@lax-wp/editor 0.3.19 → 0.3.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -205,7 +205,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
205
205
  ${a?"":"hover:border-blue-400 hover:bg-blue-100"}
206
206
  group
207
207
  ${t?a?"ring-2 ring-blue-500":"border-blue-500 bg-blue-100":""}
208
- `,style:{minWidth:a?`${u.width}px`:"140px",minHeight:a?`${u.height}px`:"30px",width:a?`${u.width}px`:"auto",height:a?`${u.height}px`:"auto"},onClick:m,id:e,children:[f.jsx("input",{ref:c,type:"file",accept:"image/*",className:"hidden",onChange:_}),r&&f.jsx("button",{className:"absolute -top-2 -right-2 w-5 h-5 bg-red-500 text-white rounded-full flex items-center justify-center text-xs opacity-0 group-hover:opacity-100 transition-opacity duration-200 hover:bg-red-600 z-10",onClick:b=>{b.stopPropagation(),r()},title:"Delete signature",children:"×"}),a&&o&&f.jsxs(f.Fragment,{children:[g("nw"),g("ne"),g("sw"),g("se")]}),a?f.jsx("img",{src:a,alt:"Signature",className:"w-full h-full object-contain block",style:{pointerEvents:"none"}}):f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"text-blue-600",children:f.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("path",{d:"M12 16L16 12H13V4H11V12H8L12 16Z",fill:"currentColor"}),f.jsx("path",{d:"M20 18H4V20H20V18Z",fill:"currentColor"})]})}),f.jsx("span",{className:"text-gray-600 font-medium text-sm select-none",children:"Signature"})]})]})},MB=({node:e,selected:t,deleteNode:n,updateAttributes:r,editor:i})=>{const[o,a]=A.useState(!1),s=e.attrs.redlineType==="user-deletion"||e.attrs.redlineType==="ai-deletion",l=m=>{a(!0);const _=new Image;_.src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=",m.dataTransfer.setDragImage(_,0,0)},c=()=>{a(!1)},d=()=>{i&&e.attrs.id?i.commands.deleteSignature(e.attrs.id):n()},u=m=>{const _=new FileReader;_.onload=h=>{const g=h.target?.result,b=new Image;b.onload=()=>{let{naturalWidth:E,naturalHeight:S}=b;const y=300;if(E>y){const T=S/E;E=y,S=y*T}i&&e.attrs.id&&i.commands.updateSignature(e.attrs.id,{signatureUrl:g,fileName:m.name,width:Math.round(E),height:Math.round(S)})},b.onerror=()=>{},b.src=g},_.onerror=()=>{},_.readAsDataURL(m)},p=m=>{r&&r({width:m.width,height:m.height})};return f.jsxs(f.Fragment,{children:[f.jsx(DB,{isVisible:o}),f.jsx(Tp,{className:"signature-node-wrapper",as:"span",draggable:"true","data-drag-handle":"","data-redline-type":e.attrs.redlineType||void 0,"data-redline-user-id":e.attrs.redlineUserId||void 0,"data-redline-user-name":e.attrs.redlineUserName||void 0,"data-redline-timestamp":e.attrs.redlineTimestamp||void 0,"data-signature-action":e.attrs.redlineAction||void 0,onDragStart:l,onDragEnd:c,children:f.jsx("div",{className:s?'relative inline-flex rounded-lg overflow-hidden opacity-80 before:absolute before:inset-0 before:bg-red-500/10 before:border-2 before:border-red-500 before:rounded-lg before:pointer-events-none after:absolute after:top-1 after:right-1 after:px-1.5 after:py-0.5 after:text-[10px] after:font-semibold after:uppercase after:tracking-wide after:text-white after:bg-red-500 after:rounded after:content-["Deleted"] after:pointer-events-none':"relative inline-flex",children:f.jsx(wB,{id:e.attrs.id,selected:t,signatureUrl:e.attrs.signatureUrl,width:e.attrs.width,height:e.attrs.height,onSelect:()=>{},onDelete:d,onUpload:u,onResize:p})})})]})},DB=({isVisible:e})=>e?Ri.createPortal(f.jsx("div",{className:"signature-drag-preview absolute -top-[1000px] -left-[1000px] inline-flex items-center justify-center gap-2 px-2 py-1 mx-1 my-1 bg-blue-50 border-2 border-dashed border-blue-300 rounded-lg min-w-[140px] min-h-[30px] pointer-events-none opacity-80 z-[1000]",children:f.jsx("span",{className:"text-gray-600 font-medium text-sm select-none",children:"Signature"})}),document.body):null,LB=bt.create({name:"signature",group:"inline",draggable:!0,atom:!0,inline:!0,addOptions(){return{HTMLAttributes:{}}},addAttributes(){return{id:{default:null,parseHTML:e=>e.getAttribute("id"),renderHTML:e=>e.id?{id:e.id}:{}},recipientEmail:{default:"",parseHTML:e=>e.getAttribute("data-recipient-email"),renderHTML:e=>e.recipientEmail?{"data-recipient-email":e.recipientEmail}:{}},signatureUrl:{default:null,parseHTML:e=>e.getAttribute("data-signature-url"),renderHTML:e=>e.signatureUrl?{"data-signature-url":e.signatureUrl}:{}},fileName:{default:null,parseHTML:e=>e.getAttribute("data-file-name"),renderHTML:e=>e.fileName?{"data-file-name":e.fileName}:{}},width:{default:140,parseHTML:e=>{const t=e.getAttribute("data-width");return t?Number(t):140},renderHTML:e=>e.width?{"data-width":String(e.width)}:{}},height:{default:60,parseHTML:e=>{const t=e.getAttribute("data-height");return t?Number(t):60},renderHTML:e=>e.height?{"data-height":String(e.height)}:{}},fontSize:{default:"1px",parseHTML:e=>e.style.fontSize,renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize};`}:{}},redlineType:{default:null,parseHTML:e=>e.getAttribute(xe),renderHTML:e=>e.redlineType?{[xe]:e.redlineType}:{}},redlineUserId:{default:null,parseHTML:e=>e.getAttribute(je),renderHTML:e=>e.redlineUserId?{[je]:e.redlineUserId}:{}},redlineUserName:{default:null,parseHTML:e=>e.getAttribute(Ke),renderHTML:e=>e.redlineUserName?{[Ke]:e.redlineUserName}:{}},redlineTimestamp:{default:null,parseHTML:e=>e.getAttribute(Qe),renderHTML:e=>e.redlineTimestamp?{[Qe]:e.redlineTimestamp}:{}},redlineAction:{default:null,parseHTML:e=>e.getAttribute("data-signature-action"),renderHTML:e=>e.redlineAction?{"data-signature-action":e.redlineAction}:{}},redlinePreviousAttrs:{default:null,parseHTML:e=>e.getAttribute("data-signature-previous-attrs"),renderHTML:e=>e.redlinePreviousAttrs?{"data-signature-previous-attrs":e.redlinePreviousAttrs}:{}}}},parseHTML(){return[{tag:'span[id^="anchor_s"]'}]},renderHTML({HTMLAttributes:e}){const n=`\\s${e.id?e.id.replace("anchor_s",""):""}\\`;return["span",Pe(this.options.HTMLAttributes,e),n]},addNodeView(){return yp(MB)},addKeyboardShortcuts(){const e=t=>{const{selection:n}=this.editor.state;let r;if(n instanceof ge&&n.node.type.name===this.name)r=n.node.attrs.id;else if(n.empty){const i=t==="backward"?n.$from.nodeBefore:n.$from.nodeAfter;i?.type.name===this.name&&(r=i.attrs.id)}return r?this.editor.commands.deleteSignature(r):!1};return{Backspace:()=>e("backward"),Delete:()=>e("forward")}},addCommands(){return{addSignature:e=>({commands:t,state:n,editor:r})=>{let i=0;const{doc:o}=n;o.descendants(u=>(u.type.name===this.name&&i++,!0));const a=e?.id||`anchor_s${i+1}`,s=r.storage?.redline,c=r.extensionManager.extensions.find(u=>u.name==="redline")?.options?.currentEntity||{id:"unknown",name:"User"},d=s?.isActive?s.mode==="ai"?bn:gn:null;return t.insertContent({type:this.name,attrs:{...e,id:a,...d?{redlineType:d,redlineUserId:c.id,redlineUserName:c.name,redlineTimestamp:new Date().toISOString(),redlineAction:"add"}:{}}})},updateSignature:(e,t)=>({tr:n,state:r,dispatch:i,editor:o})=>{const{doc:a}=r;let s=!1;const l=o.storage?.redline,d=o.extensionManager.extensions.find(p=>p.name==="redline")?.options?.currentEntity||{id:"unknown",name:"User"},u=l?.isActive?l.mode==="ai"?bn:gn:null;return a.descendants((p,m)=>{if(p.type.name===this.name&&p.attrs.id===e){const _={...p.attrs,...t};return u?n.setNodeMarkup(m,void 0,{..._,redlineType:u,redlineUserId:d.id,redlineUserName:d.name,redlineTimestamp:p.attrs.redlineTimestamp||new Date().toISOString(),redlineAction:"update",redlinePreviousAttrs:JSON.stringify({signatureUrl:p.attrs.signatureUrl??null,fileName:p.attrs.fileName??null,recipientEmail:p.attrs.recipientEmail??"",width:p.attrs.width??140,height:p.attrs.height??60})}):n.setNodeMarkup(m,void 0,_),s=!0,!1}return!0}),s&&i&&i(n),s},renumberSignatures:()=>({tr:e,state:t,dispatch:n})=>{const{doc:r}=t,i=[];r.descendants((a,s)=>(a.type.name===this.name&&i.push({node:a,pos:s}),!0)),i.sort((a,s)=>a.pos-s.pos);let o=!1;return i.forEach(({node:a,pos:s},l)=>{const c=`anchor_s${l+1}`;a.attrs.id!==c&&(e.setNodeMarkup(s,void 0,{...a.attrs,id:c}),o=!0)}),o&&n&&n(e),o},deleteSignature:e=>({tr:t,state:n,dispatch:r,editor:i})=>{const{doc:o}=n;let a=-1,s=0,l=null;const c=i.storage?.redline,u=i.extensionManager.extensions.find(m=>m.name==="redline")?.options?.currentEntity||{id:"unknown",name:"User"},p=c?.isActive?c.mode==="ai"?wo:ko:null;if(o.descendants((m,_)=>m.type.name===this.name&&m.attrs.id===e?(a=_,s=m.nodeSize,l=m,!1):!0),a>=0){const m=l,_=m?.attrs;p&&m?_?.redlineType===gn||_?.redlineType===bn?t.delete(a,a+s):t.setNodeMarkup(a,void 0,{..._,redlineType:p,redlineUserId:u.id,redlineUserName:u.name,redlineTimestamp:new Date().toISOString(),redlineAction:"delete",redlinePreviousAttrs:JSON.stringify({signatureUrl:_?.signatureUrl??null,fileName:_?.fileName??null,recipientEmail:_?.recipientEmail??"",width:_?.width??140,height:_?.height??60})}):t.delete(a,a+s);const h=[];return t.doc.descendants((b,E)=>(b.type.name===this.name&&h.push({node:b,pos:E}),!0)),h.sort((b,E)=>b.pos-E.pos),h.forEach(({node:b,pos:E},S)=>{const y=`anchor_s${S+1}`;b.attrs.id!==y&&t.setNodeMarkup(E,void 0,{...b.attrs,id:y})}),r&&r(t),!0}return!1}}}}),PB=Re.create({name:"dragDrop",addProseMirrorPlugins(){const{editor:e}=this;return[new Ie({key:new Fe("dragDrop"),props:{handleDOMEvents:{drop:(t,n)=>{n.preventDefault();const r=n.dataTransfer?.getData("elementType");if(!r)return!1;const i=t.posAtCoords({left:n.clientX,top:n.clientY});if(!i)return!1;const{state:o,dispatch:a}=t,{tr:s}=o;switch(r){case"image":{console.log("Insert image at position:",i.pos),window.dispatchEvent(new CustomEvent("insertElement",{detail:{type:"image",pos:i.pos}}));break}case"signature":{e.chain().focus().setTextSelection(i.pos).addSignature().run();break}case"codeBlock":{const l=s.doc.resolve(i.pos);s.setSelection(ue.near(l));const c=o.schema.nodes.codeBlock?.create();c&&s.replaceSelectionWith(c),a(s),t.focus();break}case"divider":{const l=s.doc.resolve(i.pos);s.setSelection(ue.near(l)),s.replaceSelectionWith(o.schema.nodes.horizontalRule.create()),a(s),t.focus();break}case"page-break":{const l=s.doc.resolve(i.pos);s.setSelection(ue.near(l));const c=o.schema.nodes.pageBreak?.create();c&&s.replaceSelectionWith(c),a(s),t.focus();break}default:return!1}return!0},dragover:(t,n)=>(n.preventDefault(),!1)}}})]}}),Td={person:{bg:"#DBEAFE",color:"#1D4ED8",darkBg:"rgba(59,130,246,0.22)",darkColor:"#93C5FD"},organization:{bg:"#F3E8FF",color:"#7C3AED",darkBg:"rgba(168,85,247,0.22)",darkColor:"#C4B5FD"},email:{bg:"#FEF3C7",color:"#B45309",darkBg:"rgba(245,158,11,0.22)",darkColor:"#FCD34D"},phone:{bg:"#D1FAE5",color:"#047857",darkBg:"rgba(34,197,94,0.22)",darkColor:"#6EE7B7"},location:{bg:"#FFEDD5",color:"#C2410C",darkBg:"rgba(249,115,22,0.22)",darkColor:"#FDBA74"},date:{bg:"#EDE9FE",color:"#6D28D9",darkBg:"rgba(139,92,246,0.22)",darkColor:"#C4B5FD"},time:{bg:"#E0F2FE",color:"#0369A1",darkBg:"rgba(14,165,233,0.22)",darkColor:"#7DD3FC"},money:{bg:"#D1FAE5",color:"#065F46",darkBg:"rgba(16,185,129,0.22)",darkColor:"#6EE7B7"},url:{bg:"#CCFBF1",color:"#0F766E",darkBg:"rgba(20,184,166,0.22)",darkColor:"#5EEAD4"}},BB={bg:"#FFF3E0",color:"#E65100"};function YT(e){try{const o=(((JSON.parse(e)[0]?.anonymizedVariable??"").split("_")[0]?.trim()??"").split(/\s+/)[0]??"").toLowerCase();return Td[o]?o:o==="ssn"?"SSN":o==="gpe"?"GPE":o}catch{return""}}function $T(e,t,n){const r=n?.placeholderFormat??"numbered",i=n?.highlightChanges??!1;if(r==="redacted"){e.style.display="inline-block",e.style.padding="1px 2px",e.style.margin="0 1px",e.style.fontSize="0.92em",e.style.fontWeight="500",e.style.whiteSpace="nowrap";const s=getComputedStyle(e.parentElement??e).color||"#000";e.style.backgroundColor=s,e.style.color="transparent";return}const o=YT(t),a=Td[o]??BB;i?(e.style.display="inline-block",e.style.padding="1px 5px",e.style.margin="0 1px",e.style.borderRadius="4px",e.style.fontSize="0.92em",e.style.fontWeight="500",e.style.whiteSpace="nowrap",e.style.backgroundColor=a.bg,e.style.color=a.color):(WT(e),e.style.color=a.color)}function WT(e){e.style.display="",e.style.padding="",e.style.margin="",e.style.borderRadius="",e.style.fontSize="",e.style.fontWeight="",e.style.whiteSpace="",e.style.backgroundColor="",e.style.color=""}const FB=bt.create({name:"anonymizedText",group:"inline",inline:!0,atom:!0,selectable:!0,draggable:!1,addOptions(){return{showTooltip:!0,placeholderFormat:"numbered",highlightChanges:!1,isAnonymized:!1}},addAttributes(){return{placeholder:{default:"",parseHTML:e=>e.getAttribute("data-anon-placeholder")??"",renderHTML:e=>({"data-anon-placeholder":e.placeholder})},anonymizedData:{default:"[]",parseHTML:e=>e.getAttribute("data-anon-data")??"[]",renderHTML:e=>({"data-anon-data":e.anonymizedData})},showValue:{default:!1,parseHTML:e=>e.getAttribute("data-anon-show-value")==="true",renderHTML:e=>({"data-anon-show-value":String(!!e.showValue)})}}},parseHTML(){return[{tag:"span[data-anon-placeholder]"}]},renderHTML({node:e}){const{placeholder:t,anonymizedData:n}=e.attrs;return["span",{"data-anon-placeholder":t,"data-anon-data":n,class:"anonymized-text",contenteditable:"false"},t]},addNodeView(){const e={placeholderFormat:this.options.placeholderFormat,highlightChanges:this.options.highlightChanges},t=this.options.isAnonymized;return({node:n})=>{const{placeholder:r,anonymizedData:i,showValue:o}=n.attrs,a=document.createElement("span");a.className="anonymized-text",a.contentEditable="false",a.setAttribute("data-anon-placeholder",r),a.setAttribute("data-anon-data",i),a.setAttribute("data-anon-show-value",String(!!o));let s=r;try{const c=JSON.parse(i)[0]?.value??"";o&&c&&(s=c),c&&(a.title=o?`Placeholder: ${r}`:`Original: ${c}`)}catch{}return a.textContent=s,t&&!o&&$T(a,i,e),{dom:a,update(l){if(l.type.name!=="anonymizedText")return!1;const{placeholder:c,anonymizedData:d,showValue:u}=l.attrs;a.setAttribute("data-anon-placeholder",c),a.setAttribute("data-anon-data",d),a.setAttribute("data-anon-show-value",String(!!u));let p=c;try{const _=JSON.parse(d)[0]?.value??"";u&&_&&(p=_),a.title=u?c?`Placeholder: ${c}`:"":_?`Original: ${_}`:""}catch{}return a.textContent=p,u?WT(a):$T(a,d,e),!0}}}}});function uf(e){if(Array.isArray(e))return e;if(typeof e=="string"&&e.trim())try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}return[]}const UB=hn.create({name:"anonymizedLink",inclusive:!1,exitable:!0,spanning:!0,keepOnSplit:!1,addOptions(){return{HTMLAttributes:{},openOnClick:!1}},addAttributes(){return{href:{default:null,parseHTML:e=>e.getAttribute("href")??e.getAttribute("data-anon-href"),renderHTML:e=>{const n=uf(e.anonymizedData)[0]?.value??e.href??null;return n?e.showValue?{href:n}:{"data-anon-href":n}:{}}},target:{default:"_blank",parseHTML:e=>e.getAttribute("target"),renderHTML:e=>e.target?{target:e.target}:{}},rel:{default:"noopener noreferrer nofollow",parseHTML:e=>e.getAttribute("rel"),renderHTML:e=>e.rel?{rel:e.rel}:{}},class:{default:null,parseHTML:e=>e.getAttribute("class"),renderHTML:e=>e.class?{class:e.class}:{}},anonymizedData:{default:[],parseHTML:e=>uf(e.getAttribute("data-anon-data")),renderHTML:e=>{const t=uf(e.anonymizedData);return{"data-anon-data":JSON.stringify(t)}}},showValue:{default:!1,parseHTML:e=>e.getAttribute("data-anon-show-value")==="true",renderHTML:e=>({"data-anon-show-value":String(!!e.showValue)})}}},parseHTML(){return[{tag:"a[data-anon-link]",getAttrs:e=>typeof e=="string"?!1:e.hasAttribute("data-anon-link")?null:!1},{tag:"a[data-anon-data]",getAttrs:e=>typeof e=="string"?!1:e.hasAttribute("data-anon-data")?null:!1}]},renderHTML({HTMLAttributes:e}){return["a",Pe(this.options.HTMLAttributes,e,{"data-anon-link":"true"}),0]},addCommands(){return{setAnonymizedLink:e=>({chain:t})=>t().setMark(this.name,e).run(),unsetAnonymizedLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).run()}}}),qT=["#958DF1","#F98181","#70CFF8","#B9F18D","#FBBC88","#AC73E5","#94FADB","#E84E8C","#FF9D66","#5B8DEF","#42E695","#FAF594","#C084FC","#2DD4BF","#F472B6","#FFB84D","#A78BFA","#34D399","#FBBF24","#60A5FA","#FCA5A5","#818CF8"];function As(e){return(e.id?.trim()||e.email?.trim()||e.name?.trim()||"").toLowerCase()||"__anonymous__"}function zB(e){const t=new Map;for(const n of e){const r=As(n);t.has(r)||t.set(r,n)}return[...t.values()]}function HB(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return Math.abs(t)%qT.length}function GB(e,t){const n=qT,r=As(e);if(t&&t.length>0){const o=zB([...t,e]).sort((s,l)=>As(s).localeCompare(As(l))).findIndex(s=>As(s)===r);return n[(o===-1?0:o)%n.length]}return n[HB(r)]}const VB=e=>[Gk,Yk,_B,...Qb(e)?[]:[MO],ew,nw,Ew.configure({maxDepth:9}),DO,kO.configure({placeholder:"Write something …"}),zk.configure({oneHalf:!1,oneQuarter:!1,threeQuarters:!1}),YE,jE,qE,pw,Cw,Tw,WE,$E,KE.configure({types:["textStyle"]}),Rw.configure({multicolor:!0}),ow,dw.configure({nested:!0}),mw.configure({types:["paragraph","heading","blockquote"],minLevel:0,maxLevel:12}),uw.configure({minWordsToTriggerAutoCompletion:e?.aiAutocompletion?.minWordsToTriggerAutoCompletion||Ub,debounceTime:e?.aiAutocompletion?.debounceTime||Fb,isEnabled:!!(e?.aiAutocompletion?.enabled&&e?.aiAutocompletion?.fetchCompletion),fetchCompletion:e?.aiAutocompletion?.fetchCompletion}),Ow.configure({types:["heading","paragraph","blockquote","listItem"],defaultAlignment:"left"}),ww,Dw.configure({levels:[1,2,3,4,5,6]}),U2.configure({resizable:!0,allowTableNodeSelection:!0,lastColumnResizable:!0,HTMLAttributes:{class:"tiptap-table"}}),G2,H2,z2,Y2.configure({enabled:e?.enableVariableText||!1,variableValues:e?.variableValues||{}}),hM.configure({openOnClick:!1,linkOnPaste:!0,defaultProtocol:"https",protocols:["http","https"]}),UB,EM,D8,B8.configure({unit:"in",defaultMargins:{top:1,right:1,bottom:1,left:1}}),U8,z8,K8.configure({inline:!0,allowBase64:!0}),tB,sB,uB,mB,gB,wO.configure({node:"paragraph",notAfter:["paragraph"]}),IB.configure({isActive:!1,mode:"user",currentEntity:{id:e?.currentUser?.id||"unknown",name:e?.currentUser?.name||"User"}}),kB,LB,PB,FB.configure({placeholderFormat:e?.piiAnonymization?.settings?.placeholderFormat??"numbered",highlightChanges:e?.piiAnonymization?.settings?.highlightChanges??!1,isAnonymized:e?.piiAnonymization?.isAnonymized??e?.piiAnonymization?.isAnalyzed??!1}),...Qb(e)?(()=>{const t=e.collaborativeEditing;return[fk.configure({document:t.ydoc}),hk.configure({provider:t.provider,user:{name:e?.currentUser?.name||"Anonymous",color:e?.currentUser?.color?.trim()||GB(e?.currentUser??{},e?.allUsers)}})]})():[]],jT=[{label:"Default",value:"#ffffff"},{label:"Eye-friendly Green",value:"#e8f5e9"},{label:"Elegant Yellow",value:"#fff8e1"},{label:"Cloudy Blue",value:"#e3f2fd"},{label:"Sky Blue",value:"#bbdefb"},{label:"Dark Night Black",value:"#616161"}],tr={top:1,right:1,bottom:1,left:1},KT={Normal:{top:1,right:1,bottom:1,left:1},Narrow:{top:.5,right:.5,bottom:.5,left:.5},Moderate:{top:1.25,right:1.25,bottom:1.25,left:1.25},Wide:{top:1.75,right:1.75,bottom:1.75,left:1.75},Mirrored:{top:1.25,right:1,bottom:1.25,left:2}},QT=0,XT=3,ZT=.25,JT=()=>{const{editor:e}=lt(),[t,n]=A.useState(jT[0].value);A.useEffect(()=>{if(!e)return;const E=document.body.getAttribute("data-page-background-color");E&&n(E)},[e]);const r=E=>{n(E),e&&e.chain().focus().setPageBackgroundColor(E).run()},[i,o]=A.useState({size:"A4",orientation:"portrait"});A.useEffect(()=>{document.body.setAttribute("data-page-orientation",i.orientation)},[i.orientation]);const a=E=>{const{size:S,orientation:y}=E,T=`page-${S.toLowerCase()}`;return y==="landscape"?`${T}-landscape`:T},s=()=>{e.chain().focus().setPageBreak().run()},[l,c]=A.useState(tr),[d,u]=A.useState({top:"1",right:"1",bottom:"1",left:"1"});A.useEffect(()=>{const S=(()=>{if(e&&e.getAttributes)try{const T=e.getAttributes("pageMargin");if(T&&Object.keys(T).length>0)return{top:T.top??tr.top,right:T.right??tr.right,bottom:T.bottom??tr.bottom,left:T.left??tr.left}}catch(T){console.error("Error getting margins from editor:",T)}const y=document.body.getAttribute("data-page-margins");if(y)try{return JSON.parse(y)}catch(T){console.error("Error parsing page margins data attribute:",T)}return tr})();c(S),u({top:S.top.toString(),right:S.right.toString(),bottom:S.bottom.toString(),left:S.left.toString()})},[e]);const p=(E,S)=>{if(u(x=>({...x,[E]:S})),S==="")return;const y=Number(S);if(isNaN(y))return;const T=Math.min(Math.max(QT,y),XT);c(x=>({...x,[E]:T}))},m=E=>{const S=d[E];(S===""||isNaN(Number(S)))&&(u(T=>({...T,[E]:"0"})),c(T=>({...T,[E]:0})))},_=(E,S)=>{if(E.key==="ArrowUp"||E.key==="ArrowDown"){E.preventDefault();const y=l[S];let T;E.key==="ArrowUp"?T=Math.min(y+ZT,XT):T=Math.max(y-ZT,QT),c(x=>({...x,[S]:T})),u(x=>({...x,[S]:T.toString()}))}},h=E=>{const S=KT[E];c({...S}),u({top:S.top.toString(),right:S.right.toString(),bottom:S.bottom.toString(),left:S.left.toString()}),e&&e.commands.setPresetMargins&&e.commands.setPresetMargins(E)},g=E=>{c({...tr}),u({top:tr.top.toString(),right:tr.right.toString(),bottom:tr.bottom.toString(),left:tr.left.toString()}),E("portrait"),e&&e.commands.resetPageMargins&&e.commands.resetPageMargins()},b=E=>{e&&e.commands.setPageMargins&&e.commands.setPageMargins({top:l.top,right:l.right,bottom:l.bottom,left:l.left}),E?.()};return{pageClass:a(i),selectedBGColor:t,handleSetPageBackgroundColor:r,pageConfig:i,setPageConfig:o,handleInsertPageBreak:s,margins:l,inputValues:d,handleMarginInputChange:p,handleMarginInputBlur:m,handleMarginKeyDown:_,applyPresetMargins:h,resetMarginsToDefault:g,applyMargins:b}},YB=(e,t)=>{const[n,r]=A.useState(!1),[i,o]=A.useState(!1),a=()=>{r(!0),e?.setEditable(!1),(t?.current||document.documentElement).requestFullscreen?.()},s=A.useCallback(()=>{r(!1),o(!1),(t?.current||document.documentElement).classList.remove("laser-active"),e?.setEditable(!0),document.fullscreenElement&&document.exitFullscreen?.()},[e,t]),l=d=>{o(d);const u=t?.current||document.documentElement;d?u.classList.add("laser-active"):u.classList.remove("laser-active")},c=()=>{n?s():a()};return A.useEffect(()=>{const d="fullscreenchange",u=()=>{!document.fullscreenElement&&n&&s()};return document.addEventListener(d,u),()=>{document.removeEventListener(d,u)}},[n,e,s]),{isPresentationMode:n,isLaserActive:i,onPresentationModeToggle:c,handleLaserToggle:l}},e1=()=>{const[e,t]=A.useState(()=>document.documentElement.classList.contains("dark"));return A.useEffect(()=>{const n=()=>{t(document.documentElement.classList.contains("dark"))},r=new MutationObserver(i=>{i.forEach(o=>{o.attributeName==="class"&&n()})});return r.observe(document.documentElement,{attributes:!0}),()=>r.disconnect()},[]),e},t1=A.createContext(void 0),yd=()=>{const e=A.useContext(t1),t=e1();return e||{config:{},isDarkMode:t}},$B=({onSelect:e,withHeaderRow:t=!0,onHeaderRowChange:n})=>{const[r,i]=A.useState({rows:0,cols:0}),[o,a]=A.useState(8),[s,l]=A.useState(8),c=A.useRef(null),d=A.useRef(0),u=A.useRef(null),p=8,m=10,_=20,h=3,g=80;A.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]);const b=(v,C)=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{v>=o-1&&o<_&&a(O=>Math.min(O+1,_)),C>=s-1&&s<_&&l(O=>Math.min(O+1,_)),v<o-h&&o>p&&a(()=>Math.max(v+h,p)),C<s-h&&s>m&&l(()=>Math.max(C+h,m)),u.current=null},g)},E=(v,C)=>{const O=Date.now(),w=v+1,z=C+1;i({rows:w,cols:z}),!(O-d.current<g)&&(d.current=O,b(w,z))},S=()=>{i({rows:0,cols:0})},y=()=>{e(r.rows,r.cols),x()},T=v=>{n&&n(v.target.checked)},x=()=>{u.current&&(clearTimeout(u.current),u.current=null),a(p),l(m),i({rows:0,cols:0}),d.current=0};return f.jsxs("div",{className:"relative p-2",id:"editor-dropdown-content",children:[f.jsx("div",{ref:c,className:"grid gap-[2px]",style:{gridTemplateColumns:`repeat(${s}, 1fr)`,overflowY:o>p?"auto":"visible",transition:"all 0.15s cubic-bezier(0.4, 0, 0.2, 1)"},onMouseLeave:S,children:Array.from({length:o}).map((v,C)=>f.jsx(A.Fragment,{children:Array.from({length:s}).map((O,w)=>f.jsx("div",{className:`w-4 h-4 border cursor-pointer transition-colors duration-50 ${C<r.rows&&w<r.cols?"bg-primary-100 dark:bg-primary-900 border-primary-300":"bg-gray-50 dark:bg-black-700 border-gray-300 dark:border-black-500"}`,onMouseEnter:()=>E(C,w),onClick:y},`${C}-${w}`))},C))}),f.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-700 dark:text-black-200 font-medium mt-1",children:[f.jsxs("div",{children:[r.rows,"×",r.cols]}),f.jsx("div",{children:"Click to insert table"})]}),f.jsx("div",{className:"my-2 mb-1",children:f.jsx(Oe.Checkbox,{id:"table-header-row",checked:t,onChange:T,children:f.jsx(G.Typography,{variant:"regular",appearance:"title",children:"Include header row"})})})]})},Si=()=>f.jsx("div",{className:"h-6 w-0.5 bg-neutral-300 dark:bg-black-500"}),Dn=()=>{const{editor:e}=lt();return Ab({editor:e,selector:n=>n.editor?{canUndo:n.editor.can().chain().undo().run()??!1,canRedo:n.editor.can().chain().redo().run()??!1,isBold:n.editor.isActive("bold")??!1,canBold:n.editor.can().chain().toggleBold().run()??!1,isItalic:n.editor.isActive("italic")??!1,canItalic:n.editor.can().chain().toggleItalic().run()??!1,isStrike:n.editor.isActive("strike")??!1,canStrike:n.editor.can().chain().toggleStrike().run()??!1,isUnderline:n.editor.isActive("underline")??!1,canUnderline:n.editor.can().chain().toggleUnderline().run()??!1,isSuperscript:n.editor.isActive("superscript")??!1,canSuperscript:n.editor.can().chain().toggleSuperscript().run()??!1,isSubscript:n.editor.isActive("subscript")??!1,canSubscript:n.editor.can().chain().toggleSubscript().run()??!1,selectionColor:n.editor.getAttributes("textStyle")?.color??"#000000",selectionBackgroundColor:n.editor.getAttributes("textStyle")?.backgroundColor??"#FFFFFF",highlightColor:ip(n.editor.state,"highlight")?.color??"#FFFFFF",fontSize:parseInt(n.editor.getAttributes("textStyle")?.fontSize?.replace(/px|pt/,"")??"12",10),fontFamily:n.editor.getAttributes("textStyle")?.fontFamily??"Arial, sans-serif",characterCount:n.editor.storage.characterCount?.characters?.()??0,wordCount:n.editor.storage.characterCount?.words?.()??0,isAIAutocompletionEnabled:n.editor.storage.aiAutoCompletion.isEnabled??!1,isTaskList:n.editor.isActive("taskList")??!1,canIndent:n.editor.can().sinkListItem("taskItem")||n.editor.can().sinkListItem("listItem")||n.editor.can().indent(),canOutdent:n.editor.can().liftListItem("taskItem")||n.editor.can().liftListItem("listItem")||n.editor.can().outdent(),isOrderedList:n.editor.isActive("orderedList")??!1,currentOrderedListType:n.editor.getAttributes("orderedList")?.listType??"decimal",isUnorderedList:n.editor.isActive("bulletList")??!1,currentUnorderedListType:n.editor.getAttributes("bulletList")?.listType??"default",isTextAlignJustify:n.editor.isActive({textAlign:"justify"})??!1,isTextAlignCenter:n.editor.isActive({textAlign:"center"})??!1,isTextAlignRight:n.editor.isActive({textAlign:"right"})??!1,isTextAlignLeft:n.editor.isActive({textAlign:"left"})??!1,lineHeight:n.editor.getAttributes("textStyle")?.lineHeight??"",isBlockquote:n.editor.isActive("blockquote")??!1,canBlockquote:n.editor.can().chain().toggleBlockquote().run()??!1,selectionHeadingLevel:n.editor.getAttributes("heading")?.level??"paragraph",isTableActive:n.editor.isActive("table")??!1,isLinkActive:n.editor.isActive("link")??!1,isInsideColumn:(()=>{const{$from:r}=n.editor.state.selection;for(let i=r.depth;i>0;i--)if(r.node(i).type.name==="pageColumnWrapper")return!0;return!1})(),columnShowDividers:(()=>{const{$from:r}=n.editor.state.selection;for(let i=r.depth;i>0;i--){const o=r.node(i);if(o.type.name==="pageColumnWrapper")return o.attrs.showDividers!==!1}return!0})(),canSplitCell:n.editor.can().chain().splitCell().run()??!1,canMergeCells:n.editor.can().chain().mergeCells().run()??!1}:{canUndo:!1,canRedo:!1,isBold:!1,canBold:!1,isItalic:!1,canItalic:!1,isStrike:!1,canStrike:!1,isUnderline:!1,canUnderline:!1,isSuperscript:!1,canSuperscript:!1,isSubscript:!1,canSubscript:!1,selectionColor:"#000000",selectionBackgroundColor:"#FFFFFF",highlightColor:"#FFFFFF",fontSize:12,fontFamily:"Arial, sans-serif",characterCount:0,wordCount:0,isAIAutocompletionEnabled:!1,isTaskList:!1,canIndent:!1,canOutdent:!1,isOrderedList:!1,currentOrderedListType:"decimal",isUnorderedList:!1,currentUnorderedListType:"default",isTextAlignJustify:!1,isTextAlignCenter:!1,isTextAlignRight:!1,isTextAlignLeft:!1,lineHeight:"",isBlockquote:!1,canBlockquote:!1,selectionHeadingLevel:"paragraph",isTableActive:!1,isLinkActive:!1,isInsideColumn:!1,columnShowDividers:!0,canSplitCell:!1,canMergeCells:!1}})},pf="data-redline-row-action",mf="data-redline-column-action",ff="data-redline-column-id",n1=e=>!!(e&&e.type.name==="table"&&(e.attrs["data-redline-type"]==="user-insertion"||e.attrs["data-redline-type"]==="ai-insertion")),r1=()=>{const{editor:e}=lt(),t=()=>{if(!e)return null;const{$from:v}=e.state.selection;for(let C=v.depth;C>0;C--){const O=v.node(C);if(O.type.name==="table")return{depth:C,node:O,pos:v.before(C)}}return null},n=()=>{if(!e)return null;const{$from:v}=e.state.selection;for(let C=v.depth;C>0;C--){const O=v.node(C);if(O.type.name==="tableRow")return{depth:C,node:O,pos:v.before(C)}}return null},r=()=>{if(!e)return null;const{$from:v}=e.state.selection;for(let C=v.depth;C>0;C--){const O=v.node(C);if(O.type.name==="tableCell"||O.type.name==="tableHeader")return{depth:C,node:O,pos:v.before(C),colIndex:v.index(C-1)}}return null},i=v=>{if(!e)return;const C=e.storage?.redline;if(!C?.isActive)return;const O=e.state.doc.nodeAt(v);if(!O||O.type.name!=="tableRow")return;const w=e.state.doc.resolve(v);let z=null;for(let M=w.depth;M>0;M--){const B=w.node(M);if(B.type.name==="table"){z=B;break}}if(n1(z))return;const P=e.extensionManager.extensions.find(M=>M.name==="redline")?.options?.currentEntity||{id:"unknown",name:"User"},I=C.mode==="ai"?"ai-insertion":"user-insertion",R=O.attrs["data-row-id"]||`blank-row-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,k=e.state.tr.setNodeMarkup(v,void 0,{...O.attrs,"data-row-id":R,"data-redline-type":I,"data-redline-user-id":P.id,"data-redline-user-name":P.name,"data-redline-timestamp":new Date().toISOString(),[pf]:"add"});e.view.dispatch(k)},o=v=>{if(!e)return;const C=e.storage?.redline;if(!C?.isActive)return;const O=e.state.doc.nodeAt(v);if(!O||O.type.name!=="table")return;const z=e.extensionManager.extensions.find(I=>I.name==="redline")?.options?.currentEntity||{id:"unknown",name:"User"},N=C.mode==="ai"?"ai-insertion":"user-insertion",P=e.state.tr.setNodeMarkup(v,void 0,{...O.attrs,"data-redline-type":N,"data-redline-user-id":z.id,"data-redline-user-name":z.name,"data-redline-timestamp":new Date().toISOString()});e.view.dispatch(P)},a=v=>{if(!e)return;const C=e.state.doc.nodeAt(v);if(!C||C.type.name!=="tableRow")return;const O=e.storage?.redline;if(!O?.isActive){e.chain().focus().deleteRow().run();return}const w=C.attrs[pf],z=C.attrs["data-redline-type"];if(w==="add"&&(z==="user-insertion"||z==="ai-insertion")){e.chain().focus().deleteRow().run();return}const I=e.extensionManager.extensions.find(B=>B.name==="redline")?.options?.currentEntity||{id:"unknown",name:"User"},R=O.mode==="ai"?"ai-deletion":"user-deletion",k=C.attrs["data-row-id"]||`row-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,M=e.state.tr.setNodeMarkup(v,void 0,{...C.attrs,"data-row-id":k,"data-redline-type":R,"data-redline-user-id":I.id,"data-redline-user-name":I.name,"data-redline-timestamp":new Date().toISOString(),[pf]:"delete"});e.view.dispatch(M)},s=(v,C)=>{if(!e)return;const O=e.storage?.redline;if(!O?.isActive)return;const w=e.state.doc.nodeAt(v);if(!w||w.type.name!=="table"||n1(w))return;const N=e.extensionManager.extensions.find(B=>B.name==="redline")?.options?.currentEntity||{id:"unknown",name:"User"},P=O.mode==="ai"?"ai-insertion":"user-insertion",I=new Date().toISOString(),R=`column-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,k=e.state.tr;let M=1;w.forEach(B=>{if(B.type.name!=="tableRow"){M+=B.nodeSize;return}let D=null,U=0,H=1;if(B.forEach(V=>{if(D!==null){H+=V.nodeSize;return}U===C&&(D=v+M+H),U++,H+=V.nodeSize}),D!==null){const V=e.state.doc.nodeAt(D);V&&k.setNodeMarkup(D,void 0,{...V.attrs,"data-redline-type":P,"data-redline-user-id":N.id,"data-redline-user-name":N.name,"data-redline-timestamp":I,[mf]:"add",[ff]:R})}M+=B.nodeSize}),k.docChanged&&e.view.dispatch(k)},l=(v,C)=>{if(!e)return;const O=e.storage?.redline;if(!O?.isActive){e.chain().focus().deleteColumn().run();return}const w=e.state.doc.nodeAt(v);if(!w||w.type.name!=="table")return;const N=e.extensionManager.extensions.find(U=>U.name==="redline")?.options?.currentEntity||{id:"unknown",name:"User"},P=O.mode==="ai"?"ai-deletion":"user-deletion",I=new Date().toISOString(),R=e.state.tr;let k=!1,M=null,B=1;if(w.forEach(U=>{if(U.type.name!=="tableRow"){B+=U.nodeSize;return}let H=null,V=0,j=1;if(U.forEach(W=>{if(H!==null){j+=W.nodeSize;return}V===C&&(H=v+B+j),V++,j+=W.nodeSize}),H!==null){const W=e.state.doc.nodeAt(H);if(W){const oe=W.attrs[mf],Z=W.attrs["data-redline-type"];oe==="add"&&(Z==="user-insertion"||Z==="ai-insertion")&&(k=!0,M=W.attrs[ff]??M)}}B+=U.nodeSize}),k){e.chain().focus().deleteColumn().run();return}const D=M??`column-delete-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;B=1,w.forEach(U=>{if(U.type.name!=="tableRow"){B+=U.nodeSize;return}let H=null,V=0,j=1;if(U.forEach(W=>{if(H!==null){j+=W.nodeSize;return}V===C&&(H=v+B+j),V++,j+=W.nodeSize}),H!==null){const W=e.state.doc.nodeAt(H);W&&R.setNodeMarkup(H,void 0,{...W.attrs,"data-redline-type":P,"data-redline-user-id":N.id,"data-redline-user-name":N.name,"data-redline-timestamp":I,[mf]:"delete",[ff]:D})}B+=U.nodeSize}),R.docChanged&&e.view.dispatch(R)};return{handleInsertTable:(v,C,O)=>{if(!e||!e.commands.insertTable({rows:v,cols:C,withHeaderRow:O}))return;const z=t();z&&o(z.pos)},handleInsertRowAbove:()=>{if(!e)return;const v=n();if(!v){e.chain().focus().addRowBefore().run();return}e.chain().focus().addRowBefore().run()&&i(v.pos)},handleInsertRowBelow:()=>{if(!e)return;const v=n();if(!v){e.chain().focus().addRowAfter().run();return}e.chain().focus().addRowAfter().run()&&i(v.pos+v.node.nodeSize)},handleDeleteRow:()=>{if(!e)return;const v=n();if(!v){e.chain().focus().deleteRow().run();return}a(v.pos)},handleInsertColumnLeft:()=>{if(!e)return;const v=r(),C=t();!e.chain().focus().addColumnBefore().run()||!v||!C||s(C.pos,v.colIndex)},handleInsertColumnRight:()=>{if(!e)return;const v=r(),C=t();!e.chain().focus().addColumnAfter().run()||!v||!C||s(C.pos,v.colIndex+1)},handleDeleteColumn:()=>{if(!e)return;const v=r(),C=t();if(!v||!C){e.chain().focus().deleteColumn().run();return}l(C.pos,v.colIndex)},handleSetCellBackgroundColor:v=>{e&&e.chain().focus().setCellAttribute("backgroundColor",v).run()},handleClearCellBackgroundColor:()=>{e&&e.chain().focus().setCellAttribute("backgroundColor",null).run()},handleMergeCells:()=>{e&&e.chain().focus().mergeCells().run()},handleSplitCell:()=>{e&&e.chain().focus().splitCell().run()},handleDeleteTable:()=>{e&&e.chain().focus().deleteTable().run()},handleInsertTableFromData:({tableType:v,data:C,columns:O,options:w})=>{e&&e.commands.insertTableFromData({tableType:v,data:C,columns:O,options:w})},handleUpdateTableValues:v=>{e&&e.commands.updateTableValues(v)}}},i1=()=>{const{editor:e}=lt(),{isAIAutocompletionEnabled:t}=Dn();return e?{handleUndo:()=>{e.chain().focus().undo().run()},handleRedo:()=>{e.chain().focus().redo().run()},handleToggleAIAutocompletion:()=>{t?e.commands.disableAutocompletion():e.commands.enableAutocompletion()},handleClearFormatting:()=>{e.chain().focus().unsetAllMarks().run()}}:{handleUndo:()=>{},handleRedo:()=>{},handleAIAutocompletion:()=>{}}},WB=cf(f.jsx("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8"}),"Undo"),qB=cf(f.jsx("path",{d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7z"}),"Redo"),o1="!p-1.5 !max-h-none !rounded !bg-transparent hover:!bg-neutral-100 dark:hover:!bg-black-600",a1=()=>{const{canUndo:e,canRedo:t}=Dn(),{handleUndo:n,handleRedo:r}=i1();return f.jsxs(f.Fragment,{children:[f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"toolbar-undo",title:"Undo",status:"no-background",className:o1+" !border-none",onClick:n,disabled:!e,children:f.jsx(WB,{fontSize:"medium"})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"toolbar-redo",title:"Redo",status:"no-background",className:o1+" !border-none",onClick:r,disabled:!t,children:f.jsx(qB,{fontSize:"medium"})})})]})},jB=()=>{const{isTableActive:e,canSplitCell:t,canMergeCells:n}=Dn(),{handleInsertTable:r,handleInsertRowAbove:i,handleInsertRowBelow:o,handleDeleteRow:a,handleInsertColumnLeft:s,handleInsertColumnRight:l,handleDeleteColumn:c,handleMergeCells:d,handleSplitCell:u,handleDeleteTable:p}=r1(),[m,_]=A.useState(!0),[h,g]=A.useState(!1),b=E=>{g(E)};return f.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[f.jsx(a1,{}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(Si,{})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(Oe.Popover,{content:f.jsx($B,{onSelect:(E,S)=>r(E,S,m),withHeaderRow:m,onHeaderRowChange:E=>_(E)}),trigger:"click",open:h,onOpenChange:b,arrow:!1,style:{padding:"0px"},children:f.jsx(G.Button,{id:"table-insert",onClick:()=>g(!0),status:"no-background",className:"!p-1 !max-h-none !rounded border-none",title:"Insert Table",children:f.jsxs("div",{className:"flex items-center flex-row gap-1",children:[f.jsx(ie,{name:"table",size:"18px",strokeWidth:4}),f.jsx(ee.ArrowDropDownOutlined,{sx:{fontSize:"18px",color:"inherit"}})]})})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(Si,{})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"table-insert-row-above",onClick:i,disabled:!e,status:"no-background",className:"!p-1 !max-h-none !rounded border-none",title:"Insert Row Above",children:f.jsx("div",{className:"flex items-center flex-row gap-1",children:f.jsx(ie,{name:"add-row",strokeWidth:4,size:"18px"})})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"table-insert-row-below",onClick:o,disabled:!e,status:"no-background",className:"!p-1 !max-h-none !rounded border-none",title:"Insert Row Below",children:f.jsx("div",{className:"flex items-center flex-row gap-1",children:f.jsx(ie,{name:"add-row",strokeWidth:4,className:"rotate-[180deg]",size:"18px"})})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"table-delete-row",onClick:a,disabled:!e,status:"no-background",className:"!p-1 !max-h-none !rounded border-none",title:"Delete Row",children:f.jsx("div",{className:"flex items-center flex-row gap-1",children:f.jsx(ie,{name:"table-delete-row",strokeWidth:2,size:"18px"})})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"table-insert-col-left",onClick:s,disabled:!e,status:"no-background",className:"!p-1 !max-h-none !rounded border-none",title:"Insert Column Left",children:f.jsx("div",{className:"flex items-center flex-row gap-1",children:f.jsx(ie,{name:"add-row",strokeWidth:4,className:"rotate-[-90deg]",size:"18px"})})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"table-insert-col-right",onClick:l,disabled:!e,status:"no-background",className:"!p-1 !max-h-none !rounded border-none",title:"Insert Column Right",children:f.jsx("div",{className:"flex items-center flex-row gap-1",children:f.jsx(ie,{name:"add-row",strokeWidth:4,className:"rotate-[90deg]",size:"18px"})})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"table-delete-col",onClick:c,disabled:!e,status:"no-background",className:"!p-1 !max-h-none !rounded border-none",title:"Delete Column",children:f.jsx("div",{className:"flex items-center flex-row gap-1",children:f.jsx(ie,{name:"table-delete-column",strokeWidth:2,size:"18px"})})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"table-merge-cells",onClick:d,disabled:!e||!n,status:"no-background",className:"!p-1 !max-h-none !rounded border-none",title:"Merge Cells",children:f.jsx("div",{className:"flex items-center flex-row gap-1",children:f.jsx(ie,{name:"table-merge-cell",strokeWidth:4,size:"18px"})})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(Si,{})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"table-split-cell",onClick:u,disabled:!e||!t,status:"no-background",className:"!p-1 !max-h-none !rounded border-none",title:"Split Cell",children:f.jsx("div",{className:"flex items-center flex-row gap-1",children:f.jsx(ie,{name:"table-split-cell",strokeWidth:4,size:"18px"})})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(Si,{})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"table-delete",onClick:p,disabled:!e,status:"no-background",className:"!p-1 !max-h-none !rounded border-none",title:"Delete Table",children:f.jsx("div",{className:"flex items-center flex-row gap-1",children:f.jsx(ie,{name:"table-delete",size:"18px",strokeWidth:4})})})})]})},_f=({id:e,title:t,value:n,icon:r,showNone:i=!0,presetColorsPanel:o,contentWidth:a,showLabel:s=!1,onColorSelect:l,onResetColor:c})=>{const{token:d}=Oe.theme.useToken(),[u,p]=A.useState(!1),[m,_]=A.useState(n||"#FFFFFF"),h=E=>{_(E)},g=E=>{_(E),l?.(E),p(!1)},b=(E,{components:{Picker:S}})=>f.jsxs(Oe.Row,{justify:"space-between",wrap:!1,children:[o||f.jsxs(Oe.Col,{span:12,children:[f.jsxs("div",{className:"mb-2",children:[f.jsx("div",{className:"text-sm mb-1.5 dark:text-white",children:"Select Color"}),f.jsx("div",{className:"grid gap-1.5",children:qA.map((y,T)=>f.jsx("div",{className:"flex gap-1.5 justify-center",children:y.map(x=>f.jsx("button",{className:`w-4 h-4 rounded-sm hover:scale-[1.2] transition-transform ${m===x?"ring-2 ring-blue-500":""} ${x==="#FFFFFF"?"border":""}`,style:{backgroundColor:x},onClick:()=>g(x)},x))},T))})]}),f.jsxs("div",{className:"mb-2",children:[f.jsx("div",{className:"text-sm mb-1.5 dark:text-white",children:"Standard Colors"}),f.jsx("div",{className:"flex gap-1.5",children:jA.map(y=>f.jsx("button",{className:`w-3.5 h-3.5 rounded-sm hover:scale-[1.2] transition-transform ${m===y?"ring-2 ring-blue-500":""}`,style:{backgroundColor:y},onClick:()=>g(y)},y))})]}),f.jsxs("div",{className:"flex items-center justify-between gap-1",children:[i&&f.jsxs("div",{className:"flex items-center gap-0.5 text-sm cursor-pointer text-primary-400 hover:text-primary-700",onClick:()=>g("transparent"),children:[f.jsx(ee.FormatColorResetOutlined,{sx:{fontSize:"18px"}}),"None"]}),c&&f.jsx("div",{className:"text-sm cursor-pointer text-primary-400 hover:text-primary-700",onClick:()=>{c(),p(!1)},children:"Reset"})]})]}),f.jsx(Oe.Divider,{type:"vertical",style:{height:"auto"}}),f.jsx(Oe.Col,{flex:"auto",children:f.jsx(S,{})})]});return f.jsx(Oe.ColorPicker,{open:u,defaultValue:d.colorPrimary,styles:{popupOverlayInner:{width:a||420}},panelRender:b,size:"small",arrow:!1,value:m,onChangeComplete:E=>h(E.toHexString()),onOpenChange:E=>{E||(l?.(m),p(E))},placement:"bottom",children:f.jsx(G.Button,{id:e,title:t,status:"no-background",className:"!p-1.5 !px-2 !max-h-none !rounded !border-none hover:!bg-neutral-100 dark:hover:!bg-black-600",onClick:()=>p(!0),children:r?f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("div",{className:"flex flex-col items-center relative",children:[r,f.jsx("div",{className:"pb-1 w-full rounded-lg border border-gray-200 dark:border-black-400",style:{backgroundColor:n}})]}),s&&f.jsx("span",{className:"min-w-max text-xs",children:t})]}):f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"w-full h-full rounded-sm",style:{backgroundColor:n}}),s&&f.jsx("span",{className:"min-w-max text-xs",children:t})]})})})},hf=()=>{const{editor:e}=lt(),{fontSize:t,isSubscript:n,isSuperscript:r}=Dn();if(!e)return{handleFontFamilyChange:()=>{},handleFontSizeChange:()=>{},increaseFontSize:()=>{},decreaseFontSize:()=>{},handleSuperscriptToggle:()=>{},handleSubscriptToggle:()=>{},handleToggleBold:()=>{},handleToggleItalic:()=>{},handleToggleUnderline:()=>{},handleToggleStrike:()=>{},handleSetColor:T=>{},handleUnsetColor:()=>{},handleSetBackgroundColor:T=>{},handleUnsetBackgroundColor:()=>{},handleSetHighlightColor:T=>{},handleUnsetHighlightColor:()=>{},isEditable:!1};const i=T=>{e?.commands?.setFontFamily&&e.chain().focus().setFontFamily(T).run()},o=T=>{T&&e.chain().focus().setFontSize(T+"pt").setSelectedListItemMarkerFontSize(T+"pt").setSelectedTaskItemMarkerFontSize(T+"pt").run()},a=()=>{const T=t;if(T&&!isNaN(T)){const x=T+1;e.chain().focus().setFontSize(x+"pt").setSelectedListItemMarkerFontSize(x+"pt").setSelectedTaskItemMarkerFontSize(x+"pt").run()}},s=()=>{const T=t;if(T&&!isNaN(T)&&T>1){const x=T-1;e.chain().focus().setFontSize(x+"pt").setSelectedListItemMarkerFontSize(x+"pt").setSelectedTaskItemMarkerFontSize(x+"pt").run()}},l=()=>{n&&e.chain().focus().unsetSubscript().run(),e.chain().focus().toggleSuperscript().run()},c=()=>{r&&e.chain().focus().unsetSuperscript().run(),e.chain().focus().toggleSubscript().run()},d=()=>{e.chain().focus().toggleBold().run()},u=()=>{e.chain().focus().toggleItalic().run()},p=()=>{e.chain().focus().toggleUnderline().run()},m=()=>{e.chain().focus().toggleStrike().run()},_=T=>{e.chain().focus().setColor(T).setSelectedListItemMarkerColor(T).setSelectedTaskItemMarkerColor(T).run()},h=()=>{e.chain().focus().unsetColor().setSelectedListItemMarkerColor(null).setSelectedTaskItemMarkerColor(null).run()},g=T=>{e.chain().focus().setBackgroundColor(T).run()},b=()=>{e.chain().focus().unsetBackgroundColor().run()},E=T=>{e.chain().focus().toggleHighlight({color:T}).run()},S=()=>{e.chain().focus().unsetHighlight().run()},y=e.isEditable;return{handleFontFamilyChange:i,handleFontSizeChange:o,increaseFontSize:a,decreaseFontSize:s,handleSuperscriptToggle:l,handleSubscriptToggle:c,handleToggleBold:d,handleToggleItalic:u,handleToggleUnderline:p,handleToggleStrike:m,handleSetColor:_,handleUnsetColor:h,handleSetBackgroundColor:g,handleUnsetBackgroundColor:b,handleSetHighlightColor:E,handleUnsetHighlightColor:S,isEditable:y}},Zo=(e=!1)=>`!p-1.5 !max-h-none !rounded hover:!bg-neutral-100 dark:hover:!bg-black-600 ${e?"!bg-neutral-200 dark:!bg-black-600":"!bg-transparent"}`,KB=()=>{const{fontFamily:e,fontSize:t,canSuperscript:n,isSuperscript:r,canSubscript:i,isSubscript:o,selectionColor:a,selectionBackgroundColor:s,canBold:l,isBold:c,canItalic:d,isItalic:u,canUnderline:p,isUnderline:m,canStrike:_,isStrike:h}=Dn(),{handleFontFamilyChange:g,handleFontSizeChange:b,handleSuperscriptToggle:E,handleSubscriptToggle:S,handleSetColor:y,handleUnsetColor:T,handleSetBackgroundColor:x,handleUnsetBackgroundColor:v,handleToggleBold:C,handleToggleItalic:O,handleToggleUnderline:w,handleToggleStrike:z}=hf();return f.jsxs(f.Fragment,{children:[f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(Oe.Dropdown,{menu:{items:Bb.map(N=>({label:f.jsx("span",{style:{fontFamily:N.value},children:N.label}),key:N.value,onClick:()=>g(N.value)})),style:{maxHeight:"256px",overflow:"auto"}},className:"px-2 w-24 cursor-pointer",children:f.jsxs("div",{className:"flex items-center gap-1 justify-between h-6",children:[f.jsx("span",{className:"text-sm truncate dark:text-black-100",children:Bb.find(N=>N.value===e)?.label}),f.jsx(ee.ArrowDropDownOutlined,{className:"text-gray-500 dark:text-black-300 hover:opacity-50"})]})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsxs(Oe.Space.Compact,{className:"cursor-pointer hidden-spin h-6",children:[f.jsx("input",{type:"number",value:t,onChange:N=>{const P=Number(N.target.value);P>=6&&P<=128?b(P):P<6?b(6):P>128&&b(128)},min:6,max:128,className:`text-right w-8 h-6 border-0 outline-none bg-transparent dark:text-black-100
208
+ `,style:{minWidth:a?`${u.width}px`:"140px",minHeight:a?`${u.height}px`:"30px",width:a?`${u.width}px`:"auto",height:a?`${u.height}px`:"auto"},onClick:m,id:e,children:[f.jsx("input",{ref:c,type:"file",accept:"image/*",className:"hidden",onChange:_}),r&&f.jsx("button",{className:"absolute -top-2 -right-2 w-5 h-5 bg-red-500 text-white rounded-full flex items-center justify-center text-xs opacity-0 group-hover:opacity-100 transition-opacity duration-200 hover:bg-red-600 z-10",onClick:b=>{b.stopPropagation(),r()},title:"Delete signature",children:"×"}),a&&o&&f.jsxs(f.Fragment,{children:[g("nw"),g("ne"),g("sw"),g("se")]}),a?f.jsx("img",{src:a,alt:"Signature",className:"w-full h-full object-contain block",style:{pointerEvents:"none"}}):f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"text-blue-600",children:f.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("path",{d:"M12 16L16 12H13V4H11V12H8L12 16Z",fill:"currentColor"}),f.jsx("path",{d:"M20 18H4V20H20V18Z",fill:"currentColor"})]})}),f.jsx("span",{className:"text-gray-600 font-medium text-sm select-none",children:"Signature"})]})]})},MB=({node:e,selected:t,deleteNode:n,updateAttributes:r,editor:i})=>{const[o,a]=A.useState(!1),s=e.attrs.redlineType==="user-deletion"||e.attrs.redlineType==="ai-deletion",l=m=>{a(!0);const _=new Image;_.src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=",m.dataTransfer.setDragImage(_,0,0)},c=()=>{a(!1)},d=()=>{i&&e.attrs.id?i.commands.deleteSignature(e.attrs.id):n()},u=m=>{const _=new FileReader;_.onload=h=>{const g=h.target?.result,b=new Image;b.onload=()=>{let{naturalWidth:E,naturalHeight:S}=b;const y=300;if(E>y){const T=S/E;E=y,S=y*T}i&&e.attrs.id&&i.commands.updateSignature(e.attrs.id,{signatureUrl:g,fileName:m.name,width:Math.round(E),height:Math.round(S)})},b.onerror=()=>{},b.src=g},_.onerror=()=>{},_.readAsDataURL(m)},p=m=>{r&&r({width:m.width,height:m.height})};return f.jsxs(f.Fragment,{children:[f.jsx(DB,{isVisible:o}),f.jsx(Tp,{className:"signature-node-wrapper",as:"span",draggable:"true","data-drag-handle":"","data-redline-type":e.attrs.redlineType||void 0,"data-redline-user-id":e.attrs.redlineUserId||void 0,"data-redline-user-name":e.attrs.redlineUserName||void 0,"data-redline-timestamp":e.attrs.redlineTimestamp||void 0,"data-signature-action":e.attrs.redlineAction||void 0,onDragStart:l,onDragEnd:c,children:f.jsx("div",{className:s?'relative inline-flex rounded-lg overflow-hidden opacity-80 before:absolute before:inset-0 before:bg-red-500/10 before:border-2 before:border-red-500 before:rounded-lg before:pointer-events-none after:absolute after:top-1 after:right-1 after:px-1.5 after:py-0.5 after:text-[10px] after:font-semibold after:uppercase after:tracking-wide after:text-white after:bg-red-500 after:rounded after:content-["Deleted"] after:pointer-events-none':"relative inline-flex",children:f.jsx(wB,{id:e.attrs.id,selected:t,signatureUrl:e.attrs.signatureUrl,width:e.attrs.width,height:e.attrs.height,onSelect:()=>{},onDelete:d,onUpload:u,onResize:p})})})]})},DB=({isVisible:e})=>e?Ri.createPortal(f.jsx("div",{className:"signature-drag-preview absolute -top-[1000px] -left-[1000px] inline-flex items-center justify-center gap-2 px-2 py-1 mx-1 my-1 bg-blue-50 border-2 border-dashed border-blue-300 rounded-lg min-w-[140px] min-h-[30px] pointer-events-none opacity-80 z-[1000]",children:f.jsx("span",{className:"text-gray-600 font-medium text-sm select-none",children:"Signature"})}),document.body):null,LB=bt.create({name:"signature",group:"inline",draggable:!0,atom:!0,inline:!0,addOptions(){return{HTMLAttributes:{}}},addAttributes(){return{id:{default:null,parseHTML:e=>e.getAttribute("id"),renderHTML:e=>e.id?{id:e.id}:{}},recipientEmail:{default:"",parseHTML:e=>e.getAttribute("data-recipient-email"),renderHTML:e=>e.recipientEmail?{"data-recipient-email":e.recipientEmail}:{}},signatureUrl:{default:null,parseHTML:e=>e.getAttribute("data-signature-url"),renderHTML:e=>e.signatureUrl?{"data-signature-url":e.signatureUrl}:{}},fileName:{default:null,parseHTML:e=>e.getAttribute("data-file-name"),renderHTML:e=>e.fileName?{"data-file-name":e.fileName}:{}},width:{default:140,parseHTML:e=>{const t=e.getAttribute("data-width");return t?Number(t):140},renderHTML:e=>e.width?{"data-width":String(e.width)}:{}},height:{default:60,parseHTML:e=>{const t=e.getAttribute("data-height");return t?Number(t):60},renderHTML:e=>e.height?{"data-height":String(e.height)}:{}},fontSize:{default:"1px",parseHTML:e=>e.style.fontSize,renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize};`}:{}},redlineType:{default:null,parseHTML:e=>e.getAttribute(xe),renderHTML:e=>e.redlineType?{[xe]:e.redlineType}:{}},redlineUserId:{default:null,parseHTML:e=>e.getAttribute(je),renderHTML:e=>e.redlineUserId?{[je]:e.redlineUserId}:{}},redlineUserName:{default:null,parseHTML:e=>e.getAttribute(Ke),renderHTML:e=>e.redlineUserName?{[Ke]:e.redlineUserName}:{}},redlineTimestamp:{default:null,parseHTML:e=>e.getAttribute(Qe),renderHTML:e=>e.redlineTimestamp?{[Qe]:e.redlineTimestamp}:{}},redlineAction:{default:null,parseHTML:e=>e.getAttribute("data-signature-action"),renderHTML:e=>e.redlineAction?{"data-signature-action":e.redlineAction}:{}},redlinePreviousAttrs:{default:null,parseHTML:e=>e.getAttribute("data-signature-previous-attrs"),renderHTML:e=>e.redlinePreviousAttrs?{"data-signature-previous-attrs":e.redlinePreviousAttrs}:{}}}},parseHTML(){return[{tag:'span[id^="anchor_s"]'}]},renderHTML({HTMLAttributes:e}){const n=`\\s${e.id?e.id.replace("anchor_s",""):""}\\`;return["span",Pe(this.options.HTMLAttributes,e),n]},addNodeView(){return yp(MB)},addKeyboardShortcuts(){const e=t=>{const{selection:n}=this.editor.state;let r;if(n instanceof ge&&n.node.type.name===this.name)r=n.node.attrs.id;else if(n.empty){const i=t==="backward"?n.$from.nodeBefore:n.$from.nodeAfter;i?.type.name===this.name&&(r=i.attrs.id)}return r?this.editor.commands.deleteSignature(r):!1};return{Backspace:()=>e("backward"),Delete:()=>e("forward")}},addCommands(){return{addSignature:e=>({commands:t,state:n,editor:r})=>{let i=0;const{doc:o}=n;o.descendants(u=>(u.type.name===this.name&&i++,!0));const a=e?.id||`anchor_s${i+1}`,s=r.storage?.redline,c=r.extensionManager.extensions.find(u=>u.name==="redline")?.options?.currentEntity||{id:"unknown",name:"User"},d=s?.isActive?s.mode==="ai"?bn:gn:null;return t.insertContent({type:this.name,attrs:{...e,id:a,...d?{redlineType:d,redlineUserId:c.id,redlineUserName:c.name,redlineTimestamp:new Date().toISOString(),redlineAction:"add"}:{}}})},updateSignature:(e,t)=>({tr:n,state:r,dispatch:i,editor:o})=>{const{doc:a}=r;let s=!1;const l=o.storage?.redline,d=o.extensionManager.extensions.find(p=>p.name==="redline")?.options?.currentEntity||{id:"unknown",name:"User"},u=l?.isActive?l.mode==="ai"?bn:gn:null;return a.descendants((p,m)=>{if(p.type.name===this.name&&p.attrs.id===e){const _={...p.attrs,...t};return u?n.setNodeMarkup(m,void 0,{..._,redlineType:u,redlineUserId:d.id,redlineUserName:d.name,redlineTimestamp:p.attrs.redlineTimestamp||new Date().toISOString(),redlineAction:"update",redlinePreviousAttrs:JSON.stringify({signatureUrl:p.attrs.signatureUrl??null,fileName:p.attrs.fileName??null,recipientEmail:p.attrs.recipientEmail??"",width:p.attrs.width??140,height:p.attrs.height??60})}):n.setNodeMarkup(m,void 0,_),s=!0,!1}return!0}),s&&i&&i(n),s},renumberSignatures:()=>({tr:e,state:t,dispatch:n})=>{const{doc:r}=t,i=[];r.descendants((a,s)=>(a.type.name===this.name&&i.push({node:a,pos:s}),!0)),i.sort((a,s)=>a.pos-s.pos);let o=!1;return i.forEach(({node:a,pos:s},l)=>{const c=`anchor_s${l+1}`;a.attrs.id!==c&&(e.setNodeMarkup(s,void 0,{...a.attrs,id:c}),o=!0)}),o&&n&&n(e),o},deleteSignature:e=>({tr:t,state:n,dispatch:r,editor:i})=>{const{doc:o}=n;let a=-1,s=0,l=null;const c=i.storage?.redline,u=i.extensionManager.extensions.find(m=>m.name==="redline")?.options?.currentEntity||{id:"unknown",name:"User"},p=c?.isActive?c.mode==="ai"?wo:ko:null;if(o.descendants((m,_)=>m.type.name===this.name&&m.attrs.id===e?(a=_,s=m.nodeSize,l=m,!1):!0),a>=0){const m=l,_=m?.attrs;p&&m?_?.redlineType===gn||_?.redlineType===bn?t.delete(a,a+s):t.setNodeMarkup(a,void 0,{..._,redlineType:p,redlineUserId:u.id,redlineUserName:u.name,redlineTimestamp:new Date().toISOString(),redlineAction:"delete",redlinePreviousAttrs:JSON.stringify({signatureUrl:_?.signatureUrl??null,fileName:_?.fileName??null,recipientEmail:_?.recipientEmail??"",width:_?.width??140,height:_?.height??60})}):t.delete(a,a+s);const h=[];return t.doc.descendants((b,E)=>(b.type.name===this.name&&h.push({node:b,pos:E}),!0)),h.sort((b,E)=>b.pos-E.pos),h.forEach(({node:b,pos:E},S)=>{const y=`anchor_s${S+1}`;b.attrs.id!==y&&t.setNodeMarkup(E,void 0,{...b.attrs,id:y})}),r&&r(t),!0}return!1}}}}),PB=Re.create({name:"dragDrop",addProseMirrorPlugins(){const{editor:e}=this;return[new Ie({key:new Fe("dragDrop"),props:{handleDOMEvents:{drop:(t,n)=>{n.preventDefault();const r=n.dataTransfer?.getData("elementType");if(!r)return!1;const i=t.posAtCoords({left:n.clientX,top:n.clientY});if(!i)return!1;const{state:o,dispatch:a}=t,{tr:s}=o;switch(r){case"image":{console.log("Insert image at position:",i.pos),window.dispatchEvent(new CustomEvent("insertElement",{detail:{type:"image",pos:i.pos}}));break}case"signature":{e.chain().focus().setTextSelection(i.pos).addSignature().run();break}case"codeBlock":{const l=s.doc.resolve(i.pos);s.setSelection(ue.near(l));const c=o.schema.nodes.codeBlock?.create();c&&s.replaceSelectionWith(c),a(s),t.focus();break}case"divider":{const l=s.doc.resolve(i.pos);s.setSelection(ue.near(l)),s.replaceSelectionWith(o.schema.nodes.horizontalRule.create()),a(s),t.focus();break}case"page-break":{const l=s.doc.resolve(i.pos);s.setSelection(ue.near(l));const c=o.schema.nodes.pageBreak?.create();c&&s.replaceSelectionWith(c),a(s),t.focus();break}default:return!1}return!0},dragover:(t,n)=>(n.preventDefault(),!1)}}})]}}),Td={person:{bg:"#DBEAFE",color:"#1D4ED8",darkBg:"rgba(59,130,246,0.22)",darkColor:"#93C5FD"},organization:{bg:"#F3E8FF",color:"#7C3AED",darkBg:"rgba(168,85,247,0.22)",darkColor:"#C4B5FD"},email:{bg:"#FEF3C7",color:"#B45309",darkBg:"rgba(245,158,11,0.22)",darkColor:"#FCD34D"},phone:{bg:"#D1FAE5",color:"#047857",darkBg:"rgba(34,197,94,0.22)",darkColor:"#6EE7B7"},location:{bg:"#FFEDD5",color:"#C2410C",darkBg:"rgba(249,115,22,0.22)",darkColor:"#FDBA74"},date:{bg:"#EDE9FE",color:"#6D28D9",darkBg:"rgba(139,92,246,0.22)",darkColor:"#C4B5FD"},time:{bg:"#E0F2FE",color:"#0369A1",darkBg:"rgba(14,165,233,0.22)",darkColor:"#7DD3FC"},money:{bg:"#D1FAE5",color:"#065F46",darkBg:"rgba(16,185,129,0.22)",darkColor:"#6EE7B7"},url:{bg:"#CCFBF1",color:"#0F766E",darkBg:"rgba(20,184,166,0.22)",darkColor:"#5EEAD4"}},BB={bg:"#FFF3E0",color:"#E65100"};function YT(e){try{const o=(((JSON.parse(e)[0]?.anonymizedVariable??"").split("_")[0]?.trim()??"").split(/\s+/)[0]??"").toLowerCase();return Td[o]?o:o==="ssn"?"SSN":o==="gpe"?"GPE":o}catch{return""}}function $T(e,t,n){const r=n?.placeholderFormat??"numbered",i=n?.highlightChanges??!1;if(r==="redacted"){e.style.display="inline-block",e.style.padding="1px 2px",e.style.margin="0 1px",e.style.fontSize="0.92em",e.style.fontWeight="500",e.style.whiteSpace="nowrap";const s=getComputedStyle(e.parentElement??e).color||"#000";e.style.backgroundColor=s,e.style.color="transparent";return}const o=YT(t),a=Td[o]??BB;i?(e.style.display="inline-block",e.style.padding="1px 5px",e.style.margin="0 1px",e.style.borderRadius="4px",e.style.fontSize="0.92em",e.style.fontWeight="500",e.style.whiteSpace="nowrap",e.style.backgroundColor=a.bg,e.style.color=a.color):(WT(e),e.style.color=a.color)}function WT(e){e.style.display="",e.style.padding="",e.style.margin="",e.style.borderRadius="",e.style.fontSize="",e.style.fontWeight="",e.style.whiteSpace="",e.style.backgroundColor="",e.style.color=""}const FB=bt.create({name:"anonymizedText",group:"inline",inline:!0,atom:!0,selectable:!0,draggable:!1,addOptions(){return{placeholderFormat:"numbered",highlightChanges:!1,isAnonymized:!1}},addAttributes(){return{placeholder:{default:"",parseHTML:e=>e.getAttribute("data-anon-placeholder")??"",renderHTML:e=>({"data-anon-placeholder":e.placeholder})},anonymizedData:{default:"[]",parseHTML:e=>e.getAttribute("data-anon-data")??"[]",renderHTML:e=>({"data-anon-data":e.anonymizedData})},showValue:{default:!1,parseHTML:e=>e.getAttribute("data-anon-show-value")==="true",renderHTML:e=>({"data-anon-show-value":String(!!e.showValue)})}}},parseHTML(){return[{tag:"span[data-anon-placeholder]"}]},renderHTML({node:e}){const{placeholder:t,anonymizedData:n}=e.attrs;return["span",{"data-anon-placeholder":t,"data-anon-data":n,class:"anonymized-text",contenteditable:"false"},t]},addNodeView(){const e={placeholderFormat:this.options.placeholderFormat,highlightChanges:this.options.highlightChanges},t=this.options.isAnonymized;return({node:n})=>{const{placeholder:r,anonymizedData:i,showValue:o}=n.attrs,a=document.createElement("span");a.className="anonymized-text",a.contentEditable="false",a.setAttribute("data-anon-placeholder",r),a.setAttribute("data-anon-data",i),a.setAttribute("data-anon-show-value",String(!!o));let s=r;try{const c=JSON.parse(i)[0]?.value??"";o&&c&&(s=c)}catch{}return a.textContent=s,t&&!o&&$T(a,i,e),{dom:a,update(l){if(l.type.name!=="anonymizedText")return!1;const{placeholder:c,anonymizedData:d,showValue:u}=l.attrs;a.setAttribute("data-anon-placeholder",c),a.setAttribute("data-anon-data",d),a.setAttribute("data-anon-show-value",String(!!u));let p=c;try{const _=JSON.parse(d)[0]?.value??"";u&&_&&(p=_)}catch{}return a.textContent=p,u?WT(a):$T(a,d,e),!0}}}}});function uf(e){if(Array.isArray(e))return e;if(typeof e=="string"&&e.trim())try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}return[]}const UB=hn.create({name:"anonymizedLink",inclusive:!1,exitable:!0,spanning:!0,keepOnSplit:!1,addOptions(){return{HTMLAttributes:{},openOnClick:!1}},addAttributes(){return{href:{default:null,parseHTML:e=>e.getAttribute("href")??e.getAttribute("data-anon-href"),renderHTML:e=>{const n=uf(e.anonymizedData)[0]?.value??e.href??null;return n?e.showValue?{href:n}:{"data-anon-href":n}:{}}},target:{default:"_blank",parseHTML:e=>e.getAttribute("target"),renderHTML:e=>e.target?{target:e.target}:{}},rel:{default:"noopener noreferrer nofollow",parseHTML:e=>e.getAttribute("rel"),renderHTML:e=>e.rel?{rel:e.rel}:{}},class:{default:null,parseHTML:e=>e.getAttribute("class"),renderHTML:e=>e.class?{class:e.class}:{}},anonymizedData:{default:[],parseHTML:e=>uf(e.getAttribute("data-anon-data")),renderHTML:e=>{const t=uf(e.anonymizedData);return{"data-anon-data":JSON.stringify(t)}}},showValue:{default:!1,parseHTML:e=>e.getAttribute("data-anon-show-value")==="true",renderHTML:e=>({"data-anon-show-value":String(!!e.showValue)})}}},parseHTML(){return[{tag:"a[data-anon-link]",getAttrs:e=>typeof e=="string"?!1:e.hasAttribute("data-anon-link")?null:!1},{tag:"a[data-anon-data]",getAttrs:e=>typeof e=="string"?!1:e.hasAttribute("data-anon-data")?null:!1}]},renderHTML({HTMLAttributes:e}){return["a",Pe(this.options.HTMLAttributes,e,{"data-anon-link":"true"}),0]},addCommands(){return{setAnonymizedLink:e=>({chain:t})=>t().setMark(this.name,e).run(),unsetAnonymizedLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).run()}}}),qT=["#958DF1","#F98181","#70CFF8","#B9F18D","#FBBC88","#AC73E5","#94FADB","#E84E8C","#FF9D66","#5B8DEF","#42E695","#FAF594","#C084FC","#2DD4BF","#F472B6","#FFB84D","#A78BFA","#34D399","#FBBF24","#60A5FA","#FCA5A5","#818CF8"];function As(e){return(e.id?.trim()||e.email?.trim()||e.name?.trim()||"").toLowerCase()||"__anonymous__"}function zB(e){const t=new Map;for(const n of e){const r=As(n);t.has(r)||t.set(r,n)}return[...t.values()]}function HB(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return Math.abs(t)%qT.length}function GB(e,t){const n=qT,r=As(e);if(t&&t.length>0){const o=zB([...t,e]).sort((s,l)=>As(s).localeCompare(As(l))).findIndex(s=>As(s)===r);return n[(o===-1?0:o)%n.length]}return n[HB(r)]}const VB=e=>[Gk,Yk,_B,...Qb(e)?[]:[MO],ew,nw,Ew.configure({maxDepth:9}),DO,kO.configure({placeholder:"Write something …"}),zk.configure({oneHalf:!1,oneQuarter:!1,threeQuarters:!1}),YE,jE,qE,pw,Cw,Tw,WE,$E,KE.configure({types:["textStyle"]}),Rw.configure({multicolor:!0}),ow,dw.configure({nested:!0}),mw.configure({types:["paragraph","heading","blockquote"],minLevel:0,maxLevel:12}),uw.configure({minWordsToTriggerAutoCompletion:e?.aiAutocompletion?.minWordsToTriggerAutoCompletion||Ub,debounceTime:e?.aiAutocompletion?.debounceTime||Fb,isEnabled:!!(e?.aiAutocompletion?.enabled&&e?.aiAutocompletion?.fetchCompletion),fetchCompletion:e?.aiAutocompletion?.fetchCompletion}),Ow.configure({types:["heading","paragraph","blockquote","listItem"],defaultAlignment:"left"}),ww,Dw.configure({levels:[1,2,3,4,5,6]}),U2.configure({resizable:!0,allowTableNodeSelection:!0,lastColumnResizable:!0,HTMLAttributes:{class:"tiptap-table"}}),G2,H2,z2,Y2.configure({enabled:e?.enableVariableText||!1,variableValues:e?.variableValues||{}}),hM.configure({openOnClick:!1,linkOnPaste:!0,defaultProtocol:"https",protocols:["http","https"]}),UB,EM,D8,B8.configure({unit:"in",defaultMargins:{top:1,right:1,bottom:1,left:1}}),U8,z8,K8.configure({inline:!0,allowBase64:!0}),tB,sB,uB,mB,gB,wO.configure({node:"paragraph",notAfter:["paragraph"]}),IB.configure({isActive:!1,mode:"user",currentEntity:{id:e?.currentUser?.id||"unknown",name:e?.currentUser?.name||"User"}}),kB,LB,PB,FB.configure({placeholderFormat:e?.piiAnonymization?.settings?.placeholderFormat??"numbered",highlightChanges:e?.piiAnonymization?.settings?.highlightChanges??!1,isAnonymized:e?.piiAnonymization?.isAnonymized??e?.piiAnonymization?.isAnalyzed??!1}),...Qb(e)?(()=>{const t=e.collaborativeEditing;return[fk.configure({document:t.ydoc}),hk.configure({provider:t.provider,user:{name:e?.currentUser?.name||"Anonymous",color:e?.currentUser?.color?.trim()||GB(e?.currentUser??{},e?.allUsers)}})]})():[]],jT=[{label:"Default",value:"#ffffff"},{label:"Eye-friendly Green",value:"#e8f5e9"},{label:"Elegant Yellow",value:"#fff8e1"},{label:"Cloudy Blue",value:"#e3f2fd"},{label:"Sky Blue",value:"#bbdefb"},{label:"Dark Night Black",value:"#616161"}],tr={top:1,right:1,bottom:1,left:1},KT={Normal:{top:1,right:1,bottom:1,left:1},Narrow:{top:.5,right:.5,bottom:.5,left:.5},Moderate:{top:1.25,right:1.25,bottom:1.25,left:1.25},Wide:{top:1.75,right:1.75,bottom:1.75,left:1.75},Mirrored:{top:1.25,right:1,bottom:1.25,left:2}},QT=0,XT=3,ZT=.25,JT=()=>{const{editor:e}=lt(),[t,n]=A.useState(jT[0].value);A.useEffect(()=>{if(!e)return;const E=document.body.getAttribute("data-page-background-color");E&&n(E)},[e]);const r=E=>{n(E),e&&e.chain().focus().setPageBackgroundColor(E).run()},[i,o]=A.useState({size:"A4",orientation:"portrait"});A.useEffect(()=>{document.body.setAttribute("data-page-orientation",i.orientation)},[i.orientation]);const a=E=>{const{size:S,orientation:y}=E,T=`page-${S.toLowerCase()}`;return y==="landscape"?`${T}-landscape`:T},s=()=>{e.chain().focus().setPageBreak().run()},[l,c]=A.useState(tr),[d,u]=A.useState({top:"1",right:"1",bottom:"1",left:"1"});A.useEffect(()=>{const S=(()=>{if(e&&e.getAttributes)try{const T=e.getAttributes("pageMargin");if(T&&Object.keys(T).length>0)return{top:T.top??tr.top,right:T.right??tr.right,bottom:T.bottom??tr.bottom,left:T.left??tr.left}}catch(T){console.error("Error getting margins from editor:",T)}const y=document.body.getAttribute("data-page-margins");if(y)try{return JSON.parse(y)}catch(T){console.error("Error parsing page margins data attribute:",T)}return tr})();c(S),u({top:S.top.toString(),right:S.right.toString(),bottom:S.bottom.toString(),left:S.left.toString()})},[e]);const p=(E,S)=>{if(u(x=>({...x,[E]:S})),S==="")return;const y=Number(S);if(isNaN(y))return;const T=Math.min(Math.max(QT,y),XT);c(x=>({...x,[E]:T}))},m=E=>{const S=d[E];(S===""||isNaN(Number(S)))&&(u(T=>({...T,[E]:"0"})),c(T=>({...T,[E]:0})))},_=(E,S)=>{if(E.key==="ArrowUp"||E.key==="ArrowDown"){E.preventDefault();const y=l[S];let T;E.key==="ArrowUp"?T=Math.min(y+ZT,XT):T=Math.max(y-ZT,QT),c(x=>({...x,[S]:T})),u(x=>({...x,[S]:T.toString()}))}},h=E=>{const S=KT[E];c({...S}),u({top:S.top.toString(),right:S.right.toString(),bottom:S.bottom.toString(),left:S.left.toString()}),e&&e.commands.setPresetMargins&&e.commands.setPresetMargins(E)},g=E=>{c({...tr}),u({top:tr.top.toString(),right:tr.right.toString(),bottom:tr.bottom.toString(),left:tr.left.toString()}),E("portrait"),e&&e.commands.resetPageMargins&&e.commands.resetPageMargins()},b=E=>{e&&e.commands.setPageMargins&&e.commands.setPageMargins({top:l.top,right:l.right,bottom:l.bottom,left:l.left}),E?.()};return{pageClass:a(i),selectedBGColor:t,handleSetPageBackgroundColor:r,pageConfig:i,setPageConfig:o,handleInsertPageBreak:s,margins:l,inputValues:d,handleMarginInputChange:p,handleMarginInputBlur:m,handleMarginKeyDown:_,applyPresetMargins:h,resetMarginsToDefault:g,applyMargins:b}},YB=(e,t)=>{const[n,r]=A.useState(!1),[i,o]=A.useState(!1),a=()=>{r(!0),e?.setEditable(!1),(t?.current||document.documentElement).requestFullscreen?.()},s=A.useCallback(()=>{r(!1),o(!1),(t?.current||document.documentElement).classList.remove("laser-active"),e?.setEditable(!0),document.fullscreenElement&&document.exitFullscreen?.()},[e,t]),l=d=>{o(d);const u=t?.current||document.documentElement;d?u.classList.add("laser-active"):u.classList.remove("laser-active")},c=()=>{n?s():a()};return A.useEffect(()=>{const d="fullscreenchange",u=()=>{!document.fullscreenElement&&n&&s()};return document.addEventListener(d,u),()=>{document.removeEventListener(d,u)}},[n,e,s]),{isPresentationMode:n,isLaserActive:i,onPresentationModeToggle:c,handleLaserToggle:l}},e1=()=>{const[e,t]=A.useState(()=>document.documentElement.classList.contains("dark"));return A.useEffect(()=>{const n=()=>{t(document.documentElement.classList.contains("dark"))},r=new MutationObserver(i=>{i.forEach(o=>{o.attributeName==="class"&&n()})});return r.observe(document.documentElement,{attributes:!0}),()=>r.disconnect()},[]),e},t1=A.createContext(void 0),yd=()=>{const e=A.useContext(t1),t=e1();return e||{config:{},isDarkMode:t}},$B=({onSelect:e,withHeaderRow:t=!0,onHeaderRowChange:n})=>{const[r,i]=A.useState({rows:0,cols:0}),[o,a]=A.useState(8),[s,l]=A.useState(8),c=A.useRef(null),d=A.useRef(0),u=A.useRef(null),p=8,m=10,_=20,h=3,g=80;A.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]);const b=(v,C)=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{v>=o-1&&o<_&&a(O=>Math.min(O+1,_)),C>=s-1&&s<_&&l(O=>Math.min(O+1,_)),v<o-h&&o>p&&a(()=>Math.max(v+h,p)),C<s-h&&s>m&&l(()=>Math.max(C+h,m)),u.current=null},g)},E=(v,C)=>{const O=Date.now(),w=v+1,z=C+1;i({rows:w,cols:z}),!(O-d.current<g)&&(d.current=O,b(w,z))},S=()=>{i({rows:0,cols:0})},y=()=>{e(r.rows,r.cols),x()},T=v=>{n&&n(v.target.checked)},x=()=>{u.current&&(clearTimeout(u.current),u.current=null),a(p),l(m),i({rows:0,cols:0}),d.current=0};return f.jsxs("div",{className:"relative p-2",id:"editor-dropdown-content",children:[f.jsx("div",{ref:c,className:"grid gap-[2px]",style:{gridTemplateColumns:`repeat(${s}, 1fr)`,overflowY:o>p?"auto":"visible",transition:"all 0.15s cubic-bezier(0.4, 0, 0.2, 1)"},onMouseLeave:S,children:Array.from({length:o}).map((v,C)=>f.jsx(A.Fragment,{children:Array.from({length:s}).map((O,w)=>f.jsx("div",{className:`w-4 h-4 border cursor-pointer transition-colors duration-50 ${C<r.rows&&w<r.cols?"bg-primary-100 dark:bg-primary-900 border-primary-300":"bg-gray-50 dark:bg-black-700 border-gray-300 dark:border-black-500"}`,onMouseEnter:()=>E(C,w),onClick:y},`${C}-${w}`))},C))}),f.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-700 dark:text-black-200 font-medium mt-1",children:[f.jsxs("div",{children:[r.rows,"×",r.cols]}),f.jsx("div",{children:"Click to insert table"})]}),f.jsx("div",{className:"my-2 mb-1",children:f.jsx(Oe.Checkbox,{id:"table-header-row",checked:t,onChange:T,children:f.jsx(G.Typography,{variant:"regular",appearance:"title",children:"Include header row"})})})]})},Si=()=>f.jsx("div",{className:"h-6 w-0.5 bg-neutral-300 dark:bg-black-500"}),Dn=()=>{const{editor:e}=lt();return Ab({editor:e,selector:n=>n.editor?{canUndo:n.editor.can().chain().undo().run()??!1,canRedo:n.editor.can().chain().redo().run()??!1,isBold:n.editor.isActive("bold")??!1,canBold:n.editor.can().chain().toggleBold().run()??!1,isItalic:n.editor.isActive("italic")??!1,canItalic:n.editor.can().chain().toggleItalic().run()??!1,isStrike:n.editor.isActive("strike")??!1,canStrike:n.editor.can().chain().toggleStrike().run()??!1,isUnderline:n.editor.isActive("underline")??!1,canUnderline:n.editor.can().chain().toggleUnderline().run()??!1,isSuperscript:n.editor.isActive("superscript")??!1,canSuperscript:n.editor.can().chain().toggleSuperscript().run()??!1,isSubscript:n.editor.isActive("subscript")??!1,canSubscript:n.editor.can().chain().toggleSubscript().run()??!1,selectionColor:n.editor.getAttributes("textStyle")?.color??"#000000",selectionBackgroundColor:n.editor.getAttributes("textStyle")?.backgroundColor??"#FFFFFF",highlightColor:ip(n.editor.state,"highlight")?.color??"#FFFFFF",fontSize:parseInt(n.editor.getAttributes("textStyle")?.fontSize?.replace(/px|pt/,"")??"12",10),fontFamily:n.editor.getAttributes("textStyle")?.fontFamily??"Arial, sans-serif",characterCount:n.editor.storage.characterCount?.characters?.()??0,wordCount:n.editor.storage.characterCount?.words?.()??0,isAIAutocompletionEnabled:n.editor.storage.aiAutoCompletion.isEnabled??!1,isTaskList:n.editor.isActive("taskList")??!1,canIndent:n.editor.can().sinkListItem("taskItem")||n.editor.can().sinkListItem("listItem")||n.editor.can().indent(),canOutdent:n.editor.can().liftListItem("taskItem")||n.editor.can().liftListItem("listItem")||n.editor.can().outdent(),isOrderedList:n.editor.isActive("orderedList")??!1,currentOrderedListType:n.editor.getAttributes("orderedList")?.listType??"decimal",isUnorderedList:n.editor.isActive("bulletList")??!1,currentUnorderedListType:n.editor.getAttributes("bulletList")?.listType??"default",isTextAlignJustify:n.editor.isActive({textAlign:"justify"})??!1,isTextAlignCenter:n.editor.isActive({textAlign:"center"})??!1,isTextAlignRight:n.editor.isActive({textAlign:"right"})??!1,isTextAlignLeft:n.editor.isActive({textAlign:"left"})??!1,lineHeight:n.editor.getAttributes("textStyle")?.lineHeight??"",isBlockquote:n.editor.isActive("blockquote")??!1,canBlockquote:n.editor.can().chain().toggleBlockquote().run()??!1,selectionHeadingLevel:n.editor.getAttributes("heading")?.level??"paragraph",isTableActive:n.editor.isActive("table")??!1,isLinkActive:n.editor.isActive("link")??!1,isInsideColumn:(()=>{const{$from:r}=n.editor.state.selection;for(let i=r.depth;i>0;i--)if(r.node(i).type.name==="pageColumnWrapper")return!0;return!1})(),columnShowDividers:(()=>{const{$from:r}=n.editor.state.selection;for(let i=r.depth;i>0;i--){const o=r.node(i);if(o.type.name==="pageColumnWrapper")return o.attrs.showDividers!==!1}return!0})(),canSplitCell:n.editor.can().chain().splitCell().run()??!1,canMergeCells:n.editor.can().chain().mergeCells().run()??!1}:{canUndo:!1,canRedo:!1,isBold:!1,canBold:!1,isItalic:!1,canItalic:!1,isStrike:!1,canStrike:!1,isUnderline:!1,canUnderline:!1,isSuperscript:!1,canSuperscript:!1,isSubscript:!1,canSubscript:!1,selectionColor:"#000000",selectionBackgroundColor:"#FFFFFF",highlightColor:"#FFFFFF",fontSize:12,fontFamily:"Arial, sans-serif",characterCount:0,wordCount:0,isAIAutocompletionEnabled:!1,isTaskList:!1,canIndent:!1,canOutdent:!1,isOrderedList:!1,currentOrderedListType:"decimal",isUnorderedList:!1,currentUnorderedListType:"default",isTextAlignJustify:!1,isTextAlignCenter:!1,isTextAlignRight:!1,isTextAlignLeft:!1,lineHeight:"",isBlockquote:!1,canBlockquote:!1,selectionHeadingLevel:"paragraph",isTableActive:!1,isLinkActive:!1,isInsideColumn:!1,columnShowDividers:!0,canSplitCell:!1,canMergeCells:!1}})},pf="data-redline-row-action",mf="data-redline-column-action",ff="data-redline-column-id",n1=e=>!!(e&&e.type.name==="table"&&(e.attrs["data-redline-type"]==="user-insertion"||e.attrs["data-redline-type"]==="ai-insertion")),r1=()=>{const{editor:e}=lt(),t=()=>{if(!e)return null;const{$from:v}=e.state.selection;for(let C=v.depth;C>0;C--){const O=v.node(C);if(O.type.name==="table")return{depth:C,node:O,pos:v.before(C)}}return null},n=()=>{if(!e)return null;const{$from:v}=e.state.selection;for(let C=v.depth;C>0;C--){const O=v.node(C);if(O.type.name==="tableRow")return{depth:C,node:O,pos:v.before(C)}}return null},r=()=>{if(!e)return null;const{$from:v}=e.state.selection;for(let C=v.depth;C>0;C--){const O=v.node(C);if(O.type.name==="tableCell"||O.type.name==="tableHeader")return{depth:C,node:O,pos:v.before(C),colIndex:v.index(C-1)}}return null},i=v=>{if(!e)return;const C=e.storage?.redline;if(!C?.isActive)return;const O=e.state.doc.nodeAt(v);if(!O||O.type.name!=="tableRow")return;const w=e.state.doc.resolve(v);let z=null;for(let M=w.depth;M>0;M--){const B=w.node(M);if(B.type.name==="table"){z=B;break}}if(n1(z))return;const P=e.extensionManager.extensions.find(M=>M.name==="redline")?.options?.currentEntity||{id:"unknown",name:"User"},I=C.mode==="ai"?"ai-insertion":"user-insertion",R=O.attrs["data-row-id"]||`blank-row-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,k=e.state.tr.setNodeMarkup(v,void 0,{...O.attrs,"data-row-id":R,"data-redline-type":I,"data-redline-user-id":P.id,"data-redline-user-name":P.name,"data-redline-timestamp":new Date().toISOString(),[pf]:"add"});e.view.dispatch(k)},o=v=>{if(!e)return;const C=e.storage?.redline;if(!C?.isActive)return;const O=e.state.doc.nodeAt(v);if(!O||O.type.name!=="table")return;const z=e.extensionManager.extensions.find(I=>I.name==="redline")?.options?.currentEntity||{id:"unknown",name:"User"},N=C.mode==="ai"?"ai-insertion":"user-insertion",P=e.state.tr.setNodeMarkup(v,void 0,{...O.attrs,"data-redline-type":N,"data-redline-user-id":z.id,"data-redline-user-name":z.name,"data-redline-timestamp":new Date().toISOString()});e.view.dispatch(P)},a=v=>{if(!e)return;const C=e.state.doc.nodeAt(v);if(!C||C.type.name!=="tableRow")return;const O=e.storage?.redline;if(!O?.isActive){e.chain().focus().deleteRow().run();return}const w=C.attrs[pf],z=C.attrs["data-redline-type"];if(w==="add"&&(z==="user-insertion"||z==="ai-insertion")){e.chain().focus().deleteRow().run();return}const I=e.extensionManager.extensions.find(B=>B.name==="redline")?.options?.currentEntity||{id:"unknown",name:"User"},R=O.mode==="ai"?"ai-deletion":"user-deletion",k=C.attrs["data-row-id"]||`row-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,M=e.state.tr.setNodeMarkup(v,void 0,{...C.attrs,"data-row-id":k,"data-redline-type":R,"data-redline-user-id":I.id,"data-redline-user-name":I.name,"data-redline-timestamp":new Date().toISOString(),[pf]:"delete"});e.view.dispatch(M)},s=(v,C)=>{if(!e)return;const O=e.storage?.redline;if(!O?.isActive)return;const w=e.state.doc.nodeAt(v);if(!w||w.type.name!=="table"||n1(w))return;const N=e.extensionManager.extensions.find(B=>B.name==="redline")?.options?.currentEntity||{id:"unknown",name:"User"},P=O.mode==="ai"?"ai-insertion":"user-insertion",I=new Date().toISOString(),R=`column-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,k=e.state.tr;let M=1;w.forEach(B=>{if(B.type.name!=="tableRow"){M+=B.nodeSize;return}let D=null,U=0,H=1;if(B.forEach(V=>{if(D!==null){H+=V.nodeSize;return}U===C&&(D=v+M+H),U++,H+=V.nodeSize}),D!==null){const V=e.state.doc.nodeAt(D);V&&k.setNodeMarkup(D,void 0,{...V.attrs,"data-redline-type":P,"data-redline-user-id":N.id,"data-redline-user-name":N.name,"data-redline-timestamp":I,[mf]:"add",[ff]:R})}M+=B.nodeSize}),k.docChanged&&e.view.dispatch(k)},l=(v,C)=>{if(!e)return;const O=e.storage?.redline;if(!O?.isActive){e.chain().focus().deleteColumn().run();return}const w=e.state.doc.nodeAt(v);if(!w||w.type.name!=="table")return;const N=e.extensionManager.extensions.find(U=>U.name==="redline")?.options?.currentEntity||{id:"unknown",name:"User"},P=O.mode==="ai"?"ai-deletion":"user-deletion",I=new Date().toISOString(),R=e.state.tr;let k=!1,M=null,B=1;if(w.forEach(U=>{if(U.type.name!=="tableRow"){B+=U.nodeSize;return}let H=null,V=0,j=1;if(U.forEach(W=>{if(H!==null){j+=W.nodeSize;return}V===C&&(H=v+B+j),V++,j+=W.nodeSize}),H!==null){const W=e.state.doc.nodeAt(H);if(W){const oe=W.attrs[mf],Z=W.attrs["data-redline-type"];oe==="add"&&(Z==="user-insertion"||Z==="ai-insertion")&&(k=!0,M=W.attrs[ff]??M)}}B+=U.nodeSize}),k){e.chain().focus().deleteColumn().run();return}const D=M??`column-delete-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;B=1,w.forEach(U=>{if(U.type.name!=="tableRow"){B+=U.nodeSize;return}let H=null,V=0,j=1;if(U.forEach(W=>{if(H!==null){j+=W.nodeSize;return}V===C&&(H=v+B+j),V++,j+=W.nodeSize}),H!==null){const W=e.state.doc.nodeAt(H);W&&R.setNodeMarkup(H,void 0,{...W.attrs,"data-redline-type":P,"data-redline-user-id":N.id,"data-redline-user-name":N.name,"data-redline-timestamp":I,[mf]:"delete",[ff]:D})}B+=U.nodeSize}),R.docChanged&&e.view.dispatch(R)};return{handleInsertTable:(v,C,O)=>{if(!e||!e.commands.insertTable({rows:v,cols:C,withHeaderRow:O}))return;const z=t();z&&o(z.pos)},handleInsertRowAbove:()=>{if(!e)return;const v=n();if(!v){e.chain().focus().addRowBefore().run();return}e.chain().focus().addRowBefore().run()&&i(v.pos)},handleInsertRowBelow:()=>{if(!e)return;const v=n();if(!v){e.chain().focus().addRowAfter().run();return}e.chain().focus().addRowAfter().run()&&i(v.pos+v.node.nodeSize)},handleDeleteRow:()=>{if(!e)return;const v=n();if(!v){e.chain().focus().deleteRow().run();return}a(v.pos)},handleInsertColumnLeft:()=>{if(!e)return;const v=r(),C=t();!e.chain().focus().addColumnBefore().run()||!v||!C||s(C.pos,v.colIndex)},handleInsertColumnRight:()=>{if(!e)return;const v=r(),C=t();!e.chain().focus().addColumnAfter().run()||!v||!C||s(C.pos,v.colIndex+1)},handleDeleteColumn:()=>{if(!e)return;const v=r(),C=t();if(!v||!C){e.chain().focus().deleteColumn().run();return}l(C.pos,v.colIndex)},handleSetCellBackgroundColor:v=>{e&&e.chain().focus().setCellAttribute("backgroundColor",v).run()},handleClearCellBackgroundColor:()=>{e&&e.chain().focus().setCellAttribute("backgroundColor",null).run()},handleMergeCells:()=>{e&&e.chain().focus().mergeCells().run()},handleSplitCell:()=>{e&&e.chain().focus().splitCell().run()},handleDeleteTable:()=>{e&&e.chain().focus().deleteTable().run()},handleInsertTableFromData:({tableType:v,data:C,columns:O,options:w})=>{e&&e.commands.insertTableFromData({tableType:v,data:C,columns:O,options:w})},handleUpdateTableValues:v=>{e&&e.commands.updateTableValues(v)}}},i1=()=>{const{editor:e}=lt(),{isAIAutocompletionEnabled:t}=Dn();return e?{handleUndo:()=>{e.chain().focus().undo().run()},handleRedo:()=>{e.chain().focus().redo().run()},handleToggleAIAutocompletion:()=>{t?e.commands.disableAutocompletion():e.commands.enableAutocompletion()},handleClearFormatting:()=>{e.chain().focus().unsetAllMarks().run()}}:{handleUndo:()=>{},handleRedo:()=>{},handleAIAutocompletion:()=>{}}},WB=cf(f.jsx("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8"}),"Undo"),qB=cf(f.jsx("path",{d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7z"}),"Redo"),o1="!p-1.5 !max-h-none !rounded !bg-transparent hover:!bg-neutral-100 dark:hover:!bg-black-600",a1=()=>{const{canUndo:e,canRedo:t}=Dn(),{handleUndo:n,handleRedo:r}=i1();return f.jsxs(f.Fragment,{children:[f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"toolbar-undo",title:"Undo",status:"no-background",className:o1+" !border-none",onClick:n,disabled:!e,children:f.jsx(WB,{fontSize:"medium"})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"toolbar-redo",title:"Redo",status:"no-background",className:o1+" !border-none",onClick:r,disabled:!t,children:f.jsx(qB,{fontSize:"medium"})})})]})},jB=()=>{const{isTableActive:e,canSplitCell:t,canMergeCells:n}=Dn(),{handleInsertTable:r,handleInsertRowAbove:i,handleInsertRowBelow:o,handleDeleteRow:a,handleInsertColumnLeft:s,handleInsertColumnRight:l,handleDeleteColumn:c,handleMergeCells:d,handleSplitCell:u,handleDeleteTable:p}=r1(),[m,_]=A.useState(!0),[h,g]=A.useState(!1),b=E=>{g(E)};return f.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[f.jsx(a1,{}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(Si,{})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(Oe.Popover,{content:f.jsx($B,{onSelect:(E,S)=>r(E,S,m),withHeaderRow:m,onHeaderRowChange:E=>_(E)}),trigger:"click",open:h,onOpenChange:b,arrow:!1,style:{padding:"0px"},children:f.jsx(G.Button,{id:"table-insert",onClick:()=>g(!0),status:"no-background",className:"!p-1 !max-h-none !rounded border-none",title:"Insert Table",children:f.jsxs("div",{className:"flex items-center flex-row gap-1",children:[f.jsx(ie,{name:"table",size:"18px",strokeWidth:4}),f.jsx(ee.ArrowDropDownOutlined,{sx:{fontSize:"18px",color:"inherit"}})]})})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(Si,{})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"table-insert-row-above",onClick:i,disabled:!e,status:"no-background",className:"!p-1 !max-h-none !rounded border-none",title:"Insert Row Above",children:f.jsx("div",{className:"flex items-center flex-row gap-1",children:f.jsx(ie,{name:"add-row",strokeWidth:4,size:"18px"})})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"table-insert-row-below",onClick:o,disabled:!e,status:"no-background",className:"!p-1 !max-h-none !rounded border-none",title:"Insert Row Below",children:f.jsx("div",{className:"flex items-center flex-row gap-1",children:f.jsx(ie,{name:"add-row",strokeWidth:4,className:"rotate-[180deg]",size:"18px"})})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"table-delete-row",onClick:a,disabled:!e,status:"no-background",className:"!p-1 !max-h-none !rounded border-none",title:"Delete Row",children:f.jsx("div",{className:"flex items-center flex-row gap-1",children:f.jsx(ie,{name:"table-delete-row",strokeWidth:2,size:"18px"})})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"table-insert-col-left",onClick:s,disabled:!e,status:"no-background",className:"!p-1 !max-h-none !rounded border-none",title:"Insert Column Left",children:f.jsx("div",{className:"flex items-center flex-row gap-1",children:f.jsx(ie,{name:"add-row",strokeWidth:4,className:"rotate-[-90deg]",size:"18px"})})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"table-insert-col-right",onClick:l,disabled:!e,status:"no-background",className:"!p-1 !max-h-none !rounded border-none",title:"Insert Column Right",children:f.jsx("div",{className:"flex items-center flex-row gap-1",children:f.jsx(ie,{name:"add-row",strokeWidth:4,className:"rotate-[90deg]",size:"18px"})})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"table-delete-col",onClick:c,disabled:!e,status:"no-background",className:"!p-1 !max-h-none !rounded border-none",title:"Delete Column",children:f.jsx("div",{className:"flex items-center flex-row gap-1",children:f.jsx(ie,{name:"table-delete-column",strokeWidth:2,size:"18px"})})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"table-merge-cells",onClick:d,disabled:!e||!n,status:"no-background",className:"!p-1 !max-h-none !rounded border-none",title:"Merge Cells",children:f.jsx("div",{className:"flex items-center flex-row gap-1",children:f.jsx(ie,{name:"table-merge-cell",strokeWidth:4,size:"18px"})})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(Si,{})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"table-split-cell",onClick:u,disabled:!e||!t,status:"no-background",className:"!p-1 !max-h-none !rounded border-none",title:"Split Cell",children:f.jsx("div",{className:"flex items-center flex-row gap-1",children:f.jsx(ie,{name:"table-split-cell",strokeWidth:4,size:"18px"})})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(Si,{})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"table-delete",onClick:p,disabled:!e,status:"no-background",className:"!p-1 !max-h-none !rounded border-none",title:"Delete Table",children:f.jsx("div",{className:"flex items-center flex-row gap-1",children:f.jsx(ie,{name:"table-delete",size:"18px",strokeWidth:4})})})})]})},_f=({id:e,title:t,value:n,icon:r,showNone:i=!0,presetColorsPanel:o,contentWidth:a,showLabel:s=!1,onColorSelect:l,onResetColor:c})=>{const{token:d}=Oe.theme.useToken(),[u,p]=A.useState(!1),[m,_]=A.useState(n||"#FFFFFF"),h=E=>{_(E)},g=E=>{_(E),l?.(E),p(!1)},b=(E,{components:{Picker:S}})=>f.jsxs(Oe.Row,{justify:"space-between",wrap:!1,children:[o||f.jsxs(Oe.Col,{span:12,children:[f.jsxs("div",{className:"mb-2",children:[f.jsx("div",{className:"text-sm mb-1.5 dark:text-white",children:"Select Color"}),f.jsx("div",{className:"grid gap-1.5",children:qA.map((y,T)=>f.jsx("div",{className:"flex gap-1.5 justify-center",children:y.map(x=>f.jsx("button",{className:`w-4 h-4 rounded-sm hover:scale-[1.2] transition-transform ${m===x?"ring-2 ring-blue-500":""} ${x==="#FFFFFF"?"border":""}`,style:{backgroundColor:x},onClick:()=>g(x)},x))},T))})]}),f.jsxs("div",{className:"mb-2",children:[f.jsx("div",{className:"text-sm mb-1.5 dark:text-white",children:"Standard Colors"}),f.jsx("div",{className:"flex gap-1.5",children:jA.map(y=>f.jsx("button",{className:`w-3.5 h-3.5 rounded-sm hover:scale-[1.2] transition-transform ${m===y?"ring-2 ring-blue-500":""}`,style:{backgroundColor:y},onClick:()=>g(y)},y))})]}),f.jsxs("div",{className:"flex items-center justify-between gap-1",children:[i&&f.jsxs("div",{className:"flex items-center gap-0.5 text-sm cursor-pointer text-primary-400 hover:text-primary-700",onClick:()=>g("transparent"),children:[f.jsx(ee.FormatColorResetOutlined,{sx:{fontSize:"18px"}}),"None"]}),c&&f.jsx("div",{className:"text-sm cursor-pointer text-primary-400 hover:text-primary-700",onClick:()=>{c(),p(!1)},children:"Reset"})]})]}),f.jsx(Oe.Divider,{type:"vertical",style:{height:"auto"}}),f.jsx(Oe.Col,{flex:"auto",children:f.jsx(S,{})})]});return f.jsx(Oe.ColorPicker,{open:u,defaultValue:d.colorPrimary,styles:{popupOverlayInner:{width:a||420}},panelRender:b,size:"small",arrow:!1,value:m,onChangeComplete:E=>h(E.toHexString()),onOpenChange:E=>{E||(l?.(m),p(E))},placement:"bottom",children:f.jsx(G.Button,{id:e,title:t,status:"no-background",className:"!p-1.5 !px-2 !max-h-none !rounded !border-none hover:!bg-neutral-100 dark:hover:!bg-black-600",onClick:()=>p(!0),children:r?f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("div",{className:"flex flex-col items-center relative",children:[r,f.jsx("div",{className:"pb-1 w-full rounded-lg border border-gray-200 dark:border-black-400",style:{backgroundColor:n}})]}),s&&f.jsx("span",{className:"min-w-max text-xs",children:t})]}):f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"w-full h-full rounded-sm",style:{backgroundColor:n}}),s&&f.jsx("span",{className:"min-w-max text-xs",children:t})]})})})},hf=()=>{const{editor:e}=lt(),{fontSize:t,isSubscript:n,isSuperscript:r}=Dn();if(!e)return{handleFontFamilyChange:()=>{},handleFontSizeChange:()=>{},increaseFontSize:()=>{},decreaseFontSize:()=>{},handleSuperscriptToggle:()=>{},handleSubscriptToggle:()=>{},handleToggleBold:()=>{},handleToggleItalic:()=>{},handleToggleUnderline:()=>{},handleToggleStrike:()=>{},handleSetColor:T=>{},handleUnsetColor:()=>{},handleSetBackgroundColor:T=>{},handleUnsetBackgroundColor:()=>{},handleSetHighlightColor:T=>{},handleUnsetHighlightColor:()=>{},isEditable:!1};const i=T=>{e?.commands?.setFontFamily&&e.chain().focus().setFontFamily(T).run()},o=T=>{T&&e.chain().focus().setFontSize(T+"pt").setSelectedListItemMarkerFontSize(T+"pt").setSelectedTaskItemMarkerFontSize(T+"pt").run()},a=()=>{const T=t;if(T&&!isNaN(T)){const x=T+1;e.chain().focus().setFontSize(x+"pt").setSelectedListItemMarkerFontSize(x+"pt").setSelectedTaskItemMarkerFontSize(x+"pt").run()}},s=()=>{const T=t;if(T&&!isNaN(T)&&T>1){const x=T-1;e.chain().focus().setFontSize(x+"pt").setSelectedListItemMarkerFontSize(x+"pt").setSelectedTaskItemMarkerFontSize(x+"pt").run()}},l=()=>{n&&e.chain().focus().unsetSubscript().run(),e.chain().focus().toggleSuperscript().run()},c=()=>{r&&e.chain().focus().unsetSuperscript().run(),e.chain().focus().toggleSubscript().run()},d=()=>{e.chain().focus().toggleBold().run()},u=()=>{e.chain().focus().toggleItalic().run()},p=()=>{e.chain().focus().toggleUnderline().run()},m=()=>{e.chain().focus().toggleStrike().run()},_=T=>{e.chain().focus().setColor(T).setSelectedListItemMarkerColor(T).setSelectedTaskItemMarkerColor(T).run()},h=()=>{e.chain().focus().unsetColor().setSelectedListItemMarkerColor(null).setSelectedTaskItemMarkerColor(null).run()},g=T=>{e.chain().focus().setBackgroundColor(T).run()},b=()=>{e.chain().focus().unsetBackgroundColor().run()},E=T=>{e.chain().focus().toggleHighlight({color:T}).run()},S=()=>{e.chain().focus().unsetHighlight().run()},y=e.isEditable;return{handleFontFamilyChange:i,handleFontSizeChange:o,increaseFontSize:a,decreaseFontSize:s,handleSuperscriptToggle:l,handleSubscriptToggle:c,handleToggleBold:d,handleToggleItalic:u,handleToggleUnderline:p,handleToggleStrike:m,handleSetColor:_,handleUnsetColor:h,handleSetBackgroundColor:g,handleUnsetBackgroundColor:b,handleSetHighlightColor:E,handleUnsetHighlightColor:S,isEditable:y}},Zo=(e=!1)=>`!p-1.5 !max-h-none !rounded hover:!bg-neutral-100 dark:hover:!bg-black-600 ${e?"!bg-neutral-200 dark:!bg-black-600":"!bg-transparent"}`,KB=()=>{const{fontFamily:e,fontSize:t,canSuperscript:n,isSuperscript:r,canSubscript:i,isSubscript:o,selectionColor:a,selectionBackgroundColor:s,canBold:l,isBold:c,canItalic:d,isItalic:u,canUnderline:p,isUnderline:m,canStrike:_,isStrike:h}=Dn(),{handleFontFamilyChange:g,handleFontSizeChange:b,handleSuperscriptToggle:E,handleSubscriptToggle:S,handleSetColor:y,handleUnsetColor:T,handleSetBackgroundColor:x,handleUnsetBackgroundColor:v,handleToggleBold:C,handleToggleItalic:O,handleToggleUnderline:w,handleToggleStrike:z}=hf();return f.jsxs(f.Fragment,{children:[f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(Oe.Dropdown,{menu:{items:Bb.map(N=>({label:f.jsx("span",{style:{fontFamily:N.value},children:N.label}),key:N.value,onClick:()=>g(N.value)})),style:{maxHeight:"256px",overflow:"auto"}},className:"px-2 w-24 cursor-pointer",children:f.jsxs("div",{className:"flex items-center gap-1 justify-between h-6",children:[f.jsx("span",{className:"text-sm truncate dark:text-black-100",children:Bb.find(N=>N.value===e)?.label}),f.jsx(ee.ArrowDropDownOutlined,{className:"text-gray-500 dark:text-black-300 hover:opacity-50"})]})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsxs(Oe.Space.Compact,{className:"cursor-pointer hidden-spin h-6",children:[f.jsx("input",{type:"number",value:t,onChange:N=>{const P=Number(N.target.value);P>=6&&P<=128?b(P):P<6?b(6):P>128&&b(128)},min:6,max:128,className:`text-right w-8 h-6 border-0 outline-none bg-transparent dark:text-black-100
209
209
  [appearance:textfield]
210
210
  [&::-webkit-outer-spin-button]:appearance-none
211
211
  [&::-webkit-inner-spin-button]:appearance-none`}),f.jsx(Oe.Dropdown,{menu:{items:$A.map(N=>({label:N.label,key:N.value,onClick:()=>b(N.value)}))},placement:"bottomRight",popupRender:N=>f.jsx("div",{className:"w-18 max-h-64 rounded-md overflow-auto bg-white dark:bg-black-800",children:N}),children:f.jsx(ee.ArrowDropDownOutlined,{className:"text-gray-500 dark:text-black-300 hover:opacity-50"})})]})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(Si,{})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"toolbar-bold",title:"Bold",status:"no-background",className:Zo(c)+" !border-none",onClick:C,disabled:!l,children:f.jsx(ee.FormatBold,{fontSize:"medium"})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"toolbar-italic",title:"Italic",status:"no-background",className:Zo(u)+" !border-none",onClick:O,disabled:!d,children:f.jsx(ee.FormatItalic,{fontSize:"medium"})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"toolbar-underline",title:"Underline",status:"no-background",className:Zo(m)+" !border-none",onClick:w,disabled:!p,children:f.jsx(ee.FormatUnderlined,{fontSize:"medium"})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"toolbar-strikethrough",title:"Strikethrough",status:"no-background",className:Zo(h)+" !border-none",onClick:z,disabled:!_,children:f.jsx(ee.FormatStrikethrough,{fontSize:"medium"})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"toolbar-superscript",title:"Superscript",status:"no-background",className:Zo(r)+" !border-none",onClick:E,disabled:!n,children:f.jsx(ee.Superscript,{fontSize:"medium"})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"toolbar-subscript",title:"Subscript",status:"no-background",className:Zo(o)+" !border-none",onClick:S,disabled:!i,children:f.jsx(ee.Subscript,{fontSize:"medium"})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(_f,{id:"selectionColor",title:"Text Color",showNone:!1,value:a,icon:f.jsx(ie,{name:"a-icon",strokeWidth:1.5,className:"pb-[1px]",size:19}),onColorSelect:N=>y(N),onResetColor:T})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(_f,{id:"selectionBackgroundColor",title:"Background Color",showNone:!1,value:s,icon:f.jsx(ie,{name:"color-fill",strokeWidth:2.5,size:20}),onColorSelect:N=>x(N),onResetColor:v})})]})},Cd=()=>{const{editor:e}=lt(),t=()=>e?e.isActive("taskList")?"task":e.isActive("bulletList")?`bullet:${e.getAttributes("bulletList")?.listType??"default"}`:e.isActive("orderedList")?`ordered:${e.getAttributes("orderedList")?.listType??"decimal"}`:"none":"none",n=()=>{if(!e)return null;const{from:b,to:E,$from:S}=e.state.selection;if(b!==E)return{from:b,to:E};for(let y=S.depth;y>0;y--)if(S.node(y).isTextblock)return{from:S.start(y),to:S.end(y)};return null},r=(b,E)=>{if(!e||b===E)return;const S=e.storage?.redline;if(!S?.isActive)return;const y=n();if(!y||y.from>=y.to)return;let T=!1;if(e.state.doc.nodesBetween(y.from,y.to,k=>{if(k.isText&&k.marks.some(M=>M.type.name==="userDeletion"||M.type.name==="aiDeletion"?!0:M.type.name==="userInsertion"||M.type.name==="aiInsertion"?!M.attrs.formatChanges||M.attrs.linkData:!1))return T=!0,!1}),T)return;const v=(S.mode||"user")==="ai"?"aiInsertion":"userInsertion",C=e.state.schema.marks[v];if(!C)return;const w=e.extensionManager.extensions.find(k=>k.name==="redline")?.options?.currentEntity||{id:"unknown",name:"User"},N=e.state.doc.nodeAt(y.from)?.marks.find(k=>k.type.name===v&&k.attrs.formatChanges);let P={list:{old:b,new:E}},I=new Date().toISOString();if(N?.attrs.formatChanges)try{const k=JSON.parse(N.attrs.formatChanges);P={...k,list:k.list?{old:k.list.old,new:E}:{old:b,new:E}},I=N.attrs.timestamp||I,P.list.old===P.list.new&&delete P.list}catch{P={list:{old:b,new:E}}}const R=e.state.tr;N&&R.removeMark(y.from,y.to,C),Object.keys(P).length>0&&(R.addMark(y.from,y.to,C.create({userId:w.id,userName:w.name,timestamp:I,formatChanges:JSON.stringify(P)})),e.view.dispatch(R))},i=()=>e?.chain().focus().command(({tr:b})=>(b.setMeta(ts,!0),!0));return{handleToggleTaskList:()=>{if(!e)return;const b=t();i()?.toggleTaskList().run(),r(b,t())},handleIndent:()=>{e&&(e.isActive("taskItem")?e.chain().focus().sinkListItem("taskItem").run():e.isActive("listItem")?e.chain().focus().sinkListItem("listItem").run():e.commands.indent())},handleOutdent:()=>{e&&(e.isActive("taskItem")?e.chain().focus().liftListItem("taskItem").run():e.isActive("listItem")?e.chain().focus().liftListItem("listItem").run():e.commands.outdent())},handleToggleOrderedList:()=>{if(!e)return;const b=t();i()?.toggleList("orderedList","listItem").run(),r(b,t())},handleListTypeChange:b=>{if(!e)return;const E=t(),S=i();S&&(e.isActive("orderedList")||S.toggleList("orderedList","listItem"),S.updateAttributes("orderedList",{listType:b}).run(),r(E,t()))},handleToggleUnorderedList:()=>{if(!e)return;const b=t();i()?.toggleList("bulletList","listItem").run(),r(b,t())},handleUnorderedListTypeChange:b=>{if(!e)return;const E=t(),S=i();S&&(e.isActive("bulletList")||S.toggleList("bulletList","listItem"),S.updateAttributes("bulletList",{listType:b}).run(),r(E,t()))},handleTextAlignLeft:()=>{e&&e.chain().setTextAlign("left").run()},handleTextAlignCenter:()=>{e&&e.chain().setTextAlign("center").run()},handleTextAlignRight:()=>{e&&e.chain().setTextAlign("right").run()},handleTextAlignJustify:()=>{e&&e.chain().setTextAlign("justify").run()},handleToggleBlockquote:()=>{e&&e.chain().focus().toggleBlockquote().run()}}},Sr=({delay:e=0,className:t=""})=>f.jsx(i_.motion.div,{className:`w-full h-1.5 bg-gray-200 rounded-sm overflow-hidden relative ${t}`,initial:{opacity:.6},animate:{opacity:[.6,1,.6]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut",delay:e},children:f.jsx(i_.motion.div,{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white to-transparent",animate:{x:["-100%","100%"]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut",delay:e}})}),QB=({onClose:e})=>{const{isUnorderedList:t,currentUnorderedListType:n}=Dn(),{handleUnorderedListTypeChange:r}=Cd();return f.jsx("div",{className:"p-3 bg-white dark:bg-black-800 rounded shadow-lg border border-gray-200 dark:border-black-600",style:{minWidth:"300px"},children:QA.map((i,o)=>f.jsx("div",{className:"flex gap-2 mb-2 last:mb-0",children:i.map(a=>f.jsx("button",{onClick:()=>{r(a.key),e()},className:`flex-1 p-2 border rounded hover:border-primary-400 hover:bg-gray-50 dark:hover:bg-black-700 transition-all ${t&&n===a.key?"border-primary-500 bg-primary-50 dark:bg-primary-950 ring-1 ring-primary-200":"border-gray-300 dark:border-black-500 bg-white dark:bg-black-700"}`,children:f.jsxs("div",{className:"text-left text-xs leading-relaxed",children:[f.jsxs("div",{className:"text-gray-800 dark:text-black-200 text-xs flex gap-1 items-center w-full",children:[a.main[0],f.jsx(Sr,{delay:0})]}),f.jsxs("div",{className:"text-gray-700 dark:text-black-300 ml-5 text-xs flex gap-1 items-center w-[calc(100%_-_20px)]",children:[a.nested[0],f.jsx(Sr,{delay:.1})]}),f.jsxs("div",{className:"text-gray-700 dark:text-black-300 ml-5 text-xs flex gap-1 items-center w-[calc(100%_-_20px)]",children:[a.nested[1],f.jsx(Sr,{delay:.2})]}),f.jsxs("div",{className:"text-gray-700 dark:text-black-300 ml-10 text-xs flex gap-1 items-center w-[calc(100%_-_40px)]",children:[a.deepNested[0],f.jsx(Sr,{delay:.3})]}),f.jsxs("div",{className:"text-gray-800 dark:text-black-200 text-xs flex gap-1 items-center w-full",children:[a.main[1],f.jsx(Sr,{delay:.4})]})]})},a.key))},o))})},XB=({onClose:e})=>{const{isOrderedList:t,currentOrderedListType:n}=Dn(),{handleListTypeChange:r}=Cd();return f.jsx("div",{className:"p-3 bg-white dark:bg-black-800 rounded shadow-lg border border-gray-200 dark:border-black-600",style:{minWidth:"300px"},children:KA.map((i,o)=>f.jsx("div",{className:"flex gap-2 mb-2 last:mb-0",children:i.map(a=>f.jsx("button",{onClick:()=>{r(a.key),e()},className:`flex-1 p-2 border rounded hover:border-primary-400 hover:bg-gray-50 dark:hover:bg-black-700 transition-all ${t&&n===a.key?"border-primary-500 bg-primary-50 dark:bg-primary-950 ring-1 ring-primary-200":"border-gray-300 dark:border-black-500 bg-white dark:bg-black-700"}`,children:f.jsxs("div",{className:"text-left text-xs leading-relaxed",children:[f.jsxs("div",{className:"text-gray-800 dark:text-black-200 text-xs flex gap-1 items-center w-full",children:[a.main[0],f.jsx(Sr,{delay:0})]}),f.jsxs("div",{className:"text-gray-700 dark:text-black-300 ml-5 text-xs flex gap-1 items-center w-[calc(100%_-_20px)]",children:[a.nested[0],f.jsx(Sr,{delay:.1})]}),f.jsxs("div",{className:"text-gray-700 dark:text-black-300 ml-5 text-xs flex gap-1 items-center w-[calc(100%_-_20px)]",children:[a.nested[1],f.jsx(Sr,{delay:.2})]}),f.jsxs("div",{className:"text-gray-700 dark:text-black-300 ml-10 text-xs flex gap-1 items-center w-[calc(100%_-_40px)]",children:[a.deepNested[0],f.jsx(Sr,{delay:.3})]}),f.jsxs("div",{className:"text-gray-800 dark:text-black-200 text-xs flex gap-1 items-center w-full",children:[a.main[1],f.jsx(Sr,{delay:.4})]})]})},a.key))},o))})},gf=()=>{const{editor:e}=lt(),[t,n]=A.useState(""),[r,i]=A.useState(!1),o=({state:p})=>{const{from:m,to:_}=p.selection;return m!==_?!1:p.doc.resolve(m).marks().some(g=>g.type.name==="link")},a=()=>{t&&(navigator.clipboard.writeText(t),i(!0),setTimeout(()=>i(!1),200))},s=()=>{e&&e.chain().focus().unsetLink().run()},l=p=>{if(!p||!p.trim())return null;let m=p.trim();/^https?:\/\//i.test(m)||(m=`https://${m}`);try{return new URL(m).href}catch{return null}},c=(p,m,_)=>{if(!e||!p)return;const h=l(p);if(!h)return;const{from:g,to:b}=_??e.state.selection;if(m&&!(g!==b)){const S=g;e.chain().focus().setTextSelection({from:g,to:b}).insertContent(m).setTextSelection({from:S,to:S+m.length}).setLink({href:h}).run()}else e.chain().focus().setTextSelection({from:g,to:b}).setLink({href:h}).run()},d=p=>{if(!e||!p)return;const m=l(p);m&&e.chain().focus().extendMarkRange("link").setLink({href:m}).run()},u=()=>{if(!e)return{initialUrl:"",initialText:"",selectionRange:{from:0,to:0}};const{state:p}=e,{from:m,to:_}=p.selection,h=p.doc.textBetween(m,_," ");return{initialUrl:e.getAttributes("link").href||"",initialText:h,selectionRange:{from:m,to:_}}};return A.useEffect(()=>{if(!e)return;const p=()=>{const m=e.getAttributes("link").href||"";n(m)};return p(),e.on("selectionUpdate",p),e.on("transaction",p),()=>{e.off("selectionUpdate",p),e.off("transaction",p)}},[e]),{linkUrl:t,copied:r,shouldShowLinkOnBubbleMenu:o,handleCopy:a,handleRemove:s,handleInsertLink:c,handleEditLink:d,getSelectionLinkValues:u}},Jo={INSERT:"insert",EDIT:"edit"},s1=({mode:e,initialUrl:t="",initialText:n="",selectionRange:r,onSubmit:i,onCancel:o})=>{const[a,s]=A.useState(t),[l,c]=A.useState(n),{handleInsertLink:d,handleEditLink:u}=gf(),p=!!r&&r.from!==r.to,m=e===Jo.EDIT||p||l.trim().length>0,_=()=>{s(""),c("")},h=()=>{a&&(e===Jo.EDIT?u(a):d(a,l,r),_(),i?.())},g=b=>{b.key==="Enter"?(b.preventDefault(),h()):b.key==="Escape"&&(_(),o?.())};return A.useEffect(()=>{s(t),c(n)},[t,n]),f.jsx("div",{className:"min-w-[320px]",onClick:b=>{b.stopPropagation(),b.preventDefault()},children:f.jsxs("div",{className:"space-y-3",children:[f.jsx(G.InputField,{id:"link-url",label:"URL",placeholder:"https://example.com",value:a,onChange:s,onKeyDown:g,inputProps:{autoFocus:!0}}),e===Jo.INSERT&&f.jsx(G.InputField,{id:"link-text",label:"Text (optional)",placeholder:"Link text",value:l,onChange:c,onKeyDown:g}),f.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[f.jsx(G.Button,{id:"link-cancel-btn",status:"secondary-neutral",onClick:o,children:"Cancel"}),f.jsx(G.Button,{id:"link-submit-btn",status:"primary",onClick:h,disabled:!a||!m,children:e===Jo.EDIT?"Update":"Insert"})]})]})})},l1=()=>{const{editor:e}=lt(),{getSelectionLinkValues:t}=gf(),[n,r]=A.useState(!1),[i,o]=A.useState(t()),a=A.useCallback(()=>r(!1),[]),s=A.useCallback(()=>{o(t()),r(!0)},[t]);return f.jsx(Oe.Popover,{content:f.jsx(s1,{mode:Jo.INSERT,...i,onSubmit:a,onCancel:a}),trigger:"click",placement:"bottom",arrow:!1,open:n,onOpenChange:r,children:f.jsx("div",{onMouseDown:l=>{e&&o(t()),l.preventDefault()},children:f.jsx(G.Button,{id:"insert-link-btn",status:"no-background",className:"!p-1.5 !max-h-none !rounded !bg-transparent hover:!bg-neutral-100 dark:hover:!bg-black-600 !border-none",onClick:s,title:"Insert Link",children:f.jsx("div",{className:"relative flex items-center gap-1",children:f.jsx(ee.InsertLink,{fontSize:"medium"})})})})})},ZB=[{label:"Single Line",value:"single-line"},{label:"Double Line",value:"double-line"},{label:"Dotted Line",value:"dotted-line"},{label:"Dashed Line",value:"dashed-line"},{label:"Double Dashed Line",value:"double-dashed-line"},{label:"Thick Single Line",value:"thick-single-line"},{label:"Thick and Thick Line Top",value:"thick-and-thick-line-top"},{label:"Thick and Thick Line Bottom",value:"thick-and-thick-line-bottom"},{label:"Wavy Line",value:"wavy-line"}],JB=({onClose:e})=>{const{editor:t}=lt(),n=r=>{t.commands.setHorizontalRule({styleType:r}),e()};return f.jsxs("div",{className:"w-56 divider-preview",children:[f.jsx("div",{className:"px-2 pb-2 text-sm font-medium text-gray-800 dark:text-black-200 border-b dark:border-black-600",children:"Divider Style"}),f.jsx("div",{className:"py-2 max-h-96 overflow-y-auto",children:ZB.map(r=>f.jsx("div",{className:"px-2 py-3 hover:bg-gray-100 dark:hover:bg-black-600 rounded-md cursor-pointer transition-colors",onClick:()=>n(r.value),title:r.label,children:f.jsx("hr",{className:`hr--${r.value} !m-0`,style:{backgroundSize:r.value==="wavy-line"?"300% 8px":""}})},r.value))})]})};function eF(){if(console&&console.warn){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];ro(t[0])&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t)}}const c1={};function bf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];ro(t[0])&&c1[t[0]]||(ro(t[0])&&(c1[t[0]]=new Date),eF(...t))}const d1=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},u1=(e,t,n)=>{e.loadNamespaces(t,d1(e,n))},p1=(e,t,n,r)=>{ro(n)&&(n=[n]),n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,d1(e,r))},tF=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(s,l)=>{const c=t.services.backendConnector.state[`${s}|${l}`];return c===-1||c===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(r,e)&&(!i||a(o,e)))},nF=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!t.languages||!t.languages.length?(bf("i18n.languages were undefined or empty",t.languages),!0):t.options.ignoreJSONStructure!==void 0?t.hasLoadedNamespace(e,{lng:n.lng,precheck:(i,o)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,e))return!1}}):tF(e,t,n)},ro=e=>typeof e=="string",rF=e=>typeof e=="object"&&e!==null,iF=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,oF={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},aF=e=>oF[e];let sF={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(iF,aF)};const lF=()=>sF;let cF;const dF=()=>cF,uF=A.createContext();class pF{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces=()=>Object.keys(this.usedNamespaces)}const mF=(e,t)=>{const n=A.useRef();return A.useEffect(()=>{n.current=e},[e,t]),n.current},m1=(e,t,n,r)=>e.getFixedT(t,n,r),fF=(e,t,n,r)=>A.useCallback(m1(e,t,n,r),[e,t,n,r]),_F=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=t,{i18n:r,defaultNS:i}=A.useContext(uF)||{},o=n||r||dF();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new pF),!o){bf("You will need to pass in an i18next instance by using initReactI18next");const y=(x,v)=>ro(v)?v:rF(v)&&ro(v.defaultValue)?v.defaultValue:Array.isArray(x)?x[x.length-1]:x,T=[y,{},!1];return T.t=y,T.i18n={},T.ready=!1,T}o.options.react&&o.options.react.wait!==void 0&&bf("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...lF(),...o.options.react,...t},{useSuspense:s,keyPrefix:l}=a;let c=i||o.options&&o.options.defaultNS;c=ro(c)?[c]:c||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(c);const d=(o.isInitialized||o.initializedStoreOnce)&&c.every(y=>nF(y,o,a)),u=fF(o,t.lng||null,a.nsMode==="fallback"?c:c[0],l),p=()=>u,m=()=>m1(o,t.lng||null,a.nsMode==="fallback"?c:c[0],l),[_,h]=A.useState(p);let g=c.join();t.lng&&(g=`${t.lng}${g}`);const b=mF(g),E=A.useRef(!0);A.useEffect(()=>{const{bindI18n:y,bindI18nStore:T}=a;E.current=!0,!d&&!s&&(t.lng?p1(o,t.lng,c,()=>{E.current&&h(m)}):u1(o,c,()=>{E.current&&h(m)})),d&&b&&b!==g&&E.current&&h(m);const x=()=>{E.current&&h(m)};return y&&o&&o.on(y,x),T&&o&&o.store.on(T,x),()=>{E.current=!1,y&&o&&y.split(" ").forEach(v=>o.off(v,x)),T&&o&&T.split(" ").forEach(v=>o.store.off(v,x))}},[o,g]),A.useEffect(()=>{E.current&&d&&h(p)},[o,l,d]);const S=[_,o,d];if(S.t=_,S.i18n=o,S.ready=d,d||!d&&!s)return S;throw new Promise(y=>{t.lng?p1(o,t.lng,c,()=>y()):u1(o,c,()=>y())})},hF=({open:e,initialValue:t,onApply:n,onCancel:r})=>{const[i,o]=A.useState(t||"1.5"),a=A.useRef(null),{t:s}=_F();A.useEffect(()=>{e&&(o(t||"1.5"),setTimeout(()=>a.current?.select(),100))},[e,t]);const l=parseFloat(i),c=!isNaN(l)&&l>=.5&&l<=10,d=A.useCallback(()=>{c&&n(String(l))},[c,l,n]);return f.jsx(Oe.Modal,{open:e,title:s("Custom Line Height"),onCancel:r,width:360,centered:!0,footer:f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(G.Button,{id:"custom-lh-cancel",status:"secondary-neutral",onClick:r,children:s("Cancel")}),f.jsx(G.Button,{id:"custom-lh-apply",status:"primary",onClick:d,disabled:!c,children:s("Apply")})]}),children:f.jsxs("div",{className:"py-2",children:[f.jsx("label",{className:"block text-xs text-neutral-600 dark:text-black-300 mb-1.5",children:"Value (0.5 – 10)"}),f.jsx("input",{ref:a,type:"number",step:"0.1",min:"0.5",max:"10",value:i,onChange:u=>o(u.target.value),onKeyDown:u=>{u.key==="Enter"&&d(),u.key==="Escape"&&r()},className:"w-full px-3 py-2 text-sm border border-neutral-300 dark:border-black-500 rounded-md bg-white dark:bg-black-700 text-neutral-900 dark:text-neutral-100 focus:outline-none focus:border-primary-500 focus:ring-1 focus:ring-primary-500 [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"}),i&&!c&&f.jsx("p",{className:"text-xs text-red-500 mt-1",children:s("Enter a value between 0.5 and 10")})]})})},gF=()=>{const{lineHeight:e}=Dn(),{editor:t}=lt(),[n,r]=A.useState(!1),i=a=>{a===e?t.commands.unsetLineHeight():t.commands.setLineHeight(a)},o=[...WA.map(a=>({label:f.jsxs("div",{className:"flex items-center justify-between w-full min-w-[120px]",children:[f.jsx("span",{children:a.label}),e===a.value&&f.jsx(ie,{name:"check",size:14,strokeWidth:3,className:"text-primary-500"})]}),key:a.value,onClick:()=>i(a.value)})),{type:"divider"},{key:"reset",label:f.jsx("span",{className:"text-neutral-500 dark:text-black-300",children:"Reset"}),disabled:!e,onClick:()=>t.commands.unsetLineHeight()},{type:"divider"},{key:"custom",label:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(ie,{name:"edit",size:14,strokeWidth:2}),f.jsx("span",{children:"Custom"})]}),onClick:()=>r(!0)}];return f.jsxs(f.Fragment,{children:[f.jsx(Oe.Tooltip,{title:"Line Spacing",placement:"top",arrow:!1,mouseEnterDelay:.3,children:f.jsx("div",{children:f.jsx(Oe.Dropdown,{menu:{items:o},placement:"bottomLeft",trigger:["click"],children:f.jsxs("div",{className:"flex items-center gap-0.5 px-1.5 py-2.5 dark:text-black-100 cursor-pointer rounded hover:bg-neutral-100 dark:hover:bg-black-600",children:[f.jsx(ie,{name:"line-height",size:18}),f.jsx(ee.ArrowDropDownOutlined,{className:"text-gray-500 dark:text-black-300",sx:{fontSize:"16px"}})]})})})}),f.jsx(hF,{open:n,initialValue:e,onApply:a=>{t.commands.setLineHeight(a),r(!1)},onCancel:()=>r(!1)})]})},ea=(e=!1,t="")=>`!p-1.5 !max-h-none !rounded hover:!bg-neutral-100 dark:hover:!bg-black-600 ${e?"!bg-neutral-200 dark:!bg-black-600":"!bg-transparent"} ${t}`.trim(),bF=(e=!1,t="")=>`!p-1.5 !max-h-none !rounded hover:!bg-neutral-100 dark:hover:!bg-black-600 ${e?"!bg-neutral-200 dark:!bg-black-600":"!bg-transparent"} ${t}`.trim(),EF=()=>{const{isTaskList:e,canIndent:t,canOutdent:n,isOrderedList:r,isUnorderedList:i,isBlockquote:o,canBlockquote:a,isTextAlignLeft:s,isTextAlignCenter:l,isTextAlignRight:c,isTextAlignJustify:d}=Dn(),{handleToggleTaskList:u,handleIndent:p,handleOutdent:m,handleToggleOrderedList:_,handleToggleUnorderedList:h,handleToggleBlockquote:g,handleTextAlignLeft:b,handleTextAlignCenter:E,handleTextAlignRight:S,handleTextAlignJustify:y}=Cd(),[T,x]=A.useState(!1),[v,C]=A.useState(!1),[O,w]=A.useState(!1);return f.jsxs(f.Fragment,{children:[f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(gF,{})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"align-left",title:"Align Left",onClick:b,status:"no-background",className:`!p-1.5 !max-h-none !rounded !border-none hover:!bg-neutral-100 dark:hover:!bg-black-600 ${s?"!bg-neutral-200 dark:!bg-black-600":""}`,children:f.jsx(ee.FormatAlignLeft,{fontSize:"medium"})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"align-center",title:"Align Center",onClick:E,status:"no-background",className:`!p-1.5 !max-h-none !rounded !border-none hover:!bg-neutral-100 dark:hover:!bg-black-600 ${l?"!bg-neutral-200 dark:!bg-black-600":""}`,children:f.jsx(ee.FormatAlignCenter,{fontSize:"medium"})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"align-right",title:"Align Right",onClick:S,status:"no-background",className:`!p-1.5 !max-h-none !rounded !border-none hover:!bg-neutral-100 dark:hover:!bg-black-600 ${c?"!bg-neutral-200 dark:!bg-black-600":""}`,children:f.jsx(ee.FormatAlignRight,{fontSize:"medium"})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"align-justify",title:"Justify",onClick:y,status:"no-background",className:`!p-1.5 !max-h-none !rounded !border-none hover:!bg-neutral-100 dark:hover:!bg-black-600 ${d?"!bg-neutral-200 dark:!bg-black-600":""}`,children:f.jsx(ee.FormatAlignJustify,{fontSize:"medium"})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsxs(Oe.Space.Compact,{className:`flex items-center ${i?"bg-black-100 dark:bg-black-600":""}`,title:"Bullet list",children:[f.jsx(G.Button,{id:"toolbar-toggle-unordered-list",status:"no-background",className:ea()+" !border-none",onClick:h,children:f.jsx(ee.FormatListBulleted,{fontSize:"medium"})}),f.jsx(Oe.Tooltip,{placement:"top",arrow:!1,color:"black",mouseEnterDelay:.3,children:f.jsx(Oe.Dropdown,{popupRender:()=>f.jsx(QB,{onClose:()=>C(!1)}),trigger:["click"],open:v,onOpenChange:C,children:f.jsx(ee.ArrowDropDownOutlined,{className:"text-neutral-600 hover:opacity-75 hover:bg-black-100 dark:hover:bg-black-500 cursor-pointer",sx:{fontSize:"18px"}})})})]})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsxs(Oe.Space.Compact,{className:`flex items-center ${r?"bg-black-100 dark:bg-black-600":""}`,title:"Numbered list",children:[f.jsx(G.Button,{id:"toolbar-toggle-ordered-list",status:"no-background",className:ea()+" !border-none",onClick:_,children:f.jsx(ee.FormatListNumbered,{fontSize:"medium"})}),f.jsx(Oe.Tooltip,{placement:"top",arrow:!1,color:"black",mouseEnterDelay:.3,children:f.jsx(Oe.Dropdown,{popupRender:()=>f.jsx(XB,{onClose:()=>x(!1)}),trigger:["click"],open:T,onOpenChange:x,children:f.jsx(ee.ArrowDropDownOutlined,{className:"text-neutral-600 hover:opacity-75 hover:bg-black-100 dark:hover:bg-black-500 cursor-pointer",sx:{fontSize:"18px"}})})})]})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"toolbar-toggle-tasklist",title:"Checklist",status:"no-background",className:ea(e,"mr-1 !p-2 !border-none"),onClick:u,disabled:!1,children:f.jsx(ie,{name:"task-list",size:20})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"toolbar-indent-increase",title:"Increase Indent",status:"no-background",className:ea()+" !border-none",onClick:p,disabled:!t,children:f.jsx(ee.FormatIndentIncrease,{fontSize:"medium"})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"toolbar-indent-decrease",title:"Decrease Indent",status:"no-background",className:ea()+" !border-none",onClick:m,disabled:!n,children:f.jsx(ee.FormatIndentDecrease,{fontSize:"medium"})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(Oe.Popover,{content:f.jsx(JB,{onClose:()=>w(!1)}),trigger:"click",placement:"bottom",arrow:!1,open:O,onOpenChange:w,children:f.jsx(G.Button,{id:"toolbar-insert-divider",title:"Insert Divider",status:"no-background",className:bF()+" !border-none",children:f.jsx(ee.LineStyle,{fontSize:"medium"})})})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(l1,{})}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(G.Button,{id:"toolbar-toggle-blockquote",title:"Blockquote",status:"no-background",className:ea(o,"!p-2.5 !border-none"),onClick:g,disabled:!a,children:f.jsx(ie,{name:"quote"})})})]})},f1=[{label:"Regular",value:"paragraph"},{label:"Title 1",value:"h1"},{label:"Title 2",value:"h2"},{label:"Title 3",value:"h3"},{label:"Title 4",value:"h4"},{label:"Title 5",value:"h5"},{label:"Title 6",value:"h6"}],_1={h1:{fontSize:"1.5rem",fontWeight:"bold",lineHeight:"1.2"},h2:{fontSize:"1.25rem",fontWeight:"bold",lineHeight:"1.2"},h3:{fontSize:"1.1rem",fontWeight:"bold",lineHeight:"1.2"},h4:{fontSize:"1rem",fontWeight:"bold",lineHeight:"1.2"},h5:{fontSize:"0.875rem",fontWeight:"bold",lineHeight:"1.2"},h6:{fontSize:"0.75rem",fontWeight:"bold",lineHeight:"1.2"},paragraph:{fontSize:"0.875rem",fontWeight:"normal",lineHeight:"1.2"}},SF=()=>{const{editor:e}=lt(),t=()=>{if(!e)return"paragraph";const a=e.getAttributes("heading")?.level;return a?`h${a}`:"paragraph"},n=()=>{if(!e)return null;const{from:a,to:s,$from:l}=e.state.selection;if(a!==s)return{from:a,to:s};for(let c=l.depth;c>0;c--)if(l.node(c).isTextblock)return{from:l.start(c),to:l.end(c)};return null},r=(a,s)=>{if(!e||a===s)return;const l=e.storage?.redline;if(!l?.isActive)return;const c=n();if(!c||c.from>=c.to)return;let d=!1;if(e.state.doc.nodesBetween(c.from,c.to,T=>{if(T.isText&&T.marks.some(x=>x.type.name==="userDeletion"||x.type.name==="aiDeletion"?!0:x.type.name==="userInsertion"||x.type.name==="aiInsertion"?!x.attrs.formatChanges||x.attrs.linkData:!1))return d=!0,!1}),d)return;const p=(l.mode||"user")==="ai"?"aiInsertion":"userInsertion",m=e.state.schema.marks[p];if(!m)return;const h=e.extensionManager.extensions.find(T=>T.name==="redline")?.options?.currentEntity||{id:"unknown",name:"User"},b=e.state.doc.nodeAt(c.from)?.marks.find(T=>T.type.name===p&&T.attrs.formatChanges);let E={heading:{old:a,new:s}},S=new Date().toISOString();if(b?.attrs.formatChanges)try{const T=JSON.parse(b.attrs.formatChanges);E={...T,heading:T.heading?{old:T.heading.old,new:s}:{old:a,new:s}},S=b.attrs.timestamp||S,E.heading.old===E.heading.new&&delete E.heading}catch{E={heading:{old:a,new:s}}}const y=e.state.tr;b&&y.removeMark(c.from,c.to,m),Object.keys(E).length>0&&(y.addMark(c.from,c.to,m.create({userId:h.id,userName:h.name,timestamp:S,formatChanges:JSON.stringify(E)})),e.view.dispatch(y))},i=()=>e?.chain().focus().command(({tr:a})=>(a.setMeta(ts,!0),!0));return{handleHeadingChange:a=>{if(!e)return;const s=t(),l=i();if(l){if(a==="paragraph")l.setParagraph().run();else if(typeof a=="string"&&a.startsWith("h")){const c=parseInt(a.substring(1),10);c>=1&&c<=6&&l.setHeading({level:c}).run()}r(s,t())}}}},TF=()=>{const{selectionHeadingLevel:e}=Dn(),{handleHeadingChange:t}=SF(),n=A.useRef(null),r=A.useRef(null),[i,o]=A.useState(!1),a=e==="paragraph"?e:`h${e}`;A.useEffect(()=>{if(!i)return;const l=c=>{const d=c.target,u=!n.current?.contains(d),p=!r.current?.contains(d);u&&p&&o(!1)};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[i]);const s=A.useCallback(l=>{const c=_1[l.value]||_1.paragraph;return f.jsx("span",{style:c,children:l.label})},[]);return f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(Oe.Dropdown,{menu:{items:f1?.map(l=>({key:l.value,label:s(l),onClick:()=>t(l.value)}))},className:"px-2 w-24 h-6 cursor-pointer",popupRender:l=>f.jsx("div",{className:"w-32 max-h-80 rounded-md bg-white dark:bg-black-800 dark:border dark:border-black-600 shadow-lg",children:l}),children:f.jsxs("div",{className:"flex items-center gap-1 justify-between text-neutral-900 dark:text-white",children:[f.jsx("span",{className:"text-sm truncate",children:f1.find(l=>l.value===a)?.label}),f.jsx(ee.ArrowDropDownOutlined,{className:"text-gray-500 dark:text-black-400 hover:opacity-50"})]})})})},yF=()=>f.jsxs(f.Fragment,{children:[f.jsx(a1,{}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(Si,{})}),f.jsx(TF,{}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(Si,{})}),f.jsx(KB,{}),f.jsx("div",{"data-responsive-item":"true",className:"inline-flex items-center shrink-0",children:f.jsx(Si,{})}),f.jsx(EF,{})]}),CF=()=>f.jsx("div",{className:"flex flex-wrap items-center gap-1",children:f.jsx(yF,{})}),vF=({activeTab:e})=>{switch(e){case"Text":return f.jsx(CF,{});case"Table":return f.jsx(jB,{});default:return null}},h1=e=>{const t=e.firstElementChild??e;return t.classList.contains("h-6")&&t.classList.contains("bg-neutral-300")},xF=({children:e})=>{const[t,n]=A.useState(!1),[r,i]=A.useState(0),[o,a]=A.useState(!1),s=A.useRef(null),l=A.useRef(null),c=A.useRef(null),d=A.useRef(null),u=A.useRef(null),p=A.useRef(null),m=b=>{if(!b)return[];const E=[];return Array.from(b.children).forEach(y=>{if(y.matches('[data-responsive-item="true"]')){E.push(y);return}const T=Array.from(y.querySelectorAll('[data-responsive-item="true"]'));T.length>0?E.push(...T):E.push(y)}),E},_=A.useCallback(()=>{if(!d.current)return;const b=m(d.current);for(let E=0;E<b.length;E++){const S=b[E];E<r?S.style.display="none":S.style.display=h1(S)?"none":""}},[r]),h=A.useCallback(()=>{if(!s.current||!l.current||!c.current)return;const b=m(s.current),E=m(c.current);if(b.length===0)return;const S=60,y=C=>{let O=0,w=0;for(let z=0;z<b.length;z++){const N=b[z],P=N.getBoundingClientRect(),I=window.getComputedStyle(N),R=parseFloat(I.marginLeft)||0,k=parseFloat(I.marginRight)||0,M=P.width+R+k;if(O+M<=C-120)O+=M,w=z+1;else break}return w},T=l.current.offsetWidth;let x=y(T);if(x<b.length&&(x=y(T-S)),x>0&&x<b.length){const C=x-1;h1(b[C])&&x--}const v=Math.max(0,Math.min(x,b.length));for(let C=0;C<E.length;C++)E[C].style.display=C<v?"":"none";n(v<b.length),i(v)},[]),g=A.useCallback(()=>{u.current!==null&&cancelAnimationFrame(u.current),u.current=requestAnimationFrame(()=>{h(),u.current=null})},[h]);return A.useEffect(()=>{g(),p.current=window.setTimeout(()=>{g()},80);const b=new ResizeObserver(()=>{g()});return l.current&&b.observe(l.current),l.current?.parentElement&&b.observe(l.current.parentElement),window.addEventListener("resize",g),()=>{p.current!==null&&window.clearTimeout(p.current),u.current!==null&&cancelAnimationFrame(u.current),b.disconnect(),window.removeEventListener("resize",g)}},[e,g]),A.useEffect(()=>{o&&requestAnimationFrame(_)},[e,o,_,r]),f.jsxs("div",{ref:l,className:"flex min-w-0 items-center gap-2 overflow-hidden flex-grow",children:[f.jsx("div",{ref:s,className:"flex items-center gap-2",style:{visibility:"hidden",position:"absolute",pointerEvents:"none",whiteSpace:"nowrap",top:0,left:10},children:e}),f.jsx("div",{ref:c,className:"flex items-center gap-2",children:e}),t&&f.jsx(Oe.Dropdown,{popupRender:()=>f.jsx("div",{ref:d,className:"max-w-[440px] flex flex-auto items-start gap-2 p-2 bg-white dark:bg-black-800 rounded-md shadow-lg border border-neutral-200 dark:border-black-600 [&_[data-responsive-item='true']]:shrink [&_[data-responsive-item='true']]:max-w-full",children:e}),trigger:["click"],placement:"bottomLeft",onOpenChange:b=>{a(b),b&&requestAnimationFrame(_)},children:f.jsx(G.Button,{id:"toolbar-overflow-menu",title:"More Options",status:"no-background",className:"!p-2 !max-h-none !rounded !bg-transparent hover:!bg-neutral-100 dark:hover:!bg-black-600 !border-none",children:f.jsx(ie,{name:"three-dots-vertical",size:18})})})]})},NF=({activeTab:e,setActiveTab:t})=>{const[n,r]=A.useState(!1),i=o=>o.toLowerCase()==="text"?f.jsx(ie,{name:"text-dropdown",size:"16px"}):f.jsx(ie,{name:"table-dropdown",strokeWidth:3,size:"16px"});return f.jsxs("div",{className:"flex items-center gap-2 bg-white dark:bg-black-800 w-full justify-between p-2 shadow-md dark:shadow-black-900 z-50",style:{height:"48px"},children:[f.jsx("div",{className:"flex flex-grow min-w-0 items-center gap-2",children:f.jsx(xF,{children:f.jsx(vF,{activeTab:e})})}),f.jsx(Oe.Dropdown,{menu:{items:Pb.map(o=>({label:f.jsx(G.OptionButton,{icon:i(o),onClick:()=>t(Ga(o)),text:Ga(o),className:"text-black-900 dark:text-white"}),key:o.toLowerCase(),size:"medium"})),selectedKeys:[e.toLowerCase()]},trigger:["click"],placement:"bottomLeft",onOpenChange:o=>r(o),overlayClassName:"row-option-cell",children:f.jsxs(G.Button,{id:"toolbar-tab-selector",title:"Toolbar Options",status:"no-background",className:"!p-1 !max-h-none !rounded w-28 !border-none",children:[f.jsxs("div",{className:"flex items-center gap-2 text-md dark:text-neutral-100",children:[i(e),f.jsx("span",{className:"text-sm",children:e})]}),f.jsx("div",{className:"transition-all duration-200 ease-in-out",children:f.jsx(ee.ArrowDropDown,{fontSize:"small",className:`transition-transform duration-200 ease-in-out ${n?"rotate-180":""}`})})]})})]})},RF=()=>{const[e,t]=A.useState(Pb[0]);return f.jsx(NF,{activeTab:e,setActiveTab:t})},g1=A.createContext(void 0),AF=({editorConfig:e,children:t,onPresentationModeToggle:n,pageConfig:r,setPageConfig:i})=>{const{editor:o}=lt(),[a,s]=A.useState(e?.mode||Gi.EDITING.value);return A.useEffect(()=>{o&&(a===Gi.SUGGESTING.value?(o.commands.toggleRedlineMode(!0,"user"),o.setEditable(!0)):a===Gi.VIEWING.value?(o.commands.toggleRedlineMode(!1),o.setEditable(!1)):(o.commands.toggleRedlineMode(!1),o.setEditable(!0)))},[a,o]),A.useEffect(()=>{e?.mode&&s(e.mode)},[e?.mode]),A.useEffect(()=>{e?.onEditModeChange?.(a)},[a,e,e?.onEditModeChange]),f.jsx(g1.Provider,{value:{onPresentationModeToggle:n,pageConfig:r,setPageConfig:i,editorConfig:e,currentMode:a,setCurrentMode:s},children:t})},vd=()=>{const e=A.useContext(g1);if(!e)throw new Error("useToolbar must be used within a ToolbarProvider");return e},OF=({selectedBGColor:e,setSelectedBGColor:t})=>{const{token:n}=Oe.theme.useToken(),{isDarkMode:r}=yd(),[i,o]=A.useState(!1),[a,s]=A.useState(e||"#FFFFFF"),l=u=>{s(u)},c=u=>{s(u),t(u)};A.useEffect(()=>{s(e)},[e]);const d=(u,{components:{Picker:p}})=>f.jsxs(Oe.Row,{justify:"space-between",wrap:!1,children:[f.jsx(Oe.Col,{span:13,children:f.jsx("div",{className:"bg-white dark:bg-black-800 rounded-md border border-transparent dark:border-black-600",children:f.jsx("div",{className:"grid grid-cols-3 gap-2",children:jT.map(m=>f.jsx("div",{className:`w-20 h-28 p-3 flex items-center justify-center text-center text-xs border rounded-md cursor-pointer transition-all duration-200 hover:shadow-md ${e===m.value?"border-blue-500 ring-2 ring-blue-200 dark:border-primary-500 dark:ring-2 dark:ring-primary-500/40":"border-gray-200 dark:border-black-600"}`,style:{backgroundColor:m.value,color:m.value==="#616161"?"white":"black"},onClick:()=>c(m.value),children:m.label},m.value))})})}),f.jsx(Oe.Divider,{type:"vertical",style:{height:"auto"}}),f.jsx(Oe.Col,{flex:"auto",children:f.jsx(p,{})})]});return f.jsx(Oe.ColorPicker,{open:i,defaultValue:n.colorPrimary,styles:{popupOverlayInner:{width:500}},rootClassName:r?"dark":void 0,panelRender:d,size:"small",arrow:!1,value:a,onChangeComplete:u=>l(u.toHexString()),onOpenChange:u=>{u||(t(a),o(u))},placement:"bottom",children:f.jsxs("div",{onClick:()=>o(!i),className:"w-full h-[29px] px-3 flex items-center justify-between gap-2 border border-neutral-300 dark:border-black-600 rounded-md cursor-pointer hover:border-gray-300 dark:hover:border-black-500 transition-colors bg-white dark:bg-black-800",children:[f.jsx("div",{className:"w-5 h-5 rounded-full border border-neutral-400 dark:border-black-500 flex-shrink-0",style:{backgroundColor:a}}),i?f.jsx(ee.ExpandLessOutlined,{sx:{fontSize:"20px"},className:"text-neutral-400 dark:text-black-300"}):f.jsx(ee.ExpandMoreOutlined,{sx:{fontSize:"18px"},className:"text-neutral-400 dark:text-black-300"})]})})},b1=["top","right","bottom","left"],E1=["start","end"],S1=b1.reduce((e,t)=>e.concat(t,t+"-"+E1[0],t+"-"+E1[1]),[]),Tr=Math.min,Sn=Math.max,xd=Math.round,yr=e=>({x:e,y:e}),IF={left:"right",right:"left",bottom:"top",top:"bottom"},kF={start:"end",end:"start"};function Ef(e,t,n){return Sn(e,Tr(t,n))}function $r(e,t){return typeof e=="function"?e(t):e}function qn(e){return e.split("-")[0]}function nr(e){return e.split("-")[1]}function T1(e){return e==="x"?"y":"x"}function Sf(e){return e==="y"?"height":"width"}const wF=new Set(["top","bottom"]);function Cr(e){return wF.has(qn(e))?"y":"x"}function Tf(e){return T1(Cr(e))}function y1(e,t,n){n===void 0&&(n=!1);const r=nr(e),i=Tf(e),o=Sf(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Rd(a)),[a,Rd(a)]}function MF(e){const t=Rd(e);return[Nd(e),t,Nd(t)]}function Nd(e){return e.replace(/start|end/g,t=>kF[t])}const C1=["left","right"],v1=["right","left"],DF=["top","bottom"],LF=["bottom","top"];function PF(e,t,n){switch(e){case"top":case"bottom":return n?t?v1:C1:t?C1:v1;case"left":case"right":return t?DF:LF;default:return[]}}function BF(e,t,n,r){const i=nr(e);let o=PF(qn(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(Nd)))),o}function Rd(e){return e.replace(/left|right|bottom|top/g,t=>IF[t])}function FF(e){return{top:0,right:0,bottom:0,left:0,...e}}function yf(e){return typeof e!="number"?FF(e):{top:e,right:e,bottom:e,left:e}}function ta(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function x1(e,t,n){let{reference:r,floating:i}=e;const o=Cr(t),a=Tf(t),s=Sf(a),l=qn(t),c=o==="y",d=r.x+r.width/2-i.width/2,u=r.y+r.height/2-i.height/2,p=r[s]/2-i[s]/2;let m;switch(l){case"top":m={x:d,y:r.y-i.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:u};break;case"left":m={x:r.x-i.width,y:u};break;default:m={x:r.x,y:r.y}}switch(nr(t)){case"start":m[a]-=p*(n&&c?-1:1);break;case"end":m[a]+=p*(n&&c?-1:1);break}return m}const UF=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:u}=x1(c,r,l),p=r,m={},_=0;for(let h=0;h<s.length;h++){const{name:g,fn:b}=s[h],{x:E,y:S,data:y,reset:T}=await b({x:d,y:u,initialPlacement:r,placement:p,strategy:i,middlewareData:m,rects:c,platform:a,elements:{reference:e,floating:t}});d=E??d,u=S??u,m={...m,[g]:{...m[g],...y}},T&&_<=50&&(_++,typeof T=="object"&&(T.placement&&(p=T.placement),T.rects&&(c=T.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):T.rects),{x:d,y:u}=x1(c,p,l)),h=-1)}return{x:d,y:u,placement:p,strategy:i,middlewareData:m}};async function na(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:m=0}=$r(t,e),_=yf(m),g=s[p?u==="floating"?"reference":"floating":u],b=ta(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(g)))==null||n?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),E=u==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),y=await(o.isElement==null?void 0:o.isElement(S))?await(o.getScale==null?void 0:o.getScale(S))||{x:1,y:1}:{x:1,y:1},T=ta(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:E,offsetParent:S,strategy:l}):E);return{top:(b.top-T.top+_.top)/y.y,bottom:(T.bottom-b.bottom+_.bottom)/y.y,left:(b.left-T.left+_.left)/y.x,right:(T.right-b.right+_.right)/y.x}}const zF=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:d=0}=$r(e,t)||{};if(c==null)return{};const u=yf(d),p={x:n,y:r},m=Tf(i),_=Sf(m),h=await a.getDimensions(c),g=m==="y",b=g?"top":"left",E=g?"bottom":"right",S=g?"clientHeight":"clientWidth",y=o.reference[_]+o.reference[m]-p[m]-o.floating[_],T=p[m]-o.reference[m],x=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let v=x?x[S]:0;(!v||!await(a.isElement==null?void 0:a.isElement(x)))&&(v=s.floating[S]||o.floating[_]);const C=y/2-T/2,O=v/2-h[_]/2-1,w=Tr(u[b],O),z=Tr(u[E],O),N=w,P=v-h[_]-z,I=v/2-h[_]/2+C,R=Ef(N,I,P),k=!l.arrow&&nr(i)!=null&&I!==R&&o.reference[_]/2-(I<N?w:z)-h[_]/2<0,M=k?I<N?I-N:I-P:0;return{[m]:p[m]+M,data:{[m]:R,centerOffset:I-R-M,...k&&{alignmentOffset:M}},reset:k}}});function HF(e,t,n){return(e?[...n.filter(i=>nr(i)===e),...n.filter(i=>nr(i)!==e)]:n.filter(i=>qn(i)===i)).filter(i=>e?nr(i)===e||(t?Nd(i)!==i:!1):!0)}const GF=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,i;const{rects:o,middlewareData:a,placement:s,platform:l,elements:c}=t,{crossAxis:d=!1,alignment:u,allowedPlacements:p=S1,autoAlignment:m=!0,..._}=$r(e,t),h=u!==void 0||p===S1?HF(u||null,m,p):p,g=await na(t,_),b=((n=a.autoPlacement)==null?void 0:n.index)||0,E=h[b];if(E==null)return{};const S=y1(E,o,await(l.isRTL==null?void 0:l.isRTL(c.floating)));if(s!==E)return{reset:{placement:h[0]}};const y=[g[qn(E)],g[S[0]],g[S[1]]],T=[...((r=a.autoPlacement)==null?void 0:r.overflows)||[],{placement:E,overflows:y}],x=h[b+1];if(x)return{data:{index:b+1,overflows:T},reset:{placement:x}};const v=T.map(w=>{const z=nr(w.placement);return[w.placement,z&&d?w.overflows.slice(0,2).reduce((N,P)=>N+P,0):w.overflows[0],w.overflows]}).sort((w,z)=>w[1]-z[1]),O=((i=v.filter(w=>w[2].slice(0,nr(w[0])?2:3).every(z=>z<=0))[0])==null?void 0:i[0])||v[0][0];return O!==s?{data:{index:b+1,overflows:T},reset:{placement:O}}:{}}}},VF=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:h=!0,...g}=$r(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const b=qn(i),E=Cr(s),S=qn(s)===s,y=await(l.isRTL==null?void 0:l.isRTL(c.floating)),T=p||(S||!h?[Rd(s)]:MF(s)),x=_!=="none";!p&&x&&T.push(...BF(s,h,_,y));const v=[s,...T],C=await na(t,g),O=[];let w=((r=o.flip)==null?void 0:r.overflows)||[];if(d&&O.push(C[b]),u){const I=y1(i,a,y);O.push(C[I[0]],C[I[1]])}if(w=[...w,{placement:i,overflows:O}],!O.every(I=>I<=0)){var z,N;const I=(((z=o.flip)==null?void 0:z.index)||0)+1,R=v[I];if(R&&(!(u==="alignment"?E!==Cr(R):!1)||w.every(B=>Cr(B.placement)===E?B.overflows[0]>0:!0)))return{data:{index:I,overflows:w},reset:{placement:R}};let k=(N=w.filter(M=>M.overflows[0]<=0).sort((M,B)=>M.overflows[1]-B.overflows[1])[0])==null?void 0:N.placement;if(!k)switch(m){case"bestFit":{var P;const M=(P=w.filter(B=>{if(x){const D=Cr(B.placement);return D===E||D==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(D=>D>0).reduce((D,U)=>D+U,0)]).sort((B,D)=>B[1]-D[1])[0])==null?void 0:P[0];M&&(k=M);break}case"initialPlacement":k=s;break}if(i!==k)return{reset:{placement:k}}}return{}}}};function N1(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function R1(e){return b1.some(t=>e[t]>=0)}const YF=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=$r(e,t);switch(r){case"referenceHidden":{const o=await na(t,{...i,elementContext:"reference"}),a=N1(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:R1(a)}}}case"escaped":{const o=await na(t,{...i,altBoundary:!0}),a=N1(o,n.floating);return{data:{escapedOffsets:a,escaped:R1(a)}}}default:return{}}}}};function A1(e){const t=Tr(...e.map(o=>o.left)),n=Tr(...e.map(o=>o.top)),r=Sn(...e.map(o=>o.right)),i=Sn(...e.map(o=>o.bottom));return{x:t,y:n,width:r-t,height:i-n}}function $F(e){const t=e.slice().sort((i,o)=>i.y-o.y),n=[];let r=null;for(let i=0;i<t.length;i++){const o=t[i];!r||o.y-r.y>r.height/2?n.push([o]):n[n.length-1].push(o),r=o}return n.map(i=>ta(A1(i)))}const WF=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:i,platform:o,strategy:a}=t,{padding:s=2,x:l,y:c}=$r(e,t),d=Array.from(await(o.getClientRects==null?void 0:o.getClientRects(r.reference))||[]),u=$F(d),p=ta(A1(d)),m=yf(s);function _(){if(u.length===2&&u[0].left>u[1].right&&l!=null&&c!=null)return u.find(g=>l>g.left-m.left&&l<g.right+m.right&&c>g.top-m.top&&c<g.bottom+m.bottom)||p;if(u.length>=2){if(Cr(n)==="y"){const w=u[0],z=u[u.length-1],N=qn(n)==="top",P=w.top,I=z.bottom,R=N?w.left:z.left,k=N?w.right:z.right,M=k-R,B=I-P;return{top:P,bottom:I,left:R,right:k,width:M,height:B,x:R,y:P}}const g=qn(n)==="left",b=Sn(...u.map(w=>w.right)),E=Tr(...u.map(w=>w.left)),S=u.filter(w=>g?w.left===E:w.right===b),y=S[0].top,T=S[S.length-1].bottom,x=E,v=b,C=v-x,O=T-y;return{top:y,bottom:T,left:x,right:v,width:C,height:O,x,y}}return p}const h=await o.getElementRects({reference:{getBoundingClientRect:_},floating:r.floating,strategy:a});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},qF=new Set(["left","top"]);async function jF(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=qn(n),s=nr(n),l=Cr(n)==="y",c=qF.has(a)?-1:1,d=o&&l?-1:1,u=$r(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:_}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&typeof _=="number"&&(m=s==="end"?_*-1:_),l?{x:m*d,y:p*c}:{x:p*c,y:m*d}}const KF=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,l=await jF(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},QF=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:g=>{let{x:b,y:E}=g;return{x:b,y:E}}},...l}=$r(e,t),c={x:n,y:r},d=await na(t,l),u=Cr(qn(i)),p=T1(u);let m=c[p],_=c[u];if(o){const g=p==="y"?"top":"left",b=p==="y"?"bottom":"right",E=m+d[g],S=m-d[b];m=Ef(E,m,S)}if(a){const g=u==="y"?"top":"left",b=u==="y"?"bottom":"right",E=_+d[g],S=_-d[b];_=Ef(E,_,S)}const h=s.fn({...t,[p]:m,[u]:_});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[p]:o,[u]:a}}}}}},XF=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:a,elements:s}=t,{apply:l=()=>{},...c}=$r(e,t),d=await na(t,c),u=qn(i),p=nr(i),m=Cr(i)==="y",{width:_,height:h}=o.floating;let g,b;u==="top"||u==="bottom"?(g=u,b=p===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(b=u,g=p==="end"?"top":"bottom");const E=h-d.top-d.bottom,S=_-d.left-d.right,y=Tr(h-d[g],E),T=Tr(_-d[b],S),x=!t.middlewareData.shift;let v=y,C=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(C=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(v=E),x&&!p){const w=Sn(d.left,0),z=Sn(d.right,0),N=Sn(d.top,0),P=Sn(d.bottom,0);m?C=_-2*(w!==0||z!==0?w+z:Sn(d.left,d.right)):v=h-2*(N!==0||P!==0?N+P:Sn(d.top,d.bottom))}await l({...t,availableWidth:C,availableHeight:v});const O=await a.getDimensions(s.floating);return _!==O.width||h!==O.height?{reset:{rects:!0}}:{}}}};function Ad(){return typeof window<"u"}function ra(e){return O1(e)?(e.nodeName||"").toLowerCase():"#document"}function Ln(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Wr(e){var t;return(t=(O1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function O1(e){return Ad()?e instanceof Node||e instanceof Ln(e).Node:!1}function rr(e){return Ad()?e instanceof Element||e instanceof Ln(e).Element:!1}function vr(e){return Ad()?e instanceof HTMLElement||e instanceof Ln(e).HTMLElement:!1}function I1(e){return!Ad()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ln(e).ShadowRoot}const ZF=new Set(["inline","contents"]);function Os(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ir(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ZF.has(i)}const JF=new Set(["table","td","th"]);function eU(e){return JF.has(ra(e))}const tU=[":popover-open",":modal"];function Od(e){return tU.some(t=>{try{return e.matches(t)}catch{return!1}})}const nU=["transform","translate","scale","rotate","perspective"],rU=["transform","translate","scale","rotate","perspective","filter"],iU=["paint","layout","strict","content"];function Cf(e){const t=vf(),n=rr(e)?ir(e):e;return nU.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||rU.some(r=>(n.willChange||"").includes(r))||iU.some(r=>(n.contain||"").includes(r))}function oU(e){let t=Ti(e);for(;vr(t)&&!ia(t);){if(Cf(t))return t;if(Od(t))return null;t=Ti(t)}return null}function vf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const aU=new Set(["html","body","#document"]);function ia(e){return aU.has(ra(e))}function ir(e){return Ln(e).getComputedStyle(e)}function Id(e){return rr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ti(e){if(ra(e)==="html")return e;const t=e.assignedSlot||e.parentNode||I1(e)&&e.host||Wr(e);return I1(t)?t.host:t}function k1(e){const t=Ti(e);return ia(t)?e.ownerDocument?e.ownerDocument.body:e.body:vr(t)&&Os(t)?t:k1(t)}function w1(e,t,n){var r;t===void 0&&(t=[]);const i=k1(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=Ln(i);return o?(xf(a),t.concat(a,a.visualViewport||[],Os(i)?i:[],[])):t.concat(i,w1(i,[]))}function xf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function M1(e){const t=ir(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=vr(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=xd(n)!==o||xd(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function D1(e){return rr(e)?e:e.contextElement}function oa(e){const t=D1(e);if(!vr(t))return yr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=M1(t);let a=(o?xd(n.width):n.width)/r,s=(o?xd(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const sU=yr(0);function L1(e){const t=Ln(e);return!vf()||!t.visualViewport?sU:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function lU(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ln(e)?!1:t}function Is(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=D1(e);let a=yr(1);t&&(r?rr(r)&&(a=oa(r)):a=oa(e));const s=lU(o,n,r)?L1(o):yr(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,d=i.width/a.x,u=i.height/a.y;if(o){const p=Ln(o),m=r&&rr(r)?Ln(r):r;let _=p,h=xf(_);for(;h&&r&&m!==_;){const g=oa(h),b=h.getBoundingClientRect(),E=ir(h),S=b.left+(h.clientLeft+parseFloat(E.paddingLeft))*g.x,y=b.top+(h.clientTop+parseFloat(E.paddingTop))*g.y;l*=g.x,c*=g.y,d*=g.x,u*=g.y,l+=S,c+=y,_=Ln(h),h=xf(_)}}return ta({width:d,height:u,x:l,y:c})}function kd(e,t){const n=Id(e).scrollLeft;return t?t.left+n:Is(Wr(e)).left+n}function P1(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-kd(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function cU(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=Wr(r),s=t?Od(t.floating):!1;if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=yr(1);const d=yr(0),u=vr(r);if((u||!u&&!o)&&((ra(r)!=="body"||Os(a))&&(l=Id(r)),vr(r))){const m=Is(r);c=oa(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const p=a&&!u&&!o?P1(a,l):yr(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:n.y*c.y-l.scrollTop*c.y+d.y+p.y}}function dU(e){return Array.from(e.getClientRects())}function uU(e){const t=Wr(e),n=Id(e),r=e.ownerDocument.body,i=Sn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Sn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+kd(e);const s=-n.scrollTop;return ir(r).direction==="rtl"&&(a+=Sn(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}const B1=25;function pU(e,t){const n=Ln(e),r=Wr(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const d=vf();(!d||d&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const c=kd(r);if(c<=0){const d=r.ownerDocument,u=d.body,p=getComputedStyle(u),m=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,_=Math.abs(r.clientWidth-u.clientWidth-m);_<=B1&&(o-=_)}else c<=B1&&(o+=c);return{width:o,height:a,x:s,y:l}}const mU=new Set(["absolute","fixed"]);function fU(e,t){const n=Is(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=vr(e)?oa(e):yr(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:a,height:s,x:l,y:c}}function F1(e,t,n){let r;if(t==="viewport")r=pU(e,n);else if(t==="document")r=uU(Wr(e));else if(rr(t))r=fU(t,n);else{const i=L1(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return ta(r)}function U1(e,t){const n=Ti(e);return n===t||!rr(n)||ia(n)?!1:ir(n).position==="fixed"||U1(n,t)}function _U(e,t){const n=t.get(e);if(n)return n;let r=w1(e,[]).filter(s=>rr(s)&&ra(s)!=="body"),i=null;const o=ir(e).position==="fixed";let a=o?Ti(e):e;for(;rr(a)&&!ia(a);){const s=ir(a),l=Cf(a);!l&&s.position==="fixed"&&(i=null),(o?!l&&!i:!l&&s.position==="static"&&!!i&&mU.has(i.position)||Os(a)&&!l&&U1(e,a))?r=r.filter(d=>d!==a):i=s,a=Ti(a)}return t.set(e,r),r}function hU(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?Od(t)?[]:_U(t,this._c):[].concat(n),r],s=a[0],l=a.reduce((c,d)=>{const u=F1(t,d,i);return c.top=Sn(u.top,c.top),c.right=Tr(u.right,c.right),c.bottom=Tr(u.bottom,c.bottom),c.left=Sn(u.left,c.left),c},F1(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function gU(e){const{width:t,height:n}=M1(e);return{width:t,height:n}}function bU(e,t,n){const r=vr(t),i=Wr(t),o=n==="fixed",a=Is(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=yr(0);function c(){l.x=kd(i)}if(r||!r&&!o)if((ra(t)!=="body"||Os(i))&&(s=Id(t)),r){const m=Is(t,!0,o,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else i&&c();o&&!r&&i&&c();const d=i&&!r&&!o?P1(i,s):yr(0),u=a.left+s.scrollLeft-l.x-d.x,p=a.top+s.scrollTop-l.y-d.y;return{x:u,y:p,width:a.width,height:a.height}}function Nf(e){return ir(e).position==="static"}function z1(e,t){if(!vr(e)||ir(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Wr(e)===n&&(n=n.ownerDocument.body),n}function H1(e,t){const n=Ln(e);if(Od(e))return n;if(!vr(e)){let i=Ti(e);for(;i&&!ia(i);){if(rr(i)&&!Nf(i))return i;i=Ti(i)}return n}let r=z1(e,t);for(;r&&eU(r)&&Nf(r);)r=z1(r,t);return r&&ia(r)&&Nf(r)&&!Cf(r)?n:r||oU(e)||n}const EU=async function(e){const t=this.getOffsetParent||H1,n=this.getDimensions,r=await n(e.floating);return{reference:bU(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function SU(e){return ir(e).direction==="rtl"}const TU={convertOffsetParentRelativeRectToViewportRelativeRect:cU,getDocumentElement:Wr,getClippingRect:hU,getOffsetParent:H1,getElementRects:EU,getClientRects:dU,getDimensions:gU,getScale:oa,isElement:rr,isRTL:SU},G1=KF,V1=GF,Y1=QF,$1=VF,W1=XF,q1=YF,j1=zF,K1=WF,Q1=(e,t,n)=>{const r=new Map,i={platform:TU,...n},o={...i.platform,_c:r};return UF(e,t,{...i,platform:o})};function yU(e,t){const n=Math.min(e.top,t.top),r=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),a=Math.max(e.right,t.right)-i,s=r-n,l=i,c=n;return new DOMRect(l,c,a,s)}var CU=class{constructor({editor:e,element:t,view:n,updateDelay:r=250,resizeDelay:i=60,shouldShow:o,appendTo:a,getReferencedVirtualElement:s,options:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:d,state:u,from:p,to:m})=>{const{doc:_,selection:h}=u,{empty:g}=h,b=!_.textBetween(p,m).length&&tp(u.selection),E=this.element.contains(document.activeElement);return!(!(d.hasFocus()||E)||g||b||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:d})=>{var u;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}d?.relatedTarget&&((u=this.element.parentNode)!=null&&u.contains(d.relatedTarget))||d?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(d,u)=>{const p=!u?.selection.eq(d.state.selection),m=!u?.doc.eq(d.state.doc);!p&&!m||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(d,p,m,u)},this.updateDelay))},this.updateHandler=(d,u,p,m)=>{const{composing:_}=d;if(_||!u&&!p)return;if(!this.getShouldShow(m)){this.hide();return}this.updatePosition(),this.show()},this.transactionHandler=({transaction:d})=>{d.getMeta("bubbleMenu")==="updatePosition"&&this.updatePosition()};var c;this.editor=e,this.element=t,this.view=n,this.updateDelay=r,this.resizeDelay=i,this.appendTo=a,this.scrollTarget=(c=l?.scrollTarget)!=null?c:window,this.getReferencedVirtualElement=s,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&this.show()}get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push($1(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Y1(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(G1(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(j1(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(W1(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(V1(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(q1(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(K1(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}get virtualElement(){var e;const{selection:t}=this.editor.state,n=(e=this.getReferencedVirtualElement)==null?void 0:e.call(this);if(n)return n;const r=cb(this.view,t.from,t.to);let i={getBoundingClientRect:()=>r,getClientRects:()=>[r]};if(t instanceof ge){let o=this.view.nodeDOM(t.from);const a=o.dataset.nodeViewWrapper?o:o.querySelector("[data-node-view-wrapper]");a&&(o=a),o&&(i={getBoundingClientRect:()=>o.getBoundingClientRect(),getClientRects:()=>[o.getBoundingClientRect()]})}if(t instanceof rt){const{$anchorCell:o,$headCell:a}=t,s=o?o.pos:a.pos,l=a?a.pos:o.pos,c=this.view.nodeDOM(s),d=this.view.nodeDOM(l);if(!c||!d)return;const u=c===d?c.getBoundingClientRect():yU(c.getBoundingClientRect(),d.getBoundingClientRect());i={getBoundingClientRect:()=>u,getClientRects:()=>[u]}}return i}updatePosition(){const e=this.virtualElement;e&&Q1(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:t,y:n,strategy:r})=>{this.element.style.width="max-content",this.element.style.position=r,this.element.style.left=`${t}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){const{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,t);return}const i=!t?.selection.eq(e.state.selection),o=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,o,t)}getShouldShow(e){var t;const{state:n}=this.view,{selection:r}=n,{ranges:i}=r,o=Math.min(...i.map(l=>l.$from.pos)),a=Math.max(...i.map(l=>l.$to.pos));return(t=this.shouldShow)==null?void 0:t.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:e,from:o,to:a})}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},X1=e=>new Ie({key:typeof e.pluginKey=="string"?new Fe(e.pluginKey):e.pluginKey,view:t=>new CU({view:t,...e})});Re.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[X1({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var vU=class{constructor({editor:e,element:t,view:n,options:r,appendTo:i,shouldShow:o}){this.preventHide=!1,this.isVisible=!1,this.shouldShow=({view:a,state:s})=>{const{selection:l}=s,{$anchor:c,empty:d}=l,u=c.depth===1,p=c.parent.isTextblock&&!c.parent.type.spec.code&&!c.parent.textContent&&c.parent.childCount===0&&!this.getTextContent(c.parent);return!(!a.hasFocus()||!d||!u||!p||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(a,s,l,c)=>{const{composing:d}=a;if(d||!s&&!l)return;if(!this.getShouldShow(c)){this.hide();return}this.updatePosition(),this.show()},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var s;if(this.preventHide){this.preventHide=!1;return}a?.relatedTarget&&((s=this.element.parentNode)!=null&&s.contains(a.relatedTarget))||a?.relatedTarget!==this.editor.view.dom&&this.hide()},this.editor=e,this.element=t,this.view=n,this.appendTo=i,this.floatingUIOptions={...this.floatingUIOptions,...r},this.element.tabIndex=0,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.update(n,n.state),this.getShouldShow()&&this.show()}getTextContent(e){return rb(e,{textSerializers:sp(this.editor.schema)})}get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push($1(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Y1(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(G1(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(j1(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(W1(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(V1(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(q1(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(K1(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}getShouldShow(e){var t;const{state:n}=this.view,{selection:r}=n,{ranges:i}=r,o=Math.min(...i.map(l=>l.$from.pos)),a=Math.max(...i.map(l=>l.$to.pos));return(t=this.shouldShow)==null?void 0:t.call(this,{editor:this.editor,view:this.view,state:n,oldState:e,from:o,to:a})}updatePosition(){const{selection:e}=this.editor.state,t=cb(this.view,e.from,e.to);Q1({getBoundingClientRect:()=>t,getClientRects:()=>[t]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:r,y:i,strategy:o})=>{this.element.style.width="max-content",this.element.style.position=o,this.element.style.left=`${r}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){const n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,r,t)}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},Z1=e=>new Ie({key:typeof e.pluginKey=="string"?new Fe(e.pluginKey):e.pluginKey,view:t=>new vU({view:t,...e})});Re.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Z1({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});var Rf=A.forwardRef(({pluginKey:e="bubbleMenu",editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:o=null,getReferencedVirtualElement:a,options:s,children:l,...c},d)=>{const u=A.useRef(document.createElement("div"));typeof d=="function"?d(u.current):d&&(d.current=u.current);const{editor:p}=kb();return A.useEffect(()=>{const m=u.current;if(m.style.visibility="hidden",m.style.position="absolute",t?.isDestroyed||p?.isDestroyed)return;const _=t||p;if(!_){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const h=X1({updateDelay:n,resizeDelay:r,editor:_,element:m,appendTo:i,pluginKey:e,shouldShow:o,getReferencedVirtualElement:a,options:s});return _.registerPlugin(h),()=>{_.unregisterPlugin(e),window.requestAnimationFrame(()=>{m.parentNode&&m.parentNode.removeChild(m)})}},[t,p,e,n,r,i,o,a,s]),Ri.createPortal(f.jsx("div",{...c,children:l}),u.current)});A.forwardRef(({pluginKey:e="floatingMenu",editor:t,appendTo:n,shouldShow:r=null,options:i,children:o,...a},s)=>{const l=A.useRef(document.createElement("div"));typeof s=="function"?s(l.current):s&&(s.current=l.current);const{editor:c}=kb();return A.useEffect(()=>{const d=l.current;if(d.style.visibility="hidden",d.style.position="absolute",t?.isDestroyed||c?.isDestroyed)return;const u=t||c;if(!u){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const p=Z1({editor:u,element:d,pluginKey:e,appendTo:n,shouldShow:r,options:i});return u.registerPlugin(p),()=>{u.unregisterPlugin(e),window.requestAnimationFrame(()=>{d.parentNode&&d.parentNode.removeChild(d)})}},[t,c,n,e,r,i]),Ri.createPortal(f.jsx("div",{...a,children:o}),l.current)});const xU=()=>{const{decreaseFontSize:e,increaseFontSize:t,isEditable:n}=hf();return f.jsxs(f.Fragment,{children:[f.jsx(G.Button,{id:"font-size-decrease",title:"Decrease Font Size",onClick:e,disabled:!n,status:"no-background",className:"!p-1.5 !max-h-none !rounded !border-none hover:!bg-neutral-100 dark:hover:!bg-black-600",children:f.jsx(ee.TextDecrease,{fontSize:"medium"})}),f.jsx(G.Button,{id:"font-size-increase",title:"Increase Font Size",onClick:t,disabled:!n,status:"no-background",className:"!p-1.5 !max-h-none !rounded !border-none hover:!bg-neutral-100 dark:hover:!bg-black-600",children:f.jsx(ee.TextIncrease,{fontSize:"medium"})})]})},NU=()=>{const{handleClearFormatting:e}=i1();return f.jsx(G.Button,{id:"clear-text-format",onClick:e,status:"no-background",className:"!p-1.5 !max-h-none !rounded hover:!bg-neutral-100 dark:hover:!bg-black-600",title:"Clear formatting",children:f.jsx(ie,{name:"clear-format",strokeWidth:1.5,size:22})})},ks=(e=!1)=>`!p-1.5 !max-h-none !rounded hover:!bg-neutral-100 dark:hover:!bg-black-600 ${e?"!bg-neutral-200 dark:!bg-black-600":"!bg-transparent"}`,RU=()=>{const[e,t]=A.useState(!1),{isTextAlignLeft:n,isTextAlignCenter:r,isTextAlignRight:i,isTextAlignJustify:o,canBold:a,canItalic:s,canUnderline:l,canStrike:c,isBold:d,isItalic:u,isUnderline:p,isStrike:m}=Dn(),{handleTextAlignLeft:_,handleTextAlignCenter:h,handleTextAlignRight:g,handleTextAlignJustify:b}=Cd(),{handleToggleBold:E,handleToggleItalic:S,handleToggleUnderline:y,handleToggleStrike:T}=hf();return f.jsxs("div",{className:"relative z-[1000] flex items-start gap-1 bg-white dark:bg-black-800 shadow-lg rounded-lg border border-neutral-200 dark:border-black-600 p-1",children:[f.jsx(xU,{}),f.jsx(G.Button,{id:"toolbar-bold",title:"Bold",status:"no-background",className:ks(d)+" !border-none",onClick:E,disabled:!a,children:f.jsx(ee.FormatBold,{fontSize:"medium"})}),f.jsx(G.Button,{id:"toolbar-italic",title:"Italic",status:"no-background",className:ks(u)+" !border-none",onClick:S,disabled:!s,children:f.jsx(ee.FormatItalic,{fontSize:"medium"})}),f.jsx(G.Button,{id:"toolbar-underline",title:"Underline",status:"no-background",className:ks(p)+" !border-none",onClick:y,disabled:!l,children:f.jsx(ee.FormatUnderlined,{fontSize:"medium"})}),f.jsx(G.Button,{id:"toolbar-strikethrough",title:"Strikethrough",status:"no-background",className:ks(m)+" !border-none",onClick:T,disabled:!c,children:f.jsx(ee.FormatStrikethrough,{fontSize:"medium"})}),f.jsx(l1,{}),f.jsx(Oe.Popover,{open:e,onOpenChange:t,content:f.jsxs("div",{className:"flex items-center space-x-2 p-1 rounded-lg bg-white dark:bg-black-800",onClick:()=>t(!1),children:[f.jsx(G.Button,{id:"align-left",title:"Align Left",onClick:_,status:"no-background",className:`!p-1.5 !max-h-none !rounded !border-none hover:!bg-neutral-100 dark:hover:!bg-black-600 ${n?"!bg-neutral-200 dark:!bg-black-600":""}`,children:f.jsx(ee.FormatAlignLeft,{fontSize:"medium"})}),f.jsx(G.Button,{id:"align-center",title:"Align Center",onClick:h,status:"no-background",className:`!p-1.5 !max-h-none !rounded !border-none hover:!bg-neutral-100 dark:hover:!bg-black-600 ${r?"!bg-neutral-200 dark:!bg-black-600":""}`,children:f.jsx(ee.FormatAlignCenter,{fontSize:"medium"})}),f.jsx(G.Button,{id:"align-right",title:"Align Right",onClick:g,status:"no-background",className:`!p-1.5 !max-h-none !rounded !border-none hover:!bg-neutral-100 dark:hover:!bg-black-600 ${i?"!bg-neutral-200 dark:!bg-black-600":""}`,children:f.jsx(ee.FormatAlignRight,{fontSize:"medium"})}),f.jsx(G.Button,{id:"align-justify",title:"Justify",onClick:b,status:"no-background",className:`!p-1.5 !max-h-none !rounded !border-none hover:!bg-neutral-100 dark:hover:!bg-black-600 ${o?"!bg-neutral-200 dark:!bg-black-600":""}`,children:f.jsx(ee.FormatAlignJustify,{fontSize:"medium"})})]}),trigger:"click",arrow:!1,placement:"bottom",children:f.jsxs(G.Button,{id:"toolbar-bubble-text-alignment",title:"Text Alignment",status:"no-background",className:ks+" !border-none !py-2.5",children:[f.jsx(ie,{name:r?"align-center":i?"align-right":o?"align-justify":"align-left",strokeWidth:1.5}),f.jsx(ee.ArrowDropDownOutlined,{sx:{fontSize:"16px",color:"inherit"}})]})}),f.jsx(NU,{})]})},AU=()=>{const[e,t]=A.useState(!1),{linkUrl:n,copied:r,handleCopy:i,handleRemove:o}=gf();return f.jsxs("div",{className:"relative z-[1000] flex items-center gap-1 bg-white dark:bg-black-800 shadow-lg rounded-lg border border-neutral-200 dark:border-black-600 p-2",children:[f.jsxs("div",{className:"flex items-center space-x-2 min-w-0",children:[f.jsx("div",{className:"flex-shrink-0 w-6 h-6 bg-gray-200 dark:bg-black-600 text-gray-600 dark:text-black-200 hover:text-primary-600 rounded-full flex items-center justify-center",children:f.jsx(ie,{name:"link",size:12})}),f.jsx("a",{href:n,target:"_blank",className:"text-sm text-blue-600 dark:text-primary-300 truncate max-w-[200px]",title:n,children:n})]}),f.jsx("div",{className:"h-5 w-px bg-gray-300 dark:bg-black-500"}),f.jsxs("div",{className:"flex items-center space-x-1",children:[f.jsx("button",{onClick:i,className:`p-1.5 hover:bg-gray-100 dark:hover:bg-black-600 hover:text-primary-600 rounded transition-colors ${r?"text-green-600 dark:text-success-400":"text-gray-600 dark:text-black-300"}`,title:r?"Copied!":"Copy link",children:f.jsx(ie,{name:r?"check":"copy",size:16,strokeWidth:3})}),f.jsx(Oe.Popover,{content:f.jsx(s1,{mode:Jo.EDIT,initialUrl:n,onSubmit:()=>t(!1),onCancel:()=>t(!1)}),trigger:"click",placement:"bottom",arrow:!1,open:e,onOpenChange:t,children:f.jsx("button",{onMouseDown:a=>a.preventDefault(),className:"p-1.5 hover:bg-gray-100 dark:hover:bg-black-600 hover:text-primary-600 text-gray-600 dark:text-black-300 rounded transition-colors",title:"Edit link",children:f.jsx(ie,{name:"edit",size:16,strokeWidth:3})})}),f.jsx("button",{onClick:o,className:"p-1.5 hover:bg-gray-100 dark:hover:bg-black-600 hover:text-primary-600 text-gray-600 dark:text-black-300 rounded transition-colors",title:"Remove link",children:f.jsx(ie,{name:"node-delete",size:16,strokeWidth:3})})]})]})},OU=()=>{const{editor:e}=lt(),[t,n]=A.useState({alignment:zn.LEFT,width:no}),r=A.useCallback(()=>{const{selection:o}=e.state,a=o,{node:s}=a;return s&&s.type.name==="image"?{alignment:s.attrs.align||zn.LEFT,width:s.attrs.width||no}:{alignment:zn.LEFT,width:no}},[e.state]),i=A.useCallback(o=>{e.chain().focus().updateAttributes("image",{align:o}).run()},[e]);return A.useEffect(()=>{const o=()=>{n(r())};return o(),e.on("transaction",o),e.on("selectionUpdate",o),()=>{e.off("transaction",o),e.off("selectionUpdate",o)}},[e,r]),{currentImageAlignment:t.alignment,currentImageWidth:t.width,updateImageAlignment:i}},IU=()=>{const{currentImageAlignment:e,updateImageAlignment:t}=OU(),n=[{alignment:zn.LEFT,icon:f.jsx(ie,{name:"align-left"}),title:"Align Left"},{alignment:zn.CENTER,icon:f.jsx(ie,{name:"align-center"}),title:"Align Center"},{alignment:zn.RIGHT,icon:f.jsx(ie,{name:"align-right"}),title:"Align Right"}];return f.jsx("div",{className:"relative z-[1000] flex gap-1 bg-white dark:bg-black-800 p-1 rounded-md shadow-lg border border-neutral-200 dark:border-black-600",onMouseDown:r=>r.preventDefault(),children:n.map(({alignment:r,icon:i,title:o})=>f.jsx(G.Button,{id:`toolbar-image-align-${r}`,status:"no-background",className:`!p-1.5 !max-h-none !rounded !bg-transparent hover:!bg-neutral-100 dark:hover:!bg-black-600 !border-none ${r===e?"!bg-neutral-200 dark:!bg-black-600":""}`,onClick:()=>t(r),title:o,children:i},r))})},$t="!w-full !justify-start gap-2 !p-2 !max-h-none !rounded !bg-transparent hover:!bg-neutral-100 dark:hover:!bg-black-600",kU=({onRequestClose:e}={})=>{const{isTableActive:t,canSplitCell:n,canMergeCells:r}=Dn(),{handleInsertRowAbove:i,handleInsertRowBelow:o,handleDeleteRow:a,handleInsertColumnLeft:s,handleInsertColumnRight:l,handleDeleteColumn:c,handleSetCellBackgroundColor:d,handleClearCellBackgroundColor:u,handleMergeCells:p,handleSplitCell:m,handleDeleteTable:_}=r1(),{editor:h,editorConfig:g}=lt(),b=()=>{if(!h)return 0;const{$from:k}=h.state.selection;for(let M=k.depth;M>0;M--)if(k.node(M).type.name==="tableRow")return Math.max(0,k.index(M-1)-1);return 0},E=()=>{if(!h)return 0;const{$from:k}=h.state.selection;for(let M=k.depth;M>0;M--)if(k.node(M).type.name==="tableCell"||k.node(M).type.name==="tableHeader")return k.index(M-1);return 0},S=()=>{if(!h)return[];const{$from:k}=h.state.selection;for(let M=k.depth;M>0;M--){const B=k.node(M);if(B.type.name!=="table")continue;const D=[];return B.forEach(U=>{if(U.type.name!=="tableRow")return;const H=U.attrs["data-row-id"];H&&D.push(H)}),D}return[]},y=()=>{if(!h)return[];const{$from:k}=h.state.selection;for(let M=k.depth;M>0;M--){const B=k.node(M);if(B.type.name!=="table")continue;const D=[];return B.forEach(U=>{U.type.name==="tableRow"&&U.forEach(H=>{if(H.type.name!=="tableHeader")return;const V=H.attrs["data-header-id"];V&&D.push(V)})}),D}return[]},T=()=>{if(!h)return"";const{$from:k}=h.state.selection;for(let M=k.depth;M>0;M--)if(k.node(M).type.name==="table")return k.node(M).attrs["data-table-type"]??"";return""},x=()=>{if(!h)return"";const{$from:k}=h.state.selection;for(let M=k.depth;M>0;M--)if(k.node(M).type.name==="table")return k.node(M).attrs["data-table-id"]??"";return""},v=(()=>{if(!h)return!1;const{$from:k}=h.state.selection;for(let M=k.depth;M>0;M--)if(k.node(M).type.name==="tableHeader")return!0;return!1})(),C=h?.getAttributes("tableCell")?.backgroundColor??"#ffffff",O=(()=>{if(!h)return!1;const{$from:k}=h.state.selection;for(let M=k.depth;M>0;M--){const B=k.node(M);if(B.type.name==="tableCell"&&B.attrs["data-cell-id"]||B.type.name==="tableHeader"&&B.attrs["data-header-id"])return!0}return!1})(),w=()=>{if(!h)return;const{from:k}=h.state.selection;h.chain().focus().setTextSelection(k).run()},z=k=>()=>{k(),w(),e?.()},N=k=>k.closest('[data-table-context-menu="true"]')??document.body,[P,I]=A.useState(C),R=k=>{I(k),d(k)};return A.useEffect(()=>{I(C)},[C]),f.jsxs("div",{className:"relative z-[1000] w-48 flex flex-col items-start bg-white dark:bg-black-800 opacity-100 shadow-lg rounded-lg border border-neutral-200 dark:border-black-600 p-2",children:[f.jsxs("div",{className:"hidden",children:[f.jsx(_f,{id:"cellBackgroundColor",title:"Cell Background",value:P,icon:f.jsx(ie,{name:"color-fill",size:14,strokeWidth:2}),showLabel:!0,onColorSelect:R,onResetColor:u}),f.jsxs(G.Button,{id:"table-clear-cell-bg",title:"Clear Cell Background",status:"no-background",className:$t+" !border-none",onClick:u,disabled:!t,children:[f.jsx(ie,{name:"clear-format",strokeWidth:2}),f.jsx("span",{className:"text-xs",children:"Clear Cell Background"})]})]}),f.jsx(Oe.Dropdown,{trigger:["hover"],getPopupContainer:N,align:{points:["tl","tr"],offset:[4,0],overflow:{adjustX:!0,adjustY:!1}},popupRender:()=>f.jsxs("div",{className:"flex flex-col bg-white dark:bg-black-800 shadow-lg rounded-lg border border-neutral-200 dark:border-black-600 p-1 min-w-[170px]",onClick:w,children:[f.jsx(G.Button,{id:"table-insert-blank-row",title:"Insert Blank Row",status:"no-background",className:$t+" !border-none",disabled:v,onClick:z(i),children:f.jsx("span",{className:"text-xs",children:"Insert blank row"})}),f.jsx(G.Button,{id:"table-insert-row-from-agreement",title:"Insert Row From Agreement",status:"no-background",className:$t+" !border-none",onClick:z(()=>g.onInsertRowFromAgreement?.({rowIndex:b(),tableId:x(),tableType:T(),rowIds:S()})),disabled:!g.onInsertRowFromAgreement||!O||v,children:f.jsx("span",{className:"text-xs",children:"Insert from agreement"})})]}),children:f.jsx("div",{className:"w-full",children:f.jsxs(G.Button,{id:"table-insert-row-above",title:"Insert Row Above",status:"no-background",className:$t+" !border-none w-full",disabled:!t||v,children:[f.jsx(ie,{name:"add-row",strokeWidth:4,size:"18px"}),f.jsxs("div",{className:"flex flex-1 items-center justify-between",children:[f.jsx("span",{className:"text-xs",children:"Insert Row Above"}),f.jsx(ee.ChevronRight,{sx:{fontSize:14},className:"ml-auto text-neutral-400"})]})]})})}),f.jsx(Oe.Dropdown,{trigger:["hover"],getPopupContainer:N,align:{points:["tl","tr"],offset:[4,0],overflow:{adjustX:!0,adjustY:!1}},popupRender:()=>f.jsxs("div",{className:"flex flex-col bg-white dark:bg-black-800 shadow-lg rounded-lg border border-neutral-200 dark:border-black-600 p-1 min-w-[170px]",onClick:w,children:[f.jsx(G.Button,{id:"table-insert-blank-row-below",title:"Insert Blank Row Below",status:"no-background",className:$t+" !border-none",onClick:z(o),children:f.jsx("span",{className:"text-xs",children:"Insert blank row"})}),f.jsx(G.Button,{id:"table-insert-row-below-from-agreement",title:"Insert Row Below From Agreement",status:"no-background",className:$t+" !border-none",onClick:z(()=>g.onInsertRowFromAgreement?.({rowIndex:b()+1,tableId:x(),tableType:T(),rowIds:S()})),disabled:!g.onInsertRowFromAgreement||!O,children:f.jsx("span",{className:"text-xs",children:"Insert from agreement"})})]}),children:f.jsx("div",{className:"w-full",children:f.jsxs(G.Button,{id:"table-insert-row-below",title:"Insert Row Below",status:"no-background",className:$t+" !border-none w-full",disabled:!t,children:[f.jsx(ie,{name:"add-row",strokeWidth:4,className:"rotate-[180deg]",size:"18px"}),f.jsxs("div",{className:"flex flex-1 items-center justify-between",children:[f.jsx("span",{className:"text-xs",children:"Insert Row Below"}),f.jsx(ee.ChevronRight,{sx:{fontSize:14},className:"ml-auto text-neutral-400"})]})]})})}),f.jsx("div",{className:"w-full",children:f.jsxs(G.Button,{id:"table-delete-row",title:"Delete Row",status:"no-background",className:$t+" !border-none",onClick:z(a),disabled:!t,children:[f.jsx(ie,{name:"table-delete-row",strokeWidth:2}),f.jsx("span",{className:"text-xs",children:"Delete Row"})]})}),f.jsx(Oe.Dropdown,{trigger:["hover"],getPopupContainer:N,align:{points:["tl","tr"],offset:[4,0],overflow:{adjustX:!0,adjustY:!1}},popupRender:()=>f.jsxs("div",{className:"flex flex-col bg-white dark:bg-black-800 shadow-lg rounded-lg border border-neutral-200 dark:border-black-600 p-1 min-w-[170px]",onClick:w,children:[f.jsx(G.Button,{id:"table-insert-blank-column-left",title:"Insert Blank Column Left",status:"no-background",className:$t+" !border-none",onClick:z(s),children:f.jsx("span",{className:"text-xs",children:"Insert blank column"})}),f.jsx(G.Button,{id:"table-insert-column-left-from-agreement",title:"Insert Column Left From Agreement",status:"no-background",className:$t+" !border-none",onClick:z(()=>g.onInsertColumnFromAgreement?.({colIndex:E(),tableId:x(),tableType:T(),headerIds:y()})),disabled:!g.onInsertColumnFromAgreement||!O,children:f.jsx("span",{className:"text-xs",children:"Insert from agreement"})})]}),children:f.jsx("div",{className:"w-full",children:f.jsxs(G.Button,{id:"table-insert-column-left",title:"Insert Column Left",status:"no-background",className:$t+" !border-none w-full",disabled:!t,children:[f.jsx(ie,{name:"add-row",strokeWidth:4,className:"rotate-[-90deg]",size:"18px"}),f.jsxs("div",{className:"flex flex-1 items-center justify-between",children:[f.jsx("span",{className:"text-xs",children:"Insert Column Left"}),f.jsx(ee.ChevronRight,{sx:{fontSize:14},className:"ml-auto text-neutral-400"})]})]})})}),f.jsx(Oe.Dropdown,{trigger:["hover"],getPopupContainer:N,align:{points:["tl","tr"],offset:[4,0],overflow:{adjustX:!0,adjustY:!1}},popupRender:()=>f.jsxs("div",{className:"flex flex-col bg-white dark:bg-black-800 shadow-lg rounded-lg border border-neutral-200 dark:border-black-600 p-1 min-w-[170px]",onClick:w,children:[f.jsx(G.Button,{id:"table-insert-blank-column-right",title:"Insert Blank Column Right",status:"no-background",className:$t+" !border-none",onClick:z(l),children:f.jsx("span",{className:"text-xs",children:"Insert blank column"})}),f.jsx(G.Button,{id:"table-insert-column-right-from-agreement",title:"Insert Column Right From Agreement",status:"no-background",className:$t+" !border-none",onClick:z(()=>g.onInsertColumnFromAgreement?.({colIndex:E()+1,tableId:x(),tableType:T(),headerIds:y()})),disabled:!g.onInsertColumnFromAgreement||!O,children:f.jsx("span",{className:"text-xs",children:"Insert from agreement"})})]}),children:f.jsx("div",{className:"w-full",children:f.jsxs(G.Button,{id:"table-insert-column-right",title:"Insert Column Right",status:"no-background",className:$t+" !border-none w-full",disabled:!t,children:[f.jsx(ie,{name:"add-row",strokeWidth:4,className:"rotate-[90deg]",size:"18px"}),f.jsxs("div",{className:"flex flex-1 items-center justify-between",children:[f.jsx("span",{className:"text-xs",children:"Insert Column Right"}),f.jsx(ee.ChevronRight,{sx:{fontSize:14},className:"ml-auto text-neutral-400"})]})]})})}),f.jsx("div",{className:"w-full",children:f.jsxs(G.Button,{id:"table-delete-column",title:"Delete Column",status:"no-background",className:$t+" !border-none",onClick:z(c),disabled:!t,children:[f.jsx(ie,{name:"table-delete-column",strokeWidth:2}),f.jsx("span",{className:"text-xs",children:"Delete Column"})]})}),f.jsx("div",{className:"w-full",children:f.jsxs(G.Button,{id:"table-merge-cells",title:"Merge Cells",status:"no-background",className:$t+" !border-none",onClick:z(p),disabled:!t||!r,children:[f.jsx(ie,{name:"table-merge-cell",strokeWidth:4}),f.jsx("span",{className:"text-xs",children:"Merge Cells"})]})}),f.jsx("div",{className:"w-full",children:f.jsxs(G.Button,{id:"table-split-cell",title:"Split Cell",status:"no-background",className:$t+" !border-none",onClick:z(m),disabled:!t||!n,children:[f.jsx(ie,{name:"table-split-cell",strokeWidth:4}),f.jsx("span",{className:"text-xs",children:"Split Cell"})]})}),f.jsx("div",{className:"w-full",children:f.jsxs(G.Button,{id:"table-delete-table",title:"Delete Table",status:"no-background",className:$t+" !border-none",onClick:z(_),disabled:!t,children:[f.jsx(ie,{name:"table-delete",strokeWidth:4}),f.jsx("span",{className:"text-xs",children:"Delete Table"})]})})]})},wU=({editor:e})=>{const[t,n]=A.useState(null),r=({state:i})=>{if(e.isActive("image")||e.isActive("codeBlock")||e.isActive("horizontalRule"))return!1;const{from:o,to:a}=i.selection;return o!==a&&!e.isActive("link")&&!(i.selection instanceof rt)};return A.useEffect(()=>{const i=()=>{n(null)};let o=null;const a=u=>{const m=u.target?.closest("td, th");if(!o||!m||!o.contains(m)){i();return}u.preventDefault();const _=e.view.posAtCoords({left:u.clientX,top:u.clientY})?.pos;_!==void 0&&e.chain().focus().setTextSelection(_).run();const h=192,g=360,b=12,E=Math.min(u.clientX,window.innerWidth-h-b),S=Math.min(u.clientY,window.innerHeight-g-b);n({x:Math.max(b,E),y:Math.max(b,S)})},s=u=>{u.target?.closest('[data-table-context-menu="true"]')||i()},l=u=>{u.key==="Escape"&&i()};let c=!1;const d=window.requestAnimationFrame(()=>{try{o=e.view.dom}catch{o=null}o&&(o.addEventListener("contextmenu",a),document.addEventListener("mousedown",s),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),document.addEventListener("keydown",l),c=!0)});return()=>{window.cancelAnimationFrame(d),!(!c||!o)&&(o.removeEventListener("contextmenu",a),document.removeEventListener("mousedown",s),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0),document.removeEventListener("keydown",l))}},[e]),f.jsxs(f.Fragment,{children:[f.jsx(Rf,{editor:e,shouldShow:r,options:{placement:"bottom",shift:{crossAxis:!0}},children:f.jsx(RU,{})}),f.jsx(Rf,{editor:e,shouldShow:()=>e.isActive("link"),options:{placement:"bottom",shift:{crossAxis:!0}},children:f.jsx(AU,{})}),f.jsx(Rf,{editor:e,shouldShow:()=>e.isActive("image"),options:{placement:"top",shift:{crossAxis:!0}},children:f.jsx(IU,{})}),t&&Ri.createPortal(f.jsx("div",{"data-table-context-menu":"true",className:"fixed z-[1000]",style:{left:`${t.x}px`,top:`${t.y}px`},children:f.jsx(kU,{onRequestClose:()=>n(null)})}),document.body)]})},J1=()=>{const[e,t]=A.useState(100);return{zoomLevel:e,handleZoomIn:()=>{t(a=>Math.min(a+10,200))},handleZoomOut:()=>{t(a=>Math.max(a-10,50))},handleFitToScreen:()=>{t(100)},handleSetZoom:a=>{t(Math.min(Math.max(a,50),200))}}},wd="!p-1 !max-h-none !rounded !bg-transparent hover:!bg-neutral-100 dark:hover:!bg-black-600",MU=({onPresentationModeToggle:e})=>{const{characterCount:t,wordCount:n}=Dn(),{zoomLevel:r,handleZoomIn:i,handleZoomOut:o,handleFitToScreen:a,handleSetZoom:s}=J1();return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex items-center gap-2 bg-white dark:bg-black-800 w-full justify-between px-4 py-0.5 editor-footer shadow-md z-[9999] border-t border-neutral-200 dark:border-black-600",style:{height:`${YA}px`},children:[f.jsxs("div",{className:"flex gap-4 text-sm text-neutral-600 dark:text-black-300",children:[f.jsxs("span",{children:["Characters: ",t]}),f.jsxs("span",{children:["Words: ",n]})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(G.Button,{id:"footer-zoom-out",title:"Zoom Out",status:"no-background",className:wd+" !border-none",onClick:o,children:f.jsx(ie,{name:"minus",size:16,strokeWidth:3.5})}),f.jsx("input",{type:"range",min:"50",max:"200",step:"10",value:r,onChange:l=>s(parseInt(l.target.value)),className:"w-20 h-1 accent-neutral-700 dark:accent-neutral-300 cursor-pointer",title:`${r}%`}),f.jsx(G.Button,{id:"footer-zoom-in",title:"Zoom In",status:"no-background",className:wd+" !border-none",onClick:i,children:f.jsx(ie,{name:"plus",size:16,strokeWidth:3.5})}),f.jsx("div",{className:"h-6 w-px bg-neutral-300 dark:bg-black-500"}),f.jsx(G.Button,{id:"footer-fit-to-screen",title:"Fit to Screen (100%)",status:"no-background",className:wd+" !border-none",onClick:a,children:f.jsx(ie,{name:"auto-width",size:16,strokeWidth:3.5})}),f.jsx("div",{className:"h-6 w-px bg-neutral-300 dark:bg-black-500"}),f.jsxs(G.Button,{id:"footer-presentation-mode",title:"Enter Presentation Mode",status:"no-background",className:`${wd} flex items-center gap-2 !py-px !border-none`,onClick:e,children:[f.jsx(ie,{name:"preview",strokeWidth:3.5}),f.jsx("span",{children:"Present"})]})]})]}),f.jsx("style",{children:`
@@ -225,7 +225,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
225
225
  hover:-translate-y-[1px] hover:shadow-md
226
226
  focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-400/60
227
227
  ${W?"bg-primary-50 dark:bg-primary-950/70 border-primary-300 dark:border-primary-700 shadow-md":"bg-white/95 dark:bg-black-800/95 border-neutral-200 dark:border-black-600"}
228
- `,style:{width:`${n}px`},title:`${N(V.type)} change ${H+1}`,children:[f.jsx("span",{"aria-hidden":"true",className:`absolute -left-[10px] top-1/2 -translate-y-1/2 z-[1] h-0 w-0 border-y-[9px] border-y-transparent border-r-[10px] ${W?"border-r-primary-300 dark:border-r-primary-700":"border-r-neutral-200 dark:border-r-black-600"}`}),f.jsx("span",{"aria-hidden":"true",className:`absolute -left-[9px] top-1/2 -translate-y-1/2 z-[2] h-0 w-0 border-y-[7px] border-y-transparent border-r-[9px] ${W?"border-r-primary-50 dark:border-r-primary-900":"border-r-white/95 dark:border-r-black-800/95"}`}),f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx(ie,{name:"redline-item",size:16,className:W?"text-primary-500":"text-neutral-500 dark:text-neutral-300"}),f.jsx("span",{className:`text-[10px] font-semibold tracking-wide truncate ${W?"text-primary-500":"text-neutral-600 dark:text-neutral-200"}`,style:{maxWidth:`${Math.max(n-66,40)}px`},children:P(V)})]}),f.jsx("span",{className:`inline-flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-[11px] font-bold leading-none ${W?"bg-primary-200 text-primary-700 dark:bg-primary-900 dark:text-primary-200":"bg-neutral-200 text-neutral-700 dark:bg-black-700 dark:text-neutral-200"}`,children:H+1})]})},V.id):f.jsx("div",{"data-redline-item":"true",style:{position:"absolute",top:`${j}px`,left:0,width:"380px",zIndex:W?8:3,pointerEvents:"auto",transition:v?"none":"top 200ms ease, left 200ms ease"},children:f.jsx(zf,{ref:oe=>{oe?m.current.set(V.id,oe):m.current.delete(V.id)},change:V,onAccept:o,onReject:a,onNavigate:s,onAddComment:l,onEditComment:c,onDeleteComment:d,currentUser:T,isActive:W,onSetActive:()=>{g(V.id),b(null)},isSuggestingMode:S,showComments:Sy,canReviewChanges:y})},V.id)})})}),z&&Ri.createPortal(f.jsx("div",{"data-redline-item":"true",className:"fixed pointer-events-auto z-[6] rounded-lg shadow-[0px_12px_32px_0px_rgba(16,24,40,0.08)]",style:{top:`${h.top}px`,left:`${h.left}px`,maxWidth:"380px",width:"380px",transform:h.showBelow?"none":"translateY(-100%)"},children:f.jsx(zf,{change:x,onAccept:o,onReject:a,onNavigate:s,onAddComment:l,onEditComment:c,onDeleteComment:d,currentUser:T,isActive:!0,onSetActive:()=>g(x.id),isSuggestingMode:S,showComments:Sy,canReviewChanges:y})}),document.body)]})},A7=({id:e,tools:t,position:n="right",isExpanded:r=!1,defaultActiveTool:i=null,expandedWidth:o=320,toggleToolbar:a})=>{const[s,l]=A.useState(i),c=t.filter(_=>!_.notVisible),d=_=>{(s!==_||!r)&&(a?.(!0),l(_))},u=()=>{a?.(!r),!r&&!s&&c.length>0?l(c[0].id):r&&l(null)},p=n==="left",m=c.find(_=>_.id===s)??null;return f.jsxs("div",{className:`h-full flex ${p?"flex-row":"flex-row-reverse"}`,children:[f.jsxs("div",{id:e,className:"h-full w-14 bg-white dark:bg-black-800 border border-neutral-200 dark:border-black-600 flex flex-col relative z-10",children:[f.jsx("div",{className:"flex-1 flex flex-col",children:c.map(_=>f.jsxs("button",{onClick:()=>d(_.id),className:`w-full h-14 flex items-center justify-center transition-all duration-[500ms] relative ${s===_.id&&r?"bg-blue-50 dark:bg-primary-950 text-blue-600 dark:text-primary-300":"text-gray-600 dark:text-black-300 hover:bg-neutral-100 dark:hover:bg-black-700 hover:text-neutral-900 dark:hover:text-white"}`,title:_.label,children:[s===_.id&&r&&f.jsx("div",{className:`absolute ${p?"right-0":"left-0"} top-0 bottom-0 w-0.5 bg-primary-600`}),f.jsx("div",{className:`flex items-center justify-center ${s===_.id&&r?"text-primary-400":"text-neutral-400 dark:text-black-300"}`,children:_.icon})]},_.id))}),f.jsx("button",{onClick:u,className:`w-full h-12 flex items-center justify-center text-gray-600 dark:text-black-300 hover:bg-neutral-100 dark:hover:bg-black-700 hover:text-neutral-900 dark:hover:text-white transition-colors duration-[500ms] ${r?"rotate-0":"rotate-180"}`,title:r?"Collapse sidebar":"Expand sidebar",children:f.jsx(ie,{name:"double-right-arrow",size:16,strokeWidth:2})})]}),f.jsx("div",{className:`h-full bg-white dark:bg-black-800 ${p?"border-r":"border-l"} border-neutral-200 dark:border-black-600 overflow-hidden transition-all duration-[500ms] ease-in-out shadow-lg z-10`,style:{width:r?`${o}px`:"0px",minWidth:r?`${o}px`:"0px"},children:r&&s&&m&&f.jsx("div",{className:`h-full transition-opacity duration-[500ms] ${r?"opacity-100 delay-100":"opacity-0"}`,style:{width:`${o}px`},children:m.content})})]})},O7=({onExport:e,onClose:t})=>{const[n,r]=A.useState(null),i=()=>{n&&(e?.({fileType:n}),r(null))},o=()=>{r(null),t?.()},a=[{value:"pdf",label:"PDF"},{value:"text",label:"Text"},{value:"json",label:"JSON"},{value:"html",label:"HTML"},{value:"markdown",label:"Markdown"}];return f.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-black-800",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-black-600",children:[f.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Export"}),t&&f.jsx("button",{onClick:t,className:"text-gray-400 dark:text-black-400 hover:text-gray-600 dark:hover:text-black-200 transition-colors",children:f.jsx(ee.Close,{sx:{fontSize:20}})})]}),f.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:f.jsx("div",{className:"space-y-6",children:f.jsxs("div",{children:[f.jsx("label",{className:"block text-xs font-semibold text-gray-500 dark:text-black-300 uppercase tracking-wide mb-2",children:"File Type"}),f.jsx(G.SelectField,{value:n,onChange:r,selectOptions:a,placeholder:"Select File Type",className:"w-full",getPopupContainer:()=>document.getElementById("editor-shell-qwCfsxssdsfsd")??document.body})]})})}),f.jsxs("div",{className:"px-4 py-3 border-t border-gray-200 dark:border-black-600 flex items-center justify-between bg-white dark:bg-black-800",children:[f.jsx("button",{onClick:o,className:"px-3 py-1.5 border border-neutral-300 dark:border-black-500 text-sm font-medium text-neutral-900 dark:text-white hover:bg-neutral-100 dark:hover:bg-black-700 rounded-lg transition-colors",children:"Cancel"}),f.jsx("button",{onClick:i,className:"px-3 py-1.5 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:!n,children:"Export"})]})]})},Ty=50,I7=()=>{const{editor:e}=lt(),[t,n]=A.useState(""),[r,i]=A.useState([]),[o,a]=A.useState(0),s=(m,_,h=!0)=>{if(!e)return;const g=_||r;if(m<0||m>=g.length)return;const b=g[m];e.commands.setTextSelection({from:b.from,to:b.to}),h&&e.commands.focus(),a(m)},l=(m,_=!1)=>{if(!e||!m){i([]),a(0);return}const h=[],g=m.toLowerCase(),b=e.state.doc;b.descendants((E,S)=>{if(E.isText&&E.text){const y=E.text,T=y.toLowerCase();let x=0;for(;x<T.length;){const v=T.indexOf(g,x);if(v===-1)break;const C=S+v,O=C+m.length,w=b.content.size,z=Math.max(0,C-Ty),N=Math.min(w-1,O+Ty);let P="",I="";try{C>z&&(P=b.textBetween(z,C," "),z>0&&(P="... "+P)),O<N&&(I=b.textBetween(O,N," "),N<w-1&&(I=I+" ..."))}catch(R){console.error("Error extracting context:",R)}h.push({id:`match-${h.length}`,from:C,to:O,text:y.substring(v,v+m.length),contextBefore:P,contextAfter:I}),x=v+1}}}),i(h),a(h.length>0?0:-1),_&&h.length>0&&s(0,h,!1)},c=()=>{if(r.length===0)return;const m=o>0?o-1:r.length-1;s(m,void 0,!0)},d=()=>{if(r.length===0)return;const m=o<r.length-1?o+1:0;s(m,void 0,!0)},u=m=>{if(!e||r.length===0||o<0)return;const _=r[o];e.chain().focus().setTextSelection({from:_.from,to:_.to}).insertContent(m).run(),setTimeout(()=>{l(t,!1)},50)},p=m=>{if(!e||r.length===0)return;const _=[...r].sort((g,b)=>b.from-g.from),h=e.state.tr;_.forEach(g=>{h.replaceWith(g.from,g.to,e.schema.text(m))}),e.view.dispatch(h),e.commands.focus(),setTimeout(()=>{l(t,!1)},50)};return A.useEffect(()=>{t&&e?l(t,!1):(i([]),a(0))},[t,e]),{searchQuery:t,setSearchQuery:n,matches:r,currentMatchIndex:o,goToPrevious:c,goToNext:d,replaceCurrent:u,replaceAll:p,navigateToMatch:s}},k7=({onClose:e,currentMode:t})=>{const[n,r]=A.useState("FIND & REPLACE"),[i,o]=A.useState(""),a=A.useRef(new Map),{searchQuery:s,setSearchQuery:l,matches:c,currentMatchIndex:d,goToPrevious:u,goToNext:p,replaceCurrent:m,replaceAll:_,navigateToMatch:h}=I7(),g=c.length;A.useEffect(()=>{const S=a.current.get(d);S&&S.scrollIntoView({behavior:"smooth",block:"nearest"})},[d]);const b=()=>{i&&s&&m(i)},E=()=>{i&&s&&_(i)};return f.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-black-800",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-black-600",children:[f.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Search"}),e&&f.jsx("button",{onClick:e,className:"text-gray-400 dark:text-black-400 hover:text-gray-600 dark:hover:text-black-200 transition-colors",children:f.jsx(ee.Close,{sx:{fontSize:20}})})]}),f.jsx("div",{className:"px-4 pt-3",children:f.jsx(G.Tabs,{variant:"switch",size:"sm",fullWidth:!0,className:"w-full",tabs:["FIND","FIND & REPLACE"],activeTab:n,onTabClick:S=>r(S),tabIcons:{FIND:f.jsx(ie,{name:"search",size:18}),"FIND & REPLACE":f.jsx(ie,{name:"search-and-replace",size:18})}})}),f.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[f.jsxs("div",{className:"p-4 space-y-3 flex-shrink-0",children:[f.jsx("div",{className:"w-full",children:f.jsx(G.SearchBar,{value:s,onChange:l,placeholder:"Search ...",id:"find-editor-search-bar",isClearable:!0})}),n==="FIND & REPLACE"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"relative",children:[f.jsx(ie,{name:"arrow-right",size:20,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 dark:text-black-400"}),f.jsx("input",{type:"text",value:i,onChange:S=>o(S.target.value),placeholder:"Replace with",className:"w-full h-8 pl-9 pr-3 py-2.5 border border-neutral-200 dark:border-black-600 rounded-lg bg-white dark:bg-black-700 text-neutral-900 dark:text-white placeholder:text-neutral-400 dark:placeholder:text-black-400 focus:outline-none focus:!border-primary-500 text-sm"})]}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx("button",{onClick:b,disabled:!s||!i||t==="viewing",className:"flex-1 h-9 px-3 py-1.5 text-sm font-medium border border-neutral-300 dark:border-black-500 text-neutral-900 dark:text-white rounded-lg hover:bg-neutral-50 dark:hover:bg-black-700 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Replace"}),f.jsx("button",{onClick:E,disabled:!s||!i||t==="viewing",className:"flex-1 h-9 px-3 py-1.5 text-sm font-medium border border-neutral-300 dark:border-black-500 text-neutral-900 dark:text-white rounded-lg hover:bg-neutral-50 dark:hover:bg-black-700 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Replace All"})]})]}),f.jsx("hr",{className:"border-neutral-200 dark:border-black-600"}),s&&g>0&&f.jsxs("div",{className:"flex items-center justify-between pt-2 pb-1",children:[f.jsxs("span",{className:"text-sm font-medium text-gray-700 dark:text-black-200",children:["Result ",d+1," of ",g]}),f.jsxs("div",{className:"flex gap-1",children:[f.jsx("button",{onClick:u,className:"p-1 hover:bg-gray-100 dark:hover:bg-black-600 rounded transition-colors text-neutral-700 dark:text-black-200",title:"Previous result",children:f.jsx(ee.KeyboardArrowUp,{sx:{fontSize:20}})}),f.jsx("button",{onClick:p,className:"p-1 hover:bg-gray-100 dark:hover:bg-black-600 rounded transition-colors text-neutral-700 dark:text-black-200",title:"Next result",children:f.jsx(ee.KeyboardArrowDown,{sx:{fontSize:20}})})]})]})]}),s&&g>0&&f.jsx("div",{className:"flex-1 overflow-y-auto px-4 pb-4",children:f.jsx("div",{className:"space-y-2",children:c.map((S,y)=>f.jsx("div",{ref:T=>{T?a.current.set(y,T):a.current.delete(y)},className:`p-3 rounded-lg cursor-pointer transition-colors ${y===d?"bg-primary-50 dark:bg-primary-950 border border-primary-200 dark:border-primary-800":"bg-primary-50 dark:bg-primary-700 hover:bg-primary-100 dark:hover:bg-primary-600"}`,onClick:()=>h(y,void 0,!0),children:f.jsxs("p",{className:"text-sm text-gray-700 dark:text-black-200 leading-relaxed",children:[S.contextBefore,f.jsx("span",{className:"text-primary-600 dark:text-primary-300 font-medium",children:S.text}),S.contextAfter]})},S.id))})}),s&&g===0&&f.jsx("div",{className:"flex-1 flex items-center justify-center text-gray-500 dark:text-black-400",children:f.jsxs("p",{className:"text-sm",children:['No results found for "',s,'"']})})]})]})},w7=[{label:"Free",value:null},{label:"1:1",value:1/1},{label:"4:3",value:4/3},{label:"16:9",value:16/9},{label:"3:2",value:3/2},{label:"2:3",value:2/3}],M7=({open:e,imageUrl:t,onApply:n,onCancel:r})=>{const[i,o]=A.useState(null),[a,s]=A.useState(0),[l,c]=A.useState(!1),[d,u]=A.useState(!1),[p,m]=A.useState({x:50,y:50,width:400,height:300}),[_,h]=A.useState(!1),[g,b]=A.useState(null),[E,S]=A.useState({x:0,y:0}),y=A.useRef(null),T=A.useRef(null),x=A.useRef(null);A.useEffect(()=>{if(T.current&&x.current&&e){const R=T.current,k=x.current,M=()=>{const B=R.getBoundingClientRect(),D=k.getBoundingClientRect(),U=Math.min(B.width*.8,400),H=Math.min(B.height*.8,300),V=B.left-D.left+(B.width-U)/2,j=B.top-D.top+(B.height-H)/2;m({x:V,y:j,width:U,height:H})};if(R.complete)M();else return R.addEventListener("load",M),()=>R.removeEventListener("load",M)}},[e,t]);const v=()=>{s(R=>(R-90+360)%360)},C=()=>{s(R=>(R+90)%360)},O=()=>{c(!l)},w=()=>{u(!d)};A.useEffect(()=>{i&&m(R=>({...R,height:R.width/i}))},[i]);const z=(R,k)=>{R.preventDefault(),S({x:R.clientX,y:R.clientY}),k?b(k):h(!0)},N=R=>{if(_){const k=R.clientX-E.x,M=R.clientY-E.y;m(B=>({...B,x:B.x+k,y:B.y+M})),S({x:R.clientX,y:R.clientY})}else if(g){const k=R.clientX-E.x,M=R.clientY-E.y;m(B=>{const D={...B};switch(g){case"tl":D.x+=k,D.y+=M,D.width-=k,D.height-=M;break;case"tr":D.y+=M,D.width+=k,D.height-=M;break;case"bl":D.x+=k,D.width-=k,D.height+=M;break;case"br":D.width+=k,D.height+=M;break;case"t":D.y+=M,D.height-=M;break;case"b":D.height+=M;break;case"l":D.x+=k,D.width-=k;break;case"r":D.width+=k;break}return i&&(D.height=D.width/i),D.width=Math.max(50,D.width),D.height=Math.max(50,D.height),D}),S({x:R.clientX,y:R.clientY})}},P=()=>{h(!1),b(null)};A.useEffect(()=>{if(_||g)return window.addEventListener("mousemove",N),window.addEventListener("mouseup",P),()=>{window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",P)}},[_,g,E]);const I=()=>{if(!y.current||!T.current||!x.current)return;const R=y.current,k=R.getContext("2d");if(!k)return;const M=T.current,B=x.current,D=M.getBoundingClientRect(),U=B.getBoundingClientRect(),H=M.naturalWidth/D.width,V=p.x-(D.left-U.left),j=p.y-(D.top-U.top),W=Math.max(0,V*H),oe=Math.max(0,j*H),Z=Math.min(p.width*H,M.naturalWidth-W),X=Math.min(p.height*H,M.naturalHeight-oe),se=document.createElement("canvas"),be=se.getContext("2d");if(!be)return;se.width=Z,se.height=X,be.drawImage(M,W,oe,Z,X,0,0,Z,X),a%180===0?(R.width=Z,R.height=X):(R.width=X,R.height=Z),k.save(),k.translate(R.width/2,R.height/2),k.scale(l?-1:1,d?-1:1),k.rotate(a*Math.PI/180),k.drawImage(se,-se.width/2,-se.height/2),k.restore();const pe=R.toDataURL("image/jpeg",.95);n(pe)};return f.jsx(Oe.Modal,{open:e,onCancel:r,footer:null,width:900,centered:!0,closeIcon:null,children:f.jsxs("div",{className:"p-2",children:[f.jsxs("div",{className:"flex items-center justify-between mb-6",children:[f.jsx("h2",{className:"text-xl font-semibold text-neutral-900 dark:text-neutral-100",children:"Crop Image"}),f.jsx("button",{onClick:r,className:"text-neutral-400 hover:text-neutral-600 dark:text-black-300 dark:hover:text-black-100 transition-colors",children:f.jsx(ee.Close,{sx:{fontSize:20}})})]}),f.jsxs("div",{className:"flex gap-4",children:[f.jsxs("div",{ref:x,className:"flex-1 relative bg-neutral-900 rounded-lg overflow-hidden",style:{height:"400px"},children:[f.jsx("img",{ref:T,src:t,alt:"Crop preview",className:"w-full h-full object-contain",style:{transform:`scaleX(${l?-1:1}) scaleY(${d?-1:1}) rotate(${a}deg)`}}),f.jsxs("div",{className:"absolute border-2 border-white cursor-move",style:{left:`${p.x}px`,top:`${p.y}px`,width:`${p.width}px`,height:`${p.height}px`,boxShadow:"0 0 0 9999px rgba(0, 0, 0, 0.6)"},onMouseDown:R=>z(R),children:[["tl","tr","bl","br"].map(R=>f.jsx("div",{className:"absolute w-3 h-3 bg-blue-500 rounded-full",style:{top:R.includes("t")?"-6px":"auto",bottom:R.includes("b")?"-6px":"auto",left:R.includes("l")?"-6px":"auto",right:R.includes("r")?"-6px":"auto",cursor:`${R.includes("t")?"n":"s"}${R.includes("l")?"w":"e"}-resize`},onMouseDown:k=>{k.stopPropagation(),z(k,R)}},R)),["t","b","l","r"].map(R=>f.jsx("div",{className:"absolute w-3 h-3 bg-blue-500 rounded-full",style:{top:R==="t"?"-6px":R==="b"?"auto":"50%",bottom:R==="b"?"-6px":"auto",left:R==="l"?"-6px":R==="r"?"auto":"50%",right:R==="r"?"-6px":"auto",transform:R==="t"||R==="b"?"translateX(-50%)":R==="l"||R==="r"?"translateY(-50%)":"none",cursor:`${R==="t"||R==="b"?"ns":"ew"}-resize`},onMouseDown:k=>{k.stopPropagation(),z(k,R)}},R))]})]}),f.jsxs("div",{className:"w-64 space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-semibold text-neutral-900 dark:text-neutral-100 mb-2",children:"Aspect Ratio"}),f.jsx("div",{className:"grid grid-cols-2 gap-2",children:w7.map(R=>f.jsx("button",{onClick:()=>o(R.value),className:`h-8 px-2 py-1 text-sm font-medium rounded-lg transition-colors ${i===R.value?"bg-primary-500 text-white":"bg-white dark:bg-black-700 border border-neutral-300 dark:border-black-500 text-neutral-700 dark:text-black-200 hover:bg-neutral-50 dark:hover:bg-black-600"}`,children:R.label},R.label))})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-semibold text-neutral-900 dark:text-neutral-100 mb-2",children:"Rotation"}),f.jsxs("div",{className:"grid grid-cols-4 gap-2 mb-2",children:[f.jsx("button",{onClick:v,className:"h-8 px-2 py-1 border border-neutral-300 dark:border-black-500 rounded-lg hover:bg-neutral-50 dark:hover:bg-black-600 text-neutral-700 dark:text-black-200 flex items-center justify-center",title:"Rotate Left",children:f.jsx(ee.RotateLeftOutlined,{sx:{fontSize:16}})}),f.jsx("button",{onClick:C,className:"h-8 px-2 py-1 border border-neutral-300 dark:border-black-500 rounded-lg hover:bg-neutral-50 dark:hover:bg-black-600 text-neutral-700 dark:text-black-200 flex items-center justify-center",title:"Rotate Right",children:f.jsx(ee.RotateRightOutlined,{sx:{fontSize:16}})}),f.jsx("button",{onClick:O,className:"h-8 px-2 py-1 border border-neutral-300 dark:border-black-500 rounded-lg hover:bg-neutral-50 dark:hover:bg-black-600 text-neutral-700 dark:text-black-200 flex items-center justify-center",title:"Flip Horizontal",children:f.jsx(ee.OpenInFullOutlined,{sx:{fontSize:14,transform:"rotate(45deg)"}})}),f.jsx("button",{onClick:w,className:"h-8 px-2 py-1 border border-neutral-300 dark:border-black-500 rounded-lg hover:bg-neutral-50 dark:hover:bg-black-600 text-neutral-700 dark:text-black-200 flex items-center justify-center",title:"Flip Vertical",children:f.jsx(ee.OpenInFullOutlined,{sx:{fontSize:14,transform:"rotate(135deg)"}})})]}),f.jsxs("div",{className:"flex h-8 items-stretch border border-neutral-300 dark:border-black-500 rounded-lg overflow-hidden",children:[f.jsxs("div",{className:"flex-1 flex items-center px-4 relative",children:[f.jsx("input",{type:"number",value:a,onChange:R=>s(parseInt(R.target.value)||0),className:"w-full text-sm font-semibold text-neutral-900 dark:text-neutral-100 focus:outline-none text-left border-none bg-transparent [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",style:{minWidth:0}}),f.jsx("span",{className:"text-sm text-neutral-900 dark:text-neutral-100 font-semibold ml-0.5",children:"°"})]}),f.jsxs("div",{className:"flex items-center border-l border-neutral-300 dark:border-black-500",children:[f.jsx("button",{onClick:()=>s((a+1)%360),className:"cursor-pointer w-8 flex items-center justify-center border-r border-neutral-300 dark:border-black-500 text-neutral-400 dark:text-black-300 transition-colors text-md",children:"+"}),f.jsx("div",{className:"w-px bg-neutral-300 dark:bg-black-500"}),f.jsx("button",{onClick:()=>s((a-1+360)%360),className:"cursor-pointer w-8 flex items-center justify-center text-neutral-400 dark:text-black-300 transition-colors text-md",children:"−"})]})]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-semibold text-neutral-900 dark:text-neutral-100 mb-2",children:"Dimensions"}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("label",{className:"block text-sm text-neutral-600 dark:text-black-300 mb-1",children:"Width"}),f.jsxs("div",{className:"flex h-8 items-stretch border border-neutral-300 dark:border-black-500 rounded-lg overflow-hidden",children:[f.jsx("input",{type:"number",value:Math.round(p.width),onChange:R=>{const k=parseInt(R.target.value)||0;m(M=>({...M,width:k,height:i?k/i:M.height}))},className:"flex-1 px-4 py-1.5 text-sm font-semibold text-neutral-900 dark:text-neutral-100 focus:outline-none text-left border-none bg-transparent [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",style:{minWidth:0}}),f.jsxs("div",{className:"flex items-center",children:[f.jsx("button",{onClick:()=>m(R=>({...R,width:R.width+10,height:i?(R.width+10)/i:R.height})),className:"cursor-pointer w-8 flex items-center justify-center border-r border-neutral-300 dark:border-black-500 text-neutral-400 dark:text-black-300 transition-colors text-md",children:"+"}),f.jsx("div",{className:"w-px bg-neutral-300 dark:bg-black-500"}),f.jsx("button",{onClick:()=>m(R=>({...R,width:Math.max(50,R.width-10),height:i?Math.max(50,R.width-10)/i:R.height})),className:"cursor-pointer w-8 flex items-center justify-center text-neutral-400 dark:text-black-300 transition-colors text-md",children:"−"})]})]}),f.jsx("span",{className:"flex items-center text-xs text-neutral-500 dark:text-black-300",children:"px"})]}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("label",{className:"block text-sm text-neutral-600 dark:text-black-300 mb-1",children:"Height"}),f.jsxs("div",{className:"flex h-8 items-stretch border border-neutral-300 dark:border-black-500 rounded-lg overflow-hidden",children:[f.jsx("input",{type:"number",value:Math.round(p.height),onChange:R=>{const k=parseInt(R.target.value)||0;m(M=>({...M,height:k,width:i?k*i:M.width}))},className:"flex-1 px-4 py-1.5 text-sm font-semibold text-neutral-900 dark:text-neutral-100 focus:outline-none text-left border-none bg-transparent [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",style:{minWidth:0},disabled:!!i}),f.jsxs("div",{className:"flex items-center",children:[f.jsx("button",{onClick:()=>m(R=>({...R,height:R.height+10,width:i?(R.height+10)*i:R.width})),className:"cursor-pointer w-8 flex items-center justify-center border-r border-neutral-300 dark:border-black-500 text-neutral-400 dark:text-black-300 transition-colors text-md",disabled:!!i,children:"+"}),f.jsx("div",{className:"w-px bg-neutral-300 dark:bg-black-500"}),f.jsx("button",{onClick:()=>m(R=>({...R,height:Math.max(50,R.height-10),width:i?Math.max(50,R.height-10)*i:R.width})),className:"cursor-pointer w-8 flex items-center justify-center text-neutral-400 dark:text-black-300 transition-colors text-md",disabled:!!i,children:"−"})]})]}),f.jsx("span",{className:"flex items-center text-xs text-neutral-500 dark:text-black-300",children:"px"})]})]})]})]})]}),f.jsxs("div",{className:"flex justify-between gap-2 mt-6",children:[f.jsx("button",{onClick:r,className:"px-4 py-2 text-sm font-medium text-neutral-700 dark:text-black-200 border border-neutral-300 dark:border-black-500 rounded-lg hover:bg-neutral-50 dark:hover:bg-black-600 transition-colors",children:"Cancel"}),f.jsx("button",{onClick:I,className:"px-4 py-2 text-sm font-medium text-white bg-primary-500 hover:bg-primary-600 rounded-lg transition-colors",children:"Apply"})]}),f.jsx("canvas",{ref:y,className:"hidden"})]})})};var yy={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Cy=A.createContext&&A.createContext(yy),D7=["attr","size","title"];function L7(e,t){if(e==null)return{};var n=P7(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function P7(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Bd(){return Bd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bd.apply(this,arguments)}function vy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vy(Object(n),!0).forEach(function(r){B7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function B7(e,t,n){return t=F7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F7(e){var t=U7(e,"string");return typeof t=="symbol"?t:t+""}function U7(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xy(e){return e&&e.map((t,n)=>A.createElement(t.tag,Fd({key:n},t.attr),xy(t.child)))}function z7(e){return t=>A.createElement(H7,Bd({attr:Fd({},e.attr)},t),xy(e.child))}function H7(e){var t=n=>{var{attr:r,size:i,title:o}=e,a=L7(e,D7),s=i||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),A.createElement("svg",Bd({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,a,{className:l,style:Fd(Fd({color:e.color||n.color},n.style),e.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),o&&A.createElement("title",null,o),e.children)};return Cy!==void 0?A.createElement(Cy.Consumer,null,n=>t(n)):t(yy)}function G7(e){return z7({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5zM1.6 11.85H0v3.999h.791v-1.342h.803q.43 0 .732-.173.305-.175.463-.474a1.4 1.4 0 0 0 .161-.677q0-.375-.158-.677a1.2 1.2 0 0 0-.46-.477q-.3-.18-.732-.179m.545 1.333a.8.8 0 0 1-.085.38.57.57 0 0 1-.238.241.8.8 0 0 1-.375.082H.788V12.48h.66q.327 0 .512.181.185.183.185.522m1.217-1.333v3.999h1.46q.602 0 .998-.237a1.45 1.45 0 0 0 .595-.689q.196-.45.196-1.084 0-.63-.196-1.075a1.43 1.43 0 0 0-.589-.68q-.396-.234-1.005-.234zm.791.645h.563q.371 0 .609.152a.9.9 0 0 1 .354.454q.118.302.118.753a2.3 2.3 0 0 1-.068.592 1.1 1.1 0 0 1-.196.422.8.8 0 0 1-.334.252 1.3 1.3 0 0 1-.483.082h-.563zm3.743 1.763v1.591h-.79V11.85h2.548v.653H7.896v1.117h1.606v.638z"},child:[]}]})(e)}const{Dragger:V7}=Oe.Upload,Y7=200*1024*1024,$7=({getFile:e,description:t,errorMessage:n=null,disabled:r=!1,defaultFile:i=null,acceptedFiles:o=null,isLoading:a=!1,asBase64:s=!1,multiple:l=!1,onDelete:c,hideSelectedFile:d=!1})=>{const[u,p]=A.useState(null),[m,_]=A.useState("#d9d9d9"),[h,g]=A.useState(!1),b={accept:o||"*",multiple:l,showUploadList:!1,disabled:r,beforeUpload:T=>{if(T.size>Y7)return!1;if(d||p(T),s){const x=new FileReader;x.onload=v=>{const C=v?.target?.result;e(C,T?.name)},x.readAsDataURL(T)}else e(T);return d||p(T),!1}},E=()=>{p(null),e(""),c?.()};A.useEffect(()=>{i?.name&&p(i)},[i]),A.useEffect(()=>{_(n?"#EF4444":"#d9d9d9")},[n]);const S=T=>T?T.length<=30?T:`${T.slice(0,23)}....${T.slice(-7)}`:"",y=({size:T=24,fill:x="#98A2B3"})=>f.jsx("svg",{width:T,height:T,viewBox:"0 0 24 24",fill:"none",children:f.jsx("path",{d:"M21 15V19C21 19.5304 20.7893 20.0391 20.4142 20.4142C20.0391 20.7893 19.5304 21 19 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V15M7 10L12 15M12 15L17 10M12 15V3",stroke:x,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});return f.jsxs("div",{children:[f.jsx("div",{className:"h-32",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:f.jsx(V7,{...b,style:{borderColor:h&&!n?"#016DCF":m,transition:"border-color 0.2s"},disabled:r||a,children:u&&!d?f.jsxs("div",{className:"flex items-center justify-between mx-5",title:u?.name||i?.name,children:[f.jsxs("div",{className:"flex items-center justify-center gap-4",children:[u?.type==="application/pdf"?f.jsx("div",{className:"p-3 bg-primary-50 rounded-lg",children:f.jsx(G7,{size:20,color:"#016DCF"})}):f.jsx("div",{className:"p-3 bg-primary-50 rounded-lg",children:f.jsx(ee.DescriptionRounded,{sx:{height:"20px",width:"20px",color:"#016DCF"}})}),f.jsxs("div",{className:"text-left",children:[f.jsx("p",{className:"text-sm font-medium text-gray-900",children:S(u?.name||i?.name)}),u?.size>0&&f.jsxs("p",{className:"text-xs text-gray-500",children:[(u.size/1024).toFixed(2)," KB"]})]})]}),a?f.jsx("div",{className:"animate-spin",children:f.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:f.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"#016DCF",strokeWidth:"4",strokeDasharray:"60",strokeLinecap:"round"})})}):f.jsx("button",{className:"ml-4 p-1 hover:bg-red-50 rounded transition-colors",onClick:T=>{T.stopPropagation(),E()},disabled:r,children:f.jsx(ee.DeleteOutline,{sx:{fontSize:20},className:"text-gray-400 hover:text-red-600"})})]}):f.jsx("div",{className:"flex items-center justify-center",children:f.jsxs("div",{className:"flex flex-col items-center",children:[f.jsx("div",{className:"mb-4 flex justify-center",children:f.jsx(y,{size:24,fill:"#98A2B3"})}),f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center justify-center",children:[f.jsx("span",{className:"text-sm font-medium text-primary-600",children:"Click to upload"}),f.jsx("span",{className:"text-sm font-medium text-gray-500 ml-1",children:"or drag and drop"})]}),t&&f.jsx("p",{className:"text-xs text-gray-400 mt-1 text-center",children:t})]})]})})})}),n&&f.jsx("p",{className:"text-red-500 text-xs mt-1 font-medium",children:n})]})},W7=({onInsert:e,onBack:t,onClose:n})=>{const[r,i]=A.useState(null),[o,a]=A.useState(""),[s,l]=A.useState(0),[c,d]=A.useState("center"),[u,p]=A.useState(2),[m,_]=A.useState("#4C04AF"),[h,g]=A.useState(8),[b,E]=A.useState(!1),S=(C,O)=>{if(typeof C=="string"){i(C),a(O||"image.png");const w=C.length*3/4;l(Math.round(w/1024))}else if(C instanceof File){a(C.name),l(Math.round(C.size/1024));const w=new FileReader;w.onload=z=>{i(z.target?.result)},w.readAsDataURL(C)}},y=()=>{i(null),a(""),l(0)},T=()=>{r&&e&&e({url:r,fileName:o,fileSize:s,alignment:c,borderWeight:u,borderColor:m,cornerRadius:h})},x=C=>{i(C),E(!1)},v=[{value:"left",icon:f.jsx(ee.FormatAlignLeftOutlined,{sx:{fontSize:16}}),title:"Align Left"},{value:"center",icon:f.jsx(ee.FormatAlignCenterOutlined,{sx:{fontSize:16}}),title:"Align Center"},{value:"right",icon:f.jsx(ee.FormatAlignRightOutlined,{sx:{fontSize:16}}),title:"Align Right"},{value:"full",icon:f.jsx(ee.FormatAlignJustifyOutlined,{sx:{fontSize:16}}),title:"Full Width"}];return f.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-black-800",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-neutral-200 dark:border-black-600",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[t&&f.jsx("button",{onClick:t,className:"text-neutral-600 dark:text-black-300 hover:text-neutral-900 dark:hover:text-white transition-colors",children:f.jsx(ee.ArrowBack,{sx:{fontSize:20}})}),f.jsx("h2",{className:"text-lg font-semibold text-neutral-900 dark:text-white",children:"Image"})]}),n&&f.jsx("button",{onClick:n,className:"text-neutral-400 dark:text-black-400 hover:text-neutral-600 dark:hover:text-black-200 transition-colors",children:f.jsx(ee.Close,{sx:{fontSize:20}})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto",children:[f.jsxs("div",{className:"p-4 space-y-4",children:[f.jsx("div",{className:"text-xs text-neutral-500 dark:text-black-300 uppercase font-medium",children:"Drag & drop onto the document to add"}),f.jsxs("div",{className:"flex flex-col",children:[r?f.jsx("div",{className:"relative w-full aspect-video bg-neutral-50 dark:bg-black-700 p-3 rounded-t-lg overflow-hidden border border-neutral-200 dark:border-black-600",children:f.jsx("img",{src:r,alt:"Preview",className:"w-full h-full object-cover",style:{border:u>0?`${u}px solid ${m}`:"none",borderRadius:`${h}px`}})}):f.jsx($7,{getFile:S,description:"PNG, JPG, GIF up to 200MB",acceptedFiles:"image/*",asBase64:!0,onDelete:y,hideSelectedFile:!0}),r&&f.jsxs("div",{className:"flex items-center gap-1 px-3 py-1.5 bg-neutral-50 dark:bg-black-700 rounded-b-lg border border-neutral-200 dark:border-black-600",children:[f.jsx(ie,{name:"image",size:20,className:"text-primary-500"}),f.jsx("span",{className:"flex-1 text-sm font-medium text-neutral-900 dark:text-white truncate",children:o}),f.jsxs("span",{className:"text-sm text-neutral-500 dark:text-black-400",children:["• ",s," KB"]}),f.jsx("button",{onClick:()=>E(!0),className:"py-1 px-2 ml-1 transition-colors mb-0.5 hover:bg-primary-50 dark:hover:bg-black-600 rounded",title:"Crop image",children:f.jsx(ee.CropRounded,{sx:{fontSize:16},className:"text-primary-600 dark:text-primary-400"})}),f.jsx("button",{onClick:y,className:"py-1 px-2 rounded transition-colors mb-0.5 hover:bg-red-50 dark:hover:bg-red-900/30",title:"Remove image",children:f.jsx(ee.DeleteOutline,{sx:{fontSize:16},className:"text-red-600 dark:text-red-400"})})]})]})]}),f.jsx("hr",{className:"border-neutral-200 dark:border-black-600"}),f.jsx("div",{className:"p-4 space-y-4",children:r&&f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{className:"text-sm font-semibold text-neutral-900 dark:text-white",children:"Image Settings"}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-xs font-medium text-neutral-500 dark:text-black-400 uppercase mb-2",children:"Alignment"}),f.jsx("div",{className:"grid grid-cols-4 gap-2",children:v.map(C=>f.jsx("button",{onClick:()=>d(C.value),className:`h-8 px-2 py-1 flex items-center justify-center rounded-lg border transition-colors ${c===C.value?"bg-primary-500 border-primary-500 text-white":"bg-white dark:bg-black-700 border-neutral-300 dark:border-black-500 text-neutral-600 dark:text-black-200 hover:border-primary-300 dark:hover:border-primary-500"}`,title:C.title,children:C.icon},C.value))})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-xs font-medium text-neutral-500 dark:text-black-400 uppercase mb-2",children:"Border Weight"}),f.jsxs("div",{className:"flex h-8 items-stretch border border-neutral-300 dark:border-black-500 rounded-lg overflow-hidden bg-white dark:bg-black-700",children:[f.jsx("input",{type:"number",value:u,onChange:C=>p(Math.max(0,parseInt(C.target.value)||0)),className:"flex-1 px-4 py-1.5 text-sm font-semibold text-neutral-900 dark:text-white focus:outline-none text-left border-none bg-transparent [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",style:{minWidth:0}}),f.jsxs("div",{className:"flex items-stretch border-r border-neutral-300 dark:border-black-500",children:[f.jsx("button",{onClick:()=>p(u+1),className:"w-8 flex items-center justify-center text-neutral-400 dark:text-black-400 hover:bg-neutral-50 dark:hover:bg-black-600 transition-colors text-md",children:"+"}),f.jsx("div",{className:"w-px bg-neutral-300 dark:bg-black-500"}),f.jsx("button",{onClick:()=>p(Math.max(0,u-1)),className:"w-8 flex items-center justify-center text-neutral-400 dark:text-black-400 hover:bg-neutral-50 dark:hover:bg-black-600 transition-colors text-md",children:"−"})]})]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-xs font-medium text-neutral-500 dark:text-black-400 uppercase mb-2",children:"Border Color"}),f.jsxs("div",{className:"flex gap-3 h-8 items-center",children:[f.jsx("div",{className:"w-6 cursor-pointer hover:opacity-80 transition-opacity m-1",children:f.jsx(Oe.ColorPicker,{value:m,onChange:C=>_(C.toHexString()),format:"hex",showText:!1})}),f.jsxs("div",{className:"flex-1 h-8 items-center border border-neutral-300 dark:border-black-500 rounded-lg overflow-hidden bg-white dark:bg-black-700",children:[f.jsx("div",{className:"w-px bg-neutral-300 dark:bg-black-500"}),f.jsx("input",{type:"text",value:m.toUpperCase(),onChange:C=>_(C.target.value),className:"flex-1 px-4 py-1 text-sm font-medium text-neutral-900 dark:text-white focus:outline-none border-none uppercase bg-transparent",placeholder:"#000000"})]})]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-xs font-medium text-neutral-500 dark:text-black-400 uppercase mb-2",children:"Corner Radius"}),f.jsxs("div",{className:"flex h-8 items-stretch border border-neutral-300 dark:border-black-500 rounded-lg overflow-hidden bg-white dark:bg-black-700",children:[f.jsx("input",{type:"number",value:h,onChange:C=>g(Math.max(0,parseInt(C.target.value)||0)),className:"flex-1 px-4 py-1.5 text-sm font-semibold text-neutral-900 dark:text-white focus:outline-none text-left border-none bg-transparent [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",style:{minWidth:0}}),f.jsxs("div",{className:"flex items-center",children:[f.jsx("button",{onClick:()=>g(h+1),className:"w-8 flex items-center justify-center border-r border-neutral-300 dark:border-black-500 text-neutral-400 dark:text-black-400 hover:bg-neutral-50 dark:hover:bg-black-600 transition-colors text-md",children:"+"}),f.jsx("div",{className:"w-px bg-neutral-300 dark:bg-black-500"}),f.jsx("button",{onClick:()=>g(Math.max(0,h-1)),className:"w-8 flex items-center justify-center text-neutral-400 dark:text-black-400 hover:bg-neutral-50 dark:hover:bg-black-600 transition-colors text-md",children:"−"})]})]})]})]})})]}),r&&f.jsxs("div",{className:"px-4 py-3 border-t border-neutral-200 dark:border-black-600 flex items-center justify-between bg-white dark:bg-black-800",children:[f.jsx("button",{onClick:()=>{i(null),a(""),l(0),t?.()},className:"px-4 py-2 text-sm font-medium text-neutral-700 dark:text-black-200 border border-neutral-300 dark:border-black-500 hover:bg-neutral-50 dark:hover:bg-black-700 rounded-lg transition-colors",children:"Cancel"}),f.jsx("button",{onClick:T,className:"px-4 py-2 text-sm font-medium text-white bg-primary-500 hover:bg-primary-600 rounded-lg transition-colors",children:"Insert"})]}),r&&f.jsx(M7,{open:b,imageUrl:r,onApply:x,onCancel:()=>E(!1)})]})},q7=({onClose:e})=>{const{editor:t}=lt(),[n,r]=A.useState(null),[i,o]=A.useState(!1),[a,s]=A.useState(null);A.useEffect(()=>{const m=_=>{const h=_;h.detail?.type==="image"&&(s(h.detail.pos??null),o(!0))};return window.addEventListener("insertElement",m),()=>{window.removeEventListener("insertElement",m)}},[]);const l=m=>{if(t)switch(m){case"image":s(null),o(!0);break;case"signature":t.commands.addSignature();break;case"codeBlock":t.chain().focus().toggleCodeBlock().run();break;case"divider":t.chain().focus().setHorizontalRule().run();break;case"page-break":t.chain().focus().setPageBreak().run();break}},c=m=>{if(!t)return;const _={src:m.url,alt:m.fileName,align:m.alignment,borderWeight:m.borderWeight,borderColor:m.borderColor,cornerRadius:m.cornerRadius},h=t.chain().focus();a!==null&&h.setTextSelection(a),h.insertContent({type:"image",attrs:_}).run(),o(!1),s(null),e?.()},d=[{icon:f.jsx(ie,{name:"image",size:20}),label:"Image",type:"image"},{icon:f.jsx(ie,{name:"signature",size:20}),label:"Signature",type:"signature"},{icon:f.jsx(ee.Code,{sx:{fontSize:20}}),label:"Code Block",type:"codeBlock"},{icon:f.jsx(ee.HorizontalRule,{sx:{fontSize:20}}),label:"Divider",type:"divider"},{icon:f.jsx(ee.InsertPageBreakOutlined,{sx:{fontSize:20}}),label:"Page break",type:"page-break"}],u=(m,_)=>{m.dataTransfer.effectAllowed="copy",m.dataTransfer.setData("elementType",_),m.dataTransfer.setData("text/plain",_),r(_)},p=()=>{r(null)};return i?f.jsx(W7,{onInsert:c,onBack:()=>{o(!1),s(null)},onClose:e}):f.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-black-800",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-black-600",children:[f.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Content"}),e&&f.jsx("button",{onClick:e,className:"text-gray-400 dark:text-black-400 hover:text-gray-600 dark:hover:text-black-200 transition-colors",children:f.jsx(ee.Close,{sx:{fontSize:20}})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[f.jsx("div",{className:"text-xs text-neutral-500 dark:text-black-300 uppercase font-medium mb-2",children:"Drag & drop onto the document to add"}),f.jsx("div",{className:"space-y-2",children:d.map(m=>f.jsxs("div",{draggable:!0,onDragStart:_=>u(_,m.type),onDragEnd:p,onClick:()=>l(m.type),className:`w-full flex items-start gap-2 px-3 py-2 rounded-lg border transition-all group cursor-move ${n===m.type?"opacity-50 border-primary-400 bg-primary-50 dark:bg-primary-950":"border-neutral-200 dark:border-black-600 hover:bg-neutral-50 dark:hover:bg-black-700 hover:border-primary-300"}`,children:[f.jsx("span",{className:"text-sm text-neutral-500 dark:text-black-100",children:m.icon}),f.jsx("div",{className:"flex-1 text-left",children:f.jsx("div",{className:"text-sm font-medium text-neutral-900 dark:text-white transition-colors",children:m.label})})]},m.label))})]})]})},j7=[],K7=[{value:"numbered",label:"Numbered",example:"Person 1, Company 1, Email 1"},{value:"descriptive",label:"Descriptive",example:"[PERSON_NAME], [COMPANY_NAME]"},{value:"redacted",label:"Redacted",example:"[REDACTED]"}],Q7=e=>e.value==="redacted"?f.jsxs("span",{className:"flex items-center gap-1",children:[e.example,","," ",f.jsx("span",{className:"inline-block w-16 h-3.5 bg-neutral-700 dark:bg-neutral-300 rounded-sm"})]}):e.example,X7=({detectionConfigs:e,onBack:t,onClose:n,onSave:r})=>{const{editorConfig:i}=lt(),o=i.piiAnonymization?.settings,[a,s]=A.useState(()=>{const S=e.map(T=>{const x=o?.detections?.find(v=>v.id===T.id);return{id:T.id,enabled:x?.enabled??!1}});return S.some(T=>T.enabled)?S:S.map(T=>({...T,enabled:!0}))}),[l,c]=A.useState(o?.placeholderFormat??"numbered"),[d,u]=A.useState(o?.highlightChanges??!1),p=(S,y)=>{s(T=>{const x=T.map(C=>C.id===S?{...C,enabled:y}:C);return x.some(C=>C.enabled)?x:x.map(C=>({...C,enabled:!0}))})},[m,_]=A.useState(!1),g=a.filter(S=>S.enabled).map(S=>S.id),b=e.filter(S=>a.find(y=>y.id===S.id)?.enabled).length,E=()=>{_(!0);const y={document_id:i.file?.id??"",tags:g,placeholder_format:l,highlight_changes:d,json_content:{}};i.piiAnonymization?.onSaveAnonymizationSettings?.(y)};return A.useEffect(()=>{m&&!i.piiAnonymization?.isScanningDocument&&(_(!1),r?.(g))},[i.piiAnonymization?.isScanningDocument]),f.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-black-800",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-black-600",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[t&&f.jsx(G.IconButton,{id:"anon-settings-back-btn",variant:"ghost",onClick:t,tooltip:"Back",noborder:!0,children:f.jsx(ee.ArrowBack,{sx:{fontSize:18}})}),f.jsx(G.Typography,{variant:"semibold",size:"medium",appearance:"title",children:"Anonymization Settings"})]}),n&&f.jsx(G.IconButton,{id:"anon-settings-close-btn",variant:"ghost",onClick:n,tooltip:"Close",noborder:!0,children:f.jsx(ee.Close,{sx:{fontSize:20}})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-5",children:[f.jsx(G.Card,{className:"!rounded-xl !border-success-100 dark:!border-success-800 !bg-success-50 dark:!bg-success-950/30 !px-4 !py-3 !shadow-none",children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-success-100 dark:bg-success-900/50",children:f.jsx(ee.CheckCircle,{sx:{fontSize:22},className:"text-success-600 dark:text-success-400"})}),f.jsxs("div",{children:[f.jsx(G.Typography,{variant:"semibold",size:"small",appearance:"title",children:"Document Protected"}),f.jsxs(G.Typography,{variant:"regular",size:"extra-small",appearance:"subtitle",className:"!text-success-700 dark:!text-success-400",children:[b," entities have been anonymized successfully"]})]})]})}),f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-1.5 mb-3",children:[f.jsx(ie,{name:"search",size:20,className:"text-primary-500 dark:text-black-300"}),f.jsx(G.Typography,{variant:"semibold",size:"small",appearance:"title",children:"Anonymization Mapping"})]}),f.jsx("div",{className:"space-y-2",children:e.map(S=>{const y=a.find(T=>T.id===S.id);return f.jsxs("div",{className:"flex items-center justify-between h-[50px] rounded-md border border-neutral-200 dark:border-black-600 bg-neutral-50 dark:bg-black-700 px-3 py-3",children:[f.jsxs("div",{className:"flex items-center gap-2.5",children:[f.jsx("div",{className:S.bgColor+" rounded-md p-1.5",children:f.jsx(ie,{name:S.iconName,size:18,className:S.iconColor})}),f.jsx(G.Typography,{variant:"medium",size:"extra-small",appearance:"title",className:"!text-sm",children:S.settingsLabel})]}),f.jsx(G.Checkbox,{id:`detection-${S.id}`,checked:y?.enabled??!1,onChange:T=>p(S.id,T),size:"small"})]},S.id)})})]}),f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-1.5 mb-3",children:[f.jsx(ee.LocalOffer,{sx:{fontSize:16},className:"text-primary-500 dark:text-black-300"}),f.jsx(G.Typography,{variant:"semibold",size:"small",appearance:"title",children:"Placeholder Format"})]}),f.jsx("div",{className:"space-y-2",children:K7.map(S=>{const y=l===S.value;return f.jsx("button",{type:"button",onClick:()=>c(S.value),className:`w-full text-left rounded-xl border px-4 py-3 transition-colors ${y?"border-primary-400 dark:border-primary-600 bg-primary-50 dark:bg-primary-950":"border-neutral-200 dark:border-black-600 bg-white dark:bg-black-700 hover:bg-neutral-50 dark:hover:bg-black-600"}`,children:f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx("div",{className:"pt-0.5",children:f.jsx(G.Radio,{isChecked:y,onSelect:()=>c(S.value),className:"h-4 w-4 shrink-0 accent-primary-600 dark:accent-primary-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/80 dark:focus-visible:ring-primary-400/80 focus-visible:ring-offset-1 focus-visible:ring-offset-white dark:focus-visible:ring-offset-black-800 rounded-full"})}),f.jsxs("div",{children:[f.jsx(G.Typography,{variant:"semibold",size:"extra-small",appearance:"title",className:"!text-sm mb-0.5",children:S.label}),f.jsx(G.Typography,{variant:"regular",size:"extra-small",appearance:"subtitle",children:Q7(S)})]})]})},S.value)})})]}),f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-1.5 mb-3",children:[f.jsx(ee.TuneOutlined,{sx:{fontSize:16},className:"text-primary-500 dark:text-black-300"}),f.jsx(G.Typography,{variant:"semibold",size:"small",appearance:"title",children:"Additional Options"})]}),f.jsxs("div",{className:"flex items-center justify-between rounded-md border border-neutral-200 dark:border-black-600 bg-neutral-50 dark:bg-black-700 px-3 py-3",children:[f.jsx(G.Typography,{variant:"medium",size:"extra-small",appearance:"title",className:"!text-sm",children:"Highlight changes in document"}),f.jsx(G.Checkbox,{id:"highlight-changes",checked:d,onChange:S=>u(S),size:"small"})]})]})]}),f.jsxs("div",{className:"px-4 py-3 w-full border-t border-gray-200 dark:border-black-600 flex justify-between items-center gap-2 bg-white dark:bg-black-800",children:[f.jsx(G.Button,{id:"anon-settings-cancel-btn",status:"secondary-neutral",appearance:"outline",onClick:t,className:"flex-1 py-1.5 border w-40 border-neutral-300 dark:border-black-500 bg-neutral-50 dark:bg-black-950",children:"Cancel"}),f.jsx(G.Button,{id:"anon-settings-save-btn",status:"primary",isLoading:i.piiAnonymization?.isScanningDocument??!1,onClick:E,className:"flex-1 py-1.5 border w-40 border-primary-300 dark:border-primary-200 bg-primary-50 dark:bg-primary-950",children:"Save Changes"})]})]})},Z7={nm:"Artboard",ddd:0,h:600,w:600,meta:{g:"LottieFiles AE 0.1.20",tc:"#ffffff"},layers:[{ty:4,nm:"Rectangle",sr:1,st:0,op:3600,ip:0,hd:!1,ddd:0,bm:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[0,0,0],ix:1},s:{a:0,k:[100,100,100],ix:6},sk:{a:0,k:0},p:{a:1,k:[{o:{x:.275,y:0},i:{x:.376,y:1},s:[300,485.5,0],t:0,ti:[0,0,0],to:[0,-60,0]},{o:{x:.632,y:0},i:{x:.725,y:1},s:[300,125.5,0],t:110,ti:[0,-60,0],to:[0,0,0]},{s:[300,485.5,0],t:220}],ix:2},r:{a:0,k:0,ix:10},sa:{a:0,k:0},o:{a:0,k:100,ix:11}},ef:[],shapes:[{ty:"gr",bm:0,hd:!1,mn:"ADBE Vector Group",nm:"Rectangle",ix:1,cix:2,np:2,it:[{ty:"rc",bm:0,hd:!1,mn:"ADBE Vector Shape - Rect",nm:"Rectangle Path 1",d:1,p:{a:0,k:[0,0],ix:3},r:{a:0,k:4.5,ix:4},s:{a:0,k:[300,9],ix:2}},{ty:"fl",bm:0,hd:!1,mn:"ADBE Vector Graphic - Fill",nm:"Fill 1",c:{a:0,k:[.0941,.4392,.8431],ix:4},r:1,o:{a:0,k:100,ix:5}},{ty:"tr",a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},sk:{a:0,k:0,ix:4},p:{a:0,k:[0,0],ix:2},r:{a:0,k:0,ix:6},sa:{a:0,k:0,ix:5},o:{a:0,k:100,ix:7}}]}],ind:1},{ty:4,nm:"bottom-grad",sr:1,st:0,op:3600,ip:0,hd:!1,ddd:0,bm:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[0,0,0],ix:1},s:{a:0,k:[100,-100,100],ix:6},sk:{a:0,k:0},p:{a:1,k:[{o:{x:.274,y:0},i:{x:.374,y:1},s:[300,463.5,0],t:1,ti:[0,-7.167,0],to:[0,-52.833,0]},{o:{x:.621,y:0},i:{x:.726,y:1},s:[300,146.5,0],t:111,ti:[0,-60,0],to:[0,7.167,0]},{s:[300,506.5,0],t:221}],ix:2},r:{a:0,k:0,ix:10},sa:{a:0,k:0},o:{a:1,k:[{o:{x:.333,y:0},i:{x:.667,y:1},s:[0],t:120},{o:{x:.333,y:0},i:{x:.667,y:1},s:[40],t:152},{o:{x:.333,y:0},i:{x:.667,y:1},s:[40],t:199},{s:[0],t:218}],ix:11}},ef:[],shapes:[{ty:"gr",bm:0,hd:!1,mn:"ADBE Vector Group",nm:"Rectangle",ix:1,cix:2,np:2,it:[{ty:"rc",bm:0,hd:!1,mn:"ADBE Vector Shape - Rect",nm:"Rectangle Path 1",d:1,p:{a:0,k:[0,0],ix:3},r:{a:0,k:0,ix:4},s:{a:0,k:[300,45],ix:2}},{ty:"gf",bm:0,hd:!1,mn:"ADBE Vector Graphic - G-Fill",nm:"Gradient Fill 1",e:{a:0,k:[0,22.5],ix:6},g:{p:3,k:{a:0,k:[0,.09411764705882353,.4392156862745098,.8431372549019608,.5,.09411764705882353,.4392156862745098,.8431372549019608,1,.09411764705882353,.4392156862745098,.8431372549019608,0,0,.5,.2,1,.4],ix:9}},t:1,a:{a:0,k:0},h:{a:0,k:0},s:{a:0,k:[0,-22.5],ix:5},r:1,o:{a:0,k:100,ix:10}},{ty:"tr",a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},sk:{a:0,k:0,ix:4},p:{a:0,k:[0,0],ix:2},r:{a:0,k:0,ix:6},sa:{a:0,k:0,ix:5},o:{a:0,k:100,ix:7}}]}],ind:2},{ty:4,nm:"top-grad",sr:1,st:0,op:3600,ip:0,hd:!1,ddd:0,bm:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[0,0,0],ix:1},s:{a:0,k:[100,100,100],ix:6},sk:{a:0,k:0},p:{a:1,k:[{o:{x:.271,y:0},i:{x:.376,y:1},s:[300,463.5,0],t:1,ti:[0,0,0],to:[0,-60,0]},{o:{x:.632,y:0},i:{x:.725,y:1},s:[300,103.5,0],t:111,ti:[0,-60,0],to:[0,0,0]},{s:[300,463.5,0],t:221}],ix:2},r:{a:0,k:0,ix:10},sa:{a:0,k:0},o:{a:1,k:[{o:{x:.167,y:0},i:{x:.833,y:1},s:[0],t:0},{o:{x:.333,y:0},i:{x:.667,y:1},s:[40],t:14},{o:{x:.333,y:0},i:{x:.667,y:1},s:[40],t:89},{o:{x:.333,y:0},i:{x:.833,y:1},s:[0],t:108},{s:[0],t:221}],ix:11}},ef:[],shapes:[{ty:"gr",bm:0,hd:!1,mn:"ADBE Vector Group",nm:"Rectangle",ix:1,cix:2,np:2,it:[{ty:"rc",bm:0,hd:!1,mn:"ADBE Vector Shape - Rect",nm:"Rectangle Path 1",d:1,p:{a:0,k:[0,0],ix:3},r:{a:0,k:0,ix:4},s:{a:0,k:[300,45],ix:2}},{ty:"gf",bm:0,hd:!1,mn:"ADBE Vector Graphic - G-Fill",nm:"Gradient Fill 1",e:{a:0,k:[0,22.5],ix:6},g:{p:3,k:{a:0,k:[0,.9490196078431372,.9568627450980393,.9686274509803922,.5,.09411764705882353,.4392156862745098,.8431372549019608,1,.09411764705882353,.4392156862745098,.8431372549019608,0,1,.5,.2,1,.4],ix:9}},t:1,a:{a:0,k:0},h:{a:0,k:0},s:{a:0,k:[0,-22.5],ix:5},r:1,o:{a:0,k:100,ix:10}},{ty:"tr",a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},sk:{a:0,k:0,ix:4},p:{a:0,k:[0,0],ix:2},r:{a:0,k:0,ix:6},sa:{a:0,k:0,ix:5},o:{a:0,k:100,ix:7}}]}],ind:3},{ty:0,nm:"full",sr:1,st:0,op:3600,ip:0,hd:!1,ddd:0,bm:0,hasMask:!0,ao:0,ks:{a:{a:0,k:[300,300,0],ix:1},s:{a:0,k:[100,100,100],ix:6},sk:{a:0,k:0},p:{a:0,k:[300,300,0],ix:2},r:{a:0,k:0,ix:10},sa:{a:0,k:0},o:{a:0,k:100,ix:11}},ef:[],masksProperties:[{nm:"Mask 1",inv:!1,mode:"i",x:{a:0,k:0,ix:4},o:{a:0,k:100,ix:3},pt:{a:1,k:[{o:{x:.272,y:0},i:{x:.364,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[448.801,109],[153,109],[153,479.957],[448.801,479.957]]}],t:0},{o:{x:.631,y:0},i:{x:.73,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[448.801,109],[153,109],[153,129.957],[448.801,129.957]]}],t:110},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[448.801,109],[153,109],[153,479.957],[448.801,479.957]]}],t:220}],ix:1}}],w:600,h:600,refId:"comp_0",ind:4},{ty:0,nm:"trans",sr:1,st:0,op:3600,ip:0,hd:!1,ddd:0,bm:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[300,300,0],ix:1},s:{a:0,k:[100,100,100],ix:6},sk:{a:0,k:0},p:{a:0,k:[300,300,0],ix:2},r:{a:0,k:0,ix:10},sa:{a:0,k:0},o:{a:0,k:100,ix:11}},ef:[],w:600,h:600,refId:"comp_1",ind:5}],v:"5.5.7",fr:60,op:227,ip:0,assets:JSON.parse('[{"nm":"","id":"comp_0","layers":[{"ty":4,"nm":"Rectangle Copy 10","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[274,400.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 3","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[128,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.2196,0.5451,0.9294],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":1},{"ty":4,"nm":"Rectangle Copy 9","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[368.5,302.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 5","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[41,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.2196,0.5451,0.9294],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":2},{"ty":4,"nm":"Rectangle Copy 8","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[348.5,351.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 4","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[81,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.2196,0.5451,0.9294],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":3},{"ty":4,"nm":"Rectangle Copy 7","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[249,351.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 2","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[78,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.2196,0.5451,0.9294],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":4},{"ty":4,"nm":"Rectangle Copy 6","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[270.5,302.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[121,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.2196,0.5451,0.9294],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":5},{"ty":4,"nm":"Rectangle 3","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[255,234.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[90,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.2196,0.5451,0.9294],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":6},{"ty":4,"nm":"Rectangle 2","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[299.89,304.75,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle","ix":1,"cix":2,"np":2,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":19,"ix":4},"s":{"a":0,"k":[245.78,319.5],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.949,0.9569,0.9686],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":7}]},{"nm":"","id":"comp_1","layers":[{"ty":4,"nm":"Rectangle Copy 3","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[274,400.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 3","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[128,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.8824,0.9137,0.949],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":1},{"ty":4,"nm":"Rectangle Copy 5","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[368.5,302.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 5","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[41,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.8824,0.9137,0.949],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":2},{"ty":4,"nm":"Rectangle Copy 4","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[348.5,351.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 4","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[81,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.8824,0.9137,0.949],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":3},{"ty":4,"nm":"Rectangle Copy 2","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[249,351.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 2","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[78,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.8824,0.9137,0.949],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":4},{"ty":4,"nm":"Rectangle Copy","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[270.5,302.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[121,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.8824,0.9137,0.949],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":5},{"ty":4,"nm":"Rectangle","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[255,234.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[90,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.8824,0.9137,0.949],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":6},{"ty":4,"nm":"Rectangle","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[299.89,304.75,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":60,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle","ix":1,"cix":2,"np":2,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":19,"ix":4},"s":{"a":0,"k":[245.78,319.5],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.949,0.9569,0.9686],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":7}]}]')},J7=1e4,Ny=90,e9=600,Ry=30,Gf=13e3,t9={completed:{lightBg:"linear-gradient(90deg, #ECFDF3 0%, rgba(236, 253, 243, 0.6) 100%)",darkBg:"linear-gradient(90deg, rgba(34, 197, 94, 0.18) 0%, rgba(34, 197, 94, 0.08) 100%)",border:"border-[#D1FADF] dark:border-success-900",textClass:"!text-neutral-600 dark:!text-neutral-200"},scanning:{lightBg:"linear-gradient(90deg, #ECFDF3 0%, rgba(230, 241, 252, 0.6) 100%)",darkBg:"linear-gradient(90deg, rgba(34, 197, 94, 0.18) 0%, rgba(59, 130, 246, 0.08) 100%)",border:"border-[#C6E1F9] dark:border-primary-900",textClass:"!text-neutral-600 dark:!text-neutral-200"},pending:{lightBg:"linear-gradient(90deg, #F9FAFB 0%, rgba(249, 250, 251, 0.6) 100%)",darkBg:"linear-gradient(90deg, rgba(148, 163, 184, 0.12) 0%, rgba(148, 163, 184, 0.04) 100%)",border:"border-[#F2F4F7] dark:border-neutral-700",textClass:"!text-neutral-400 dark:!text-neutral-400"}},n9=({status:e})=>e==="completed"?f.jsx(ee.CheckCircle,{sx:{fontSize:16},className:"text-success-600 dark:text-success-400"}):e==="scanning"?f.jsx(ie,{name:"loading",size:16,className:"text-blue-600 dark:text-blue-400 animate-spin"}):f.jsx("div",{className:"w-4 h-4 flex items-center justify-center",children:f.jsx("div",{className:"w-[13px] h-[13px] rounded-full bg-neutral-300 dark:bg-neutral-600"})}),r9=({status:e,label:t})=>{const n=t9[e];return f.jsxs("div",{className:`relative flex items-center gap-2 p-3 rounded-lg border border-transparent ${n.border} transition-all duration-300 overflow-hidden`,children:[f.jsx("div",{className:"absolute inset-0 dark:hidden",style:{background:n.lightBg},"aria-hidden":!0}),f.jsx("div",{className:"absolute inset-0 hidden dark:block",style:{background:n.darkBg},"aria-hidden":!0}),f.jsxs("div",{className:"relative z-10 flex items-center gap-2",children:[f.jsx(n9,{status:e}),f.jsx(G.Typography,{variant:"medium",size:"small",className:n.textClass,children:t})]})]})},i9=(e,t)=>{switch(t){case"completed":return`${e.label} identified`;case"scanning":return`Scanning ${e.label.toLowerCase()}...`;case"pending":return`${e.label} pending`}},o9=({detectionConfigs:e,runDocumentScan:t,isScanningDocument:n,onClose:r,onCancel:i,onComplete:o})=>{const[a,s]=A.useState(()=>!!t),[l,c]=A.useState(0),[d,u]=A.useState(0),p=A.useRef(null),m=A.useRef(null),_=A.useRef(o);_.current=o;const h=A.useRef(t);h.current=t;const g=n!==void 0,b=a||n===!0,E=A.useRef(b);E.current=b;const S=A.useRef(0),y=e.length;A.useEffect(()=>{if(!p.current)return;const C=pC.loadAnimation({container:p.current,renderer:"svg",loop:!0,autoplay:!1,animationData:Z7});return m.current=C,()=>{C.destroy(),m.current=null}},[]);const T=g?n===!0:t!=null?a:l<100;A.useEffect(()=>{const C=m.current;C&&(T?C.play():C.pause())},[T]),A.useEffect(()=>{let C=!1;const O=h.current;if(!O){s(!1);return}return(async()=>{try{await O()}catch{}finally{C||s(!1)}})(),()=>{C=!0}},[]),A.useEffect(()=>{if(!g||y===0)return;let C="approaching",O=0,w=0,z=!1;const N=Date.now(),P=setInterval(()=>{if(!z)if(C==="approaching"){if(!E.current){C="completing",O=Date.now(),w=S.current;return}const I=Date.now()-N,R=Math.min(Ny,I/J7*Ny);S.current=R,c(R),u(Math.min(Math.floor(R/100*y),y))}else{const I=Date.now()-O,R=100-w,k=Math.min(100,w+I/e9*R);S.current=k,c(k),u(Math.min(Math.floor(k/100*y),y)),k>=100&&(z=!0,clearInterval(P),_.current?.())}},Ry);return()=>clearInterval(P)},[g,y]),A.useEffect(()=>{!g||y!==0||b||_.current?.()},[g,b,y]),A.useEffect(()=>{if(g||a||y===0)return;const C=Date.now(),O=setInterval(()=>{const w=Date.now()-C,z=Math.min(w/Gf*100,100),N=Math.min(Math.floor(w/Gf*y),y);c(z),u(N),w>=Gf&&(clearInterval(O),_.current?.())},50);return()=>clearInterval(O)},[g,a,y]),A.useEffect(()=>{g||a||y!==0||_.current?.()},[g,a,y]);const x=C=>!g&&a?"pending":C<d?"completed":C===d&&d<y?"scanning":"pending",v=!g&&a;return f.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-black-800",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-black-600",children:[f.jsx(G.Typography,{variant:"semibold",size:"medium",appearance:"title",className:"text-neutral-900 dark:text-neutral-100",children:"PII Anonymization"}),r&&f.jsx(G.IconButton,{id:"pii-scanning-close-btn",variant:"ghost",onClick:r,tooltip:"Close",noborder:!0,className:"text-neutral-600 dark:text-neutral-300 hover:text-neutral-900 dark:hover:text-neutral-100",children:f.jsx(ee.Close,{sx:{fontSize:20}})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto p-5 space-y-4 bg-white dark:bg-black-800",children:[f.jsxs("div",{className:"relative flex flex-col items-center px-4 py-5 gap-3 rounded-lg overflow-hidden bg-gradient-to-br from-primary-50 to-primary-100 dark:from-primary-900 dark:to-primary-800",children:[f.jsx("div",{ref:p,className:"relative z-10 w-12 h-12 bg-white dark:bg-black-700 border border-primary-100 dark:border-black-400 rounded-xl flex items-center justify-center"}),f.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-1",children:[f.jsx(G.Typography,{variant:"semibold",size:"small",appearance:"title",className:"text-neutral-900 dark:text-neutral-100",children:b?"Scanning document…":"Analyzing Document..."}),f.jsx(G.Typography,{variant:"medium",size:"extra-small",appearance:"subtitle",className:"text-neutral-600 dark:text-neutral-300",children:b?"Waiting for server response…":"Detecting sensitive information"})]})]}),f.jsxs("div",{className:"space-y-3",children:[f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsx(G.Typography,{variant:"semibold",size:"small",appearance:"title",className:"text-neutral-900 dark:text-neutral-100",children:"Scanning progress"}),f.jsx("span",{className:"text-sm font-semibold text-primary-600 dark:text-primary-400",children:v?"—":`${Math.round(l)}%`})]}),f.jsx("div",{className:"w-full h-2.5 bg-primary-100 dark:bg-primary-975 rounded-full overflow-hidden",children:v?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"relative h-full w-1/3 rounded-full animate-pulse dark:hidden bg-primary-600","aria-hidden":!0}),f.jsx("div",{className:"relative h-full w-1/3 rounded-full animate-pulse hidden dark:block bg-primary-400","aria-hidden":!0})]}):f.jsxs("div",{className:"relative h-full rounded-full overflow-hidden",style:{width:`${l}%`,transition:`width ${Ry}ms linear`},children:[f.jsx("div",{className:"absolute inset-0 h-full rounded-full dark:hidden bg-primary-600 dark:bg-primary-975 linear-gradient(90deg, #54A4EC 0%, #016DCF 100%)","aria-hidden":!0}),f.jsx("div",{className:"absolute inset-0 h-full rounded-full hidden dark:block bg-primary-600","aria-hidden":!0})]})})]}),f.jsx("div",{className:"space-y-2",children:e.map((C,O)=>{const w=x(O);return f.jsx(r9,{status:w,label:i9(C,w)},C.id)})})]}),f.jsx("div",{className:"px-4 py-4 border-t border-gray-200 dark:border-black-600 bg-white dark:bg-black-800",children:f.jsx(G.Button,{id:"pii-cancel-scan-btn",status:"secondary-neutral",appearance:"outline",onClick:i,className:"w-full py-1.5 border border-neutral-300 dark:border-black-500 bg-neutral-100 dark:bg-black-700 text-neutral-900 dark:text-neutral-100 hover:bg-neutral-200 dark:hover:bg-black-600",children:"Cancel Scan"})})]})};function Ay(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ay(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function a9(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ay(e))&&(r&&(r+=" "),r+=t);return r}const Vf="-",s9=e=>{const t=c9(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const o=i.split(Vf);return o[0]===""&&o.length!==1&&o.shift(),Oy(o,t)||l9(i)},getConflictingClassGroupIds:(i,o)=>{const a=n[i]||[];return o&&r[i]?[...a,...r[i]]:a}}},Oy=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Oy(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(Vf);return t.validators.find(({validator:a})=>a(o))?.classGroupId},Iy=/^\[(.+)\]$/,l9=e=>{if(Iy.test(e)){const t=Iy.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},c9=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const i in n)Yf(n[i],r,i,t);return r},Yf=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:ky(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(d9(i)){Yf(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{Yf(a,ky(t,o),n,r)})})},ky=(e,t)=>{let n=e;return t.split(Vf).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},d9=e=>e.isThemeGetter,u9=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set(o,a){n.has(o)?n.set(o,a):i(o,a)}}},$f="!",Wf=":",p9=Wf.length,m9=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let a=0,s=0,l=0,c;for(let _=0;_<i.length;_++){let h=i[_];if(a===0&&s===0){if(h===Wf){o.push(i.slice(l,_)),l=_+p9;continue}if(h==="/"){c=_;continue}}h==="["?a++:h==="]"?a--:h==="("?s++:h===")"&&s--}const d=o.length===0?i:i.substring(l),u=f9(d),p=u!==d,m=c&&c>l?c-l:void 0;return{modifiers:o,hasImportantModifier:p,baseClassName:u,maybePostfixModifierPosition:m}};if(t){const i=t+Wf,o=r;r=a=>a.startsWith(i)?o(a.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},f9=e=>e.endsWith($f)?e.substring(0,e.length-1):e.startsWith($f)?e.substring(1):e,_9=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const r=[];let i=[];return n.forEach(o=>{o[0]==="["||t[o]?(r.push(...i.sort(),o),i=[]):i.push(o)}),r.push(...i.sort()),r}},h9=e=>({cache:u9(e.cacheSize),parseClassName:m9(e),sortModifiers:_9(e),...s9(e)}),g9=/\s+/,b9=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,a=[],s=e.trim().split(g9);let l="";for(let c=s.length-1;c>=0;c-=1){const d=s[c],{isExternal:u,modifiers:p,hasImportantModifier:m,baseClassName:_,maybePostfixModifierPosition:h}=n(d);if(u){l=d+(l.length>0?" "+l:l);continue}let g=!!h,b=r(g?_.substring(0,h):_);if(!b){if(!g){l=d+(l.length>0?" "+l:l);continue}if(b=r(_),!b){l=d+(l.length>0?" "+l:l);continue}g=!1}const E=o(p).join(":"),S=m?E+$f:E,y=S+b;if(a.includes(y))continue;a.push(y);const T=i(b,g);for(let x=0;x<T.length;++x){const v=T[x];a.push(S+v)}l=d+(l.length>0?" "+l:l)}return l};function E9(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=wy(t))&&(r&&(r+=" "),r+=n);return r}const wy=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=wy(e[r]))&&(n&&(n+=" "),n+=t);return n};function S9(e,...t){let n,r,i,o=a;function a(l){const c=t.reduce((d,u)=>u(d),e());return n=h9(c),r=n.cache.get,i=n.cache.set,o=s,s(l)}function s(l){const c=r(l);if(c)return c;const d=b9(l,n);return i(l,d),d}return function(){return o(E9.apply(null,arguments))}}const zt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},My=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Dy=/^\((?:(\w[\w-]*):)?(.+)\)$/i,T9=/^\d+\/\d+$/,y9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,C9=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,v9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,x9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,N9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,sa=e=>T9.test(e),Be=e=>!!e&&!Number.isNaN(Number(e)),Ci=e=>!!e&&Number.isInteger(Number(e)),qf=e=>e.endsWith("%")&&Be(e.slice(0,-1)),qr=e=>y9.test(e),R9=()=>!0,A9=e=>C9.test(e)&&!v9.test(e),Ly=()=>!1,O9=e=>x9.test(e),I9=e=>N9.test(e),k9=e=>!me(e)&&!fe(e),w9=e=>la(e,zy,Ly),me=e=>My.test(e),oo=e=>la(e,Hy,A9),jf=e=>la(e,B9,Be),Py=e=>la(e,Fy,Ly),M9=e=>la(e,Uy,I9),Ud=e=>la(e,Gy,O9),fe=e=>Dy.test(e),Ls=e=>ca(e,Hy),D9=e=>ca(e,F9),By=e=>ca(e,Fy),L9=e=>ca(e,zy),P9=e=>ca(e,Uy),zd=e=>ca(e,Gy,!0),la=(e,t,n)=>{const r=My.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ca=(e,t,n=!1)=>{const r=Dy.exec(e);return r?r[1]?t(r[1]):n:!1},Fy=e=>e==="position"||e==="percentage",Uy=e=>e==="image"||e==="url",zy=e=>e==="length"||e==="size"||e==="bg-size",Hy=e=>e==="length",B9=e=>e==="number",F9=e=>e==="family-name",Gy=e=>e==="shadow",U9=()=>{const e=zt("color"),t=zt("font"),n=zt("text"),r=zt("font-weight"),i=zt("tracking"),o=zt("leading"),a=zt("breakpoint"),s=zt("container"),l=zt("spacing"),c=zt("radius"),d=zt("shadow"),u=zt("inset-shadow"),p=zt("text-shadow"),m=zt("drop-shadow"),_=zt("blur"),h=zt("perspective"),g=zt("aspect"),b=zt("ease"),E=zt("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...y(),fe,me],x=()=>["auto","hidden","clip","visible","scroll"],v=()=>["auto","contain","none"],C=()=>[fe,me,l],O=()=>[sa,"full","auto",...C()],w=()=>[Ci,"none","subgrid",fe,me],z=()=>["auto",{span:["full",Ci,fe,me]},Ci,fe,me],N=()=>[Ci,"auto",fe,me],P=()=>["auto","min","max","fr",fe,me],I=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],R=()=>["start","end","center","stretch","center-safe","end-safe"],k=()=>["auto",...C()],M=()=>[sa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],B=()=>[e,fe,me],D=()=>[...y(),By,Py,{position:[fe,me]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],H=()=>["auto","cover","contain",L9,w9,{size:[fe,me]}],V=()=>[qf,Ls,oo],j=()=>["","none","full",c,fe,me],W=()=>["",Be,Ls,oo],oe=()=>["solid","dashed","dotted","double"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>[Be,qf,By,Py],se=()=>["","none",_,fe,me],be=()=>["none",Be,fe,me],pe=()=>["none",Be,fe,me],He=()=>[Be,fe,me],te=()=>[sa,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[qr],breakpoint:[qr],color:[R9],container:[qr],"drop-shadow":[qr],ease:["in","out","in-out"],font:[k9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[qr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[qr],shadow:[qr],spacing:["px",Be],text:[qr],"text-shadow":[qr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",sa,me,fe,g]}],container:["container"],columns:[{columns:[Be,me,fe,s]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:T()}],overflow:[{overflow:x()}],"overflow-x":[{"overflow-x":x()}],"overflow-y":[{"overflow-y":x()}],overscroll:[{overscroll:v()}],"overscroll-x":[{"overscroll-x":v()}],"overscroll-y":[{"overscroll-y":v()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{start:O()}],end:[{end:O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[Ci,"auto",fe,me]}],basis:[{basis:[sa,"full","auto",s,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Be,sa,"auto","initial","none",me]}],grow:[{grow:["",Be,fe,me]}],shrink:[{shrink:["",Be,fe,me]}],order:[{order:[Ci,"first","last","none",fe,me]}],"grid-cols":[{"grid-cols":w()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":w()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":P()}],"auto-rows":[{"auto-rows":P()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...I(),"normal"]}],"justify-items":[{"justify-items":[...R(),"normal"]}],"justify-self":[{"justify-self":["auto",...R()]}],"align-content":[{content:["normal",...I()]}],"align-items":[{items:[...R(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...R(),{baseline:["","last"]}]}],"place-content":[{"place-content":I()}],"place-items":[{"place-items":[...R(),"baseline"]}],"place-self":[{"place-self":["auto",...R()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:M()}],w:[{w:[s,"screen",...M()]}],"min-w":[{"min-w":[s,"screen","none",...M()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...M()]}],h:[{h:["screen","lh",...M()]}],"min-h":[{"min-h":["screen","lh","none",...M()]}],"max-h":[{"max-h":["screen","lh",...M()]}],"font-size":[{text:["base",n,Ls,oo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,fe,jf]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qf,me]}],"font-family":[{font:[D9,me,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,fe,me]}],"line-clamp":[{"line-clamp":[Be,"none",fe,jf]}],leading:[{leading:[o,...C()]}],"list-image":[{"list-image":["none",fe,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",fe,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Be,"from-font","auto",fe,oo]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Be,"auto",fe,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fe,me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",fe,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:H()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ci,fe,me],radial:["",fe,me],conic:[Ci,fe,me]},P9,M9]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:V()}],"gradient-via-pos":[{via:V()}],"gradient-to-pos":[{to:V()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:j()}],"rounded-s":[{"rounded-s":j()}],"rounded-e":[{"rounded-e":j()}],"rounded-t":[{"rounded-t":j()}],"rounded-r":[{"rounded-r":j()}],"rounded-b":[{"rounded-b":j()}],"rounded-l":[{"rounded-l":j()}],"rounded-ss":[{"rounded-ss":j()}],"rounded-se":[{"rounded-se":j()}],"rounded-ee":[{"rounded-ee":j()}],"rounded-es":[{"rounded-es":j()}],"rounded-tl":[{"rounded-tl":j()}],"rounded-tr":[{"rounded-tr":j()}],"rounded-br":[{"rounded-br":j()}],"rounded-bl":[{"rounded-bl":j()}],"border-w":[{border:W()}],"border-w-x":[{"border-x":W()}],"border-w-y":[{"border-y":W()}],"border-w-s":[{"border-s":W()}],"border-w-e":[{"border-e":W()}],"border-w-t":[{"border-t":W()}],"border-w-r":[{"border-r":W()}],"border-w-b":[{"border-b":W()}],"border-w-l":[{"border-l":W()}],"divide-x":[{"divide-x":W()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":W()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...oe(),"hidden","none"]}],"divide-style":[{divide:[...oe(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Be,fe,me]}],"outline-w":[{outline:["",Be,Ls,oo]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",d,zd,Ud]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",u,zd,Ud]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Be,oo]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":W()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",p,zd,Ud]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Be,fe,me]}],"mix-blend":[{"mix-blend":[...Z(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Z()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Be]}],"mask-image-linear-from-pos":[{"mask-linear-from":X()}],"mask-image-linear-to-pos":[{"mask-linear-to":X()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":X()}],"mask-image-t-to-pos":[{"mask-t-to":X()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":X()}],"mask-image-r-to-pos":[{"mask-r-to":X()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":X()}],"mask-image-b-to-pos":[{"mask-b-to":X()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":X()}],"mask-image-l-to-pos":[{"mask-l-to":X()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":X()}],"mask-image-x-to-pos":[{"mask-x-to":X()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":X()}],"mask-image-y-to-pos":[{"mask-y-to":X()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[fe,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":X()}],"mask-image-radial-to-pos":[{"mask-radial-to":X()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":y()}],"mask-image-conic-pos":[{"mask-conic":[Be]}],"mask-image-conic-from-pos":[{"mask-conic-from":X()}],"mask-image-conic-to-pos":[{"mask-conic-to":X()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:H()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",fe,me]}],filter:[{filter:["","none",fe,me]}],blur:[{blur:se()}],brightness:[{brightness:[Be,fe,me]}],contrast:[{contrast:[Be,fe,me]}],"drop-shadow":[{"drop-shadow":["","none",m,zd,Ud]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Be,fe,me]}],"hue-rotate":[{"hue-rotate":[Be,fe,me]}],invert:[{invert:["",Be,fe,me]}],saturate:[{saturate:[Be,fe,me]}],sepia:[{sepia:["",Be,fe,me]}],"backdrop-filter":[{"backdrop-filter":["","none",fe,me]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[Be,fe,me]}],"backdrop-contrast":[{"backdrop-contrast":[Be,fe,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Be,fe,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Be,fe,me]}],"backdrop-invert":[{"backdrop-invert":["",Be,fe,me]}],"backdrop-opacity":[{"backdrop-opacity":[Be,fe,me]}],"backdrop-saturate":[{"backdrop-saturate":[Be,fe,me]}],"backdrop-sepia":[{"backdrop-sepia":["",Be,fe,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",fe,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Be,"initial",fe,me]}],ease:[{ease:["linear","initial",b,fe,me]}],delay:[{delay:[Be,fe,me]}],animate:[{animate:["none",E,fe,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,fe,me]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:be()}],"rotate-x":[{"rotate-x":be()}],"rotate-y":[{"rotate-y":be()}],"rotate-z":[{"rotate-z":be()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:He()}],"skew-x":[{"skew-x":He()}],"skew-y":[{"skew-y":He()}],transform:[{transform:[fe,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:te()}],"translate-x":[{"translate-x":te()}],"translate-y":[{"translate-y":te()}],"translate-z":[{"translate-z":te()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",fe,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",fe,me]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Be,Ls,oo,jf]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},z9=S9(U9);function H9(...e){return z9(a9(e))}const G9="0 0 24 24",V9=14;function Vy(e,t){const n=A.forwardRef(({size:r=V9,color:i,className:o,style:a,...s},l)=>f.jsx("svg",{ref:l,xmlns:"http://www.w3.org/2000/svg",width:r,height:r,viewBox:G9,fill:"none","aria-hidden":"true",className:H9("text-neutral-900 dark:text-neutral-50",o),...s,dangerouslySetInnerHTML:{__html:t}}));return n.displayName=e,n}const Y9=Vy("VisibilityOffIcon",'<path d="M15.175 8.3251C15.6583 8.80843 16.0083 9.35843 16.225 9.9751C16.4583 10.5918 16.5417 11.2251 16.475 11.8751C16.475 12.1251 16.3833 12.3418 16.2 12.5251C16.0167 12.6918 15.8 12.7751 15.55 12.7751C15.3 12.7751 15.0833 12.6918 14.9 12.5251C14.7333 12.3418 14.65 12.1251 14.65 11.8751C14.7333 11.4418 14.7083 11.0251 14.575 10.6251C14.4417 10.2251 14.2333 9.88343 13.95 9.6001C13.6667 9.31676 13.325 9.1001 12.925 8.9501C12.525 8.8001 12.1 8.76676 11.65 8.8501C11.4 8.8501 11.1833 8.75843 11 8.5751C10.8333 8.39176 10.75 8.1751 10.75 7.9251C10.75 7.6751 10.8333 7.46676 11 7.3001C11.1833 7.11676 11.4 7.0251 11.65 7.0251C12.2833 6.95843 12.9083 7.04176 13.525 7.2751C14.1417 7.49176 14.6917 7.84176 15.175 8.3251ZM12 6.0001C11.6833 6.0001 11.375 6.01676 11.075 6.0501C10.775 6.06676 10.475 6.10843 10.175 6.1751C9.89167 6.2251 9.63333 6.18343 9.4 6.0501C9.18333 5.91676 9.03333 5.71676 8.95 5.4501C8.86667 5.18343 8.89167 4.9251 9.025 4.6751C9.175 4.4251 9.38333 4.2751 9.65 4.2251C10.0333 4.14176 10.4167 4.08343 10.8 4.0501C11.2 4.01676 11.6 4.0001 12 4.0001C14.2833 4.0001 16.3667 4.6001 18.25 5.8001C20.15 7.0001 21.6 8.61676 22.6 10.6501C22.6667 10.7834 22.7167 10.9251 22.75 11.0751C22.7833 11.2084 22.8 11.3501 22.8 11.5001C22.8 11.6501 22.7833 11.8001 22.75 11.9501C22.7333 12.0834 22.6917 12.2168 22.625 12.3501C22.325 13.0168 21.95 13.6418 21.5 14.2251C21.0667 14.8084 20.5833 15.3418 20.05 15.8251C19.85 16.0084 19.6167 16.0834 19.35 16.0501C19.0833 16.0168 18.8667 15.8834 18.7 15.6501C18.5333 15.4168 18.4583 15.1668 18.475 14.9001C18.5083 14.6168 18.625 14.3834 18.825 14.2001C19.225 13.8168 19.5917 13.4001 19.925 12.9501C20.2583 12.5001 20.55 12.0168 20.8 11.5001C19.9667 9.81676 18.7583 8.48343 17.175 7.5001C15.6083 6.5001 13.8833 6.0001 12 6.0001ZM12 19.0001C9.76667 19.0001 7.725 18.4001 5.875 17.2001C4.025 15.9834 2.56667 14.3918 1.5 12.4251C1.41667 12.2918 1.35 12.1501 1.3 12.0001C1.26667 11.8334 1.25 11.6668 1.25 11.5001C1.25 11.3334 1.26667 11.1751 1.3 11.0251C1.33333 10.8751 1.39167 10.7251 1.475 10.5751C1.80833 9.90843 2.19167 9.2751 2.625 8.6751C3.075 8.05843 3.58333 7.5001 4.15 7.0001L2.075 4.9001C1.89167 4.7001 1.8 4.46676 1.8 4.2001C1.81667 3.91676 1.91667 3.68343 2.1 3.5001C2.28333 3.31676 2.51667 3.2251 2.8 3.2251C3.08333 3.2251 3.31667 3.31676 3.5 3.5001L20.5 20.5001C20.6833 20.6834 20.775 20.9168 20.775 21.2001C20.7917 21.4668 20.7 21.7001 20.5 21.9001C20.3167 22.0834 20.0833 22.1751 19.8 22.1751C19.5167 22.1751 19.2833 22.0834 19.1 21.9001L15.6 18.4501C15.0167 18.6334 14.425 18.7751 13.825 18.8751C13.225 18.9584 12.6167 19.0001 12 19.0001ZM5.55 8.4001C5.06667 8.83343 4.625 9.30843 4.225 9.8251C3.825 10.3418 3.48333 10.9001 3.2 11.5001C4.03333 13.1834 5.23333 14.5251 6.8 15.5251C8.38333 16.5084 10.1167 17.0001 12 17.0001C12.3333 17.0001 12.6583 16.9834 12.975 16.9501C13.2917 16.9001 13.6167 16.8501 13.95 16.8001L13.05 15.8501C12.8667 15.9001 12.6917 15.9418 12.525 15.9751C12.3583 15.9918 12.1833 16.0001 12 16.0001C10.75 16.0001 9.68333 15.5668 8.8 14.7001C7.93333 13.8168 7.5 12.7501 7.5 11.5001C7.5 11.3168 7.50833 11.1418 7.525 10.9751C7.55833 10.8084 7.6 10.6334 7.65 10.4501L5.55 8.4001Z" fill="currentColor"/>'),$9=Vy("VisibilityIcon",'<path d="M12 16C13.25 16 14.3084 15.5667 15.175 14.7C16.0584 13.8167 16.5 12.75 16.5 11.5C16.5 10.25 16.0584 9.19167 15.175 8.325C14.3084 7.44167 13.25 7 12 7C10.75 7 9.68336 7.44167 8.80002 8.325C7.93336 9.19167 7.50003 10.25 7.50003 11.5C7.50003 12.75 7.93336 13.8167 8.80002 14.7C9.68336 15.5667 10.75 16 12 16ZM12 14.2C11.25 14.2 10.6084 13.9417 10.075 13.425C9.55836 12.8917 9.30002 12.25 9.30002 11.5C9.30002 10.75 9.55836 10.1167 10.075 9.6C10.6084 9.06667 11.25 8.8 12 8.8C12.75 8.8 13.3834 9.06667 13.9 9.6C14.4334 10.1167 14.7 10.75 14.7 11.5C14.7 12.25 14.4334 12.8917 13.9 13.425C13.3834 13.9417 12.75 14.2 12 14.2ZM12 19C9.76669 19 7.72502 18.4 5.87502 17.2C4.04169 16 2.59169 14.4167 1.52502 12.45C1.44169 12.3 1.37502 12.15 1.32502 12C1.29169 11.8333 1.27502 11.6667 1.27502 11.5C1.27502 11.3333 1.29169 11.175 1.32502 11.025C1.37502 10.8583 1.44169 10.7 1.52502 10.55C2.59169 8.58333 4.04169 7 5.87502 5.8C7.72502 4.6 9.76669 4 12 4C14.2334 4 16.2667 4.6 18.1 5.8C19.95 7 21.4084 8.58333 22.475 10.55C22.5584 10.7 22.6167 10.8583 22.65 11.025C22.7 11.175 22.725 11.3333 22.725 11.5C22.725 11.6667 22.7 11.8333 22.65 12C22.6167 12.15 22.5584 12.3 22.475 12.45C21.4084 14.4167 19.95 16 18.1 17.2C16.2667 18.4 14.2334 19 12 19ZM12 17C13.8834 17 15.6084 16.5083 17.175 15.525C18.7584 14.525 19.9667 13.1833 20.8 11.5C19.9667 9.81667 18.7584 8.48333 17.175 7.5C15.6084 6.5 13.8834 6 12 6C10.1167 6 8.38336 6.5 6.80002 7.5C5.23336 8.48333 4.03336 9.81667 3.20002 11.5C4.03336 13.1833 5.23336 14.525 6.80002 15.525C8.38336 16.5083 10.1167 17 12 17Z" fill="currentColor"/>');function Ps(e){if(Array.isArray(e))return e;if(typeof e=="string"&&e.trim())try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{}return[]}function Hd(e,t){if(!t)return!0;const r=Ps(e)[0]?.anonymizedVariable??"";return t.has(r)}function Kf(e,t,n){const{state:r}=e,{tr:i,schema:o}=r,a=o.marks.anonymizedLink,s=[],l=[];r.doc.descendants((c,d)=>{if(c.type.name==="anonymizedText"){if(c.attrs.showValue===t)return;const u=c.attrs.anonymizedData;if(!Hd(u,n))return;s.push({pos:d,attrs:{...c.attrs,showValue:t}});return}if(a&&c.isText){const u=c.marks.find(p=>p.type===a);if(!u||u.attrs.showValue===t||!Hd(u.attrs.anonymizedData,n))return;l.push({from:d,to:d+c.nodeSize,attrs:u.attrs})}});for(const{pos:c,attrs:d}of s)i.setNodeMarkup(i.mapping.map(c),void 0,d);if(a)for(const{from:c,to:d,attrs:u}of l){const p=i.mapping.map(c),m=i.mapping.map(d);i.removeMark(p,m,a),i.addMark(p,m,a.create({...u,showValue:t}))}i.docChanged&&e.view.dispatch(i)}function Yy(e,t){const{state:n}=e,{tr:r,schema:i}=n,o=i.marks.anonymizedLink,a=i.marks.link;if(!o||!a)return;const s=[];if(n.doc.descendants((l,c)=>{if(!l.isText)return;const d=l.marks.find(u=>u.type===o);d&&Hd(d.attrs.anonymizedData,t)&&s.push({from:c,to:c+l.nodeSize,attrs:d.attrs})}),s.length!==0){for(const{from:l,to:c,attrs:d}of s){const p=Ps(d.anonymizedData)[0]?.value??d.href??null;r.removeMark(l,c,o),r.addMark(l,c,a.create({href:p,target:d.target??null,rel:d.rel??null,class:d.class??null}))}r.docChanged&&e.view.dispatch(r)}}function $y(e,t){const{state:n}=e,{tr:r}=n,i=[];n.doc.descendants((o,a)=>{if(o.type.name!=="anonymizedText")return;const s=o.attrs.anonymizedData;if(!Hd(s,t))return;let l=o.attrs.placeholder;try{const c=JSON.parse(s);c[0]?.value&&(l=c[0].value)}catch{}i.push({from:a,to:a+o.nodeSize,text:l})});for(let o=i.length-1;o>=0;o--){const{from:a,to:s,text:l}=i[o];r.replaceWith(a,s,n.schema.text(l))}r.docChanged&&e.view.dispatch(r)}function Wy(e,t){const r=Ps(t)[0];if(!r?.anonymizedVariable)return;const i=YT(t),o=r.anonymizedVariable,a=r.value??"";e[i]||(e[i]=[]);const s=e[i].find(l=>l[o]!==void 0);s?s.count=(typeof s.count=="number"?s.count:1)+1:e[i].push({[o]:a,count:1})}function qy(e){const t={},n=e.state.schema.marks.anonymizedLink;return e.state.doc.descendants(r=>{if(r.type.name==="anonymizedText"){Wy(t,r.attrs.anonymizedData);return}if(n&&r.isText){const i=r.marks.find(a=>a.type===n);if(!i)return;const o=JSON.stringify(Ps(i.attrs.anonymizedData));Wy(t,o)}}),t}function jy(e,t){const n=t?.revealState??"placeholder",r=new Set,i=e.state.schema.marks.anonymizedLink,o=(a,s)=>{if(n==="placeholder"&&s||n==="revealed"&&!s)return;const c=Ps(a)[0]?.anonymizedVariable;c&&r.add(c)};return e.state.doc.descendants(a=>{if(a.type.name==="anonymizedText"){o(a.attrs.anonymizedData,a.attrs.showValue===!0);return}if(i&&a.isText){const s=a.marks.find(l=>l.type===i);if(!s)return;o(s.attrs.anonymizedData,s.attrs.showValue===!0)}}),r}function Ky(e,t){const n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return`rgba(${n},${r},${i},${t})`}function Qf(e,t){return e.replace(/[\d.]+\)$/,`${t})`)}const Qy={...Object.fromEntries(Object.entries(Td).map(([e,t])=>[e,{light:{bg:`linear-gradient(90deg, ${t.bg} 0%, ${Ky(t.bg,.6)} 100%)`,border:Ky(t.color,.25)},dark:{bg:`linear-gradient(90deg, ${Qf(t.darkBg,.18)} 0%, ${Qf(t.darkBg,.06)} 100%)`,border:Qf(t.darkBg,.4)}}])),default:{light:{bg:"linear-gradient(90deg, #F9FAFB 0%, rgba(249,250,251,0.6) 100%)",border:"#E5E7EB"},dark:{bg:"linear-gradient(90deg, rgba(148,163,184,0.12) 0%, rgba(148,163,184,0.04) 100%)",border:"rgba(148,163,184,0.35)"}}},W9={person:{iconName:"person",label:"Person"},organization:{iconName:"apartment",label:"Organization"},email:{iconName:"email",label:"Email"},phone:{iconName:"phone",label:"Phone"},location:{iconName:"public",label:"Location"},date:{iconName:"calendar_month",label:"Date"},time:{iconName:"schedule",label:"Time"},money:{iconName:"payments",label:"Money"},url:{iconName:"link",label:"URL"}},Gd={light:{bg:"linear-gradient(90deg, #ECFDF3 0%, rgba(236,253,243,0.6) 100%)",border:"#D1FADF"},dark:{bg:"linear-gradient(90deg, rgba(34,197,94,0.2) 0%, rgba(34,197,94,0.08) 100%)",border:"rgba(34,197,94,0.45)"}};function q9(e,t){return Object.entries(e).filter(([,n])=>n.length>0).map(([n,r],i)=>{const o=n.toLowerCase(),a=W9[o],s=Td[o],l=t.find(d=>d.label.toLowerCase()===o||d.id.toLowerCase()===o)??{id:o.replace(/\s+/g,"_"),label:a?.label??n.charAt(0).toUpperCase()+n.slice(1),iconName:a?.iconName??"tag",iconColor:s?.color??"text-neutral-500",bgColor:"bg-neutral-100 dark:bg-neutral-800",settingsLabel:a?.label??n},c=[];return r.forEach((d,u)=>{const p=typeof d.count=="number"?d.count:Number(d.count??1);Object.entries(d).filter(([m])=>m!=="count").forEach(([m,_],h)=>{const g=m.startsWith("[")&&m.endsWith("]")?m.slice(1,-1):m;c.push({id:`api-${i}-${u}-${h}`,replacement:g,original:String(_),occurrences:p})})}),{config:l,entities:c}})}const j9=({entity:e,isSelected:t,onToggle:n,isApplied:r})=>r?f.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 rounded-md hover:bg-neutral-50 dark:hover:bg-black-700/50 transition-colors",children:[f.jsxs("div",{className:"flex items-center gap-1.5 flex-1 min-w-0",children:[f.jsx("span",{className:"text-xs font-medium text-primary-600 dark:text-primary-400 truncate",children:e.replacement}),f.jsx("span",{className:"text-neutral-400 dark:text-neutral-500 text-xs shrink-0",children:"←"}),f.jsx("span",{className:"text-xs font-medium text-neutral-700 dark:text-neutral-300 truncate",children:e.original})]}),f.jsxs("span",{className:"bg-neutral-100 dark:bg-neutral-800 rounded-lg px-1.5 py-0.5 text-xs font-medium text-neutral-600 dark:text-neutral-400 shrink-0",children:[e.occurrences," replacement",e.occurrences!==1?"s":""]})]}):f.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-md hover:bg-neutral-50 dark:hover:bg-black-700/50 transition-colors",children:[f.jsx(G.Checkbox,{id:`entity-${e.id}`,checked:t,onChange:i=>n(e.id,i),size:"small"}),f.jsxs("div",{className:"flex items-center gap-1.5 flex-1 min-w-0",children:[f.jsx("span",{className:"text-xs font-medium text-neutral-800 dark:text-neutral-200 truncate",children:e.original}),f.jsx("span",{className:"text-neutral-400 dark:text-neutral-500 text-xs shrink-0",children:"→"}),f.jsx("span",{className:"text-xs font-medium text-primary-600 dark:text-primary-400 truncate",children:e.replacement})]}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs("span",{className:"bg-neutral-100 dark:bg-neutral-800 rounded-lg px-1.5 py-0.5 text-xs font-medium text-neutral-600 dark:text-neutral-400",children:[e.occurrences," times"]}),f.jsx("button",{type:"button",className:"rounded pb-1 text-neutral-400 dark:text-neutral-500 hover:text-neutral-600 dark:hover:text-neutral-300 focus-visible:outline focus-visible:ring-2 focus-visible:ring-primary-500 dark:focus-visible:ring-primary-400 transition-colors","aria-label":"Locate in document",children:f.jsx(ee.GpsFixed,{sx:{fontSize:16}})})]})]}),K9=({category:e,isExpanded:t,onToggleExpand:n,selectedIds:r,onToggleEntity:i,isApplied:o})=>{const a=Qy[e.config.id]??Qy.default,s=e.entities;return s.length===0?null:f.jsxs("div",{className:"rounded-lg overflow-hidden relative border border-transparent",children:[f.jsx("div",{className:"absolute inset-0 rounded-lg border pointer-events-none dark:hidden",style:{borderColor:a.light.border},"aria-hidden":!0}),f.jsx("div",{className:"absolute inset-0 rounded-lg border pointer-events-none hidden dark:block",style:{borderColor:a.dark.border},"aria-hidden":!0}),f.jsxs("button",{type:"button",className:"relative w-full flex items-center justify-between px-3 py-2.5 focus-visible:outline focus-visible:ring-2 focus-visible:ring-primary-500 dark:focus-visible:ring-primary-400 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-black-800 rounded-t-lg transition-colors",onClick:n,children:[f.jsx("div",{className:"absolute inset-0 dark:hidden",style:{background:a.light.bg},"aria-hidden":!0}),f.jsx("div",{className:"absolute inset-0 hidden dark:block",style:{background:a.dark.bg},"aria-hidden":!0}),f.jsxs("div",{className:"relative z-10 flex items-center gap-2 w-full justify-between",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(ie,{name:e.config.iconName,size:16,className:e.config.iconColor.startsWith("text-")?e.config.iconColor:"",fillColor:e.config.iconColor.startsWith("#")?e.config.iconColor:void 0}),f.jsx("span",{className:"text-xs font-semibold text-neutral-800 dark:text-neutral-200",children:e.config.label}),f.jsx("span",{className:"text-xs font-medium text-neutral-600 dark:text-neutral-400 bg-neutral-100 dark:bg-neutral-800 rounded-full px-2 border border-neutral-300 dark:border-neutral-600",children:s.length})]}),f.jsx(ee.KeyboardArrowUp,{sx:{fontSize:14},className:`text-neutral-400 dark:text-neutral-500 transition-transform shrink-0 ${t?"":"rotate-180"}`})]})]}),t&&f.jsx("div",{className:"bg-white dark:bg-black-800 border-t border-neutral-200 dark:border-black-600 divide-y divide-neutral-100 dark:divide-black-600",children:s.map(l=>f.jsx(j9,{entity:l,isSelected:r.has(l.id),onToggle:i,isApplied:o},l.id))})]})},Q9=({detectionConfigs:e,onClose:t,onApply:n,onRevertAnonymization:r})=>{const{editor:i,editorConfig:o}=lt(),[a,s]=A.useState(o.piiAnonymization?.isAnonymized??!1),[l,c]=A.useState(!1),[d,u]=A.useState(()=>i?qy(i):{});A.useEffect(()=>{s(o.piiAnonymization?.isAnonymized??!1)},[o.piiAnonymization?.isAnonymized]),A.useEffect(()=>{if(!i)return;const v=()=>u(qy(i));v();const C=({transaction:O})=>{O.docChanged&&v()};return i.on("transaction",C),()=>{i.off("transaction",C)}},[i]);const p=A.useMemo(()=>Object.keys(d).length===0?[]:q9(d,e),[d,e]),m=A.useMemo(()=>p.flatMap(v=>v.entities.map(C=>C.id)),[p]),_=m.length,h=a?_:0,[g,b]=A.useState(()=>new Set(m)),[E,S]=A.useState(()=>new Set(p.map(v=>v.config.id)));A.useEffect(()=>{const v=new Set(m);b(C=>{const O=new Set;for(const w of v)(C.size===0||C.has(w))&&O.add(w);return O.size===C.size&&[...O].every(w=>C.has(w))?C:O})},[m]),A.useEffect(()=>{const v=p.map(C=>C.config.id);S(C=>C.size>0?C:new Set(v))},[p]);const y=A.useCallback((v,C)=>{b(O=>{const w=new Set(O);return C?w.add(v):w.delete(v),w})},[]),T=A.useCallback(()=>{const v=g.size===_;b(v?new Set:new Set(m))},[g.size,_,m]),x=A.useCallback(v=>{S(C=>{const O=new Set(C);return O.has(v)?O.delete(v):O.add(v),O})},[]);return A.useEffect(()=>{if(!i||!a)return;const v=()=>{c(jy(i,{revealState:"revealed"}).size>0)};return v(),i.on("update",v),()=>{i.off("update",v)}},[i,a]),f.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-black-800",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-black-600",children:[f.jsx(G.Typography,{variant:"semibold",size:"medium",appearance:"title",className:"text-neutral-900 dark:text-neutral-100",children:"PII Anonymization"}),t&&f.jsx(G.IconButton,{id:"pii-results-close-btn",variant:"ghost",onClick:t,tooltip:"Close",noborder:!0,className:"text-neutral-600 dark:text-neutral-300 hover:text-neutral-900 dark:hover:text-neutral-100",children:f.jsx(ee.Close,{sx:{fontSize:20}})})]}),f.jsx("div",{className:"flex-1 overflow-y-auto p-5 space-y-4 bg-white dark:bg-black-800 scrollbar-dark",children:_===0&&!a?f.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[f.jsx(ie,{name:"seal",size:48,strokeWidth:1.5,className:"text-success-500 dark:text-success-400 mb-4"}),f.jsx(G.Typography,{variant:"semibold",size:"small",appearance:"title",className:"mb-1 text-neutral-800 dark:text-neutral-200",children:"No Sensitive Data Found"}),f.jsx(G.Typography,{variant:"regular",size:"extra-small",appearance:"subtitle",className:"max-w-[220px]",children:"Your document doesn't contain any personally identifiable information to anonymize."})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"relative flex items-center gap-3 px-4 py-3 rounded-xl border border-transparent",children:[f.jsx("div",{className:"absolute inset-0 rounded-xl border dark:hidden",style:{background:Gd.light.bg,borderColor:Gd.light.border},"aria-hidden":!0}),f.jsx("div",{className:"absolute inset-0 rounded-xl border hidden dark:block",style:{background:Gd.dark.bg,borderColor:Gd.dark.border},"aria-hidden":!0}),f.jsx("div",{className:"relative z-10 flex items-center gap-3 w-full",children:a?f.jsxs(f.Fragment,{children:[f.jsx(ie,{name:"seal",size:24,strokeWidth:2,className:"text-success-700 dark:text-success-300 shrink-0"}),f.jsxs("div",{children:[f.jsx(G.Typography,{variant:"semibold",size:"small",className:"!text-success-700 dark:!text-success-300",children:"Document Protected"}),f.jsxs(G.Typography,{variant:"regular",size:"extra-small",className:"!text-success-600 dark:!text-success-400",children:[h," entit",h===1?"y has":"ies have"," been anonymized successfully"]})]})]}):f.jsxs(f.Fragment,{children:[f.jsx(ie,{name:"tickmark",size:38,strokeWidth:3,className:"text-success-700 dark:text-success-800 shrink-0"}),f.jsxs("div",{children:[f.jsx(G.Typography,{variant:"semibold",size:"small",className:"!text-success-700 dark:!text-success-300",children:"Scan Complete"}),f.jsxs(G.Typography,{variant:"regular",size:"extra-small",className:"!text-success-600 dark:!text-success-400",children:["Found ",_," sensitive entities across ",p.length," categories"]})]})]})})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx(G.Typography,{variant:"semibold",size:"extra-small",appearance:"title",className:"text-neutral-900 dark:text-neutral-100",children:a?"Anonymization Mapping":"Select items to anonymize"}),a?null:f.jsxs("button",{type:"button",className:"flex items-center gap-1 text-primary-600 dark:text-primary-400 hover:text-primary-700 dark:hover:text-primary-300 focus-visible:outline focus-visible:ring-2 focus-visible:ring-primary-500 dark:focus-visible:ring-primary-400 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-black-800 rounded transition-colors",onClick:T,children:[f.jsx(ee.DoneAll,{sx:{fontSize:16}}),f.jsx("span",{className:"text-xs font-medium text-inherit",children:g.size===_?"Deselect All":"Select All"})]})]}),f.jsx("div",{className:"space-y-4",children:p.map(v=>f.jsx(K9,{category:v,isExpanded:E.has(v.config.id),onToggleExpand:()=>x(v.config.id),selectedIds:g,onToggleEntity:y,isApplied:a},v.config.id))})]})}),f.jsx("div",{className:"border-t border-gray-200 dark:border-black-600 bg-white dark:bg-black-800",children:_===0&&!a?f.jsx("div",{className:"px-4 py-4",children:f.jsx(G.Button,{id:"pii-close-btn-empty",status:"secondary-neutral",appearance:"outline",onClick:()=>{o.piiAnonymization?.onRevertAnonymization?.(),t?.()},className:"w-full py-1.5 border border-neutral-300 dark:border-black-500 bg-white dark:bg-black-700 text-neutral-700 dark:text-neutral-200 hover:bg-neutral-50 dark:hover:bg-black-600",children:"Close"})}):a?f.jsxs("div",{className:"px-4 py-4 space-y-2 flex flex-col gap-1",children:[f.jsx(G.Button,{id:"pii-reveal-originals-btn",status:"secondary-neutral",appearance:"outline",className:"w-full py-1.5 border border-neutral-300 dark:border-black-500 bg-white dark:bg-black-700 text-neutral-700 dark:text-neutral-200 hover:bg-neutral-50 dark:hover:bg-black-600",onClick:()=>{const v=!l;if(i)if(v)Kf(i,!0,void 0);else{const C=jy(i,{revealState:"revealed"});Kf(i,!1,C.size>0?C:void 0)}c(v)},children:f.jsxs("span",{className:"flex items-center justify-center gap-1.5",children:[l?f.jsx(Y9,{size:16}):f.jsx($9,{size:16}),l?"Hide Originals":"Reveal Originals"]})}),f.jsx(G.Button,{id:"pii-revert-anonymization-btn",status:"secondary-neutral",appearance:"outline",onClick:()=>{r?.()},isLoading:o.piiAnonymization?.isRevertingAnonymization,disabled:o.piiAnonymization?.isRevertingAnonymization,className:"w-full py-1.5 border border-neutral-300 dark:border-black-500 bg-white dark:bg-black-700 text-neutral-700 dark:text-neutral-200 hover:bg-neutral-50 dark:hover:bg-black-600",children:f.jsxs("span",{className:"flex items-center justify-center gap-1.5",children:[f.jsx(ie,{name:"undo",size:16,className:"text-neutral-600 dark:text-neutral-300"}),"Revert Anonymization"]})})]}):f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"flex items-center justify-between px-4 pt-3 pb-2",children:f.jsxs(G.Typography,{variant:"medium",size:"extra-small",appearance:"subtitle",className:"text-neutral-600 dark:text-neutral-400",children:[g.size," of ",_," selected"]})}),f.jsx("div",{className:"px-4 pb-4",children:f.jsx(G.Button,{id:"pii-apply-btn",status:"primary",appearance:"outline",onClick:()=>{const v=p.flatMap(w=>w.entities),C=[],O=[];for(const w of v)g.has(w.id)?C.push(w.replacement):O.push(w.replacement);n?.(C,O),s(!0),o.piiAnonymization?.onAnonymizeDocument?.()},className:"w-full py-1.5",children:f.jsxs("span",{className:"flex items-center justify-center gap-1.5",children:[f.jsx(ie,{name:"pii-anonymization",size:16,fillColor:"white"}),"Apply Anonymization"]})})})]})})]})},X9=({onClose:e})=>{const{editor:t,editorConfig:n}=lt(),r=A.useMemo(()=>n.piiAnonymization?.settings?.detectionConfigs??j7,[n.piiAnonymization?.settings?.detectionConfigs]),[i,o]=A.useState("main"),a=A.useRef(!1);A.useEffect(()=>{!n.piiAnonymization?.isRevertingAnonymization&&a.current&&(a.current=!1,t&&(Yy(t),$y(t)),o("main"))},[n.piiAnonymization?.isRevertingAnonymization,t]);const[s,l]=A.useState(()=>{const d=n.piiAnonymization?.settings?.detections;return d!=null&&d.length>0?d.filter(u=>u.enabled).map(u=>u.id):r.map(u=>u.id)}),c=r.filter(d=>s.includes(d.id));return n.piiAnonymization?.isAnalyzed||i==="results"?f.jsx(Q9,{detectionConfigs:c,onClose:e,onSettings:()=>o("settings"),onApply:(d,u)=>{if(!t)return;if(u.length>0){const m=new Set(u);Yy(t,m),$y(t,m)}const p=new Set(d);Kf(t,!1,p)},onRevertAnonymization:()=>{a.current=!0,n.piiAnonymization?.onRevertAnonymization?.()}}):i==="scanning"?f.jsx(o9,{detectionConfigs:c,isScanningDocument:n.piiAnonymization?.isScanningDocument,runDocumentScan:async()=>{const d=t?t.getJSON():{},u=await n.piiAnonymization?.onScanDocument?.(d);if(u?.json_content&&t){const p=kp(u.json_content,u.placeholder_format??"numbered");t.commands.setContent(p)}},onClose:e,onCancel:()=>o("main"),onComplete:()=>o("results")}):i==="settings"?f.jsx(X7,{detectionConfigs:r,onBack:()=>o("main"),onClose:e,onSave:d=>{l(d.length>0?d:r.map(u=>u.id)),o("main")}}):f.jsxs("div",{className:"h-full bg-white dark:bg-black-800",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-black-600",children:[f.jsx(G.Typography,{variant:"semibold",size:"medium",appearance:"title",children:"PII Anonymization"}),e&&f.jsx(G.IconButton,{id:"pii-close-btn",variant:"ghost",onClick:e,tooltip:"Close",noborder:!0,children:f.jsx(ee.Close,{sx:{fontSize:20}})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[f.jsxs(G.Card,{className:"!rounded-xl !border-primary-100 dark:!border-primary-900 !bg-primary-50 dark:!bg-primary-950 !p-5 text-center !shadow-none mb-6",children:[f.jsx("div",{className:"mx-auto mb-3 flex h-12 w-12 items-center justify-center rounded-xl bg-white dark:bg-primary-950 border border-primary-100 dark:!border-primary-900",children:f.jsx(ie,{className:"text-primary-600 dark:text-neutral-100",name:"pii-anonymization",size:26})}),f.jsx(G.Typography,{variant:"semibold",size:"small",appearance:"title",className:"mb-1",children:"Protect Sensitive Information"}),f.jsx(G.Typography,{variant:"regular",size:"extra-small",appearance:"subtitle",className:"leading-relaxed",children:"Automatically detect and anonymize personal data before sharing or processing with AI"})]}),f.jsxs(G.Card,{className:"!rounded-xl !border-neutral-100 dark:!border-neutral-800 !p-4 !shadow-none bg-neutral-50 dark:bg-black-600",children:[f.jsx(G.Typography,{variant:"semibold",size:"extra-small",appearance:"subtitle",className:"uppercase tracking-wider mb-3",children:"What We Detect"}),f.jsx("div",{className:"grid grid-cols-2",children:r.map(d=>f.jsxs("div",{className:"flex items-start gap-2 rounded-lg py-1.5",children:[f.jsx(ie,{name:d.iconName,size:18,className:d.iconColor}),f.jsx(G.Typography,{variant:"medium",size:"small",appearance:"title",className:"!text-neutral-700 dark:!text-black-200",children:d.label})]},d.id))})]})]}),f.jsxs("div",{className:"px-4 flex justify-between items-center gap-2 bg-white dark:bg-black-800",children:[f.jsx(G.Button,{id:"pii-configure-btn",status:"secondary-neutral",appearance:"outline",onClick:()=>o("settings"),className:"flex-1 py-1.5 border border-neutral-300 dark:border-black-500 bg-neutral-50 dark:bg-black-950",children:f.jsxs("span",{className:"flex items-center justify-center gap-1.5 dark:text-neutral-200",children:[f.jsx(ie,{className:"text-neutral-700 dark:text-black-200",name:"settings",size:16}),"Configure Settings"]})}),f.jsx(G.Button,{id:"pii-scan-btn",status:"primary",appearance:"outline",onClick:()=>o("scanning"),className:"flex-1 py-1.5 border border-primary-300 dark:border-primary-200 bg-primary-50 dark:bg-primary-950",children:f.jsxs("span",{className:"flex items-center justify-center gap-1.5 text-primary-600 dark:text-primary-200",children:[f.jsx(ie,{className:"text-primary-600 dark:text-primary-200",name:"document-scanner",size:16}),"Scan Document"]})})]})]})},Z9=".page-a4{width:210mm;min-height:297mm}.page-a4-landscape{width:297mm;min-height:210mm}.page-a3{width:297mm;min-height:420mm}.page-a3-landscape{width:420mm;min-height:297mm}.page-letter{width:8.5in;min-height:11in}.page-letter-landscape{width:11in;min-height:8.5in}.page-legal{width:8.5in;min-height:14in}.page-legal-landscape{width:14in;min-height:8.5in}.page-tabloid{width:11in;min-height:17in}.page-tabloid-landscape{width:17in;min-height:11in}",J9=`.tiptap :first-child{margin-top:0}.tiptap p,.tiptap h1,.tiptap h2,.tiptap h3,.tiptap h4,.tiptap h5,.tiptap h6,.tiptap blockquote{max-width:100%;word-wrap:break-word;overflow-wrap:break-word}.tiptap ul,.tiptap ol{padding:0!important;margin:0 0 0 .35in!important}:is(.tiptap ul,.tiptap ol) li{list-style-position:outside;padding-left:.15in;margin-left:0}:is(.tiptap ul,.tiptap ol) li p{display:inline;margin:0;font-size:var(--list-marker-font-size, inherit)}:is(.tiptap ul,.tiptap ol) li::marker{margin-right:.1in}.tiptap ul[data-type=taskList]{list-style:none;margin:0!important;padding:0}.tiptap ul[data-type=taskList] li{align-items:flex-start;display:flex;margin-left:0}.tiptap ul[data-type=taskList] li>label{flex:0 0 auto;margin-right:.15in;-webkit-user-select:none;-moz-user-select:none;user-select:none;display:flex;align-items:flex-start;font-size:var(--list-marker-font-size, 1rem);color:var(--list-marker-color, currentColor);line-height:1}.tiptap ul[data-type=taskList] li>div{flex:1 1 auto;margin-left:4px!important;font-size:var(--list-marker-font-size, inherit)}.tiptap ul[data-type=taskList] li>div p{font-size:inherit}.tiptap ul[data-type=taskList] input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;appearance:none;font-size:inherit;color:var(--list-marker-color, currentColor);cursor:pointer;width:.8em;height:.8em;min-width:.8em;min-height:.8em;border:1.5px solid currentColor;background-color:#fff;border-radius:2px;position:relative;margin:.35em 0 0;background-repeat:no-repeat;background-position:center;background-size:.65em .65em}.tiptap ul[data-type=taskList] li[data-checked=true]>label input[type=checkbox]{border-color:currentColor;background-color:#fff;background-image:none}.tiptap ul[data-type=taskList] li[data-checked=true]>label input[type=checkbox]:after{content:"";position:absolute;inset:.08em;background-color:currentColor;-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M3 8l3 3l7-7'/%3E%3C/svg%3E");-webkit-mask-repeat:no-repeat;-webkit-mask-position:center;-webkit-mask-size:contain;mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M3 8l3 3l7-7'/%3E%3C/svg%3E");mask-repeat:no-repeat;mask-position:center;mask-size:contain;pointer-events:none}.tiptap ul[data-type=taskList] ul[data-type=taskList]{margin:0}.tiptap ul:not([data-type=taskList]) li::marker{content:"● "}.tiptap ul:not([data-type=taskList]) ul li::marker{content:"○ "}.tiptap ul:not([data-type=taskList]) ul ul li::marker{content:"■ "}.tiptap ul:not([data-type=taskList]) ul ul ul li::marker{content:"● "}.tiptap ul:not([data-type=taskList]) ul ul ul ul li::marker{content:"○ "}.tiptap ul:not([data-type=taskList]) ul ul ul ul ul li::marker{content:"■ "}.tiptap ul:not([data-type=taskList]) ul ul ul ul ul ul li::marker{content:"● "}.tiptap ul:not([data-type=taskList]) ul ul ul ul ul ul ul li::marker{content:"○ "}.tiptap ul:not([data-type=taskList]) ul ul ul ul ul ul ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=default]:not([data-type=taskList]) li::marker{content:"● "}.tiptap ul[data-list-type=default]:not([data-type=taskList]) ul li::marker{content:"○ "}.tiptap ul[data-list-type=default]:not([data-type=taskList]) ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=default]:not([data-type=taskList]) ul ul ul li::marker{content:"● "}.tiptap ul[data-list-type=default]:not([data-type=taskList]) ul ul ul ul li::marker{content:"○ "}.tiptap ul[data-list-type=default]:not([data-type=taskList]) ul ul ul ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=default]:not([data-type=taskList]) ul ul ul ul ul ul li::marker{content:"● "}.tiptap ul[data-list-type=default]:not([data-type=taskList]) ul ul ul ul ul ul ul li::marker{content:"○ "}.tiptap ul[data-list-type=default]:not([data-type=taskList]) ul ul ul ul ul ul ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=diamondArrow]:not([data-type=taskList]) li::marker{content:"❖ "}.tiptap ul[data-list-type=diamondArrow]:not([data-type=taskList]) ul li::marker{content:"➤ "}.tiptap ul[data-list-type=diamondArrow]:not([data-type=taskList]) ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=diamondArrow]:not([data-type=taskList]) ul ul ul li::marker{content:"❖ "}.tiptap ul[data-list-type=diamondArrow]:not([data-type=taskList]) ul ul ul ul li::marker{content:"➤ "}.tiptap ul[data-list-type=diamondArrow]:not([data-type=taskList]) ul ul ul ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=diamondArrow]:not([data-type=taskList]) ul ul ul ul ul ul li::marker{content:"❖ "}.tiptap ul[data-list-type=diamondArrow]:not([data-type=taskList]) ul ul ul ul ul ul ul li::marker{content:"➤ "}.tiptap ul[data-list-type=diamondArrow]:not([data-type=taskList]) ul ul ul ul ul ul ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=square]:not([data-type=taskList]) li::marker{content:"☐ "}.tiptap ul[data-list-type=square]:not([data-type=taskList]) ul li::marker{content:"☐ "}.tiptap ul[data-list-type=square]:not([data-type=taskList]) ul ul li::marker{content:"☐ "}.tiptap ul[data-list-type=square]:not([data-type=taskList]) ul ul ul li::marker{content:"☐ "}.tiptap ul[data-list-type=square]:not([data-type=taskList]) ul ul ul ul li::marker{content:"☐ "}.tiptap ul[data-list-type=square]:not([data-type=taskList]) ul ul ul ul ul li::marker{content:"☐ "}.tiptap ul[data-list-type=square]:not([data-type=taskList]) ul ul ul ul ul ul li::marker{content:"☐ "}.tiptap ul[data-list-type=square]:not([data-type=taskList]) ul ul ul ul ul ul ul li::marker{content:"☐ "}.tiptap ul[data-list-type=square]:not([data-type=taskList]) ul ul ul ul ul ul ul ul li::marker{content:"☐ "}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) li::marker{content:"➔ "}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) ul li::marker{content:"◆ "}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) ul ul li::marker{content:"● "}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) ul ul ul li::marker{content:"➔ "}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) ul ul ul ul li::marker{content:"◆ "}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) ul ul ul ul ul li::marker{content:"● "}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) ul ul ul ul ul ul li::marker{content:"➔ "}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) ul ul ul ul ul ul ul li::marker{content:"◆ "}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) ul ul ul ul ul ul ul ul li::marker{content:"● "}.tiptap ul[data-list-type=star]:not([data-type=taskList]) li::marker{content:"★ "}.tiptap ul[data-list-type=star]:not([data-type=taskList]) ul li::marker{content:"○ "}.tiptap ul[data-list-type=star]:not([data-type=taskList]) ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=star]:not([data-type=taskList]) ul ul ul li::marker{content:"★ "}.tiptap ul[data-list-type=star]:not([data-type=taskList]) ul ul ul ul li::marker{content:"○ "}.tiptap ul[data-list-type=star]:not([data-type=taskList]) ul ul ul ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=star]:not([data-type=taskList]) ul ul ul ul ul ul li::marker{content:"★ "}.tiptap ul[data-list-type=star]:not([data-type=taskList]) ul ul ul ul ul ul ul li::marker{content:"○ "}.tiptap ul[data-list-type=star]:not([data-type=taskList]) ul ul ul ul ul ul ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) li::marker{content:"➤ "}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) ul li::marker{content:"○ "}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) ul ul ul li::marker{content:"➤ "}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) ul ul ul ul li::marker{content:"○ "}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) ul ul ul ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) ul ul ul ul ul ul li::marker{content:"➤ "}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) ul ul ul ul ul ul ul li::marker{content:"○ "}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) ul ul ul ul ul ul ul ul li::marker{content:"■ "}.tiptap ol{list-style-type:decimal}.tiptap ol ol{list-style-type:lower-alpha}.tiptap ol ol ol{list-style-type:lower-roman}.tiptap ol ol ol ol{list-style-type:decimal}.tiptap ol ol ol ol ol{list-style-type:lower-alpha}.tiptap ol ol ol ol ol ol{list-style-type:lower-roman}.tiptap ol ol ol ol ol ol ol{list-style-type:decimal}.tiptap ol ol ol ol ol ol ol ol{list-style-type:lower-alpha}.tiptap ol ol ol ol ol ol ol ol ol{list-style-type:lower-roman}.tiptap ol[data-list-type=decimal-parenthesis]{list-style-type:decimal}.tiptap ol[data-list-type=decimal-parenthesis] li::marker{content:counter(list-item) ") "}.tiptap ol[data-list-type=decimal-parenthesis] ol{list-style-type:lower-alpha}.tiptap ol[data-list-type=decimal-parenthesis] ol li::marker{content:counter(list-item,lower-alpha) ") "}.tiptap ol[data-list-type=decimal-parenthesis] ol ol{list-style-type:lower-roman}.tiptap ol[data-list-type=decimal-parenthesis] ol ol li::marker{content:counter(list-item,lower-roman) ") "}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol{list-style-type:decimal}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol li::marker{content:counter(list-item) ") "}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol ol{list-style-type:lower-alpha}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol ol li::marker{content:counter(list-item,lower-alpha) ") "}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol ol ol{list-style-type:lower-roman}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol ol ol li::marker{content:counter(list-item,lower-roman) ") "}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol ol ol ol{list-style-type:decimal}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol ol ol ol li::marker{content:counter(list-item) ") "}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol ol ol ol ol{list-style-type:lower-alpha}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol ol ol ol ol li::marker{content:counter(list-item,lower-alpha) ") "}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol ol ol ol ol ol{list-style-type:lower-roman}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol ol ol ol ol ol li::marker{content:counter(list-item,lower-roman) ") "}.tiptap ol[data-list-type=decimal-nested]{counter-reset:level1}.tiptap ol[data-list-type=decimal-nested]>li{counter-increment:level1}.tiptap ol[data-list-type=decimal-nested]>li::marker{content:counter(level1) ". "}.tiptap ol[data-list-type=decimal-nested] ol{counter-reset:level2}.tiptap ol[data-list-type=decimal-nested] ol>li{counter-increment:level2}.tiptap ol[data-list-type=decimal-nested] ol>li::marker{content:counter(level1) "." counter(level2) " "}.tiptap ol[data-list-type=decimal-nested] ol ol{counter-reset:level3}.tiptap ol[data-list-type=decimal-nested] ol ol>li{counter-increment:level3}.tiptap ol[data-list-type=decimal-nested] ol ol>li::marker{content:counter(level1) "." counter(level2) "." counter(level3) " "}.tiptap ol[data-list-type=decimal-nested] ol ol ol{counter-reset:level4}.tiptap ol[data-list-type=decimal-nested] ol ol ol>li{counter-increment:level4}.tiptap ol[data-list-type=decimal-nested] ol ol ol>li::marker{content:counter(level1) "." counter(level2) "." counter(level3) "." counter(level4) " "}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol{counter-reset:level5}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol>li{counter-increment:level5}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol>li::marker{content:counter(level1) "." counter(level2) "." counter(level3) "." counter(level4) "." counter(level5) " "}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol{counter-reset:level6}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol>li{counter-increment:level6}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol>li::marker{content:counter(level1) "." counter(level2) "." counter(level3) "." counter(level4) "." counter(level5) "." counter(level6) " "}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol ol{counter-reset:level7}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol ol>li{counter-increment:level7}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol ol>li::marker{content:counter(level1) "." counter(level2) "." counter(level3) "." counter(level4) "." counter(level5) "." counter(level6) "." counter(level7) " "}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol ol ol{counter-reset:level8}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol ol ol>li{counter-increment:level8}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol ol ol>li::marker{content:counter(level1) "." counter(level2) "." counter(level3) "." counter(level4) "." counter(level5) "." counter(level6) "." counter(level7) "." counter(level8) " "}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol ol ol ol{counter-reset:level9}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol ol ol ol>li{counter-increment:level9}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol ol ol ol>li::marker{content:counter(level1) "." counter(level2) "." counter(level3) "." counter(level4) "." counter(level5) "." counter(level6) "." counter(level7) "." counter(level8) "." counter(level9) " "}.tiptap ol[data-list-type=upper-alpha-mixed]{list-style-type:upper-alpha}.tiptap ol[data-list-type=upper-alpha-mixed] ol{list-style-type:lower-alpha}.tiptap ol[data-list-type=upper-alpha-mixed] ol ol{list-style-type:lower-roman}.tiptap ol[data-list-type=upper-alpha-mixed] ol ol ol{list-style-type:upper-alpha}.tiptap ol[data-list-type=upper-alpha-mixed] ol ol ol ol{list-style-type:lower-alpha}.tiptap ol[data-list-type=upper-alpha-mixed] ol ol ol ol ol{list-style-type:lower-roman}.tiptap ol[data-list-type=upper-alpha-mixed] ol ol ol ol ol ol{list-style-type:upper-alpha}.tiptap ol[data-list-type=upper-alpha-mixed] ol ol ol ol ol ol ol{list-style-type:lower-alpha}.tiptap ol[data-list-type=upper-alpha-mixed] ol ol ol ol ol ol ol ol{list-style-type:lower-roman}.tiptap ol[data-list-type=upper-roman-mixed]{list-style-type:upper-roman}.tiptap ol[data-list-type=upper-roman-mixed] ol{list-style-type:upper-alpha}.tiptap ol[data-list-type=upper-roman-mixed] ol ol{list-style-type:decimal}.tiptap ol[data-list-type=upper-roman-mixed] ol ol ol{list-style-type:upper-roman}.tiptap ol[data-list-type=upper-roman-mixed] ol ol ol ol{list-style-type:upper-alpha}.tiptap ol[data-list-type=upper-roman-mixed] ol ol ol ol ol{list-style-type:decimal}.tiptap ol[data-list-type=upper-roman-mixed] ol ol ol ol ol ol{list-style-type:upper-roman}.tiptap ol[data-list-type=upper-roman-mixed] ol ol ol ol ol ol ol{list-style-type:upper-alpha}.tiptap ol[data-list-type=upper-roman-mixed] ol ol ol ol ol ol ol ol{list-style-type:decimal}.tiptap ol[data-list-type=decimal-leading-zero-mixed]{list-style-type:decimal-leading-zero}.tiptap ol[data-list-type=decimal-leading-zero-mixed] ol{list-style-type:lower-alpha}.tiptap ol[data-list-type=decimal-leading-zero-mixed] ol ol{list-style-type:lower-roman}.tiptap ol[data-list-type=decimal-leading-zero-mixed] ol ol ol{list-style-type:decimal-leading-zero}.tiptap ol[data-list-type=decimal-leading-zero-mixed] ol ol ol ol{list-style-type:lower-alpha}.tiptap ol[data-list-type=decimal-leading-zero-mixed] ol ol ol ol ol{list-style-type:lower-roman}.tiptap ol[data-list-type=decimal-leading-zero-mixed] ol ol ol ol ol ol{list-style-type:decimal-leading-zero}.tiptap ol[data-list-type=decimal-leading-zero-mixed] ol ol ol ol ol ol ol{list-style-type:lower-alpha}.tiptap ol[data-list-type=decimal-leading-zero-mixed] ol ol ol ol ol ol ol ol{list-style-type:lower-roman}.tiptap li::marker{color:var(--list-marker-color, currentColor);font-size:calc(var(--list-marker-font-size, 1em) * .9)}.tiptap ul[data-list-type=default]:not([data-type=taskList]) li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=default]:not([data-type=taskList]) ul li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .99)}.tiptap ul[data-list-type=default]:not([data-type=taskList]) ul ul li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=diamondArrow]:not([data-type=taskList]) li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=diamondArrow]:not([data-type=taskList]) ul li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) ul li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) ul ul li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=star]:not([data-type=taskList]) li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=star]:not([data-type=taskList]) ul li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=star]:not([data-type=taskList]) ul ul li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) ul li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) ul ul li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}@media print{.tiptap ul[data-type=taskList]{list-style:none;margin-left:0!important;padding:0!important}.tiptap ul[data-type=taskList] li{align-items:flex-start;display:flex;position:relative;padding-left:0!important;margin-bottom:.25rem}.tiptap ul[data-type=taskList] label{position:relative;margin-right:.5rem;flex:0 0 auto;display:flex;align-items:flex-start}.tiptap ul[data-type=taskList] label input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:1em;height:1em;min-width:1em;min-height:1em;border:1.5px solid #000!important;background-color:#fff!important;border-radius:2px;position:relative;margin:.2em 0 0;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}.tiptap ul[data-type=taskList] li[data-checked=true] label input[type=checkbox]{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='4' stroke-linecap='round' stroke-linejoin='round' d='M3 8l3 3l7-7'/%3E%3C/svg%3E")!important;background-repeat:no-repeat!important;background-position:center!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;background-color:initial}}`,ez=".tiptap blockquote{border-left:3px solid #0f172a;padding-left:1em;padding-top:2px;padding-bottom:2px;margin-left:0;margin-right:0;background-color:#f8fafc;font-style:italic}.tiptap blockquote>p{margin:4px}.tiptap blockquote>*{background-color:inherit!important}.dark .tiptap blockquote{border-left-color:#e2e8f0;background-color:#1f2937}",tz=".tiptap h1,.tiptap h2,.tiptap h3,.tiptap h4,.tiptap h5,.tiptap h6{font-weight:700}.tiptap h1{font-size:32px;line-height:41px}.tiptap h2{font-size:27px;line-height:35px}.tiptap h3{font-size:21px;line-height:28px}.tiptap h4{font-size:18px;line-height:24px}.tiptap h5{font-size:16px;line-height:21px}.tiptap h6{font-size:15px;line-height:17px}",nz='.tiptap table{border-collapse:collapse;table-layout:fixed;width:100%;max-width:100%;overflow:hidden;page-break-inside:auto;margin:0 auto}.tiptap table tr{page-break-inside:avoid;page-break-after:auto}.tiptap table td,.tiptap table th{min-width:1em;border:1px solid #626262!important}.tiptap table td>*,.tiptap table th>*{margin-bottom:0}.tiptap table td p,.tiptap table th p{padding:4px}.tiptap table td[align=left-top],.tiptap table th[align=left-top]{vertical-align:top;text-align:left}.tiptap table td[align=center-top],.tiptap table th[align=center-top]{vertical-align:top;text-align:center}.tiptap table td[align=right-top],.tiptap table th[align=right-top]{vertical-align:middle;text-align:right}.tiptap table td[align=justify-top],.tiptap table th[align=justify-top]{vertical-align:middle;text-align:justify}.tiptap table td[align=left-middle],.tiptap table th[align=left-middle]{vertical-align:middle;text-align:left}.tiptap table td[align=center-middle],.tiptap table th[align=center-middle]{vertical-align:middle;text-align:center}.tiptap table td[align=right-middle],.tiptap table th[align=right-middle]{vertical-align:middle;text-align:right}.tiptap table td[align=justify-middle],.tiptap table th[align=justify-middle]{vertical-align:middle;text-align:justify}.tiptap table td[align=left-bottom],.tiptap table th[align=left-bottom]{vertical-align:bottom;text-align:left}.tiptap table td[align=center-bottom],.tiptap table th[align=center-bottom]{vertical-align:middle;text-align:center}.tiptap table td[align=right-bottom],.tiptap table th[align=right-bottom]{vertical-align:bottom;text-align:right}.tiptap table td[align=justify-bottom],.tiptap table th[align=justify-bottom]{vertical-align:bottom;text-align:justify}.tiptap table th{font-weight:700;text-align:left;background-color:#e1e1e1}.tiptap table .selectedCell:after{z-index:2;position:absolute;content:"";inset:0;background:#56a2ff5e;pointer-events:none;width:100%;height:100%}.tiptap table td,.tiptap table th{position:relative}.tiptap table td:after,.tiptap table th:after{content:"";position:absolute;right:-2px;top:0;bottom:0;width:4px;cursor:col-resize;z-index:1}.tiptap table p{margin:0}@media print{.tiptap table{border-collapse:collapse!important;border:1px solid #626262!important}}@media print{.tiptap table th{background-color:#e1e1e1!important;font-weight:700!important}}@media print{.tiptap table td,.tiptap table th{border:1px solid #626262!important}}',rz=".tiptap a{color:#0077e3;text-decoration:underline}.dark .tiptap a{color:#60a5fa}",iz=`hr.hr--single-line{border:none;border-top:2px solid #000000;margin:1rem 0}hr.hr--thick-single-line{border:none;border-top:4px solid #000000;margin:1rem 0}hr.hr--double-line{border:none;border-top:5px double #000000;margin:1rem 0}hr.hr--dotted-line{border:none;border-top:2px dotted #000000;margin:1rem 0}hr.hr--dashed-line{border:none;border-top:2px dashed #000000;margin:1rem 0}hr.hr--double-dashed-line{border:none;border-top:2px dashed #000000;border-bottom:2px dashed #000000;height:4px;margin:1rem 0}hr.hr--thick-and-thick-line-top{border:none;border-top:4px solid #000000;border-bottom:1px solid #000000;height:4px;margin:1rem 0}hr.hr--thick-and-thick-line-bottom{border:none;border-top:1px solid #000000;border-bottom:4px solid #000000;height:4px;margin:1rem 0}hr.hr--wavy-line{border:none;height:12px;margin:1rem 0;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 12' preserveAspectRatio='none'%3E%3Cpath d='M0,6 Q5,0 10,6 T20,6 T30,6 T40,6 T50,6 T60,6 T70,6 T80,6 T90,6 T100,6 T110,6 T120,6 T130,6 T140,6 T150,6 T160,6 T170,6 T180,6 T190,6 T200,6 T210,6 T220,6 T230,6 T240,6 T250,6 T260,6 T270,6 T280,6 T290,6 T300,6 T310,6 T320,6 T330,6 T340,6 T350,6 T360,6 T370,6 T380,6 T390,6 T400,6 T410,6 T420,6 T430,6 T440,6 T450,6 T460,6 T470,6 T480,6 T490,6 T500,6 T510,6 T520,6 T530,6 T540,6 T550,6 T560,6 T570,6 T580,6 T590,6 T600,6 T610,6 T620,6 T630,6 T640,6 T650,6 T660,6 T670,6 T680,6 T690,6 T700,6 T710,6 T720,6 T730,6 T740,6 T750,6 T760,6 T770,6 T780,6 T790,6 T800,6 T810,6 T820,6 T830,6 T840,6 T850,6 T860,6 T870,6 T880,6 T890,6 T900,6 T910,6 T920,6 T930,6 T940,6 T950,6 T960,6 T970,6 T980,6 T990,6 T1000,6 T1010,6 T1020,6 T1030,6 T1040,6 T1050,6 T1060,6 T1070,6 T1080,6 T1090,6 T1100,6 T1110,6 T1120,6 T1130,6 T1140,6 T1150,6 T1160,6 T1170,6 T1180,6 T1190,6 T1200,6' stroke='%23000000' stroke-width='3' fill='none'/%3E%3C/svg%3E");background-repeat:repeat-x;background-size:100% 8px;background-position:center}.dark .divider-preview hr.hr--single-line,.dark .divider-preview hr.hr--thick-single-line,.dark .divider-preview hr.hr--double-line,.dark .divider-preview hr.hr--dotted-line,.dark .divider-preview hr.hr--dashed-line{border-top-color:#d9d9d9}.dark .divider-preview hr.hr--double-dashed-line,.dark .divider-preview hr.hr--thick-and-thick-line-top,.dark .divider-preview hr.hr--thick-and-thick-line-bottom{border-top-color:#d9d9d9;border-bottom-color:#d9d9d9}.dark .divider-preview hr.hr--wavy-line{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 12' preserveAspectRatio='none'%3E%3Cpath d='M0,6 Q5,0 10,6 T20,6 T30,6 T40,6 T50,6 T60,6 T70,6 T80,6 T90,6 T100,6 T110,6 T120,6 T130,6 T140,6 T150,6 T160,6 T170,6 T180,6 T190,6 T200,6 T210,6 T220,6 T230,6 T240,6 T250,6 T260,6 T270,6 T280,6 T290,6 T300,6 T310,6 T320,6 T330,6 T340,6 T350,6 T360,6 T370,6 T380,6 T390,6 T400,6 T410,6 T420,6 T430,6 T440,6 T450,6 T460,6 T470,6 T480,6 T490,6 T500,6 T510,6 T520,6 T530,6 T540,6 T550,6 T560,6 T570,6 T580,6 T590,6 T600,6 T610,6 T620,6 T630,6 T640,6 T650,6 T660,6 T670,6 T680,6 T690,6 T700,6 T710,6 T720,6 T730,6 T740,6 T750,6 T760,6 T770,6 T780,6 T790,6 T800,6 T810,6 T820,6 T830,6 T840,6 T850,6 T860,6 T870,6 T880,6 T890,6 T900,6 T910,6 T920,6 T930,6 T940,6 T950,6 T960,6 T970,6 T980,6 T990,6 T1000,6 T1010,6 T1020,6 T1030,6 T1040,6 T1050,6 T1060,6 T1070,6 T1080,6 T1090,6 T1100,6 T1110,6 T1120,6 T1130,6 T1140,6 T1150,6 T1160,6 T1170,6 T1180,6 T1190,6 T1200,6' stroke='%23d9d9d9' stroke-width='3' fill='none'/%3E%3C/svg%3E")}.tiptap div[data-style-type]{display:flow-root;width:100%}.tiptap div.hr--in-selection{background-color:Highlight}.tiptap .hr--single-line>hr{border:none;border-top:2px solid #000000;margin:1rem 0}.tiptap .hr--thick-single-line>hr{border:none;border-top:4px solid #000000;margin:1rem 0}.tiptap .hr--double-line>hr{border:none;border-top:5px double #000000;margin:1rem 0}.tiptap .hr--dotted-line>hr{border:none;border-top:2px dotted #000000;margin:1rem 0}.tiptap .hr--dashed-line>hr{border:none;border-top:2px dashed #000000;margin:1rem 0}.tiptap .hr--double-dashed-line>hr{border:none;border-top:2px dashed #000000;border-bottom:2px dashed #000000;height:4px;margin:1rem 0}.tiptap .hr--thick-and-thick-line-top>hr{border:none;border-top:4px solid #000000;border-bottom:1px solid #000000;height:4px;margin:1rem 0}.tiptap .hr--thick-and-thick-line-bottom>hr{border:none;border-top:1px solid #000000;border-bottom:4px solid #000000;height:4px;margin:1rem 0}.tiptap .hr--wavy-line>hr{border:none;height:12px;margin:1rem 0;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 12' preserveAspectRatio='none'%3E%3Cpath d='M0,6 Q5,0 10,6 T20,6 T30,6 T40,6 T50,6 T60,6 T70,6 T80,6 T90,6 T100,6 T110,6 T120,6 T130,6 T140,6 T150,6 T160,6 T170,6 T180,6 T190,6 T200,6 T210,6 T220,6 T230,6 T240,6 T250,6 T260,6 T270,6 T280,6 T290,6 T300,6 T310,6 T320,6 T330,6 T340,6 T350,6 T360,6 T370,6 T380,6 T390,6 T400,6 T410,6 T420,6 T430,6 T440,6 T450,6 T460,6 T470,6 T480,6 T490,6 T500,6 T510,6 T520,6 T530,6 T540,6 T550,6 T560,6 T570,6 T580,6 T590,6 T600,6 T610,6 T620,6 T630,6 T640,6 T650,6 T660,6 T670,6 T680,6 T690,6 T700,6 T710,6 T720,6 T730,6 T740,6 T750,6 T760,6 T770,6 T780,6 T790,6 T800,6 T810,6 T820,6 T830,6 T840,6 T850,6 T860,6 T870,6 T880,6 T890,6 T900,6 T910,6 T920,6 T930,6 T940,6 T950,6 T960,6 T970,6 T980,6 T990,6 T1000,6 T1010,6 T1020,6 T1030,6 T1040,6 T1050,6 T1060,6 T1070,6 T1080,6 T1090,6 T1100,6 T1110,6 T1120,6 T1130,6 T1140,6 T1150,6 T1160,6 T1170,6 T1180,6 T1190,6 T1200,6' stroke='%23000000' stroke-width='3' fill='none'/%3E%3C/svg%3E");background-repeat:repeat-x;background-size:100% 8px;background-position:center}`,oz=".tiptap .code-block-wrapper{margin:1rem 0;border-radius:8px;overflow:hidden;position:relative}.tiptap .code-block-wrapper:has(.theme-dark){border:1px solid #333;background:#1e1e1e}.tiptap .code-block-wrapper:has(.theme-light){border:1px solid #e0e0e0;background:#f5f5f5}.tiptap .code-block-wrapper .code-block-toolbar{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.tiptap .code-block-wrapper .code-block-toolbar-left{display:flex;gap:8px;align-items:center}.tiptap .code-block-wrapper .code-block-toolbar-actions{display:flex;gap:4px;align-items:center}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark{background:#2d2d2d;border-bottom:1px solid #3d3d3d}.tiptap .code-block-wrapper .code-block-toolbar.theme-light{background:#f5f5f5;border-bottom:1px solid #e0e0e0}.tiptap .code-block-wrapper .code-block-action-btn{display:flex;align-items:center;justify-content:center;padding:4px 8px;background:transparent;border-radius:4px;cursor:pointer;transition:all .2s}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .code-block-action-btn{border:1px solid #555;color:#e0e0e0}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .code-block-action-btn:hover{background:#3d3d3d;border-color:#777}.tiptap .code-block-wrapper .code-block-toolbar.theme-light .code-block-action-btn{border:1px solid #d0d0d0;color:#333}.tiptap .code-block-wrapper .code-block-toolbar.theme-light .code-block-action-btn:hover{background:#e8e8e8;border-color:#999}.tiptap .code-block-wrapper .code-block-delete-btn:hover{color:#d32f2f;border-color:#d32f2f}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .ant-select-selector{background:#1e1e1e!important;border:1px solid #555!important;color:#e0e0e0!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .ant-select-arrow,.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .ant-select-selection-item{color:#e0e0e0!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-light .ant-select-selector{background:#fff!important;border:1px solid #d0d0d0!important;color:#333!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-light .ant-select-arrow,.tiptap .code-block-wrapper .code-block-toolbar.theme-light .ant-select-selection-item{color:#333!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .editor-select-dropdown{background:#3a3a3a!important;border:1px solid #3d3d3d!important;z-index:9999!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .editor-select-item-option-content{color:#e0e0e0!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .editor-select-item-option-selected{color:#d9ff00!important;background:#3a3a3a!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .editor-select-item-option-active{color:#d9ff00!important;background:#4b4b4b!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .editor-select-selector{color:#e0e0e0!important;background:#4b4b4b!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .editor-select-arrow{color:#e0e0e0!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .ant-select-dropdown .ant-select-item{color:#e0e0e0!important;background:transparent!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .ant-select-dropdown .ant-select-item:hover{background:#2d2d2d!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .ant-select-dropdown .ant-select-item-option-selecte{background:#2d2d2d!important;color:#1890ff!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-light .ant-select-dropdown{background:#fff!important;border:1px solid #e0e0e0!important;z-index:9999!important}.tiptap body:has(.code-block-wrapper .code-block-toolbar.theme-light) .ant-select-dropdown .ant-select-item{color:#333!important;background:transparent!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-light .ant-select-dropdown .ant-select-item:hover{background:#f5f5f5!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-light .ant-select-dropdown .ant-select-item-option-selected{background:#e6f7ff!important;color:#1890ff!important}.tiptap .code-block-wrapper .code-block-content{margin:0;padding:16px;overflow-x:auto;font-family:Consolas,Monaco,Courier New,monospace;font-size:14px;line-height:1.6;position:relative}.tiptap .code-block-wrapper .code-block-content code{display:block;background:transparent;padding:0;color:inherit;font-family:inherit;white-space:pre}.tiptap .code-block-wrapper .code-block-content code.syntax-layer *{display:inline!important;visibility:visible!important;opacity:1!important}.tiptap .code-block-wrapper .code-block-content.theme-dark code.syntax-layer *:not([class]){color:#d4d4d4!important}.tiptap .code-block-wrapper .code-block-content.theme-light code.syntax-layer *:not([class]){color:#000!important}.tiptap .code-block-wrapper .code-block-content code.editable-layer,.tiptap .code-block-wrapper .code-block-content code.editable-layer *{color:transparent!important}.tiptap .code-block-wrapper .code-block-content.wrapped{overflow-x:hidden}.tiptap .code-block-wrapper .code-block-content.wrapped code{white-space:pre-wrap;word-break:break-word}.tiptap .code-block-wrapper .code-block-content.theme-dark{background:#1e1e1e;color:#d4d4d4}.tiptap .code-block-wrapper .theme-dark .hljs-comment,.tiptap .code-block-wrapper .theme-dark .hljs-quote{color:#6a9955;font-style:italic}.tiptap .code-block-wrapper .theme-dark .hljs-keyword,.tiptap .code-block-wrapper .theme-dark .hljs-selector-tag,.tiptap .code-block-wrapper .theme-dark .hljs-literal,.tiptap .code-block-wrapper .theme-dark .hljs-type{color:#569cd6}.tiptap .code-block-wrapper .theme-dark .hljs-string,.tiptap .code-block-wrapper .theme-dark .hljs-title,.tiptap .code-block-wrapper .theme-dark .hljs-name{color:#ce9178}.tiptap .code-block-wrapper .theme-dark .hljs-number,.tiptap .code-block-wrapper .theme-dark .hljs-symbol,.tiptap .code-block-wrapper .theme-dark .hljs-bullet{color:#b5cea8}.tiptap .code-block-wrapper .theme-dark .hljs-function,.tiptap .code-block-wrapper .theme-dark .hljs-params{color:#dcdcaa}.tiptap .code-block-wrapper .theme-dark .hljs-attr,.tiptap .code-block-wrapper .theme-dark .hljs-variable,.tiptap .code-block-wrapper .theme-dark .hljs-property{color:#9cdcfe}.tiptap .code-block-wrapper .theme-dark .hljs-built_in,.tiptap .code-block-wrapper .theme-dark .hljs-class{color:#4ec9b0}.tiptap .code-block-wrapper .theme-dark .hljs-tag{color:gray}.tiptap .code-block-wrapper .theme-dark .hljs-meta{color:#d7ba7d}.tiptap .code-block-wrapper .code-block-content.theme-light{background:#fff;color:#000}.tiptap .code-block-wrapper .theme-light .hljs-comment,.tiptap .code-block-wrapper .theme-light .hljs-quote{color:green;font-style:italic}.tiptap .code-block-wrapper .theme-light .hljs-keyword,.tiptap .code-block-wrapper .theme-light .hljs-selector-tag,.tiptap .code-block-wrapper .theme-light .hljs-literal,.tiptap .code-block-wrapper .theme-light .hljs-type{color:#00f}.tiptap .code-block-wrapper .theme-light .hljs-string,.tiptap .code-block-wrapper .theme-light .hljs-title,.tiptap .code-block-wrapper .theme-light .hljs-name{color:#a31515}.tiptap .code-block-wrapper .theme-light .hljs-number,.tiptap .code-block-wrapper .theme-light .hljs-symbol,.tiptap .code-block-wrapper .theme-light .hljs-bullet{color:#098658}.tiptap .code-block-wrapper .theme-light .hljs-function,.tiptap .code-block-wrapper .theme-light .hljs-params{color:#795e26}.tiptap .code-block-wrapper .theme-light .hljs-attr,.tiptap .code-block-wrapper .theme-light .hljs-variable,.tiptap .code-block-wrapper .theme-light .hljs-property{color:#001080}.tiptap .code-block-wrapper .theme-light .hljs-built_in,.tiptap .code-block-wrapper .theme-light .hljs-class{color:#267f99}.tiptap .code-block-wrapper .code-block-content .hljs{display:block;overflow-x:auto}.tiptap .code-block-wrapper .code-block-content ::-moz-selection{background:#80cbc44d}.tiptap .code-block-wrapper .code-block-content ::selection{background:#80cbc44d}.tiptap .code-block-wrapper .code-block-content::-webkit-scrollbar{height:8px}.tiptap .code-block-wrapper .code-block-content::-webkit-scrollbar-track{background:#0003}.tiptap .code-block-wrapper .code-block-content::-webkit-scrollbar-thumb{background:#ffffff4d;border-radius:4px}.tiptap .code-block-wrapper .code-block-content::-webkit-scrollbar-thumb:hover{background:#ffffff80}@media print{.tiptap .code-block-wrapper{page-break-inside:avoid;border-radius:4px;overflow:visible;margin:1rem 0}.tiptap .code-block-wrapper .code-block-toolbar{display:none!important}.tiptap .code-block-wrapper:has(.theme-dark){border:1px solid #333!important;background:#1e1e1e!important}.tiptap .code-block-wrapper:has(.theme-light){border:1px solid #e0e0e0!important;background:#f5f5f5!important}.tiptap .code-block-wrapper .code-block-content{overflow-x:visible;overflow-y:visible;padding:16px;page-break-inside:avoid}.tiptap .code-block-wrapper .code-block-content code{white-space:pre-wrap!important;word-break:break-word}.tiptap .code-block-wrapper .code-block-content.theme-dark{background:#1e1e1e!important;color:#d4d4d4!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-dark .hljs-comment,.tiptap .code-block-wrapper .theme-dark .hljs-quote{color:#6a9955!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-dark .hljs-keyword,.tiptap .code-block-wrapper .theme-dark .hljs-selector-tag,.tiptap .code-block-wrapper .theme-dark .hljs-literal,.tiptap .code-block-wrapper .theme-dark .hljs-type{color:#569cd6!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-dark .hljs-string,.tiptap .code-block-wrapper .theme-dark .hljs-title,.tiptap .code-block-wrapper .theme-dark .hljs-name{color:#ce9178!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-dark .hljs-number,.tiptap .code-block-wrapper .theme-dark .hljs-symbol,.tiptap .code-block-wrapper .theme-dark .hljs-bullet{color:#b5cea8!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-dark .hljs-function,.tiptap .code-block-wrapper .theme-dark .hljs-params{color:#dcdcaa!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-dark .hljs-attr,.tiptap .code-block-wrapper .theme-dark .hljs-variable,.tiptap .code-block-wrapper .theme-dark .hljs-property{color:#9cdcfe!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-dark .hljs-built_in,.tiptap .code-block-wrapper .theme-dark .hljs-class{color:#4ec9b0!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .code-block-content.theme-light{background:#fff!important;color:#000!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-light .hljs-comment,.tiptap .code-block-wrapper .theme-light .hljs-quote{color:green!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-light .hljs-keyword,.tiptap .code-block-wrapper .theme-light .hljs-selector-tag,.tiptap .code-block-wrapper .theme-light .hljs-literal,.tiptap .code-block-wrapper .theme-light .hljs-type{color:#00f!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-light .hljs-string,.tiptap .code-block-wrapper .theme-light .hljs-title,.tiptap .code-block-wrapper .theme-light .hljs-name{color:#a31515!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-light .hljs-number,.tiptap .code-block-wrapper .theme-light .hljs-symbol,.tiptap .code-block-wrapper .theme-light .hljs-bullet{color:#098658!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-light .hljs-function,.tiptap .code-block-wrapper .theme-light .hljs-params{color:#795e26!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-light .hljs-attr,.tiptap .code-block-wrapper .theme-light .hljs-variable,.tiptap .code-block-wrapper .theme-light .hljs-property{color:#001080!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-light .hljs-built_in,.tiptap .code-block-wrapper .theme-light .hljs-class{color:#267f99!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}}",az=".tiptap img{display:block;max-width:100%;height:auto;border-radius:4px;page-break-inside:avoid}.tiptap [data-node-view-wrapper]{position:relative;display:block}.tiptap [data-node-view-wrapper] img{max-width:100%;height:auto;-o-object-fit:contain;object-fit:contain}.tiptap [data-node-view-wrapper].w-fit{margin-left:0;margin-right:auto}.tiptap [data-node-view-wrapper].mx-auto{display:block!important;margin-left:auto!important;margin-right:auto!important}.tiptap [data-node-view-wrapper].ml-auto{display:block!important;margin-left:auto!important;margin-right:0!important}@media print{.tiptap img{max-width:100%!important;page-break-inside:avoid;page-break-after:auto;border:none!important}.tiptap [data-node-view-wrapper].w-fit{margin-left:0!important;margin-right:auto!important}.tiptap [data-node-view-wrapper].mx-auto{display:block!important;margin-left:auto!important;margin-right:auto!important}.tiptap [data-node-view-wrapper].ml-auto{display:block!important;margin-left:auto!important;margin-right:0!important}.tiptap [data-node-view-wrapper]>div>div>div{display:none!important}.tiptap [data-node-view-wrapper] img{border:none!important}}",sz=".page-columns{display:grid;gap:1rem;margin:1rem 0}.page-columns-1{grid-template-columns:repeat(1,1fr)}.page-columns-2{grid-template-columns:repeat(2,1fr)}.page-columns-3{grid-template-columns:repeat(3,1fr)}.page-columns-4{grid-template-columns:repeat(4,1fr)}.page-columns-5{grid-template-columns:repeat(5,1fr)}.page-columns-6{grid-template-columns:repeat(6,1fr)}.page-column-node{min-height:50px;padding-right:1rem;border-right:1px solid #e0e0e0;min-width:0;overflow-wrap:break-word;word-break:break-word}.page-column-node:last-child{border-right:none;padding-right:0}.page-columns.no-dividers .page-column-node{border-right:none}",lz=()=>{const{editor:e,editorConfig:t}=lt(),n=()=>{if(!e?.getText)return;const s=e.getText(),l=new Blob([s],{type:"text/plain;charset=utf-8"}),c=t?.file?.name||"Untitled document",d=URL.createObjectURL(l),u=document.createElement("a");u.href=d,u.download=`${c}.txt`,document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(d)},r=()=>{if(!e?.getJSON)return;const s=e.getJSON(),l=t?.file?.name||"Untitled document",c=new Blob([JSON.stringify(s,null,2)],{type:"application/json"}),d=URL.createObjectURL(c),u=document.createElement("a");u.href=d,u.download=`${l}.json`,document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(d)},i=()=>{if(!e?.getText)return;const s=e.getText(),l=new Blob([s],{type:"text/markdown;charset=utf-8"}),c=t?.file?.name||"Untitled document",d=URL.createObjectURL(l),u=document.createElement("a");u.href=d,u.download=`${c}.md`,document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(d)},o=()=>{if(!e?.getHTML)return;const s=e.getHTML(),l=new Blob([s],{type:"text/html;charset=utf-8"}),c=t?.file?.name||"Untitled document",d=URL.createObjectURL(l),u=document.createElement("a");u.href=d,u.download=`${c}.html`,document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(d)},a=A.useCallback(()=>{try{const s=t?.file?.name||"Untitled document",l=document.querySelector(".editor-content")?.innerHTML||"",c=e?.storage?.pageMargin,d=c?.margins||{top:1,right:1,bottom:1,left:1},u=c?.unit||"in";console.log("this is the content",d,u);let p="portrait",m={width:210,height:297},_="white";const h=document.querySelector(".editor-content");if(h instanceof HTMLElement){const y=h.style.width,T=h.style.height;y&&T&&(m={width:parseFloat(y),height:parseFloat(T)})}const g=document.querySelector(".editor-content");if(g instanceof HTMLElement){const y=window.getComputedStyle(g).backgroundColor;y&&y!=="rgba(0, 0, 0, 0)"&&y!=="transparent"&&(_=y)}try{const y=document.body.getAttribute("data-page-orientation");y&&(p=y)}catch(y){console.error("Error parsing page orientation:",y)}const b=document.createElement("iframe");b.style.position="fixed",b.style.right="0",b.style.bottom="0",b.style.width="0",b.style.height="0",b.style.border="none",document.body.appendChild(b);const E=b.contentDocument||b.contentWindow?.document;if(!E)throw new Error("Could not access iframe document");E.open(),E.write(`
228
+ `,style:{width:`${n}px`},title:`${N(V.type)} change ${H+1}`,children:[f.jsx("span",{"aria-hidden":"true",className:`absolute -left-[10px] top-1/2 -translate-y-1/2 z-[1] h-0 w-0 border-y-[9px] border-y-transparent border-r-[10px] ${W?"border-r-primary-300 dark:border-r-primary-700":"border-r-neutral-200 dark:border-r-black-600"}`}),f.jsx("span",{"aria-hidden":"true",className:`absolute -left-[9px] top-1/2 -translate-y-1/2 z-[2] h-0 w-0 border-y-[7px] border-y-transparent border-r-[9px] ${W?"border-r-primary-50 dark:border-r-primary-900":"border-r-white/95 dark:border-r-black-800/95"}`}),f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx(ie,{name:"redline-item",size:16,className:W?"text-primary-500":"text-neutral-500 dark:text-neutral-300"}),f.jsx("span",{className:`text-[10px] font-semibold tracking-wide truncate ${W?"text-primary-500":"text-neutral-600 dark:text-neutral-200"}`,style:{maxWidth:`${Math.max(n-66,40)}px`},children:P(V)})]}),f.jsx("span",{className:`inline-flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-[11px] font-bold leading-none ${W?"bg-primary-200 text-primary-700 dark:bg-primary-900 dark:text-primary-200":"bg-neutral-200 text-neutral-700 dark:bg-black-700 dark:text-neutral-200"}`,children:H+1})]})},V.id):f.jsx("div",{"data-redline-item":"true",style:{position:"absolute",top:`${j}px`,left:0,width:"380px",zIndex:W?8:3,pointerEvents:"auto",transition:v?"none":"top 200ms ease, left 200ms ease"},children:f.jsx(zf,{ref:oe=>{oe?m.current.set(V.id,oe):m.current.delete(V.id)},change:V,onAccept:o,onReject:a,onNavigate:s,onAddComment:l,onEditComment:c,onDeleteComment:d,currentUser:T,isActive:W,onSetActive:()=>{g(V.id),b(null)},isSuggestingMode:S,showComments:Sy,canReviewChanges:y})},V.id)})})}),z&&Ri.createPortal(f.jsx("div",{"data-redline-item":"true",className:"fixed pointer-events-auto z-[6] rounded-lg shadow-[0px_12px_32px_0px_rgba(16,24,40,0.08)]",style:{top:`${h.top}px`,left:`${h.left}px`,maxWidth:"380px",width:"380px",transform:h.showBelow?"none":"translateY(-100%)"},children:f.jsx(zf,{change:x,onAccept:o,onReject:a,onNavigate:s,onAddComment:l,onEditComment:c,onDeleteComment:d,currentUser:T,isActive:!0,onSetActive:()=>g(x.id),isSuggestingMode:S,showComments:Sy,canReviewChanges:y})}),document.body)]})},A7=({id:e,tools:t,position:n="right",isExpanded:r=!1,defaultActiveTool:i=null,expandedWidth:o=320,toggleToolbar:a})=>{const[s,l]=A.useState(i),c=t.filter(_=>!_.notVisible),d=_=>{(s!==_||!r)&&(a?.(!0),l(_))},u=()=>{a?.(!r),!r&&!s&&c.length>0?l(c[0].id):r&&l(null)},p=n==="left",m=c.find(_=>_.id===s)??null;return f.jsxs("div",{className:`h-full flex ${p?"flex-row":"flex-row-reverse"}`,children:[f.jsxs("div",{id:e,className:"h-full w-14 bg-white dark:bg-black-800 border border-neutral-200 dark:border-black-600 flex flex-col relative z-10",children:[f.jsx("div",{className:"flex-1 flex flex-col",children:c.map(_=>f.jsxs("button",{onClick:()=>d(_.id),className:`w-full h-14 flex items-center justify-center transition-all duration-[500ms] relative ${s===_.id&&r?"bg-blue-50 dark:bg-primary-950 text-blue-600 dark:text-primary-300":"text-gray-600 dark:text-black-300 hover:bg-neutral-100 dark:hover:bg-black-700 hover:text-neutral-900 dark:hover:text-white"}`,title:_.label,children:[s===_.id&&r&&f.jsx("div",{className:`absolute ${p?"right-0":"left-0"} top-0 bottom-0 w-0.5 bg-primary-600`}),f.jsx("div",{className:`flex items-center justify-center ${s===_.id&&r?"text-primary-400":"text-neutral-400 dark:text-black-300"}`,children:_.icon})]},_.id))}),f.jsx("button",{onClick:u,className:`w-full h-12 flex items-center justify-center text-gray-600 dark:text-black-300 hover:bg-neutral-100 dark:hover:bg-black-700 hover:text-neutral-900 dark:hover:text-white transition-colors duration-[500ms] ${r?"rotate-0":"rotate-180"}`,title:r?"Collapse sidebar":"Expand sidebar",children:f.jsx(ie,{name:"double-right-arrow",size:16,strokeWidth:2})})]}),f.jsx("div",{className:`h-full bg-white dark:bg-black-800 ${p?"border-r":"border-l"} border-neutral-200 dark:border-black-600 overflow-hidden transition-all duration-[500ms] ease-in-out shadow-lg z-10`,style:{width:r?`${o}px`:"0px",minWidth:r?`${o}px`:"0px"},children:r&&s&&m&&f.jsx("div",{className:`h-full transition-opacity duration-[500ms] ${r?"opacity-100 delay-100":"opacity-0"}`,style:{width:`${o}px`},children:m.content})})]})},O7=({onExport:e,onClose:t})=>{const[n,r]=A.useState(null),i=()=>{n&&(e?.({fileType:n}),r(null))},o=()=>{r(null),t?.()},a=[{value:"pdf",label:"PDF"},{value:"text",label:"Text"},{value:"json",label:"JSON"},{value:"html",label:"HTML"},{value:"markdown",label:"Markdown"}];return f.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-black-800",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-black-600",children:[f.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Export"}),t&&f.jsx("button",{onClick:t,className:"text-gray-400 dark:text-black-400 hover:text-gray-600 dark:hover:text-black-200 transition-colors",children:f.jsx(ee.Close,{sx:{fontSize:20}})})]}),f.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:f.jsx("div",{className:"space-y-6",children:f.jsxs("div",{children:[f.jsx("label",{className:"block text-xs font-semibold text-gray-500 dark:text-black-300 uppercase tracking-wide mb-2",children:"File Type"}),f.jsx(G.SelectField,{value:n,onChange:r,selectOptions:a,placeholder:"Select File Type",className:"w-full",getPopupContainer:()=>document.getElementById("editor-shell-qwCfsxssdsfsd")??document.body})]})})}),f.jsxs("div",{className:"px-4 py-3 border-t border-gray-200 dark:border-black-600 flex items-center justify-between bg-white dark:bg-black-800",children:[f.jsx("button",{onClick:o,className:"px-3 py-1.5 border border-neutral-300 dark:border-black-500 text-sm font-medium text-neutral-900 dark:text-white hover:bg-neutral-100 dark:hover:bg-black-700 rounded-lg transition-colors",children:"Cancel"}),f.jsx("button",{onClick:i,className:"px-3 py-1.5 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:!n,children:"Export"})]})]})},Ty=50,I7=()=>{const{editor:e}=lt(),[t,n]=A.useState(""),[r,i]=A.useState([]),[o,a]=A.useState(0),s=(m,_,h=!0)=>{if(!e)return;const g=_||r;if(m<0||m>=g.length)return;const b=g[m];e.commands.setTextSelection({from:b.from,to:b.to}),h&&e.commands.focus(),a(m)},l=(m,_=!1)=>{if(!e||!m){i([]),a(0);return}const h=[],g=m.toLowerCase(),b=e.state.doc;b.descendants((E,S)=>{if(E.isText&&E.text){const y=E.text,T=y.toLowerCase();let x=0;for(;x<T.length;){const v=T.indexOf(g,x);if(v===-1)break;const C=S+v,O=C+m.length,w=b.content.size,z=Math.max(0,C-Ty),N=Math.min(w-1,O+Ty);let P="",I="";try{C>z&&(P=b.textBetween(z,C," "),z>0&&(P="... "+P)),O<N&&(I=b.textBetween(O,N," "),N<w-1&&(I=I+" ..."))}catch(R){console.error("Error extracting context:",R)}h.push({id:`match-${h.length}`,from:C,to:O,text:y.substring(v,v+m.length),contextBefore:P,contextAfter:I}),x=v+1}}}),i(h),a(h.length>0?0:-1),_&&h.length>0&&s(0,h,!1)},c=()=>{if(r.length===0)return;const m=o>0?o-1:r.length-1;s(m,void 0,!0)},d=()=>{if(r.length===0)return;const m=o<r.length-1?o+1:0;s(m,void 0,!0)},u=m=>{if(!e||r.length===0||o<0)return;const _=r[o];e.chain().focus().setTextSelection({from:_.from,to:_.to}).insertContent(m).run(),setTimeout(()=>{l(t,!1)},50)},p=m=>{if(!e||r.length===0)return;const _=[...r].sort((g,b)=>b.from-g.from),h=e.state.tr;_.forEach(g=>{h.replaceWith(g.from,g.to,e.schema.text(m))}),e.view.dispatch(h),e.commands.focus(),setTimeout(()=>{l(t,!1)},50)};return A.useEffect(()=>{t&&e?l(t,!1):(i([]),a(0))},[t,e]),{searchQuery:t,setSearchQuery:n,matches:r,currentMatchIndex:o,goToPrevious:c,goToNext:d,replaceCurrent:u,replaceAll:p,navigateToMatch:s}},k7=({onClose:e,currentMode:t})=>{const[n,r]=A.useState("FIND & REPLACE"),[i,o]=A.useState(""),a=A.useRef(new Map),{searchQuery:s,setSearchQuery:l,matches:c,currentMatchIndex:d,goToPrevious:u,goToNext:p,replaceCurrent:m,replaceAll:_,navigateToMatch:h}=I7(),g=c.length;A.useEffect(()=>{const S=a.current.get(d);S&&S.scrollIntoView({behavior:"smooth",block:"nearest"})},[d]);const b=()=>{i&&s&&m(i)},E=()=>{i&&s&&_(i)};return f.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-black-800",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-black-600",children:[f.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Search"}),e&&f.jsx("button",{onClick:e,className:"text-gray-400 dark:text-black-400 hover:text-gray-600 dark:hover:text-black-200 transition-colors",children:f.jsx(ee.Close,{sx:{fontSize:20}})})]}),f.jsx("div",{className:"px-4 pt-3",children:f.jsx(G.Tabs,{variant:"switch",size:"sm",fullWidth:!0,className:"w-full",tabs:["FIND","FIND & REPLACE"],activeTab:n,onTabClick:S=>r(S),tabIcons:{FIND:f.jsx(ie,{name:"search",size:18}),"FIND & REPLACE":f.jsx(ie,{name:"search-and-replace",size:18})}})}),f.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[f.jsxs("div",{className:"p-4 space-y-3 flex-shrink-0",children:[f.jsx("div",{className:"w-full",children:f.jsx(G.SearchBar,{value:s,onChange:l,placeholder:"Search ...",id:"find-editor-search-bar",isClearable:!0})}),n==="FIND & REPLACE"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"relative",children:[f.jsx(ie,{name:"arrow-right",size:20,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 dark:text-black-400"}),f.jsx("input",{type:"text",value:i,onChange:S=>o(S.target.value),placeholder:"Replace with",className:"w-full h-8 pl-9 pr-3 py-2.5 border border-neutral-200 dark:border-black-600 rounded-lg bg-white dark:bg-black-700 text-neutral-900 dark:text-white placeholder:text-neutral-400 dark:placeholder:text-black-400 focus:outline-none focus:!border-primary-500 text-sm"})]}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx("button",{onClick:b,disabled:!s||!i||t==="viewing",className:"flex-1 h-9 px-3 py-1.5 text-sm font-medium border border-neutral-300 dark:border-black-500 text-neutral-900 dark:text-white rounded-lg hover:bg-neutral-50 dark:hover:bg-black-700 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Replace"}),f.jsx("button",{onClick:E,disabled:!s||!i||t==="viewing",className:"flex-1 h-9 px-3 py-1.5 text-sm font-medium border border-neutral-300 dark:border-black-500 text-neutral-900 dark:text-white rounded-lg hover:bg-neutral-50 dark:hover:bg-black-700 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Replace All"})]})]}),f.jsx("hr",{className:"border-neutral-200 dark:border-black-600"}),s&&g>0&&f.jsxs("div",{className:"flex items-center justify-between pt-2 pb-1",children:[f.jsxs("span",{className:"text-sm font-medium text-gray-700 dark:text-black-200",children:["Result ",d+1," of ",g]}),f.jsxs("div",{className:"flex gap-1",children:[f.jsx("button",{onClick:u,className:"p-1 hover:bg-gray-100 dark:hover:bg-black-600 rounded transition-colors text-neutral-700 dark:text-black-200",title:"Previous result",children:f.jsx(ee.KeyboardArrowUp,{sx:{fontSize:20}})}),f.jsx("button",{onClick:p,className:"p-1 hover:bg-gray-100 dark:hover:bg-black-600 rounded transition-colors text-neutral-700 dark:text-black-200",title:"Next result",children:f.jsx(ee.KeyboardArrowDown,{sx:{fontSize:20}})})]})]})]}),s&&g>0&&f.jsx("div",{className:"flex-1 overflow-y-auto px-4 pb-4",children:f.jsx("div",{className:"space-y-2",children:c.map((S,y)=>f.jsx("div",{ref:T=>{T?a.current.set(y,T):a.current.delete(y)},className:`p-3 rounded-lg cursor-pointer transition-colors ${y===d?"bg-primary-50 dark:bg-primary-950 border border-primary-200 dark:border-primary-800":"bg-primary-50 dark:bg-primary-700 hover:bg-primary-100 dark:hover:bg-primary-600"}`,onClick:()=>h(y,void 0,!0),children:f.jsxs("p",{className:"text-sm text-gray-700 dark:text-black-200 leading-relaxed",children:[S.contextBefore,f.jsx("span",{className:"text-primary-600 dark:text-primary-300 font-medium",children:S.text}),S.contextAfter]})},S.id))})}),s&&g===0&&f.jsx("div",{className:"flex-1 flex items-center justify-center text-gray-500 dark:text-black-400",children:f.jsxs("p",{className:"text-sm",children:['No results found for "',s,'"']})})]})]})},w7=[{label:"Free",value:null},{label:"1:1",value:1/1},{label:"4:3",value:4/3},{label:"16:9",value:16/9},{label:"3:2",value:3/2},{label:"2:3",value:2/3}],M7=({open:e,imageUrl:t,onApply:n,onCancel:r})=>{const[i,o]=A.useState(null),[a,s]=A.useState(0),[l,c]=A.useState(!1),[d,u]=A.useState(!1),[p,m]=A.useState({x:50,y:50,width:400,height:300}),[_,h]=A.useState(!1),[g,b]=A.useState(null),[E,S]=A.useState({x:0,y:0}),y=A.useRef(null),T=A.useRef(null),x=A.useRef(null);A.useEffect(()=>{if(T.current&&x.current&&e){const R=T.current,k=x.current,M=()=>{const B=R.getBoundingClientRect(),D=k.getBoundingClientRect(),U=Math.min(B.width*.8,400),H=Math.min(B.height*.8,300),V=B.left-D.left+(B.width-U)/2,j=B.top-D.top+(B.height-H)/2;m({x:V,y:j,width:U,height:H})};if(R.complete)M();else return R.addEventListener("load",M),()=>R.removeEventListener("load",M)}},[e,t]);const v=()=>{s(R=>(R-90+360)%360)},C=()=>{s(R=>(R+90)%360)},O=()=>{c(!l)},w=()=>{u(!d)};A.useEffect(()=>{i&&m(R=>({...R,height:R.width/i}))},[i]);const z=(R,k)=>{R.preventDefault(),S({x:R.clientX,y:R.clientY}),k?b(k):h(!0)},N=R=>{if(_){const k=R.clientX-E.x,M=R.clientY-E.y;m(B=>({...B,x:B.x+k,y:B.y+M})),S({x:R.clientX,y:R.clientY})}else if(g){const k=R.clientX-E.x,M=R.clientY-E.y;m(B=>{const D={...B};switch(g){case"tl":D.x+=k,D.y+=M,D.width-=k,D.height-=M;break;case"tr":D.y+=M,D.width+=k,D.height-=M;break;case"bl":D.x+=k,D.width-=k,D.height+=M;break;case"br":D.width+=k,D.height+=M;break;case"t":D.y+=M,D.height-=M;break;case"b":D.height+=M;break;case"l":D.x+=k,D.width-=k;break;case"r":D.width+=k;break}return i&&(D.height=D.width/i),D.width=Math.max(50,D.width),D.height=Math.max(50,D.height),D}),S({x:R.clientX,y:R.clientY})}},P=()=>{h(!1),b(null)};A.useEffect(()=>{if(_||g)return window.addEventListener("mousemove",N),window.addEventListener("mouseup",P),()=>{window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",P)}},[_,g,E]);const I=()=>{if(!y.current||!T.current||!x.current)return;const R=y.current,k=R.getContext("2d");if(!k)return;const M=T.current,B=x.current,D=M.getBoundingClientRect(),U=B.getBoundingClientRect(),H=M.naturalWidth/D.width,V=p.x-(D.left-U.left),j=p.y-(D.top-U.top),W=Math.max(0,V*H),oe=Math.max(0,j*H),Z=Math.min(p.width*H,M.naturalWidth-W),X=Math.min(p.height*H,M.naturalHeight-oe),se=document.createElement("canvas"),be=se.getContext("2d");if(!be)return;se.width=Z,se.height=X,be.drawImage(M,W,oe,Z,X,0,0,Z,X),a%180===0?(R.width=Z,R.height=X):(R.width=X,R.height=Z),k.save(),k.translate(R.width/2,R.height/2),k.scale(l?-1:1,d?-1:1),k.rotate(a*Math.PI/180),k.drawImage(se,-se.width/2,-se.height/2),k.restore();const pe=R.toDataURL("image/jpeg",.95);n(pe)};return f.jsx(Oe.Modal,{open:e,onCancel:r,footer:null,width:900,centered:!0,closeIcon:null,children:f.jsxs("div",{className:"p-2",children:[f.jsxs("div",{className:"flex items-center justify-between mb-6",children:[f.jsx("h2",{className:"text-xl font-semibold text-neutral-900 dark:text-neutral-100",children:"Crop Image"}),f.jsx("button",{onClick:r,className:"text-neutral-400 hover:text-neutral-600 dark:text-black-300 dark:hover:text-black-100 transition-colors",children:f.jsx(ee.Close,{sx:{fontSize:20}})})]}),f.jsxs("div",{className:"flex gap-4",children:[f.jsxs("div",{ref:x,className:"flex-1 relative bg-neutral-900 rounded-lg overflow-hidden",style:{height:"400px"},children:[f.jsx("img",{ref:T,src:t,alt:"Crop preview",className:"w-full h-full object-contain",style:{transform:`scaleX(${l?-1:1}) scaleY(${d?-1:1}) rotate(${a}deg)`}}),f.jsxs("div",{className:"absolute border-2 border-white cursor-move",style:{left:`${p.x}px`,top:`${p.y}px`,width:`${p.width}px`,height:`${p.height}px`,boxShadow:"0 0 0 9999px rgba(0, 0, 0, 0.6)"},onMouseDown:R=>z(R),children:[["tl","tr","bl","br"].map(R=>f.jsx("div",{className:"absolute w-3 h-3 bg-blue-500 rounded-full",style:{top:R.includes("t")?"-6px":"auto",bottom:R.includes("b")?"-6px":"auto",left:R.includes("l")?"-6px":"auto",right:R.includes("r")?"-6px":"auto",cursor:`${R.includes("t")?"n":"s"}${R.includes("l")?"w":"e"}-resize`},onMouseDown:k=>{k.stopPropagation(),z(k,R)}},R)),["t","b","l","r"].map(R=>f.jsx("div",{className:"absolute w-3 h-3 bg-blue-500 rounded-full",style:{top:R==="t"?"-6px":R==="b"?"auto":"50%",bottom:R==="b"?"-6px":"auto",left:R==="l"?"-6px":R==="r"?"auto":"50%",right:R==="r"?"-6px":"auto",transform:R==="t"||R==="b"?"translateX(-50%)":R==="l"||R==="r"?"translateY(-50%)":"none",cursor:`${R==="t"||R==="b"?"ns":"ew"}-resize`},onMouseDown:k=>{k.stopPropagation(),z(k,R)}},R))]})]}),f.jsxs("div",{className:"w-64 space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-semibold text-neutral-900 dark:text-neutral-100 mb-2",children:"Aspect Ratio"}),f.jsx("div",{className:"grid grid-cols-2 gap-2",children:w7.map(R=>f.jsx("button",{onClick:()=>o(R.value),className:`h-8 px-2 py-1 text-sm font-medium rounded-lg transition-colors ${i===R.value?"bg-primary-500 text-white":"bg-white dark:bg-black-700 border border-neutral-300 dark:border-black-500 text-neutral-700 dark:text-black-200 hover:bg-neutral-50 dark:hover:bg-black-600"}`,children:R.label},R.label))})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-semibold text-neutral-900 dark:text-neutral-100 mb-2",children:"Rotation"}),f.jsxs("div",{className:"grid grid-cols-4 gap-2 mb-2",children:[f.jsx("button",{onClick:v,className:"h-8 px-2 py-1 border border-neutral-300 dark:border-black-500 rounded-lg hover:bg-neutral-50 dark:hover:bg-black-600 text-neutral-700 dark:text-black-200 flex items-center justify-center",title:"Rotate Left",children:f.jsx(ee.RotateLeftOutlined,{sx:{fontSize:16}})}),f.jsx("button",{onClick:C,className:"h-8 px-2 py-1 border border-neutral-300 dark:border-black-500 rounded-lg hover:bg-neutral-50 dark:hover:bg-black-600 text-neutral-700 dark:text-black-200 flex items-center justify-center",title:"Rotate Right",children:f.jsx(ee.RotateRightOutlined,{sx:{fontSize:16}})}),f.jsx("button",{onClick:O,className:"h-8 px-2 py-1 border border-neutral-300 dark:border-black-500 rounded-lg hover:bg-neutral-50 dark:hover:bg-black-600 text-neutral-700 dark:text-black-200 flex items-center justify-center",title:"Flip Horizontal",children:f.jsx(ee.OpenInFullOutlined,{sx:{fontSize:14,transform:"rotate(45deg)"}})}),f.jsx("button",{onClick:w,className:"h-8 px-2 py-1 border border-neutral-300 dark:border-black-500 rounded-lg hover:bg-neutral-50 dark:hover:bg-black-600 text-neutral-700 dark:text-black-200 flex items-center justify-center",title:"Flip Vertical",children:f.jsx(ee.OpenInFullOutlined,{sx:{fontSize:14,transform:"rotate(135deg)"}})})]}),f.jsxs("div",{className:"flex h-8 items-stretch border border-neutral-300 dark:border-black-500 rounded-lg overflow-hidden",children:[f.jsxs("div",{className:"flex-1 flex items-center px-4 relative",children:[f.jsx("input",{type:"number",value:a,onChange:R=>s(parseInt(R.target.value)||0),className:"w-full text-sm font-semibold text-neutral-900 dark:text-neutral-100 focus:outline-none text-left border-none bg-transparent [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",style:{minWidth:0}}),f.jsx("span",{className:"text-sm text-neutral-900 dark:text-neutral-100 font-semibold ml-0.5",children:"°"})]}),f.jsxs("div",{className:"flex items-center border-l border-neutral-300 dark:border-black-500",children:[f.jsx("button",{onClick:()=>s((a+1)%360),className:"cursor-pointer w-8 flex items-center justify-center border-r border-neutral-300 dark:border-black-500 text-neutral-400 dark:text-black-300 transition-colors text-md",children:"+"}),f.jsx("div",{className:"w-px bg-neutral-300 dark:bg-black-500"}),f.jsx("button",{onClick:()=>s((a-1+360)%360),className:"cursor-pointer w-8 flex items-center justify-center text-neutral-400 dark:text-black-300 transition-colors text-md",children:"−"})]})]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-semibold text-neutral-900 dark:text-neutral-100 mb-2",children:"Dimensions"}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("label",{className:"block text-sm text-neutral-600 dark:text-black-300 mb-1",children:"Width"}),f.jsxs("div",{className:"flex h-8 items-stretch border border-neutral-300 dark:border-black-500 rounded-lg overflow-hidden",children:[f.jsx("input",{type:"number",value:Math.round(p.width),onChange:R=>{const k=parseInt(R.target.value)||0;m(M=>({...M,width:k,height:i?k/i:M.height}))},className:"flex-1 px-4 py-1.5 text-sm font-semibold text-neutral-900 dark:text-neutral-100 focus:outline-none text-left border-none bg-transparent [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",style:{minWidth:0}}),f.jsxs("div",{className:"flex items-center",children:[f.jsx("button",{onClick:()=>m(R=>({...R,width:R.width+10,height:i?(R.width+10)/i:R.height})),className:"cursor-pointer w-8 flex items-center justify-center border-r border-neutral-300 dark:border-black-500 text-neutral-400 dark:text-black-300 transition-colors text-md",children:"+"}),f.jsx("div",{className:"w-px bg-neutral-300 dark:bg-black-500"}),f.jsx("button",{onClick:()=>m(R=>({...R,width:Math.max(50,R.width-10),height:i?Math.max(50,R.width-10)/i:R.height})),className:"cursor-pointer w-8 flex items-center justify-center text-neutral-400 dark:text-black-300 transition-colors text-md",children:"−"})]})]}),f.jsx("span",{className:"flex items-center text-xs text-neutral-500 dark:text-black-300",children:"px"})]}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("label",{className:"block text-sm text-neutral-600 dark:text-black-300 mb-1",children:"Height"}),f.jsxs("div",{className:"flex h-8 items-stretch border border-neutral-300 dark:border-black-500 rounded-lg overflow-hidden",children:[f.jsx("input",{type:"number",value:Math.round(p.height),onChange:R=>{const k=parseInt(R.target.value)||0;m(M=>({...M,height:k,width:i?k*i:M.width}))},className:"flex-1 px-4 py-1.5 text-sm font-semibold text-neutral-900 dark:text-neutral-100 focus:outline-none text-left border-none bg-transparent [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",style:{minWidth:0},disabled:!!i}),f.jsxs("div",{className:"flex items-center",children:[f.jsx("button",{onClick:()=>m(R=>({...R,height:R.height+10,width:i?(R.height+10)*i:R.width})),className:"cursor-pointer w-8 flex items-center justify-center border-r border-neutral-300 dark:border-black-500 text-neutral-400 dark:text-black-300 transition-colors text-md",disabled:!!i,children:"+"}),f.jsx("div",{className:"w-px bg-neutral-300 dark:bg-black-500"}),f.jsx("button",{onClick:()=>m(R=>({...R,height:Math.max(50,R.height-10),width:i?Math.max(50,R.height-10)*i:R.width})),className:"cursor-pointer w-8 flex items-center justify-center text-neutral-400 dark:text-black-300 transition-colors text-md",disabled:!!i,children:"−"})]})]}),f.jsx("span",{className:"flex items-center text-xs text-neutral-500 dark:text-black-300",children:"px"})]})]})]})]})]}),f.jsxs("div",{className:"flex justify-between gap-2 mt-6",children:[f.jsx("button",{onClick:r,className:"px-4 py-2 text-sm font-medium text-neutral-700 dark:text-black-200 border border-neutral-300 dark:border-black-500 rounded-lg hover:bg-neutral-50 dark:hover:bg-black-600 transition-colors",children:"Cancel"}),f.jsx("button",{onClick:I,className:"px-4 py-2 text-sm font-medium text-white bg-primary-500 hover:bg-primary-600 rounded-lg transition-colors",children:"Apply"})]}),f.jsx("canvas",{ref:y,className:"hidden"})]})})};var yy={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Cy=A.createContext&&A.createContext(yy),D7=["attr","size","title"];function L7(e,t){if(e==null)return{};var n=P7(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function P7(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Bd(){return Bd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bd.apply(this,arguments)}function vy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vy(Object(n),!0).forEach(function(r){B7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function B7(e,t,n){return t=F7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F7(e){var t=U7(e,"string");return typeof t=="symbol"?t:t+""}function U7(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xy(e){return e&&e.map((t,n)=>A.createElement(t.tag,Fd({key:n},t.attr),xy(t.child)))}function z7(e){return t=>A.createElement(H7,Bd({attr:Fd({},e.attr)},t),xy(e.child))}function H7(e){var t=n=>{var{attr:r,size:i,title:o}=e,a=L7(e,D7),s=i||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),A.createElement("svg",Bd({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,a,{className:l,style:Fd(Fd({color:e.color||n.color},n.style),e.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),o&&A.createElement("title",null,o),e.children)};return Cy!==void 0?A.createElement(Cy.Consumer,null,n=>t(n)):t(yy)}function G7(e){return z7({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5zM1.6 11.85H0v3.999h.791v-1.342h.803q.43 0 .732-.173.305-.175.463-.474a1.4 1.4 0 0 0 .161-.677q0-.375-.158-.677a1.2 1.2 0 0 0-.46-.477q-.3-.18-.732-.179m.545 1.333a.8.8 0 0 1-.085.38.57.57 0 0 1-.238.241.8.8 0 0 1-.375.082H.788V12.48h.66q.327 0 .512.181.185.183.185.522m1.217-1.333v3.999h1.46q.602 0 .998-.237a1.45 1.45 0 0 0 .595-.689q.196-.45.196-1.084 0-.63-.196-1.075a1.43 1.43 0 0 0-.589-.68q-.396-.234-1.005-.234zm.791.645h.563q.371 0 .609.152a.9.9 0 0 1 .354.454q.118.302.118.753a2.3 2.3 0 0 1-.068.592 1.1 1.1 0 0 1-.196.422.8.8 0 0 1-.334.252 1.3 1.3 0 0 1-.483.082h-.563zm3.743 1.763v1.591h-.79V11.85h2.548v.653H7.896v1.117h1.606v.638z"},child:[]}]})(e)}const{Dragger:V7}=Oe.Upload,Y7=200*1024*1024,$7=({getFile:e,description:t,errorMessage:n=null,disabled:r=!1,defaultFile:i=null,acceptedFiles:o=null,isLoading:a=!1,asBase64:s=!1,multiple:l=!1,onDelete:c,hideSelectedFile:d=!1})=>{const[u,p]=A.useState(null),[m,_]=A.useState("#d9d9d9"),[h,g]=A.useState(!1),b={accept:o||"*",multiple:l,showUploadList:!1,disabled:r,beforeUpload:T=>{if(T.size>Y7)return!1;if(d||p(T),s){const x=new FileReader;x.onload=v=>{const C=v?.target?.result;e(C,T?.name)},x.readAsDataURL(T)}else e(T);return d||p(T),!1}},E=()=>{p(null),e(""),c?.()};A.useEffect(()=>{i?.name&&p(i)},[i]),A.useEffect(()=>{_(n?"#EF4444":"#d9d9d9")},[n]);const S=T=>T?T.length<=30?T:`${T.slice(0,23)}....${T.slice(-7)}`:"",y=({size:T=24,fill:x="#98A2B3"})=>f.jsx("svg",{width:T,height:T,viewBox:"0 0 24 24",fill:"none",children:f.jsx("path",{d:"M21 15V19C21 19.5304 20.7893 20.0391 20.4142 20.4142C20.0391 20.7893 19.5304 21 19 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V15M7 10L12 15M12 15L17 10M12 15V3",stroke:x,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});return f.jsxs("div",{children:[f.jsx("div",{className:"h-32",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:f.jsx(V7,{...b,style:{borderColor:h&&!n?"#016DCF":m,transition:"border-color 0.2s"},disabled:r||a,children:u&&!d?f.jsxs("div",{className:"flex items-center justify-between mx-5",title:u?.name||i?.name,children:[f.jsxs("div",{className:"flex items-center justify-center gap-4",children:[u?.type==="application/pdf"?f.jsx("div",{className:"p-3 bg-primary-50 rounded-lg",children:f.jsx(G7,{size:20,color:"#016DCF"})}):f.jsx("div",{className:"p-3 bg-primary-50 rounded-lg",children:f.jsx(ee.DescriptionRounded,{sx:{height:"20px",width:"20px",color:"#016DCF"}})}),f.jsxs("div",{className:"text-left",children:[f.jsx("p",{className:"text-sm font-medium text-gray-900",children:S(u?.name||i?.name)}),u?.size>0&&f.jsxs("p",{className:"text-xs text-gray-500",children:[(u.size/1024).toFixed(2)," KB"]})]})]}),a?f.jsx("div",{className:"animate-spin",children:f.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:f.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"#016DCF",strokeWidth:"4",strokeDasharray:"60",strokeLinecap:"round"})})}):f.jsx("button",{className:"ml-4 p-1 hover:bg-red-50 rounded transition-colors",onClick:T=>{T.stopPropagation(),E()},disabled:r,children:f.jsx(ee.DeleteOutline,{sx:{fontSize:20},className:"text-gray-400 hover:text-red-600"})})]}):f.jsx("div",{className:"flex items-center justify-center",children:f.jsxs("div",{className:"flex flex-col items-center",children:[f.jsx("div",{className:"mb-4 flex justify-center",children:f.jsx(y,{size:24,fill:"#98A2B3"})}),f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center justify-center",children:[f.jsx("span",{className:"text-sm font-medium text-primary-600",children:"Click to upload"}),f.jsx("span",{className:"text-sm font-medium text-gray-500 ml-1",children:"or drag and drop"})]}),t&&f.jsx("p",{className:"text-xs text-gray-400 mt-1 text-center",children:t})]})]})})})}),n&&f.jsx("p",{className:"text-red-500 text-xs mt-1 font-medium",children:n})]})},W7=({onInsert:e,onBack:t,onClose:n})=>{const[r,i]=A.useState(null),[o,a]=A.useState(""),[s,l]=A.useState(0),[c,d]=A.useState("center"),[u,p]=A.useState(2),[m,_]=A.useState("#4C04AF"),[h,g]=A.useState(8),[b,E]=A.useState(!1),S=(C,O)=>{if(typeof C=="string"){i(C),a(O||"image.png");const w=C.length*3/4;l(Math.round(w/1024))}else if(C instanceof File){a(C.name),l(Math.round(C.size/1024));const w=new FileReader;w.onload=z=>{i(z.target?.result)},w.readAsDataURL(C)}},y=()=>{i(null),a(""),l(0)},T=()=>{r&&e&&e({url:r,fileName:o,fileSize:s,alignment:c,borderWeight:u,borderColor:m,cornerRadius:h})},x=C=>{i(C),E(!1)},v=[{value:"left",icon:f.jsx(ee.FormatAlignLeftOutlined,{sx:{fontSize:16}}),title:"Align Left"},{value:"center",icon:f.jsx(ee.FormatAlignCenterOutlined,{sx:{fontSize:16}}),title:"Align Center"},{value:"right",icon:f.jsx(ee.FormatAlignRightOutlined,{sx:{fontSize:16}}),title:"Align Right"},{value:"full",icon:f.jsx(ee.FormatAlignJustifyOutlined,{sx:{fontSize:16}}),title:"Full Width"}];return f.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-black-800",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-neutral-200 dark:border-black-600",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[t&&f.jsx("button",{onClick:t,className:"text-neutral-600 dark:text-black-300 hover:text-neutral-900 dark:hover:text-white transition-colors",children:f.jsx(ee.ArrowBack,{sx:{fontSize:20}})}),f.jsx("h2",{className:"text-lg font-semibold text-neutral-900 dark:text-white",children:"Image"})]}),n&&f.jsx("button",{onClick:n,className:"text-neutral-400 dark:text-black-400 hover:text-neutral-600 dark:hover:text-black-200 transition-colors",children:f.jsx(ee.Close,{sx:{fontSize:20}})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto",children:[f.jsxs("div",{className:"p-4 space-y-4",children:[f.jsx("div",{className:"text-xs text-neutral-500 dark:text-black-300 uppercase font-medium",children:"Drag & drop onto the document to add"}),f.jsxs("div",{className:"flex flex-col",children:[r?f.jsx("div",{className:"relative w-full aspect-video bg-neutral-50 dark:bg-black-700 p-3 rounded-t-lg overflow-hidden border border-neutral-200 dark:border-black-600",children:f.jsx("img",{src:r,alt:"Preview",className:"w-full h-full object-cover",style:{border:u>0?`${u}px solid ${m}`:"none",borderRadius:`${h}px`}})}):f.jsx($7,{getFile:S,description:"PNG, JPG, GIF up to 200MB",acceptedFiles:"image/*",asBase64:!0,onDelete:y,hideSelectedFile:!0}),r&&f.jsxs("div",{className:"flex items-center gap-1 px-3 py-1.5 bg-neutral-50 dark:bg-black-700 rounded-b-lg border border-neutral-200 dark:border-black-600",children:[f.jsx(ie,{name:"image",size:20,className:"text-primary-500"}),f.jsx("span",{className:"flex-1 text-sm font-medium text-neutral-900 dark:text-white truncate",children:o}),f.jsxs("span",{className:"text-sm text-neutral-500 dark:text-black-400",children:["• ",s," KB"]}),f.jsx("button",{onClick:()=>E(!0),className:"py-1 px-2 ml-1 transition-colors mb-0.5 hover:bg-primary-50 dark:hover:bg-black-600 rounded",title:"Crop image",children:f.jsx(ee.CropRounded,{sx:{fontSize:16},className:"text-primary-600 dark:text-primary-400"})}),f.jsx("button",{onClick:y,className:"py-1 px-2 rounded transition-colors mb-0.5 hover:bg-red-50 dark:hover:bg-red-900/30",title:"Remove image",children:f.jsx(ee.DeleteOutline,{sx:{fontSize:16},className:"text-red-600 dark:text-red-400"})})]})]})]}),f.jsx("hr",{className:"border-neutral-200 dark:border-black-600"}),f.jsx("div",{className:"p-4 space-y-4",children:r&&f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{className:"text-sm font-semibold text-neutral-900 dark:text-white",children:"Image Settings"}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-xs font-medium text-neutral-500 dark:text-black-400 uppercase mb-2",children:"Alignment"}),f.jsx("div",{className:"grid grid-cols-4 gap-2",children:v.map(C=>f.jsx("button",{onClick:()=>d(C.value),className:`h-8 px-2 py-1 flex items-center justify-center rounded-lg border transition-colors ${c===C.value?"bg-primary-500 border-primary-500 text-white":"bg-white dark:bg-black-700 border-neutral-300 dark:border-black-500 text-neutral-600 dark:text-black-200 hover:border-primary-300 dark:hover:border-primary-500"}`,title:C.title,children:C.icon},C.value))})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-xs font-medium text-neutral-500 dark:text-black-400 uppercase mb-2",children:"Border Weight"}),f.jsxs("div",{className:"flex h-8 items-stretch border border-neutral-300 dark:border-black-500 rounded-lg overflow-hidden bg-white dark:bg-black-700",children:[f.jsx("input",{type:"number",value:u,onChange:C=>p(Math.max(0,parseInt(C.target.value)||0)),className:"flex-1 px-4 py-1.5 text-sm font-semibold text-neutral-900 dark:text-white focus:outline-none text-left border-none bg-transparent [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",style:{minWidth:0}}),f.jsxs("div",{className:"flex items-stretch border-r border-neutral-300 dark:border-black-500",children:[f.jsx("button",{onClick:()=>p(u+1),className:"w-8 flex items-center justify-center text-neutral-400 dark:text-black-400 hover:bg-neutral-50 dark:hover:bg-black-600 transition-colors text-md",children:"+"}),f.jsx("div",{className:"w-px bg-neutral-300 dark:bg-black-500"}),f.jsx("button",{onClick:()=>p(Math.max(0,u-1)),className:"w-8 flex items-center justify-center text-neutral-400 dark:text-black-400 hover:bg-neutral-50 dark:hover:bg-black-600 transition-colors text-md",children:"−"})]})]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-xs font-medium text-neutral-500 dark:text-black-400 uppercase mb-2",children:"Border Color"}),f.jsxs("div",{className:"flex gap-3 h-8 items-center",children:[f.jsx("div",{className:"w-6 cursor-pointer hover:opacity-80 transition-opacity m-1",children:f.jsx(Oe.ColorPicker,{value:m,onChange:C=>_(C.toHexString()),format:"hex",showText:!1})}),f.jsxs("div",{className:"flex-1 h-8 items-center border border-neutral-300 dark:border-black-500 rounded-lg overflow-hidden bg-white dark:bg-black-700",children:[f.jsx("div",{className:"w-px bg-neutral-300 dark:bg-black-500"}),f.jsx("input",{type:"text",value:m.toUpperCase(),onChange:C=>_(C.target.value),className:"flex-1 px-4 py-1 text-sm font-medium text-neutral-900 dark:text-white focus:outline-none border-none uppercase bg-transparent",placeholder:"#000000"})]})]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-xs font-medium text-neutral-500 dark:text-black-400 uppercase mb-2",children:"Corner Radius"}),f.jsxs("div",{className:"flex h-8 items-stretch border border-neutral-300 dark:border-black-500 rounded-lg overflow-hidden bg-white dark:bg-black-700",children:[f.jsx("input",{type:"number",value:h,onChange:C=>g(Math.max(0,parseInt(C.target.value)||0)),className:"flex-1 px-4 py-1.5 text-sm font-semibold text-neutral-900 dark:text-white focus:outline-none text-left border-none bg-transparent [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",style:{minWidth:0}}),f.jsxs("div",{className:"flex items-center",children:[f.jsx("button",{onClick:()=>g(h+1),className:"w-8 flex items-center justify-center border-r border-neutral-300 dark:border-black-500 text-neutral-400 dark:text-black-400 hover:bg-neutral-50 dark:hover:bg-black-600 transition-colors text-md",children:"+"}),f.jsx("div",{className:"w-px bg-neutral-300 dark:bg-black-500"}),f.jsx("button",{onClick:()=>g(Math.max(0,h-1)),className:"w-8 flex items-center justify-center text-neutral-400 dark:text-black-400 hover:bg-neutral-50 dark:hover:bg-black-600 transition-colors text-md",children:"−"})]})]})]})]})})]}),r&&f.jsxs("div",{className:"px-4 py-3 border-t border-neutral-200 dark:border-black-600 flex items-center justify-between bg-white dark:bg-black-800",children:[f.jsx("button",{onClick:()=>{i(null),a(""),l(0),t?.()},className:"px-4 py-2 text-sm font-medium text-neutral-700 dark:text-black-200 border border-neutral-300 dark:border-black-500 hover:bg-neutral-50 dark:hover:bg-black-700 rounded-lg transition-colors",children:"Cancel"}),f.jsx("button",{onClick:T,className:"px-4 py-2 text-sm font-medium text-white bg-primary-500 hover:bg-primary-600 rounded-lg transition-colors",children:"Insert"})]}),r&&f.jsx(M7,{open:b,imageUrl:r,onApply:x,onCancel:()=>E(!1)})]})},q7=({onClose:e})=>{const{editor:t}=lt(),[n,r]=A.useState(null),[i,o]=A.useState(!1),[a,s]=A.useState(null);A.useEffect(()=>{const m=_=>{const h=_;h.detail?.type==="image"&&(s(h.detail.pos??null),o(!0))};return window.addEventListener("insertElement",m),()=>{window.removeEventListener("insertElement",m)}},[]);const l=m=>{if(t)switch(m){case"image":s(null),o(!0);break;case"signature":t.commands.addSignature();break;case"codeBlock":t.chain().focus().toggleCodeBlock().run();break;case"divider":t.chain().focus().setHorizontalRule().run();break;case"page-break":t.chain().focus().setPageBreak().run();break}},c=m=>{if(!t)return;const _={src:m.url,alt:m.fileName,align:m.alignment,borderWeight:m.borderWeight,borderColor:m.borderColor,cornerRadius:m.cornerRadius},h=t.chain().focus();a!==null&&h.setTextSelection(a),h.insertContent({type:"image",attrs:_}).run(),o(!1),s(null),e?.()},d=[{icon:f.jsx(ie,{name:"image",size:20}),label:"Image",type:"image"},{icon:f.jsx(ie,{name:"signature",size:20}),label:"Signature",type:"signature"},{icon:f.jsx(ee.Code,{sx:{fontSize:20}}),label:"Code Block",type:"codeBlock"},{icon:f.jsx(ee.HorizontalRule,{sx:{fontSize:20}}),label:"Divider",type:"divider"},{icon:f.jsx(ee.InsertPageBreakOutlined,{sx:{fontSize:20}}),label:"Page break",type:"page-break"}],u=(m,_)=>{m.dataTransfer.effectAllowed="copy",m.dataTransfer.setData("elementType",_),m.dataTransfer.setData("text/plain",_),r(_)},p=()=>{r(null)};return i?f.jsx(W7,{onInsert:c,onBack:()=>{o(!1),s(null)},onClose:e}):f.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-black-800",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-black-600",children:[f.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Content"}),e&&f.jsx("button",{onClick:e,className:"text-gray-400 dark:text-black-400 hover:text-gray-600 dark:hover:text-black-200 transition-colors",children:f.jsx(ee.Close,{sx:{fontSize:20}})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[f.jsx("div",{className:"text-xs text-neutral-500 dark:text-black-300 uppercase font-medium mb-2",children:"Drag & drop onto the document to add"}),f.jsx("div",{className:"space-y-2",children:d.map(m=>f.jsxs("div",{draggable:!0,onDragStart:_=>u(_,m.type),onDragEnd:p,onClick:()=>l(m.type),className:`w-full flex items-start gap-2 px-3 py-2 rounded-lg border transition-all group cursor-move ${n===m.type?"opacity-50 border-primary-400 bg-primary-50 dark:bg-primary-950":"border-neutral-200 dark:border-black-600 hover:bg-neutral-50 dark:hover:bg-black-700 hover:border-primary-300"}`,children:[f.jsx("span",{className:"text-sm text-neutral-500 dark:text-black-100",children:m.icon}),f.jsx("div",{className:"flex-1 text-left",children:f.jsx("div",{className:"text-sm font-medium text-neutral-900 dark:text-white transition-colors",children:m.label})})]},m.label))})]})]})},j7=[],K7=[{value:"numbered",label:"Numbered",example:"Person 1, Company 1, Email 1"},{value:"descriptive",label:"Descriptive",example:"[PERSON_NAME], [COMPANY_NAME]"},{value:"redacted",label:"Redacted",example:"[REDACTED]"}],Q7=e=>e.value==="redacted"?f.jsxs("span",{className:"flex items-center gap-1",children:[e.example,","," ",f.jsx("span",{className:"inline-block w-16 h-3.5 bg-neutral-700 dark:bg-neutral-300 rounded-sm"})]}):e.example,X7=({detectionConfigs:e,onBack:t,onClose:n,onSave:r})=>{const{editorConfig:i}=lt(),o=i.piiAnonymization?.settings,[a,s]=A.useState(()=>{const S=e.map(T=>{const x=o?.detections?.find(v=>v.id===T.id);return{id:T.id,enabled:x?.enabled??!1}});return S.some(T=>T.enabled)?S:S.map(T=>({...T,enabled:!0}))}),[l,c]=A.useState(o?.placeholderFormat??"numbered"),[d,u]=A.useState(o?.highlightChanges??!1),p=(S,y)=>{s(T=>{const x=T.map(C=>C.id===S?{...C,enabled:y}:C);return x.some(C=>C.enabled)?x:x.map(C=>({...C,enabled:!0}))})},[m,_]=A.useState(!1),g=a.filter(S=>S.enabled).map(S=>S.id),b=e.filter(S=>a.find(y=>y.id===S.id)?.enabled).length,E=()=>{_(!0);const y={document_id:i.file?.id??"",tags:g,placeholder_format:l,highlight_changes:d,json_content:{}};i.piiAnonymization?.onSaveAnonymizationSettings?.(y)};return A.useEffect(()=>{m&&!i.piiAnonymization?.isScanningDocument&&(_(!1),r?.(g))},[i.piiAnonymization?.isScanningDocument]),f.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-black-800",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-black-600",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[t&&f.jsx(G.IconButton,{id:"anon-settings-back-btn",variant:"ghost",onClick:t,tooltip:"Back",noborder:!0,children:f.jsx(ee.ArrowBack,{sx:{fontSize:18}})}),f.jsx(G.Typography,{variant:"semibold",size:"medium",appearance:"title",children:"Anonymization Settings"})]}),n&&f.jsx(G.IconButton,{id:"anon-settings-close-btn",variant:"ghost",onClick:n,tooltip:"Close",noborder:!0,children:f.jsx(ee.Close,{sx:{fontSize:20}})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-5",children:[f.jsx(G.Card,{className:"!rounded-xl !border-success-100 dark:!border-success-800 !bg-success-50 dark:!bg-success-950/30 !px-4 !py-3 !shadow-none",children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-success-100 dark:bg-success-900/50",children:f.jsx(ee.CheckCircle,{sx:{fontSize:22},className:"text-success-600 dark:text-success-400"})}),f.jsxs("div",{children:[f.jsx(G.Typography,{variant:"semibold",size:"small",appearance:"title",children:"Document Protected"}),f.jsxs(G.Typography,{variant:"regular",size:"extra-small",appearance:"subtitle",className:"!text-success-700 dark:!text-success-400",children:[b," entities have been anonymized successfully"]})]})]})}),f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-1.5 mb-3",children:[f.jsx(ie,{name:"search",size:20,className:"text-primary-500 dark:text-black-300"}),f.jsx(G.Typography,{variant:"semibold",size:"small",appearance:"title",children:"Anonymization Mapping"})]}),f.jsx("div",{className:"space-y-2",children:e.map(S=>{const y=a.find(T=>T.id===S.id);return f.jsxs("div",{className:"flex items-center justify-between h-[50px] rounded-md border border-neutral-200 dark:border-black-600 bg-neutral-50 dark:bg-black-700 px-3 py-3",children:[f.jsxs("div",{className:"flex items-center gap-2.5",children:[f.jsx("div",{className:S.bgColor+" rounded-md p-1.5",children:f.jsx(ie,{name:S.iconName,size:18,className:S.iconColor})}),f.jsx(G.Typography,{variant:"medium",size:"extra-small",appearance:"title",className:"!text-sm",children:S.settingsLabel})]}),f.jsx(G.Checkbox,{id:`detection-${S.id}`,checked:y?.enabled??!1,onChange:T=>p(S.id,T),size:"small"})]},S.id)})})]}),f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-1.5 mb-3",children:[f.jsx(ee.LocalOffer,{sx:{fontSize:16},className:"text-primary-500 dark:text-black-300"}),f.jsx(G.Typography,{variant:"semibold",size:"small",appearance:"title",children:"Placeholder Format"})]}),f.jsx("div",{className:"space-y-2",children:K7.map(S=>{const y=l===S.value;return f.jsx("button",{type:"button",onClick:()=>c(S.value),className:`w-full text-left rounded-xl border px-4 py-3 transition-colors ${y?"border-primary-400 dark:border-primary-600 bg-primary-50 dark:bg-primary-950":"border-neutral-200 dark:border-black-600 bg-white dark:bg-black-700 hover:bg-neutral-50 dark:hover:bg-black-600"}`,children:f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx("div",{className:"pt-0.5",children:f.jsx(G.Radio,{isChecked:y,onSelect:()=>c(S.value),className:"h-4 w-4 shrink-0 accent-primary-600 dark:accent-primary-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/80 dark:focus-visible:ring-primary-400/80 focus-visible:ring-offset-1 focus-visible:ring-offset-white dark:focus-visible:ring-offset-black-800 rounded-full"})}),f.jsxs("div",{children:[f.jsx(G.Typography,{variant:"semibold",size:"extra-small",appearance:"title",className:"!text-sm mb-0.5",children:S.label}),f.jsx(G.Typography,{variant:"regular",size:"extra-small",appearance:"subtitle",children:Q7(S)})]})]})},S.value)})})]}),f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-1.5 mb-3",children:[f.jsx(ee.TuneOutlined,{sx:{fontSize:16},className:"text-primary-500 dark:text-black-300"}),f.jsx(G.Typography,{variant:"semibold",size:"small",appearance:"title",children:"Additional Options"})]}),f.jsxs("div",{className:"flex items-center justify-between rounded-md border border-neutral-200 dark:border-black-600 bg-neutral-50 dark:bg-black-700 px-3 py-3",children:[f.jsx(G.Typography,{variant:"medium",size:"extra-small",appearance:"title",className:"!text-sm",children:"Highlight changes in document"}),f.jsx(G.Checkbox,{id:"highlight-changes",checked:d,onChange:S=>u(S),size:"small"})]})]})]}),f.jsxs("div",{className:"px-4 py-3 w-full border-t border-gray-200 dark:border-black-600 flex justify-between items-center gap-2 bg-white dark:bg-black-800",children:[f.jsx(G.Button,{id:"anon-settings-cancel-btn",status:"secondary-neutral",appearance:"outline",onClick:t,className:"flex-1 py-1.5 border w-40 border-neutral-300 dark:border-black-500 bg-neutral-50 dark:bg-black-950",children:"Cancel"}),f.jsx(G.Button,{id:"anon-settings-save-btn",status:"primary",isLoading:i.piiAnonymization?.isScanningDocument??!1,onClick:E,className:"flex-1 py-1.5 border w-40 border-primary-300 dark:border-primary-200 bg-primary-50 dark:bg-primary-950",children:"Save Changes"})]})]})},Z7={nm:"Artboard",ddd:0,h:600,w:600,meta:{g:"LottieFiles AE 0.1.20",tc:"#ffffff"},layers:[{ty:4,nm:"Rectangle",sr:1,st:0,op:3600,ip:0,hd:!1,ddd:0,bm:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[0,0,0],ix:1},s:{a:0,k:[100,100,100],ix:6},sk:{a:0,k:0},p:{a:1,k:[{o:{x:.275,y:0},i:{x:.376,y:1},s:[300,485.5,0],t:0,ti:[0,0,0],to:[0,-60,0]},{o:{x:.632,y:0},i:{x:.725,y:1},s:[300,125.5,0],t:110,ti:[0,-60,0],to:[0,0,0]},{s:[300,485.5,0],t:220}],ix:2},r:{a:0,k:0,ix:10},sa:{a:0,k:0},o:{a:0,k:100,ix:11}},ef:[],shapes:[{ty:"gr",bm:0,hd:!1,mn:"ADBE Vector Group",nm:"Rectangle",ix:1,cix:2,np:2,it:[{ty:"rc",bm:0,hd:!1,mn:"ADBE Vector Shape - Rect",nm:"Rectangle Path 1",d:1,p:{a:0,k:[0,0],ix:3},r:{a:0,k:4.5,ix:4},s:{a:0,k:[300,9],ix:2}},{ty:"fl",bm:0,hd:!1,mn:"ADBE Vector Graphic - Fill",nm:"Fill 1",c:{a:0,k:[.0941,.4392,.8431],ix:4},r:1,o:{a:0,k:100,ix:5}},{ty:"tr",a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},sk:{a:0,k:0,ix:4},p:{a:0,k:[0,0],ix:2},r:{a:0,k:0,ix:6},sa:{a:0,k:0,ix:5},o:{a:0,k:100,ix:7}}]}],ind:1},{ty:4,nm:"bottom-grad",sr:1,st:0,op:3600,ip:0,hd:!1,ddd:0,bm:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[0,0,0],ix:1},s:{a:0,k:[100,-100,100],ix:6},sk:{a:0,k:0},p:{a:1,k:[{o:{x:.274,y:0},i:{x:.374,y:1},s:[300,463.5,0],t:1,ti:[0,-7.167,0],to:[0,-52.833,0]},{o:{x:.621,y:0},i:{x:.726,y:1},s:[300,146.5,0],t:111,ti:[0,-60,0],to:[0,7.167,0]},{s:[300,506.5,0],t:221}],ix:2},r:{a:0,k:0,ix:10},sa:{a:0,k:0},o:{a:1,k:[{o:{x:.333,y:0},i:{x:.667,y:1},s:[0],t:120},{o:{x:.333,y:0},i:{x:.667,y:1},s:[40],t:152},{o:{x:.333,y:0},i:{x:.667,y:1},s:[40],t:199},{s:[0],t:218}],ix:11}},ef:[],shapes:[{ty:"gr",bm:0,hd:!1,mn:"ADBE Vector Group",nm:"Rectangle",ix:1,cix:2,np:2,it:[{ty:"rc",bm:0,hd:!1,mn:"ADBE Vector Shape - Rect",nm:"Rectangle Path 1",d:1,p:{a:0,k:[0,0],ix:3},r:{a:0,k:0,ix:4},s:{a:0,k:[300,45],ix:2}},{ty:"gf",bm:0,hd:!1,mn:"ADBE Vector Graphic - G-Fill",nm:"Gradient Fill 1",e:{a:0,k:[0,22.5],ix:6},g:{p:3,k:{a:0,k:[0,.09411764705882353,.4392156862745098,.8431372549019608,.5,.09411764705882353,.4392156862745098,.8431372549019608,1,.09411764705882353,.4392156862745098,.8431372549019608,0,0,.5,.2,1,.4],ix:9}},t:1,a:{a:0,k:0},h:{a:0,k:0},s:{a:0,k:[0,-22.5],ix:5},r:1,o:{a:0,k:100,ix:10}},{ty:"tr",a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},sk:{a:0,k:0,ix:4},p:{a:0,k:[0,0],ix:2},r:{a:0,k:0,ix:6},sa:{a:0,k:0,ix:5},o:{a:0,k:100,ix:7}}]}],ind:2},{ty:4,nm:"top-grad",sr:1,st:0,op:3600,ip:0,hd:!1,ddd:0,bm:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[0,0,0],ix:1},s:{a:0,k:[100,100,100],ix:6},sk:{a:0,k:0},p:{a:1,k:[{o:{x:.271,y:0},i:{x:.376,y:1},s:[300,463.5,0],t:1,ti:[0,0,0],to:[0,-60,0]},{o:{x:.632,y:0},i:{x:.725,y:1},s:[300,103.5,0],t:111,ti:[0,-60,0],to:[0,0,0]},{s:[300,463.5,0],t:221}],ix:2},r:{a:0,k:0,ix:10},sa:{a:0,k:0},o:{a:1,k:[{o:{x:.167,y:0},i:{x:.833,y:1},s:[0],t:0},{o:{x:.333,y:0},i:{x:.667,y:1},s:[40],t:14},{o:{x:.333,y:0},i:{x:.667,y:1},s:[40],t:89},{o:{x:.333,y:0},i:{x:.833,y:1},s:[0],t:108},{s:[0],t:221}],ix:11}},ef:[],shapes:[{ty:"gr",bm:0,hd:!1,mn:"ADBE Vector Group",nm:"Rectangle",ix:1,cix:2,np:2,it:[{ty:"rc",bm:0,hd:!1,mn:"ADBE Vector Shape - Rect",nm:"Rectangle Path 1",d:1,p:{a:0,k:[0,0],ix:3},r:{a:0,k:0,ix:4},s:{a:0,k:[300,45],ix:2}},{ty:"gf",bm:0,hd:!1,mn:"ADBE Vector Graphic - G-Fill",nm:"Gradient Fill 1",e:{a:0,k:[0,22.5],ix:6},g:{p:3,k:{a:0,k:[0,.9490196078431372,.9568627450980393,.9686274509803922,.5,.09411764705882353,.4392156862745098,.8431372549019608,1,.09411764705882353,.4392156862745098,.8431372549019608,0,1,.5,.2,1,.4],ix:9}},t:1,a:{a:0,k:0},h:{a:0,k:0},s:{a:0,k:[0,-22.5],ix:5},r:1,o:{a:0,k:100,ix:10}},{ty:"tr",a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},sk:{a:0,k:0,ix:4},p:{a:0,k:[0,0],ix:2},r:{a:0,k:0,ix:6},sa:{a:0,k:0,ix:5},o:{a:0,k:100,ix:7}}]}],ind:3},{ty:0,nm:"full",sr:1,st:0,op:3600,ip:0,hd:!1,ddd:0,bm:0,hasMask:!0,ao:0,ks:{a:{a:0,k:[300,300,0],ix:1},s:{a:0,k:[100,100,100],ix:6},sk:{a:0,k:0},p:{a:0,k:[300,300,0],ix:2},r:{a:0,k:0,ix:10},sa:{a:0,k:0},o:{a:0,k:100,ix:11}},ef:[],masksProperties:[{nm:"Mask 1",inv:!1,mode:"i",x:{a:0,k:0,ix:4},o:{a:0,k:100,ix:3},pt:{a:1,k:[{o:{x:.272,y:0},i:{x:.364,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[448.801,109],[153,109],[153,479.957],[448.801,479.957]]}],t:0},{o:{x:.631,y:0},i:{x:.73,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[448.801,109],[153,109],[153,129.957],[448.801,129.957]]}],t:110},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[448.801,109],[153,109],[153,479.957],[448.801,479.957]]}],t:220}],ix:1}}],w:600,h:600,refId:"comp_0",ind:4},{ty:0,nm:"trans",sr:1,st:0,op:3600,ip:0,hd:!1,ddd:0,bm:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[300,300,0],ix:1},s:{a:0,k:[100,100,100],ix:6},sk:{a:0,k:0},p:{a:0,k:[300,300,0],ix:2},r:{a:0,k:0,ix:10},sa:{a:0,k:0},o:{a:0,k:100,ix:11}},ef:[],w:600,h:600,refId:"comp_1",ind:5}],v:"5.5.7",fr:60,op:227,ip:0,assets:JSON.parse('[{"nm":"","id":"comp_0","layers":[{"ty":4,"nm":"Rectangle Copy 10","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[274,400.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 3","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[128,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.2196,0.5451,0.9294],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":1},{"ty":4,"nm":"Rectangle Copy 9","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[368.5,302.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 5","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[41,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.2196,0.5451,0.9294],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":2},{"ty":4,"nm":"Rectangle Copy 8","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[348.5,351.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 4","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[81,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.2196,0.5451,0.9294],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":3},{"ty":4,"nm":"Rectangle Copy 7","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[249,351.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 2","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[78,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.2196,0.5451,0.9294],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":4},{"ty":4,"nm":"Rectangle Copy 6","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[270.5,302.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[121,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.2196,0.5451,0.9294],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":5},{"ty":4,"nm":"Rectangle 3","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[255,234.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[90,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.2196,0.5451,0.9294],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":6},{"ty":4,"nm":"Rectangle 2","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[299.89,304.75,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle","ix":1,"cix":2,"np":2,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":19,"ix":4},"s":{"a":0,"k":[245.78,319.5],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.949,0.9569,0.9686],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":7}]},{"nm":"","id":"comp_1","layers":[{"ty":4,"nm":"Rectangle Copy 3","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[274,400.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 3","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[128,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.8824,0.9137,0.949],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":1},{"ty":4,"nm":"Rectangle Copy 5","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[368.5,302.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 5","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[41,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.8824,0.9137,0.949],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":2},{"ty":4,"nm":"Rectangle Copy 4","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[348.5,351.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 4","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[81,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.8824,0.9137,0.949],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":3},{"ty":4,"nm":"Rectangle Copy 2","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[249,351.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy 2","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[78,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.8824,0.9137,0.949],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":4},{"ty":4,"nm":"Rectangle Copy","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[270.5,302.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle Copy","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[121,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.8824,0.9137,0.949],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":5},{"ty":4,"nm":"Rectangle","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[255,234.5,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12.5,"ix":4},"s":{"a":0,"k":[90,25],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.8824,0.9137,0.949],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":6},{"ty":4,"nm":"Rectangle","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[299.89,304.75,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":60,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle","ix":1,"cix":2,"np":2,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":19,"ix":4},"s":{"a":0,"k":[245.78,319.5],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.949,0.9569,0.9686],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":7}]}]')},J7=1e4,Ny=90,e9=600,Ry=30,Gf=13e3,t9={completed:{bgClass:"bg-primary-100 dark:bg-primary-900",border:"border-primary-100 dark:border-primary-900",textClass:"!text-neutral-600 dark:!text-neutral-200"},scanning:{bgClass:"bg-primary-50 dark:bg-primary-950",border:"border-primary-100 dark:border-primary-900",textClass:"!text-neutral-600 dark:!text-neutral-200"},pending:{bgClass:"bg-primary-50/50 dark:bg-primary-975",border:"border-primary-50 dark:border-primary-950",textClass:"!text-neutral-400 dark:!text-neutral-400"}},n9=({status:e})=>e==="completed"?f.jsx(ee.CheckCircle,{sx:{fontSize:16},className:"text-success-600 dark:text-success-400"}):e==="scanning"?f.jsx(ie,{name:"loading",size:16,className:"text-blue-600 dark:text-blue-400 animate-spin"}):f.jsx("div",{className:"w-4 h-4 flex items-center justify-center",children:f.jsx("div",{className:"w-[13px] h-[13px] rounded-full bg-neutral-300 dark:bg-neutral-600"})}),r9=({status:e,label:t})=>{const n=t9[e];return f.jsxs("div",{className:`relative flex items-center gap-2 p-3 rounded-lg border ${n.border} ${n.bgClass} transition-all duration-300 overflow-hidden`,children:[f.jsx(n9,{status:e}),f.jsx(G.Typography,{variant:"medium",size:"small",className:n.textClass,children:t})]})},i9=(e,t)=>{switch(t){case"completed":return`${e.label} identified`;case"scanning":return`Scanning ${e.label.toLowerCase()}...`;case"pending":return`${e.label} pending`}},o9=({detectionConfigs:e,runDocumentScan:t,isScanningDocument:n,onClose:r,onCancel:i,onComplete:o})=>{const[a,s]=A.useState(()=>!!t),[l,c]=A.useState(0),[d,u]=A.useState(0),p=A.useRef(null),m=A.useRef(null),_=A.useRef(o);_.current=o;const h=A.useRef(t);h.current=t;const g=n!==void 0,b=a||n===!0,E=A.useRef(b);E.current=b;const S=A.useRef(0),y=e.length;A.useEffect(()=>{if(!p.current)return;const C=pC.loadAnimation({container:p.current,renderer:"svg",loop:!0,autoplay:!1,animationData:Z7});return m.current=C,()=>{C.destroy(),m.current=null}},[]);const T=g?n===!0:t!=null?a:l<100;A.useEffect(()=>{const C=m.current;C&&(T?C.play():C.pause())},[T]),A.useEffect(()=>{let C=!1;const O=h.current;if(!O){s(!1);return}return(async()=>{try{await O()}catch{}finally{C||s(!1)}})(),()=>{C=!0}},[]),A.useEffect(()=>{if(!g||y===0)return;let C="approaching",O=0,w=0,z=!1;const N=Date.now(),P=setInterval(()=>{if(!z)if(C==="approaching"){if(!E.current){C="completing",O=Date.now(),w=S.current;return}const I=Date.now()-N,R=Math.min(Ny,I/J7*Ny);S.current=R,c(R),u(Math.min(Math.floor(R/100*y),y))}else{const I=Date.now()-O,R=100-w,k=Math.min(100,w+I/e9*R);S.current=k,c(k),u(Math.min(Math.floor(k/100*y),y)),k>=100&&(z=!0,clearInterval(P),_.current?.())}},Ry);return()=>clearInterval(P)},[g,y]),A.useEffect(()=>{!g||y!==0||b||_.current?.()},[g,b,y]),A.useEffect(()=>{if(g||a||y===0)return;const C=Date.now(),O=setInterval(()=>{const w=Date.now()-C,z=Math.min(w/Gf*100,100),N=Math.min(Math.floor(w/Gf*y),y);c(z),u(N),w>=Gf&&(clearInterval(O),_.current?.())},50);return()=>clearInterval(O)},[g,a,y]),A.useEffect(()=>{g||a||y!==0||_.current?.()},[g,a,y]);const x=C=>!g&&a?"pending":C<d?"completed":C===d&&d<y?"scanning":"pending",v=!g&&a;return f.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-black-800",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-black-600",children:[f.jsx(G.Typography,{variant:"semibold",size:"medium",appearance:"title",className:"text-neutral-900 dark:text-neutral-100",children:"PII Anonymization"}),r&&f.jsx(G.IconButton,{id:"pii-scanning-close-btn",variant:"ghost",onClick:r,tooltip:"Close",noborder:!0,className:"text-neutral-600 dark:text-neutral-300 hover:text-neutral-900 dark:hover:text-neutral-100",children:f.jsx(ee.Close,{sx:{fontSize:20}})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto p-5 space-y-4 bg-white dark:bg-black-800",children:[f.jsxs("div",{className:"relative flex flex-col items-center px-4 py-5 gap-3 rounded-lg overflow-hidden bg-gradient-to-br from-primary-50 to-primary-100 dark:from-primary-900 dark:to-primary-800",children:[f.jsx("div",{ref:p,className:"relative z-10 w-12 h-12 bg-white dark:bg-black-700 border border-primary-100 dark:border-black-400 rounded-xl flex items-center justify-center"}),f.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-1",children:[f.jsx(G.Typography,{variant:"semibold",size:"small",appearance:"title",className:"text-neutral-900 dark:text-neutral-100",children:b?"Scanning document…":"Analyzing Document..."}),f.jsx(G.Typography,{variant:"medium",size:"extra-small",appearance:"subtitle",className:"text-neutral-600 dark:text-neutral-300",children:b?"Waiting for server response…":"Detecting sensitive information"})]})]}),f.jsxs("div",{className:"space-y-3",children:[f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsx(G.Typography,{variant:"semibold",size:"small",appearance:"title",className:"text-neutral-900 dark:text-neutral-100",children:"Scanning progress"}),f.jsx("span",{className:"text-sm font-semibold text-primary-600 dark:text-primary-400",children:v?"—":`${Math.round(l)}%`})]}),f.jsx("div",{className:"w-full h-2.5 bg-primary-100 dark:bg-primary-975 rounded-full overflow-hidden",children:v?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"relative h-full w-1/3 rounded-full animate-pulse dark:hidden bg-primary-600","aria-hidden":!0}),f.jsx("div",{className:"relative h-full w-1/3 rounded-full animate-pulse hidden dark:block bg-primary-400","aria-hidden":!0})]}):f.jsxs("div",{className:"relative h-full rounded-full overflow-hidden",style:{width:`${l}%`,transition:`width ${Ry}ms linear`},children:[f.jsx("div",{className:"absolute inset-0 h-full rounded-full dark:hidden bg-primary-600 dark:bg-primary-975 linear-gradient(90deg, #54A4EC 0%, #016DCF 100%)","aria-hidden":!0}),f.jsx("div",{className:"absolute inset-0 h-full rounded-full hidden dark:block bg-primary-600","aria-hidden":!0})]})})]}),f.jsx("div",{className:"space-y-2",children:e.map((C,O)=>{const w=x(O);return f.jsx(r9,{status:w,label:i9(C,w)},C.id)})})]}),f.jsx("div",{className:"px-4 py-4 border-t border-gray-200 dark:border-black-600 bg-white dark:bg-black-800",children:f.jsx(G.Button,{id:"pii-cancel-scan-btn",status:"secondary-neutral",appearance:"outline",onClick:i,className:"w-full py-1.5 border border-neutral-300 dark:border-black-500 bg-neutral-100 dark:bg-black-700 text-neutral-900 dark:text-neutral-100 hover:bg-neutral-200 dark:hover:bg-black-600",children:"Cancel Scan"})})]})};function Ay(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ay(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function a9(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ay(e))&&(r&&(r+=" "),r+=t);return r}const Vf="-",s9=e=>{const t=c9(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const o=i.split(Vf);return o[0]===""&&o.length!==1&&o.shift(),Oy(o,t)||l9(i)},getConflictingClassGroupIds:(i,o)=>{const a=n[i]||[];return o&&r[i]?[...a,...r[i]]:a}}},Oy=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Oy(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(Vf);return t.validators.find(({validator:a})=>a(o))?.classGroupId},Iy=/^\[(.+)\]$/,l9=e=>{if(Iy.test(e)){const t=Iy.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},c9=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const i in n)Yf(n[i],r,i,t);return r},Yf=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:ky(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(d9(i)){Yf(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{Yf(a,ky(t,o),n,r)})})},ky=(e,t)=>{let n=e;return t.split(Vf).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},d9=e=>e.isThemeGetter,u9=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set(o,a){n.has(o)?n.set(o,a):i(o,a)}}},$f="!",Wf=":",p9=Wf.length,m9=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let a=0,s=0,l=0,c;for(let _=0;_<i.length;_++){let h=i[_];if(a===0&&s===0){if(h===Wf){o.push(i.slice(l,_)),l=_+p9;continue}if(h==="/"){c=_;continue}}h==="["?a++:h==="]"?a--:h==="("?s++:h===")"&&s--}const d=o.length===0?i:i.substring(l),u=f9(d),p=u!==d,m=c&&c>l?c-l:void 0;return{modifiers:o,hasImportantModifier:p,baseClassName:u,maybePostfixModifierPosition:m}};if(t){const i=t+Wf,o=r;r=a=>a.startsWith(i)?o(a.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},f9=e=>e.endsWith($f)?e.substring(0,e.length-1):e.startsWith($f)?e.substring(1):e,_9=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const r=[];let i=[];return n.forEach(o=>{o[0]==="["||t[o]?(r.push(...i.sort(),o),i=[]):i.push(o)}),r.push(...i.sort()),r}},h9=e=>({cache:u9(e.cacheSize),parseClassName:m9(e),sortModifiers:_9(e),...s9(e)}),g9=/\s+/,b9=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,a=[],s=e.trim().split(g9);let l="";for(let c=s.length-1;c>=0;c-=1){const d=s[c],{isExternal:u,modifiers:p,hasImportantModifier:m,baseClassName:_,maybePostfixModifierPosition:h}=n(d);if(u){l=d+(l.length>0?" "+l:l);continue}let g=!!h,b=r(g?_.substring(0,h):_);if(!b){if(!g){l=d+(l.length>0?" "+l:l);continue}if(b=r(_),!b){l=d+(l.length>0?" "+l:l);continue}g=!1}const E=o(p).join(":"),S=m?E+$f:E,y=S+b;if(a.includes(y))continue;a.push(y);const T=i(b,g);for(let x=0;x<T.length;++x){const v=T[x];a.push(S+v)}l=d+(l.length>0?" "+l:l)}return l};function E9(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=wy(t))&&(r&&(r+=" "),r+=n);return r}const wy=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=wy(e[r]))&&(n&&(n+=" "),n+=t);return n};function S9(e,...t){let n,r,i,o=a;function a(l){const c=t.reduce((d,u)=>u(d),e());return n=h9(c),r=n.cache.get,i=n.cache.set,o=s,s(l)}function s(l){const c=r(l);if(c)return c;const d=b9(l,n);return i(l,d),d}return function(){return o(E9.apply(null,arguments))}}const zt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},My=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Dy=/^\((?:(\w[\w-]*):)?(.+)\)$/i,T9=/^\d+\/\d+$/,y9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,C9=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,v9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,x9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,N9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,sa=e=>T9.test(e),Be=e=>!!e&&!Number.isNaN(Number(e)),Ci=e=>!!e&&Number.isInteger(Number(e)),qf=e=>e.endsWith("%")&&Be(e.slice(0,-1)),qr=e=>y9.test(e),R9=()=>!0,A9=e=>C9.test(e)&&!v9.test(e),Ly=()=>!1,O9=e=>x9.test(e),I9=e=>N9.test(e),k9=e=>!me(e)&&!fe(e),w9=e=>la(e,zy,Ly),me=e=>My.test(e),oo=e=>la(e,Hy,A9),jf=e=>la(e,B9,Be),Py=e=>la(e,Fy,Ly),M9=e=>la(e,Uy,I9),Ud=e=>la(e,Gy,O9),fe=e=>Dy.test(e),Ls=e=>ca(e,Hy),D9=e=>ca(e,F9),By=e=>ca(e,Fy),L9=e=>ca(e,zy),P9=e=>ca(e,Uy),zd=e=>ca(e,Gy,!0),la=(e,t,n)=>{const r=My.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ca=(e,t,n=!1)=>{const r=Dy.exec(e);return r?r[1]?t(r[1]):n:!1},Fy=e=>e==="position"||e==="percentage",Uy=e=>e==="image"||e==="url",zy=e=>e==="length"||e==="size"||e==="bg-size",Hy=e=>e==="length",B9=e=>e==="number",F9=e=>e==="family-name",Gy=e=>e==="shadow",U9=()=>{const e=zt("color"),t=zt("font"),n=zt("text"),r=zt("font-weight"),i=zt("tracking"),o=zt("leading"),a=zt("breakpoint"),s=zt("container"),l=zt("spacing"),c=zt("radius"),d=zt("shadow"),u=zt("inset-shadow"),p=zt("text-shadow"),m=zt("drop-shadow"),_=zt("blur"),h=zt("perspective"),g=zt("aspect"),b=zt("ease"),E=zt("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...y(),fe,me],x=()=>["auto","hidden","clip","visible","scroll"],v=()=>["auto","contain","none"],C=()=>[fe,me,l],O=()=>[sa,"full","auto",...C()],w=()=>[Ci,"none","subgrid",fe,me],z=()=>["auto",{span:["full",Ci,fe,me]},Ci,fe,me],N=()=>[Ci,"auto",fe,me],P=()=>["auto","min","max","fr",fe,me],I=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],R=()=>["start","end","center","stretch","center-safe","end-safe"],k=()=>["auto",...C()],M=()=>[sa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],B=()=>[e,fe,me],D=()=>[...y(),By,Py,{position:[fe,me]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],H=()=>["auto","cover","contain",L9,w9,{size:[fe,me]}],V=()=>[qf,Ls,oo],j=()=>["","none","full",c,fe,me],W=()=>["",Be,Ls,oo],oe=()=>["solid","dashed","dotted","double"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>[Be,qf,By,Py],se=()=>["","none",_,fe,me],be=()=>["none",Be,fe,me],pe=()=>["none",Be,fe,me],He=()=>[Be,fe,me],te=()=>[sa,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[qr],breakpoint:[qr],color:[R9],container:[qr],"drop-shadow":[qr],ease:["in","out","in-out"],font:[k9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[qr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[qr],shadow:[qr],spacing:["px",Be],text:[qr],"text-shadow":[qr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",sa,me,fe,g]}],container:["container"],columns:[{columns:[Be,me,fe,s]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:T()}],overflow:[{overflow:x()}],"overflow-x":[{"overflow-x":x()}],"overflow-y":[{"overflow-y":x()}],overscroll:[{overscroll:v()}],"overscroll-x":[{"overscroll-x":v()}],"overscroll-y":[{"overscroll-y":v()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{start:O()}],end:[{end:O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[Ci,"auto",fe,me]}],basis:[{basis:[sa,"full","auto",s,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Be,sa,"auto","initial","none",me]}],grow:[{grow:["",Be,fe,me]}],shrink:[{shrink:["",Be,fe,me]}],order:[{order:[Ci,"first","last","none",fe,me]}],"grid-cols":[{"grid-cols":w()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":w()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":P()}],"auto-rows":[{"auto-rows":P()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...I(),"normal"]}],"justify-items":[{"justify-items":[...R(),"normal"]}],"justify-self":[{"justify-self":["auto",...R()]}],"align-content":[{content:["normal",...I()]}],"align-items":[{items:[...R(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...R(),{baseline:["","last"]}]}],"place-content":[{"place-content":I()}],"place-items":[{"place-items":[...R(),"baseline"]}],"place-self":[{"place-self":["auto",...R()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:M()}],w:[{w:[s,"screen",...M()]}],"min-w":[{"min-w":[s,"screen","none",...M()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...M()]}],h:[{h:["screen","lh",...M()]}],"min-h":[{"min-h":["screen","lh","none",...M()]}],"max-h":[{"max-h":["screen","lh",...M()]}],"font-size":[{text:["base",n,Ls,oo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,fe,jf]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qf,me]}],"font-family":[{font:[D9,me,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,fe,me]}],"line-clamp":[{"line-clamp":[Be,"none",fe,jf]}],leading:[{leading:[o,...C()]}],"list-image":[{"list-image":["none",fe,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",fe,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Be,"from-font","auto",fe,oo]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Be,"auto",fe,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fe,me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",fe,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:H()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ci,fe,me],radial:["",fe,me],conic:[Ci,fe,me]},P9,M9]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:V()}],"gradient-via-pos":[{via:V()}],"gradient-to-pos":[{to:V()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:j()}],"rounded-s":[{"rounded-s":j()}],"rounded-e":[{"rounded-e":j()}],"rounded-t":[{"rounded-t":j()}],"rounded-r":[{"rounded-r":j()}],"rounded-b":[{"rounded-b":j()}],"rounded-l":[{"rounded-l":j()}],"rounded-ss":[{"rounded-ss":j()}],"rounded-se":[{"rounded-se":j()}],"rounded-ee":[{"rounded-ee":j()}],"rounded-es":[{"rounded-es":j()}],"rounded-tl":[{"rounded-tl":j()}],"rounded-tr":[{"rounded-tr":j()}],"rounded-br":[{"rounded-br":j()}],"rounded-bl":[{"rounded-bl":j()}],"border-w":[{border:W()}],"border-w-x":[{"border-x":W()}],"border-w-y":[{"border-y":W()}],"border-w-s":[{"border-s":W()}],"border-w-e":[{"border-e":W()}],"border-w-t":[{"border-t":W()}],"border-w-r":[{"border-r":W()}],"border-w-b":[{"border-b":W()}],"border-w-l":[{"border-l":W()}],"divide-x":[{"divide-x":W()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":W()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...oe(),"hidden","none"]}],"divide-style":[{divide:[...oe(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Be,fe,me]}],"outline-w":[{outline:["",Be,Ls,oo]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",d,zd,Ud]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",u,zd,Ud]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Be,oo]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":W()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",p,zd,Ud]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Be,fe,me]}],"mix-blend":[{"mix-blend":[...Z(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Z()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Be]}],"mask-image-linear-from-pos":[{"mask-linear-from":X()}],"mask-image-linear-to-pos":[{"mask-linear-to":X()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":X()}],"mask-image-t-to-pos":[{"mask-t-to":X()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":X()}],"mask-image-r-to-pos":[{"mask-r-to":X()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":X()}],"mask-image-b-to-pos":[{"mask-b-to":X()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":X()}],"mask-image-l-to-pos":[{"mask-l-to":X()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":X()}],"mask-image-x-to-pos":[{"mask-x-to":X()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":X()}],"mask-image-y-to-pos":[{"mask-y-to":X()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[fe,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":X()}],"mask-image-radial-to-pos":[{"mask-radial-to":X()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":y()}],"mask-image-conic-pos":[{"mask-conic":[Be]}],"mask-image-conic-from-pos":[{"mask-conic-from":X()}],"mask-image-conic-to-pos":[{"mask-conic-to":X()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:H()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",fe,me]}],filter:[{filter:["","none",fe,me]}],blur:[{blur:se()}],brightness:[{brightness:[Be,fe,me]}],contrast:[{contrast:[Be,fe,me]}],"drop-shadow":[{"drop-shadow":["","none",m,zd,Ud]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Be,fe,me]}],"hue-rotate":[{"hue-rotate":[Be,fe,me]}],invert:[{invert:["",Be,fe,me]}],saturate:[{saturate:[Be,fe,me]}],sepia:[{sepia:["",Be,fe,me]}],"backdrop-filter":[{"backdrop-filter":["","none",fe,me]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[Be,fe,me]}],"backdrop-contrast":[{"backdrop-contrast":[Be,fe,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Be,fe,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Be,fe,me]}],"backdrop-invert":[{"backdrop-invert":["",Be,fe,me]}],"backdrop-opacity":[{"backdrop-opacity":[Be,fe,me]}],"backdrop-saturate":[{"backdrop-saturate":[Be,fe,me]}],"backdrop-sepia":[{"backdrop-sepia":["",Be,fe,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",fe,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Be,"initial",fe,me]}],ease:[{ease:["linear","initial",b,fe,me]}],delay:[{delay:[Be,fe,me]}],animate:[{animate:["none",E,fe,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,fe,me]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:be()}],"rotate-x":[{"rotate-x":be()}],"rotate-y":[{"rotate-y":be()}],"rotate-z":[{"rotate-z":be()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:He()}],"skew-x":[{"skew-x":He()}],"skew-y":[{"skew-y":He()}],transform:[{transform:[fe,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:te()}],"translate-x":[{"translate-x":te()}],"translate-y":[{"translate-y":te()}],"translate-z":[{"translate-z":te()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",fe,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",fe,me]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Be,Ls,oo,jf]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},z9=S9(U9);function H9(...e){return z9(a9(e))}const G9="0 0 24 24",V9=14;function Vy(e,t){const n=A.forwardRef(({size:r=V9,color:i,className:o,style:a,...s},l)=>f.jsx("svg",{ref:l,xmlns:"http://www.w3.org/2000/svg",width:r,height:r,viewBox:G9,fill:"none","aria-hidden":"true",className:H9("text-neutral-900 dark:text-neutral-50",o),...s,dangerouslySetInnerHTML:{__html:t}}));return n.displayName=e,n}const Y9=Vy("VisibilityOffIcon",'<path d="M15.175 8.3251C15.6583 8.80843 16.0083 9.35843 16.225 9.9751C16.4583 10.5918 16.5417 11.2251 16.475 11.8751C16.475 12.1251 16.3833 12.3418 16.2 12.5251C16.0167 12.6918 15.8 12.7751 15.55 12.7751C15.3 12.7751 15.0833 12.6918 14.9 12.5251C14.7333 12.3418 14.65 12.1251 14.65 11.8751C14.7333 11.4418 14.7083 11.0251 14.575 10.6251C14.4417 10.2251 14.2333 9.88343 13.95 9.6001C13.6667 9.31676 13.325 9.1001 12.925 8.9501C12.525 8.8001 12.1 8.76676 11.65 8.8501C11.4 8.8501 11.1833 8.75843 11 8.5751C10.8333 8.39176 10.75 8.1751 10.75 7.9251C10.75 7.6751 10.8333 7.46676 11 7.3001C11.1833 7.11676 11.4 7.0251 11.65 7.0251C12.2833 6.95843 12.9083 7.04176 13.525 7.2751C14.1417 7.49176 14.6917 7.84176 15.175 8.3251ZM12 6.0001C11.6833 6.0001 11.375 6.01676 11.075 6.0501C10.775 6.06676 10.475 6.10843 10.175 6.1751C9.89167 6.2251 9.63333 6.18343 9.4 6.0501C9.18333 5.91676 9.03333 5.71676 8.95 5.4501C8.86667 5.18343 8.89167 4.9251 9.025 4.6751C9.175 4.4251 9.38333 4.2751 9.65 4.2251C10.0333 4.14176 10.4167 4.08343 10.8 4.0501C11.2 4.01676 11.6 4.0001 12 4.0001C14.2833 4.0001 16.3667 4.6001 18.25 5.8001C20.15 7.0001 21.6 8.61676 22.6 10.6501C22.6667 10.7834 22.7167 10.9251 22.75 11.0751C22.7833 11.2084 22.8 11.3501 22.8 11.5001C22.8 11.6501 22.7833 11.8001 22.75 11.9501C22.7333 12.0834 22.6917 12.2168 22.625 12.3501C22.325 13.0168 21.95 13.6418 21.5 14.2251C21.0667 14.8084 20.5833 15.3418 20.05 15.8251C19.85 16.0084 19.6167 16.0834 19.35 16.0501C19.0833 16.0168 18.8667 15.8834 18.7 15.6501C18.5333 15.4168 18.4583 15.1668 18.475 14.9001C18.5083 14.6168 18.625 14.3834 18.825 14.2001C19.225 13.8168 19.5917 13.4001 19.925 12.9501C20.2583 12.5001 20.55 12.0168 20.8 11.5001C19.9667 9.81676 18.7583 8.48343 17.175 7.5001C15.6083 6.5001 13.8833 6.0001 12 6.0001ZM12 19.0001C9.76667 19.0001 7.725 18.4001 5.875 17.2001C4.025 15.9834 2.56667 14.3918 1.5 12.4251C1.41667 12.2918 1.35 12.1501 1.3 12.0001C1.26667 11.8334 1.25 11.6668 1.25 11.5001C1.25 11.3334 1.26667 11.1751 1.3 11.0251C1.33333 10.8751 1.39167 10.7251 1.475 10.5751C1.80833 9.90843 2.19167 9.2751 2.625 8.6751C3.075 8.05843 3.58333 7.5001 4.15 7.0001L2.075 4.9001C1.89167 4.7001 1.8 4.46676 1.8 4.2001C1.81667 3.91676 1.91667 3.68343 2.1 3.5001C2.28333 3.31676 2.51667 3.2251 2.8 3.2251C3.08333 3.2251 3.31667 3.31676 3.5 3.5001L20.5 20.5001C20.6833 20.6834 20.775 20.9168 20.775 21.2001C20.7917 21.4668 20.7 21.7001 20.5 21.9001C20.3167 22.0834 20.0833 22.1751 19.8 22.1751C19.5167 22.1751 19.2833 22.0834 19.1 21.9001L15.6 18.4501C15.0167 18.6334 14.425 18.7751 13.825 18.8751C13.225 18.9584 12.6167 19.0001 12 19.0001ZM5.55 8.4001C5.06667 8.83343 4.625 9.30843 4.225 9.8251C3.825 10.3418 3.48333 10.9001 3.2 11.5001C4.03333 13.1834 5.23333 14.5251 6.8 15.5251C8.38333 16.5084 10.1167 17.0001 12 17.0001C12.3333 17.0001 12.6583 16.9834 12.975 16.9501C13.2917 16.9001 13.6167 16.8501 13.95 16.8001L13.05 15.8501C12.8667 15.9001 12.6917 15.9418 12.525 15.9751C12.3583 15.9918 12.1833 16.0001 12 16.0001C10.75 16.0001 9.68333 15.5668 8.8 14.7001C7.93333 13.8168 7.5 12.7501 7.5 11.5001C7.5 11.3168 7.50833 11.1418 7.525 10.9751C7.55833 10.8084 7.6 10.6334 7.65 10.4501L5.55 8.4001Z" fill="currentColor"/>'),$9=Vy("VisibilityIcon",'<path d="M12 16C13.25 16 14.3084 15.5667 15.175 14.7C16.0584 13.8167 16.5 12.75 16.5 11.5C16.5 10.25 16.0584 9.19167 15.175 8.325C14.3084 7.44167 13.25 7 12 7C10.75 7 9.68336 7.44167 8.80002 8.325C7.93336 9.19167 7.50003 10.25 7.50003 11.5C7.50003 12.75 7.93336 13.8167 8.80002 14.7C9.68336 15.5667 10.75 16 12 16ZM12 14.2C11.25 14.2 10.6084 13.9417 10.075 13.425C9.55836 12.8917 9.30002 12.25 9.30002 11.5C9.30002 10.75 9.55836 10.1167 10.075 9.6C10.6084 9.06667 11.25 8.8 12 8.8C12.75 8.8 13.3834 9.06667 13.9 9.6C14.4334 10.1167 14.7 10.75 14.7 11.5C14.7 12.25 14.4334 12.8917 13.9 13.425C13.3834 13.9417 12.75 14.2 12 14.2ZM12 19C9.76669 19 7.72502 18.4 5.87502 17.2C4.04169 16 2.59169 14.4167 1.52502 12.45C1.44169 12.3 1.37502 12.15 1.32502 12C1.29169 11.8333 1.27502 11.6667 1.27502 11.5C1.27502 11.3333 1.29169 11.175 1.32502 11.025C1.37502 10.8583 1.44169 10.7 1.52502 10.55C2.59169 8.58333 4.04169 7 5.87502 5.8C7.72502 4.6 9.76669 4 12 4C14.2334 4 16.2667 4.6 18.1 5.8C19.95 7 21.4084 8.58333 22.475 10.55C22.5584 10.7 22.6167 10.8583 22.65 11.025C22.7 11.175 22.725 11.3333 22.725 11.5C22.725 11.6667 22.7 11.8333 22.65 12C22.6167 12.15 22.5584 12.3 22.475 12.45C21.4084 14.4167 19.95 16 18.1 17.2C16.2667 18.4 14.2334 19 12 19ZM12 17C13.8834 17 15.6084 16.5083 17.175 15.525C18.7584 14.525 19.9667 13.1833 20.8 11.5C19.9667 9.81667 18.7584 8.48333 17.175 7.5C15.6084 6.5 13.8834 6 12 6C10.1167 6 8.38336 6.5 6.80002 7.5C5.23336 8.48333 4.03336 9.81667 3.20002 11.5C4.03336 13.1833 5.23336 14.525 6.80002 15.525C8.38336 16.5083 10.1167 17 12 17Z" fill="currentColor"/>');function Ps(e){if(Array.isArray(e))return e;if(typeof e=="string"&&e.trim())try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{}return[]}function Hd(e,t){if(!t)return!0;const r=Ps(e)[0]?.anonymizedVariable??"";return t.has(r)}function Kf(e,t,n){const{state:r}=e,{tr:i,schema:o}=r,a=o.marks.anonymizedLink,s=[],l=[];r.doc.descendants((c,d)=>{if(c.type.name==="anonymizedText"){if(c.attrs.showValue===t)return;const u=c.attrs.anonymizedData;if(!Hd(u,n))return;s.push({pos:d,attrs:{...c.attrs,showValue:t}});return}if(a&&c.isText){const u=c.marks.find(p=>p.type===a);if(!u||u.attrs.showValue===t||!Hd(u.attrs.anonymizedData,n))return;l.push({from:d,to:d+c.nodeSize,attrs:u.attrs})}});for(const{pos:c,attrs:d}of s)i.setNodeMarkup(i.mapping.map(c),void 0,d);if(a)for(const{from:c,to:d,attrs:u}of l){const p=i.mapping.map(c),m=i.mapping.map(d);i.removeMark(p,m,a),i.addMark(p,m,a.create({...u,showValue:t}))}i.docChanged&&e.view.dispatch(i)}function Yy(e,t){const{state:n}=e,{tr:r,schema:i}=n,o=i.marks.anonymizedLink,a=i.marks.link;if(!o||!a)return;const s=[];if(n.doc.descendants((l,c)=>{if(!l.isText)return;const d=l.marks.find(u=>u.type===o);d&&Hd(d.attrs.anonymizedData,t)&&s.push({from:c,to:c+l.nodeSize,attrs:d.attrs})}),s.length!==0){for(const{from:l,to:c,attrs:d}of s){const p=Ps(d.anonymizedData)[0]?.value??d.href??null;r.removeMark(l,c,o),r.addMark(l,c,a.create({href:p,target:d.target??null,rel:d.rel??null,class:d.class??null}))}r.docChanged&&e.view.dispatch(r)}}function $y(e,t){const{state:n}=e,{tr:r}=n,i=[];n.doc.descendants((o,a)=>{if(o.type.name!=="anonymizedText")return;const s=o.attrs.anonymizedData;if(!Hd(s,t))return;let l=o.attrs.placeholder;try{const c=JSON.parse(s);c[0]?.value&&(l=c[0].value)}catch{}i.push({from:a,to:a+o.nodeSize,text:l})});for(let o=i.length-1;o>=0;o--){const{from:a,to:s,text:l}=i[o];r.replaceWith(a,s,n.schema.text(l))}r.docChanged&&e.view.dispatch(r)}function Wy(e,t){const r=Ps(t)[0];if(!r?.anonymizedVariable)return;const i=YT(t),o=r.anonymizedVariable,a=r.value??"";e[i]||(e[i]=[]);const s=e[i].find(l=>l[o]!==void 0);s?s.count=(typeof s.count=="number"?s.count:1)+1:e[i].push({[o]:a,count:1})}function qy(e){const t={},n=e.state.schema.marks.anonymizedLink;return e.state.doc.descendants(r=>{if(r.type.name==="anonymizedText"){Wy(t,r.attrs.anonymizedData);return}if(n&&r.isText){const i=r.marks.find(a=>a.type===n);if(!i)return;const o=JSON.stringify(Ps(i.attrs.anonymizedData));Wy(t,o)}}),t}function jy(e,t){const n=t?.revealState??"placeholder",r=new Set,i=e.state.schema.marks.anonymizedLink,o=(a,s)=>{if(n==="placeholder"&&s||n==="revealed"&&!s)return;const c=Ps(a)[0]?.anonymizedVariable;c&&r.add(c)};return e.state.doc.descendants(a=>{if(a.type.name==="anonymizedText"){o(a.attrs.anonymizedData,a.attrs.showValue===!0);return}if(i&&a.isText){const s=a.marks.find(l=>l.type===i);if(!s)return;o(s.attrs.anonymizedData,s.attrs.showValue===!0)}}),r}function Ky(e,t){const n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return`rgba(${n},${r},${i},${t})`}function Qf(e,t){return e.replace(/[\d.]+\)$/,`${t})`)}const Qy={...Object.fromEntries(Object.entries(Td).map(([e,t])=>[e,{light:{bg:`linear-gradient(90deg, ${t.bg} 0%, ${Ky(t.bg,.6)} 100%)`,border:Ky(t.color,.25)},dark:{bg:`linear-gradient(90deg, ${Qf(t.darkBg,.18)} 0%, ${Qf(t.darkBg,.06)} 100%)`,border:Qf(t.darkBg,.4)}}])),default:{light:{bg:"linear-gradient(90deg, #F9FAFB 0%, rgba(249,250,251,0.6) 100%)",border:"#E5E7EB"},dark:{bg:"linear-gradient(90deg, rgba(148,163,184,0.12) 0%, rgba(148,163,184,0.04) 100%)",border:"rgba(148,163,184,0.35)"}}},W9={person:{iconName:"person",label:"Person"},organization:{iconName:"apartment",label:"Organization"},email:{iconName:"email",label:"Email"},phone:{iconName:"phone",label:"Phone"},location:{iconName:"public",label:"Location"},date:{iconName:"calendar_month",label:"Date"},time:{iconName:"schedule",label:"Time"},money:{iconName:"payments",label:"Money"},url:{iconName:"link",label:"URL"}},Gd={light:{bg:"linear-gradient(90deg, #ECFDF3 0%, rgba(236,253,243,0.6) 100%)",border:"#D1FADF"},dark:{bg:"linear-gradient(90deg, rgba(34,197,94,0.2) 0%, rgba(34,197,94,0.08) 100%)",border:"rgba(34,197,94,0.45)"}};function q9(e,t){return Object.entries(e).filter(([,n])=>n.length>0).map(([n,r],i)=>{const o=n.toLowerCase(),a=W9[o],s=Td[o],l=t.find(d=>d.label.toLowerCase()===o||d.id.toLowerCase()===o)??{id:o.replace(/\s+/g,"_"),label:a?.label??n.charAt(0).toUpperCase()+n.slice(1),iconName:a?.iconName??"tag",iconColor:s?.color??"text-neutral-500",bgColor:"bg-neutral-100 dark:bg-neutral-800",settingsLabel:a?.label??n},c=[];return r.forEach((d,u)=>{const p=typeof d.count=="number"?d.count:Number(d.count??1);Object.entries(d).filter(([m])=>m!=="count").forEach(([m,_],h)=>{const g=m.startsWith("[")&&m.endsWith("]")?m.slice(1,-1):m;c.push({id:`api-${i}-${u}-${h}`,replacement:g,original:String(_),occurrences:p})})}),{config:l,entities:c}})}const j9=({entity:e,isSelected:t,onToggle:n,isApplied:r})=>r?f.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 rounded-md hover:bg-neutral-50 dark:hover:bg-black-700/50 transition-colors",children:[f.jsxs("div",{className:"flex items-center gap-1.5 flex-1 min-w-0",children:[f.jsx("span",{className:"text-xs font-medium text-primary-600 dark:text-primary-400 cursor-pointer whitespace-nowrap",title:e.replacement,children:e.replacement}),f.jsx("span",{className:"text-neutral-400 dark:text-neutral-500 text-xs shrink-0",children:"←"}),f.jsx("span",{className:"text-xs font-medium text-neutral-700 dark:text-neutral-300 truncate cursor-pointer",title:e.original,children:e.original})]}),f.jsxs("span",{className:"bg-neutral-100 dark:bg-neutral-800 rounded-lg px-1.5 py-0.5 text-xs font-medium text-neutral-600 dark:text-neutral-400 shrink-0",children:[e.occurrences," replacement",e.occurrences!==1?"s":""]})]}):f.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-md hover:bg-neutral-50 dark:hover:bg-black-700/50 transition-colors",children:[f.jsx(G.Checkbox,{id:`entity-${e.id}`,checked:t,onChange:i=>n(e.id,i),size:"small"}),f.jsxs("div",{className:"flex items-center gap-1.5 flex-1 min-w-0 max-w-[190px]",children:[f.jsx("span",{className:"text-xs font-medium text-neutral-800 dark:text-neutral-200 truncate cursor-pointer",title:e.original,children:e.original}),f.jsx("span",{className:"text-neutral-400 dark:text-neutral-500 text-xs shrink-0",children:"→"}),f.jsx("span",{className:"text-xs font-medium text-primary-600 dark:text-primary-400 cursor-pointer whitespace-nowrap",title:e.replacement,children:e.replacement})]}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs("span",{className:"bg-neutral-100 dark:bg-neutral-800 rounded-lg px-1.5 py-0.5 text-xs font-medium text-neutral-600 dark:text-neutral-400",children:[e.occurrences," times"]}),f.jsx("button",{type:"button",className:"rounded pb-1 text-neutral-400 dark:text-neutral-500 hover:text-neutral-600 dark:hover:text-neutral-300 focus-visible:outline focus-visible:ring-2 focus-visible:ring-primary-500 dark:focus-visible:ring-primary-400 transition-colors","aria-label":"Locate in document",children:f.jsx(ee.GpsFixed,{sx:{fontSize:16}})})]})]}),K9=({category:e,isExpanded:t,onToggleExpand:n,selectedIds:r,onToggleEntity:i,isApplied:o})=>{const a=Qy[e.config.id]??Qy.default,s=e.entities;return s.length===0?null:f.jsxs("div",{className:"rounded-lg overflow-hidden relative border border-transparent",children:[f.jsx("div",{className:"absolute inset-0 rounded-lg border pointer-events-none dark:hidden",style:{borderColor:a.light.border},"aria-hidden":!0}),f.jsx("div",{className:"absolute inset-0 rounded-lg border pointer-events-none hidden dark:block",style:{borderColor:a.dark.border},"aria-hidden":!0}),f.jsxs("button",{type:"button",className:"relative w-full flex items-center justify-between px-3 py-2.5 focus-visible:outline focus-visible:ring-2 focus-visible:ring-primary-500 dark:focus-visible:ring-primary-400 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-black-800 rounded-t-lg transition-colors",onClick:n,children:[f.jsx("div",{className:"absolute inset-0 dark:hidden",style:{background:a.light.bg},"aria-hidden":!0}),f.jsx("div",{className:"absolute inset-0 hidden dark:block",style:{background:a.dark.bg},"aria-hidden":!0}),f.jsxs("div",{className:"relative z-10 flex items-center gap-2 w-full justify-between",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(ie,{name:e.config.iconName,size:16,className:e.config.iconColor.startsWith("text-")?e.config.iconColor:"",fillColor:e.config.iconColor.startsWith("#")?e.config.iconColor:void 0}),f.jsx("span",{className:"text-xs font-semibold text-neutral-800 dark:text-neutral-200",children:e.config.label}),f.jsx("span",{className:"text-xs font-medium text-neutral-600 dark:text-neutral-400 bg-neutral-100 dark:bg-neutral-800 rounded-full px-2 border border-neutral-300 dark:border-neutral-600",children:s.length})]}),f.jsx(ee.KeyboardArrowUp,{sx:{fontSize:14},className:`text-neutral-400 dark:text-neutral-500 transition-transform shrink-0 ${t?"":"rotate-180"}`})]})]}),t&&f.jsx("div",{className:"bg-white dark:bg-black-800 border-t border-neutral-200 dark:border-black-600 divide-y divide-neutral-100 dark:divide-black-600",children:s.map(l=>f.jsx(j9,{entity:l,isSelected:r.has(l.id),onToggle:i,isApplied:o},l.id))})]})},Q9=({detectionConfigs:e,onClose:t,onApply:n,onRevertAnonymization:r})=>{const{editor:i,editorConfig:o}=lt(),[a,s]=A.useState(o.piiAnonymization?.isAnonymized??!1),[l,c]=A.useState(!1),[d,u]=A.useState(()=>i?qy(i):{});A.useEffect(()=>{s(o.piiAnonymization?.isAnonymized??!1)},[o.piiAnonymization?.isAnonymized]),A.useEffect(()=>{if(!i)return;const v=()=>u(qy(i));v();const C=({transaction:O})=>{O.docChanged&&v()};return i.on("transaction",C),()=>{i.off("transaction",C)}},[i]);const p=A.useMemo(()=>Object.keys(d).length===0?[]:q9(d,e),[d,e]),m=A.useMemo(()=>p.flatMap(v=>v.entities.map(C=>C.id)),[p]),_=m.length,h=a?_:0,[g,b]=A.useState(()=>new Set(m)),[E,S]=A.useState(()=>new Set(p.map(v=>v.config.id)));A.useEffect(()=>{const v=new Set(m);b(C=>{const O=new Set;for(const w of v)(C.size===0||C.has(w))&&O.add(w);return O.size===C.size&&[...O].every(w=>C.has(w))?C:O})},[m]),A.useEffect(()=>{const v=p.map(C=>C.config.id);S(C=>C.size>0?C:new Set(v))},[p]);const y=A.useCallback((v,C)=>{b(O=>{const w=new Set(O);return C?w.add(v):w.delete(v),w})},[]),T=A.useCallback(()=>{const v=g.size===_;b(v?new Set:new Set(m))},[g.size,_,m]),x=A.useCallback(v=>{S(C=>{const O=new Set(C);return O.has(v)?O.delete(v):O.add(v),O})},[]);return A.useEffect(()=>{if(!i||!a)return;const v=()=>{c(jy(i,{revealState:"revealed"}).size>0)};return v(),i.on("update",v),()=>{i.off("update",v)}},[i,a]),f.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-black-800",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-black-600",children:[f.jsx(G.Typography,{variant:"semibold",size:"medium",appearance:"title",className:"text-neutral-900 dark:text-neutral-100",children:"PII Anonymization"}),t&&f.jsx(G.IconButton,{id:"pii-results-close-btn",variant:"ghost",onClick:t,tooltip:"Close",noborder:!0,className:"text-neutral-600 dark:text-neutral-300 hover:text-neutral-900 dark:hover:text-neutral-100",children:f.jsx(ee.Close,{sx:{fontSize:20}})})]}),f.jsx("div",{className:"flex-1 overflow-y-auto p-5 space-y-4 bg-white dark:bg-black-800 scrollbar-dark",children:_===0&&!a?f.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[f.jsx(ie,{name:"seal",size:48,strokeWidth:1.5,className:"text-success-500 dark:text-success-400 mb-4"}),f.jsx(G.Typography,{variant:"semibold",size:"small",appearance:"title",className:"mb-1 text-neutral-800 dark:text-neutral-200",children:"No Sensitive Data Found"}),f.jsx(G.Typography,{variant:"regular",size:"extra-small",appearance:"subtitle",className:"max-w-[220px]",children:"Your document doesn't contain any personally identifiable information to anonymize."})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"relative flex items-center gap-3 px-4 py-3 rounded-xl border border-transparent",children:[f.jsx("div",{className:"absolute inset-0 rounded-xl border dark:hidden",style:{background:Gd.light.bg,borderColor:Gd.light.border},"aria-hidden":!0}),f.jsx("div",{className:"absolute inset-0 rounded-xl border hidden dark:block",style:{background:Gd.dark.bg,borderColor:Gd.dark.border},"aria-hidden":!0}),f.jsx("div",{className:"relative z-10 flex items-center gap-3 w-full",children:a?f.jsxs(f.Fragment,{children:[f.jsx(ie,{name:"seal",size:24,strokeWidth:2,className:"text-success-700 dark:text-success-300 shrink-0"}),f.jsxs("div",{children:[f.jsx(G.Typography,{variant:"semibold",size:"small",className:"!text-success-700 dark:!text-success-300",children:"Document Protected"}),f.jsxs(G.Typography,{variant:"regular",size:"extra-small",className:"!text-success-600 dark:!text-success-400",children:[h," entit",h===1?"y has":"ies have"," been anonymized successfully"]})]})]}):f.jsxs(f.Fragment,{children:[f.jsx(ie,{name:"tickmark",size:38,strokeWidth:3,className:"text-success-700 dark:text-success-800 shrink-0"}),f.jsxs("div",{children:[f.jsx(G.Typography,{variant:"semibold",size:"small",className:"!text-success-700 dark:!text-success-300",children:"Scan Complete"}),f.jsxs(G.Typography,{variant:"regular",size:"extra-small",className:"!text-success-600 dark:!text-success-400",children:["Found ",_," sensitive entities across ",p.length," categories"]})]})]})})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx(G.Typography,{variant:"semibold",size:"extra-small",appearance:"title",className:"text-neutral-900 dark:text-neutral-100",children:a?"Anonymization Mapping":"Select items to anonymize"}),a?null:f.jsxs("button",{type:"button",className:"flex items-center gap-1 text-primary-600 dark:text-primary-400 hover:text-primary-700 dark:hover:text-primary-300 focus-visible:outline focus-visible:ring-2 focus-visible:ring-primary-500 dark:focus-visible:ring-primary-400 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-black-800 rounded transition-colors",onClick:T,children:[f.jsx(ee.DoneAll,{sx:{fontSize:16}}),f.jsx("span",{className:"text-xs font-medium text-inherit",children:g.size===_?"Deselect All":"Select All"})]})]}),f.jsx("div",{className:"space-y-4",children:p.map(v=>f.jsx(K9,{category:v,isExpanded:E.has(v.config.id),onToggleExpand:()=>x(v.config.id),selectedIds:g,onToggleEntity:y,isApplied:a},v.config.id))})]})}),f.jsx("div",{className:"border-t border-gray-200 dark:border-black-600 bg-white dark:bg-black-800",children:_===0&&!a?f.jsx("div",{className:"px-4 py-4",children:f.jsx(G.Button,{id:"pii-close-btn-empty",status:"secondary-neutral",appearance:"outline",onClick:()=>{o.piiAnonymization?.onRevertAnonymization?.(),t?.()},className:"w-full py-1.5 border border-neutral-300 dark:border-black-500 bg-white dark:bg-black-700 text-neutral-700 dark:text-neutral-200 hover:bg-neutral-50 dark:hover:bg-black-600",children:"Close"})}):a?f.jsxs("div",{className:"px-4 py-4 space-y-2 flex flex-col gap-1",children:[f.jsx(G.Button,{id:"pii-reveal-originals-btn",status:"secondary-neutral",appearance:"outline",className:"w-full py-1.5 border border-neutral-300 dark:border-black-500 bg-white dark:bg-black-700 text-neutral-700 dark:text-neutral-200 hover:bg-neutral-50 dark:hover:bg-black-600",onClick:()=>{const v=!l;if(i)if(v)Kf(i,!0,void 0);else{const C=jy(i,{revealState:"revealed"});Kf(i,!1,C.size>0?C:void 0)}c(v)},children:f.jsxs("span",{className:"flex items-center justify-center gap-1.5",children:[l?f.jsx(Y9,{size:16}):f.jsx($9,{size:16}),l?"Hide Originals":"Reveal Originals"]})}),f.jsx(G.Button,{id:"pii-revert-anonymization-btn",status:"secondary-neutral",appearance:"outline",onClick:()=>{r?.()},isLoading:o.piiAnonymization?.isRevertingAnonymization,disabled:o.piiAnonymization?.isRevertingAnonymization,className:"w-full py-1.5 border border-neutral-300 dark:border-black-500 bg-white dark:bg-black-700 text-neutral-700 dark:text-neutral-200 hover:bg-neutral-50 dark:hover:bg-black-600",children:f.jsxs("span",{className:"flex items-center justify-center gap-1.5",children:[f.jsx(ie,{name:"undo",size:16,className:"text-neutral-600 dark:text-neutral-300"}),"Revert Anonymization"]})})]}):f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"flex items-center justify-between px-4 pt-3 pb-2",children:f.jsxs(G.Typography,{variant:"medium",size:"extra-small",appearance:"subtitle",className:"text-neutral-600 dark:text-neutral-400",children:[g.size," of ",_," selected"]})}),f.jsx("div",{className:"px-4 pb-4",children:f.jsx(G.Button,{id:"pii-apply-btn",status:"primary",appearance:"outline",onClick:()=>{const v=p.flatMap(w=>w.entities),C=[],O=[];for(const w of v)g.has(w.id)?C.push(w.replacement):O.push(w.replacement);n?.(C,O),s(!0),o.piiAnonymization?.onAnonymizeDocument?.()},className:"w-full py-1.5",children:f.jsxs("span",{className:"flex items-center justify-center gap-1.5",children:[f.jsx(ie,{name:"pii-anonymization",size:16,fillColor:"white"}),"Apply Anonymization"]})})})]})})]})},X9=({onClose:e})=>{const{editor:t,editorConfig:n}=lt(),r=A.useMemo(()=>n.piiAnonymization?.settings?.detectionConfigs??j7,[n.piiAnonymization?.settings?.detectionConfigs]),[i,o]=A.useState("main"),a=A.useRef(!1);A.useEffect(()=>{!n.piiAnonymization?.isRevertingAnonymization&&a.current&&(a.current=!1,t&&(Yy(t),$y(t)),o("main"))},[n.piiAnonymization?.isRevertingAnonymization,t]);const[s,l]=A.useState(()=>{const d=n.piiAnonymization?.settings?.detections;return d!=null&&d.length>0?d.filter(u=>u.enabled).map(u=>u.id):r.map(u=>u.id)}),c=r.filter(d=>s.includes(d.id));return n.piiAnonymization?.isAnalyzed||i==="results"?f.jsx(Q9,{detectionConfigs:c,onClose:e,onSettings:()=>o("settings"),onApply:(d,u)=>{if(!t)return;if(u.length>0){const m=new Set(u);Yy(t,m),$y(t,m)}const p=new Set(d);Kf(t,!1,p)},onRevertAnonymization:()=>{a.current=!0,n.piiAnonymization?.onRevertAnonymization?.()}}):i==="scanning"?f.jsx(o9,{detectionConfigs:c,isScanningDocument:n.piiAnonymization?.isScanningDocument,runDocumentScan:async()=>{const d=t?t.getJSON():{},u=await n.piiAnonymization?.onScanDocument?.(d);if(u?.json_content&&t){const p=kp(u.json_content,u.placeholder_format??"numbered");t.commands.setContent(p)}},onClose:e,onCancel:()=>o("main"),onComplete:()=>o("results")}):i==="settings"?f.jsx(X7,{detectionConfigs:r,onBack:()=>o("main"),onClose:e,onSave:d=>{l(d.length>0?d:r.map(u=>u.id)),o("main")}}):f.jsxs("div",{className:"h-full bg-white dark:bg-black-800",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-black-600",children:[f.jsx(G.Typography,{variant:"semibold",size:"medium",appearance:"title",children:"PII Anonymization"}),e&&f.jsx(G.IconButton,{id:"pii-close-btn",variant:"ghost",onClick:e,tooltip:"Close",noborder:!0,children:f.jsx(ee.Close,{sx:{fontSize:20}})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[f.jsxs(G.Card,{className:"!rounded-xl !border-primary-100 dark:!border-primary-900 !bg-primary-50 dark:!bg-primary-950 !p-5 text-center !shadow-none mb-6",children:[f.jsx("div",{className:"mx-auto mb-3 flex h-12 w-12 items-center justify-center rounded-xl bg-white dark:bg-primary-950 border border-primary-100 dark:!border-primary-900",children:f.jsx(ie,{className:"text-primary-600 dark:text-neutral-100",name:"pii-anonymization",size:26})}),f.jsx(G.Typography,{variant:"semibold",size:"small",appearance:"title",className:"mb-1",children:"Protect Sensitive Information"}),f.jsx(G.Typography,{variant:"regular",size:"extra-small",appearance:"subtitle",className:"leading-relaxed",children:"Automatically detect and anonymize personal data before sharing or processing with AI"})]}),f.jsxs(G.Card,{className:"!rounded-xl !border-neutral-100 dark:!border-neutral-800 !p-4 !shadow-none bg-neutral-50 dark:bg-black-600",children:[f.jsx(G.Typography,{variant:"semibold",size:"extra-small",appearance:"subtitle",className:"uppercase tracking-wider mb-3",children:"What We Detect"}),f.jsx("div",{className:"grid grid-cols-2",children:r.map(d=>f.jsxs("div",{className:"flex items-start gap-2 rounded-lg py-1.5",children:[f.jsx(ie,{name:d.iconName,size:18,className:d.iconColor}),f.jsx(G.Typography,{variant:"medium",size:"small",appearance:"title",className:"!text-neutral-700 dark:!text-black-200",children:d.label})]},d.id))})]})]}),f.jsxs("div",{className:"px-4 flex justify-between items-center gap-2 bg-white dark:bg-black-800",children:[f.jsx(G.Button,{id:"pii-configure-btn",status:"secondary-neutral",appearance:"outline",onClick:()=>o("settings"),className:"flex-1 py-1.5 border border-neutral-300 dark:border-black-500 bg-neutral-50 dark:bg-black-950",children:f.jsxs("span",{className:"flex items-center justify-center gap-1.5 dark:text-neutral-200",children:[f.jsx(ie,{className:"text-neutral-700 dark:text-black-200",name:"settings",size:16}),"Configure Settings"]})}),f.jsx(G.Button,{id:"pii-scan-btn",status:"primary",appearance:"outline",onClick:()=>o("scanning"),className:"flex-1 py-1.5 border border-primary-300 dark:border-primary-200 bg-primary-50 dark:bg-primary-950",children:f.jsxs("span",{className:"flex items-center justify-center gap-1.5 text-primary-600 dark:text-primary-200",children:[f.jsx(ie,{className:"text-primary-600 dark:text-primary-200",name:"document-scanner",size:16}),"Scan Document"]})})]})]})},Z9=".page-a4{width:210mm;min-height:297mm}.page-a4-landscape{width:297mm;min-height:210mm}.page-a3{width:297mm;min-height:420mm}.page-a3-landscape{width:420mm;min-height:297mm}.page-letter{width:8.5in;min-height:11in}.page-letter-landscape{width:11in;min-height:8.5in}.page-legal{width:8.5in;min-height:14in}.page-legal-landscape{width:14in;min-height:8.5in}.page-tabloid{width:11in;min-height:17in}.page-tabloid-landscape{width:17in;min-height:11in}",J9=`.tiptap :first-child{margin-top:0}.tiptap p,.tiptap h1,.tiptap h2,.tiptap h3,.tiptap h4,.tiptap h5,.tiptap h6,.tiptap blockquote{max-width:100%;word-wrap:break-word;overflow-wrap:break-word}.tiptap ul,.tiptap ol{padding:0!important;margin:0 0 0 .35in!important}:is(.tiptap ul,.tiptap ol) li{list-style-position:outside;padding-left:.15in;margin-left:0}:is(.tiptap ul,.tiptap ol) li p{display:inline;margin:0;font-size:var(--list-marker-font-size, inherit)}:is(.tiptap ul,.tiptap ol) li::marker{margin-right:.1in}.tiptap ul[data-type=taskList]{list-style:none;margin:0!important;padding:0}.tiptap ul[data-type=taskList] li{align-items:flex-start;display:flex;margin-left:0}.tiptap ul[data-type=taskList] li>label{flex:0 0 auto;margin-right:.15in;-webkit-user-select:none;-moz-user-select:none;user-select:none;display:flex;align-items:flex-start;font-size:var(--list-marker-font-size, 1rem);color:var(--list-marker-color, currentColor);line-height:1}.tiptap ul[data-type=taskList] li>div{flex:1 1 auto;margin-left:4px!important;font-size:var(--list-marker-font-size, inherit)}.tiptap ul[data-type=taskList] li>div p{font-size:inherit}.tiptap ul[data-type=taskList] input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;appearance:none;font-size:inherit;color:var(--list-marker-color, currentColor);cursor:pointer;width:.8em;height:.8em;min-width:.8em;min-height:.8em;border:1.5px solid currentColor;background-color:#fff;border-radius:2px;position:relative;margin:.35em 0 0;background-repeat:no-repeat;background-position:center;background-size:.65em .65em}.tiptap ul[data-type=taskList] li[data-checked=true]>label input[type=checkbox]{border-color:currentColor;background-color:#fff;background-image:none}.tiptap ul[data-type=taskList] li[data-checked=true]>label input[type=checkbox]:after{content:"";position:absolute;inset:.08em;background-color:currentColor;-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M3 8l3 3l7-7'/%3E%3C/svg%3E");-webkit-mask-repeat:no-repeat;-webkit-mask-position:center;-webkit-mask-size:contain;mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M3 8l3 3l7-7'/%3E%3C/svg%3E");mask-repeat:no-repeat;mask-position:center;mask-size:contain;pointer-events:none}.tiptap ul[data-type=taskList] ul[data-type=taskList]{margin:0}.tiptap ul:not([data-type=taskList]) li::marker{content:"● "}.tiptap ul:not([data-type=taskList]) ul li::marker{content:"○ "}.tiptap ul:not([data-type=taskList]) ul ul li::marker{content:"■ "}.tiptap ul:not([data-type=taskList]) ul ul ul li::marker{content:"● "}.tiptap ul:not([data-type=taskList]) ul ul ul ul li::marker{content:"○ "}.tiptap ul:not([data-type=taskList]) ul ul ul ul ul li::marker{content:"■ "}.tiptap ul:not([data-type=taskList]) ul ul ul ul ul ul li::marker{content:"● "}.tiptap ul:not([data-type=taskList]) ul ul ul ul ul ul ul li::marker{content:"○ "}.tiptap ul:not([data-type=taskList]) ul ul ul ul ul ul ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=default]:not([data-type=taskList]) li::marker{content:"● "}.tiptap ul[data-list-type=default]:not([data-type=taskList]) ul li::marker{content:"○ "}.tiptap ul[data-list-type=default]:not([data-type=taskList]) ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=default]:not([data-type=taskList]) ul ul ul li::marker{content:"● "}.tiptap ul[data-list-type=default]:not([data-type=taskList]) ul ul ul ul li::marker{content:"○ "}.tiptap ul[data-list-type=default]:not([data-type=taskList]) ul ul ul ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=default]:not([data-type=taskList]) ul ul ul ul ul ul li::marker{content:"● "}.tiptap ul[data-list-type=default]:not([data-type=taskList]) ul ul ul ul ul ul ul li::marker{content:"○ "}.tiptap ul[data-list-type=default]:not([data-type=taskList]) ul ul ul ul ul ul ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=diamondArrow]:not([data-type=taskList]) li::marker{content:"❖ "}.tiptap ul[data-list-type=diamondArrow]:not([data-type=taskList]) ul li::marker{content:"➤ "}.tiptap ul[data-list-type=diamondArrow]:not([data-type=taskList]) ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=diamondArrow]:not([data-type=taskList]) ul ul ul li::marker{content:"❖ "}.tiptap ul[data-list-type=diamondArrow]:not([data-type=taskList]) ul ul ul ul li::marker{content:"➤ "}.tiptap ul[data-list-type=diamondArrow]:not([data-type=taskList]) ul ul ul ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=diamondArrow]:not([data-type=taskList]) ul ul ul ul ul ul li::marker{content:"❖ "}.tiptap ul[data-list-type=diamondArrow]:not([data-type=taskList]) ul ul ul ul ul ul ul li::marker{content:"➤ "}.tiptap ul[data-list-type=diamondArrow]:not([data-type=taskList]) ul ul ul ul ul ul ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=square]:not([data-type=taskList]) li::marker{content:"☐ "}.tiptap ul[data-list-type=square]:not([data-type=taskList]) ul li::marker{content:"☐ "}.tiptap ul[data-list-type=square]:not([data-type=taskList]) ul ul li::marker{content:"☐ "}.tiptap ul[data-list-type=square]:not([data-type=taskList]) ul ul ul li::marker{content:"☐ "}.tiptap ul[data-list-type=square]:not([data-type=taskList]) ul ul ul ul li::marker{content:"☐ "}.tiptap ul[data-list-type=square]:not([data-type=taskList]) ul ul ul ul ul li::marker{content:"☐ "}.tiptap ul[data-list-type=square]:not([data-type=taskList]) ul ul ul ul ul ul li::marker{content:"☐ "}.tiptap ul[data-list-type=square]:not([data-type=taskList]) ul ul ul ul ul ul ul li::marker{content:"☐ "}.tiptap ul[data-list-type=square]:not([data-type=taskList]) ul ul ul ul ul ul ul ul li::marker{content:"☐ "}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) li::marker{content:"➔ "}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) ul li::marker{content:"◆ "}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) ul ul li::marker{content:"● "}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) ul ul ul li::marker{content:"➔ "}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) ul ul ul ul li::marker{content:"◆ "}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) ul ul ul ul ul li::marker{content:"● "}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) ul ul ul ul ul ul li::marker{content:"➔ "}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) ul ul ul ul ul ul ul li::marker{content:"◆ "}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) ul ul ul ul ul ul ul ul li::marker{content:"● "}.tiptap ul[data-list-type=star]:not([data-type=taskList]) li::marker{content:"★ "}.tiptap ul[data-list-type=star]:not([data-type=taskList]) ul li::marker{content:"○ "}.tiptap ul[data-list-type=star]:not([data-type=taskList]) ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=star]:not([data-type=taskList]) ul ul ul li::marker{content:"★ "}.tiptap ul[data-list-type=star]:not([data-type=taskList]) ul ul ul ul li::marker{content:"○ "}.tiptap ul[data-list-type=star]:not([data-type=taskList]) ul ul ul ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=star]:not([data-type=taskList]) ul ul ul ul ul ul li::marker{content:"★ "}.tiptap ul[data-list-type=star]:not([data-type=taskList]) ul ul ul ul ul ul ul li::marker{content:"○ "}.tiptap ul[data-list-type=star]:not([data-type=taskList]) ul ul ul ul ul ul ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) li::marker{content:"➤ "}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) ul li::marker{content:"○ "}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) ul ul ul li::marker{content:"➤ "}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) ul ul ul ul li::marker{content:"○ "}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) ul ul ul ul ul li::marker{content:"■ "}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) ul ul ul ul ul ul li::marker{content:"➤ "}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) ul ul ul ul ul ul ul li::marker{content:"○ "}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) ul ul ul ul ul ul ul ul li::marker{content:"■ "}.tiptap ol{list-style-type:decimal}.tiptap ol ol{list-style-type:lower-alpha}.tiptap ol ol ol{list-style-type:lower-roman}.tiptap ol ol ol ol{list-style-type:decimal}.tiptap ol ol ol ol ol{list-style-type:lower-alpha}.tiptap ol ol ol ol ol ol{list-style-type:lower-roman}.tiptap ol ol ol ol ol ol ol{list-style-type:decimal}.tiptap ol ol ol ol ol ol ol ol{list-style-type:lower-alpha}.tiptap ol ol ol ol ol ol ol ol ol{list-style-type:lower-roman}.tiptap ol[data-list-type=decimal-parenthesis]{list-style-type:decimal}.tiptap ol[data-list-type=decimal-parenthesis] li::marker{content:counter(list-item) ") "}.tiptap ol[data-list-type=decimal-parenthesis] ol{list-style-type:lower-alpha}.tiptap ol[data-list-type=decimal-parenthesis] ol li::marker{content:counter(list-item,lower-alpha) ") "}.tiptap ol[data-list-type=decimal-parenthesis] ol ol{list-style-type:lower-roman}.tiptap ol[data-list-type=decimal-parenthesis] ol ol li::marker{content:counter(list-item,lower-roman) ") "}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol{list-style-type:decimal}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol li::marker{content:counter(list-item) ") "}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol ol{list-style-type:lower-alpha}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol ol li::marker{content:counter(list-item,lower-alpha) ") "}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol ol ol{list-style-type:lower-roman}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol ol ol li::marker{content:counter(list-item,lower-roman) ") "}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol ol ol ol{list-style-type:decimal}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol ol ol ol li::marker{content:counter(list-item) ") "}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol ol ol ol ol{list-style-type:lower-alpha}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol ol ol ol ol li::marker{content:counter(list-item,lower-alpha) ") "}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol ol ol ol ol ol{list-style-type:lower-roman}.tiptap ol[data-list-type=decimal-parenthesis] ol ol ol ol ol ol ol ol li::marker{content:counter(list-item,lower-roman) ") "}.tiptap ol[data-list-type=decimal-nested]{counter-reset:level1}.tiptap ol[data-list-type=decimal-nested]>li{counter-increment:level1}.tiptap ol[data-list-type=decimal-nested]>li::marker{content:counter(level1) ". "}.tiptap ol[data-list-type=decimal-nested] ol{counter-reset:level2}.tiptap ol[data-list-type=decimal-nested] ol>li{counter-increment:level2}.tiptap ol[data-list-type=decimal-nested] ol>li::marker{content:counter(level1) "." counter(level2) " "}.tiptap ol[data-list-type=decimal-nested] ol ol{counter-reset:level3}.tiptap ol[data-list-type=decimal-nested] ol ol>li{counter-increment:level3}.tiptap ol[data-list-type=decimal-nested] ol ol>li::marker{content:counter(level1) "." counter(level2) "." counter(level3) " "}.tiptap ol[data-list-type=decimal-nested] ol ol ol{counter-reset:level4}.tiptap ol[data-list-type=decimal-nested] ol ol ol>li{counter-increment:level4}.tiptap ol[data-list-type=decimal-nested] ol ol ol>li::marker{content:counter(level1) "." counter(level2) "." counter(level3) "." counter(level4) " "}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol{counter-reset:level5}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol>li{counter-increment:level5}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol>li::marker{content:counter(level1) "." counter(level2) "." counter(level3) "." counter(level4) "." counter(level5) " "}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol{counter-reset:level6}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol>li{counter-increment:level6}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol>li::marker{content:counter(level1) "." counter(level2) "." counter(level3) "." counter(level4) "." counter(level5) "." counter(level6) " "}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol ol{counter-reset:level7}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol ol>li{counter-increment:level7}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol ol>li::marker{content:counter(level1) "." counter(level2) "." counter(level3) "." counter(level4) "." counter(level5) "." counter(level6) "." counter(level7) " "}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol ol ol{counter-reset:level8}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol ol ol>li{counter-increment:level8}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol ol ol>li::marker{content:counter(level1) "." counter(level2) "." counter(level3) "." counter(level4) "." counter(level5) "." counter(level6) "." counter(level7) "." counter(level8) " "}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol ol ol ol{counter-reset:level9}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol ol ol ol>li{counter-increment:level9}.tiptap ol[data-list-type=decimal-nested] ol ol ol ol ol ol ol ol>li::marker{content:counter(level1) "." counter(level2) "." counter(level3) "." counter(level4) "." counter(level5) "." counter(level6) "." counter(level7) "." counter(level8) "." counter(level9) " "}.tiptap ol[data-list-type=upper-alpha-mixed]{list-style-type:upper-alpha}.tiptap ol[data-list-type=upper-alpha-mixed] ol{list-style-type:lower-alpha}.tiptap ol[data-list-type=upper-alpha-mixed] ol ol{list-style-type:lower-roman}.tiptap ol[data-list-type=upper-alpha-mixed] ol ol ol{list-style-type:upper-alpha}.tiptap ol[data-list-type=upper-alpha-mixed] ol ol ol ol{list-style-type:lower-alpha}.tiptap ol[data-list-type=upper-alpha-mixed] ol ol ol ol ol{list-style-type:lower-roman}.tiptap ol[data-list-type=upper-alpha-mixed] ol ol ol ol ol ol{list-style-type:upper-alpha}.tiptap ol[data-list-type=upper-alpha-mixed] ol ol ol ol ol ol ol{list-style-type:lower-alpha}.tiptap ol[data-list-type=upper-alpha-mixed] ol ol ol ol ol ol ol ol{list-style-type:lower-roman}.tiptap ol[data-list-type=upper-roman-mixed]{list-style-type:upper-roman}.tiptap ol[data-list-type=upper-roman-mixed] ol{list-style-type:upper-alpha}.tiptap ol[data-list-type=upper-roman-mixed] ol ol{list-style-type:decimal}.tiptap ol[data-list-type=upper-roman-mixed] ol ol ol{list-style-type:upper-roman}.tiptap ol[data-list-type=upper-roman-mixed] ol ol ol ol{list-style-type:upper-alpha}.tiptap ol[data-list-type=upper-roman-mixed] ol ol ol ol ol{list-style-type:decimal}.tiptap ol[data-list-type=upper-roman-mixed] ol ol ol ol ol ol{list-style-type:upper-roman}.tiptap ol[data-list-type=upper-roman-mixed] ol ol ol ol ol ol ol{list-style-type:upper-alpha}.tiptap ol[data-list-type=upper-roman-mixed] ol ol ol ol ol ol ol ol{list-style-type:decimal}.tiptap ol[data-list-type=decimal-leading-zero-mixed]{list-style-type:decimal-leading-zero}.tiptap ol[data-list-type=decimal-leading-zero-mixed] ol{list-style-type:lower-alpha}.tiptap ol[data-list-type=decimal-leading-zero-mixed] ol ol{list-style-type:lower-roman}.tiptap ol[data-list-type=decimal-leading-zero-mixed] ol ol ol{list-style-type:decimal-leading-zero}.tiptap ol[data-list-type=decimal-leading-zero-mixed] ol ol ol ol{list-style-type:lower-alpha}.tiptap ol[data-list-type=decimal-leading-zero-mixed] ol ol ol ol ol{list-style-type:lower-roman}.tiptap ol[data-list-type=decimal-leading-zero-mixed] ol ol ol ol ol ol{list-style-type:decimal-leading-zero}.tiptap ol[data-list-type=decimal-leading-zero-mixed] ol ol ol ol ol ol ol{list-style-type:lower-alpha}.tiptap ol[data-list-type=decimal-leading-zero-mixed] ol ol ol ol ol ol ol ol{list-style-type:lower-roman}.tiptap li::marker{color:var(--list-marker-color, currentColor);font-size:calc(var(--list-marker-font-size, 1em) * .9)}.tiptap ul[data-list-type=default]:not([data-type=taskList]) li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=default]:not([data-type=taskList]) ul li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .99)}.tiptap ul[data-list-type=default]:not([data-type=taskList]) ul ul li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=diamondArrow]:not([data-type=taskList]) li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=diamondArrow]:not([data-type=taskList]) ul li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) ul li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=arrowDiamond]:not([data-type=taskList]) ul ul li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=star]:not([data-type=taskList]) li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=star]:not([data-type=taskList]) ul li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=star]:not([data-type=taskList]) ul ul li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) ul li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}.tiptap ul[data-list-type=arrowCircle]:not([data-type=taskList]) ul ul li::marker{font-size:calc(var(--list-marker-font-size, 1rem) * .9)}@media print{.tiptap ul[data-type=taskList]{list-style:none;margin-left:0!important;padding:0!important}.tiptap ul[data-type=taskList] li{align-items:flex-start;display:flex;position:relative;padding-left:0!important;margin-bottom:.25rem}.tiptap ul[data-type=taskList] label{position:relative;margin-right:.5rem;flex:0 0 auto;display:flex;align-items:flex-start}.tiptap ul[data-type=taskList] label input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:1em;height:1em;min-width:1em;min-height:1em;border:1.5px solid #000!important;background-color:#fff!important;border-radius:2px;position:relative;margin:.2em 0 0;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}.tiptap ul[data-type=taskList] li[data-checked=true] label input[type=checkbox]{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='4' stroke-linecap='round' stroke-linejoin='round' d='M3 8l3 3l7-7'/%3E%3C/svg%3E")!important;background-repeat:no-repeat!important;background-position:center!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;background-color:initial}}`,ez=".tiptap blockquote{border-left:3px solid #0f172a;padding-left:1em;padding-top:2px;padding-bottom:2px;margin-left:0;margin-right:0;background-color:#f8fafc;font-style:italic}.tiptap blockquote>p{margin:4px}.tiptap blockquote>*{background-color:inherit!important}.dark .tiptap blockquote{border-left-color:#e2e8f0;background-color:#1f2937}",tz=".tiptap h1,.tiptap h2,.tiptap h3,.tiptap h4,.tiptap h5,.tiptap h6{font-weight:700}.tiptap h1{font-size:32px;line-height:41px}.tiptap h2{font-size:27px;line-height:35px}.tiptap h3{font-size:21px;line-height:28px}.tiptap h4{font-size:18px;line-height:24px}.tiptap h5{font-size:16px;line-height:21px}.tiptap h6{font-size:15px;line-height:17px}",nz='.tiptap table{border-collapse:collapse;table-layout:fixed;width:100%;max-width:100%;overflow:hidden;page-break-inside:auto;margin:0 auto}.tiptap table tr{page-break-inside:avoid;page-break-after:auto}.tiptap table td,.tiptap table th{min-width:1em;border:1px solid #626262!important}.tiptap table td>*,.tiptap table th>*{margin-bottom:0}.tiptap table td p,.tiptap table th p{padding:4px}.tiptap table td[align=left-top],.tiptap table th[align=left-top]{vertical-align:top;text-align:left}.tiptap table td[align=center-top],.tiptap table th[align=center-top]{vertical-align:top;text-align:center}.tiptap table td[align=right-top],.tiptap table th[align=right-top]{vertical-align:middle;text-align:right}.tiptap table td[align=justify-top],.tiptap table th[align=justify-top]{vertical-align:middle;text-align:justify}.tiptap table td[align=left-middle],.tiptap table th[align=left-middle]{vertical-align:middle;text-align:left}.tiptap table td[align=center-middle],.tiptap table th[align=center-middle]{vertical-align:middle;text-align:center}.tiptap table td[align=right-middle],.tiptap table th[align=right-middle]{vertical-align:middle;text-align:right}.tiptap table td[align=justify-middle],.tiptap table th[align=justify-middle]{vertical-align:middle;text-align:justify}.tiptap table td[align=left-bottom],.tiptap table th[align=left-bottom]{vertical-align:bottom;text-align:left}.tiptap table td[align=center-bottom],.tiptap table th[align=center-bottom]{vertical-align:middle;text-align:center}.tiptap table td[align=right-bottom],.tiptap table th[align=right-bottom]{vertical-align:bottom;text-align:right}.tiptap table td[align=justify-bottom],.tiptap table th[align=justify-bottom]{vertical-align:bottom;text-align:justify}.tiptap table th{font-weight:700;text-align:left;background-color:#e1e1e1}.tiptap table .selectedCell:after{z-index:2;position:absolute;content:"";inset:0;background:#56a2ff5e;pointer-events:none;width:100%;height:100%}.tiptap table td,.tiptap table th{position:relative}.tiptap table td:after,.tiptap table th:after{content:"";position:absolute;right:-2px;top:0;bottom:0;width:4px;cursor:col-resize;z-index:1}.tiptap table p{margin:0}@media print{.tiptap table{border-collapse:collapse!important;border:1px solid #626262!important}}@media print{.tiptap table th{background-color:#e1e1e1!important;font-weight:700!important}}@media print{.tiptap table td,.tiptap table th{border:1px solid #626262!important}}',rz=".tiptap a{color:#0077e3;text-decoration:underline}.dark .tiptap a{color:#60a5fa}",iz=`hr.hr--single-line{border:none;border-top:2px solid #000000;margin:1rem 0}hr.hr--thick-single-line{border:none;border-top:4px solid #000000;margin:1rem 0}hr.hr--double-line{border:none;border-top:5px double #000000;margin:1rem 0}hr.hr--dotted-line{border:none;border-top:2px dotted #000000;margin:1rem 0}hr.hr--dashed-line{border:none;border-top:2px dashed #000000;margin:1rem 0}hr.hr--double-dashed-line{border:none;border-top:2px dashed #000000;border-bottom:2px dashed #000000;height:4px;margin:1rem 0}hr.hr--thick-and-thick-line-top{border:none;border-top:4px solid #000000;border-bottom:1px solid #000000;height:4px;margin:1rem 0}hr.hr--thick-and-thick-line-bottom{border:none;border-top:1px solid #000000;border-bottom:4px solid #000000;height:4px;margin:1rem 0}hr.hr--wavy-line{border:none;height:12px;margin:1rem 0;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 12' preserveAspectRatio='none'%3E%3Cpath d='M0,6 Q5,0 10,6 T20,6 T30,6 T40,6 T50,6 T60,6 T70,6 T80,6 T90,6 T100,6 T110,6 T120,6 T130,6 T140,6 T150,6 T160,6 T170,6 T180,6 T190,6 T200,6 T210,6 T220,6 T230,6 T240,6 T250,6 T260,6 T270,6 T280,6 T290,6 T300,6 T310,6 T320,6 T330,6 T340,6 T350,6 T360,6 T370,6 T380,6 T390,6 T400,6 T410,6 T420,6 T430,6 T440,6 T450,6 T460,6 T470,6 T480,6 T490,6 T500,6 T510,6 T520,6 T530,6 T540,6 T550,6 T560,6 T570,6 T580,6 T590,6 T600,6 T610,6 T620,6 T630,6 T640,6 T650,6 T660,6 T670,6 T680,6 T690,6 T700,6 T710,6 T720,6 T730,6 T740,6 T750,6 T760,6 T770,6 T780,6 T790,6 T800,6 T810,6 T820,6 T830,6 T840,6 T850,6 T860,6 T870,6 T880,6 T890,6 T900,6 T910,6 T920,6 T930,6 T940,6 T950,6 T960,6 T970,6 T980,6 T990,6 T1000,6 T1010,6 T1020,6 T1030,6 T1040,6 T1050,6 T1060,6 T1070,6 T1080,6 T1090,6 T1100,6 T1110,6 T1120,6 T1130,6 T1140,6 T1150,6 T1160,6 T1170,6 T1180,6 T1190,6 T1200,6' stroke='%23000000' stroke-width='3' fill='none'/%3E%3C/svg%3E");background-repeat:repeat-x;background-size:100% 8px;background-position:center}.dark .divider-preview hr.hr--single-line,.dark .divider-preview hr.hr--thick-single-line,.dark .divider-preview hr.hr--double-line,.dark .divider-preview hr.hr--dotted-line,.dark .divider-preview hr.hr--dashed-line{border-top-color:#d9d9d9}.dark .divider-preview hr.hr--double-dashed-line,.dark .divider-preview hr.hr--thick-and-thick-line-top,.dark .divider-preview hr.hr--thick-and-thick-line-bottom{border-top-color:#d9d9d9;border-bottom-color:#d9d9d9}.dark .divider-preview hr.hr--wavy-line{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 12' preserveAspectRatio='none'%3E%3Cpath d='M0,6 Q5,0 10,6 T20,6 T30,6 T40,6 T50,6 T60,6 T70,6 T80,6 T90,6 T100,6 T110,6 T120,6 T130,6 T140,6 T150,6 T160,6 T170,6 T180,6 T190,6 T200,6 T210,6 T220,6 T230,6 T240,6 T250,6 T260,6 T270,6 T280,6 T290,6 T300,6 T310,6 T320,6 T330,6 T340,6 T350,6 T360,6 T370,6 T380,6 T390,6 T400,6 T410,6 T420,6 T430,6 T440,6 T450,6 T460,6 T470,6 T480,6 T490,6 T500,6 T510,6 T520,6 T530,6 T540,6 T550,6 T560,6 T570,6 T580,6 T590,6 T600,6 T610,6 T620,6 T630,6 T640,6 T650,6 T660,6 T670,6 T680,6 T690,6 T700,6 T710,6 T720,6 T730,6 T740,6 T750,6 T760,6 T770,6 T780,6 T790,6 T800,6 T810,6 T820,6 T830,6 T840,6 T850,6 T860,6 T870,6 T880,6 T890,6 T900,6 T910,6 T920,6 T930,6 T940,6 T950,6 T960,6 T970,6 T980,6 T990,6 T1000,6 T1010,6 T1020,6 T1030,6 T1040,6 T1050,6 T1060,6 T1070,6 T1080,6 T1090,6 T1100,6 T1110,6 T1120,6 T1130,6 T1140,6 T1150,6 T1160,6 T1170,6 T1180,6 T1190,6 T1200,6' stroke='%23d9d9d9' stroke-width='3' fill='none'/%3E%3C/svg%3E")}.tiptap div[data-style-type]{display:flow-root;width:100%}.tiptap div.hr--in-selection{background-color:Highlight}.tiptap .hr--single-line>hr{border:none;border-top:2px solid #000000;margin:1rem 0}.tiptap .hr--thick-single-line>hr{border:none;border-top:4px solid #000000;margin:1rem 0}.tiptap .hr--double-line>hr{border:none;border-top:5px double #000000;margin:1rem 0}.tiptap .hr--dotted-line>hr{border:none;border-top:2px dotted #000000;margin:1rem 0}.tiptap .hr--dashed-line>hr{border:none;border-top:2px dashed #000000;margin:1rem 0}.tiptap .hr--double-dashed-line>hr{border:none;border-top:2px dashed #000000;border-bottom:2px dashed #000000;height:4px;margin:1rem 0}.tiptap .hr--thick-and-thick-line-top>hr{border:none;border-top:4px solid #000000;border-bottom:1px solid #000000;height:4px;margin:1rem 0}.tiptap .hr--thick-and-thick-line-bottom>hr{border:none;border-top:1px solid #000000;border-bottom:4px solid #000000;height:4px;margin:1rem 0}.tiptap .hr--wavy-line>hr{border:none;height:12px;margin:1rem 0;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 12' preserveAspectRatio='none'%3E%3Cpath d='M0,6 Q5,0 10,6 T20,6 T30,6 T40,6 T50,6 T60,6 T70,6 T80,6 T90,6 T100,6 T110,6 T120,6 T130,6 T140,6 T150,6 T160,6 T170,6 T180,6 T190,6 T200,6 T210,6 T220,6 T230,6 T240,6 T250,6 T260,6 T270,6 T280,6 T290,6 T300,6 T310,6 T320,6 T330,6 T340,6 T350,6 T360,6 T370,6 T380,6 T390,6 T400,6 T410,6 T420,6 T430,6 T440,6 T450,6 T460,6 T470,6 T480,6 T490,6 T500,6 T510,6 T520,6 T530,6 T540,6 T550,6 T560,6 T570,6 T580,6 T590,6 T600,6 T610,6 T620,6 T630,6 T640,6 T650,6 T660,6 T670,6 T680,6 T690,6 T700,6 T710,6 T720,6 T730,6 T740,6 T750,6 T760,6 T770,6 T780,6 T790,6 T800,6 T810,6 T820,6 T830,6 T840,6 T850,6 T860,6 T870,6 T880,6 T890,6 T900,6 T910,6 T920,6 T930,6 T940,6 T950,6 T960,6 T970,6 T980,6 T990,6 T1000,6 T1010,6 T1020,6 T1030,6 T1040,6 T1050,6 T1060,6 T1070,6 T1080,6 T1090,6 T1100,6 T1110,6 T1120,6 T1130,6 T1140,6 T1150,6 T1160,6 T1170,6 T1180,6 T1190,6 T1200,6' stroke='%23000000' stroke-width='3' fill='none'/%3E%3C/svg%3E");background-repeat:repeat-x;background-size:100% 8px;background-position:center}`,oz=".tiptap .code-block-wrapper{margin:1rem 0;border-radius:8px;overflow:hidden;position:relative}.tiptap .code-block-wrapper:has(.theme-dark){border:1px solid #333;background:#1e1e1e}.tiptap .code-block-wrapper:has(.theme-light){border:1px solid #e0e0e0;background:#f5f5f5}.tiptap .code-block-wrapper .code-block-toolbar{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.tiptap .code-block-wrapper .code-block-toolbar-left{display:flex;gap:8px;align-items:center}.tiptap .code-block-wrapper .code-block-toolbar-actions{display:flex;gap:4px;align-items:center}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark{background:#2d2d2d;border-bottom:1px solid #3d3d3d}.tiptap .code-block-wrapper .code-block-toolbar.theme-light{background:#f5f5f5;border-bottom:1px solid #e0e0e0}.tiptap .code-block-wrapper .code-block-action-btn{display:flex;align-items:center;justify-content:center;padding:4px 8px;background:transparent;border-radius:4px;cursor:pointer;transition:all .2s}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .code-block-action-btn{border:1px solid #555;color:#e0e0e0}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .code-block-action-btn:hover{background:#3d3d3d;border-color:#777}.tiptap .code-block-wrapper .code-block-toolbar.theme-light .code-block-action-btn{border:1px solid #d0d0d0;color:#333}.tiptap .code-block-wrapper .code-block-toolbar.theme-light .code-block-action-btn:hover{background:#e8e8e8;border-color:#999}.tiptap .code-block-wrapper .code-block-delete-btn:hover{color:#d32f2f;border-color:#d32f2f}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .ant-select-selector{background:#1e1e1e!important;border:1px solid #555!important;color:#e0e0e0!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .ant-select-arrow,.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .ant-select-selection-item{color:#e0e0e0!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-light .ant-select-selector{background:#fff!important;border:1px solid #d0d0d0!important;color:#333!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-light .ant-select-arrow,.tiptap .code-block-wrapper .code-block-toolbar.theme-light .ant-select-selection-item{color:#333!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .editor-select-dropdown{background:#3a3a3a!important;border:1px solid #3d3d3d!important;z-index:9999!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .editor-select-item-option-content{color:#e0e0e0!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .editor-select-item-option-selected{color:#d9ff00!important;background:#3a3a3a!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .editor-select-item-option-active{color:#d9ff00!important;background:#4b4b4b!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .editor-select-selector{color:#e0e0e0!important;background:#4b4b4b!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .editor-select-arrow{color:#e0e0e0!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .ant-select-dropdown .ant-select-item{color:#e0e0e0!important;background:transparent!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .ant-select-dropdown .ant-select-item:hover{background:#2d2d2d!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-dark .ant-select-dropdown .ant-select-item-option-selecte{background:#2d2d2d!important;color:#1890ff!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-light .ant-select-dropdown{background:#fff!important;border:1px solid #e0e0e0!important;z-index:9999!important}.tiptap body:has(.code-block-wrapper .code-block-toolbar.theme-light) .ant-select-dropdown .ant-select-item{color:#333!important;background:transparent!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-light .ant-select-dropdown .ant-select-item:hover{background:#f5f5f5!important}.tiptap .code-block-wrapper .code-block-toolbar.theme-light .ant-select-dropdown .ant-select-item-option-selected{background:#e6f7ff!important;color:#1890ff!important}.tiptap .code-block-wrapper .code-block-content{margin:0;padding:16px;overflow-x:auto;font-family:Consolas,Monaco,Courier New,monospace;font-size:14px;line-height:1.6;position:relative}.tiptap .code-block-wrapper .code-block-content code{display:block;background:transparent;padding:0;color:inherit;font-family:inherit;white-space:pre}.tiptap .code-block-wrapper .code-block-content code.syntax-layer *{display:inline!important;visibility:visible!important;opacity:1!important}.tiptap .code-block-wrapper .code-block-content.theme-dark code.syntax-layer *:not([class]){color:#d4d4d4!important}.tiptap .code-block-wrapper .code-block-content.theme-light code.syntax-layer *:not([class]){color:#000!important}.tiptap .code-block-wrapper .code-block-content code.editable-layer,.tiptap .code-block-wrapper .code-block-content code.editable-layer *{color:transparent!important}.tiptap .code-block-wrapper .code-block-content.wrapped{overflow-x:hidden}.tiptap .code-block-wrapper .code-block-content.wrapped code{white-space:pre-wrap;word-break:break-word}.tiptap .code-block-wrapper .code-block-content.theme-dark{background:#1e1e1e;color:#d4d4d4}.tiptap .code-block-wrapper .theme-dark .hljs-comment,.tiptap .code-block-wrapper .theme-dark .hljs-quote{color:#6a9955;font-style:italic}.tiptap .code-block-wrapper .theme-dark .hljs-keyword,.tiptap .code-block-wrapper .theme-dark .hljs-selector-tag,.tiptap .code-block-wrapper .theme-dark .hljs-literal,.tiptap .code-block-wrapper .theme-dark .hljs-type{color:#569cd6}.tiptap .code-block-wrapper .theme-dark .hljs-string,.tiptap .code-block-wrapper .theme-dark .hljs-title,.tiptap .code-block-wrapper .theme-dark .hljs-name{color:#ce9178}.tiptap .code-block-wrapper .theme-dark .hljs-number,.tiptap .code-block-wrapper .theme-dark .hljs-symbol,.tiptap .code-block-wrapper .theme-dark .hljs-bullet{color:#b5cea8}.tiptap .code-block-wrapper .theme-dark .hljs-function,.tiptap .code-block-wrapper .theme-dark .hljs-params{color:#dcdcaa}.tiptap .code-block-wrapper .theme-dark .hljs-attr,.tiptap .code-block-wrapper .theme-dark .hljs-variable,.tiptap .code-block-wrapper .theme-dark .hljs-property{color:#9cdcfe}.tiptap .code-block-wrapper .theme-dark .hljs-built_in,.tiptap .code-block-wrapper .theme-dark .hljs-class{color:#4ec9b0}.tiptap .code-block-wrapper .theme-dark .hljs-tag{color:gray}.tiptap .code-block-wrapper .theme-dark .hljs-meta{color:#d7ba7d}.tiptap .code-block-wrapper .code-block-content.theme-light{background:#fff;color:#000}.tiptap .code-block-wrapper .theme-light .hljs-comment,.tiptap .code-block-wrapper .theme-light .hljs-quote{color:green;font-style:italic}.tiptap .code-block-wrapper .theme-light .hljs-keyword,.tiptap .code-block-wrapper .theme-light .hljs-selector-tag,.tiptap .code-block-wrapper .theme-light .hljs-literal,.tiptap .code-block-wrapper .theme-light .hljs-type{color:#00f}.tiptap .code-block-wrapper .theme-light .hljs-string,.tiptap .code-block-wrapper .theme-light .hljs-title,.tiptap .code-block-wrapper .theme-light .hljs-name{color:#a31515}.tiptap .code-block-wrapper .theme-light .hljs-number,.tiptap .code-block-wrapper .theme-light .hljs-symbol,.tiptap .code-block-wrapper .theme-light .hljs-bullet{color:#098658}.tiptap .code-block-wrapper .theme-light .hljs-function,.tiptap .code-block-wrapper .theme-light .hljs-params{color:#795e26}.tiptap .code-block-wrapper .theme-light .hljs-attr,.tiptap .code-block-wrapper .theme-light .hljs-variable,.tiptap .code-block-wrapper .theme-light .hljs-property{color:#001080}.tiptap .code-block-wrapper .theme-light .hljs-built_in,.tiptap .code-block-wrapper .theme-light .hljs-class{color:#267f99}.tiptap .code-block-wrapper .code-block-content .hljs{display:block;overflow-x:auto}.tiptap .code-block-wrapper .code-block-content ::-moz-selection{background:#80cbc44d}.tiptap .code-block-wrapper .code-block-content ::selection{background:#80cbc44d}.tiptap .code-block-wrapper .code-block-content::-webkit-scrollbar{height:8px}.tiptap .code-block-wrapper .code-block-content::-webkit-scrollbar-track{background:#0003}.tiptap .code-block-wrapper .code-block-content::-webkit-scrollbar-thumb{background:#ffffff4d;border-radius:4px}.tiptap .code-block-wrapper .code-block-content::-webkit-scrollbar-thumb:hover{background:#ffffff80}@media print{.tiptap .code-block-wrapper{page-break-inside:avoid;border-radius:4px;overflow:visible;margin:1rem 0}.tiptap .code-block-wrapper .code-block-toolbar{display:none!important}.tiptap .code-block-wrapper:has(.theme-dark){border:1px solid #333!important;background:#1e1e1e!important}.tiptap .code-block-wrapper:has(.theme-light){border:1px solid #e0e0e0!important;background:#f5f5f5!important}.tiptap .code-block-wrapper .code-block-content{overflow-x:visible;overflow-y:visible;padding:16px;page-break-inside:avoid}.tiptap .code-block-wrapper .code-block-content code{white-space:pre-wrap!important;word-break:break-word}.tiptap .code-block-wrapper .code-block-content.theme-dark{background:#1e1e1e!important;color:#d4d4d4!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-dark .hljs-comment,.tiptap .code-block-wrapper .theme-dark .hljs-quote{color:#6a9955!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-dark .hljs-keyword,.tiptap .code-block-wrapper .theme-dark .hljs-selector-tag,.tiptap .code-block-wrapper .theme-dark .hljs-literal,.tiptap .code-block-wrapper .theme-dark .hljs-type{color:#569cd6!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-dark .hljs-string,.tiptap .code-block-wrapper .theme-dark .hljs-title,.tiptap .code-block-wrapper .theme-dark .hljs-name{color:#ce9178!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-dark .hljs-number,.tiptap .code-block-wrapper .theme-dark .hljs-symbol,.tiptap .code-block-wrapper .theme-dark .hljs-bullet{color:#b5cea8!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-dark .hljs-function,.tiptap .code-block-wrapper .theme-dark .hljs-params{color:#dcdcaa!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-dark .hljs-attr,.tiptap .code-block-wrapper .theme-dark .hljs-variable,.tiptap .code-block-wrapper .theme-dark .hljs-property{color:#9cdcfe!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-dark .hljs-built_in,.tiptap .code-block-wrapper .theme-dark .hljs-class{color:#4ec9b0!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .code-block-content.theme-light{background:#fff!important;color:#000!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-light .hljs-comment,.tiptap .code-block-wrapper .theme-light .hljs-quote{color:green!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-light .hljs-keyword,.tiptap .code-block-wrapper .theme-light .hljs-selector-tag,.tiptap .code-block-wrapper .theme-light .hljs-literal,.tiptap .code-block-wrapper .theme-light .hljs-type{color:#00f!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-light .hljs-string,.tiptap .code-block-wrapper .theme-light .hljs-title,.tiptap .code-block-wrapper .theme-light .hljs-name{color:#a31515!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-light .hljs-number,.tiptap .code-block-wrapper .theme-light .hljs-symbol,.tiptap .code-block-wrapper .theme-light .hljs-bullet{color:#098658!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-light .hljs-function,.tiptap .code-block-wrapper .theme-light .hljs-params{color:#795e26!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-light .hljs-attr,.tiptap .code-block-wrapper .theme-light .hljs-variable,.tiptap .code-block-wrapper .theme-light .hljs-property{color:#001080!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.tiptap .code-block-wrapper .theme-light .hljs-built_in,.tiptap .code-block-wrapper .theme-light .hljs-class{color:#267f99!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}}",az=".tiptap img{display:block;max-width:100%;height:auto;border-radius:4px;page-break-inside:avoid}.tiptap [data-node-view-wrapper]{position:relative;display:block}.tiptap [data-node-view-wrapper] img{max-width:100%;height:auto;-o-object-fit:contain;object-fit:contain}.tiptap [data-node-view-wrapper].w-fit{margin-left:0;margin-right:auto}.tiptap [data-node-view-wrapper].mx-auto{display:block!important;margin-left:auto!important;margin-right:auto!important}.tiptap [data-node-view-wrapper].ml-auto{display:block!important;margin-left:auto!important;margin-right:0!important}@media print{.tiptap img{max-width:100%!important;page-break-inside:avoid;page-break-after:auto;border:none!important}.tiptap [data-node-view-wrapper].w-fit{margin-left:0!important;margin-right:auto!important}.tiptap [data-node-view-wrapper].mx-auto{display:block!important;margin-left:auto!important;margin-right:auto!important}.tiptap [data-node-view-wrapper].ml-auto{display:block!important;margin-left:auto!important;margin-right:0!important}.tiptap [data-node-view-wrapper]>div>div>div{display:none!important}.tiptap [data-node-view-wrapper] img{border:none!important}}",sz=".page-columns{display:grid;gap:1rem;margin:1rem 0}.page-columns-1{grid-template-columns:repeat(1,1fr)}.page-columns-2{grid-template-columns:repeat(2,1fr)}.page-columns-3{grid-template-columns:repeat(3,1fr)}.page-columns-4{grid-template-columns:repeat(4,1fr)}.page-columns-5{grid-template-columns:repeat(5,1fr)}.page-columns-6{grid-template-columns:repeat(6,1fr)}.page-column-node{min-height:50px;padding-right:1rem;border-right:1px solid #e0e0e0;min-width:0;overflow-wrap:break-word;word-break:break-word}.page-column-node:last-child{border-right:none;padding-right:0}.page-columns.no-dividers .page-column-node{border-right:none}",lz=()=>{const{editor:e,editorConfig:t}=lt(),n=()=>{if(!e?.getText)return;const s=e.getText(),l=new Blob([s],{type:"text/plain;charset=utf-8"}),c=t?.file?.name||"Untitled document",d=URL.createObjectURL(l),u=document.createElement("a");u.href=d,u.download=`${c}.txt`,document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(d)},r=()=>{if(!e?.getJSON)return;const s=e.getJSON(),l=t?.file?.name||"Untitled document",c=new Blob([JSON.stringify(s,null,2)],{type:"application/json"}),d=URL.createObjectURL(c),u=document.createElement("a");u.href=d,u.download=`${l}.json`,document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(d)},i=()=>{if(!e?.getText)return;const s=e.getText(),l=new Blob([s],{type:"text/markdown;charset=utf-8"}),c=t?.file?.name||"Untitled document",d=URL.createObjectURL(l),u=document.createElement("a");u.href=d,u.download=`${c}.md`,document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(d)},o=()=>{if(!e?.getHTML)return;const s=e.getHTML(),l=new Blob([s],{type:"text/html;charset=utf-8"}),c=t?.file?.name||"Untitled document",d=URL.createObjectURL(l),u=document.createElement("a");u.href=d,u.download=`${c}.html`,document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(d)},a=A.useCallback(()=>{try{const s=t?.file?.name||"Untitled document",l=document.querySelector(".editor-content")?.innerHTML||"",c=e?.storage?.pageMargin,d=c?.margins||{top:1,right:1,bottom:1,left:1},u=c?.unit||"in";console.log("this is the content",d,u);let p="portrait",m={width:210,height:297},_="white";const h=document.querySelector(".editor-content");if(h instanceof HTMLElement){const y=h.style.width,T=h.style.height;y&&T&&(m={width:parseFloat(y),height:parseFloat(T)})}const g=document.querySelector(".editor-content");if(g instanceof HTMLElement){const y=window.getComputedStyle(g).backgroundColor;y&&y!=="rgba(0, 0, 0, 0)"&&y!=="transparent"&&(_=y)}try{const y=document.body.getAttribute("data-page-orientation");y&&(p=y)}catch(y){console.error("Error parsing page orientation:",y)}const b=document.createElement("iframe");b.style.position="fixed",b.style.right="0",b.style.bottom="0",b.style.width="0",b.style.height="0",b.style.border="none",document.body.appendChild(b);const E=b.contentDocument||b.contentWindow?.document;if(!E)throw new Error("Could not access iframe document");E.open(),E.write(`
229
229
  <!DOCTYPE html>
230
230
  <html>
231
231
  <head>
@@ -277,4 +277,4 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
277
277
  </div>
278
278
  </body>
279
279
  </html>
280
- `),E.close();const S=document.title;b.contentWindow&&(b.contentWindow.document.title=s),document.title=s,setTimeout(()=>{b.contentWindow&&(b.contentWindow.document.title=s),document.title=s},100),setTimeout(()=>{try{if(b.contentWindow)b.contentWindow.matchMedia&&b.contentWindow.matchMedia("print").addEventListener("change",function(T){T.matches||(document.title=S,document.body.removeChild(b))}),b.contentWindow.document.title=s||"Untitled document",b.contentWindow.focus(),b.contentWindow.print(),setTimeout(()=>{document.body.contains(b)&&document.body.removeChild(b),document.title=S},1e3);else throw new Error("Cannot access iframe content window")}catch(y){document.body.removeChild(b),document.title=S,Oe.message.error("Failed to export: "+String(y))}},1e3)}catch(s){Oe.message.error("Failed to export: "+String(s))}},[t]);return{downloadTextFile:n,downloadJsonFile:r,downloadMarkdownFile:i,downloadHtmlFile:o,downloadPdfFile:a}},cz=[{value:"A4",label:"A4 (210 × 297 mm)",description:"210 × 297 mm"},{value:"A3",label:"A3 (297 × 420 mm)",description:"297 × 420 mm"},{value:"Letter",label:"Letter (8.5 × 11 in)",description:"8.5 × 11 in"},{value:"Legal",label:"Legal (8.5 × 14 in)",description:"8.5 × 14 in"},{value:"Tabloid",label:"Tabloid (11 × 17 in)",description:"11 × 17 in"}],dz=({onApply:e,onClose:t})=>{const{pageConfig:n,setPageConfig:r}=vd(),{selectedBGColor:i,margins:o,inputValues:a,handleMarginInputChange:s,handleMarginInputBlur:l,handleMarginKeyDown:c,applyPresetMargins:d,handleSetPageBackgroundColor:u,applyMargins:p}=JT(),m=A.useRef({pageConfig:{...n},bgColor:document.body.getAttribute("data-page-background-color")??i,margins:{...o}}),[_,h]=A.useState(!1),g=()=>{p(),m.current={pageConfig:{...n},bgColor:i,margins:{...o}},e?.(),t?.()},b=()=>{m.current&&(r(m.current.pageConfig),u(m.current.bgColor)),t?.()},E="w-16 text-xs p-1 border border-gray-300 dark:border-black-500 rounded bg-white dark:bg-black-700 text-neutral-900 dark:text-white";return f.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-black-800",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-black-600",children:[f.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Page Settings"}),t&&f.jsx("button",{onClick:b,className:"text-gray-400 dark:text-black-400 hover:text-gray-600 dark:hover:text-black-200 transition-colors",children:f.jsx(ee.Close,{sx:{fontSize:20}})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[f.jsxs("div",{className:"mb-4",children:[f.jsx("h4",{className:"text-xs font-medium mb-2 text-neutral-700 dark:text-black-200",children:"Orientation"}),f.jsx(G.Tabs,{variant:"switch",size:"sm",fullWidth:!0,className:"w-full",tabs:["PORTRAIT","LANDSCAPE"],activeTab:n.orientation.toUpperCase(),onTabClick:S=>r({...n,orientation:S==="LANDSCAPE"?"landscape":"portrait"}),tabIcons:{PORTRAIT:f.jsx(ee.CropPortrait,{sx:{fontSize:18},className:"mb-0.5"}),LANDSCAPE:f.jsx(ee.CropLandscape,{sx:{fontSize:18},className:"mb-px"})}})]}),f.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[f.jsxs("div",{className:"flex-1",children:[f.jsx("h4",{className:"text-xs font-medium mb-1 text-neutral-700 dark:text-black-200",children:"Page Size"}),f.jsx(G.SelectField,{value:n.size,onChange:S=>r({...n,size:S}),selectOptions:cz,placeholder:"Select Page Size",className:"w-full",suffixIcon:_?f.jsx(ee.ExpandLessOutlined,{sx:{fontSize:20}}):f.jsx(ee.ExpandMoreOutlined,{sx:{fontSize:20}}),onDropdownVisibleChange:S=>h(S),getPopupContainer:()=>document.getElementById("editor-shell-qwCfsxssdsfsd")??document.body})]}),f.jsxs("div",{className:"w-20",children:[f.jsx("h4",{className:"text-xs font-medium mb-1 text-neutral-700 dark:text-black-200",children:"Page Color"}),f.jsx(OF,{selectedBGColor:i,setSelectedBGColor:u})]})]}),f.jsxs("div",{className:"mb-4",children:[f.jsx("h4",{className:"text-xs font-medium mb-1 text-neutral-700 dark:text-black-200",children:"Preset Margins"}),f.jsx("div",{className:"grid grid-cols-2 gap-1",children:Object.entries(KT).map(([S])=>f.jsx("button",{className:"h-8 text-xs py-1.5 px-2 bg-neutral-50 dark:bg-black-700 border border-neutral-200 dark:border-black-500 hover:bg-neutral-200 dark:hover:bg-black-600 text-neutral-900 dark:text-white rounded transition-colors",onClick:()=>d(S),children:S},S))})]}),f.jsx("div",{children:f.jsx("h4",{className:"text-xs font-medium mb-1 text-neutral-700 dark:text-black-200",children:"Margins"})}),f.jsx("div",{className:"mb-4 w-full bg-neutral-100 dark:bg-black-700 p-2 rounded border border-neutral-300 dark:border-black-500",children:f.jsxs("div",{className:"w-full flex gap-2 items-center justify-center",children:[f.jsx("div",{className:"flex items-center gap-1 justify-end",children:f.jsx("div",{className:"flex items-center",children:f.jsx("input",{type:"text",value:a.left,onChange:S=>s("left",S.target.value),onKeyDown:S=>c(S,"left"),onBlur:()=>l("left"),className:E,placeholder:"Left"})})}),f.jsxs("div",{className:"flex flex-col items-center gap-2",children:[f.jsx("div",{className:"flex flex-col items-center gap-0.5",children:f.jsx("div",{className:"flex items-center",children:f.jsx("input",{type:"text",value:a.top,onChange:S=>s("top",S.target.value),onKeyDown:S=>c(S,"top"),onBlur:()=>l("top"),className:E,placeholder:"Top"})})}),f.jsx("div",{className:"flex items-center justify-center",children:f.jsx("div",{className:`relative ${n.orientation==="portrait"?"w-24 h-32":"w-32 h-24"} border border-gray-300 dark:border-black-500 bg-white dark:bg-black-600`,children:f.jsx("div",{className:"absolute bg-primary-100 dark:bg-primary-900 border border-primary-300 dark:border-primary-600",style:{top:`${Math.min(o.top/10*100,80)}%`,left:`${Math.min(o.left/10*100,80)}%`,right:`${Math.min(o.right/10*100,80)}%`,bottom:`${Math.min(o.bottom/10*100,80)}%`}})})}),f.jsx("div",{className:"flex flex-col-reverse items-center gap-0.5",children:f.jsx("div",{className:"flex items-center",children:f.jsx("input",{type:"text",value:a.bottom,onChange:S=>s("bottom",S.target.value),onKeyDown:S=>c(S,"bottom"),onBlur:()=>l("bottom"),className:E,placeholder:"Bottom"})})})]}),f.jsx("div",{className:"flex flex-row-reverse items-center gap-1 justify-start",children:f.jsx("div",{className:"flex items-center",children:f.jsx("input",{type:"text",value:a.right,onChange:S=>s("right",S.target.value),onKeyDown:S=>c(S,"right"),onBlur:()=>l("right"),className:E,placeholder:"Right"})})})]})})]}),f.jsxs("div",{className:"px-4 py-3 border-t border-gray-200 dark:border-black-600 flex items-center justify-between bg-white dark:bg-black-800",children:[f.jsx("button",{onClick:b,className:"px-3 py-1.5 border border-neutral-300 dark:border-black-500 text-sm font-medium text-neutral-900 dark:text-white hover:bg-neutral-100 dark:hover:bg-black-700 rounded-lg transition-colors",children:"Cancel"}),f.jsx("button",{onClick:g,className:"px-3 py-1.5 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 rounded-lg transition-colors",children:"Apply"})]})]})},uz=({position:e="right",currentMode:t})=>{const[n,r]=A.useState(!1),{isDarkMode:i}=yd(),{downloadTextFile:o,downloadJsonFile:a,downloadMarkdownFile:s,downloadHtmlFile:l,downloadPdfFile:c}=lz(),d=_=>{switch(_.fileType.value){case"text":o();break;case"json":a();break;case"markdown":s();break;case"html":l();break;case"pdf":c();break;default:o();break}},u=_=>{console.log("Search:",_)},p=(_,h)=>{console.log("Replace:",_,"with",h)},m=[{id:"add",icon:f.jsx(ie,{className:"dark:text-neutral-100",name:"insert-icon",size:24}),label:"Add Element",content:f.jsx(q7,{onClose:()=>r(!1)}),notVisible:t==="viewing"},{id:"search",icon:f.jsx(ie,{className:"dark:text-neutral-100",name:"document-search",size:24}),label:"Find and Replace",content:f.jsx(k7,{currentMode:t,onSearch:u,onReplace:p,onClose:()=>r(!1)})},{id:"ai",icon:f.jsx(ie,{className:"dark:text-neutral-100",name:"ai-icon",size:24}),label:"AI Assistant",content:f.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-black-800",children:[f.jsx("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-black-600",children:f.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"AI Assistant"})}),f.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:f.jsx("p",{className:"text-sm text-gray-600 dark:text-black-300",children:"AI Assistant features coming soon..."})})]}),notVisible:!0},{id:"page-settings",icon:f.jsx(ie,{className:"dark:text-neutral-100",name:i?"page-settings-dark":"page-settings",size:20}),label:"Page Settings",content:f.jsx(dz,{onClose:()=>r(!1)}),notVisible:t==="viewing"},{id:"pii-anonymization",icon:f.jsx(ie,{className:"dark:text-neutral-100",name:"pii-anonymization",size:24}),label:"PII Anonymization",content:f.jsx(X9,{onClose:()=>r(!1)}),notVisible:t==="viewing"||t==="suggesting"},{id:"export",icon:f.jsx(ie,{className:"dark:text-neutral-100",name:"download-rounded",size:18}),label:"Export Document",content:f.jsx(O7,{onExport:d,onClose:()=>r(!1)})}];return f.jsx(A7,{id:"editor-sidebar-qwCfsdsfsd",tools:m,position:e,isExpanded:n,expandedWidth:370,toggleToolbar:r})},pz=({editorPageRef:e,isPresentationMode:t,pageClass:n})=>{const{editor:r,editorConfig:i}=lt(),{currentMode:o}=vd(),a=i.editable&&!i.asViewer&&!t&&o!==Gi.VIEWING.value;return f.jsxs("div",{className:`${i.enablePagination?n:""} editor-content`,ref:e,id:"editor-content-qwCfsdsfsd",children:[f.jsx(wA,{editor:r}),a&&f.jsx(wU,{editor:r})]})},mz=()=>{const{currentMode:e,editorConfig:t}=vd();return e===Gi.VIEWING.value||t?.asViewer?null:f.jsx(RF,{})},fz=()=>{const e=A.useRef(null),t=A.useRef(null),{editor:n,editorConfig:r,redlineItemWidth:i}=lt(),{pageClass:o,pageConfig:a,setPageConfig:s}=JT(),{isDarkMode:l}=yd(),{isPresentationMode:c,isLaserActive:d,onPresentationModeToggle:u,handleLaserToggle:p}=YB(n,t),{changes:m}=Hf(),_=m.length>0&&!c;return A.useEffect(()=>{if(!n||!e.current)return;const h=g=>{const b=g.target;if(!b||!e.current?.contains(b)||b.closest("button, input, textarea, select, a, [role='button']"))return;if(n.view.dom.contains(b)){n.commands.focus();return}const S=n.view.posAtCoords({left:g.clientX,top:g.clientY})?.pos??n.state.selection.to;n.chain().focus().setTextSelection(S).run()};return document.addEventListener("click",h),()=>{document.removeEventListener("click",h)}},[n]),f.jsx(AF,{editorConfig:r,onPresentationModeToggle:u,pageConfig:a,setPageConfig:s,children:f.jsxs("div",{ref:t,className:`max-w-full h-full relative flex flex-col bg-neutral-200 dark:bg-black-900 editor-container ${c?"editor-presentation-mode":""} ${d?"laser-active":""} ${l?"dark":""}`,id:"editor-shell-qwCfsxssdsfsd",children:[f.jsx(mz,{}),f.jsxs("div",{className:"flex flex-1 min-h-0 dark:bg-black-600",children:[f.jsx(e7,{children:f.jsx("div",{className:"flex-1 overflow-auto",children:f.jsxs("div",{className:"min-h-full w-fit min-w-full flex justify-center items-start p-4",children:[f.jsx(pz,{editorPageRef:e,isPresentationMode:c,pageClass:o}),_&&f.jsx("div",{style:{width:`${i+40}px`,transition:"width 220ms ease"}})]})})}),!c&&!r?.asViewer&&f.jsx(uz,{position:"left",currentMode:r?.mode||"viewing"}),!c&&f.jsx(R7,{})]}),!c&&!r?.asViewer&&f.jsx(MU,{onPresentationModeToggle:u}),c&&f.jsx(LU,{onPresentationModeToggle:u,onLaserToggle:p})]})})};function Xy(e){return e==null?!1:typeof e=="string"?e.trim().length>0:typeof e=="object"?Object.keys(e).length>0:!1}const _z=({config:e={}})=>{const t={...uO,...e},n=A.useRef(t);n.current=t;const r=A.useRef(null),i=A.useRef(!1),o=t.content!==null&&typeof t.content=="object"?kp(t.content,t.piiAnonymization?.settings?.placeholderFormat??"numbered"):t.content,a=!!(t.collaborativeEditing?.enabled&&t.collaborativeEditing?.ydoc&&t.collaborativeEditing?.provider),s=BA({extensions:VB(t),...a?{}:{content:o},autofocus:!1,editable:!t.asViewer&&t.editable,onUpdate:({editor:l})=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{t.onContentChange&&t.onContentChange(l)},t.debounceTimeForContentChange)}},a?[t.file?.id??""]:[t.content]);return A.useEffect(()=>{i.current=!1},[t.file?.id,a]),A.useEffect(()=>{if(!a||!s||s.isDestroyed)return;const l=t.collaborativeEditing;if(!l?.provider||!Xy(o))return;const c=l.provider;if(typeof c.on!="function")return;const d=()=>{queueMicrotask(()=>{if(!(i.current||!s||s.isDestroyed)){if(!s.isEmpty){i.current=!0;return}if(!Xy(o)){i.current=!0;return}i.current=!0,s.commands.setContent(o)}})};return c.on("synced",d),c.synced&&d(),()=>c.off?.("synced",d)},[s,a,t.collaborativeEditing,o]),A.useEffect(()=>{if(!s||s.isDestroyed||!t.piiAnonymization?.onScanComplete)return;const l=c=>{const d=s;if(!d||d.isDestroyed)return;const p=n.current.piiAnonymization?.settings?.placeholderFormat??"numbered";if(typeof c=="string"){d.commands.setContent(c);return}if(c!==null&&typeof c=="object"&&!Array.isArray(c)){const m=kp(c,p);d.commands.setContent(m)}};t.piiAnonymization?.onScanComplete(l)},[s,t.piiAnonymization?.onScanComplete]),A.useEffect(()=>()=>{s?.destroy()},[s]),s?f.jsx(A8,{editor:s,editorConfig:t,children:f.jsx(Oe.ConfigProvider,{prefixCls:"editor",children:f.jsx(fz,{})})}):null},hz=({config:e={},children:t})=>{const n=e1(),r=e.theme?.isDarkMode??n;return f.jsx(t1.Provider,{value:{config:e,isDarkMode:r},children:t})};on.Editor=_z,on.EditorProvider=hz,on.useEditorProvider=yd,Object.defineProperty(on,Symbol.toStringTag,{value:"Module"})}));
280
+ `),E.close();const S=document.title;b.contentWindow&&(b.contentWindow.document.title=s),document.title=s,setTimeout(()=>{b.contentWindow&&(b.contentWindow.document.title=s),document.title=s},100),setTimeout(()=>{try{if(b.contentWindow)b.contentWindow.matchMedia&&b.contentWindow.matchMedia("print").addEventListener("change",function(T){T.matches||(document.title=S,document.body.removeChild(b))}),b.contentWindow.document.title=s||"Untitled document",b.contentWindow.focus(),b.contentWindow.print(),setTimeout(()=>{document.body.contains(b)&&document.body.removeChild(b),document.title=S},1e3);else throw new Error("Cannot access iframe content window")}catch(y){document.body.removeChild(b),document.title=S,Oe.message.error("Failed to export: "+String(y))}},1e3)}catch(s){Oe.message.error("Failed to export: "+String(s))}},[t]);return{downloadTextFile:n,downloadJsonFile:r,downloadMarkdownFile:i,downloadHtmlFile:o,downloadPdfFile:a}},cz=[{value:"A4",label:"A4 (210 × 297 mm)",description:"210 × 297 mm"},{value:"A3",label:"A3 (297 × 420 mm)",description:"297 × 420 mm"},{value:"Letter",label:"Letter (8.5 × 11 in)",description:"8.5 × 11 in"},{value:"Legal",label:"Legal (8.5 × 14 in)",description:"8.5 × 14 in"},{value:"Tabloid",label:"Tabloid (11 × 17 in)",description:"11 × 17 in"}],dz=({onApply:e,onClose:t})=>{const{pageConfig:n,setPageConfig:r}=vd(),{selectedBGColor:i,margins:o,inputValues:a,handleMarginInputChange:s,handleMarginInputBlur:l,handleMarginKeyDown:c,applyPresetMargins:d,handleSetPageBackgroundColor:u,applyMargins:p}=JT(),m=A.useRef({pageConfig:{...n},bgColor:document.body.getAttribute("data-page-background-color")??i,margins:{...o}}),[_,h]=A.useState(!1),g=()=>{p(),m.current={pageConfig:{...n},bgColor:i,margins:{...o}},e?.(),t?.()},b=()=>{m.current&&(r(m.current.pageConfig),u(m.current.bgColor)),t?.()},E="w-16 text-xs p-1 border border-gray-300 dark:border-black-500 rounded bg-white dark:bg-black-700 text-neutral-900 dark:text-white";return f.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-black-800",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-black-600",children:[f.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Page Settings"}),t&&f.jsx("button",{onClick:b,className:"text-gray-400 dark:text-black-400 hover:text-gray-600 dark:hover:text-black-200 transition-colors",children:f.jsx(ee.Close,{sx:{fontSize:20}})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[f.jsxs("div",{className:"mb-4",children:[f.jsx("h4",{className:"text-xs font-medium mb-2 text-neutral-700 dark:text-black-200",children:"Orientation"}),f.jsx(G.Tabs,{variant:"switch",size:"sm",fullWidth:!0,className:"w-full",tabs:["PORTRAIT","LANDSCAPE"],activeTab:n.orientation.toUpperCase(),onTabClick:S=>r({...n,orientation:S==="LANDSCAPE"?"landscape":"portrait"}),tabIcons:{PORTRAIT:f.jsx(ee.CropPortrait,{sx:{fontSize:18},className:"mb-0.5"}),LANDSCAPE:f.jsx(ee.CropLandscape,{sx:{fontSize:18},className:"mb-px"})}})]}),f.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[f.jsxs("div",{className:"flex-1",children:[f.jsx("h4",{className:"text-xs font-medium mb-1 text-neutral-700 dark:text-black-200",children:"Page Size"}),f.jsx(G.SelectField,{value:n.size,onChange:S=>r({...n,size:S}),selectOptions:cz,placeholder:"Select Page Size",className:"w-full",suffixIcon:_?f.jsx(ee.ExpandLessOutlined,{sx:{fontSize:20}}):f.jsx(ee.ExpandMoreOutlined,{sx:{fontSize:20}}),onDropdownVisibleChange:S=>h(S),getPopupContainer:()=>document.getElementById("editor-shell-qwCfsxssdsfsd")??document.body})]}),f.jsxs("div",{className:"w-20",children:[f.jsx("h4",{className:"text-xs font-medium mb-1 text-neutral-700 dark:text-black-200",children:"Page Color"}),f.jsx(OF,{selectedBGColor:i,setSelectedBGColor:u})]})]}),f.jsxs("div",{className:"mb-4",children:[f.jsx("h4",{className:"text-xs font-medium mb-1 text-neutral-700 dark:text-black-200",children:"Preset Margins"}),f.jsx("div",{className:"grid grid-cols-2 gap-1",children:Object.entries(KT).map(([S])=>f.jsx("button",{className:"h-8 text-xs py-1.5 px-2 bg-neutral-50 dark:bg-black-700 border border-neutral-200 dark:border-black-500 hover:bg-neutral-200 dark:hover:bg-black-600 text-neutral-900 dark:text-white rounded transition-colors",onClick:()=>d(S),children:S},S))})]}),f.jsx("div",{children:f.jsx("h4",{className:"text-xs font-medium mb-1 text-neutral-700 dark:text-black-200",children:"Margins"})}),f.jsx("div",{className:"mb-4 w-full bg-neutral-100 dark:bg-black-700 p-2 rounded border border-neutral-300 dark:border-black-500",children:f.jsxs("div",{className:"w-full flex gap-2 items-center justify-center",children:[f.jsx("div",{className:"flex items-center gap-1 justify-end",children:f.jsx("div",{className:"flex items-center",children:f.jsx("input",{type:"text",value:a.left,onChange:S=>s("left",S.target.value),onKeyDown:S=>c(S,"left"),onBlur:()=>l("left"),className:E,placeholder:"Left"})})}),f.jsxs("div",{className:"flex flex-col items-center gap-2",children:[f.jsx("div",{className:"flex flex-col items-center gap-0.5",children:f.jsx("div",{className:"flex items-center",children:f.jsx("input",{type:"text",value:a.top,onChange:S=>s("top",S.target.value),onKeyDown:S=>c(S,"top"),onBlur:()=>l("top"),className:E,placeholder:"Top"})})}),f.jsx("div",{className:"flex items-center justify-center",children:f.jsx("div",{className:`relative ${n.orientation==="portrait"?"w-24 h-32":"w-32 h-24"} border border-gray-300 dark:border-black-500 bg-white dark:bg-black-600`,children:f.jsx("div",{className:"absolute bg-primary-100 dark:bg-primary-900 border border-primary-300 dark:border-primary-600",style:{top:`${Math.min(o.top/10*100,80)}%`,left:`${Math.min(o.left/10*100,80)}%`,right:`${Math.min(o.right/10*100,80)}%`,bottom:`${Math.min(o.bottom/10*100,80)}%`}})})}),f.jsx("div",{className:"flex flex-col-reverse items-center gap-0.5",children:f.jsx("div",{className:"flex items-center",children:f.jsx("input",{type:"text",value:a.bottom,onChange:S=>s("bottom",S.target.value),onKeyDown:S=>c(S,"bottom"),onBlur:()=>l("bottom"),className:E,placeholder:"Bottom"})})})]}),f.jsx("div",{className:"flex flex-row-reverse items-center gap-1 justify-start",children:f.jsx("div",{className:"flex items-center",children:f.jsx("input",{type:"text",value:a.right,onChange:S=>s("right",S.target.value),onKeyDown:S=>c(S,"right"),onBlur:()=>l("right"),className:E,placeholder:"Right"})})})]})})]}),f.jsxs("div",{className:"px-4 py-3 border-t border-gray-200 dark:border-black-600 flex items-center justify-between bg-white dark:bg-black-800",children:[f.jsx("button",{onClick:b,className:"px-3 py-1.5 border border-neutral-300 dark:border-black-500 text-sm font-medium text-neutral-900 dark:text-white hover:bg-neutral-100 dark:hover:bg-black-700 rounded-lg transition-colors",children:"Cancel"}),f.jsx("button",{onClick:g,className:"px-3 py-1.5 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 rounded-lg transition-colors",children:"Apply"})]})]})},uz=({position:e="right",currentMode:t})=>{const[n,r]=A.useState(!1),{isDarkMode:i}=yd();A.useEffect(()=>{r(!1)},[t]);const{downloadTextFile:o,downloadJsonFile:a,downloadMarkdownFile:s,downloadHtmlFile:l,downloadPdfFile:c}=lz(),d=_=>{switch(_.fileType.value){case"text":o();break;case"json":a();break;case"markdown":s();break;case"html":l();break;case"pdf":c();break;default:o();break}},u=_=>{console.log("Search:",_)},p=(_,h)=>{console.log("Replace:",_,"with",h)},m=[{id:"add",icon:f.jsx(ie,{className:"dark:text-neutral-100",name:"insert-icon",size:24}),label:"Add Element",content:f.jsx(q7,{onClose:()=>r(!1)}),notVisible:t==="viewing"},{id:"search",icon:f.jsx(ie,{className:"dark:text-neutral-100",name:"document-search",size:24}),label:"Find and Replace",content:f.jsx(k7,{currentMode:t,onSearch:u,onReplace:p,onClose:()=>r(!1)})},{id:"ai",icon:f.jsx(ie,{className:"dark:text-neutral-100",name:"ai-icon",size:24}),label:"AI Assistant",content:f.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-black-800",children:[f.jsx("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-black-600",children:f.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"AI Assistant"})}),f.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:f.jsx("p",{className:"text-sm text-gray-600 dark:text-black-300",children:"AI Assistant features coming soon..."})})]}),notVisible:!0},{id:"page-settings",icon:f.jsx(ie,{className:"dark:text-neutral-100",name:i?"page-settings-dark":"page-settings",size:20}),label:"Page Settings",content:f.jsx(dz,{onClose:()=>r(!1)}),notVisible:t==="viewing"},{id:"pii-anonymization",icon:f.jsx(ie,{className:"dark:text-neutral-100",name:"pii-anonymization",size:24}),label:"PII Anonymization",content:f.jsx(X9,{onClose:()=>r(!1)}),notVisible:t==="viewing"||t==="suggesting"},{id:"export",icon:f.jsx(ie,{className:"dark:text-neutral-100",name:"download-rounded",size:18}),label:"Export Document",content:f.jsx(O7,{onExport:d,onClose:()=>r(!1)})}];return f.jsx(A7,{id:"editor-sidebar-qwCfsdsfsd",tools:m,position:e,isExpanded:n,expandedWidth:370,toggleToolbar:r})},pz=({editorPageRef:e,isPresentationMode:t,pageClass:n})=>{const{editor:r,editorConfig:i}=lt(),{currentMode:o}=vd(),a=i.editable&&!i.asViewer&&!t&&o!==Gi.VIEWING.value;return f.jsxs("div",{className:`${i.enablePagination?n:""} editor-content`,ref:e,id:"editor-content-qwCfsdsfsd",children:[f.jsx(wA,{editor:r}),a&&f.jsx(wU,{editor:r})]})},mz=()=>{const{currentMode:e,editorConfig:t}=vd();return e===Gi.VIEWING.value||t?.asViewer?null:f.jsx(RF,{})},fz=()=>{const e=A.useRef(null),t=A.useRef(null),{editor:n,editorConfig:r,redlineItemWidth:i}=lt(),{pageClass:o,pageConfig:a,setPageConfig:s}=JT(),{isDarkMode:l}=yd(),{isPresentationMode:c,isLaserActive:d,onPresentationModeToggle:u,handleLaserToggle:p}=YB(n,t),{changes:m}=Hf(),_=m.length>0&&!c;return A.useEffect(()=>{if(!n||!e.current)return;const h=g=>{const b=g.target;if(!b||!e.current?.contains(b)||b.closest("button, input, textarea, select, a, [role='button']"))return;if(n.view.dom.contains(b)){n.commands.focus();return}const S=n.view.posAtCoords({left:g.clientX,top:g.clientY})?.pos??n.state.selection.to;n.chain().focus().setTextSelection(S).run()};return document.addEventListener("click",h),()=>{document.removeEventListener("click",h)}},[n]),f.jsx(AF,{editorConfig:r,onPresentationModeToggle:u,pageConfig:a,setPageConfig:s,children:f.jsxs("div",{ref:t,className:`max-w-full h-full relative flex flex-col bg-neutral-200 dark:bg-black-900 editor-container ${c?"editor-presentation-mode":""} ${d?"laser-active":""} ${l?"dark":""}`,id:"editor-shell-qwCfsxssdsfsd",children:[f.jsx(mz,{}),f.jsxs("div",{className:"flex flex-1 min-h-0 dark:bg-black-600",children:[f.jsx(e7,{children:f.jsx("div",{className:"flex-1 overflow-auto",children:f.jsxs("div",{className:"min-h-full w-fit min-w-full flex justify-center items-start p-4",children:[f.jsx(pz,{editorPageRef:e,isPresentationMode:c,pageClass:o}),_&&f.jsx("div",{style:{width:`${i+40}px`,transition:"width 220ms ease"}})]})})}),!c&&!r?.asViewer&&f.jsx(uz,{position:"left",currentMode:r?.mode||"viewing"}),!c&&f.jsx(R7,{})]}),!c&&!r?.asViewer&&f.jsx(MU,{onPresentationModeToggle:u}),c&&f.jsx(LU,{onPresentationModeToggle:u,onLaserToggle:p})]})})};function Xy(e){return e==null?!1:typeof e=="string"?e.trim().length>0:typeof e=="object"?Object.keys(e).length>0:!1}const _z=({config:e={}})=>{const t={...uO,...e},n=A.useRef(t);n.current=t;const r=A.useRef(null),i=A.useRef(!1),o=t.content!==null&&typeof t.content=="object"?kp(t.content,t.piiAnonymization?.settings?.placeholderFormat??"numbered"):t.content,a=!!(t.collaborativeEditing?.enabled&&t.collaborativeEditing?.ydoc&&t.collaborativeEditing?.provider),s=BA({extensions:VB(t),...a?{}:{content:o},autofocus:!1,editable:!t.asViewer&&t.editable,onUpdate:({editor:l})=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{t.onContentChange&&t.onContentChange(l)},t.debounceTimeForContentChange)}},a?[t.file?.id??""]:[t.content]);return A.useEffect(()=>{i.current=!1},[t.file?.id,a]),A.useEffect(()=>{if(!a||!s||s.isDestroyed)return;const l=t.collaborativeEditing;if(!l?.provider||!Xy(o))return;const c=l.provider;if(typeof c.on!="function")return;const d=()=>{queueMicrotask(()=>{if(!(i.current||!s||s.isDestroyed)){if(!s.isEmpty){i.current=!0;return}if(!Xy(o)){i.current=!0;return}i.current=!0,s.commands.setContent(o)}})};return c.on("synced",d),c.synced&&d(),()=>c.off?.("synced",d)},[s,a,t.collaborativeEditing,o]),A.useEffect(()=>{if(!s||s.isDestroyed||!t.piiAnonymization?.onScanComplete)return;const l=c=>{const d=s;if(!d||d.isDestroyed)return;const p=n.current.piiAnonymization?.settings?.placeholderFormat??"numbered";if(typeof c=="string"){d.commands.setContent(c);return}if(c!==null&&typeof c=="object"&&!Array.isArray(c)){const m=kp(c,p);d.commands.setContent(m)}};t.piiAnonymization?.onScanComplete(l)},[s,t.piiAnonymization?.onScanComplete]),A.useEffect(()=>()=>{s?.destroy()},[s]),s?f.jsx(A8,{editor:s,editorConfig:t,children:f.jsx(Oe.ConfigProvider,{prefixCls:"editor",children:f.jsx(fz,{})})}):null},hz=({config:e={},children:t})=>{const n=e1(),r=e.theme?.isDarkMode??n;return f.jsx(t1.Provider,{value:{config:e,isDarkMode:r},children:t})};on.Editor=_z,on.EditorProvider=hz,on.useEditorProvider=yd,Object.defineProperty(on,Symbol.toStringTag,{value:"Module"})}));