ados-rcm 1.1.379 → 1.1.381
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.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
@@ -344,7 +344,7 @@ Error generating stack: `+d.message+`
|
|
344
344
|
`,"user"),this.quill.setSelection(i+1,0),t.index=i+1}else{const l=this.quill.getLine(t.index)[0];l&&l.length()>1?(this.quill.insertText(t.index,`
|
345
345
|
|
346
346
|
`,"user"),t.index+=2):(this.quill.insertText(t.index,`
|
347
|
-
`,"user"),t.index+=1)}}findTableParent(e){let t=e;for(;t;){if(t.domNode&&t.domNode.tagName==="TABLE")return t;t=t.parent}return null}hidePicker(){this.removeTooltip(),this.picker&&(this.picker.remove(),this.picker=null),this.tableButton&&this.tableButton.classList.remove("ql-expanded")}}var Iu={},Wb;function MP(){if(Wb)return Iu;Wb=1;var r=Fs;if(process.env.NODE_ENV==="production")Iu.createRoot=r.createRoot,Iu.hydrateRoot=r.hydrateRoot;else{var e=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Iu.createRoot=function(t,n){e.usingClientEntryPoint=!0;try{return r.createRoot(t,n)}finally{e.usingClientEntryPoint=!1}},Iu.hydrateRoot=function(t,n,i){e.usingClientEntryPoint=!0;try{return r.hydrateRoot(t,n,i)}finally{e.usingClientEntryPoint=!1}}}return Iu}var DP=MP();const Vb=il(DP);class OP{constructor(e,t){it(this,"DEFAULTS",{maxRowCount:-1});it(this,"quill");it(this,"options");it(this,"position",null);it(this,"table");it(this,"selectedCell",null);it(this,"menuRoot",null);it(this,"helperTextElement",null);it(this,"scrollTimeout",null);it(this,"SCROLL_DEBOUNCE_TIME",80);it(this,"lastSelectedCellRef",null);it(this,"boundDocClickHandler",this.hideMenu.bind(this));it(this,"boundEditorChangeHandler",this.editorChangeHandler.bind(this));it(this,"boundContextMenuHandler",this.contextMenuHandler.bind(this));it(this,"boundCopyHandler",this.copyHandler.bind(this));it(this,"boundScrollHandler",this.handleScroll.bind(this));it(this,"boundPasteHandler",this.pasteHandler.bind(this));it(this,"menuItems",[]);it(this,"positionCache",new Map);it(this,"POSITION_CACHE_LIFETIME",1e3);it(this,"reactRoot",null);if(this.quill=e,this.options={...this.DEFAULTS,...t},this.table=e.getModule("table"),!this.table){console.error('"table" module not found');return}this.initializeMenuItems(),this.overrideTableMethods(),this.initializeHelperText(),this.attachEventListeners()}initializeMenuItems(){this.menuItems=[{handler:()=>{(!(this.options.maxRowCount!==void 0&&this.options.maxRowCount>0)||this.getColCount()<(this.options.maxRowCount||0))&&this.table.insertColumnRight()},icon:Os.renderToString(v.jsx(qr,{icon:"AddColRight"})),title:hn.AEditor["Insert Column Right"]},{handler:()=>{(!(this.options.maxRowCount!==void 0&&this.options.maxRowCount>0)||this.getColCount()<(this.options.maxRowCount||0))&&this.table.insertColumnLeft()},icon:Os.renderToString(v.jsx(qr,{icon:"AddColLeft"})),title:hn.AEditor["Insert Column Left"]},{handler:()=>{this.table.insertRowAbove()},icon:Os.renderToString(v.jsx(qr,{icon:"AddRowAbove"})),title:hn.AEditor["Insert Row Top"]},{handler:()=>{this.table.insertRowBelow()},icon:Os.renderToString(v.jsx(qr,{icon:"AddRowBelow"})),title:hn.AEditor["Insert Row Bottom"]},{handler:()=>{this.table.deleteColumn()},icon:Os.renderToString(v.jsx(qr,{icon:"RemoveCol"})),title:hn.AEditor["Delete Column"]},{handler:()=>{this.table.deleteRow()},icon:Os.renderToString(v.jsx(qr,{icon:"RemoveRow"})),title:hn.AEditor["Delete Row"]},{handler:()=>{this.table.deleteTable()},icon:Os.renderToString(v.jsx(qr,{icon:"Trash"})),title:hn.AEditor["Delete Table"]}]}overrideTableMethods(){const e=this.table.insertTable;this.table.insertTable=(...n)=>{const i=e.apply(this.table,n),l=this.quill.getSelection();return l&&(this.quill.focus(),setTimeout(()=>this.detectButton(l),0)),i};const t=this.table.deleteTable;this.table.deleteTable=(...n)=>{const i=t.apply(this.table,n);return this.cleanupTableUI(),i}}initializeHelperText(){this.helperTextElement=document.createElement("div"),this.helperTextElement.className=Nn["ql-tableui-helper"];const e=document.createElement("span");e.className=Fe.clsx("Caption1",Nn["ql-tableui-helper__text"],"NoSelect"),e.textContent=hn.AEditor["Right click to open properties"];const t=document.createElement("span");t.className=Nn["ql-tableui-helper__icon"],t.innerHTML=Os.renderToString(v.jsx(qr,{icon:"MoreHorizontal",size:"xs"})),t.addEventListener("click",n=>{n.preventDefault(),n.stopPropagation(),this.menuRoot?this.hideMenu():this.showMenu()}),this.helperTextElement.appendChild(e),this.helperTextElement.appendChild(t),this.helperTextElement.style.display="none",this.quill.container.appendChild(this.helperTextElement)}attachEventListeners(){this.quill.on("editor-change",this.boundEditorChangeHandler),this.quill.root.addEventListener("contextmenu",this.boundContextMenuHandler),this.quill.root.addEventListener("copy",this.boundCopyHandler),this.quill.root.addEventListener("paste",this.boundPasteHandler),window.addEventListener("scroll",this.boundScrollHandler,!0)}removeEventListeners(){this.quill.off("editor-change",this.boundEditorChangeHandler),this.quill.root.removeEventListener("contextmenu",this.boundContextMenuHandler),this.quill.root.removeEventListener("copy",this.boundCopyHandler),this.quill.root.removeEventListener("paste",this.boundPasteHandler),document.removeEventListener("click",this.boundDocClickHandler),window.removeEventListener("scroll",this.boundScrollHandler,!0)}editorChangeHandler(e,t,n,i){e==="selection-change"&&this.detectButton(t)}contextMenuHandler(e){return this.isTable()?(e.preventDefault(),this.showMenu(),!1):!0}copyHandler(e){if(!this.selectedCell||!e.clipboardData)return;e.preventDefault();const t=this.selectedCell.textContent||"";e.clipboardData.setData("text/plain",t)}isTable(e){return e=e||this.quill.getSelection(),e?!!(this.quill.getFormat(e.index).table&&!e.length):!1}getColCount(e){if(e=e||this.quill.getSelection(),!e)return 0;const[t]=this.table.getTable(e);return t?t.rows().reduce((n,i)=>Math.max(i.children.length,n),0):0}showMenu(){if(this.menuRoot){this.hideMenu();return}if(!this.selectedCell)return;this.menuRoot||(this.menuRoot=document.createElement("div"),document.body.appendChild(this.menuRoot));const e=this.getBoundingRectWithCache(this.selectedCell),t=window.innerWidth,n=window.innerHeight,i=I.memo(({item:u,index:h})=>v.jsxs("div",{className:Nn["ql-tableui-options__item"],onClick:this.createItemClickHandler(u),children:[v.jsx("span",{className:Nn["ql-tableui-options__item-icon"],dangerouslySetInnerHTML:{__html:u.icon}}),v.jsx("span",{className:Nn["ql-tableui-options__item-text"],children:u.title})]},h)),l=()=>v.jsx("div",{className:Nn["ql-tableui-options"],style:{position:"fixed",visibility:"hidden",zIndex:1e4},children:this.menuItems.map((u,h)=>v.jsx(i,{item:u,index:h},h))});try{Vb.createRoot?(this.reactRoot=Vb.createRoot(this.menuRoot),this.reactRoot.render(v.jsx(l,{}))):Fs.render(v.jsx(l,{}),this.menuRoot)}catch{Fs.render(v.jsx(l,{}),this.menuRoot)}document.addEventListener("click",this.boundDocClickHandler),requestAnimationFrame(()=>{if(!this.menuRoot)return;const u=this.menuRoot.firstElementChild;if(u){const h=u.getBoundingClientRect();let g=e.bottom+window.scrollY,m=e.left+window.scrollX;m+h.width>t&&(m=e.right-h.width+window.scrollX),g+h.height>n+window.scrollY&&(g=e.top-h.height+window.scrollY),u.style.top=`${g}px`,u.style.left=`${m}px`,u.style.visibility="visible"}})}hideMenu(){this.menuRoot&&(document.removeEventListener("click",this.boundDocClickHandler),this.reactRoot?(this.reactRoot.unmount(),this.reactRoot=null):Fs.unmountComponentAtNode(this.menuRoot),this.menuRoot.remove(),this.menuRoot=null)}detectButton(e){if(e)if(this.isTable(e)){const[t,n]=this.quill.getLine(e.index);if(!t||!t.domNode)return;const i=t.domNode,l=`${i.tagName}-${i.offsetLeft}-${i.offsetTop}`;this.selectedCell===i||this.lastSelectedCellRef===l||(this.clearAllTableCellOutlines(),i.style.outline="2px solid var(--acent-brand)",i.style.outlineOffset="-1px",this.selectedCell=i,this.lastSelectedCellRef=l),this.showHelperText();const h=this.quill.container.getBoundingClientRect(),g=i.getBoundingClientRect(),m={bottom:g.bottom-h.top,height:g.height,left:g.left-h.left,right:g.right-h.left,top:g.top-h.top,width:g.width,x:g.x,y:g.y,toJSON:()=>JSON.stringify(m)};this.position&&(this.position.top!==m.top||this.position.left!==m.left)&&this.hideMenu(),this.position=m}else this.cleanupTableUI()}clearAllTableCellOutlines(){this.selectedCell&&(this.selectedCell.style.removeProperty("outline"),this.selectedCell.style.removeProperty("outline-offset"),this.selectedCell=null),this.quill.root.querySelectorAll("td, th").forEach(t=>{t instanceof HTMLElement&&(t.style.removeProperty("outline"),t.style.removeProperty("outline-offset"))}),this.lastSelectedCellRef=null}showHelperText(){if(!this.selectedCell||!this.helperTextElement)return;const e=this.quill.getSelection();if(!e)return;const[t]=this.table.getTable(e);if(!t||!t.domNode)return;const i=t.domNode.getBoundingClientRect(),l=this.quill.container.getBoundingClientRect();if(!(i.bottom<l.top+5||i.top>l.bottom-5)){let h=i.top-l.top-20;i.top<l.top&&(h=5),this.helperTextElement.style.display="block",this.helperTextElement.style.left=`${i.left-l.left}px`,this.helperTextElement.style.top=`${h}px`}else this.helperTextElement.style.display="none"}removeHelperText(){this.helperTextElement&&(this.helperTextElement.style.display="none")}handleScroll(){this.removeHelperText(),this.hideMenu(),this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(()=>{const e=this.quill.getSelection();e&&this.isTable(e)&&this.detectButton(e),this.scrollTimeout=null},this.SCROLL_DEBOUNCE_TIME)}destroy(){this.removeEventListeners(),this.cleanupTableUI(),this.helperTextElement&&this.helperTextElement.remove(),this.scrollTimeout&&(clearTimeout(this.scrollTimeout),this.scrollTimeout=null),this.positionCache.clear(),this.reactRoot=null,this.selectedCell=null,this.helperTextElement=null,this.position=null,this.options=this.DEFAULTS,this.menuRoot=null,this.table=null}createItemClickHandler(e){return t=>{t.preventDefault(),t.stopPropagation(),this.quill.focus(),e.handler(),this.hideMenu(),this.detectButton(this.quill.getSelection())}}getBoundingRectWithCache(e){const t=Date.now(),n=this.positionCache.get(e);if(n&&t-n.timestamp<this.POSITION_CACHE_LIFETIME)return n.rect;const i=e.getBoundingClientRect();return this.positionCache.set(e,{rect:i,timestamp:t}),i}pasteHandler(){this.clearAllTableCellOutlines(),setTimeout(()=>{const e=this.quill.getSelection();e&&this.detectButton(e)},0)}cleanupTableUI(){this.removeHelperText(),this.clearAllTableCellOutlines(),this.hideMenu(),this.lastSelectedCellRef=null}}const lS=[1,2,3,!1,4],cS=Ue.import("ui/icons");cS.table=Os.renderToString(v.jsx(qr,{icon:"Table",strokeWidth:2.5}));cS.divider=Os.renderToString(v.jsx(qr,{icon:"Minus",strokeWidth:2.5}));const PP=Ue.import("blots/block/embed");class rm extends PP{static create(e){const t=super.create(e);return t.style.border="var(--AEditor_Addon_Primary_border)",t.style.borderBottom="none",t.style.transition="border var(--Transition)",t}}it(rm,"blotName","divider"),it(rm,"tagName","hr");Ue.register({"modules/imageCompress":ZD,"modules/resize":JD,"modules/tablePicker":LP,"modules/tableUI":OP,"formats/header":qP(lS),"formats/divider":rm},!0);const NP=["bold","italic","underline","strike","blockquote","table","size","header","color","background","indent","list","align","image","link","video","divider"],jP=[[{header:lS}],["bold","italic","underline","strike","blockquote","divider","table",{color:[]},{background:[]}],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"},{align:[]}],["link","image","video"],["clean"]],FP=r=>{const{onEnterPress:e,errorMessage:t,type:n="Primary",editorRef:i,useValue:l,useError:u,placeholder:h,tabIndex:g,autoFocus:m,editorProps:M,wrapProps:E,helperText:C,label:_,labelProps:S,wrapType:D,style:A,minHeight:b,maxHeight:k,contentHeight:O,contentMaxHeight:H=1e3,toolbarSize:q="Med",readOnly:G,limitPosition:Y="bottom",maxLength:de,noLineBreak:te,toolbar:fe,singleLine:P,...re}=r,K=I.useMemo(()=>n==="ReadOnly"||G,[n,G]),ne=I.useMemo(()=>O?20:0,[O]),[oe,ue]=I.useState(q==="Med"?40:50),ge=I.useMemo(()=>K?0:oe,[K,oe]),[ae,_e]=I.useMemo(()=>[20,6],[]),pe=I.useMemo(()=>de||!u?0:Y==="bottom"?ae+_e:0,[u,de,Y,ae,_e]),[ve,Le]=I.useState(O),[Ne,Ve]=I.useState(!1),[Ae,rt]=I.useState(!1),pt=I.useRef(null),Ke=I.useRef(0),Ze=I.useRef(0),De=I.useMemo(()=>_?24:0,[_]),ke=I.useCallback(Lt=>{if(!Ne||!O)return;const ce=Lt.clientY-Ze.current,X=b?b-ge-pe:O,Ee=Math.max(X,0),He=k?k-ge-pe:H,ft=Math.min(He,Math.max(Ee,Ke.current+ce));Le(ft)},[O,Ne,H,b,k,ge,pe]),Te=I.useCallback(()=>{Ve(!1),rt(!1),window.removeEventListener("mousemove",ke),window.removeEventListener("mouseup",Te)},[ke]),je=I.useCallback(Lt=>{if(!ve)return;if(Lt.detail===2){Le(O);return}Ve(!0),rt(!0),Ke.current=ve,Ze.current=Lt.clientY;const ce=Ee=>{if(!O)return;const He=Ee.clientY-Ze.current,ft=b?b-ge-pe:O,dt=Math.max(ft,0),bt=k?k-ge-pe:H,$t=Math.min(bt,Math.max(dt,Ke.current+He));Le($t)},X=()=>{Ve(!1),rt(!1),window.removeEventListener("mousemove",ce),window.removeEventListener("mouseup",X)};window.addEventListener("mousemove",ce),window.addEventListener("mouseup",X)},[O,ve,H,b,k,ge,pe]),Re=I.useMemo(()=>O||b,[O,b]),Qe=I.useMemo(()=>Re?"fit-content":k?k+De:`calc(100% - ${De}px)`,[Re,k,De]),ct=I.useMemo(()=>{if(O){if(ve)switch(n){case"ReadOnly":return ve;case"Raw":return ve+pe;default:return ve+ge+pe}}else return},[O,ve,n,ge,pe]),_t=I.useMemo(()=>{if(!(!k||k<=ge+pe))switch(n){case"ReadOnly":return k;case"Raw":return k-pe;default:return k-ge-pe}},[n,ge,pe,k]),wt=I.useMemo(()=>{if(b&&O){const Lt=Math.min(b-ge-pe,O);return K?Lt:Lt+ge+pe}else return b||(O?void 0:`calc(100% - ${De}px)`)},[b,O,De,ge,pe,K]),mt=I.useMemo(()=>BP(t)?"Error":n,[t,n]),[It,St]=pn(l,""),[at,ot]=pn(u,!1),[xt,Ie]=I.useState(()=>{if(!It)return new Gt;try{const Lt=document.createElement("div");return Lt.innerHTML=It,new Ue(Lt,{readOnly:!0}).getContents()}catch(Lt){return console.warn("Error parsing HTML content:",Lt),new Gt}}),lt=I.useCallback(Lt=>Lt.ops?Lt.ops.reduce((ce,X)=>typeof X.insert=="string"?ce+X.insert.replace(/\n/g,"").split("").reduce((Ee,He)=>Ee+(He.charCodeAt(0)<=127?1:3),0):typeof X.insert=="object"&&X.insert.image?ce+X.insert.image.length:ce,0):0,[]),gt=I.useMemo(()=>Math.floor(5e4*.68234)*3,[]),Et=I.useMemo(()=>u&&!K&&v.jsxs(Xl,{className:Nn.Limit,children:["(",v.jsx("span",{className:at?Nn.Error:void 0,children:nm(lt(xt))})," / ",nm(gt),")"]}),[lt,at,xt,K,gt,u]),Bt=I.useMemo(()=>({clipboard:{matchVisual:!1},keyboard:te&&{bindings:{Enter:{key:"Enter",handler:Lt=>{if(e&&St){const ce=Lt.root.innerHTML;e(ce)}return!1}}}},imageCompress:{quality:.5},...!K&&{resize:{locale:{altTip:hn.AEditor["Image size adjust"],center:hn.AEditor.Center,floatLeft:hn.AEditor.floatLeft,floatRight:hn.AEditor.floatRight,inputTip:hn.AEditor["Input on mouse down"],restore:hn.AEditor.Restore}},table:!0,tablePicker:!0,tableUI:!0,toolbar:{container:fe||jP,handlers:{divider:function(){const Lt=this.quill,ce=Lt.getSelection(!0),X=Lt.getModule("table"),Ee=X&&(()=>{try{return!!X.getTable(ce)[0]}catch{return!1}})();Ee||Lt.insertText(ce.index,`
|
347
|
+
`,"user"),t.index+=1)}}findTableParent(e){let t=e;for(;t;){if(t.domNode&&t.domNode.tagName==="TABLE")return t;t=t.parent}return null}hidePicker(){this.removeTooltip(),this.picker&&(this.picker.remove(),this.picker=null),this.tableButton&&this.tableButton.classList.remove("ql-expanded")}}var Iu={},Wb;function MP(){if(Wb)return Iu;Wb=1;var r=Fs;if(process.env.NODE_ENV==="production")Iu.createRoot=r.createRoot,Iu.hydrateRoot=r.hydrateRoot;else{var e=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Iu.createRoot=function(t,n){e.usingClientEntryPoint=!0;try{return r.createRoot(t,n)}finally{e.usingClientEntryPoint=!1}},Iu.hydrateRoot=function(t,n,i){e.usingClientEntryPoint=!0;try{return r.hydrateRoot(t,n,i)}finally{e.usingClientEntryPoint=!1}}}return Iu}var DP=MP();const Vb=il(DP);class OP{constructor(e,t){it(this,"DEFAULTS",{maxRowCount:-1});it(this,"quill");it(this,"options");it(this,"position",null);it(this,"table");it(this,"selectedCell",null);it(this,"menuRoot",null);it(this,"helperTextElement",null);it(this,"scrollTimeout",null);it(this,"SCROLL_DEBOUNCE_TIME",80);it(this,"lastSelectedCellRef",null);it(this,"boundDocClickHandler",this.hideMenu.bind(this));it(this,"boundEditorChangeHandler",this.editorChangeHandler.bind(this));it(this,"boundContextMenuHandler",this.contextMenuHandler.bind(this));it(this,"boundCopyHandler",this.copyHandler.bind(this));it(this,"boundScrollHandler",this.handleScroll.bind(this));it(this,"boundPasteHandler",this.pasteHandler.bind(this));it(this,"menuItems",[]);it(this,"positionCache",new Map);it(this,"POSITION_CACHE_LIFETIME",1e3);it(this,"reactRoot",null);if(this.quill=e,this.options={...this.DEFAULTS,...t},this.table=e.getModule("table"),!this.table){console.error('"table" module not found');return}this.initializeMenuItems(),this.overrideTableMethods(),this.initializeHelperText(),this.attachEventListeners()}initializeMenuItems(){this.menuItems=[{handler:()=>{(!(this.options.maxRowCount!==void 0&&this.options.maxRowCount>0)||this.getColCount()<(this.options.maxRowCount||0))&&this.table.insertColumnRight()},icon:Os.renderToString(v.jsx(qr,{icon:"AddColRight"})),title:hn.AEditor["Insert Column Right"]},{handler:()=>{(!(this.options.maxRowCount!==void 0&&this.options.maxRowCount>0)||this.getColCount()<(this.options.maxRowCount||0))&&this.table.insertColumnLeft()},icon:Os.renderToString(v.jsx(qr,{icon:"AddColLeft"})),title:hn.AEditor["Insert Column Left"]},{handler:()=>{this.table.insertRowAbove()},icon:Os.renderToString(v.jsx(qr,{icon:"AddRowAbove"})),title:hn.AEditor["Insert Row Top"]},{handler:()=>{this.table.insertRowBelow()},icon:Os.renderToString(v.jsx(qr,{icon:"AddRowBelow"})),title:hn.AEditor["Insert Row Bottom"]},{handler:()=>{this.table.deleteColumn()},icon:Os.renderToString(v.jsx(qr,{icon:"RemoveCol"})),title:hn.AEditor["Delete Column"]},{handler:()=>{this.table.deleteRow()},icon:Os.renderToString(v.jsx(qr,{icon:"RemoveRow"})),title:hn.AEditor["Delete Row"]},{handler:()=>{this.table.deleteTable()},icon:Os.renderToString(v.jsx(qr,{icon:"Trash"})),title:hn.AEditor["Delete Table"]}]}overrideTableMethods(){const e=this.table.insertTable;this.table.insertTable=(...n)=>{const i=e.apply(this.table,n),l=this.quill.getSelection();return l&&(this.quill.focus(),setTimeout(()=>this.detectButton(l),0)),i};const t=this.table.deleteTable;this.table.deleteTable=(...n)=>{const i=t.apply(this.table,n);return this.cleanupTableUI(),i}}initializeHelperText(){this.helperTextElement=document.createElement("div"),this.helperTextElement.className=Nn["ql-tableui-helper"];const e=document.createElement("span");e.className=Fe.clsx("Caption1",Nn["ql-tableui-helper__text"],"NoSelect"),e.textContent=hn.AEditor["Right click to open properties"];const t=document.createElement("span");t.className=Nn["ql-tableui-helper__icon"],t.innerHTML=Os.renderToString(v.jsx(qr,{icon:"MoreHorizontal",size:"xs"})),t.addEventListener("click",n=>{n.preventDefault(),n.stopPropagation(),this.menuRoot?this.hideMenu():this.showMenu()}),this.helperTextElement.appendChild(e),this.helperTextElement.appendChild(t),this.helperTextElement.style.display="none",this.quill.container.appendChild(this.helperTextElement)}attachEventListeners(){this.quill.on("editor-change",this.boundEditorChangeHandler),this.quill.root.addEventListener("contextmenu",this.boundContextMenuHandler),this.quill.root.addEventListener("copy",this.boundCopyHandler),this.quill.root.addEventListener("paste",this.boundPasteHandler),window.addEventListener("scroll",this.boundScrollHandler,!0)}removeEventListeners(){this.quill.off("editor-change",this.boundEditorChangeHandler),this.quill.root.removeEventListener("contextmenu",this.boundContextMenuHandler),this.quill.root.removeEventListener("copy",this.boundCopyHandler),this.quill.root.removeEventListener("paste",this.boundPasteHandler),document.removeEventListener("click",this.boundDocClickHandler),window.removeEventListener("scroll",this.boundScrollHandler,!0)}editorChangeHandler(e,t,n,i){e==="selection-change"&&this.detectButton(t)}contextMenuHandler(e){return this.isTable()?(e.preventDefault(),this.showMenu(),!1):!0}copyHandler(e){if(!this.selectedCell||!e.clipboardData)return;e.preventDefault();const t=this.selectedCell.textContent||"";e.clipboardData.setData("text/plain",t)}isTable(e){return e=e||this.quill.getSelection(),e?!!(this.quill.getFormat(e.index).table&&!e.length):!1}getColCount(e){if(e=e||this.quill.getSelection(),!e)return 0;const[t]=this.table.getTable(e);return t?t.rows().reduce((n,i)=>Math.max(i.children.length,n),0):0}showMenu(){if(this.menuRoot){this.hideMenu();return}if(!this.selectedCell)return;this.menuRoot||(this.menuRoot=document.createElement("div"),document.body.appendChild(this.menuRoot));const e=this.getBoundingRectWithCache(this.selectedCell),t=window.innerWidth,n=window.innerHeight,i=I.memo(({item:u,index:h})=>v.jsxs("div",{className:Nn["ql-tableui-options__item"],onClick:this.createItemClickHandler(u),children:[v.jsx("span",{className:Nn["ql-tableui-options__item-icon"],dangerouslySetInnerHTML:{__html:u.icon}}),v.jsx("span",{className:Nn["ql-tableui-options__item-text"],children:u.title})]},h)),l=()=>v.jsx("div",{className:Nn["ql-tableui-options"],style:{position:"fixed",visibility:"hidden",zIndex:1e4},children:this.menuItems.map((u,h)=>v.jsx(i,{item:u,index:h},h))});try{Vb.createRoot?(this.reactRoot=Vb.createRoot(this.menuRoot),this.reactRoot.render(v.jsx(l,{}))):Fs.render(v.jsx(l,{}),this.menuRoot)}catch{Fs.render(v.jsx(l,{}),this.menuRoot)}document.addEventListener("click",this.boundDocClickHandler),requestAnimationFrame(()=>{if(!this.menuRoot)return;const u=this.menuRoot.firstElementChild;if(u){const h=u.getBoundingClientRect();let g=e.bottom+window.scrollY,m=e.left+window.scrollX;m+h.width>t&&(m=e.right-h.width+window.scrollX),g+h.height>n+window.scrollY&&(g=e.top-h.height+window.scrollY),u.style.top=`${g}px`,u.style.left=`${m}px`,u.style.visibility="visible"}})}hideMenu(){this.menuRoot&&(document.removeEventListener("click",this.boundDocClickHandler),this.reactRoot?(this.reactRoot.unmount(),this.reactRoot=null):Fs.unmountComponentAtNode(this.menuRoot),this.menuRoot.remove(),this.menuRoot=null)}detectButton(e){if(e)if(this.isTable(e)){const[t,n]=this.quill.getLine(e.index);if(!t||!t.domNode)return;const i=t.domNode,l=`${i.tagName}-${i.offsetLeft}-${i.offsetTop}`;this.selectedCell===i||this.lastSelectedCellRef===l||(this.clearAllTableCellOutlines(),i.style.outline="2px solid var(--acent-brand)",i.style.outlineOffset="-1px",this.selectedCell=i,this.lastSelectedCellRef=l),this.showHelperText();const h=this.quill.container.getBoundingClientRect(),g=i.getBoundingClientRect(),m={bottom:g.bottom-h.top,height:g.height,left:g.left-h.left,right:g.right-h.left,top:g.top-h.top,width:g.width,x:g.x,y:g.y,toJSON:()=>JSON.stringify(m)};this.position&&(this.position.top!==m.top||this.position.left!==m.left)&&this.hideMenu(),this.position=m}else this.cleanupTableUI()}clearAllTableCellOutlines(){this.selectedCell&&(this.selectedCell.style.removeProperty("outline"),this.selectedCell.style.removeProperty("outline-offset"),this.selectedCell=null),this.quill.root.querySelectorAll("td, th").forEach(t=>{t instanceof HTMLElement&&(t.style.removeProperty("outline"),t.style.removeProperty("outline-offset"))}),this.lastSelectedCellRef=null}showHelperText(){if(!this.selectedCell||!this.helperTextElement)return;const e=this.quill.getSelection();if(!e)return;const[t]=this.table.getTable(e);if(!t||!t.domNode)return;const i=t.domNode.getBoundingClientRect(),l=this.quill.container.getBoundingClientRect();if(!(i.bottom<l.top+5||i.top>l.bottom-5)){let h=i.top-l.top-20;i.top<l.top&&(h=5),this.helperTextElement.style.display="block",this.helperTextElement.style.left=`${i.left-l.left}px`,this.helperTextElement.style.top=`${h}px`}else this.helperTextElement.style.display="none"}removeHelperText(){this.helperTextElement&&(this.helperTextElement.style.display="none")}handleScroll(){this.removeHelperText(),this.hideMenu(),this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(()=>{const e=this.quill.getSelection();e&&this.isTable(e)&&this.detectButton(e),this.scrollTimeout=null},this.SCROLL_DEBOUNCE_TIME)}destroy(){this.removeEventListeners(),this.cleanupTableUI(),this.helperTextElement&&this.helperTextElement.remove(),this.scrollTimeout&&(clearTimeout(this.scrollTimeout),this.scrollTimeout=null),this.positionCache.clear(),this.reactRoot=null,this.selectedCell=null,this.helperTextElement=null,this.position=null,this.options=this.DEFAULTS,this.menuRoot=null,this.table=null}createItemClickHandler(e){return t=>{t.preventDefault(),t.stopPropagation(),this.quill.focus(),e.handler(),this.hideMenu(),this.detectButton(this.quill.getSelection())}}getBoundingRectWithCache(e){const t=Date.now(),n=this.positionCache.get(e);if(n&&t-n.timestamp<this.POSITION_CACHE_LIFETIME)return n.rect;const i=e.getBoundingClientRect();return this.positionCache.set(e,{rect:i,timestamp:t}),i}pasteHandler(){this.clearAllTableCellOutlines(),setTimeout(()=>{const e=this.quill.getSelection();e&&this.detectButton(e)},0)}cleanupTableUI(){this.removeHelperText(),this.clearAllTableCellOutlines(),this.hideMenu(),this.lastSelectedCellRef=null}}const lS=[1,2,3,!1,4],cS=Ue.import("ui/icons");cS.table=Os.renderToString(v.jsx(qr,{icon:"Table",strokeWidth:2.5}));cS.divider=Os.renderToString(v.jsx(qr,{icon:"Minus",strokeWidth:2.5}));const PP=Ue.import("blots/block/embed");class rm extends PP{static create(e){const t=super.create(e);return t.style.border="var(--AEditor_Addon_Primary_border)",t.style.borderBottom="none",t.style.transition="border var(--Transition)",t}}it(rm,"blotName","divider"),it(rm,"tagName","hr");Ue.register({"modules/imageCompress":ZD,"modules/resize":JD,"modules/tablePicker":LP,"modules/tableUI":OP,"formats/header":qP(lS),"formats/divider":rm},!0);const NP=["bold","italic","underline","strike","blockquote","table","size","header","color","background","indent","list","align","image","link","video","divider"],jP=[[{header:lS}],["bold","italic","underline","strike","blockquote","divider","table",{color:[]},{background:[]}],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"},{align:[]}],["link","image","video"],["clean"]],FP=r=>{const{onEnterPress:e,errorMessage:t,type:n="Primary",editorRef:i,useValue:l,useError:u,placeholder:h,tabIndex:g,autoFocus:m,editorProps:M,wrapProps:E,helperText:C,label:_,labelProps:S,wrapType:D,style:A,minHeight:b,maxHeight:k,contentHeight:O,contentMaxHeight:H=1e3,toolbarSize:q="Med",readOnly:G,limitPosition:Y="bottom",maxLength:de,noLineBreak:te,toolbar:fe,singleLine:P,...re}=r,K=I.useMemo(()=>n==="ReadOnly"||G,[n,G]),ne=I.useMemo(()=>O?20:0,[O]),[oe,ue]=I.useState(q==="Med"?40:50),ge=I.useMemo(()=>K?0:oe,[K,oe]),[ae,_e]=I.useMemo(()=>[20,6],[]),pe=I.useMemo(()=>de||!u?0:Y==="bottom"?ae+_e:0,[u,de,Y,ae,_e]),[ve,Le]=I.useState(O),[Ne,Ve]=I.useState(!1),[Ae,rt]=I.useState(!1),pt=I.useRef(null),Ke=I.useRef(0),Ze=I.useRef(0),De=I.useMemo(()=>_?24:0,[_]),ke=I.useCallback(Lt=>{if(!Ne||!O)return;const ce=Lt.clientY-Ze.current,X=b?b-ge-pe:O,Ee=Math.max(X,0),He=k?k-ge-pe:H,ft=Math.min(He,Math.max(Ee,Ke.current+ce));Le(ft)},[O,Ne,H,b,k,ge,pe]),Te=I.useCallback(()=>{Ve(!1),rt(!1),window.removeEventListener("mousemove",ke),window.removeEventListener("mouseup",Te)},[ke]),je=I.useCallback(Lt=>{if(!ve)return;if(Lt.detail===2){Le(O);return}Ve(!0),rt(!0),Ke.current=ve,Ze.current=Lt.clientY;const ce=Ee=>{if(!O)return;const He=Ee.clientY-Ze.current,ft=b?b-ge-pe:O,dt=Math.max(ft,0),bt=k?k-ge-pe:H,$t=Math.min(bt,Math.max(dt,Ke.current+He));Le($t)},X=()=>{Ve(!1),rt(!1),window.removeEventListener("mousemove",ce),window.removeEventListener("mouseup",X)};window.addEventListener("mousemove",ce),window.addEventListener("mouseup",X)},[O,ve,H,b,k,ge,pe]),Re=I.useMemo(()=>O||b||P,[O,b,P]),Qe=I.useMemo(()=>Re?"fit-content":k?k+De:`calc(100% - ${De}px)`,[Re,k,De]),ct=I.useMemo(()=>{if(O){if(ve)switch(n){case"ReadOnly":return ve;case"Raw":return ve+pe;default:return ve+ge+pe}}else return},[O,ve,n,ge,pe]),_t=I.useMemo(()=>{if(!(!k||k<=ge+pe))switch(n){case"ReadOnly":return k;case"Raw":return k-pe;default:return k-ge-pe}},[n,ge,pe,k]),wt=I.useMemo(()=>{if(b&&O){const Lt=Math.min(b-ge-pe,O);return K?Lt:Lt+ge+pe}else return b||(O?void 0:`calc(100% - ${De}px)`)},[b,O,De,ge,pe,K]),mt=I.useMemo(()=>BP(t)?"Error":n,[t,n]),[It,St]=pn(l,""),[at,ot]=pn(u,!1),[xt,Ie]=I.useState(()=>{if(!It)return new Gt;try{const Lt=document.createElement("div");return Lt.innerHTML=It,new Ue(Lt,{readOnly:!0}).getContents()}catch(Lt){return console.warn("Error parsing HTML content:",Lt),new Gt}}),lt=I.useCallback(Lt=>Lt.ops?Lt.ops.reduce((ce,X)=>typeof X.insert=="string"?ce+X.insert.replace(/\n/g,"").split("").reduce((Ee,He)=>Ee+(He.charCodeAt(0)<=127?1:3),0):typeof X.insert=="object"&&X.insert.image?ce+X.insert.image.length:ce,0):0,[]),gt=I.useMemo(()=>Math.floor(5e4*.68234)*3,[]),Et=I.useMemo(()=>u&&!K&&v.jsxs(Xl,{className:Nn.Limit,children:["(",v.jsx("span",{className:at?Nn.Error:void 0,children:nm(lt(xt))})," / ",nm(gt),")"]}),[lt,at,xt,K,gt,u]),Bt=I.useMemo(()=>({clipboard:{matchVisual:!1},keyboard:te&&{bindings:{Enter:{key:"Enter",handler:Lt=>{if(e&&St){const ce=Lt.root.innerHTML;e(ce)}return!1}}}},imageCompress:{quality:.5},...!K&&{resize:{locale:{altTip:hn.AEditor["Image size adjust"],center:hn.AEditor.Center,floatLeft:hn.AEditor.floatLeft,floatRight:hn.AEditor.floatRight,inputTip:hn.AEditor["Input on mouse down"],restore:hn.AEditor.Restore}},table:!0,tablePicker:!0,tableUI:!0,toolbar:{container:fe||jP,handlers:{divider:function(){const Lt=this.quill,ce=Lt.getSelection(!0),X=Lt.getModule("table"),Ee=X&&(()=>{try{return!!X.getTable(ce)[0]}catch{return!1}})();Ee||Lt.insertText(ce.index,`
|
348
348
|
`,Ue.sources.USER);const He=Ee?0:1;Lt.insertEmbed(ce.index+He,"divider",!0,Ue.sources.USER),Lt.setSelection(ce.index+He+1,0,Ue.sources.SILENT)}}}}}),[K,te,e,St,fe]),ze=I.useCallback((Lt,ce,X,Ee)=>{var He;if(St&&X==="user")try{const ft=Ee.getContents(),dt=Ee.getHTML(),bt=((He=ft.ops)==null?void 0:He.length)===1&&ft.ops[0].insert===`
|
349
349
|
`;ot&&ot(lt(ft)>gt),St(bt?"":dt),Ie(ft)}catch(ft){console.warn("Error handling editor change:",ft)}},[lt,gt,ot,St]),Ct=I.useMemo(()=>q==="Med"?8:12.5,[q]),Ft=I.useCallback(Lt=>{if(!Lt)return;const ce=Lt.getEditor();if(!ce)return;const X=[],Ee={input:Ut=>{const Ht=Ut.target;Ht.value=Ht.value.replace(/[^0-9]/g,"");const nr=parseInt(Ht.value);nr>100&&(Ht.value="100"),nr<1&&(Ht.value="1")},keyDown:Ut=>{if(Ut.key!=="Delete"&&Ut.key!=="Backspace")return;const Ht=document.querySelector("#image-resizer");if(!Ht)return;const nr=Ht.getBoundingClientRect(),sr=document.querySelectorAll(".ql-editor img"),cr=Array.from(sr).find(mr=>{const Xe=mr.getBoundingClientRect();return Math.abs(Xe.left-nr.left)<5&&Math.abs(Xe.top-nr.top)<5});if(cr){Ht.style.display="none";try{const mr=Ue.find(cr);if(mr){const Xe=ce.getIndex(mr);mr.remove(),ce.setSelection(Xe,0,Ue.sources.USER)}}catch(mr){console.warn("Error removing image:",mr)}}},formatExpand:Ut=>{try{const Ht=ce.getFormat();Ut.forEach(nr=>{if(Ht[nr]){const sr=Ht[nr],cr=`.ql-${nr}`,mr=document.querySelector(`${cr} .ql-picker-label`),Xe=document.querySelectorAll(`${cr} .ql-picker-item`),At=Array.from(Xe).find(vt=>vt.getAttribute("data-value")===sr);At&&(At.classList.add("ql-selected"),mr==null||mr.classList.add("ql-active"))}})}catch(Ht){console.warn("Error expanding format:",Ht)}},resizeToolbar:Ut=>{requestAnimationFrame(()=>{for(const Ht of Ut)ue(Ht.contentRect.height+Ct*2)})}},He=ce.root,ft=document.querySelector(".ql-snow.ql-toolbar"),dt=document.querySelector("#image-resizer .input-wrapper input"),bt=new ResizeObserver(Ee.resizeToolbar),$t=["header","color"],Mt=[];return He==null||He.addEventListener("keydown",Ee.keyDown),dt==null||dt.addEventListener("input",Ee.input),ft&&bt.observe(ft),$t.forEach(Ut=>{const Ht=document.querySelector(`.ql-${Ut} .ql-picker-label`);if(Ht)try{Ht.addEventListener("click",()=>Ee.formatExpand($t)),Mt.push(Ht)}catch(nr){console.warn(`Error adding event listener to ${Ut} picker:`,nr)}}),X.push(()=>{He==null||He.removeEventListener("keydown",Ee.keyDown),dt==null||dt.removeEventListener("input",Ee.input),ft&&bt.disconnect(),Mt.forEach(Ut=>Ut.removeEventListener("click",()=>Ee.formatExpand($t)))}),()=>X.forEach(Ut=>Ut())},[Ct]),br=I.useCallback(Lt=>{if(!Lt||!de)return;const ce=Lt.getEditor();if(!ce)return;const X=(Ee,He)=>{try{const ft=ce.getSelection();if(!ft)return!0;const dt=ce.getText().length-1,bt=(ft==null?void 0:ft.length)||0,$t=de-(dt-bt);if(He.length<=$t)return!0;if(Ee.preventDefault(),Ee.type==="paste"){const Mt=(ft==null?void 0:ft.index)||dt,Ut=He.substring(0,$t);ft!=null&&ft.length&&ce.deleteText(Mt,ft.length),ce.insertText(Mt,Ut)}}catch(ft){console.warn("Error processing input:",ft)}return!1};te&&ce.root.addEventListener("keydown",Ee=>{if(Ee.key==="Enter"&&e){const He=ce.root.innerHTML;e(He),Ee.preventDefault()}}),ce.root.addEventListener("beforeinput",Ee=>{Ee.inputType.startsWith("insert")&&X(Ee,Ee.data||"")},!0),ce.root.addEventListener("paste",Ee=>{const He=Ee.clipboardData;He&&X(Ee,He.getData("text/plain"))},!0)},[de,te,e]),Or=I.useCallback(Lt=>{i&&(typeof i=="function"?i(Lt):i.current=Lt),Lt&&(Ft(Lt),br(Lt))},[i,Ft,br]);return v.jsx(Uc,{helperText:C,wrapType:D,labelProps:{...S,style:{minHeight:20}},errorMessage:t,label:v.jsxs(Vn,{style:{gap:4},children:[_,!de&&Y==="top"&&Et]}),wrapProps:{...E,className:Fe.clsx(E==null?void 0:E.className,!Re&&Nn.AEditorWrapper),style:{...E==null?void 0:E.style,height:Qe}},children:v.jsxs(Wr,{...re,className:Fe.clsx(re.className,Nn.AEditorContainer),style:{...A,height:ct,minHeight:wt},children:[v.jsx(bh,{...M,ref:Or,className:Fe.clsx(M==null?void 0:M.className,Nn.AEditor,Nn[mt]),formats:NP,modules:Bt,placeholder:h,readOnly:K,theme:"snow",value:xt,style:{maxHeight:_t?_t+ge:void 0,"--icon-size":`${q==="Med"?18:24}px`,"--editor-padding":P?"8px 12px":"12px","--toolbar-padding":`${Ct}px`,"--content-height":P?"34px":ve?`${ve}px`:"100%","--content-max-height":_t?`${_t}px`:"100%","--default-text":`'${hn.AEditor.Default}'`,"--arrow-background":`url("data:image/svg+xml,${encodeURIComponent(Os.renderToString(v.jsx(qr,{icon:"EditorArrow"})))}`},onChange:ze}),O&&v.jsxs(v.Fragment,{children:[v.jsx("div",{ref:pt,className:Nn.Resizer,style:{height:ne,bottom:u&&!K?pe-1:-1},onMouseDown:je}),Ae&&v.jsx("div",{className:Fe.clsx(Nn.Indicator,"NoSelect","Caption"),style:{bottom:u&&!K?pe:0},children:`${Math.round(ve)}px`})]}),v.jsx("div",{className:Fe.clsx(Nn.LimitContainer,"NoSelect"),style:{marginTop:_e,minHeight:ae,display:!de&&Y==="bottom"?"flex":"none"},children:Et})]})})};function BP(r){return Array.isArray(r)?r.filter(Boolean).length>0:!!r}function qP(r){const e=Ue.import("formats/header");return e.whitelist=r,e}const nm=r=>{if(!r)return"0 bytes";const e=["bytes","KB","MB","GB","TB","PB","EB","ZB","YB","RB","QB"];let t=0;for(;r>=1024&&t<e.length-1;)r/=1024,t++;return`${t===0?Math.floor(r):r.toFixed(1)} ${e[t]}`};function eh(r,e){Array.isArray(r)||(r=[r]);for(const t of r){if(e(t))return t;if(!t.children||t.children.length<1)continue;const n=eh(t.children,e);if(n)return n}}function sd(r,e){Array.isArray(r)||(r=[r]);for(const t of r)e(t),!(!t.children||t.children.length<1)&&sd(t.children,e)}function uS(r,e){Array.isArray(r)||(r=[r]);const t=[];return sd(r,(n,i)=>t.push(e(n,i))),t}function fS(r,e){Array.isArray(r)||(r=[r]);for(const t of r){if(!e(t))return!1;if(!(!t.children||t.children.length<1)&&!fS(t.children,e))return!1}return!0}function HP(r,e){Array.isArray(r)||(r=[r]);const t=[];return sd(r,(n,i)=>{e(n,i)&&t.push(n)}),t}function zP(r){Array.isArray(r)||(r=[r]);let e=0;return sd(r,()=>e++),e}function $P(r,e,t,n){if(n(e,t))return null;Array.isArray(r)||(r=[r]);const i=eh(r,u=>{var h;return(h=u.children)==null?void 0:h.some(g=>n(g,e))}),l=eh(r,u=>{var h;return(h=u.children)==null?void 0:h.some(g=>n(g,t))});if(i===void 0&&l===void 0){const u=r.findIndex(g=>n(g,e)),h=r.findIndex(g=>n(g,t));return r.splice(u,1),r.splice(h,0,e),[...r]}else if(i!==void 0&&l!==void 0&&n(i,l)&&i.children){const u=i.children.findIndex(g=>n(g,e)),h=i.children.findIndex(g=>n(g,t));return u===void 0||h===void 0?null:(i.children.splice(u,1),i.children.splice(h,0,e),i.children=[...i.children],[...r])}return null}function UP(r,e,t){const n=[],i=[...e];for(;i.length>0;){const l=i.shift();if(l&&!n.find(u=>t(u,l))&&(n.push(l),!(!l.children||l.children.length<1)))for(const u of l.children)i.push(u)}return n}function WP(r,e,t){Array.isArray(r)||(r=[r]);const n=uS(r,u=>u),i=[],l=[...e];for(;l.length>0;){const u=l.shift();if(!u||i.find(g=>t(g,u)))continue;i.push(u);const h=n.find(g=>{var m;return(m=g.children)==null?void 0:m.some(M=>t(M,u))});h&&l.push(h)}return i}const Qa={find:eh,forEach:sd,map:uS,every:fS,filter:HP,length:zP,replace:$P,descendants:UP,ancestors:WP},VP="_AWrap_f5le3_1",GP="_AContainer_f5le3_10",ZP="_ATree_f5le3_18",YP="_ATreeBody_f5le3_30",KP="_CoverBorder_f5le3_36",XP="_InsertBorder_f5le3_45",JP="_ATreeHeader_f5le3_76",QP="_ATreeBodyHeader_f5le3_82",eN="_ATreeBodyHeaderResources_f5le3_92",tN="_ATreeItem_f5le3_98",rN="_IsSelectUsed_f5le3_114",nN="_IsSelected_f5le3_117",iN="_IsSearchSelected_f5le3_122",oN="_IsHovered_f5le3_133",sN="_CheckBox_f5le3_137",aN="_Indents_f5le3_149",lN="_ExpandIcon_f5le3_156",cN="_Content_f5le3_168",uN="_RightSticky_f5le3_177",fN="_SearchInputWrap_f5le3_188",dN="_SearchInput_f5le3_188",hN="_RightAddon_f5le3_200",pN="_RightAddonIcon_f5le3_211",gN="_Loader_f5le3_218",fn={AWrap:VP,AContainer:GP,ATree:ZP,ATreeBody:YP,CoverBorder:KP,InsertBorder:XP,ATreeHeader:JP,ATreeBodyHeader:QP,ATreeBodyHeaderResources:eN,ATreeItem:tN,IsSelectUsed:rN,IsSelected:nN,IsSearchSelected:iN,IsHovered:oN,CheckBox:sN,Indents:aN,ExpandIcon:lN,Content:cN,RightSticky:uN,SearchInputWrap:fN,SearchInput:dN,RightAddon:hN,RightAddonIcon:pN,Loader:gN},mN=r=>{const{isEqual:e,item:t,selectDisabled:n,selectUnused:i,isParentDisabled:l,indents:u,extIndents:h,useExpand:g,useSelect:m,useSearch:M,onDragStart:E,onDragOver:C,onDragEnd:_,showCheckbox:S,icons:D,iconWidth:A,isSelectMulti:b,isDraggable:k,isParentCheckHovered:O,hoverdItem:H,onMouseOver:q,onMouseLeave:G,ContentRenderer:Y,TreeItemRenderer:de,RightStickyAddon:te,resources:fe,containerRef:P,TreeItemStyle:re,TreeItemClassName:K,searchItemStyle:ne,searchItemClassName:oe,height:ue}=r,{children:ge}=I.useMemo(()=>t,[t]),[ae,_e]=I.useMemo(()=>g,[g]),[pe,ve]=I.useMemo(()=>m,[m]),[Le,Ne]=I.useMemo(()=>M,[M]),Ve=I.useMemo(()=>i?i(t):!1,[i,t]),Ae=I.useMemo(()=>!n||l?l:n(t),[n,l,t]),rt=I.useMemo(()=>ae.some(ze=>e(ze,t)),[ae,e,t]),pt=I.useMemo(()=>!ge||ge.length<1?"noChild":rt?"expanded":"collapsed",[ge,rt]),Ke=I.useMemo(()=>{const ze=D[pt];return am.includes(ze)?v.jsx(qr,{style:{width:A,height:A},icon:ze}):ze},[D,A,pt]),Ze=I.useCallback(ze=>{!_e||pt==="noChild"||(_e(rt?ae.filter(Ct=>!e(Ct,t)):[...ae,t]),ze.stopPropagation())},[_e,ae,rt,t,e,pt]),De=I.useMemo(()=>pe.some(ze=>e(ze,t)),[pe,e,t]),ke=I.useCallback(()=>{!ve||Ae||(ve(b?De?pe.filter(ze=>!e(ze,t)):[...pe,t]:[t]),Le&&Ne&&Le.items.some(ze=>e(ze,t))&&Ne({...Le,item:t}))},[b,Ae,De,Le,Ne,ve,e,pe,t]),Te=I.useMemo(()=>Le==null?void 0:Le.items.some(ze=>e(ze,t)),[Le,e,t]),je=I.useMemo(()=>Te&&(Le==null?void 0:Le.item)&&e(Le.item,t),[Te,Le,e,t]),Re=I.useRef(null);I.useEffect(()=>{setTimeout(()=>{if(je&&Re.current&&P.current){const{top:ze,bottom:Ct}=Re.current.getBoundingClientRect(),{top:Ft,bottom:br}=P.current.getBoundingClientRect();(ze<Ft||Ct>br)&&Re.current.scrollIntoView({behavior:"smooth",block:"center"})}},10)},[P,je]);const[Qe,ct]=I.useState(!1),_t=I.useCallback(()=>!Ae&&ct(!0),[Ae]),wt=I.useCallback(()=>!Ae&&ct(!1),[Ae]),mt=I.useMemo(()=>Qa.map(t,ze=>ze).filter(ze=>!(n!=null&&n(ze))&&!(i!=null&&i(ze))),[n,i,t]),It=I.useMemo(()=>!S||!b?!1:De&&mt.some(ze=>pe.some(Ct=>e(ze,Ct)))&&mt.some(ze=>!pe.some(Ct=>e(ze,Ct))),[S,b,De,mt,e,pe]),St=I.useMemo(()=>S?b?mt.every(ze=>pe.some(Ct=>e(ze,Ct))):pe.some(ze=>e(ze,t)):!1,[S,b,mt,t,e,pe]),at=I.useCallback(()=>{if(!(!ve||Ae))if(b)if(De){const ze=pe.filter(Ct=>!(i!=null&&i(Ct))&&!(n!=null&&n(Ct))&&mt.some(Ft=>e(Ft,Ct)));ze.length>0&&ve(pe.filter(Ct=>!ze.some(Ft=>e(Ct,Ft))))}else{const ze=mt.filter(Ct=>!(i!=null&&i(Ct))&&!(n!=null&&n(Ct))&&!pe.some(Ft=>e(Ft,Ct)));ze.length>0&&ve([...pe,...ze])}else ve([t])},[Ae,n,i,b,ve,e,De,pe,mt,t]),ot=I.useCallback(ze=>{Ae||at(),ze.stopPropagation()},[Ae,at]),xt=I.useMemo(()=>{if(!S||!b||Ae)return"";if(De){const Ct=pe.filter(Ft=>!(i!=null&&i(Ft))&&!(n!=null&&n(Ft))&&mt.some(br=>e(br,Ft)));if(Ct.length>0)return fe["deselect n"](Ct.length)}const ze=mt.filter(Ct=>!(i!=null&&i(Ct))&&!(n!=null&&n(Ct))&&!pe.some(Ft=>e(Ft,Ct)));return fe["select n"](ze.length)},[n,i,fe,Ae,S,b,De,mt,e,pe]),Ie=I.useMemo(()=>Rr.getContent(te,r),[te,r]),lt=I.useMemo(()=>Rr.getContent(re,r),[r,re]),gt=I.useMemo(()=>Rr.getContent(K,r),[r,K]),Et=I.useMemo(()=>Rr.getContent(oe,r),[r,oe]),Bt=I.useMemo(()=>Rr.getContent(ne,r),[r,ne]);return v.jsxs(I.Fragment,{children:[v.jsxs(Wr,{className:Fe.clsx(fn.ATreeItem,De&&fn.IsSelected,!Ae&&(Qe||O)&&fn.IsHovered,Te&&fn.IsSearched,je&&(Et||fn.IsSearchSelected),!Ve&&fn.IsSelectUsed,"NoSelect",gt),style:{...lt,...je&&Bt,"--ATreeItem_height":`${ue}px`},draggable:k,onDragStart:()=>E==null?void 0:E(t),onDragEnter:ze=>C==null?void 0:C(ze,t),onDragEnd:ze=>_==null?void 0:_(ze,t),onClick:ke,abaseRef:Re,isDisabled:Ae,onMouseOver:ze=>q==null?void 0:q(ze,t),onMouseLeave:ze=>G==null?void 0:G(ze,t),children:[S&&v.jsx(Uu,{style:{visibility:Ae||Ve?"hidden":"visible",zIndex:Ae||Ve?0:2},className:fn.CheckBox,useCheck:[+St,at],onClick:ot,isIndeterminate:It,onMouseOver:_t,onMouseOut:wt,tooltip:xt,isDisabled:Ae}),v.jsx("div",{className:fn.Indents,style:{paddingLeft:S?0:r.icons.noChild?12:0},children:u.map((ze,Ct)=>{const Ft=Ct===u.length-1;return v.jsx(I2,{value:ze,map:{Collapsed:h?h({iconWidth:A}).collapsed:v.jsx(yN,{iconWidth:A}),Expanded:h?h({iconWidth:A,isLast:Ft}).expanded:v.jsx(vN,{iconWidth:A,isLast:Ft}),IsLast:h?h({iconWidth:A}).isLast:v.jsx(bN,{iconWidth:A})}},Ct)})}),Ke&&v.jsx("div",{className:fn.ExpandIcon,style:{width:A,minWidth:A,maxWidth:A},onClick:Ze,children:Ke}),v.jsx("div",{className:Fe.clsx(fn.Content,"NoSelect"),children:v.jsx(Y,{isEqual:e,item:t,indents:u,extIndents:h,useExpand:g,useSelect:m,useSearch:M,onDragStart:E,onDragOver:C,onDragEnd:_,showCheckbox:S,icons:D,iconWidth:A,isSelectMulti:b,isDraggable:k,isParentCheckHovered:b&&(Qe||O),hoverdItem:H,onMouseOver:q,onMouseLeave:G,ContentRenderer:Y,TreeItemRenderer:de,RightStickyAddon:te,resources:fe,containerRef:P,TreeItemStyle:re,TreeItemClassName:K,searchItemClassName:Et,searchItemStyle:ne,height:ue})}),Ie&&v.jsx("div",{className:fn.RightSticky,children:Ie})]}),rt&&(ge==null?void 0:ge.map((ze,Ct)=>v.jsx(de,{isEqual:e,item:ze,selectDisabled:n,selectUnused:i,indents:[...u.map(Ft=>Ft==="IsLast"?"Collapsed":Ft),Ct===ge.length-1?"IsLast":"Expanded"],extIndents:h,ContentRenderer:Y,useExpand:g,useSelect:m,useSearch:M,onDragStart:E,onDragOver:C,onDragEnd:_,showCheckbox:S,icons:D,iconWidth:A,isSelectMulti:b,isDraggable:k,isParentCheckHovered:b&&(Qe||O),hoverdItem:H,onMouseOver:q,onMouseLeave:G,TreeItemRenderer:de,RightStickyAddon:te,resources:fe,containerRef:P,TreeItemStyle:re,TreeItemClassName:K,searchItemClassName:Et,searchItemStyle:ne,height:ue},Ct)))]})},vN=({iconWidth:r,isLast:e})=>v.jsx("div",{style:{width:r/8*3,height:"100%",borderLeft:"var(--ATree_Indent_border)",marginLeft:r/2,marginRight:r/8,boxSizing:"border-box",transition:"border-color var(--Transition)"},children:e&&v.jsx("div",{style:{borderBottom:"var(--ATree_Indent_border)",height:"50%",transition:"border-color var(--Transition)"}})}),yN=({iconWidth:r})=>v.jsx("div",{style:{width:r,height:"100%",borderLeft:"none",marginLeft:0,transition:"border-color var(--Transition)"}}),bN=({iconWidth:r})=>v.jsx("div",{style:{width:r/8*3,height:"50%",borderLeft:"var(--ATree_Indent_border)",borderBottom:"var(--ATree_Indent_border)",marginLeft:r/2,marginRight:r/8,boxSizing:"border-box",transition:"border-color var(--Transition)"}}),_N=r=>{const{isEqual:e,searchResult:t,initSearch:n,searchUp:i,searchDown:l,searchEnter:u,isDisabled:h,isLoading:g,resources:m,maxLength:M,autoFocus:E}=r,C=I.useCallback(D=>{D.key==="Enter"?u():D.key==="ArrowDown"?l():D.key==="ArrowUp"&&i(),D.preventDefault(),D.stopPropagation()},[l,u,i]),_=I.useCallback(D=>{n(D)},[n]),S=I.useMemo(()=>h||g?-1:void 0,[h,g]);return v.jsx(Jl,{className:fn.SearchInput,wrapProps:{className:fn.SearchInputWrap},isDisabled:h,tabIndex:S,useValue:[(t==null?void 0:t.keyword)??"",_],onKeyDown:C,placeholder:m["Search(Placeholder)"],RightAddon:v.jsx(xN,{isEqual:e,searchResult:t,searchUp:i,searchDown:l,searchEnter:u,resources:m}),maxLength:M,autoFocus:E})},xN=r=>{const{isEqual:e,searchResult:t,searchUp:n,searchDown:i,searchEnter:l,resources:u}=r,h=I.useMemo(()=>!t||t.items.length<1?0:t.items.findIndex(S=>t.item&&e(S,t.item))+1,[t,e]),g=I.useMemo(()=>!t||t.items.length<1?0:t.items.length,[t]),m=I.useMemo(()=>h<2,[h]),M=I.useMemo(()=>h>=g,[h,g]),E=I.useCallback(S=>{S.stopPropagation(),!m&&n()},[n,m]),C=I.useCallback(S=>{S.stopPropagation(),!M&&i()},[i,M]),_=I.useCallback(S=>{S.stopPropagation(),l()},[l]);return v.jsx("div",{className:Fe.clsx(fn.RightAddon,"NoSelect"),children:t?v.jsxs(v.Fragment,{children:[h,"/",g,v.jsx(Wr,{onClick:E,isDisabled:m,children:v.jsx(qr,{className:fn.RightAddonIcon,icon:"ArrowUp",mask:""})}),v.jsx(Wr,{onClick:C,isDisabled:M,children:v.jsx(qr,{className:fn.RightAddonIcon,icon:"ArrowDown"})})]}):v.jsx(vo,{type:"Raw",className:fn.RightAddonIcon,style:{marginRight:4},icon:"Search",onClick:_,tooltip:u["Search(Button)"]})})},SN=r=>{var mr;const{pk:e,selectDisabled:t,selectUnused:n,useItems:i,useExpand:l,useSelect:u,useSearch:h,showCheckbox:g,iconWidth:m=24,icons:M={noChild:"Folder",collapsed:"FolderCopy",expanded:"FolderOpen"},indents:E,isSelectMulti:C=!1,noSearch:_=!1,isDraggable:S,noSyncSearchSelect:D=!1,actionRef:A,placeholder:b,searchPredicate:k=wN,isDisabled:O,isLoading:H,ContentRenderer:q=CN,TreeItemRenderer:G=mN,RightStickyAddon:Y,TopRightAddon:de,TreeTopAddon:te,resources:fe,maxLength:P,autoFocus:re,TreeItemStyle:K,TreeItemClassName:ne,OverflowPadding:oe,insertBorder:ue,width:ge,searchItemClassName:ae,searchItemStyle:_e,height:pe=40,...ve}=r,Le=I.useMemo(()=>({...hn.ATree,...fe}),[fe]),Ne=I.useCallback((Xe,At)=>e!==void 0?Array.isArray(e)?e.every(vt=>el.isEqual(Xe[vt],At[vt])):el.isEqual(Xe[e],At[e]):el.isEqual(Xe,At),[e]),Ve=I.useRef(null),[Ae,rt]=pn(i,[]),pt=I.useMemo(()=>Qa.map(Ae,Xe=>Xe),[Ae]),[Ke,Ze]=pn(l,[]),[De,ke]=pn(u,[]),[Te,je]=pn(h,void 0),Re=I.useCallback(Xe=>{if(O||!Ze||Ke.some(Je=>Ne(Je,Xe)))return;const At=[];let vt=Xe;for(;vt;){const Je=vt;Ke.find(Nt=>Ne(Nt,Je))||At.push(Je),vt=pt.find(Nt=>{var ee;return(ee=Nt.children)==null?void 0:ee.some(qe=>Ne(qe,Je))})}Ze([...Ke,...At])},[Ke,O,Ne,Ze,pt]),Qe=I.useCallback(()=>{!Ze||O||Ze([...pt])},[pt,O,Ze]),ct=I.useCallback(()=>{!Ze||O||Ze([])},[Ze,O]),_t=I.useCallback(Xe=>{!ke||O||n!=null&&n(Xe)||(ke([Xe]),Re(Xe))},[ke,O,n,Re]),wt=I.useCallback(Xe=>{if(!je||O)return;if(!Xe||_){je(void 0),D||ke==null||ke([]);return}const At=Qa.filter(Ae,Je=>k(Xe,Je));let vt;if(At.find(Je=>(Te==null?void 0:Te.item)&&Ne(Je,Te.item))?vt=Te==null?void 0:Te.item:At.length>0&&(vt=At[0]),je({keyword:Xe,items:At,item:vt}),vt&&Re(vt),ke&&!D)if(C)ke(At);else{const Je=At.find(Nt=>vt&&Ne(Nt,vt));ke(Je?[Je]:[])}},[Ae,O,Ne,k,je,ke,Re,D,_,C,Te]),mt=I.useRef(!1);I.useEffect(()=>{mt.current=!0},[Ae]),I.useEffect(()=>{Te&&mt.current&&(wt(Te.keyword),mt.current=!1)},[wt,Te]);const It=I.useCallback(()=>{if(!Te||!je||O)return;let Xe=Te.items.findIndex(At=>Te.item&&Ne(At,Te.item))-1;Xe<0||(je({...Te,item:Te.items[Xe]}),Re(Te.items[Xe]),D||_t(Te.items[Xe]))},[Te,Re,je,O,_t,Ne,D]),St=I.useCallback(()=>{if(!Te||!je||O)return;let Xe=Te.items.findIndex(At=>Te.item&&Ne(At,Te.item))+1;Xe>=Te.items.length||(je({...Te,item:Te.items[Xe]}),Re(Te.items[Xe]),D||_t(Te.items[Xe]))},[Te,Re,O,je,_t,Ne,D]),at=I.useCallback(()=>{if(!Te||!je||O)return;let Xe=Te.items.findIndex(vt=>Te.item&&Ne(vt,Te.item));if(!D||n!=null&&n(Te.items[Xe])){St();return}if(De.some(vt=>Te.item&&Ne(vt,Te.item))){let vt=Xe+1;const Je=Te.items[vt];if(vt>=Te.items.length)return;je({...Te,item:Je}),_t(Je)}else _t(Te.items[Xe])},[Te,je,O,De,D,St,Ne,_t,n]),[ot,xt]=I.useState(!1),Ie=I.useCallback(()=>xt(!0),[]),lt=I.useCallback(()=>xt(!1),[]),gt=I.useMemo(()=>n?Qa.map(Ae,Xe=>Xe).filter(Xe=>!n(Xe)):t?Qa.map(Ae,Xe=>Xe).filter(Xe=>!t(Xe)):Qa.map(Ae,Xe=>Xe),[n,t,Ae]),Et=I.useMemo(()=>!g||!C?!1:De.length>0&>.length>De.length,[g,C,De,gt]),Bt=I.useMemo(()=>!g||!C?!1:De.length>0&>.length===De.length,[g,C,De,gt]),ze=I.useCallback(()=>{if(!ke||!C||O)return;const Xe=De.filter(At=>!(n!=null&&n(At))&&!(t!=null&&t(At))&>.some(vt=>Ne(vt,At)));if(Xe.length>0)ke(De.filter(At=>!Xe.some(vt=>Ne(At,vt))));else{const At=gt.filter(vt=>!(n!=null&&n(vt))&&!(t!=null&&t(vt))&&!De.some(Je=>Ne(Je,vt)));At.length>0&&ke([...De,...At])}},[C,O,n,t,ke,De,gt,Ne]),Ct=I.useMemo(()=>{if(!g||!C||O)return"";const Xe=De.filter(At=>!(n!=null&&n(At))&&!(t!=null&&t(At))&>.some(vt=>Ne(vt,At)));if(Xe.length>0)return Le["deselect n"](Xe.length);{const At=gt.filter(vt=>!(n!=null&&n(vt))&&!(t!=null&&t(vt))&&!De.some(Je=>Ne(Je,vt)));return Le["select n"](At.length)}},[n,t,O,Le,g,C,gt,De,Ne]),[Ft,br]=I.useState(null),[Or,Lt]=I.useState(null),ce=I.useCallback(Xe=>{!S||O||br(Xe)},[O,S]),X=I.useCallback((Xe,At)=>{if(!S||O||!Ft||(Xe.preventDefault(),Xe.stopPropagation(),Lt(At),!rt))return;const vt=Qa.replace(Ae,Ft,At,Ne);vt&&rt(vt)},[S,Ae,Ft,O,rt,Ne]),Ee=I.useCallback(()=>{if(!S||O||!Ft||!Or||!rt||Ne(Ft,Or))return;const Xe=Qa.replace(Ae,Ft,Or,Ne);Xe&&(rt(Xe),br(null))},[S,rt,Ae,Ft,Or,Ne,O]);I.useEffect(()=>{var Xe;g||(Xe=Ve.current)==null||Xe.scrollTo(0,0)},[g,Ve]),I.useEffect(()=>{!C&&De.length>1&&(ke==null||ke([De[De.length-1]]))},[C,ke,De]),I.useEffect(()=>{A&&(A.current={expandAll:Qe,collapseAll:ct})},[A,Qe,ct]),I.useEffect(()=>{if(!t||!ke)return;const Xe=De.filter(At=>!t(At));De.length!==Xe.length&&ke(Xe)},[t,De,ke]),I.useEffect(()=>{if(!n||!ke)return;const Xe=De.filter(At=>!n(At));De.length!==Xe.length&&ke(Xe)},[n,De,ke]),I.useEffect(()=>{je&&je(void 0)},[je]);const[He,ft]=I.useState(!1);I.useEffect(()=>{ft(Xe=>!Xe)},[Ae]);const[dt,bt]=I.useState(null),$t=I.useCallback((Xe,At)=>{O||(Xe.stopPropagation(),Xe.preventDefault(),bt(At))},[O]),Mt=I.useCallback((Xe,At)=>{dt===null||O||Ne(At,dt)&&(Xe.stopPropagation(),Xe.preventDefault(),bt(null))},[dt,O,Ne]),Ut=I.useRef(null),[Ht,nr]=I.useState(!1),[sr,cr]=I.useState((mr=Ut.current)==null?void 0:mr.scrollHeight);return I.useEffect(()=>{if(Ke.length<0)return;const Xe=Ve.current,At=Ut.current,vt=Xe.clientHeight<At.clientHeight;cr(vt?At.scrollHeight:Xe.clientHeight),nr(vt)},[Ke]),v.jsxs(Wr,{...ve,isDisabled:O,className:Fe.clsx(ve.className,fn.AWrap),children:[(!_||de)&&v.jsxs(Vn,{className:fn.ATreeHeader,children:[!_&&v.jsx(_N,{isEqual:Ne,searchResult:Te,initSearch:wt,searchUp:It,searchDown:St,searchEnter:at,isLoading:H,isDisabled:O,resources:Le,maxLength:P,autoFocus:re}),!_&&de&&v.jsx(mn,{w:8}),de]}),(!_||de||g&&C||S)&&v.jsx(hm,{isLoading:H&&Ae.length!==0}),(g&&C||S)&&v.jsxs("div",{className:Fe.clsx(fn.ATreeBodyHeader,"NoSelect"),children:[g&&v.jsx(Uu,{className:fn.CheckBox,useCheck:[+Bt,()=>ze()],isIndeterminate:Et,onMouseOver:Ie,onMouseOut:lt,isDisabled:O,tooltip:Ct}),Le.Items,v.jsx(Yc,{}),v.jsxs("div",{className:Fe.clsx(fn.ATreeBodyHeaderResources,"NoSelect"),style:{marginRight:Ht?8:0},children:[v.jsx("span",{children:g&&Le["*Click row for single select"]}),v.jsx("span",{children:S&&Le["*Change order to row drag"]})]})]}),v.jsx("div",{ref:Ve,className:Fe.clsx(ve.className,fn.AContainer),children:v.jsxs("div",{className:fn.ATree,style:{minWidth:ge||"fit-content",marginRight:oe&&Ht?8:0},children:[v.jsxs("div",{ref:Ut,className:fn.ATreeBody,children:[Ae.length===0?H?v.jsx(AN,{text:Le["Loading Contents..."]}):b:te,Ae.map((Xe,At)=>v.jsx(G,{isEqual:Ne,indents:[],extIndents:E,item:Xe,selectDisabled:t,selectUnused:n,isParentDisabled:O,useExpand:[Ke,Ze],useSelect:[De,ke],useSearch:[Te,je],onDragStart:ce,onDragOver:X,onDragEnd:Ee,showCheckbox:g,icons:M,iconWidth:m,isSelectMulti:C,isDraggable:S,isParentCheckHovered:C&&ot,ContentRenderer:q,TreeItemRenderer:G,RightStickyAddon:Y,resources:Le,containerRef:Ve,TreeItemStyle:K,TreeItemClassName:ne,hoverdItem:dt,onMouseOver:$t,onMouseLeave:Mt,searchItemClassName:ae,searchItemStyle:_e,height:pe},`${At}${He}`))]}),ue&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:fn.CoverBorder}),v.jsx("div",{className:fn.InsertBorder,style:{"--InsertBorder_height":`${pe}px`,height:Ht?sr:"100%"}})]})]})})]})},CN=r=>{const{item:e}=r,t={};return Qt.keys(e).forEach(n=>{n!=="children"&&(t[n]=e[n])}),JSON.stringify(t)};function wN(r,e){return Qt.some(e,(t,n)=>{var i;return(i=Qt.stringify(n))==null?void 0:i.toLowerCase().includes(r.toLowerCase())})}const AN=r=>{const{text:e}=r;return v.jsxs(Vn,{className:Fe.clsx(fn.Loader,"NoSelect"),children:[v.jsx(qr,{icon:"Spinner",style:{height:40},height:40,width:40}),v.jsx(z2,{text:e})]})};var $g,Gb;function Qu(){return Gb||(Gb=1,$g=TypeError),$g}const EN={},TN=Object.freeze(Object.defineProperty({__proto__:null,default:EN},Symbol.toStringTag,{value:"Module"})),kN=t4(TN);var Ug,Zb;function _h(){if(Zb)return Ug;Zb=1;var r=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,t=r&&e&&typeof e.get=="function"?e.get:null,n=r&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,l=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=i&&l&&typeof l.get=="function"?l.get:null,h=i&&Set.prototype.forEach,g=typeof WeakMap=="function"&&WeakMap.prototype,m=g?WeakMap.prototype.has:null,M=typeof WeakSet=="function"&&WeakSet.prototype,E=M?WeakSet.prototype.has:null,C=typeof WeakRef=="function"&&WeakRef.prototype,_=C?WeakRef.prototype.deref:null,S=Boolean.prototype.valueOf,D=Object.prototype.toString,A=Function.prototype.toString,b=String.prototype.match,k=String.prototype.slice,O=String.prototype.replace,H=String.prototype.toUpperCase,q=String.prototype.toLowerCase,G=RegExp.prototype.test,Y=Array.prototype.concat,de=Array.prototype.join,te=Array.prototype.slice,fe=Math.floor,P=typeof BigInt=="function"?BigInt.prototype.valueOf:null,re=Object.getOwnPropertySymbols,K=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ne=typeof Symbol=="function"&&typeof Symbol.iterator=="object",oe=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ne||!0)?Symbol.toStringTag:null,ue=Object.prototype.propertyIsEnumerable,ge=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(ce){return ce.__proto__}:null);function ae(ce,X){if(ce===1/0||ce===-1/0||ce!==ce||ce&&ce>-1e3&&ce<1e3||G.call(/e/,X))return X;var Ee=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof ce=="number"){var He=ce<0?-fe(-ce):fe(ce);if(He!==ce){var ft=String(He),dt=k.call(X,ft.length+1);return O.call(ft,Ee,"$&_")+"."+O.call(O.call(dt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return O.call(X,Ee,"$&_")}var _e=kN,pe=_e.custom,ve=Re(pe)?pe:null,Le={__proto__:null,double:'"',single:"'"},Ne={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Ug=function ce(X,Ee,He,ft){var dt=Ee||{};if(_t(dt,"quoteStyle")&&!_t(Le,dt.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(_t(dt,"maxStringLength")&&(typeof dt.maxStringLength=="number"?dt.maxStringLength<0&&dt.maxStringLength!==1/0:dt.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var bt=_t(dt,"customInspect")?dt.customInspect:!0;if(typeof bt!="boolean"&&bt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(_t(dt,"indent")&&dt.indent!==null&&dt.indent!==" "&&!(parseInt(dt.indent,10)===dt.indent&&dt.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(_t(dt,"numericSeparator")&&typeof dt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var $t=dt.numericSeparator;if(typeof X>"u")return"undefined";if(X===null)return"null";if(typeof X=="boolean")return X?"true":"false";if(typeof X=="string")return gt(X,dt);if(typeof X=="number"){if(X===0)return 1/0/X>0?"0":"-0";var Mt=String(X);return $t?ae(X,Mt):Mt}if(typeof X=="bigint"){var Ut=String(X)+"n";return $t?ae(X,Ut):Ut}var Ht=typeof dt.depth>"u"?5:dt.depth;if(typeof He>"u"&&(He=0),He>=Ht&&Ht>0&&typeof X=="object")return pt(X)?"[Array]":"[Object]";var nr=br(dt,He);if(typeof ft>"u")ft=[];else if(It(ft,X)>=0)return"[Circular]";function sr(ur,hr,$r){if(hr&&(ft=te.call(ft),ft.push(hr)),$r){var vr={depth:dt.depth};return _t(dt,"quoteStyle")&&(vr.quoteStyle=dt.quoteStyle),ce(ur,vr,He+1,ft)}return ce(ur,dt,He+1,ft)}if(typeof X=="function"&&!Ze(X)){var cr=mt(X),mr=Lt(X,sr);return"[Function"+(cr?": "+cr:" (anonymous)")+"]"+(mr.length>0?" { "+de.call(mr,", ")+" }":"")}if(Re(X)){var Xe=ne?O.call(String(X),/^(Symbol\(.*\))_[^)]*$/,"$1"):K.call(X);return typeof X=="object"&&!ne?Bt(Xe):Xe}if(lt(X)){for(var At="<"+q.call(String(X.nodeName)),vt=X.attributes||[],Je=0;Je<vt.length;Je++)At+=" "+vt[Je].name+"="+Ve(Ae(vt[Je].value),"double",dt);return At+=">",X.childNodes&&X.childNodes.length&&(At+="..."),At+="</"+q.call(String(X.nodeName))+">",At}if(pt(X)){if(X.length===0)return"[]";var Nt=Lt(X,sr);return nr&&!Ft(Nt)?"["+Or(Nt,nr)+"]":"[ "+de.call(Nt,", ")+" ]"}if(De(X)){var ee=Lt(X,sr);return!("cause"in Error.prototype)&&"cause"in X&&!ue.call(X,"cause")?"{ ["+String(X)+"] "+de.call(Y.call("[cause]: "+sr(X.cause),ee),", ")+" }":ee.length===0?"["+String(X)+"]":"{ ["+String(X)+"] "+de.call(ee,", ")+" }"}if(typeof X=="object"&&bt){if(ve&&typeof X[ve]=="function"&&_e)return _e(X,{depth:Ht-He});if(bt!=="symbol"&&typeof X.inspect=="function")return X.inspect()}if(St(X)){var qe=[];return n&&n.call(X,function(ur,hr){qe.push(sr(hr,X,!0)+" => "+sr(ur,X))}),Ct("Map",t.call(X),qe,nr)}if(xt(X)){var ht=[];return h&&h.call(X,function(ur){ht.push(sr(ur,X))}),Ct("Set",u.call(X),ht,nr)}if(at(X))return ze("WeakMap");if(Ie(X))return ze("WeakSet");if(ot(X))return ze("WeakRef");if(Te(X))return Bt(sr(Number(X)));if(Qe(X))return Bt(sr(P.call(X)));if(je(X))return Bt(S.call(X));if(ke(X))return Bt(sr(String(X)));if(typeof window<"u"&&X===window)return"{ [object Window] }";if(typeof globalThis<"u"&&X===globalThis||typeof yi<"u"&&X===yi)return"{ [object globalThis] }";if(!Ke(X)&&!Ze(X)){var Ot=Lt(X,sr),rr=ge?ge(X)===Object.prototype:X instanceof Object||X.constructor===Object,Xt=X instanceof Object?"":"null prototype",Dt=!rr&&oe&&Object(X)===X&&oe in X?k.call(wt(X),8,-1):Xt?"Object":"",Jt=rr||typeof X.constructor!="function"?"":X.constructor.name?X.constructor.name+" ":"",Mr=Jt+(Dt||Xt?"["+de.call(Y.call([],Dt||[],Xt||[]),": ")+"] ":"");return Ot.length===0?Mr+"{}":nr?Mr+"{"+Or(Ot,nr)+"}":Mr+"{ "+de.call(Ot,", ")+" }"}return String(X)};function Ve(ce,X,Ee){var He=Ee.quoteStyle||X,ft=Le[He];return ft+ce+ft}function Ae(ce){return O.call(String(ce),/"/g,""")}function rt(ce){return!oe||!(typeof ce=="object"&&(oe in ce||typeof ce[oe]<"u"))}function pt(ce){return wt(ce)==="[object Array]"&&rt(ce)}function Ke(ce){return wt(ce)==="[object Date]"&&rt(ce)}function Ze(ce){return wt(ce)==="[object RegExp]"&&rt(ce)}function De(ce){return wt(ce)==="[object Error]"&&rt(ce)}function ke(ce){return wt(ce)==="[object String]"&&rt(ce)}function Te(ce){return wt(ce)==="[object Number]"&&rt(ce)}function je(ce){return wt(ce)==="[object Boolean]"&&rt(ce)}function Re(ce){if(ne)return ce&&typeof ce=="object"&&ce instanceof Symbol;if(typeof ce=="symbol")return!0;if(!ce||typeof ce!="object"||!K)return!1;try{return K.call(ce),!0}catch{}return!1}function Qe(ce){if(!ce||typeof ce!="object"||!P)return!1;try{return P.call(ce),!0}catch{}return!1}var ct=Object.prototype.hasOwnProperty||function(ce){return ce in this};function _t(ce,X){return ct.call(ce,X)}function wt(ce){return D.call(ce)}function mt(ce){if(ce.name)return ce.name;var X=b.call(A.call(ce),/^function\s*([\w$]+)/);return X?X[1]:null}function It(ce,X){if(ce.indexOf)return ce.indexOf(X);for(var Ee=0,He=ce.length;Ee<He;Ee++)if(ce[Ee]===X)return Ee;return-1}function St(ce){if(!t||!ce||typeof ce!="object")return!1;try{t.call(ce);try{u.call(ce)}catch{return!0}return ce instanceof Map}catch{}return!1}function at(ce){if(!m||!ce||typeof ce!="object")return!1;try{m.call(ce,m);try{E.call(ce,E)}catch{return!0}return ce instanceof WeakMap}catch{}return!1}function ot(ce){if(!_||!ce||typeof ce!="object")return!1;try{return _.call(ce),!0}catch{}return!1}function xt(ce){if(!u||!ce||typeof ce!="object")return!1;try{u.call(ce);try{t.call(ce)}catch{return!0}return ce instanceof Set}catch{}return!1}function Ie(ce){if(!E||!ce||typeof ce!="object")return!1;try{E.call(ce,E);try{m.call(ce,m)}catch{return!0}return ce instanceof WeakSet}catch{}return!1}function lt(ce){return!ce||typeof ce!="object"?!1:typeof HTMLElement<"u"&&ce instanceof HTMLElement?!0:typeof ce.nodeName=="string"&&typeof ce.getAttribute=="function"}function gt(ce,X){if(ce.length>X.maxStringLength){var Ee=ce.length-X.maxStringLength,He="... "+Ee+" more character"+(Ee>1?"s":"");return gt(k.call(ce,0,X.maxStringLength),X)+He}var ft=Ne[X.quoteStyle||"single"];ft.lastIndex=0;var dt=O.call(O.call(ce,ft,"\\$1"),/[\x00-\x1f]/g,Et);return Ve(dt,"single",X)}function Et(ce){var X=ce.charCodeAt(0),Ee={8:"b",9:"t",10:"n",12:"f",13:"r"}[X];return Ee?"\\"+Ee:"\\x"+(X<16?"0":"")+H.call(X.toString(16))}function Bt(ce){return"Object("+ce+")"}function ze(ce){return ce+" { ? }"}function Ct(ce,X,Ee,He){var ft=He?Or(Ee,He):de.call(Ee,", ");return ce+" ("+X+") {"+ft+"}"}function Ft(ce){for(var X=0;X<ce.length;X++)if(It(ce[X],`
|
350
350
|
`)>=0)return!1;return!0}function br(ce,X){var Ee;if(ce.indent===" ")Ee=" ";else if(typeof ce.indent=="number"&&ce.indent>0)Ee=de.call(Array(ce.indent+1)," ");else return null;return{base:Ee,prev:de.call(Array(X+1),Ee)}}function Or(ce,X){if(ce.length===0)return"";var Ee=`
|
package/dist/index.es.js
CHANGED
@@ -30687,7 +30687,7 @@ const oM = [
|
|
30687
30687
|
window.addEventListener("mousemove", le), window.addEventListener("mouseup", K);
|
30688
30688
|
},
|
30689
30689
|
[O, ye, q, b, k, pe, he]
|
30690
|
-
), Ie = me(() => O || b, [O, b]), et = me(() => Ie ? "fit-content" : k ? k + Pe : `calc(100% - ${Pe}px)`, [Ie, k, Pe]), ut = me(() => {
|
30690
|
+
), Ie = me(() => O || b || P, [O, b, P]), et = me(() => Ie ? "fit-content" : k ? k + Pe : `calc(100% - ${Pe}px)`, [Ie, k, Pe]), ut = me(() => {
|
30691
30691
|
if (O) {
|
30692
30692
|
if (ye)
|
30693
30693
|
switch (n) {
|