@layers-app/editor 0.5.8-optimization → 0.5.10-optimization

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.
Files changed (51) hide show
  1. package/README.md +0 -19
  2. package/dist/ExcalidrawComponent-D7Z_2awF.cjs +1 -0
  3. package/dist/ExcalidrawComponent-Re4zFgLg.js +283 -0
  4. package/dist/InlineImageComponent-DHgCaPNk.cjs +1 -0
  5. package/dist/InlineImageComponent-kXhZcmF6.js +265 -0
  6. package/dist/collaboration-C7xVk0Zj.cjs +4 -0
  7. package/dist/collaboration-Cn7KizEJ.js +5997 -0
  8. package/dist/excalidraw-C-6bid_P.js +16497 -0
  9. package/dist/excalidraw-DpwKTNBz.cjs +574 -0
  10. package/dist/index-B4yOqKUQ.cjs +1 -0
  11. package/dist/index-BZu8Qnrg.cjs +1 -0
  12. package/dist/index-CFA9Drk2.cjs +16 -0
  13. package/dist/index-CX5msaMB.js +296 -0
  14. package/dist/index-CbQX0N2c.js +136 -0
  15. package/dist/index-DEC5JR_F.js +60 -0
  16. package/dist/index-Dan3tqoj.cjs +1 -0
  17. package/dist/index-WCOc4LNL.js +16600 -0
  18. package/dist/index.cjs +2 -2
  19. package/dist/index.js +12 -13
  20. package/dist/lexical-2rxs76dr.cjs +41 -0
  21. package/dist/lexical-C60GkwxR.js +13122 -0
  22. package/dist/lexical-code-DKIWiZdJ.js +604 -0
  23. package/dist/lexical-code-VafvPacU.cjs +9 -0
  24. package/dist/lexical-collab-1tX9tFVC.js +1025 -0
  25. package/dist/lexical-collab-Nk2LVpJv.cjs +1 -0
  26. package/dist/lexical-file-C52Mze5k.cjs +1 -0
  27. package/dist/lexical-file-DjHP4vVw.js +43 -0
  28. package/dist/lexical-markdown-BSl_ahWw.cjs +12 -0
  29. package/dist/lexical-markdown-DcEwQQba.js +488 -0
  30. package/dist/lodash-3PEMjFQT.cjs +1 -0
  31. package/dist/lodash-jftOdrxX.js +711 -0
  32. package/dist/stats.html +4949 -0
  33. package/dist/vendor-BrXDSyZX.js +136433 -0
  34. package/dist/vendor-Bt6Lma3y.cjs +2469 -0
  35. package/package.json +42 -74
  36. package/dist/layers.8yssqxrI.js +0 -6774
  37. package/dist/layers.B8z-e4Vg.js +0 -7
  38. package/dist/layers.BQLznd92.js +0 -4
  39. package/dist/layers.BVRvG1mv.js +0 -3
  40. package/dist/layers.BjCQNcdJ.js +0 -341
  41. package/dist/layers.BnVn2uMi.js +0 -7723
  42. package/dist/layers.CLcioDq5.js +0 -2511
  43. package/dist/layers.CTSBFg3j.js +0 -1
  44. package/dist/layers.CoCZDINv.js +0 -864
  45. package/dist/layers.D0ZtUpST.js +0 -2
  46. package/dist/layers.D2zjLyjP.js +0 -6
  47. package/dist/layers.DNCgFYS7.js +0 -27
  48. package/dist/layers.Dt_Jdn4Y.js +0 -2227
  49. package/dist/layers.DwX5sVtx.js +0 -1
  50. package/dist/layers.QjAkD17S.js +0 -3677
  51. package/dist/layers.pre7B8K-.js +0 -530
@@ -1,2 +0,0 @@
1
- "use strict";const Oe=require("@lexical/react/LexicalComposerContext"),n=require("react/jsx-runtime"),l=require("react"),Be=require("react-dom"),Ee=require("react-i18next"),xe=require("@lexical/rich-text"),de=require("@lexical/utils"),u=require("@mantine/core"),$=require("@tabler/icons-react"),c=require("lexical"),Ce=require("./layers.BVRvG1mv.js"),rt=require("@lexical/code");require("@lexical/hashtag");const Me=require("@lexical/link");require("@lexical/mark");require("@lexical/overflow");require("@lexical/react/LexicalHorizontalRuleNode");const C=require("./layers.BQLznd92.js"),ee=require("./layers.B8z-e4Vg.js"),T=require("./layers.DwX5sVtx.js"),Ne=require("@lexical/selection"),Pe=require("@layers-app/shared"),V=require("./layers.D2zjLyjP.js"),lt=require("./layers.DNCgFYS7.js"),at=require("@lexical/react/LexicalDecoratorBlockNode"),He=require("@mantine/hooks"),Ke=require("./layers.CTSBFg3j.js"),ct=4,ut=2,dt="draggable-block-menu",ft=16,ze="application/x-lexical-drag-block",De=e=>e?e.match(/(\d*\.?\d+)%/g):[],Ze=e=>e<0?0:e>100?100:e,Je=(e,t,o)=>{let i=0,s=[];e.update(()=>{if(e&&t){const f=e.getElementByKey(t.getKey());if(f){const p=f.style;s=De(p.getPropertyValue("grid-template-columns")).map(m=>m.slice(0,-1)),i=s?s.length:0}}const a=100/(i+1),r=[...s];r.splice(o,0,`${a}%`);let d=a/i;for(let f=0;f<r.length;f++)if(o!==f){const p=Number(r[f])-d;r[f]=`minmax(100px,${Ze(p)}%)`}else r[f]=`minmax(100px,${r[f]})`;t.setTemplateColumns(r.join(" "))})},Re=(e,t,o,i)=>{e.update(()=>{const s=e.getElementByKey(t.getKey());if(!s)return;let a=i;o<i&&(a=i-1);const d=s.style.getPropertyValue("grid-template-columns").match(/minmax\([^)]*\)|\S+/g)||[],f=d.splice(o,1)[0];d.splice(a,0,f),t.setTemplateColumns(d.join(" "))})},Ie=(e,t)=>(e!=null&&e.children?Array.from(e.children):[]).indexOf(t);function mt(e,t,o,i){var f;let s=e.getAttribute("data-direction")==="left",a=e.getAttribute("data-direction")==="right",r=e.getAttribute("data-index"),d=e.getAttribute("data-index-start");if(s||a||r){let p=(f=o.getParent())==null?void 0:f.getParent();if(o instanceof C.LayoutContainerNode&&(p=o),o instanceof C.LayoutDividerNode||o instanceof C.LayoutContainerNode){const m=p==null?void 0:p.getChildren();let N=i instanceof C.LayoutDividerNode;if((m==null?void 0:m.length)>=4&&!N)return!0;t.update(()=>{var _;let g=0;s?g=0:a?g=((_=p==null?void 0:p.getChildren())==null?void 0:_.length)-1:g=Number(r),N?Re(t,p,Number(d),g):Je(t,p,g);let A=null;g!==void 0&&t.update(()=>{if(A=p.getChildren()[g],N)o instanceof C.LayoutContainerNode?A.insertAfter(i.getParent()):A.insertBefore(i.getParent());else if(a)A.insertAfter(C.$createLayoutItemNode().append(i).append(C.$createLayoutDividerNode()));else{const j=i.getParent(),L=j==null?void 0:j.getParent();C.$isLayoutItemNode(j)&&(j==null?void 0:j.getChildrenSize())===2&&C.$isLayoutItemNode(j)&&C.$isLayoutContainerNode(L)&&T.removeNodeKeepContent(t,j,L),A.insertBefore(C.$createLayoutItemNode().append(i).append(C.$createLayoutDividerNode()))}})})}else t.update(()=>{const m=C.$createLayoutContainerNode(ee.GRID_TWO_COL_WITH_GAP);let N;if(C.$isCalloutWrapperNode(o)||ee.$isCollapsibleContainerNode(o)){const g=i.getParent(),A=g==null?void 0:g.getParent();if(C.$isLayoutItemNode(g)&&(g==null?void 0:g.getChildrenSize())===2&&C.$isLayoutContainerNode(A)){const j=A.getParent(),L=j==null?void 0:j.getParent(),F=A.getChildren(),v=F.findIndex(B=>B===g)===0?1:0,P=F[v];if(C.$isLayoutItemNode(P)){const B=P.getChildren()[0];C.$isCalloutWrapperNode(L)&&(L.append(B),A.remove(),N=T.$copyNodeDeep(L))}}else N=T.$copyNodeDeep(o,i)}else N=T.$copyNodeDeep(o);N&&(s?(m.append(C.$createLayoutItemNode().append(i).append(C.$createLayoutDividerNode())),m.append(C.$createLayoutItemNode().append(N).append(C.$createLayoutDividerNode()))):(m.append(C.$createLayoutItemNode().append(N).append(C.$createLayoutDividerNode())),m.append(C.$createLayoutItemNode().append(i).append(C.$createLayoutDividerNode()))),o.insertAfter(m),o.remove(),N.selectStart())});return!0}return!1}function pt(e,t,o="right",i=!1){e.update(()=>{const s=c.$getNearestNodeFromDOMNode(t),a=s==null?void 0:s.getParent();if(a){if(De(a.__templateColumns).length===4)return;let d=Ie(t.parentElement,t);o==="right"&&(d=d+1),Je(e,a,d)}const r=C.$createLayoutItemNode().append(c.$createParagraphNode()).append(C.$createLayoutDividerNode());s&&(o==="right"?i?(s.insertBefore(T.$copyNodeDeep(s)),s.selectStart()):(s.insertAfter(r),r==null||r.selectStart()):(s.insertBefore(r),r.selectStart()))})}const et=(e,t)=>{const o=t==null?void 0:t.getParent();let i=De(o==null?void 0:o.getTemplateColumns());const s=o==null?void 0:o.getChildren();let a=0;if(s&&t){for(let m=0;m<s.length;m++)if(s[m].__key===t.__key){a=m;break}}i.splice(a,1);const r=i.map(m=>parseFloat(m)),d=r.reduce((m,N)=>m+N,0),p=r.map(m=>m/d*100).map(m=>`minmax(50px,${m.toFixed(2)}%)`);o==null||o.setTemplateColumns(p.join(" "))},gt=e=>e.className.includes("editor-image")||e.className.includes("video-container")?e:e.className.includes("editor-excalidraw")?e.firstChild:null,tt=(e,t)=>t!=null&&t.__key&&e!==t.__key?tt(e,t==null?void 0:t.getParent()):e===(t==null?void 0:t.__key),qe=(e,t,o)=>{e.update(()=>{var r,d,f;const i=(r=t==null?void 0:t.getParent())==null?void 0:r.getParent(),s=t==null?void 0:t.getParent(),a=o==="right"?(d=t==null?void 0:t.getParent())==null?void 0:d.getNextSibling():(f=t==null?void 0:t.getParent())==null?void 0:f.getPreviousSibling();if(s&&a&&i instanceof C.LayoutContainerNode){const p=e.getElementByKey(s.getKey()),m=e.getElementByKey(i.getKey()),N=Ie(m,p);s&&i&&a&&(o==="right"&&(Re(e,i,N+1,N),a.insertAfter(s)),o==="left"&&(Re(e,i,N,N+1),a.insertBefore(s)))}})};function ht(e){e&&(e.style.display="none")}function We({blockElement:e,editor:t,isTop:o,isClickedBlockRef:i,setDraggableBlockElem:s}){e&&(i.current=!0,t.update(()=>{const a=c.$getNearestNodeFromDOMNode(e);if(a){const r=c.$createParagraphNode();o?(a.insertBefore(r),setTimeout(()=>{s(t.getElementByKey(r.__key)),t.update(()=>{r.selectStart()})})):(a.insertAfter(r),setTimeout(()=>{s(t.getElementByKey(r.__key)),t.update(()=>{r.selectEnd()})}))}}))}function xt(e){const t=(f,p)=>f?parseFloat(window.getComputedStyle(f)[p]):0,{marginTop:o,marginBottom:i}=window.getComputedStyle(e),s=t(e.previousElementSibling,"marginBottom"),a=t(e.nextElementSibling,"marginTop"),r=Math.max(parseFloat(o),s);return{marginBottom:Math.max(parseFloat(i),a),marginTop:r}}function Ct(e){return!!e.closest(`.${dt}`)}function Ue(e,t,o,i){if(!e){t.style.opacity="0";return}t.style.display="block";let s=null;const a=gt(e);a&&a.style.justifyContent!=="left"&&a.firstChild instanceof HTMLElement?s=a.firstChild.getBoundingClientRect():s=e.getBoundingClientRect();let r=null,d=0,f=!0,p=0;if(s){let F=e.firstChild instanceof HTMLElement&&(e.firstChild.hasAttribute("data-lexical-text")||e.firstChild.tagName==="LI"||e.firstChild.tagName==="A")?e.firstChild:null;if(F&&!F.className.includes("editor-image")&&e.tagName!=="CODE"){const M=window.getComputedStyle(F),v=parseFloat(M.lineHeight),P=parseFloat(M.fontSize);p=Math.ceil(P+(v-P)/2),r=F.getBoundingClientRect()}else if(e.firstChild instanceof HTMLElement&&e.firstChild.tagName==="BR"&&e.tagName!=="CODE"){const M=window.getComputedStyle(e,"::before");p=parseFloat(M.height)||30}else e&&(e.tagName==="HR"||e.matches(":has(audio)")||e.classList.contains("file-container"))?p=e.clientHeight:e.firstChild instanceof HTMLElement&&e.firstChild.tagName==="SUMMARY"?p=e.firstChild.clientHeight:(r=s,f=!1)}const m=o.getBoundingClientRect(),N=(r==null?void 0:r.top)||s.top,g=p||d,A=t.clientHeight,_=g-A;let j=!f||!g?s.top+7-m.top:N+_/2-m.top,L=s.left-m.left-A*2-3;e.tagName==="LI"&&e.getAttribute("role")!=="checkbox"&&(L=L-26,j=j-1),a&&(j=N-m.top+7,(a.style.justifyContent==="center"||a.style.justifyContent==="right")&&(L=L+10)),e.matches(":has(.resizable-container__handle)")&&!e.matches(":has(.hide-padding)")&&(j=N-m.top+27),s.top<0&&(j=j+-s.top),e.className==="dsd__theme__layoutDivider"&&(t.style.display="none",s.top-t.clientHeight<0?e.style.setProperty("--height-column",`${e.clientHeight+s.top-t.clientHeight-7}px`):e.style.setProperty("--height-column",`${e.clientHeight}px`)),t.style.opacity="1",!i&&L>-40&&(t.style.transform=`translate(${L}px, ${j}px)`)}function Ye(e,t){const{transform:o}=t.style;t.style.transform="translateZ(0)",e.setDragImage(t,0,0),setTimeout(()=>{t.style.transform=o})}function yt(e,t){const o=document.createElement("div");o.style.position="absolute",o.style.top="-9999px",o.style.left="-9999px",t.forEach(i=>{const s=i.cloneNode(!0);s.style.position="relative",o.appendChild(s)}),document.body.appendChild(o),e.setDragImage(o,0,0),setTimeout(()=>document.body.removeChild(o),0)}function bt(e,t,o,i,s,a,r){var x;const{top:d,height:f,width:p,left:m}=t.getBoundingClientRect(),{top:N,left:g,width:A}=s==null?void 0:s.getBoundingClientRect(),{marginTop:_,marginBottom:j}=xt(t);let L=d;o>=d?(r.current.isBottom=!0,L+=f+j/2):(r.current.isBottom=!1,L-=_/2);const F=L-N-ut,M=ft-ct,P=a.target.closest(".dsd__theme__layoutDivider");e.setAttribute("data-index",""),e.style.background="deepskyblue";const B=m-g-M;if(i<=m&&!P){if(t.closest(".dsd__theme__layoutItem"))return;e.style.transform=`translate(${B}px, ${d-N}px)`,e.style.width="4px",e.style.height=`${f}px`,e.style.opacity=".4",e.setAttribute("data-direction","left")}else if(i>=A-B&&!P&&!t.closest(".dsd__theme__layoutItem"))t.classList.contains("dsd__theme__layoutContainer")&&!e.getAttribute("data-index-start")&&t&&t.children.length>=4&&(e.style.background="red"),e.style.transform=`translate(${A-B}px, ${d-N}px)`,e.style.width="4px",e.style.height=`${f}px`,e.style.opacity=".4",e.setAttribute("data-direction","right");else if(P){a.preventDefault();const S=(x=P.parentNode)==null?void 0:x.parentNode;(S==null?void 0:S.children.length)===4&&(e.style.background="red");const k=P.parentNode,O=Ie(S,k),R=O?P.getBoundingClientRect().left-g:B+30;e.style.transform=`translate(${R}px, ${d-N}px)`,e.style.width="4px",e.style.height=`${f}px`,e.style.opacity=".4",e.setAttribute("data-index",`${O}`)}else e.style.transform=`translate(${B}px, ${F}px)`,e.style.width=`${p+M}px`,e.style.opacity=".4",e.style.height="4px",e.setAttribute("data-direction","")}function Ge(e){e&&(e.style.opacity="0",e.style.transform="translate(-10000px, -10000px)")}const Tt=({hoveredButton:e,insertNewParagraph:t,currentDraggableBlockRef:o,setHoveredButton:i,isClickedBlockRef:s,setDraggableBlockElem:a,editor:r,t:d})=>n.jsx("div",{className:`icon add-block-menu ${e?"active":""}`,onClick:()=>{t({blockElement:o.current.htmlElement,editor:r,isTop:!1,isClickedBlockRef:s,setDraggableBlockElem:a}),i("both")},onMouseEnter:()=>{i("bottom")},onMouseLeave:()=>{i("both")},children:n.jsx(u.Tooltip,{openDelay:300,label:d("editor.hoverOptions.addNewBlockAbove"),position:"bottom",disabled:s.current||!e,children:n.jsx(u.ActionIcon,{radius:"sm",color:"gray",size:"xs",variant:"subtle","aria-label":"Settings",children:e==="bottom"?n.jsx($.IconPlus,{}):n.jsx($.IconMinus,{})})})}),Mt=({hoveredButton:e,insertNewParagraph:t,currentDraggableBlockRef:o,setHoveredButton:i,isClickedBlockRef:s,setDraggableBlockElem:a,editor:r,t:d})=>n.jsx("div",{className:`icon add-block-menu add-block-menu_top ${e?"active":""}`,onClick:()=>{t({blockElement:o.current.htmlElement,editor:r,isTop:!0,isClickedBlockRef:s,setDraggableBlockElem:a}),i("both")},onMouseEnter:()=>{i("top")},onMouseLeave:()=>{i("both")},children:n.jsx(u.Tooltip,{disabled:s.current||!e,openDelay:300,label:d("editor.hoverOptions.addNewBlockBelow"),position:"top",children:n.jsx(u.ActionIcon,{radius:"sm",color:"gray",size:"xs",variant:"subtle","aria-label":"Settings",children:e==="top"?n.jsx($.IconPlus,{}):n.jsx($.IconMinus,{})})})});function nt(e,t){var a,r;const o=(a=t.exportDOM)==null?void 0:a.call(t,e),i=(o==null?void 0:o.element)??null;if(c.$isElementNode(t)){const d=i??document.createElement("div"),f=((r=t.getChildren)==null?void 0:r.call(t))??[];for(const p of f){const m=nt(e,p);if(m)d.appendChild(m);else{const N=typeof p.getTextContent=="function"?p.getTextContent():"";N&&d.appendChild(document.createTextNode(N))}}return typeof(o==null?void 0:o.after)=="function"&&o.after(d),d}if(i)return typeof(o==null?void 0:o.after)=="function"&&o.after(i),i;const s=typeof t.getTextContent=="function"?t.getTextContent():"";return s?document.createTextNode(s):null}async function Xe(e,t){const o=e.getRootElement(),i=Array.from(o.querySelectorAll(".selected-block"));if(!i.length)return;let s="",a="";e.getEditorState().read(()=>{e.update(()=>{let r=i.map(f=>c.$getNearestNodeFromDOMNode(f)).filter(f=>!!f);s=r.map(f=>typeof f.getTextContent=="function"?f.getTextContent():"").filter(Boolean).join(`
2
- `);const d=document.createElement("div");r.forEach(f=>{const p=nt(e,f);t==="cut"&&f.remove(),p&&d.appendChild(p)}),a=d.innerHTML})}),(s||a)&&await Nt(s,a)}async function Nt(e,t){if(navigator.clipboard&&"write"in navigator.clipboard&&window.ClipboardItem){const o=new ClipboardItem({"text/plain":new Blob([e],{type:"text/plain"}),...t?{"text/html":new Blob([t],{type:"text/html"})}:{}});await navigator.clipboard.write([o])}}const Ve=(e,t,o,i)=>{if(o)if(i==="layout"){const s=o.getParent(),a=s.getParent();T.removeNodeKeepContent(e,s,a),t("delete")}else{const s=o==null?void 0:o.getParent();if(s instanceof C.LayoutItemNode&&s.getChildren().length===2){const a=s,r=s.getParent();if(o.__type==="image"){a.append(c.$createParagraphNode());return}T.removeNodeKeepContent(e,a,r)}T.deleteNode(e,o),t("delete")}},Qe=e=>{const t=e._rootElement;return Array.from(t.querySelectorAll(".selected-block"))},Fe=(e,t,o,i=!1)=>{t&&e.update(()=>{const s=e.getElementByKey(t.getParent().getKey());pt(e,s,o,i)})},_t=(e,t,o,i)=>{if(i==="layout")Fe(e,o,"right",!0);else{const s=e._rootElement,a=Array.from(s.querySelectorAll(".selected-block")).reverse();a.length&&(e.update(()=>{const r=c.$getNearestNodeFromDOMNode(a[0]);a.forEach(d=>{let f=c.$getNearestNodeFromDOMNode(d);f&&(r==null||r.insertAfter(T.$copyNodeDeep(f))),ee.$removeSelectedHTMLElement(d)})}),t())}},St=({editor:e,onChange:t,currentEditorNode:o,textBlock:i,t:s,isDisabledAddColumnButton:a,disabledMoveColumnButtons:r})=>{const{fetchUploadMedia:d,excludeNodes:f}=l.useContext(Ce.Context),[p,m]=l.useState("inherit"),[N,g]=l.useState("inherit"),[A,_]=l.useState("inherit"),[j,L]=l.useState("");l.useEffect(()=>{const x=o==null?void 0:o.__type;e.read(()=>{var S;((S=o==null?void 0:o.getParent())==null?void 0:S.__type)==="layout-item"?L("layout"):L(x==="callout-wrapper"?x:"block")})},[o==null?void 0:o.__key]);const F=x=>x.split(";").filter(Boolean).reduce((S,k)=>{const[O,R]=k.split(":").map(U=>U.trim());return O&&R&&(S[O]=R),S},{}),M=x=>Object.entries(x).map(([S,k])=>`${S}: ${k}`).join("; "),v=l.useCallback(x=>{e.update(()=>{const S=Qe(e).map(O=>c.$getNearestNodeFromDOMNode(O)).filter(Boolean),k=O=>{if(typeof O.getStyle=="function"&&typeof O.setStyle=="function"){const R=F(O.getStyle());R.color=x.color,R["background-color"]=x.bgColor,O.setStyle(M(R)),m(x.bgColor),_(x.color)}};S.forEach(O=>{if(O instanceof C.ListNode){O.getChildren().forEach(R=>{const U=R.getFirstChild();U instanceof C.ExtendedTextNode&&k(U)});return}if(O instanceof c.ElementNode){const R=O.getFirstChild();R instanceof C.ExtendedTextNode&&k(R)}})})},[m,_]),P=(x,S)=>{const k=S||j;k==="callout-wrapper"&&o instanceof C.CalloutWrapperNode?e.update(()=>{const O=ee.isCalloutValue(x);o.setType(O?x.meta.type:void 0),o.setBackgroundColor(x.value)}):k==="layout-color"?e.update(()=>{const O=o==null?void 0:o.getParent(),R=x.value===N?"inherit":x.value;O instanceof C.LayoutItemNode&&O.setLayoutBackground(R)}):v({color:A,bgColor:p,[x.mode==="background"?"bgColor":x.mode]:x.value})},B=x=>{const S=Qe(e);S.length?S.forEach(k=>{e.update(()=>{let O=c.$getNearestNodeFromDOMNode(k);O&&Ve(e,t,O,x)})}):e.update(()=>{let k=c.$getNearestNodeFromDOMNode(S[0]);Ve(e,t,k,x)})};return l.useEffect(()=>{setTimeout(()=>{e.read(()=>{if(j==="callout-wrapper"&&o instanceof C.CalloutWrapperNode){m(o.__backgroundColor);return}const x=o==null?void 0:o.getParent();x instanceof C.LayoutItemNode&&g(x.__backgroundColor);const S=c.$getSelection();c.$isRangeSelection(S)&&(_(Ne.$getSelectionStyleValueForProperty(S,"color","inherit")),m(Ne.$getSelectionStyleValueForProperty(S,"background-color","inherit")))})})},[]),n.jsxs(n.Fragment,{children:[n.jsx(u.Menu.Item,{onMouseDown:x=>{x.preventDefault(),Xe(e,"copy"),t("copy")},leftSection:n.jsx($.IconClipboard,{style:{width:u.rem(14),height:u.rem(14)}}),children:s("editor.link.copy")}),n.jsx(u.Menu.Item,{onMouseDown:x=>{x.preventDefault(),Xe(e,"cut"),t("cut")},leftSection:n.jsx($.IconCut,{style:{width:u.rem(14),height:u.rem(14)}}),children:s("editor.contextMenu.cut")}),n.jsx(u.Menu.Item,{onClick:()=>B(""),leftSection:n.jsx($.IconTrash,{style:{width:u.rem(14),height:u.rem(14)}}),children:s("editor.contextMenu.delete")}),n.jsx(u.Menu.Item,{disabled:j==="layout"&&a,onClick:()=>_t(e,t,o,j),leftSection:n.jsx($.IconCopy,{style:{width:u.rem(14),height:u.rem(14)}}),children:s("editor.contextMenu.duplicate")}),i==="text"&&j!=="callout-wrapper"&&n.jsxs(n.Fragment,{children:[n.jsx(u.Menu.Divider,{}),n.jsx(ee.BlockFormatMenu,{disabled:!1,blockType:"paragraph",rootType:"root",editor:e,mode:"editor",fetchUploadMedia:d,excludeNodes:f,onChange:t,menuProps:{trigger:"hover",position:"right-start",offset:{mainAxis:0,alignmentAxis:0}},children:n.jsx("div",{children:n.jsx(V.CustomMenuItem,{label:s("editor.toolbar.turnInto"),icon:n.jsx($.IconArrowsRightLeft,{style:{width:u.rem(14),height:u.rem(14)}})})})})]}),(i==="text"||j=="callout-wrapper")&&n.jsxs(n.Fragment,{children:[n.jsx(u.Menu.Divider,{}),n.jsx(Pe.NewColorPicker,{data:{callout:{label:s("editor.colors.theme"),filled:!0,palette:ee.calloutData.map(x=>({label:s(`editor.colors.callout.${x.name}`),value:u.alpha(x.color,.19),icon:x.icon,meta:{type:x.name,emoji:x.emoji}}))}},modes:j==="callout-wrapper"?["callout","background"]:["color","background"],value:{color:A,background:p,callout:p},onChange:x=>{P(x),t(),T.resetSelection(e)},hideInherit:!0,target:n.jsx("div",{children:n.jsx(V.CustomMenuItem,{label:s(j==="callout-wrapper"?"editor.contextMenu.appearance":"editor.toolbar.color"),icon:n.jsx($.IconPaint,{size:14})})}),menuProps:{trigger:"hover",position:"right-start",offset:{mainAxis:0,alignmentAxis:0}}})]}),j==="layout"&&n.jsxs(n.Fragment,{children:[n.jsx(u.Menu.Divider,{}),n.jsx(Pe.NewColorPicker,{modes:["background"],value:{background:N},onChange:x=>{P(x,"layout-color"),t(),T.resetSelection(e)},hideInherit:!0,target:n.jsx("div",{children:n.jsx(V.CustomMenuItem,{label:s("editor.column.changeColor"),icon:n.jsx($.IconPaint,{size:14})})}),menuProps:{trigger:"hover",position:"right-start",offset:{mainAxis:0,alignmentAxis:0}}}),n.jsx(u.Menu.Item,{disabled:a,onClick:()=>{Fe(e,o,"left")},leftSection:n.jsx($.IconColumnInsertLeft,{style:{width:u.rem(14),height:u.rem(14)}}),children:s("editor.column.addLeft")}),n.jsx(u.Menu.Item,{disabled:a,onClick:()=>{Fe(e,o,"right")},leftSection:n.jsx($.IconColumnInsertRight,{style:{width:u.rem(14),height:u.rem(14)}}),children:s("editor.column.addRight")}),n.jsx(u.Menu.Item,{disabled:r.left,onClick:()=>{qe(e,o,"left"),T.resetSelection(e)},leftSection:n.jsx($.IconColumnInsertRight,{style:{width:u.rem(14),height:u.rem(14)}}),children:s("editor.column.moveLeft")}),n.jsx(u.Menu.Item,{disabled:r.right,onClick:()=>{qe(e,o,"right"),T.resetSelection(e)},leftSection:n.jsx($.IconColumnInsertRight,{style:{width:u.rem(14),height:u.rem(14)}}),children:s("editor.column.moveRight")}),n.jsx(u.Menu.Item,{onClick:()=>B("layout"),leftSection:n.jsx($.IconTrash,{style:{width:u.rem(14),height:u.rem(14)}}),children:s("editor.column.deleteColumn")})]})]})};function It(e){if(!e)return window;let t=e;for(;t;){if(t===document.body||t===document.documentElement)return window;const i=getComputedStyle(t).overflowY;if((i==="auto"||i==="scroll"||i==="overlay")&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return window}function jt(e,t){let o=150;const{clientY:i}=e;if(t===window){const s=window.innerHeight;i<o?window.scrollBy(0,Math.max(-15,(i-o)/15)):i>s-o&&window.scrollBy(0,Math.min(15,(i-(s-o))/15))}else{o=100;const s=t.getBoundingClientRect();i<s.top+o?t.scrollTop-=5:i>s.bottom-o&&(t.scrollTop+=5)}}const $t=lt.lodashExports.throttle((e,t)=>{e.preventDefault(),jt(e,t)},16);let ve=null;function kt(e){return e?e.classList.contains("dsd__theme__table-scrollable-wrapper")?e.firstElementChild:e:null}function vt(e,t,o){const i=l.useRef(null),s=l.useRef(null),a=l.useRef(!1),r=l.useRef(!1),d=l.useRef({htmlElement:null,lexicalNode:null,isBottom:!1}),f=l.useRef(null),[p,m]=l.useState(null),{disable:N}=l.useContext(Ce.Context),[g,A]=l.useState(!1),[_,j]=l.useState({opened:!1}),[L,F]=l.useState(""),[M,v]=l.useState(null),[P,B]=l.useState(!1),[x,S]=l.useState({left:!1,right:!1}),[k,O]=l.useState(null),{t:R}=Ee.useTranslation(),U=ee.useDebounce(y=>{const h=y.target;r.current||T.isHTMLElement(h)&&(Ct(h)||e.read(()=>{var X;const w=h.className.includes("content-editable-wrapper"),G=w?c.$getRoot():c.$getNearestNodeFromDOMNode(h),{htmlElement:W,lexicalNode:D}=T.$getBlockNode(G,e,{root:!0,"layout-container":!0,"layout-item":!0,callout:!0,"collapsible-content":!0},y);if((D==null?void 0:D.__type)==="callout"||(D==null?void 0:D.__type)==="callout-image"||((X=D==null?void 0:D.getParent())==null?void 0:X.__type)==="callout"&&(D==null?void 0:D.getPreviousSibling())===null){m(null);return}if(!(w&&D instanceof C.LayoutDividerNode||w&&!D)&&D!=null&&D.__key){if(D.__type==="layout-container"||D.__type==="layout-item"||D.__type==="collapsible-content"){m(null);return}W&&(d.current.htmlElement=W,d.current.lexicalNode=D),(D==null?void 0:D.__type)==="collapsible-title"&&(d.current.htmlElement=(W==null?void 0:W.parentElement)||W,d.current.lexicalNode=D.getParent()),v(null),m(d.current.htmlElement)}}))},20,50);l.useEffect(()=>()=>{ve=null},[]),l.useEffect(()=>{function y(){r.current||m(null)}function h(G){if(!a.current)return!1;const[W]=xe.eventFiles(G);if(W)return!1;const{target:D,dataTransfer:X}=G,te=(X==null?void 0:X.getData(ze))||"";e.update(()=>{var ge;let b=c.$getNodeByKey(te);if(!b||!(T.isHTMLElement(D)||D.closest(".resizable-container")))return!1;const{htmlElement:H,lexicalNode:ie,isBottom:K}=d.current;let z=ie,pe=null;if(z!=null&&z.__key&&(pe=H),!pe||!z)return!1;if(z===b)return!0;if(s.current&&mt(s.current,e,z,b))return!1;if(b.__type==="layout-divider"){if(b=b.getParent(),ie&&(b!=null&&b.isParentOf(ie)))return!1;et(e,b)}if(b.getParent()instanceof C.LayoutItemNode&&((ge=b.getParent())==null?void 0:ge.getChildren().length)===2){const he=b.getParent(),Te=he.getParent();T.removeNodeKeepContent(e,he,Te)}if(H!=null&&H.classList.contains("selected-block"))return;let be;const re=e._rootElement;K?be=Array.from(re.querySelectorAll(".selected-block")).reverse():be=Array.from(re.querySelectorAll(".selected-block")),be.length?be.forEach(he=>{let Te=c.$getNearestNodeFromDOMNode(he);K?z==null||z.insertAfter(Te):z==null||z.insertBefore(Te)}):K?z.insertAfter(b):z.insertBefore(b),m(null)})}function w(G){const{target:W}=G;T.isHTMLElement(W)&&W.className==="ContentEditable__root"&&Ge(s.current)}return t==null||t.addEventListener("mousemove",U),t==null||t.addEventListener("drop",h),t==null||t.addEventListener("mouseleave",y),t==null||t.addEventListener("dragleave",w),()=>{t==null||t.removeEventListener("mousemove",U),t==null||t.addEventListener("drop",h),t==null||t.removeEventListener("mouseleave",y),t==null||t.removeEventListener("dragleave",w)}},[t,e]),l.useEffect(()=>{if(i.current){if(r.current||_.opened)return;Ue(p,i.current,t,_.opened)}},[t,p,r.current,_.opened]),l.useEffect(()=>{function y(h){var K,z;const{clientY:w,target:G,pageX:W}=h;if(!a.current)return!1;const[D]=xe.eventFiles(h);if(D||!T.isHTMLElement(G))return!1;const X=c.$getNearestNodeFromDOMNode(G)||c.$getRoot(),{htmlElement:te,lexicalNode:b}=T.$getBlockNode(X,e,{root:!0,"layout-container":!0,"layout-item":!0,"callout-wrapper":!0,callout:!0,"collapsible-content":!0,"collapsible-container":!0},h);if(h.preventDefault(),(b==null?void 0:b.__type)==="callout"||(b==null?void 0:b.__type)==="collapsible-content"||tt(f.current,b==null?void 0:b.getParent())||(b==null?void 0:b.__type)==="layout-item"&&X.__type!=="root")return!1;te&&(d.current.htmlElement=te,d.current.lexicalNode=b);let H=null;H=d.current.htmlElement||te,H!=null&&H.closest(".dsd__theme__layoutContainer")&&X.__type==="root"&&b&&((b==null?void 0:b.__type)==="layout-item"&&X.__type==="root"?(H=H==null?void 0:H.parentElement,d.current.htmlElement=H,d.current.lexicalNode=b==null?void 0:b.getParent()):(H=(K=H.parentElement)==null?void 0:K.parentElement,d.current.htmlElement=H,d.current.lexicalNode=(z=b.getParent())==null?void 0:z.getParent()));const ie=s.current;return!H&&ie?(ie.style.background="transparent",!1):H===null||ie===null||H!=null&&H.classList.contains("selected-block")?!1:(bt(ie,H,w,W,t,h,d),!0)}return de.mergeRegister(e.registerCommand(T.ON_CHANGE_COMMAND,h=>h==="hide_menu"?(ht(i.current),setTimeout(()=>{r.current=!0},0),!1):h==="show_menu"?(r.current=!1,!1):(h===!0&&!r.current&&m(null),r.current=!1,!1),c.COMMAND_PRIORITY_LOW),e.registerCommand(T.RIGHT_CLICK_COMMAND,h=>((h==null?void 0:h.target)instanceof HTMLElement&&i.current instanceof HTMLElement&&(Z(h),Ue(h.target,i.current,t,_.opened)),!1),c.COMMAND_PRIORITY_LOW),e.registerCommand(c.DRAGOVER_COMMAND,h=>(ve||(ve=It(h.target)),$t(h,ve),y(h)),c.COMMAND_PRIORITY_LOW),e.registerCommand(c.KEY_ARROW_DOWN_COMMAND,()=>(e.dispatchCommand(T.ON_CHANGE_COMMAND,!0),!1),c.COMMAND_PRIORITY_LOW),e.registerCommand(c.KEY_ARROW_UP_COMMAND,()=>(e.dispatchCommand(T.ON_CHANGE_COMMAND,!0),!1),c.COMMAND_PRIORITY_LOW))},[t,e]);function ae(y){var D;const h=y.dataTransfer;(D=s.current)==null||D.setAttribute("data-index-start","");const w=p||d.current.htmlElement;if(!h||!w)return;const G=e._rootElement;if(w!=null&&w.classList.contains("selected-block")){const X=e._rootElement,te=Array.from(X.querySelectorAll(".selected-block"));yt(y.dataTransfer,te)}else ee.$removeSelectedHTMLElements(G),w.className.includes("_layoutDivider")&&w.parentElement?Ye(h,w.parentElement):Ye(h,w);let W="";e.read(()=>{var te,b;const X=c.$getNearestNodeFromDOMNode(w);if(X&&(W=X.getKey()),X instanceof C.LayoutDividerNode){const H=Ie((te=w.parentElement)==null?void 0:te.parentElement,w.parentElement);(b=s.current)==null||b.setAttribute("data-index-start",H.toString())}}),i.current&&(A(!0),i.current.style.opacity="0"),a.current=!0,f.current=W,h.setData(ze,W)}function Y(){a.current=!1,Ge(s.current),A(!1)}if(N)return n.jsx("div",{});function E(){var w;const y=d.current.htmlElement,h=(w=y==null?void 0:y.parentElement)==null?void 0:w.parentElement;if(h!=null&&h.classList.contains("dsd__theme__layoutContainer")&&(h.children.length===4?B(!0):B(!1),y!=null&&y.parentElement)){const G=Ie(h,y==null?void 0:y.parentElement);G?G===h.children.length-1?S({left:!1,right:!0}):S({left:!1,right:!1}):S({left:!0,right:!1})}}function Z(y){r.current=!0;const h=kt((y==null?void 0:y.target)??d.current.htmlElement);if(!h)return;const w=e._rootElement;E(),h.classList.contains("selected-block")||ee.$removeSelectedHTMLElements(w),e.update(()=>{const W=c.$getSelection(),X=((W==null?void 0:W.getNodes())??[]).filter(K=>!c.$isTextNode(K)&&!C.$isListNode(K)&&K.__parent==="root"),te=X.map(K=>{const z=e.getElementByKey(K.getKey());return K.getType()==="table"?z==null?void 0:z.firstElementChild:z}).filter(K=>K!==null),b=X.length&&te.includes(h)?te:[h];if(b.length===1){const K=c.$getNearestNodeFromDOMNode(h);if(!K)return;K.selectStart(),O(K)}else O(null);b.forEach(K=>{ee.$getSelectedHTMLElements(e,{block:K,isCreateEventListener:!1})});const H=Array.from(document.querySelectorAll(".selected-block")).reduce((K,z)=>{const pe=c.$getNearestNodeFromDOMNode(z);return pe&&K.push(pe),K},[]),ie=H.length>0&&H.every(K=>C.$isCalloutWrapperNode(K)||C.$isTableNode(K)||ee.$isCollapsibleContainerNode(K)?!1:c.$isElementNode(K)||c.$isTextNode(K));F(ie?"text":"block")}),T.blockScroll();const G=Number(y==null?void 0:y.y)+240>window.innerHeight?Number(y==null?void 0:y.y)-200:y==null?void 0:y.y;j({opened:!0,x:(y==null?void 0:y.x)??0,y:G??0}),e.dispatchCommand(T.ON_OPEN_KEBAB_MENU,!0)}const oe=()=>{e.update(()=>{const y=T.getCurrentElement();if(r.current=!1,j(h=>({opened:!1,x:h.x,y:h.y})),(y==null?void 0:y.__key)==="root"){const h=c.$createParagraphNode();y.append(h)}})},ce=o?"hide-add-button":"",me=_.x!==0?{position:"fixed",top:0,left:0,transform:`translate(${_.x}px, ${_.y}px)`}:{},_e=()=>{oe(),T.unblockScroll(),ee.onSelectEnd(e),ee.$removeSelectedHTMLElements(e._rootElement)},je=(y=!1)=>{y?e.update(()=>{const h=c.$getSelection();let w=null;c.$isRangeSelection(h)&&(w=h.anchor.getNode().getParent()),_e(),setTimeout(()=>{e.update(()=>{w==null||w.selectEnd()})},100)}):_e()},ye=l.useCallback(y=>{const h=document.querySelector(".draggable-menu");if(!_&&y.button!==2)return;const w=y.target;if(w.closest(".mantine-Menu-dropdown"))return;!((h==null?void 0:h.contains(w))&&w.closest("div.custom-menu-item"))&&y.button!==2&&_.opened&&(y.stopPropagation(),y.preventDefault())},[e,_]);return l.useEffect(()=>(_.opened?document.addEventListener("mousedown",ye):document.removeEventListener("mousedown",ye),()=>{document.removeEventListener("mousedown",ye)}),[_.opened,ye]),Be.createPortal(n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:`draggable-block-container ${ce} ${p?"visible":""}`,ref:i,onMouseEnter:()=>{var y;_||v("both"),(y=i.current)!=null&&y.style&&(i.current.style.opacity="1")},onMouseLeave:()=>{v(null)},children:[n.jsx(Mt,{hoveredButton:M,insertNewParagraph:We,currentDraggableBlockRef:d,setHoveredButton:v,isClickedBlockRef:r,setDraggableBlockElem:m,editor:e,t:R}),n.jsxs(u.Menu,{onOpen:Z,opened:_.opened,styles:{dropdown:me},position:"left-start",width:320,shadow:"md",withinPortal:!0,onClose:()=>{je()},transitionProps:C.animationMenu,children:[n.jsx(u.Menu.Target,{children:n.jsx("div",{className:"icon draggable-block-menu",draggable:!0,onDragStart:ae,onDragEnd:Y,children:n.jsx(u.Tooltip,{openDelay:300,multiline:!0,disabled:g||r.current,label:n.jsxs(n.Fragment,{children:[n.jsxs("span",{children:[n.jsx("strong",{children:R("editor.hoverOptions.drag")}),","," ",R("editor.hoverOptions.dragAction")]}),n.jsx("br",{}),n.jsxs("span",{children:[n.jsx("strong",{children:R("editor.hoverOptions.click")}),","," ",R("editor.hoverOptions.clickAction")]})]}),position:"bottom-start",children:n.jsx(u.ActionIcon,{radius:"sm",color:"gray",size:"sm",variant:"subtle","aria-label":"Settings",children:n.jsx($.IconGripVertical,{size:20})})})})}),n.jsx(Tt,{hoveredButton:M,insertNewParagraph:We,currentDraggableBlockRef:d,setHoveredButton:v,isClickedBlockRef:r,setDraggableBlockElem:m,editor:e,t:R}),n.jsx(u.Menu.Dropdown,{className:"draggable-menu",children:n.jsx(St,{onChange:()=>{je(!0),T.resetSelection(e)},t:R,textBlock:L,currentEditorNode:k,editor:e,isDisabledAddColumnButton:P,disabledMoveColumnButtons:x})})]})]}),n.jsx("div",{className:"draggable-block-target-line",ref:s})]}),t)}function At({anchorElem:e=document.body,isShowAddButton:t=!1}){const[o]=Oe.useLexicalComposerContext();return vt(o,e,t)}function Ot({editor:e,anchorElem:t,isLink:o,isBold:i,isItalic:s,isUnderline:a,isCode:r,isStrikethrough:d,isSubscript:f,isSuperscript:p,component:m,isText:N}){const g=l.useRef(null),A=l.useRef(!1),_=l.useRef(null),j=l.useCallback(()=>{e.dispatchCommand(T.ON_SHOW_LINK_POPUP,"create")},[e,o]);function L(){var M,v;g.current&&(A.current=!0,T.setFloatingElemPosition(((M=_.current)==null?void 0:M.rect)||null,g==null?void 0:g.current,t,(v=_.current)==null?void 0:v.isLink))}l.useEffect(()=>{const M=T.getNativeSelectedText();if(!N&&!(M!=null&&M.length)){let v=function(S){return S instanceof HTMLElement};const P=g.current,B=window.getSelection();let x=!1;B!=null&&B.anchorNode&&v(B.anchorNode)&&B.anchorNode.className==="toolbar"&&(x=!0),P&&!x&&(_.current={rect:null,floatingElem:P,anchorElem:t,isLink:o},T.setFloatingElemPosition(null,P,t,o),A.current=!1)}},[N,e]),l.useEffect(()=>{if(g!=null&&g.current)return document.addEventListener("mouseup",L),()=>{document.removeEventListener("mouseup",L)}},[g]),l.useEffect(()=>{e.registerCommand(c.KEY_DOWN_COMMAND,M=>{var v;return(M.metaKey||M.ctrlKey)&&M.code==="KeyA"?(M.preventDefault(),T.selectCurrentNode(e),T.getCurrentElement(!0)&&(T.isWholeNodeSelected()&&(g!=null&&g.current)?(T.setFloatingElemPosition(null,g==null?void 0:g.current,t,(v=_.current)==null?void 0:v.isLink),c.$selectAll(),ee.$getSelectedHTMLElements(e)):setTimeout(()=>{L()})),!0):!1},c.COMMAND_PRIORITY_LOW),e.registerCommand(T.ON_OPEN_KEBAB_MENU,()=>(setTimeout(()=>{var M;g!=null&&g.current&&T.setFloatingElemPosition(null,g==null?void 0:g.current,t,(M=_.current)==null?void 0:M.isLink)},100),!1),c.COMMAND_PRIORITY_LOW)},[e]);const F=l.useCallback(()=>{const M=c.$getSelection(),v=g.current,P=window.getSelection();if(v===null)return;const B=e.getRootElement();let x=!1;const S=T.getNativeSelectedText();if(S&&S.length>0&&(x=!0),M!==null&&P!==null&&!P.isCollapsed&&B!==null&&B.contains(P.anchorNode)&&x){const k=T.getDOMRangeRect(P,B);if(_.current={rect:k,floatingElem:v,anchorElem:t,isLink:o},c.$isRangeSelection(M)){const R=T.getSelectedNode(M).getParent(),U=R==null?void 0:R.getFormatType();A.current&&U&&g&&e.registerCommand(T.ON_OPEN_KEBAB_MENU,ae=>(ae||setTimeout(()=>{var Y,E;T.setFloatingElemPosition(((Y=_.current)==null?void 0:Y.rect)||null,v,t,(E=_.current)==null?void 0:E.isLink)},100),!1),c.COMMAND_PRIORITY_LOW)}}else _.current={rect:null,floatingElem:v,anchorElem:t,isLink:o}},[e,t,o]);return l.useEffect(()=>{const M=t.parentElement,v=()=>{e.getEditorState().read(()=>{F()})};return window.addEventListener("resize",v),M&&M.addEventListener("scroll",v),()=>{window.removeEventListener("resize",v),M&&M.removeEventListener("scroll",v)}},[e,F,t]),l.useEffect(()=>(e.getEditorState().read(()=>{F()}),de.mergeRegister(e.registerUpdateListener(({editorState:M})=>{M.read(()=>{F()})}),e.registerCommand(c.SELECTION_CHANGE_COMMAND,()=>(F(),!1),c.COMMAND_PRIORITY_LOW))),[e,F]),n.jsx("div",{ref:g,className:`floating-text-format-popup doc-space-editor-wrapper ${N?"":"floating-text-format-popup-hidden"}`,children:n.jsx("div",{children:e.isEditable()&&(m||n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",onClick:()=>{e.dispatchCommand(c.FORMAT_TEXT_COMMAND,"bold")},className:"popup-item spaced "+(i?"active":""),children:n.jsx(V.Icon,{name:"bold",stroke:i?3:2})}),n.jsx("button",{type:"button",onClick:()=>{e.dispatchCommand(c.FORMAT_TEXT_COMMAND,"italic")},className:"popup-item spaced "+(s?"active":""),children:n.jsx(V.Icon,{name:"italic",stroke:s?3:2})}),n.jsx("button",{type:"button",onClick:()=>{e.dispatchCommand(c.FORMAT_TEXT_COMMAND,"underline")},className:"popup-item spaced "+(a?"active":""),children:n.jsx(V.Icon,{name:"underline",stroke:a?3:2})}),n.jsx("button",{type:"button",onClick:()=>{e.dispatchCommand(c.FORMAT_TEXT_COMMAND,"strikethrough")},className:"popup-item spaced "+(d?"active":""),"data-test-id":"toolbar-strikethrough",children:n.jsx(V.Icon,{name:"strikethrough",stroke:d?3:2})}),n.jsx("button",{type:"button",onClick:()=>{e.dispatchCommand(c.FORMAT_TEXT_COMMAND,"subscript")},className:"popup-item spaced "+(f?"active":""),children:n.jsx(V.Icon,{name:"subscript",stroke:f?3:2})}),n.jsx("button",{type:"button",onClick:()=>{e.dispatchCommand(c.FORMAT_TEXT_COMMAND,"superscript")},className:"popup-item spaced "+(p?"active":""),children:n.jsx(V.Icon,{name:"superscript",stroke:p?3:2})}),n.jsx("button",{type:"button",onClick:()=>{e.dispatchCommand(c.FORMAT_TEXT_COMMAND,"code")},className:"popup-item spaced "+(r?"active":""),children:n.jsx(V.Icon,{name:"code"})}),n.jsx("button",{type:"button",onClick:j,className:"popup-item spaced "+(o?"active":""),children:n.jsx(V.Icon,{name:"link"})})]}))})})}function Dt(e,t,o){const[i,s]=l.useState(!1),[a,r]=l.useState(!1),[d,f]=l.useState(!1),[p,m]=l.useState(!1),[N,g]=l.useState(!1),[A,_]=l.useState(!1),[j,L]=l.useState(!1),[F,M]=l.useState(!1),[v,P]=l.useState(!1),B=T.allEditorSelected(),{disable:x}=l.useContext(Ce.Context),S=l.useCallback(()=>{e.getEditorState().read(()=>{var oe,ce,me;if(e.isComposing())return;const k=c.$getSelection(),O=window.getSelection(),R=e.getRootElement();if(O!==null&&(!c.$isRangeSelection(k)||R===null||!R.contains(O.anchorNode))){s(!1);return}if(!c.$isRangeSelection(k))return;const U=T.getSelectedNode(k);f(k.hasFormat("bold")),m(k.hasFormat("italic")),g(k.hasFormat("underline")),_(k.hasFormat("strikethrough")),L(k.hasFormat("subscript")),M(k.hasFormat("superscript")),P(k.hasFormat("code"));const ae=U.getParent();Me.$isLinkNode(ae)||Me.$isLinkNode(U)?r(!0):r(!1);const Y=rt.$isCodeHighlightNode(k.anchor.getNode()),E=(me=(ce=(oe=e.getElementByKey(U.__key))==null?void 0:oe.parentElement)==null?void 0:ce.parentElement)==null?void 0:me.classList.contains("Collapsible__title");!Y&&k.getTextContent()!==""&&!E?s(C.$isExtendedTextNode(U)||c.$isParagraphNode(U)||xe.$isHeadingNode(U)||xe.$isQuoteNode(U)||C.$isListItemNode(U)):s(!1);const Z=k.getTextContent().replace(/\n/g,"");if(!k.isCollapsed()&&Z===""){s(!1);return}})},[e]);return l.useEffect(()=>(document.addEventListener("selectionchange",S),()=>{document.removeEventListener("selectionchange",S)}),[S]),l.useEffect(()=>de.mergeRegister(e.registerUpdateListener(()=>{S()}),e.registerRootListener(()=>{e.getRootElement()===null&&s(!1)})),[e,S]),x?null:Be.createPortal(n.jsx(Ot,{editor:e,anchorElem:t,isLink:a,isBold:d,isItalic:p,isStrikethrough:A,isSubscript:j,isSuperscript:F,isUnderline:N,isCode:v,component:o,isText:i&&!B}),document.body)}function wt({anchorElem:e=document.body,component:t}){const[o]=Oe.useLexicalComposerContext();return Dt(o,e,t)}const Lt=(e,t,o,i)=>{e.update(()=>{if(c.$isRangeSelection(o)){const s=c.$createTextNode(t);o.insertNodes([s]),i()}})},Pt=(e,t,o,i)=>{e.update(()=>{if(c.$isRangeSelection(o)){const s=c.$createTextNode(t);o.insertNodes([]);const a=s.getParent()??o.focus.getNode().getParent();if(a){const r=o.focus.getNode().getNextSibling();r?r.insertBefore(s):a.append(s),i()}}})},Rt=(e,t="",o,i)=>{e.update(()=>{if(!c.$isRangeSelection(o))return;const a=o.anchor.getNode().getTopLevelElementOrThrow(),r=c.$createParagraphNode();t&&r.append(c.$createTextNode(t)),a.insertAfter(r),i()})},Ft=(e,t)=>{e.update(()=>{const o=c.$getSelection();if(c.$isRangeSelection(o)){const i=o.getTextContent();t(i)}})},Bt=({editor:e,response:t,onSubmit:o,setTypeMenu:i,onClose:s,t:a,selection:r})=>n.jsxs(n.Fragment,{children:[n.jsx(u.Menu.Item,{leftSection:n.jsx($.IconArrowNarrowLeft,{size:14}),onClick:()=>i("main"),children:a("editor.ai.back")}),n.jsx(u.Menu.Item,{onClick:()=>{Lt(e,t,r,s)},leftSection:n.jsx($.IconReplace,{size:14}),children:a("editor.ai.menu.answer.replaceSelection")}),n.jsx(u.Menu.Item,{onClick:()=>{Pt(e,` ${t}`,r,s)},leftSection:n.jsx($.IconTextPlus,{size:14}),children:a("editor.ai.menu.answer.addTextInline")}),n.jsx(u.Menu.Item,{onClick:()=>{Rt(e,t,r,s),s()},leftSection:n.jsx($.IconIndentIncrease,{size:14}),children:a("editor.ai.menu.answer.addBelowParagraph")}),n.jsx(u.Menu.Divider,{}),n.jsx(u.Menu.Label,{children:a("editor.ai.menu.answer.modifyFurther")}),n.jsx(u.Menu.Item,{onClick:()=>{o(`Start with this text and continue. Output this text at the start: "${t}"`,!1)},leftSection:n.jsx($.IconPlayerPlay,{size:14}),children:a("editor.ai.menu.answer.continueWriting")}),n.jsx(u.Menu.Item,{onClick:()=>{o("Regenerate this text with another way: ")},leftSection:n.jsx($.IconReload,{size:14}),children:a("editor.ai.menu.answer.regenerate")}),n.jsx(u.Menu.Item,{onClick:s,leftSection:n.jsx($.IconTrash,{size:14}),children:a("editor.ai.menu.answer.discard")})]}),Et=["arabic","bengali","chinese","dutch","english","french","german","hindi","japanese","korean","nepali","portuguese","spanish"],Ht=["professional","straightforward","friendly","poetic","passiveAggressive","pirate"],Kt=[{title:"modifySelection",options:[{title:"improveWriting",prompt:"Improve the quality of the text",icon:n.jsx($.IconWand,{size:14})},{title:"fixMistakes",prompt:"Fix any typos or general errors in the text",icon:n.jsx($.IconTextSpellcheck,{size:14})},{title:"simplify",prompt:"Shorten the text, simplifying it",icon:n.jsx($.IconSortAscending,{size:14})},{title:"addMoreDetail",prompt:"Lengthen the text, going into more detail",icon:n.jsx($.IconSortDescending,{size:14})}]},{title:"generate",options:[{title:"summarise",prompt:"Summarise the text",icon:n.jsx($.IconNotes,{size:14})},{title:"translate",icon:n.jsx($.IconLanguage,{size:14}),type:"language"},{title:"changeStyle",icon:n.jsx($.IconScript,{size:14}),type:"style"},{title:"explain",prompt:"Explain what the text is about",icon:n.jsx($.IconHelpOctagon,{size:14})}]}],zt=({setTypeMenu:e,onSubmit:t,t:o})=>n.jsxs(n.Fragment,{children:[n.jsx(u.Menu.Item,{leftSection:n.jsx($.IconArrowNarrowLeft,{size:14}),onClick:()=>e("main"),children:o("editor.ai.back")}),Et.map(i=>n.jsx(u.Menu.Item,{onClick:()=>{t(`Translate text into the ${i} language`)},children:o(`editor.ai.menu.languages.${i}`)},i))]}),qt=({setTypeMenu:e,onSubmit:t,t:o})=>n.jsx(n.Fragment,{children:Kt.map(i=>n.jsxs("div",{children:[n.jsx(u.Menu.Label,{children:o(`editor.ai.menu.main.${i.title}`)}),i.options.map(s=>n.jsx(u.Menu.Item,{onClick:()=>{if(s.type){e(s.type);return}t(s.prompt||"")},leftSection:s.icon,children:o(`editor.ai.menu.main.${s.title}`)},s.title))]},i.title))}),Wt=({setTypeMenu:e,onSubmit:t,t:o})=>n.jsxs(n.Fragment,{children:[n.jsx(u.Menu.Item,{leftSection:n.jsx($.IconArrowNarrowLeft,{size:14}),onClick:()=>e("main"),children:o("editor.ai.back")}),Ht.map(i=>n.jsx(u.Menu.Item,{onClick:()=>{t(`Change text into ${i} style`)},children:o(`editor.ai.menu.style.${i}`)},i))]}),Ut=({keyType:e,setTypeMenu:t,editor:o,onSubmit:i,response:s,onClose:a,t:r,selection:d})=>{switch(e){case"main":return n.jsx(qt,{t:r,setTypeMenu:t,onSubmit:i});case"answer":return n.jsx(Bt,{t:r,onSubmit:i,editor:o,response:s,setTypeMenu:t,onClose:a,selection:d});case"language":return n.jsx(zt,{t:r,onSubmit:i,setTypeMenu:t});case"style":return n.jsx(Wt,{t:r,onSubmit:i,setTypeMenu:t});default:return null}};function Yt(e,t=40){const[o,i]=l.useState(""),s=l.useRef(0),a=l.useRef(null),r=l.useRef(null);return l.useEffect(()=>{if(a.current&&clearInterval(a.current),i(""),s.current=0,!!e)return a.current=setInterval(()=>{i(d=>{const f=e[s.current];return s.current+=1,s.current>=e.length&&clearInterval(a.current),d+(f||"")})},t),()=>{a.current&&clearInterval(a.current)}},[e,t]),l.useEffect(()=>{r.current&&(r.current.scrollTop=r.current.scrollHeight)},[o]),{displayedText:o,containerRef:r}}const Gt=()=>{var ae;const[e,t]=l.useState({top:"0px",bottom:"auto"}),[o,i]=l.useState(!1),[s,a]=l.useState(!1),[r]=Oe.useLexicalComposerContext(),[d,f]=l.useState("main"),[p,m]=l.useState(""),[N,g]=l.useState(""),[A,_]=l.useState(""),[j,L]=l.useState(null),[F,M]=l.useState(!1),{fetchPromptResult:v}=l.useContext(Ce.Context),{t:P}=Ee.useTranslation(),[B,x]=He.useResizeObserver(),S=()=>{i(!1),a(!1),_(""),f("main"),setTimeout(()=>{t({top:"0px",bottom:"auto"})},200)},k=He.useClickOutside(()=>{S()});l.useEffect(()=>{o?(Ft(r,g),document.documentElement.style.overflow="hidden",r.update(()=>{const Y=c.$getSelection();Y&&L(Y)})):(f("main"),document.documentElement.style.overflow="auto",_(""))},[o]);const{displayedText:O,containerRef:R}=Yt(A,10),U=(Y,E=!0)=>{const Z=Y+` "${E?N:""}"Only return the modified text. Do not include any explanations, introductions, or formatting.`;M(!0),v&&v(Z,oe=>{_(oe),M(!1),f("answer"),m("")},()=>{M(!1)})};return l.useEffect(()=>{var E,Z,oe;const{bottom:Y}=((E=B.current)==null?void 0:E.getBoundingClientRect())||{bottom:0};if(Y>window.innerHeight){const ce=(((oe=(Z=r._rootElement)==null?void 0:Z.getBoundingClientRect())==null?void 0:oe.bottom)||0)-window.innerHeight;t({...e,top:"auto",bottom:`${ce}px`})}},[x.height,o,B.current]),(ae=r._rootElement)!=null&&ae.parentElement?n.jsxs(n.Fragment,{children:[e.top?Be.createPortal(n.jsx(u.Transition,{mounted:!!o,transition:"scale-x",duration:300,timingFunction:"ease",children:Y=>n.jsx(u.Box,{ref:k,style:{position:"absolute",...e,...Y},className:"ai-editor-menu",children:n.jsxs(u.Menu,{opened:!!s,closeOnItemClick:!1,position:"bottom-start",zIndex:99,transitionProps:{transition:"fade",duration:300},styles:{dropdown:{overflow:"auto"}},offset:8,middlewares:{flip:!0,size:{apply({availableHeight:E,elements:Z}){requestAnimationFrame(()=>{Object.assign(Z.floating.style,{maxHeight:`${E>=425?425:E}px`})})}}},disabled:F,children:[n.jsx(u.Menu.Target,{children:n.jsxs(u.Paper,{withBorder:!0,ref:B,shadow:"lg",radius:"md",p:"0",px:"xs",children:[A&&n.jsxs(n.Fragment,{children:[n.jsxs(u.Group,{gap:3,align:"flex-start",style:{overflowY:"auto"},mah:120,ref:R,children:[n.jsx(u.Box,{style:{flex:1},w:"auto",py:"xs",children:O}),n.jsx(u.Box,{w:"auto",mt:"xs",children:n.jsx(u.CopyButton,{value:A,timeout:2e3,children:({copied:E,copy:Z})=>n.jsx(u.Tooltip,{label:E?"Copied":"Copy",withArrow:!0,position:"right",children:n.jsx(u.ActionIcon,{color:E?"teal":"gray",variant:"subtle",onClick:Z,children:E?n.jsx($.IconCheck,{size:16}):n.jsx($.IconCopy,{size:16})})})})})]}),n.jsx(u.Divider,{my:"0"})]}),n.jsx(u.Box,{children:n.jsx(u.Input,{size:"md",placeholder:P("editor.ai.placeholder"),rightSectionPointerEvents:"all",variant:"unstyled",value:p,onKeyDown:E=>{if(E.key==="Enter"){if(F)return;U(p)}},onChange:E=>{m(E.target.value)},rightSection:n.jsx(n.Fragment,{children:F?n.jsx(u.Loader,{color:"violet",size:"16",mr:"xs"}):n.jsx(u.ActionIcon,{color:"violet",disabled:!p,variant:"subtle",onClick:()=>{U(p)},children:n.jsx($.IconSparkles,{size:16})})})})})]})}),n.jsx(u.Menu.Dropdown,{className:"menu-dropdown-ai",onMouseDown:E=>{E.stopPropagation()},children:n.jsx(Ut,{keyType:d,setTypeMenu:f,editor:r,onSubmit:U,response:A,onClose:S,t:P,selection:j})})]})})}),r._rootElement.parentElement):null,n.jsxs("button",{disabled:!1,className:"toolbar-item spaced alignment","aria-label":"Formatting options for text alignment",type:"button",onClick:()=>{const Y=document.querySelector(".floating-text-format-popup");if(Y.style.opacity="0",Y.style.transform="translate(-10000px, -10000px)",Y!=null&&Y.style){const E=window.getSelection();if((E==null?void 0:E.rangeCount)===0)return null;if(E){const oe=E.getRangeAt(0).getBoundingClientRect(),ce=document.querySelector(".content-editable-wrapper"),me=ce.getBoundingClientRect(),_e=oe.top-me.top+ce.scrollTop+oe.height+"px";t({top:_e,bottom:"auto"}),setTimeout(()=>{i(!0)},0),setTimeout(()=>{a(!0)},100)}}},children:[n.jsx($.IconSparkles,{color:"#7950f2",size:18}),n.jsx($.IconAi,{size:21,color:"#7950f2"})]})]}):null},Xt=({editor:e,isEditable:t,t:o})=>{const{fetchUploadMedia:i,imperativeHandleRef:s}=l.useContext(Ce.Context),[a,r]=l.useState(!1);return i?n.jsx(Ke.ImagePicker,{popoverProps:{opened:a,position:"bottom",onChange:r},onUpload:d=>{var f,p;!i||!d.length||(r(!1),(f=s==null?void 0:s.current)!=null&&f.insertImages&&((p=s.current)==null||p.insertImages(d)))},onChange:d=>{e.dispatchCommand(Ke.INSERT_IMAGE_COMMAND,{altText:"",src:d}),r(!1)},children:n.jsx(u.Tooltip,{label:o("editor.image.add_photo"),children:n.jsx("button",{disabled:!t,type:"button",onClick:()=>r(d=>!d),className:"toolbar-item spaced",children:n.jsx(V.Icon,{name:"photo"})})})}):null},Vt={bullet:"Маркированный список",check:"Чек-лист",code:"Кодовый блок",h1:"Заголовок 1",h2:"Заголовок 2",h3:"Заголовок 3",h4:"Заголовок 4",h5:"Заголовок 5",h6:"Заголовок 6",number:"Нумерованный список",paragraph:"Параграф",quote:"Цитата"};function Ae(){return n.jsx("div",{className:"divider"})}function Qt({mode:e,isFloating:t}){const[o]=Oe.useLexicalComposerContext(),[i,s]=l.useState(o),[a,r]=l.useState("paragraph"),[d,f]=l.useState("root"),[p,m]=l.useState(null),[N,g]=l.useState("#000"),[A,_]=l.useState("#fff"),[j,L]=l.useState("left"),[F,M]=l.useState(!1),[v,P]=l.useState(!1),[B,x]=l.useState(!1),[S,k]=l.useState(!1),[O,R]=l.useState(!1),[U,ae]=l.useState(!1),[Y,E]=l.useState(!1),[Z,oe]=l.useState(!1),[ce,me]=l.useState(!1),[_e,je]=l.useState(!1),[ye]=C.useModal(),[y,h]=l.useState(!1),[w,G]=l.useState(!0),[W,D]=l.useState(!0),[X,te]=l.useState(0),[b,H]=l.useState(()=>o.isEditable()),ie=e||"default",{excludeNodes:K,fetchUploadMedia:z,fetchPromptResult:pe,commentOptions:be}=l.useContext(Ce.Context),{t:re}=Ee.useTranslation(),ge=l.useCallback(()=>{const I=c.$getSelection();if(c.$isRangeSelection(I)){const q=I.anchor.getNode(),se=I.focus.getNode(),ne=c.$isRootNode(q)?null:q.getTopLevelElementOrThrow(),fe=c.$isRootNode(se)?null:se.getTopLevelElementOrThrow();let Q=q.getKey()==="root"?q:de.$findMatchingParent(q,ue=>{const ke=ue.getParent();return ke!==null&&c.$isRootOrShadowRoot(ke)});I.getNodes().length===1?G(!0):G(!1),Q===null&&(Q=q.getTopLevelElementOrThrow());const J=Q.getKey(),$e=i.getElementByKey(J);o.update(()=>{P(I.hasFormat("bold")),x(I.hasFormat("italic")),k(I.hasFormat("underline")),R(I.hasFormat("strikethrough")),ae(I.hasFormat("subscript")),E(I.hasFormat("superscript")),oe(I.hasFormat("code"))});const le=T.getSelectedNode(I),Se=le.getParent();Me.$isLinkNode(Se)||Me.$isLinkNode(le)?M(!0):M(!1),g(Ne.$getSelectionStyleValueForProperty(I,"color","inherit")),_(Ne.$getSelectionStyleValueForProperty(I,"background-color","inherit"));let Le;Me.$isLinkNode(Se)&&(Le=de.$findMatchingParent(le,ue=>c.$isElementNode(ue)&&!ue.isInline())),L(c.$isElementNode(Le)?Le.getFormatType():c.$isElementNode(le)?le.getFormatType():(Se==null?void 0:Se.getFormatType())||"left");const it=de.$findMatchingParent(le,C.$isTableNode);if(C.$isTableNode(it)?f("table"):f("root"),$e!==null&&(ne==null?void 0:ne.getKey())===(fe==null?void 0:fe.getKey()))if(m(J),C.$isListNode(Q)){const ue=de.$getNearestNodeOfType(q,C.ListNode),ke=ue?ue.getListType():Q.getListType();r(ke)}else{const ue=xe.$isHeadingNode(Q)?Q.getTag():Q.getType();ue in Vt&&r(ue)}else r("")}},[i,G]);l.useEffect(()=>o.registerCommand(c.SELECTION_CHANGE_COMMAND,(I,q)=>(ge(),s(q),!1),c.COMMAND_PRIORITY_CRITICAL),[o,ge]),l.useEffect(()=>de.mergeRegister(o.registerEditableListener(I=>{H(I)}),i.registerUpdateListener(({editorState:I})=>{I.read(()=>{ge()})}),i.registerCommand(c.CAN_UNDO_COMMAND,I=>(me(I),!1),c.COMMAND_PRIORITY_CRITICAL),i.registerCommand(c.CAN_REDO_COMMAND,I=>(je(I),!1),c.COMMAND_PRIORITY_CRITICAL)),[ge,i,o]),l.useEffect(()=>de.mergeRegister(i.registerCommand(c.KEY_MODIFIER_COMMAND,I=>{const q=I,{code:se,metaKey:ne}=q;if(se==="KeyK"&&ne){q.preventDefault();let fe;return F?fe=null:fe=T.sanitizeUrl("https://"),i.dispatchCommand(Me.TOGGLE_LINK_COMMAND,fe)}return!1},c.COMMAND_PRIORITY_NORMAL),i.registerCommand(c.CLICK_COMMAND,()=>{const I=c.$getSelection();if(c.$isRangeSelection(I)){const q=I.getNodes(),se=q.length>0&&q.every(ne=>C.$isCalloutWrapperNode(ne)||C.$isTableNode(ne)||ee.$isCollapsibleContainerNode(ne)?!1:c.$isElementNode(ne)||c.$isTextNode(ne));D(!se)}return!1},c.COMMAND_PRIORITY_NORMAL)),[i,F]),l.useCallback((I,q)=>{i.update(()=>{const se=c.$getSelection();se!==null&&Ne.$patchStyleText(se,I)},q?{tag:"historic"}:{})},[i]);const he=l.useCallback(()=>{setTimeout(()=>{i.dispatchCommand(c.FORMAT_TEXT_COMMAND,"")}),i.update(()=>{const I=c.$getSelection();if(c.$isRangeSelection(I)){const q=I.anchor,se=I.focus,ne=I.getNodes(),fe=I.extract();if(q.key===se.key&&q.offset===se.offset)return;ne.forEach((Q,we)=>{if(C.$isExtendedTextNode(Q)){let J=Q;we===0&&q.offset!==0&&(J=J.splitText(q.offset)[1]||J),we===ne.length-1&&(J=J.splitText(se.offset)[0]||J);const $e=fe[0];ne.length===1&&C.$isExtendedTextNode($e)&&(J=$e),J.__style!==""&&J.setStyle(""),J.__format!==0&&J.setFormat(0);const le=de.$getNearestBlockElementAncestorOrThrow(J);le.__format!==0&&le.setFormat(""),le.__indent!==0&&le.setIndent(0),Q=J}else xe.$isHeadingNode(Q)||xe.$isQuoteNode(Q)?Q.replace(c.$createParagraphNode(),!0):at.$isDecoratorBlockNode(Q)&&Q.setFormat("")})}})},[i]),Te=I=>{g(I.color),_(I["background-color"]),i.update(()=>{const q=c.$getSelection();q!==null&&Ne.$patchStyleText(q,I)})},ot=l.useCallback(()=>{o.dispatchCommand(T.ON_SHOW_LINK_POPUP,"create"),setTimeout(()=>{H(!0)},1e3)},[o]),st=()=>{o.dispatchCommand(Ce.INSERT_INLINE_COMMAND,void 0),te(I=>I+1)};return n.jsx("div",{className:"toolbar-wrapper",tabIndex:-1,children:n.jsxs("div",{className:"toolbar",children:[n.jsxs(n.Fragment,{children:[n.jsx(ee.BlockFormatMenu,{disabled:W,blockType:a,rootType:d,editor:o,mode:ie,fetchUploadMedia:z,excludeNodes:K}),n.jsx(Ae,{})]}),e==="editor"&&!0&&pe&&n.jsxs(n.Fragment,{children:[n.jsx(l.Suspense,{fallback:null,children:n.jsx(Gt,{})}),n.jsx(Ae,{})]}),n.jsxs(n.Fragment,{children:[n.jsx(u.Tooltip,{label:re("editor.toolbar.bold"),children:n.jsx("button",{disabled:!b,onClick:()=>{i.dispatchCommand(c.FORMAT_TEXT_COMMAND,"bold")},className:"toolbar-item spaced "+(v?"active":""),type:"button","data-test-id":"toolbar-bold",children:n.jsx(V.Icon,{name:"bold"})})}),n.jsx(u.Tooltip,{label:re("editor.toolbar.italic"),children:n.jsx("button",{disabled:!b,onClick:()=>{i.dispatchCommand(c.FORMAT_TEXT_COMMAND,"italic")},className:"toolbar-item spaced "+(B?"active":""),type:"button","data-test-id":"toolbar-italic",children:n.jsx(V.Icon,{name:"italic"})})}),n.jsx(u.Tooltip,{label:re("editor.toolbar.underline"),children:n.jsx("button",{disabled:!b,"data-test-id":"toolbar-underline",onClick:()=>{i.dispatchCommand(c.FORMAT_TEXT_COMMAND,"underline")},className:"toolbar-item spaced "+(S?"active":""),type:"button",children:n.jsx(V.Icon,{name:"underline"})})}),n.jsx(u.Tooltip,{label:re("editor.toolbar.strike"),children:n.jsx("button",{disabled:!b,className:"toolbar-item spaced "+(O?"active":""),"data-test-id":"toolbar-strikethrough",onClick:()=>{i.dispatchCommand(c.FORMAT_TEXT_COMMAND,"strikethrough")},children:n.jsx(V.Icon,{name:"strikethrough"})})}),n.jsx(u.Tooltip,{label:re("editor.toolbar.code"),children:n.jsx("button",{disabled:!b,onClick:()=>{i.dispatchCommand(c.FORMAT_TEXT_COMMAND,"code")},className:"toolbar-item spaced "+(Z?"active":""),type:"button","data-test-id":"toolbar-code",children:n.jsx(V.Icon,{name:"code"})})}),n.jsx(u.Tooltip,{label:re("editor.toolbar.clear"),children:n.jsx("button",{disabled:!b,className:"toolbar-item",onClick:he,"data-test-id":"toolbar-clear-format",children:n.jsx(V.Icon,{name:"сlear-format"})})}),n.jsx(u.Tooltip,{disabled:!b,label:re("editor.toolbar.link"),children:n.jsx("button",{onClick:ot,className:"toolbar-item spaced "+(F?"active":""),onMouseDown:()=>{H(!1)},type:"button","data-test-id":"toolbar-link",children:n.jsx(V.Icon,{name:"link"})})}),be&&e==="editor"&&n.jsx(u.Tooltip,{label:re("editor.toolbar.comment"),children:n.jsx("button",{onClick:st,className:"toolbar-item spaced "+(F?"active":""),type:"button","data-test-id":"toolbar-comment",children:n.jsx(V.Icon,{name:"message"})})},X),n.jsx(Pe.NewColorPicker,{value:{color:N,background:A},menuProps:{closeOnItemClick:!0},onChange:I=>{Te({color:N,"background-color":A,[I.mode==="color"?"color":"background-color"]:I.value})},disabled:!b,modes:["color","background"]})]}),n.jsx(Ae,{}),n.jsx(V.AlignMenu,{disabled:!b,value:j,editor:o,isRTL:y,setElementFormat:L}),e==="default"&&n.jsxs(n.Fragment,{children:[n.jsx(Ae,{}),n.jsx(Xt,{editor:o,t:re,isEditable:b})]}),ye]})})}exports.DraggableBlockPlugin=At;exports.FloatingTextFormatToolbarPlugin=wt;exports.ToolbarPlugin=Qt;exports.getTemplateColumns=De;exports.maxWidthPercent=Ze;exports.setTemplateColumnsAfterDelete=et;
@@ -1,6 +0,0 @@
1
- "use strict";const n=require("react/jsx-runtime"),I=require("react"),V=require("react-i18next"),je=require("@lexical/react/LexicalComposerContext"),f=require("@mantine/core"),b=require("lexical"),ae=require("./layers.BVRvG1mv.js"),e=require("@tabler/icons-react"),we=require("@layers-app/shared"),H=require("./layers.BQLznd92.js"),k=require("./layers.DwX5sVtx.js"),Se=require("react-dom"),ke=require("@lexical/react/LexicalContentEditable"),Ne=require("@lexical/rich-text"),De=require("@lexical/utils"),B=require("./layers.B8z-e4Vg.js"),Ie={bullet:e.IconList,check:e.IconListCheck,"check-mark":e.IconCheck,code:e.IconCode,h1:e.IconH1,h2:e.IconH2,h3:e.IconH3,number:e.IconListNumbers,paragraph:e.IconIndentIncrease,quote:e.IconQuote,fontFamily:e.IconLetterT,undo:e.IconArrowBackUp,redo:e.IconArrowForwardUp,bold:e.IconBold,italic:e.IconItalic,underline:e.IconUnderline,link:e.IconLink,"color-picker":e.IconColorPicker,background:e.IconBucketDroplet,photo:e.IconPhoto,"photo-check":e.IconPhotoCheck,"align-left":e.IconAlignLeft,"align-end":e.IconAlignLeft,"align-start":e.IconAlignLeft,"align-right":e.IconAlignRight,"align-center":e.IconAlignCenter,"align-justify":e.IconAlignJustified,"horizontal-rule":e.IconFlipHorizontal,strikethrough:e.IconStrikethrough,subscript:e.IconSubscript,superscript:e.IconSuperscript,minus:e.IconMinus,plus:e.IconPlus,"chevron-down":e.IconChevronDown,"chevron-right":e.IconChevronRight,grip:e.IconGripVertical,"circle-check":e.IconCircleCheck,"circle-x":e.IconCircleX,pencil:e.IconPencil,trash:e.IconTrash,table:e.IconTable,"caret-right":e.IconCaretRight,grid:e.IconColumns3,"dots-vertical":e.IconDotsVertical,copy:e.IconCopy,clipboard:e.IconClipboard,cut:e.IconCut,"arrow-bar-to-up":e.IconArrowBarToUp,"arrow-bar-to-down":e.IconArrowBarToDown,"arrow-bar-to-left":e.IconArrowBarToLeft,"arrow-bar-to-right":e.IconArrowBarToRight,"column-insert-left":e.IconColumnInsertLeft,"column-insert-right":e.IconColumnInsertRight,"row-insert-top":e.IconRowInsertTop,"row-insert-bottom":e.IconRowInsertBottom,"container-off":e.IconContainerOff,"table-off":e.IconTableOff,"layers-union":e.IconLayersUnion,"layers-substract":e.IconLayersSubtract,"сlear-format":e.IconDropletOff,form:e.IconCheckupList,youtube:e.IconBrandYoutube,emoji:e.IconMoodSmile,file:e.IconFile,success:e.IconCheck,warning:e.IconAlertTriangle,alert:e.IconExclamationCircle,defaultOff:e.IconBaseline,embed:e.IconCodeCircle,at:e.IconAt,paperclip:e.IconPaperclip,close:e.IconX,api:e.IconApi,music:e.IconMusic,message:e.IconMessage,reply:e.IconArrowBackUp,filter:e.IconFilter,messages:e.IconMessages,"shield-check":e.IconShieldCheckFilled,reOpen:e.IconReload,send:e.IconSend,expandSidebar:e.IconLayoutSidebarLeftExpand,palette:e.IconPalette},P=({name:t,iconStyle:o,...a})=>{const i=Ie[t]||Ie.bullet;return n.jsx(f.Flex,{gap:0,justify:"center",align:"center",...a,children:n.jsx(i,{size:18,stroke:2,style:o,...a})})},Le=({icon:t,title:o,pointerEvents:a="auto",isLoading:i,progress:E,nodeKey:y,onAfterCancel:m,...x})=>{const[C]=je.useLexicalComposerContext(),{t:M}=V.useTranslation(),{fetchUploadMedia:l}=I.useContext(ae.Context),_=((l==null?void 0:l.length)??0)>=5,T=()=>{C.update(()=>{const z=b.$getNodeByKey(y);z&&z.remove()})},N=z=>{z.stopPropagation(),m==null||m()};return n.jsxs(f.UnstyledButton,{className:"image-node-picker-button",styles:{root:{width:"100%",display:"flex",alignItems:"center",gap:"var(--mantine-spacing-sm)",flexDirection:"column",padding:"var(--mantine-spacing-md)",background:"var(--mantine-primary-color-light)",color:"var(--mantine-color-text)",borderRadius:"var(--mantine-radius-default)",opacity:.75,pointerEvents:i?"none":a,boxSizing:"border-box"}},...x,children:[n.jsxs("div",{className:"empty-node-button__content",children:[i&&!_&&n.jsx(f.Loader,{size:"xs",mb:2,mr:4,color:"gray"}),!i&&n.jsx(P,{name:t}),o,i&&m&&n.jsx(f.Text,{component:"span",onClick:N,variant:"link",style:{marginLeft:"auto",cursor:"pointer",pointerEvents:"auto"},children:M("editor.cancel")}),y&&!i&&n.jsx(P,{style:{pointerEvents:"auto"},className:"delete-icon",name:"close",size:22,onClick:T})]}),i&&typeof E=="number"&&_&&n.jsx(f.Progress,{w:"100%",value:E,animated:!0,transitionDuration:200})]})},Oe="_title_81iwv_1",ve="_icon_81iwv_11",Ae="_link_81iwv_20",se={title:Oe,icon:ve,link:Ae},Be=({page:t})=>{const{t:o}=V.useTranslation();return n.jsxs("div",{className:se.link,onClick:t.onClick,children:[n.jsx("div",{className:se.icon,children:t.icon?n.jsx(we.ProjectIcon,{size:16,fz:16,icon:t.icon,fallback:n.jsx(e.IconFile,{size:"1em"})}):n.jsx(e.IconFile,{size:16})}),n.jsx(f.Tooltip,{label:t.title,disabled:!t.title,openDelay:400,children:n.jsx(f.Text,{truncate:!0,className:se.title,"data-empty":!t.title,children:t.title||o("editor.noTitle")})})]})},He=I.memo,Fe=He(Be),We={center:-8,right:2,left:-18},$e=(t,o,a,i)=>{const y=t.width/2,m=t.height/2,x=i==null?void 0:i.classList[1],C=We[x];switch(o){case"nw-resize":return{x:0,y:0};case"ne-resize":return{x:t.width-16,y:0};case"sw-resize":return{x:0,y:t.height-16};case"se-resize":return{x:t.width-16,y:t.height-16};case"n-resize":return{x:y+C,y:0};case"s-resize":return{x:y+C,y:t.height-16};case"w-resize":return{x:0,y:m-8};case"e-resize":return{x:t.width-16,y:m-(a?17:8)}}},qe=(t,o,a,i=["nw-resize","ne-resize","sw-resize","se-resize","n-resize","s-resize","w-resize","e-resize"])=>{const y=a<=32,m=a>=t.height-32,x=o<=32,C=o>=t.width-32;return y&&x?i.includes("nw-resize")?"nw-resize":"default":y&&C?i.includes("ne-resize")?"ne-resize":"default":m&&x?i.includes("sw-resize")?"sw-resize":"default":m&&C?i.includes("se-resize")?"se-resize":"default":y?i.includes("n-resize")?"n-resize":"default":m?i.includes("s-resize")?"s-resize":"default":x?i.includes("w-resize")?"w-resize":"default":C&&i.includes("e-resize")?"e-resize":"default"},X=32,U=(t,o)=>t&&typeof t=="number"?Math.min(t/o*100,95.5):95.5;function Ge(t){const a=100-4e3/t;return{minResizePercent:Math.max(5,9792/t),maxWidthPercent:a}}const Ye=({editor:t,width:o,height:a,initialHeight:i,initialWidth:E,children:y,onResizeStart:m,isIcon:x,onResizeEnd:C,alignment:M,isEmbed:l,type:_})=>{const[T,N]=I.useState({x:-1e3,y:-1e3}),[z,J]=I.useState(30),[q,K]=I.useState("default"),[G,le]=I.useState(!1),{imperativeHandleRef:Y}=I.useContext(ae.Context),[Q,Z]=I.useState(null),D=I.useMemo(()=>H.getAllowedControls(M)||["e-resize"],[M]),ye=D.length===1&&D[0]==="e-resize",u=I.useRef(null),ue=I.useRef(null),R=I.useRef({rootHeight:0,rootWidth:0,ratio:1,currentWidth:0,currentWidthPercent:0,currentHeight:0,currentHeightPercent:0,startWidth:0,startWidthPercent:0,startHeight:0,startHeightPercent:0,startX:0,startY:0,direction:"x",isResizing:!1,isTop:!1,isBottom:!1,isLeft:!1,isRight:!1}),L=(r,s=95.5)=>{var d;const p=(d=t._window)==null?void 0:d.innerWidth;if(p){let g=100;l&&(g=250);const h=g/p*100;return r<h?h:r>s?s:r}else return r<20?20:r>100?100:r},de=(r,s)=>{const p=Math.min(r,s);return 15+(Math.max(200,Math.min(800,p))-100)/500*15},he=(r,s,p)=>{if(K("default"),!G)return;let d=q;d=qe(r,s,p,D),R.current.isResizing&&(d=q),K(d),J(z),N(g=>$e(r,d,l||!1,u.current)||g)},Ce=r=>{var g;if(k.isMobile)return;r.preventDefault();const s=(g=u.current)==null?void 0:g.getBoundingClientRect();if(!s)return;const p=r.clientX-s.left,d=r.clientY-s.top;R.current.isResizing||he(s,p,d)},me=(r,s=12,p=95.5,d=R.current.rootWidth)=>{const g=u.current,h=R.current;if(!g||r.button===2||!(h!=null&&h.isResizing))return;const w=g.getBoundingClientRect(),O=r.clientX-w.left,ee=r.clientY-w.top;he(w,O,ee);const te=.17,F=M==="right",W=M==="center",v=h.isLeft,A=h.isTop,$=h.isBottom,ne=h.direction==="y",c=h.isRight,S=Math.floor(F?w.right-r.clientX-(w.right-h.startX):r.clientX-h.startX),re=Math.floor(r.clientY-h.startY);let j=0;v||c?j=S/d*100:(A||$||W)&&(j=re*te),(v||A)&&(!F||ne&&!v)&&(!$||W)&&(j=-j),(A&&c||$&&c)&&(j=S/d*100),j=Math.max(-100,Math.min(100,j));const ie=h.startWidthPercent+j,oe=h.startHeightPercent+j;h.currentWidthPercent=L(Math.max(s,ie),p),h.currentHeightPercent=L(Math.max(s,oe),p),g.style.width=`${h.currentWidthPercent}%`,g.style.height=`${h.currentHeightPercent}%`},Ee=r=>{var g,h;const s=R.current;if(s.isResizing=!1,(g=u.current)==null||g.classList.remove("is-resizing"),(h=u.current)==null||h.releasePointerCapture(r.pointerId),C(s.currentWidthPercent+"%",s.currentHeightPercent+"%"),document.removeEventListener("pointermove",me),!u.current)return;const p=u.current.getBoundingClientRect(),d=de(p.width,p.height);J(d)},Me=r=>{var pe,ge;if(r.button===2||!G){r.preventDefault(),r.stopPropagation();return}if(!u.current)return;u.current.classList.add("is-resizing");const s=t.getRootElement();if(!s)return;const p=s.getBoundingClientRect();if(!t.isEditable()||q==="default")return;const d=ue.current;if(d===null)return;const g=(pe=u.current)==null?void 0:pe.getBoundingClientRect();if(!d.getBoundingClientRect()||!g)return;const{width:w,height:O,top:ee,left:te}=g,F=r.clientX-te,W=r.clientY-ee,v=W<=X,A=W>=O-X,$=F<=X,ne=F>=w-X,c=R.current,S=window.getComputedStyle(s),re=parseFloat(S.paddingTop),j=parseFloat(S.paddingBottom),ie=parseFloat(S.paddingLeft),oe=parseFloat(S.paddingRight);c.rootHeight=p.height-re-j||0,c.rootWidth=p.width-ie-oe||0,c.ratio=w/O,c.currentWidth=c.currentWidth||w,c.currentWidthPercent=+u.current.style.width.replace("%",""),c.currentHeight=c.currentHeight||O,c.currentHeightPercent=+u.current.style.height.replace("%",""),c.startX=r.clientX,c.startY=r.clientY,c.startWidth=c.currentWidth||w,c.startWidthPercent=c.currentWidthPercent,c.startHeight=c.currentHeight||O,c.startHeightPercent=c.currentHeightPercent,c.isResizing=!0,c.isTop=v,c.isBottom=A,c.isLeft=$,c.isRight=ne,c.direction=A||v?"y":"x",m&&m(),u.current.setPointerCapture(r.pointerId);const Re=((ge=u.current.parentElement)==null?void 0:ge.offsetWidth)??c.rootWidth,{maxWidthPercent:Pe,minResizePercent:_e}=Ge(Re);document.addEventListener("pointermove",be=>{var fe,xe;return me(be,_==="video"?40:_e,Pe,(xe=(fe=u.current)==null?void 0:fe.parentElement)==null?void 0:xe.offsetWidth)}),document.addEventListener("pointerup",Ee,{capture:!0,once:!0})};I.useEffect(()=>{var g;const r=u.current;if(!r)return;if(typeof o=="number"&&typeof a=="number"){r.style.width=`${L(o)}%`,r.style.height=`${L(a)}%`;return}const s=(g=r.parentElement)==null?void 0:g.getBoundingClientRect();if(!s)return;const p=U(i,s.height),d=U(E,s.width);r.style.width=`${d}%`,r.style.height=`${p}%`},[o,a,E,i]),I.useEffect(()=>{var d;if(!u.current)return;const r=u.current.getBoundingClientRect(),s=(d=u.current.parentElement)==null?void 0:d.getBoundingClientRect(),p=de(r.width,r.height);if(J(p),typeof o=="number"&&typeof a=="number")u.current.style.width=`${L(o)}%`,u.current.style.height=`${L(a)}%`,R.current.currentWidthPercent=o,R.current.currentHeightPercent=a;else if(s){const g=U(i,s.height),h=U(E,s.width);requestAnimationFrame(()=>{u.current&&(u.current.style.height=`${g}%`,u.current.style.width=`${h}%`)}),R.current.currentWidthPercent=h,R.current.currentHeightPercent=g}else u.current.style.height="100%",u.current.style.width="100%",R.current.currentWidthPercent=100,R.current.currentHeightPercent=100},[u.current,x,i,E]);const Te=r=>{const p=r.target.closest("[data-lexical-decorator]");return p?t.update(()=>{const d=b.$getNearestNodeFromDOMNode(p);d&&d instanceof b.DecoratorNode&&Z(d)}):Z(null),!1},ze=()=>(Q&&setTimeout(()=>{t.update(()=>(Q.insertAfter(b.$createParagraphNode()).selectStart(),Z(null),!0))}),!1);return Y!=null&&Y.current&&(Y.current.decoratorEnterAction=ze),I.useEffect(()=>{const r=t.registerCommand(b.CLICK_COMMAND,Te,b.COMMAND_PRIORITY_NORMAL);return()=>{r()}},[Q]),k.isMobile?y:n.jsxs("div",{ref:u,className:`resizable-container ${M||""} ${ye?"hide-padding":""}`,style:{cursor:q},onMouseMove:Ce,onMouseEnter:()=>le(!0),onMouseLeave:()=>{le(!1),K("default")},onMouseUp:()=>{t.dispatchCommand(k.ON_CHANGE_COMMAND,"show_menu")},onPointerDown:Me,children:[n.jsx("svg",{className:`resizable-container__handle ${G?"hovered":""}`,style:{"--clip-x1":`${T.x-z}px`,"--clip-y1":`${T.y-z}px`,"--clip-x2":`${T.x+z}px`,"--clip-y2":`${T.y-z}px`,"--clip-x3":`${T.x+z}px`,"--clip-y3":`${T.y+z}px`,"--clip-x4":`${T.x-z}px`,"--clip-y4":`${T.y+z}px`,clipPath:`polygon(
2
- var(--clip-x1) var(--clip-y1),
3
- var(--clip-x2) var(--clip-y2),
4
- var(--clip-x3) var(--clip-y3),
5
- var(--clip-x4) var(--clip-y4)
6
- )`,opacity:G?1:0,transition:`${R.current.isResizing?"none":` opacity 0.3s ease-in-out, clip-path ${(D==null?void 0:D.length)<4?"0.2s":"0.3s"} cubic-bezier(0.825, 0.225, 0.280, 0.770)`}`},children:n.jsx("rect",{x:0,y:0,width:"100%",height:"100%",stroke:"#D9D9D9",strokeWidth:8,rx:15,ry:15,fill:"none"})}),n.jsx("div",{ref:ue,className:"resizable-container__inner",style:{height:"100%",width:"100%",pointerEvents:R.current.isResizing?"none":"auto"},children:y})]})};function Xe({children:t}){return Se.createPortal(n.jsx("div",{className:"FlashMessage__overlay",role:"dialog",children:n.jsx("p",{className:"FlashMessage__alert",role:"alert",children:t})}),document.body)}function Ue({onClose:t,children:o,title:a,size:i}){return n.jsx(f.Modal,{className:"doc-space-editor-wrapper",size:i,centered:!0,opened:!0,onClose:t,title:a,zIndex:999,children:o})}function Ve({"data-test-id":t,children:o,className:a,onClick:i,disabled:E,small:y,title:m}){return n.jsx(f.Button,{onClick:i,disabled:E,variant:"filled",children:o})}const Je=({label:t,icon:o})=>n.jsxs("div",{className:"custom-menu-item",children:[n.jsxs("div",{children:[o,n.jsx("span",{children:t})]}),n.jsx(P,{name:"chevron-right"})]}),Ke=t=>({center:{icon:"align-center",iconRTL:"center-align",name:t("editor.toolbar.center")},end:{icon:"align-end",iconRTL:"left-align",name:"End Align"},justify:{icon:"align-justify",iconRTL:"justify-align",name:t("editor.toolbar.justify")},left:{icon:"align-left",iconRTL:"left-align",name:t("editor.toolbar.left")},right:{icon:"align-right",iconRTL:"left-align",name:t("editor.toolbar.right")},start:{icon:"align-start",iconRTL:"right-align",name:"Start Align"}});function Qe({editor:t,value:o,disabled:a=!1,setElementFormat:i}){const{t:E,i18n:y}=V.useTranslation(),m=I.useMemo(()=>Ke(E),[y.language]),x=I.useMemo(()=>o==="start"||o==="end"?m.left:m[o||"left"],[o,y.language]),C=M=>{i(M),t.dispatchCommand(b.FORMAT_ELEMENT_COMMAND,M)};return n.jsxs(f.Menu,{transitionProps:H.animationMenu,shadow:"md",styles:{dropdown:{zIndex:1e3}},children:[n.jsx(f.Menu.Target,{children:n.jsx(f.Tooltip,{label:E("editor.toolbar.align"),children:n.jsxs("button",{disabled:a,className:"toolbar-item spaced alignment","aria-label":"Formatting options for text alignment",type:"button",children:[n.jsx(P,{size:18,name:x.icon}),n.jsxs(f.Text,{mx:5,size:"sm",children:[" ",x.name]}),n.jsx(P,{name:"chevron-down"})]})})}),n.jsxs(f.Menu.Dropdown,{onMouseDown:M=>{M.preventDefault()},children:[n.jsx(f.Menu.Item,{leftSection:n.jsx(P,{size:18,name:"align-left"}),rightSection:o==="left"&&n.jsx(P,{name:"check-mark"}),onClick:()=>C("left"),children:m.left.name}),n.jsx(f.Menu.Item,{leftSection:n.jsx(P,{size:18,name:"align-center"}),rightSection:o==="center"&&n.jsx(P,{name:"check-mark"}),onClick:()=>C("center"),children:m.center.name}),n.jsx(f.Menu.Item,{leftSection:n.jsx(P,{size:18,name:"align-right"}),rightSection:o==="right"&&n.jsx(P,{name:"check-mark"}),onClick:()=>C("right"),children:m.right.name}),n.jsx(f.Menu.Item,{leftSection:n.jsx(P,{size:18,name:"align-justify"}),rightSection:o==="justify"&&n.jsx(P,{name:"check-mark"}),onClick:()=>C("justify"),children:m.justify.name})]})]})}function Ze({className:t}){return n.jsx(ke.ContentEditable,{contentEditable:!1,className:t||"ContentEditable__root"})}const et="_listContainer_1d88b_1",tt="_list_1d88b_1",nt="_text_1d88b_28",ce={listContainer:et,list:tt,text:nt},rt=({editor:t})=>{var M;const[o,a]=I.useState(!1),{t:i,i18n:E}=V.useTranslation(),{excludeNodes:y}=I.useContext(ae.Context),m=l=>{const _=document.querySelector(".editor-container");if(l){_.classList.add("empty-editor");return}_.classList.remove("empty-editor")};I.useEffect(()=>{t.update(()=>{k.checkIsEmpty()&&(a(!0),m(!0))}),De.mergeRegister(t.registerCommand(b.BLUR_COMMAND,()=>{const l=!!k.checkIsEmpty();return a(l),m(l),!1},b.COMMAND_PRIORITY_LOW),t.registerCommand(b.FOCUS_COMMAND,()=>(a(!1),m(!1),!1),b.COMMAND_PRIORITY_LOW))},[]);const x=(l,_)=>{l==null||l.update(()=>{l.focus();const N=b.$getRoot().getFirstChild();N&&_&&(_(N),a(!1))})},C=I.useMemo(()=>[{title:i("editor.emptyPageOptions.heading"),icon:n.jsx(e.IconH1,{stroke:2,size:18}),onSelect:()=>x(t,l=>{l.replace(Ne.$createHeadingNode("h1"))})},{title:i("editor.emptyPageOptions.grid"),icon:n.jsx(e.IconColumns2,{stroke:2,size:18}),onSelect:()=>{x(t,()=>{t==null||t.dispatchCommand(B.INSERT_LAYOUT_COMMAND,B.GRID_TWO_COL_WITH_GAP)})}},{title:i("editor.emptyPageOptions.list"),icon:n.jsx(e.IconListNumbers,{stroke:2,size:18}),onSelect:()=>{x(t,()=>{t==null||t.dispatchCommand(H.INSERT_ORDERED_LIST_COMMAND,void 0)})}},{title:i("editor.emptyPageOptions.code"),icon:n.jsx(e.IconCode,{stroke:2,size:18}),onSelect:()=>{x(t,()=>{t==null||t.dispatchCommand(B.INSERT_CODE_COMMAND,void 0)})}},{title:i("editor.menu.media.excalidraw.hint.description"),icon:n.jsx(e.IconPalette,{stroke:2,size:18}),onSelect:()=>{Promise.resolve().then(()=>require("./layers.B8z-e4Vg.js")).then(l=>l.index).then(({INSERT_EXCALIDRAW_COMMAND:l})=>{x(t,()=>{t.dispatchCommand(l,void 0)})})}},y.template?{title:i("editor.emptyPageOptions.template"),icon:n.jsx(e.IconTemplate,{stroke:2,size:18}),onSelect:()=>{x(t,()=>{t==null||t.dispatchCommand(k.CREATE_TEMPLATE,void 0)})}}:null,{title:i("editor.emptyPageOptions.callout"),icon:n.jsx(e.IconBaseline,{stroke:2,size:18}),onSelect:()=>{x(t,()=>{setTimeout(()=>{t==null||t.dispatchCommand(k.INSERT_CALLOUT_COMMAND,"success")})})}},{title:i("editor.emptyPageOptions.table"),icon:n.jsx(e.IconTable,{stroke:2,size:18}),onSelect:()=>{x(t,()=>{setTimeout(()=>{t==null||t.dispatchCommand(H.INSERT_TABLE_COMMAND,{columns:"4",includeHeaders:!1,rows:"3"})})})}},{title:i("editor.emptyPageOptions.integrations"),icon:n.jsx(e.IconApps,{stroke:2,size:18}),onSelect:()=>{}}],[E.language]);return o?n.jsx(f.Portal,{target:((M=t==null?void 0:t._rootElement)==null?void 0:M.parentElement)||document.body,children:n.jsx("ul",{className:`${ce.listContainer} empty-page-options`,children:C.map((l,_)=>l?n.jsxs(f.Menu,{disabled:_!==C.length-1,position:"bottom-start",shadow:"md",styles:{dropdown:{overflow:"auto",zIndex:1e3}},middlewares:B.middlewaresPopup,width:200,transitionProps:H.animationMenu,children:[n.jsx(f.Menu.Target,{children:n.jsxs("li",{className:ce.list,onClick:l.onSelect,children:[l.icon," ",n.jsx("span",{className:ce.text,children:l.title})]})}),n.jsx(f.Menu.Dropdown,{children:H.embedDescriptors.map(T=>n.jsx(f.Menu.Item,{className:"item "+B.dropDownActiveClass(T.key==="1"),leftSection:T.icon,style:{borderRadius:"var(--mantine-radius-sm)"},onClick:()=>{x(t,()=>{setTimeout(()=>{t==null||t.dispatchCommand(B.INSERT_EMBED_INTEGRATION_COMMAND,""),a(!1)})})},children:T.name},T.name))})]},l.title):null)})}):null};exports.AlignMenu=Qe;exports.Button=Ve;exports.CustomMenuItem=Je;exports.EmptyNodeButton=Le;exports.EmptyPage=rt;exports.FlashMessage=Xe;exports.Icon=P;exports.LexicalContentEditable=Ze;exports.ModalComponent=Ue;exports.PageLink=Fe;exports.ResizableContainer=Ye;
@@ -1,27 +0,0 @@
1
- "use strict";var Je=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},jt={exports:{}};/**
2
- * @license
3
- * Lodash <https://lodash.com/>
4
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
5
- * Released under MIT license <https://lodash.com/license>
6
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
7
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
8
- */var ip=jt.exports,rl;function up(){return rl||(rl=1,(function(Qe,Ve){(function(){var o,il="4.17.21",ke=200,ul="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",sn="Expected a function",fl="Invalid `variable` option passed into `_.template`",je="__lodash_hash_undefined__",ll=500,ne="__lodash_placeholder__",qn=1,Ii=2,st=4,at=1,te=2,wn=1,ct=2,Si=4,mn=8,Ct=16,On=32,mt=64,Wn=128,Ot=256,nr=512,ol=30,sl="...",al=800,cl=16,Ei=1,hl=2,gl=3,jn=1/0,Kn=9007199254740991,_l=17976931348623157e292,ee=NaN,Tn=4294967295,pl=Tn-1,vl=Tn>>>1,dl=[["ary",Wn],["bind",wn],["bindKey",ct],["curry",mn],["curryRight",Ct],["flip",nr],["partial",On],["partialRight",mt],["rearg",Ot]],ht="[object Arguments]",re="[object Array]",wl="[object AsyncFunction]",Wt="[object Boolean]",bt="[object Date]",xl="[object DOMException]",ie="[object Error]",ue="[object Function]",Ti="[object GeneratorFunction]",xn="[object Map]",Pt="[object Number]",Al="[object Null]",bn="[object Object]",yi="[object Promise]",Rl="[object Proxy]",Bt="[object RegExp]",An="[object Set]",Ft="[object String]",fe="[object Symbol]",Il="[object Undefined]",Mt="[object WeakMap]",Sl="[object WeakSet]",Ut="[object ArrayBuffer]",gt="[object DataView]",tr="[object Float32Array]",er="[object Float64Array]",rr="[object Int8Array]",ir="[object Int16Array]",ur="[object Int32Array]",fr="[object Uint8Array]",lr="[object Uint8ClampedArray]",or="[object Uint16Array]",sr="[object Uint32Array]",El=/\b__p \+= '';/g,Tl=/\b(__p \+=) '' \+/g,yl=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Li=/&(?:amp|lt|gt|quot|#39);/g,Ci=/[&<>"']/g,Ll=RegExp(Li.source),Cl=RegExp(Ci.source),ml=/<%-([\s\S]+?)%>/g,Ol=/<%([\s\S]+?)%>/g,mi=/<%=([\s\S]+?)%>/g,Wl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bl=/^\w*$/,Pl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ar=/[\\^$.*+?()[\]{}|]/g,Bl=RegExp(ar.source),cr=/^\s+/,Fl=/\s/,Ml=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ul=/\{\n\/\* \[wrapped with (.+)\] \*/,Dl=/,? & /,Nl=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Gl=/[()=,{}\[\]\/\s]/,Hl=/\\(\\)?/g,ql=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Oi=/\w*$/,Kl=/^[-+]0x[0-9a-f]+$/i,$l=/^0b[01]+$/i,zl=/^\[object .+?Constructor\]$/,Zl=/^0o[0-7]+$/i,Yl=/^(?:0|[1-9]\d*)$/,Xl=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,le=/($^)/,Jl=/['\n\r\u2028\u2029\\]/g,oe="\\ud800-\\udfff",Ql="\\u0300-\\u036f",Vl="\\ufe20-\\ufe2f",kl="\\u20d0-\\u20ff",Wi=Ql+Vl+kl,bi="\\u2700-\\u27bf",Pi="a-z\\xdf-\\xf6\\xf8-\\xff",jl="\\xac\\xb1\\xd7\\xf7",no="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",to="\\u2000-\\u206f",eo=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Bi="A-Z\\xc0-\\xd6\\xd8-\\xde",Fi="\\ufe0e\\ufe0f",Mi=jl+no+to+eo,hr="['’]",ro="["+oe+"]",Ui="["+Mi+"]",se="["+Wi+"]",Di="\\d+",io="["+bi+"]",Ni="["+Pi+"]",Gi="[^"+oe+Mi+Di+bi+Pi+Bi+"]",gr="\\ud83c[\\udffb-\\udfff]",uo="(?:"+se+"|"+gr+")",Hi="[^"+oe+"]",_r="(?:\\ud83c[\\udde6-\\uddff]){2}",pr="[\\ud800-\\udbff][\\udc00-\\udfff]",_t="["+Bi+"]",qi="\\u200d",Ki="(?:"+Ni+"|"+Gi+")",fo="(?:"+_t+"|"+Gi+")",$i="(?:"+hr+"(?:d|ll|m|re|s|t|ve))?",zi="(?:"+hr+"(?:D|LL|M|RE|S|T|VE))?",Zi=uo+"?",Yi="["+Fi+"]?",lo="(?:"+qi+"(?:"+[Hi,_r,pr].join("|")+")"+Yi+Zi+")*",oo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",so="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Xi=Yi+Zi+lo,ao="(?:"+[io,_r,pr].join("|")+")"+Xi,co="(?:"+[Hi+se+"?",se,_r,pr,ro].join("|")+")",ho=RegExp(hr,"g"),go=RegExp(se,"g"),vr=RegExp(gr+"(?="+gr+")|"+co+Xi,"g"),_o=RegExp([_t+"?"+Ni+"+"+$i+"(?="+[Ui,_t,"$"].join("|")+")",fo+"+"+zi+"(?="+[Ui,_t+Ki,"$"].join("|")+")",_t+"?"+Ki+"+"+$i,_t+"+"+zi,so,oo,Di,ao].join("|"),"g"),po=RegExp("["+qi+oe+Wi+Fi+"]"),vo=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,wo=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],xo=-1,M={};M[tr]=M[er]=M[rr]=M[ir]=M[ur]=M[fr]=M[lr]=M[or]=M[sr]=!0,M[ht]=M[re]=M[Ut]=M[Wt]=M[gt]=M[bt]=M[ie]=M[ue]=M[xn]=M[Pt]=M[bn]=M[Bt]=M[An]=M[Ft]=M[Mt]=!1;var F={};F[ht]=F[re]=F[Ut]=F[gt]=F[Wt]=F[bt]=F[tr]=F[er]=F[rr]=F[ir]=F[ur]=F[xn]=F[Pt]=F[bn]=F[Bt]=F[An]=F[Ft]=F[fe]=F[fr]=F[lr]=F[or]=F[sr]=!0,F[ie]=F[ue]=F[Mt]=!1;var Ao={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Ro={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Io={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},So={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Eo=parseFloat,To=parseInt,Ji=typeof Je=="object"&&Je&&Je.Object===Object&&Je,yo=typeof self=="object"&&self&&self.Object===Object&&self,z=Ji||yo||Function("return this")(),dr=Ve&&!Ve.nodeType&&Ve,nt=dr&&!0&&Qe&&!Qe.nodeType&&Qe,Qi=nt&&nt.exports===dr,wr=Qi&&Ji.process,an=(function(){try{var a=nt&&nt.require&&nt.require("util").types;return a||wr&&wr.binding&&wr.binding("util")}catch{}})(),Vi=an&&an.isArrayBuffer,ki=an&&an.isDate,ji=an&&an.isMap,nu=an&&an.isRegExp,tu=an&&an.isSet,eu=an&&an.isTypedArray;function en(a,g,h){switch(h.length){case 0:return a.call(g);case 1:return a.call(g,h[0]);case 2:return a.call(g,h[0],h[1]);case 3:return a.call(g,h[0],h[1],h[2])}return a.apply(g,h)}function Lo(a,g,h,w){for(var S=-1,W=a==null?0:a.length;++S<W;){var q=a[S];g(w,q,h(q),a)}return w}function cn(a,g){for(var h=-1,w=a==null?0:a.length;++h<w&&g(a[h],h,a)!==!1;);return a}function Co(a,g){for(var h=a==null?0:a.length;h--&&g(a[h],h,a)!==!1;);return a}function ru(a,g){for(var h=-1,w=a==null?0:a.length;++h<w;)if(!g(a[h],h,a))return!1;return!0}function $n(a,g){for(var h=-1,w=a==null?0:a.length,S=0,W=[];++h<w;){var q=a[h];g(q,h,a)&&(W[S++]=q)}return W}function ae(a,g){var h=a==null?0:a.length;return!!h&&pt(a,g,0)>-1}function xr(a,g,h){for(var w=-1,S=a==null?0:a.length;++w<S;)if(h(g,a[w]))return!0;return!1}function U(a,g){for(var h=-1,w=a==null?0:a.length,S=Array(w);++h<w;)S[h]=g(a[h],h,a);return S}function zn(a,g){for(var h=-1,w=g.length,S=a.length;++h<w;)a[S+h]=g[h];return a}function Ar(a,g,h,w){var S=-1,W=a==null?0:a.length;for(w&&W&&(h=a[++S]);++S<W;)h=g(h,a[S],S,a);return h}function mo(a,g,h,w){var S=a==null?0:a.length;for(w&&S&&(h=a[--S]);S--;)h=g(h,a[S],S,a);return h}function Rr(a,g){for(var h=-1,w=a==null?0:a.length;++h<w;)if(g(a[h],h,a))return!0;return!1}var Oo=Ir("length");function Wo(a){return a.split("")}function bo(a){return a.match(Nl)||[]}function iu(a,g,h){var w;return h(a,function(S,W,q){if(g(S,W,q))return w=W,!1}),w}function ce(a,g,h,w){for(var S=a.length,W=h+(w?1:-1);w?W--:++W<S;)if(g(a[W],W,a))return W;return-1}function pt(a,g,h){return g===g?$o(a,g,h):ce(a,uu,h)}function Po(a,g,h,w){for(var S=h-1,W=a.length;++S<W;)if(w(a[S],g))return S;return-1}function uu(a){return a!==a}function fu(a,g){var h=a==null?0:a.length;return h?Er(a,g)/h:ee}function Ir(a){return function(g){return g==null?o:g[a]}}function Sr(a){return function(g){return a==null?o:a[g]}}function lu(a,g,h,w,S){return S(a,function(W,q,B){h=w?(w=!1,W):g(h,W,q,B)}),h}function Bo(a,g){var h=a.length;for(a.sort(g);h--;)a[h]=a[h].value;return a}function Er(a,g){for(var h,w=-1,S=a.length;++w<S;){var W=g(a[w]);W!==o&&(h=h===o?W:h+W)}return h}function Tr(a,g){for(var h=-1,w=Array(a);++h<a;)w[h]=g(h);return w}function Fo(a,g){return U(g,function(h){return[h,a[h]]})}function ou(a){return a&&a.slice(0,hu(a)+1).replace(cr,"")}function rn(a){return function(g){return a(g)}}function yr(a,g){return U(g,function(h){return a[h]})}function Dt(a,g){return a.has(g)}function su(a,g){for(var h=-1,w=a.length;++h<w&&pt(g,a[h],0)>-1;);return h}function au(a,g){for(var h=a.length;h--&&pt(g,a[h],0)>-1;);return h}function Mo(a,g){for(var h=a.length,w=0;h--;)a[h]===g&&++w;return w}var Uo=Sr(Ao),Do=Sr(Ro);function No(a){return"\\"+So[a]}function Go(a,g){return a==null?o:a[g]}function vt(a){return po.test(a)}function Ho(a){return vo.test(a)}function qo(a){for(var g,h=[];!(g=a.next()).done;)h.push(g.value);return h}function Lr(a){var g=-1,h=Array(a.size);return a.forEach(function(w,S){h[++g]=[S,w]}),h}function cu(a,g){return function(h){return a(g(h))}}function Zn(a,g){for(var h=-1,w=a.length,S=0,W=[];++h<w;){var q=a[h];(q===g||q===ne)&&(a[h]=ne,W[S++]=h)}return W}function he(a){var g=-1,h=Array(a.size);return a.forEach(function(w){h[++g]=w}),h}function Ko(a){var g=-1,h=Array(a.size);return a.forEach(function(w){h[++g]=[w,w]}),h}function $o(a,g,h){for(var w=h-1,S=a.length;++w<S;)if(a[w]===g)return w;return-1}function zo(a,g,h){for(var w=h+1;w--;)if(a[w]===g)return w;return w}function dt(a){return vt(a)?Yo(a):Oo(a)}function Rn(a){return vt(a)?Xo(a):Wo(a)}function hu(a){for(var g=a.length;g--&&Fl.test(a.charAt(g)););return g}var Zo=Sr(Io);function Yo(a){for(var g=vr.lastIndex=0;vr.test(a);)++g;return g}function Xo(a){return a.match(vr)||[]}function Jo(a){return a.match(_o)||[]}var Qo=(function a(g){g=g==null?z:wt.defaults(z.Object(),g,wt.pick(z,wo));var h=g.Array,w=g.Date,S=g.Error,W=g.Function,q=g.Math,B=g.Object,Cr=g.RegExp,Vo=g.String,hn=g.TypeError,ge=h.prototype,ko=W.prototype,xt=B.prototype,_e=g["__core-js_shared__"],pe=ko.toString,P=xt.hasOwnProperty,jo=0,gu=(function(){var n=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})(),ve=xt.toString,ns=pe.call(B),ts=z._,es=Cr("^"+pe.call(P).replace(ar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),de=Qi?g.Buffer:o,Yn=g.Symbol,we=g.Uint8Array,_u=de?de.allocUnsafe:o,xe=cu(B.getPrototypeOf,B),pu=B.create,vu=xt.propertyIsEnumerable,Ae=ge.splice,du=Yn?Yn.isConcatSpreadable:o,Nt=Yn?Yn.iterator:o,tt=Yn?Yn.toStringTag:o,Re=(function(){try{var n=ft(B,"defineProperty");return n({},"",{}),n}catch{}})(),rs=g.clearTimeout!==z.clearTimeout&&g.clearTimeout,is=w&&w.now!==z.Date.now&&w.now,us=g.setTimeout!==z.setTimeout&&g.setTimeout,Ie=q.ceil,Se=q.floor,mr=B.getOwnPropertySymbols,fs=de?de.isBuffer:o,wu=g.isFinite,ls=ge.join,os=cu(B.keys,B),K=q.max,Y=q.min,ss=w.now,as=g.parseInt,xu=q.random,cs=ge.reverse,Or=ft(g,"DataView"),Gt=ft(g,"Map"),Wr=ft(g,"Promise"),At=ft(g,"Set"),Ht=ft(g,"WeakMap"),qt=ft(B,"create"),Ee=Ht&&new Ht,Rt={},hs=lt(Or),gs=lt(Gt),_s=lt(Wr),ps=lt(At),vs=lt(Ht),Te=Yn?Yn.prototype:o,Kt=Te?Te.valueOf:o,Au=Te?Te.toString:o;function u(n){if(N(n)&&!E(n)&&!(n instanceof m)){if(n instanceof gn)return n;if(P.call(n,"__wrapped__"))return If(n)}return new gn(n)}var It=(function(){function n(){}return function(t){if(!D(t))return{};if(pu)return pu(t);n.prototype=t;var e=new n;return n.prototype=o,e}})();function ye(){}function gn(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=o}u.templateSettings={escape:ml,evaluate:Ol,interpolate:mi,variable:"",imports:{_:u}},u.prototype=ye.prototype,u.prototype.constructor=u,gn.prototype=It(ye.prototype),gn.prototype.constructor=gn;function m(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Tn,this.__views__=[]}function ds(){var n=new m(this.__wrapped__);return n.__actions__=k(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=k(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=k(this.__views__),n}function ws(){if(this.__filtered__){var n=new m(this);n.__dir__=-1,n.__filtered__=!0}else n=this.clone(),n.__dir__*=-1;return n}function xs(){var n=this.__wrapped__.value(),t=this.__dir__,e=E(n),r=t<0,i=e?n.length:0,f=Wa(0,i,this.__views__),l=f.start,s=f.end,c=s-l,_=r?s:l-1,p=this.__iteratees__,v=p.length,d=0,x=Y(c,this.__takeCount__);if(!e||!r&&i==c&&x==c)return $u(n,this.__actions__);var R=[];n:for(;c--&&d<x;){_+=t;for(var y=-1,I=n[_];++y<v;){var C=p[y],O=C.iteratee,ln=C.type,V=O(I);if(ln==hl)I=V;else if(!V){if(ln==Ei)continue n;break n}}R[d++]=I}return R}m.prototype=It(ye.prototype),m.prototype.constructor=m;function et(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}function As(){this.__data__=qt?qt(null):{},this.size=0}function Rs(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t}function Is(n){var t=this.__data__;if(qt){var e=t[n];return e===je?o:e}return P.call(t,n)?t[n]:o}function Ss(n){var t=this.__data__;return qt?t[n]!==o:P.call(t,n)}function Es(n,t){var e=this.__data__;return this.size+=this.has(n)?0:1,e[n]=qt&&t===o?je:t,this}et.prototype.clear=As,et.prototype.delete=Rs,et.prototype.get=Is,et.prototype.has=Ss,et.prototype.set=Es;function Pn(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}function Ts(){this.__data__=[],this.size=0}function ys(n){var t=this.__data__,e=Le(t,n);if(e<0)return!1;var r=t.length-1;return e==r?t.pop():Ae.call(t,e,1),--this.size,!0}function Ls(n){var t=this.__data__,e=Le(t,n);return e<0?o:t[e][1]}function Cs(n){return Le(this.__data__,n)>-1}function ms(n,t){var e=this.__data__,r=Le(e,n);return r<0?(++this.size,e.push([n,t])):e[r][1]=t,this}Pn.prototype.clear=Ts,Pn.prototype.delete=ys,Pn.prototype.get=Ls,Pn.prototype.has=Cs,Pn.prototype.set=ms;function Bn(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}function Os(){this.size=0,this.__data__={hash:new et,map:new(Gt||Pn),string:new et}}function Ws(n){var t=Ne(this,n).delete(n);return this.size-=t?1:0,t}function bs(n){return Ne(this,n).get(n)}function Ps(n){return Ne(this,n).has(n)}function Bs(n,t){var e=Ne(this,n),r=e.size;return e.set(n,t),this.size+=e.size==r?0:1,this}Bn.prototype.clear=Os,Bn.prototype.delete=Ws,Bn.prototype.get=bs,Bn.prototype.has=Ps,Bn.prototype.set=Bs;function rt(n){var t=-1,e=n==null?0:n.length;for(this.__data__=new Bn;++t<e;)this.add(n[t])}function Fs(n){return this.__data__.set(n,je),this}function Ms(n){return this.__data__.has(n)}rt.prototype.add=rt.prototype.push=Fs,rt.prototype.has=Ms;function In(n){var t=this.__data__=new Pn(n);this.size=t.size}function Us(){this.__data__=new Pn,this.size=0}function Ds(n){var t=this.__data__,e=t.delete(n);return this.size=t.size,e}function Ns(n){return this.__data__.get(n)}function Gs(n){return this.__data__.has(n)}function Hs(n,t){var e=this.__data__;if(e instanceof Pn){var r=e.__data__;if(!Gt||r.length<ke-1)return r.push([n,t]),this.size=++e.size,this;e=this.__data__=new Bn(r)}return e.set(n,t),this.size=e.size,this}In.prototype.clear=Us,In.prototype.delete=Ds,In.prototype.get=Ns,In.prototype.has=Gs,In.prototype.set=Hs;function Ru(n,t){var e=E(n),r=!e&&ot(n),i=!e&&!r&&kn(n),f=!e&&!r&&!i&&yt(n),l=e||r||i||f,s=l?Tr(n.length,Vo):[],c=s.length;for(var _ in n)(t||P.call(n,_))&&!(l&&(_=="length"||i&&(_=="offset"||_=="parent")||f&&(_=="buffer"||_=="byteLength"||_=="byteOffset")||Dn(_,c)))&&s.push(_);return s}function Iu(n){var t=n.length;return t?n[qr(0,t-1)]:o}function qs(n,t){return Ge(k(n),it(t,0,n.length))}function Ks(n){return Ge(k(n))}function br(n,t,e){(e!==o&&!Sn(n[t],e)||e===o&&!(t in n))&&Fn(n,t,e)}function $t(n,t,e){var r=n[t];(!(P.call(n,t)&&Sn(r,e))||e===o&&!(t in n))&&Fn(n,t,e)}function Le(n,t){for(var e=n.length;e--;)if(Sn(n[e][0],t))return e;return-1}function $s(n,t,e,r){return Xn(n,function(i,f,l){t(r,i,e(i),l)}),r}function Su(n,t){return n&&Ln(t,$(t),n)}function zs(n,t){return n&&Ln(t,nn(t),n)}function Fn(n,t,e){t=="__proto__"&&Re?Re(n,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):n[t]=e}function Pr(n,t){for(var e=-1,r=t.length,i=h(r),f=n==null;++e<r;)i[e]=f?o:gi(n,t[e]);return i}function it(n,t,e){return n===n&&(e!==o&&(n=n<=e?n:e),t!==o&&(n=n>=t?n:t)),n}function _n(n,t,e,r,i,f){var l,s=t&qn,c=t&Ii,_=t&st;if(e&&(l=i?e(n,r,i,f):e(n)),l!==o)return l;if(!D(n))return n;var p=E(n);if(p){if(l=Pa(n),!s)return k(n,l)}else{var v=X(n),d=v==ue||v==Ti;if(kn(n))return Yu(n,s);if(v==bn||v==ht||d&&!i){if(l=c||d?{}:gf(n),!s)return c?Ia(n,zs(l,n)):Ra(n,Su(l,n))}else{if(!F[v])return i?n:{};l=Ba(n,v,s)}}f||(f=new In);var x=f.get(n);if(x)return x;f.set(n,l),qf(n)?n.forEach(function(I){l.add(_n(I,t,e,I,n,f))}):Gf(n)&&n.forEach(function(I,C){l.set(C,_n(I,t,e,C,n,f))});var R=_?c?jr:kr:c?nn:$,y=p?o:R(n);return cn(y||n,function(I,C){y&&(C=I,I=n[C]),$t(l,C,_n(I,t,e,C,n,f))}),l}function Zs(n){var t=$(n);return function(e){return Eu(e,n,t)}}function Eu(n,t,e){var r=e.length;if(n==null)return!r;for(n=B(n);r--;){var i=e[r],f=t[i],l=n[i];if(l===o&&!(i in n)||!f(l))return!1}return!0}function Tu(n,t,e){if(typeof n!="function")throw new hn(sn);return Vt(function(){n.apply(o,e)},t)}function zt(n,t,e,r){var i=-1,f=ae,l=!0,s=n.length,c=[],_=t.length;if(!s)return c;e&&(t=U(t,rn(e))),r?(f=xr,l=!1):t.length>=ke&&(f=Dt,l=!1,t=new rt(t));n:for(;++i<s;){var p=n[i],v=e==null?p:e(p);if(p=r||p!==0?p:0,l&&v===v){for(var d=_;d--;)if(t[d]===v)continue n;c.push(p)}else f(t,v,r)||c.push(p)}return c}var Xn=ku(yn),yu=ku(Fr,!0);function Ys(n,t){var e=!0;return Xn(n,function(r,i,f){return e=!!t(r,i,f),e}),e}function Ce(n,t,e){for(var r=-1,i=n.length;++r<i;){var f=n[r],l=t(f);if(l!=null&&(s===o?l===l&&!fn(l):e(l,s)))var s=l,c=f}return c}function Xs(n,t,e,r){var i=n.length;for(e=T(e),e<0&&(e=-e>i?0:i+e),r=r===o||r>i?i:T(r),r<0&&(r+=i),r=e>r?0:$f(r);e<r;)n[e++]=t;return n}function Lu(n,t){var e=[];return Xn(n,function(r,i,f){t(r,i,f)&&e.push(r)}),e}function Z(n,t,e,r,i){var f=-1,l=n.length;for(e||(e=Ma),i||(i=[]);++f<l;){var s=n[f];t>0&&e(s)?t>1?Z(s,t-1,e,r,i):zn(i,s):r||(i[i.length]=s)}return i}var Br=ju(),Cu=ju(!0);function yn(n,t){return n&&Br(n,t,$)}function Fr(n,t){return n&&Cu(n,t,$)}function me(n,t){return $n(t,function(e){return Nn(n[e])})}function ut(n,t){t=Qn(t,n);for(var e=0,r=t.length;n!=null&&e<r;)n=n[Cn(t[e++])];return e&&e==r?n:o}function mu(n,t,e){var r=t(n);return E(n)?r:zn(r,e(n))}function J(n){return n==null?n===o?Il:Al:tt&&tt in B(n)?Oa(n):Ka(n)}function Mr(n,t){return n>t}function Js(n,t){return n!=null&&P.call(n,t)}function Qs(n,t){return n!=null&&t in B(n)}function Vs(n,t,e){return n>=Y(t,e)&&n<K(t,e)}function Ur(n,t,e){for(var r=e?xr:ae,i=n[0].length,f=n.length,l=f,s=h(f),c=1/0,_=[];l--;){var p=n[l];l&&t&&(p=U(p,rn(t))),c=Y(p.length,c),s[l]=!e&&(t||i>=120&&p.length>=120)?new rt(l&&p):o}p=n[0];var v=-1,d=s[0];n:for(;++v<i&&_.length<c;){var x=p[v],R=t?t(x):x;if(x=e||x!==0?x:0,!(d?Dt(d,R):r(_,R,e))){for(l=f;--l;){var y=s[l];if(!(y?Dt(y,R):r(n[l],R,e)))continue n}d&&d.push(R),_.push(x)}}return _}function ks(n,t,e,r){return yn(n,function(i,f,l){t(r,e(i),f,l)}),r}function Zt(n,t,e){t=Qn(t,n),n=df(n,t);var r=n==null?n:n[Cn(vn(t))];return r==null?o:en(r,n,e)}function Ou(n){return N(n)&&J(n)==ht}function js(n){return N(n)&&J(n)==Ut}function na(n){return N(n)&&J(n)==bt}function Yt(n,t,e,r,i){return n===t?!0:n==null||t==null||!N(n)&&!N(t)?n!==n&&t!==t:ta(n,t,e,r,Yt,i)}function ta(n,t,e,r,i,f){var l=E(n),s=E(t),c=l?re:X(n),_=s?re:X(t);c=c==ht?bn:c,_=_==ht?bn:_;var p=c==bn,v=_==bn,d=c==_;if(d&&kn(n)){if(!kn(t))return!1;l=!0,p=!1}if(d&&!p)return f||(f=new In),l||yt(n)?af(n,t,e,r,i,f):Ca(n,t,c,e,r,i,f);if(!(e&at)){var x=p&&P.call(n,"__wrapped__"),R=v&&P.call(t,"__wrapped__");if(x||R){var y=x?n.value():n,I=R?t.value():t;return f||(f=new In),i(y,I,e,r,f)}}return d?(f||(f=new In),ma(n,t,e,r,i,f)):!1}function ea(n){return N(n)&&X(n)==xn}function Dr(n,t,e,r){var i=e.length,f=i,l=!r;if(n==null)return!f;for(n=B(n);i--;){var s=e[i];if(l&&s[2]?s[1]!==n[s[0]]:!(s[0]in n))return!1}for(;++i<f;){s=e[i];var c=s[0],_=n[c],p=s[1];if(l&&s[2]){if(_===o&&!(c in n))return!1}else{var v=new In;if(r)var d=r(_,p,c,n,t,v);if(!(d===o?Yt(p,_,at|te,r,v):d))return!1}}return!0}function Wu(n){if(!D(n)||Da(n))return!1;var t=Nn(n)?es:zl;return t.test(lt(n))}function ra(n){return N(n)&&J(n)==Bt}function ia(n){return N(n)&&X(n)==An}function ua(n){return N(n)&&Ze(n.length)&&!!M[J(n)]}function bu(n){return typeof n=="function"?n:n==null?tn:typeof n=="object"?E(n)?Fu(n[0],n[1]):Bu(n):tl(n)}function Nr(n){if(!Qt(n))return os(n);var t=[];for(var e in B(n))P.call(n,e)&&e!="constructor"&&t.push(e);return t}function fa(n){if(!D(n))return qa(n);var t=Qt(n),e=[];for(var r in n)r=="constructor"&&(t||!P.call(n,r))||e.push(r);return e}function Gr(n,t){return n<t}function Pu(n,t){var e=-1,r=j(n)?h(n.length):[];return Xn(n,function(i,f,l){r[++e]=t(i,f,l)}),r}function Bu(n){var t=ti(n);return t.length==1&&t[0][2]?pf(t[0][0],t[0][1]):function(e){return e===n||Dr(e,n,t)}}function Fu(n,t){return ri(n)&&_f(t)?pf(Cn(n),t):function(e){var r=gi(e,n);return r===o&&r===t?_i(e,n):Yt(t,r,at|te)}}function Oe(n,t,e,r,i){n!==t&&Br(t,function(f,l){if(i||(i=new In),D(f))la(n,t,l,e,Oe,r,i);else{var s=r?r(ui(n,l),f,l+"",n,t,i):o;s===o&&(s=f),br(n,l,s)}},nn)}function la(n,t,e,r,i,f,l){var s=ui(n,e),c=ui(t,e),_=l.get(c);if(_){br(n,e,_);return}var p=f?f(s,c,e+"",n,t,l):o,v=p===o;if(v){var d=E(c),x=!d&&kn(c),R=!d&&!x&&yt(c);p=c,d||x||R?E(s)?p=s:G(s)?p=k(s):x?(v=!1,p=Yu(c,!0)):R?(v=!1,p=Xu(c,!0)):p=[]:kt(c)||ot(c)?(p=s,ot(s)?p=zf(s):(!D(s)||Nn(s))&&(p=gf(c))):v=!1}v&&(l.set(c,p),i(p,c,r,f,l),l.delete(c)),br(n,e,p)}function Mu(n,t){var e=n.length;if(e)return t+=t<0?e:0,Dn(t,e)?n[t]:o}function Uu(n,t,e){t.length?t=U(t,function(f){return E(f)?function(l){return ut(l,f.length===1?f[0]:f)}:f}):t=[tn];var r=-1;t=U(t,rn(A()));var i=Pu(n,function(f,l,s){var c=U(t,function(_){return _(f)});return{criteria:c,index:++r,value:f}});return Bo(i,function(f,l){return Aa(f,l,e)})}function oa(n,t){return Du(n,t,function(e,r){return _i(n,r)})}function Du(n,t,e){for(var r=-1,i=t.length,f={};++r<i;){var l=t[r],s=ut(n,l);e(s,l)&&Xt(f,Qn(l,n),s)}return f}function sa(n){return function(t){return ut(t,n)}}function Hr(n,t,e,r){var i=r?Po:pt,f=-1,l=t.length,s=n;for(n===t&&(t=k(t)),e&&(s=U(n,rn(e)));++f<l;)for(var c=0,_=t[f],p=e?e(_):_;(c=i(s,p,c,r))>-1;)s!==n&&Ae.call(s,c,1),Ae.call(n,c,1);return n}function Nu(n,t){for(var e=n?t.length:0,r=e-1;e--;){var i=t[e];if(e==r||i!==f){var f=i;Dn(i)?Ae.call(n,i,1):zr(n,i)}}return n}function qr(n,t){return n+Se(xu()*(t-n+1))}function aa(n,t,e,r){for(var i=-1,f=K(Ie((t-n)/(e||1)),0),l=h(f);f--;)l[r?f:++i]=n,n+=e;return l}function Kr(n,t){var e="";if(!n||t<1||t>Kn)return e;do t%2&&(e+=n),t=Se(t/2),t&&(n+=n);while(t);return e}function L(n,t){return fi(vf(n,t,tn),n+"")}function ca(n){return Iu(Lt(n))}function ha(n,t){var e=Lt(n);return Ge(e,it(t,0,e.length))}function Xt(n,t,e,r){if(!D(n))return n;t=Qn(t,n);for(var i=-1,f=t.length,l=f-1,s=n;s!=null&&++i<f;){var c=Cn(t[i]),_=e;if(c==="__proto__"||c==="constructor"||c==="prototype")return n;if(i!=l){var p=s[c];_=r?r(p,c,s):o,_===o&&(_=D(p)?p:Dn(t[i+1])?[]:{})}$t(s,c,_),s=s[c]}return n}var Gu=Ee?function(n,t){return Ee.set(n,t),n}:tn,ga=Re?function(n,t){return Re(n,"toString",{configurable:!0,enumerable:!1,value:vi(t),writable:!0})}:tn;function _a(n){return Ge(Lt(n))}function pn(n,t,e){var r=-1,i=n.length;t<0&&(t=-t>i?0:i+t),e=e>i?i:e,e<0&&(e+=i),i=t>e?0:e-t>>>0,t>>>=0;for(var f=h(i);++r<i;)f[r]=n[r+t];return f}function pa(n,t){var e;return Xn(n,function(r,i,f){return e=t(r,i,f),!e}),!!e}function We(n,t,e){var r=0,i=n==null?r:n.length;if(typeof t=="number"&&t===t&&i<=vl){for(;r<i;){var f=r+i>>>1,l=n[f];l!==null&&!fn(l)&&(e?l<=t:l<t)?r=f+1:i=f}return i}return $r(n,t,tn,e)}function $r(n,t,e,r){var i=0,f=n==null?0:n.length;if(f===0)return 0;t=e(t);for(var l=t!==t,s=t===null,c=fn(t),_=t===o;i<f;){var p=Se((i+f)/2),v=e(n[p]),d=v!==o,x=v===null,R=v===v,y=fn(v);if(l)var I=r||R;else _?I=R&&(r||d):s?I=R&&d&&(r||!x):c?I=R&&d&&!x&&(r||!y):x||y?I=!1:I=r?v<=t:v<t;I?i=p+1:f=p}return Y(f,pl)}function Hu(n,t){for(var e=-1,r=n.length,i=0,f=[];++e<r;){var l=n[e],s=t?t(l):l;if(!e||!Sn(s,c)){var c=s;f[i++]=l===0?0:l}}return f}function qu(n){return typeof n=="number"?n:fn(n)?ee:+n}function un(n){if(typeof n=="string")return n;if(E(n))return U(n,un)+"";if(fn(n))return Au?Au.call(n):"";var t=n+"";return t=="0"&&1/n==-jn?"-0":t}function Jn(n,t,e){var r=-1,i=ae,f=n.length,l=!0,s=[],c=s;if(e)l=!1,i=xr;else if(f>=ke){var _=t?null:ya(n);if(_)return he(_);l=!1,i=Dt,c=new rt}else c=t?[]:s;n:for(;++r<f;){var p=n[r],v=t?t(p):p;if(p=e||p!==0?p:0,l&&v===v){for(var d=c.length;d--;)if(c[d]===v)continue n;t&&c.push(v),s.push(p)}else i(c,v,e)||(c!==s&&c.push(v),s.push(p))}return s}function zr(n,t){return t=Qn(t,n),n=df(n,t),n==null||delete n[Cn(vn(t))]}function Ku(n,t,e,r){return Xt(n,t,e(ut(n,t)),r)}function be(n,t,e,r){for(var i=n.length,f=r?i:-1;(r?f--:++f<i)&&t(n[f],f,n););return e?pn(n,r?0:f,r?f+1:i):pn(n,r?f+1:0,r?i:f)}function $u(n,t){var e=n;return e instanceof m&&(e=e.value()),Ar(t,function(r,i){return i.func.apply(i.thisArg,zn([r],i.args))},e)}function Zr(n,t,e){var r=n.length;if(r<2)return r?Jn(n[0]):[];for(var i=-1,f=h(r);++i<r;)for(var l=n[i],s=-1;++s<r;)s!=i&&(f[i]=zt(f[i]||l,n[s],t,e));return Jn(Z(f,1),t,e)}function zu(n,t,e){for(var r=-1,i=n.length,f=t.length,l={};++r<i;){var s=r<f?t[r]:o;e(l,n[r],s)}return l}function Yr(n){return G(n)?n:[]}function Xr(n){return typeof n=="function"?n:tn}function Qn(n,t){return E(n)?n:ri(n,t)?[n]:Rf(b(n))}var va=L;function Vn(n,t,e){var r=n.length;return e=e===o?r:e,!t&&e>=r?n:pn(n,t,e)}var Zu=rs||function(n){return z.clearTimeout(n)};function Yu(n,t){if(t)return n.slice();var e=n.length,r=_u?_u(e):new n.constructor(e);return n.copy(r),r}function Jr(n){var t=new n.constructor(n.byteLength);return new we(t).set(new we(n)),t}function da(n,t){var e=t?Jr(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.byteLength)}function wa(n){var t=new n.constructor(n.source,Oi.exec(n));return t.lastIndex=n.lastIndex,t}function xa(n){return Kt?B(Kt.call(n)):{}}function Xu(n,t){var e=t?Jr(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.length)}function Ju(n,t){if(n!==t){var e=n!==o,r=n===null,i=n===n,f=fn(n),l=t!==o,s=t===null,c=t===t,_=fn(t);if(!s&&!_&&!f&&n>t||f&&l&&c&&!s&&!_||r&&l&&c||!e&&c||!i)return 1;if(!r&&!f&&!_&&n<t||_&&e&&i&&!r&&!f||s&&e&&i||!l&&i||!c)return-1}return 0}function Aa(n,t,e){for(var r=-1,i=n.criteria,f=t.criteria,l=i.length,s=e.length;++r<l;){var c=Ju(i[r],f[r]);if(c){if(r>=s)return c;var _=e[r];return c*(_=="desc"?-1:1)}}return n.index-t.index}function Qu(n,t,e,r){for(var i=-1,f=n.length,l=e.length,s=-1,c=t.length,_=K(f-l,0),p=h(c+_),v=!r;++s<c;)p[s]=t[s];for(;++i<l;)(v||i<f)&&(p[e[i]]=n[i]);for(;_--;)p[s++]=n[i++];return p}function Vu(n,t,e,r){for(var i=-1,f=n.length,l=-1,s=e.length,c=-1,_=t.length,p=K(f-s,0),v=h(p+_),d=!r;++i<p;)v[i]=n[i];for(var x=i;++c<_;)v[x+c]=t[c];for(;++l<s;)(d||i<f)&&(v[x+e[l]]=n[i++]);return v}function k(n,t){var e=-1,r=n.length;for(t||(t=h(r));++e<r;)t[e]=n[e];return t}function Ln(n,t,e,r){var i=!e;e||(e={});for(var f=-1,l=t.length;++f<l;){var s=t[f],c=r?r(e[s],n[s],s,e,n):o;c===o&&(c=n[s]),i?Fn(e,s,c):$t(e,s,c)}return e}function Ra(n,t){return Ln(n,ei(n),t)}function Ia(n,t){return Ln(n,cf(n),t)}function Pe(n,t){return function(e,r){var i=E(e)?Lo:$s,f=t?t():{};return i(e,n,A(r,2),f)}}function St(n){return L(function(t,e){var r=-1,i=e.length,f=i>1?e[i-1]:o,l=i>2?e[2]:o;for(f=n.length>3&&typeof f=="function"?(i--,f):o,l&&Q(e[0],e[1],l)&&(f=i<3?o:f,i=1),t=B(t);++r<i;){var s=e[r];s&&n(t,s,r,f)}return t})}function ku(n,t){return function(e,r){if(e==null)return e;if(!j(e))return n(e,r);for(var i=e.length,f=t?i:-1,l=B(e);(t?f--:++f<i)&&r(l[f],f,l)!==!1;);return e}}function ju(n){return function(t,e,r){for(var i=-1,f=B(t),l=r(t),s=l.length;s--;){var c=l[n?s:++i];if(e(f[c],c,f)===!1)break}return t}}function Sa(n,t,e){var r=t&wn,i=Jt(n);function f(){var l=this&&this!==z&&this instanceof f?i:n;return l.apply(r?e:this,arguments)}return f}function nf(n){return function(t){t=b(t);var e=vt(t)?Rn(t):o,r=e?e[0]:t.charAt(0),i=e?Vn(e,1).join(""):t.slice(1);return r[n]()+i}}function Et(n){return function(t){return Ar(jf(kf(t).replace(ho,"")),n,"")}}function Jt(n){return function(){var t=arguments;switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var e=It(n.prototype),r=n.apply(e,t);return D(r)?r:e}}function Ea(n,t,e){var r=Jt(n);function i(){for(var f=arguments.length,l=h(f),s=f,c=Tt(i);s--;)l[s]=arguments[s];var _=f<3&&l[0]!==c&&l[f-1]!==c?[]:Zn(l,c);if(f-=_.length,f<e)return ff(n,t,Be,i.placeholder,o,l,_,o,o,e-f);var p=this&&this!==z&&this instanceof i?r:n;return en(p,this,l)}return i}function tf(n){return function(t,e,r){var i=B(t);if(!j(t)){var f=A(e,3);t=$(t),e=function(s){return f(i[s],s,i)}}var l=n(t,e,r);return l>-1?i[f?t[l]:l]:o}}function ef(n){return Un(function(t){var e=t.length,r=e,i=gn.prototype.thru;for(n&&t.reverse();r--;){var f=t[r];if(typeof f!="function")throw new hn(sn);if(i&&!l&&De(f)=="wrapper")var l=new gn([],!0)}for(r=l?r:e;++r<e;){f=t[r];var s=De(f),c=s=="wrapper"?ni(f):o;c&&ii(c[0])&&c[1]==(Wn|mn|On|Ot)&&!c[4].length&&c[9]==1?l=l[De(c[0])].apply(l,c[3]):l=f.length==1&&ii(f)?l[s]():l.thru(f)}return function(){var _=arguments,p=_[0];if(l&&_.length==1&&E(p))return l.plant(p).value();for(var v=0,d=e?t[v].apply(this,_):p;++v<e;)d=t[v].call(this,d);return d}})}function Be(n,t,e,r,i,f,l,s,c,_){var p=t&Wn,v=t&wn,d=t&ct,x=t&(mn|Ct),R=t&nr,y=d?o:Jt(n);function I(){for(var C=arguments.length,O=h(C),ln=C;ln--;)O[ln]=arguments[ln];if(x)var V=Tt(I),on=Mo(O,V);if(r&&(O=Qu(O,r,i,x)),f&&(O=Vu(O,f,l,x)),C-=on,x&&C<_){var H=Zn(O,V);return ff(n,t,Be,I.placeholder,e,O,H,s,c,_-C)}var En=v?e:this,Hn=d?En[n]:n;return C=O.length,s?O=$a(O,s):R&&C>1&&O.reverse(),p&&c<C&&(O.length=c),this&&this!==z&&this instanceof I&&(Hn=y||Jt(Hn)),Hn.apply(En,O)}return I}function rf(n,t){return function(e,r){return ks(e,n,t(r),{})}}function Fe(n,t){return function(e,r){var i;if(e===o&&r===o)return t;if(e!==o&&(i=e),r!==o){if(i===o)return r;typeof e=="string"||typeof r=="string"?(e=un(e),r=un(r)):(e=qu(e),r=qu(r)),i=n(e,r)}return i}}function Qr(n){return Un(function(t){return t=U(t,rn(A())),L(function(e){var r=this;return n(t,function(i){return en(i,r,e)})})})}function Me(n,t){t=t===o?" ":un(t);var e=t.length;if(e<2)return e?Kr(t,n):t;var r=Kr(t,Ie(n/dt(t)));return vt(t)?Vn(Rn(r),0,n).join(""):r.slice(0,n)}function Ta(n,t,e,r){var i=t&wn,f=Jt(n);function l(){for(var s=-1,c=arguments.length,_=-1,p=r.length,v=h(p+c),d=this&&this!==z&&this instanceof l?f:n;++_<p;)v[_]=r[_];for(;c--;)v[_++]=arguments[++s];return en(d,i?e:this,v)}return l}function uf(n){return function(t,e,r){return r&&typeof r!="number"&&Q(t,e,r)&&(e=r=o),t=Gn(t),e===o?(e=t,t=0):e=Gn(e),r=r===o?t<e?1:-1:Gn(r),aa(t,e,r,n)}}function Ue(n){return function(t,e){return typeof t=="string"&&typeof e=="string"||(t=dn(t),e=dn(e)),n(t,e)}}function ff(n,t,e,r,i,f,l,s,c,_){var p=t&mn,v=p?l:o,d=p?o:l,x=p?f:o,R=p?o:f;t|=p?On:mt,t&=~(p?mt:On),t&Si||(t&=-4);var y=[n,t,i,x,v,R,d,s,c,_],I=e.apply(o,y);return ii(n)&&wf(I,y),I.placeholder=r,xf(I,n,t)}function Vr(n){var t=q[n];return function(e,r){if(e=dn(e),r=r==null?0:Y(T(r),292),r&&wu(e)){var i=(b(e)+"e").split("e"),f=t(i[0]+"e"+(+i[1]+r));return i=(b(f)+"e").split("e"),+(i[0]+"e"+(+i[1]-r))}return t(e)}}var ya=At&&1/he(new At([,-0]))[1]==jn?function(n){return new At(n)}:xi;function lf(n){return function(t){var e=X(t);return e==xn?Lr(t):e==An?Ko(t):Fo(t,n(t))}}function Mn(n,t,e,r,i,f,l,s){var c=t&ct;if(!c&&typeof n!="function")throw new hn(sn);var _=r?r.length:0;if(_||(t&=-97,r=i=o),l=l===o?l:K(T(l),0),s=s===o?s:T(s),_-=i?i.length:0,t&mt){var p=r,v=i;r=i=o}var d=c?o:ni(n),x=[n,t,e,r,i,p,v,f,l,s];if(d&&Ha(x,d),n=x[0],t=x[1],e=x[2],r=x[3],i=x[4],s=x[9]=x[9]===o?c?0:n.length:K(x[9]-_,0),!s&&t&(mn|Ct)&&(t&=-25),!t||t==wn)var R=Sa(n,t,e);else t==mn||t==Ct?R=Ea(n,t,s):(t==On||t==(wn|On))&&!i.length?R=Ta(n,t,e,r):R=Be.apply(o,x);var y=d?Gu:wf;return xf(y(R,x),n,t)}function of(n,t,e,r){return n===o||Sn(n,xt[e])&&!P.call(r,e)?t:n}function sf(n,t,e,r,i,f){return D(n)&&D(t)&&(f.set(t,n),Oe(n,t,o,sf,f),f.delete(t)),n}function La(n){return kt(n)?o:n}function af(n,t,e,r,i,f){var l=e&at,s=n.length,c=t.length;if(s!=c&&!(l&&c>s))return!1;var _=f.get(n),p=f.get(t);if(_&&p)return _==t&&p==n;var v=-1,d=!0,x=e&te?new rt:o;for(f.set(n,t),f.set(t,n);++v<s;){var R=n[v],y=t[v];if(r)var I=l?r(y,R,v,t,n,f):r(R,y,v,n,t,f);if(I!==o){if(I)continue;d=!1;break}if(x){if(!Rr(t,function(C,O){if(!Dt(x,O)&&(R===C||i(R,C,e,r,f)))return x.push(O)})){d=!1;break}}else if(!(R===y||i(R,y,e,r,f))){d=!1;break}}return f.delete(n),f.delete(t),d}function Ca(n,t,e,r,i,f,l){switch(e){case gt:if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)return!1;n=n.buffer,t=t.buffer;case Ut:return!(n.byteLength!=t.byteLength||!f(new we(n),new we(t)));case Wt:case bt:case Pt:return Sn(+n,+t);case ie:return n.name==t.name&&n.message==t.message;case Bt:case Ft:return n==t+"";case xn:var s=Lr;case An:var c=r&at;if(s||(s=he),n.size!=t.size&&!c)return!1;var _=l.get(n);if(_)return _==t;r|=te,l.set(n,t);var p=af(s(n),s(t),r,i,f,l);return l.delete(n),p;case fe:if(Kt)return Kt.call(n)==Kt.call(t)}return!1}function ma(n,t,e,r,i,f){var l=e&at,s=kr(n),c=s.length,_=kr(t),p=_.length;if(c!=p&&!l)return!1;for(var v=c;v--;){var d=s[v];if(!(l?d in t:P.call(t,d)))return!1}var x=f.get(n),R=f.get(t);if(x&&R)return x==t&&R==n;var y=!0;f.set(n,t),f.set(t,n);for(var I=l;++v<c;){d=s[v];var C=n[d],O=t[d];if(r)var ln=l?r(O,C,d,t,n,f):r(C,O,d,n,t,f);if(!(ln===o?C===O||i(C,O,e,r,f):ln)){y=!1;break}I||(I=d=="constructor")}if(y&&!I){var V=n.constructor,on=t.constructor;V!=on&&"constructor"in n&&"constructor"in t&&!(typeof V=="function"&&V instanceof V&&typeof on=="function"&&on instanceof on)&&(y=!1)}return f.delete(n),f.delete(t),y}function Un(n){return fi(vf(n,o,Tf),n+"")}function kr(n){return mu(n,$,ei)}function jr(n){return mu(n,nn,cf)}var ni=Ee?function(n){return Ee.get(n)}:xi;function De(n){for(var t=n.name+"",e=Rt[t],r=P.call(Rt,t)?e.length:0;r--;){var i=e[r],f=i.func;if(f==null||f==n)return i.name}return t}function Tt(n){var t=P.call(u,"placeholder")?u:n;return t.placeholder}function A(){var n=u.iteratee||di;return n=n===di?bu:n,arguments.length?n(arguments[0],arguments[1]):n}function Ne(n,t){var e=n.__data__;return Ua(t)?e[typeof t=="string"?"string":"hash"]:e.map}function ti(n){for(var t=$(n),e=t.length;e--;){var r=t[e],i=n[r];t[e]=[r,i,_f(i)]}return t}function ft(n,t){var e=Go(n,t);return Wu(e)?e:o}function Oa(n){var t=P.call(n,tt),e=n[tt];try{n[tt]=o;var r=!0}catch{}var i=ve.call(n);return r&&(t?n[tt]=e:delete n[tt]),i}var ei=mr?function(n){return n==null?[]:(n=B(n),$n(mr(n),function(t){return vu.call(n,t)}))}:Ai,cf=mr?function(n){for(var t=[];n;)zn(t,ei(n)),n=xe(n);return t}:Ai,X=J;(Or&&X(new Or(new ArrayBuffer(1)))!=gt||Gt&&X(new Gt)!=xn||Wr&&X(Wr.resolve())!=yi||At&&X(new At)!=An||Ht&&X(new Ht)!=Mt)&&(X=function(n){var t=J(n),e=t==bn?n.constructor:o,r=e?lt(e):"";if(r)switch(r){case hs:return gt;case gs:return xn;case _s:return yi;case ps:return An;case vs:return Mt}return t});function Wa(n,t,e){for(var r=-1,i=e.length;++r<i;){var f=e[r],l=f.size;switch(f.type){case"drop":n+=l;break;case"dropRight":t-=l;break;case"take":t=Y(t,n+l);break;case"takeRight":n=K(n,t-l);break}}return{start:n,end:t}}function ba(n){var t=n.match(Ul);return t?t[1].split(Dl):[]}function hf(n,t,e){t=Qn(t,n);for(var r=-1,i=t.length,f=!1;++r<i;){var l=Cn(t[r]);if(!(f=n!=null&&e(n,l)))break;n=n[l]}return f||++r!=i?f:(i=n==null?0:n.length,!!i&&Ze(i)&&Dn(l,i)&&(E(n)||ot(n)))}function Pa(n){var t=n.length,e=new n.constructor(t);return t&&typeof n[0]=="string"&&P.call(n,"index")&&(e.index=n.index,e.input=n.input),e}function gf(n){return typeof n.constructor=="function"&&!Qt(n)?It(xe(n)):{}}function Ba(n,t,e){var r=n.constructor;switch(t){case Ut:return Jr(n);case Wt:case bt:return new r(+n);case gt:return da(n,e);case tr:case er:case rr:case ir:case ur:case fr:case lr:case or:case sr:return Xu(n,e);case xn:return new r;case Pt:case Ft:return new r(n);case Bt:return wa(n);case An:return new r;case fe:return xa(n)}}function Fa(n,t){var e=t.length;if(!e)return n;var r=e-1;return t[r]=(e>1?"& ":"")+t[r],t=t.join(e>2?", ":" "),n.replace(Ml,`{
9
- /* [wrapped with `+t+`] */
10
- `)}function Ma(n){return E(n)||ot(n)||!!(du&&n&&n[du])}function Dn(n,t){var e=typeof n;return t=t??Kn,!!t&&(e=="number"||e!="symbol"&&Yl.test(n))&&n>-1&&n%1==0&&n<t}function Q(n,t,e){if(!D(e))return!1;var r=typeof t;return(r=="number"?j(e)&&Dn(t,e.length):r=="string"&&t in e)?Sn(e[t],n):!1}function ri(n,t){if(E(n))return!1;var e=typeof n;return e=="number"||e=="symbol"||e=="boolean"||n==null||fn(n)?!0:bl.test(n)||!Wl.test(n)||t!=null&&n in B(t)}function Ua(n){var t=typeof n;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?n!=="__proto__":n===null}function ii(n){var t=De(n),e=u[t];if(typeof e!="function"||!(t in m.prototype))return!1;if(n===e)return!0;var r=ni(e);return!!r&&n===r[0]}function Da(n){return!!gu&&gu in n}var Na=_e?Nn:Ri;function Qt(n){var t=n&&n.constructor,e=typeof t=="function"&&t.prototype||xt;return n===e}function _f(n){return n===n&&!D(n)}function pf(n,t){return function(e){return e==null?!1:e[n]===t&&(t!==o||n in B(e))}}function Ga(n){var t=$e(n,function(r){return e.size===ll&&e.clear(),r}),e=t.cache;return t}function Ha(n,t){var e=n[1],r=t[1],i=e|r,f=i<(wn|ct|Wn),l=r==Wn&&e==mn||r==Wn&&e==Ot&&n[7].length<=t[8]||r==(Wn|Ot)&&t[7].length<=t[8]&&e==mn;if(!(f||l))return n;r&wn&&(n[2]=t[2],i|=e&wn?0:Si);var s=t[3];if(s){var c=n[3];n[3]=c?Qu(c,s,t[4]):s,n[4]=c?Zn(n[3],ne):t[4]}return s=t[5],s&&(c=n[5],n[5]=c?Vu(c,s,t[6]):s,n[6]=c?Zn(n[5],ne):t[6]),s=t[7],s&&(n[7]=s),r&Wn&&(n[8]=n[8]==null?t[8]:Y(n[8],t[8])),n[9]==null&&(n[9]=t[9]),n[0]=t[0],n[1]=i,n}function qa(n){var t=[];if(n!=null)for(var e in B(n))t.push(e);return t}function Ka(n){return ve.call(n)}function vf(n,t,e){return t=K(t===o?n.length-1:t,0),function(){for(var r=arguments,i=-1,f=K(r.length-t,0),l=h(f);++i<f;)l[i]=r[t+i];i=-1;for(var s=h(t+1);++i<t;)s[i]=r[i];return s[t]=e(l),en(n,this,s)}}function df(n,t){return t.length<2?n:ut(n,pn(t,0,-1))}function $a(n,t){for(var e=n.length,r=Y(t.length,e),i=k(n);r--;){var f=t[r];n[r]=Dn(f,e)?i[f]:o}return n}function ui(n,t){if(!(t==="constructor"&&typeof n[t]=="function")&&t!="__proto__")return n[t]}var wf=Af(Gu),Vt=us||function(n,t){return z.setTimeout(n,t)},fi=Af(ga);function xf(n,t,e){var r=t+"";return fi(n,Fa(r,za(ba(r),e)))}function Af(n){var t=0,e=0;return function(){var r=ss(),i=cl-(r-e);if(e=r,i>0){if(++t>=al)return arguments[0]}else t=0;return n.apply(o,arguments)}}function Ge(n,t){var e=-1,r=n.length,i=r-1;for(t=t===o?r:t;++e<t;){var f=qr(e,i),l=n[f];n[f]=n[e],n[e]=l}return n.length=t,n}var Rf=Ga(function(n){var t=[];return n.charCodeAt(0)===46&&t.push(""),n.replace(Pl,function(e,r,i,f){t.push(i?f.replace(Hl,"$1"):r||e)}),t});function Cn(n){if(typeof n=="string"||fn(n))return n;var t=n+"";return t=="0"&&1/n==-jn?"-0":t}function lt(n){if(n!=null){try{return pe.call(n)}catch{}try{return n+""}catch{}}return""}function za(n,t){return cn(dl,function(e){var r="_."+e[0];t&e[1]&&!ae(n,r)&&n.push(r)}),n.sort()}function If(n){if(n instanceof m)return n.clone();var t=new gn(n.__wrapped__,n.__chain__);return t.__actions__=k(n.__actions__),t.__index__=n.__index__,t.__values__=n.__values__,t}function Za(n,t,e){(e?Q(n,t,e):t===o)?t=1:t=K(T(t),0);var r=n==null?0:n.length;if(!r||t<1)return[];for(var i=0,f=0,l=h(Ie(r/t));i<r;)l[f++]=pn(n,i,i+=t);return l}function Ya(n){for(var t=-1,e=n==null?0:n.length,r=0,i=[];++t<e;){var f=n[t];f&&(i[r++]=f)}return i}function Xa(){var n=arguments.length;if(!n)return[];for(var t=h(n-1),e=arguments[0],r=n;r--;)t[r-1]=arguments[r];return zn(E(e)?k(e):[e],Z(t,1))}var Ja=L(function(n,t){return G(n)?zt(n,Z(t,1,G,!0)):[]}),Qa=L(function(n,t){var e=vn(t);return G(e)&&(e=o),G(n)?zt(n,Z(t,1,G,!0),A(e,2)):[]}),Va=L(function(n,t){var e=vn(t);return G(e)&&(e=o),G(n)?zt(n,Z(t,1,G,!0),o,e):[]});function ka(n,t,e){var r=n==null?0:n.length;return r?(t=e||t===o?1:T(t),pn(n,t<0?0:t,r)):[]}function ja(n,t,e){var r=n==null?0:n.length;return r?(t=e||t===o?1:T(t),t=r-t,pn(n,0,t<0?0:t)):[]}function nc(n,t){return n&&n.length?be(n,A(t,3),!0,!0):[]}function tc(n,t){return n&&n.length?be(n,A(t,3),!0):[]}function ec(n,t,e,r){var i=n==null?0:n.length;return i?(e&&typeof e!="number"&&Q(n,t,e)&&(e=0,r=i),Xs(n,t,e,r)):[]}function Sf(n,t,e){var r=n==null?0:n.length;if(!r)return-1;var i=e==null?0:T(e);return i<0&&(i=K(r+i,0)),ce(n,A(t,3),i)}function Ef(n,t,e){var r=n==null?0:n.length;if(!r)return-1;var i=r-1;return e!==o&&(i=T(e),i=e<0?K(r+i,0):Y(i,r-1)),ce(n,A(t,3),i,!0)}function Tf(n){var t=n==null?0:n.length;return t?Z(n,1):[]}function rc(n){var t=n==null?0:n.length;return t?Z(n,jn):[]}function ic(n,t){var e=n==null?0:n.length;return e?(t=t===o?1:T(t),Z(n,t)):[]}function uc(n){for(var t=-1,e=n==null?0:n.length,r={};++t<e;){var i=n[t];r[i[0]]=i[1]}return r}function yf(n){return n&&n.length?n[0]:o}function fc(n,t,e){var r=n==null?0:n.length;if(!r)return-1;var i=e==null?0:T(e);return i<0&&(i=K(r+i,0)),pt(n,t,i)}function lc(n){var t=n==null?0:n.length;return t?pn(n,0,-1):[]}var oc=L(function(n){var t=U(n,Yr);return t.length&&t[0]===n[0]?Ur(t):[]}),sc=L(function(n){var t=vn(n),e=U(n,Yr);return t===vn(e)?t=o:e.pop(),e.length&&e[0]===n[0]?Ur(e,A(t,2)):[]}),ac=L(function(n){var t=vn(n),e=U(n,Yr);return t=typeof t=="function"?t:o,t&&e.pop(),e.length&&e[0]===n[0]?Ur(e,o,t):[]});function cc(n,t){return n==null?"":ls.call(n,t)}function vn(n){var t=n==null?0:n.length;return t?n[t-1]:o}function hc(n,t,e){var r=n==null?0:n.length;if(!r)return-1;var i=r;return e!==o&&(i=T(e),i=i<0?K(r+i,0):Y(i,r-1)),t===t?zo(n,t,i):ce(n,uu,i,!0)}function gc(n,t){return n&&n.length?Mu(n,T(t)):o}var _c=L(Lf);function Lf(n,t){return n&&n.length&&t&&t.length?Hr(n,t):n}function pc(n,t,e){return n&&n.length&&t&&t.length?Hr(n,t,A(e,2)):n}function vc(n,t,e){return n&&n.length&&t&&t.length?Hr(n,t,o,e):n}var dc=Un(function(n,t){var e=n==null?0:n.length,r=Pr(n,t);return Nu(n,U(t,function(i){return Dn(i,e)?+i:i}).sort(Ju)),r});function wc(n,t){var e=[];if(!(n&&n.length))return e;var r=-1,i=[],f=n.length;for(t=A(t,3);++r<f;){var l=n[r];t(l,r,n)&&(e.push(l),i.push(r))}return Nu(n,i),e}function li(n){return n==null?n:cs.call(n)}function xc(n,t,e){var r=n==null?0:n.length;return r?(e&&typeof e!="number"&&Q(n,t,e)?(t=0,e=r):(t=t==null?0:T(t),e=e===o?r:T(e)),pn(n,t,e)):[]}function Ac(n,t){return We(n,t)}function Rc(n,t,e){return $r(n,t,A(e,2))}function Ic(n,t){var e=n==null?0:n.length;if(e){var r=We(n,t);if(r<e&&Sn(n[r],t))return r}return-1}function Sc(n,t){return We(n,t,!0)}function Ec(n,t,e){return $r(n,t,A(e,2),!0)}function Tc(n,t){var e=n==null?0:n.length;if(e){var r=We(n,t,!0)-1;if(Sn(n[r],t))return r}return-1}function yc(n){return n&&n.length?Hu(n):[]}function Lc(n,t){return n&&n.length?Hu(n,A(t,2)):[]}function Cc(n){var t=n==null?0:n.length;return t?pn(n,1,t):[]}function mc(n,t,e){return n&&n.length?(t=e||t===o?1:T(t),pn(n,0,t<0?0:t)):[]}function Oc(n,t,e){var r=n==null?0:n.length;return r?(t=e||t===o?1:T(t),t=r-t,pn(n,t<0?0:t,r)):[]}function Wc(n,t){return n&&n.length?be(n,A(t,3),!1,!0):[]}function bc(n,t){return n&&n.length?be(n,A(t,3)):[]}var Pc=L(function(n){return Jn(Z(n,1,G,!0))}),Bc=L(function(n){var t=vn(n);return G(t)&&(t=o),Jn(Z(n,1,G,!0),A(t,2))}),Fc=L(function(n){var t=vn(n);return t=typeof t=="function"?t:o,Jn(Z(n,1,G,!0),o,t)});function Mc(n){return n&&n.length?Jn(n):[]}function Uc(n,t){return n&&n.length?Jn(n,A(t,2)):[]}function Dc(n,t){return t=typeof t=="function"?t:o,n&&n.length?Jn(n,o,t):[]}function oi(n){if(!(n&&n.length))return[];var t=0;return n=$n(n,function(e){if(G(e))return t=K(e.length,t),!0}),Tr(t,function(e){return U(n,Ir(e))})}function Cf(n,t){if(!(n&&n.length))return[];var e=oi(n);return t==null?e:U(e,function(r){return en(t,o,r)})}var Nc=L(function(n,t){return G(n)?zt(n,t):[]}),Gc=L(function(n){return Zr($n(n,G))}),Hc=L(function(n){var t=vn(n);return G(t)&&(t=o),Zr($n(n,G),A(t,2))}),qc=L(function(n){var t=vn(n);return t=typeof t=="function"?t:o,Zr($n(n,G),o,t)}),Kc=L(oi);function $c(n,t){return zu(n||[],t||[],$t)}function zc(n,t){return zu(n||[],t||[],Xt)}var Zc=L(function(n){var t=n.length,e=t>1?n[t-1]:o;return e=typeof e=="function"?(n.pop(),e):o,Cf(n,e)});function mf(n){var t=u(n);return t.__chain__=!0,t}function Yc(n,t){return t(n),n}function He(n,t){return t(n)}var Xc=Un(function(n){var t=n.length,e=t?n[0]:0,r=this.__wrapped__,i=function(f){return Pr(f,n)};return t>1||this.__actions__.length||!(r instanceof m)||!Dn(e)?this.thru(i):(r=r.slice(e,+e+(t?1:0)),r.__actions__.push({func:He,args:[i],thisArg:o}),new gn(r,this.__chain__).thru(function(f){return t&&!f.length&&f.push(o),f}))});function Jc(){return mf(this)}function Qc(){return new gn(this.value(),this.__chain__)}function Vc(){this.__values__===o&&(this.__values__=Kf(this.value()));var n=this.__index__>=this.__values__.length,t=n?o:this.__values__[this.__index__++];return{done:n,value:t}}function kc(){return this}function jc(n){for(var t,e=this;e instanceof ye;){var r=If(e);r.__index__=0,r.__values__=o,t?i.__wrapped__=r:t=r;var i=r;e=e.__wrapped__}return i.__wrapped__=n,t}function nh(){var n=this.__wrapped__;if(n instanceof m){var t=n;return this.__actions__.length&&(t=new m(this)),t=t.reverse(),t.__actions__.push({func:He,args:[li],thisArg:o}),new gn(t,this.__chain__)}return this.thru(li)}function th(){return $u(this.__wrapped__,this.__actions__)}var eh=Pe(function(n,t,e){P.call(n,e)?++n[e]:Fn(n,e,1)});function rh(n,t,e){var r=E(n)?ru:Ys;return e&&Q(n,t,e)&&(t=o),r(n,A(t,3))}function ih(n,t){var e=E(n)?$n:Lu;return e(n,A(t,3))}var uh=tf(Sf),fh=tf(Ef);function lh(n,t){return Z(qe(n,t),1)}function oh(n,t){return Z(qe(n,t),jn)}function sh(n,t,e){return e=e===o?1:T(e),Z(qe(n,t),e)}function Of(n,t){var e=E(n)?cn:Xn;return e(n,A(t,3))}function Wf(n,t){var e=E(n)?Co:yu;return e(n,A(t,3))}var ah=Pe(function(n,t,e){P.call(n,e)?n[e].push(t):Fn(n,e,[t])});function ch(n,t,e,r){n=j(n)?n:Lt(n),e=e&&!r?T(e):0;var i=n.length;return e<0&&(e=K(i+e,0)),Ye(n)?e<=i&&n.indexOf(t,e)>-1:!!i&&pt(n,t,e)>-1}var hh=L(function(n,t,e){var r=-1,i=typeof t=="function",f=j(n)?h(n.length):[];return Xn(n,function(l){f[++r]=i?en(t,l,e):Zt(l,t,e)}),f}),gh=Pe(function(n,t,e){Fn(n,e,t)});function qe(n,t){var e=E(n)?U:Pu;return e(n,A(t,3))}function _h(n,t,e,r){return n==null?[]:(E(t)||(t=t==null?[]:[t]),e=r?o:e,E(e)||(e=e==null?[]:[e]),Uu(n,t,e))}var ph=Pe(function(n,t,e){n[e?0:1].push(t)},function(){return[[],[]]});function vh(n,t,e){var r=E(n)?Ar:lu,i=arguments.length<3;return r(n,A(t,4),e,i,Xn)}function dh(n,t,e){var r=E(n)?mo:lu,i=arguments.length<3;return r(n,A(t,4),e,i,yu)}function wh(n,t){var e=E(n)?$n:Lu;return e(n,ze(A(t,3)))}function xh(n){var t=E(n)?Iu:ca;return t(n)}function Ah(n,t,e){(e?Q(n,t,e):t===o)?t=1:t=T(t);var r=E(n)?qs:ha;return r(n,t)}function Rh(n){var t=E(n)?Ks:_a;return t(n)}function Ih(n){if(n==null)return 0;if(j(n))return Ye(n)?dt(n):n.length;var t=X(n);return t==xn||t==An?n.size:Nr(n).length}function Sh(n,t,e){var r=E(n)?Rr:pa;return e&&Q(n,t,e)&&(t=o),r(n,A(t,3))}var Eh=L(function(n,t){if(n==null)return[];var e=t.length;return e>1&&Q(n,t[0],t[1])?t=[]:e>2&&Q(t[0],t[1],t[2])&&(t=[t[0]]),Uu(n,Z(t,1),[])}),Ke=is||function(){return z.Date.now()};function Th(n,t){if(typeof t!="function")throw new hn(sn);return n=T(n),function(){if(--n<1)return t.apply(this,arguments)}}function bf(n,t,e){return t=e?o:t,t=n&&t==null?n.length:t,Mn(n,Wn,o,o,o,o,t)}function Pf(n,t){var e;if(typeof t!="function")throw new hn(sn);return n=T(n),function(){return--n>0&&(e=t.apply(this,arguments)),n<=1&&(t=o),e}}var si=L(function(n,t,e){var r=wn;if(e.length){var i=Zn(e,Tt(si));r|=On}return Mn(n,r,t,e,i)}),Bf=L(function(n,t,e){var r=wn|ct;if(e.length){var i=Zn(e,Tt(Bf));r|=On}return Mn(t,r,n,e,i)});function Ff(n,t,e){t=e?o:t;var r=Mn(n,mn,o,o,o,o,o,t);return r.placeholder=Ff.placeholder,r}function Mf(n,t,e){t=e?o:t;var r=Mn(n,Ct,o,o,o,o,o,t);return r.placeholder=Mf.placeholder,r}function Uf(n,t,e){var r,i,f,l,s,c,_=0,p=!1,v=!1,d=!0;if(typeof n!="function")throw new hn(sn);t=dn(t)||0,D(e)&&(p=!!e.leading,v="maxWait"in e,f=v?K(dn(e.maxWait)||0,t):f,d="trailing"in e?!!e.trailing:d);function x(H){var En=r,Hn=i;return r=i=o,_=H,l=n.apply(Hn,En),l}function R(H){return _=H,s=Vt(C,t),p?x(H):l}function y(H){var En=H-c,Hn=H-_,el=t-En;return v?Y(el,f-Hn):el}function I(H){var En=H-c,Hn=H-_;return c===o||En>=t||En<0||v&&Hn>=f}function C(){var H=Ke();if(I(H))return O(H);s=Vt(C,y(H))}function O(H){return s=o,d&&r?x(H):(r=i=o,l)}function ln(){s!==o&&Zu(s),_=0,r=c=i=s=o}function V(){return s===o?l:O(Ke())}function on(){var H=Ke(),En=I(H);if(r=arguments,i=this,c=H,En){if(s===o)return R(c);if(v)return Zu(s),s=Vt(C,t),x(c)}return s===o&&(s=Vt(C,t)),l}return on.cancel=ln,on.flush=V,on}var yh=L(function(n,t){return Tu(n,1,t)}),Lh=L(function(n,t,e){return Tu(n,dn(t)||0,e)});function Ch(n){return Mn(n,nr)}function $e(n,t){if(typeof n!="function"||t!=null&&typeof t!="function")throw new hn(sn);var e=function(){var r=arguments,i=t?t.apply(this,r):r[0],f=e.cache;if(f.has(i))return f.get(i);var l=n.apply(this,r);return e.cache=f.set(i,l)||f,l};return e.cache=new($e.Cache||Bn),e}$e.Cache=Bn;function ze(n){if(typeof n!="function")throw new hn(sn);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function mh(n){return Pf(2,n)}var Oh=va(function(n,t){t=t.length==1&&E(t[0])?U(t[0],rn(A())):U(Z(t,1),rn(A()));var e=t.length;return L(function(r){for(var i=-1,f=Y(r.length,e);++i<f;)r[i]=t[i].call(this,r[i]);return en(n,this,r)})}),ai=L(function(n,t){var e=Zn(t,Tt(ai));return Mn(n,On,o,t,e)}),Df=L(function(n,t){var e=Zn(t,Tt(Df));return Mn(n,mt,o,t,e)}),Wh=Un(function(n,t){return Mn(n,Ot,o,o,o,t)});function bh(n,t){if(typeof n!="function")throw new hn(sn);return t=t===o?t:T(t),L(n,t)}function Ph(n,t){if(typeof n!="function")throw new hn(sn);return t=t==null?0:K(T(t),0),L(function(e){var r=e[t],i=Vn(e,0,t);return r&&zn(i,r),en(n,this,i)})}function Bh(n,t,e){var r=!0,i=!0;if(typeof n!="function")throw new hn(sn);return D(e)&&(r="leading"in e?!!e.leading:r,i="trailing"in e?!!e.trailing:i),Uf(n,t,{leading:r,maxWait:t,trailing:i})}function Fh(n){return bf(n,1)}function Mh(n,t){return ai(Xr(t),n)}function Uh(){if(!arguments.length)return[];var n=arguments[0];return E(n)?n:[n]}function Dh(n){return _n(n,st)}function Nh(n,t){return t=typeof t=="function"?t:o,_n(n,st,t)}function Gh(n){return _n(n,qn|st)}function Hh(n,t){return t=typeof t=="function"?t:o,_n(n,qn|st,t)}function qh(n,t){return t==null||Eu(n,t,$(t))}function Sn(n,t){return n===t||n!==n&&t!==t}var Kh=Ue(Mr),$h=Ue(function(n,t){return n>=t}),ot=Ou((function(){return arguments})())?Ou:function(n){return N(n)&&P.call(n,"callee")&&!vu.call(n,"callee")},E=h.isArray,zh=Vi?rn(Vi):js;function j(n){return n!=null&&Ze(n.length)&&!Nn(n)}function G(n){return N(n)&&j(n)}function Zh(n){return n===!0||n===!1||N(n)&&J(n)==Wt}var kn=fs||Ri,Yh=ki?rn(ki):na;function Xh(n){return N(n)&&n.nodeType===1&&!kt(n)}function Jh(n){if(n==null)return!0;if(j(n)&&(E(n)||typeof n=="string"||typeof n.splice=="function"||kn(n)||yt(n)||ot(n)))return!n.length;var t=X(n);if(t==xn||t==An)return!n.size;if(Qt(n))return!Nr(n).length;for(var e in n)if(P.call(n,e))return!1;return!0}function Qh(n,t){return Yt(n,t)}function Vh(n,t,e){e=typeof e=="function"?e:o;var r=e?e(n,t):o;return r===o?Yt(n,t,o,e):!!r}function ci(n){if(!N(n))return!1;var t=J(n);return t==ie||t==xl||typeof n.message=="string"&&typeof n.name=="string"&&!kt(n)}function kh(n){return typeof n=="number"&&wu(n)}function Nn(n){if(!D(n))return!1;var t=J(n);return t==ue||t==Ti||t==wl||t==Rl}function Nf(n){return typeof n=="number"&&n==T(n)}function Ze(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Kn}function D(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}function N(n){return n!=null&&typeof n=="object"}var Gf=ji?rn(ji):ea;function jh(n,t){return n===t||Dr(n,t,ti(t))}function ng(n,t,e){return e=typeof e=="function"?e:o,Dr(n,t,ti(t),e)}function tg(n){return Hf(n)&&n!=+n}function eg(n){if(Na(n))throw new S(ul);return Wu(n)}function rg(n){return n===null}function ig(n){return n==null}function Hf(n){return typeof n=="number"||N(n)&&J(n)==Pt}function kt(n){if(!N(n)||J(n)!=bn)return!1;var t=xe(n);if(t===null)return!0;var e=P.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&pe.call(e)==ns}var hi=nu?rn(nu):ra;function ug(n){return Nf(n)&&n>=-Kn&&n<=Kn}var qf=tu?rn(tu):ia;function Ye(n){return typeof n=="string"||!E(n)&&N(n)&&J(n)==Ft}function fn(n){return typeof n=="symbol"||N(n)&&J(n)==fe}var yt=eu?rn(eu):ua;function fg(n){return n===o}function lg(n){return N(n)&&X(n)==Mt}function og(n){return N(n)&&J(n)==Sl}var sg=Ue(Gr),ag=Ue(function(n,t){return n<=t});function Kf(n){if(!n)return[];if(j(n))return Ye(n)?Rn(n):k(n);if(Nt&&n[Nt])return qo(n[Nt]());var t=X(n),e=t==xn?Lr:t==An?he:Lt;return e(n)}function Gn(n){if(!n)return n===0?n:0;if(n=dn(n),n===jn||n===-jn){var t=n<0?-1:1;return t*_l}return n===n?n:0}function T(n){var t=Gn(n),e=t%1;return t===t?e?t-e:t:0}function $f(n){return n?it(T(n),0,Tn):0}function dn(n){if(typeof n=="number")return n;if(fn(n))return ee;if(D(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=D(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=ou(n);var e=$l.test(n);return e||Zl.test(n)?To(n.slice(2),e?2:8):Kl.test(n)?ee:+n}function zf(n){return Ln(n,nn(n))}function cg(n){return n?it(T(n),-Kn,Kn):n===0?n:0}function b(n){return n==null?"":un(n)}var hg=St(function(n,t){if(Qt(t)||j(t)){Ln(t,$(t),n);return}for(var e in t)P.call(t,e)&&$t(n,e,t[e])}),Zf=St(function(n,t){Ln(t,nn(t),n)}),Xe=St(function(n,t,e,r){Ln(t,nn(t),n,r)}),gg=St(function(n,t,e,r){Ln(t,$(t),n,r)}),_g=Un(Pr);function pg(n,t){var e=It(n);return t==null?e:Su(e,t)}var vg=L(function(n,t){n=B(n);var e=-1,r=t.length,i=r>2?t[2]:o;for(i&&Q(t[0],t[1],i)&&(r=1);++e<r;)for(var f=t[e],l=nn(f),s=-1,c=l.length;++s<c;){var _=l[s],p=n[_];(p===o||Sn(p,xt[_])&&!P.call(n,_))&&(n[_]=f[_])}return n}),dg=L(function(n){return n.push(o,sf),en(Yf,o,n)});function wg(n,t){return iu(n,A(t,3),yn)}function xg(n,t){return iu(n,A(t,3),Fr)}function Ag(n,t){return n==null?n:Br(n,A(t,3),nn)}function Rg(n,t){return n==null?n:Cu(n,A(t,3),nn)}function Ig(n,t){return n&&yn(n,A(t,3))}function Sg(n,t){return n&&Fr(n,A(t,3))}function Eg(n){return n==null?[]:me(n,$(n))}function Tg(n){return n==null?[]:me(n,nn(n))}function gi(n,t,e){var r=n==null?o:ut(n,t);return r===o?e:r}function yg(n,t){return n!=null&&hf(n,t,Js)}function _i(n,t){return n!=null&&hf(n,t,Qs)}var Lg=rf(function(n,t,e){t!=null&&typeof t.toString!="function"&&(t=ve.call(t)),n[t]=e},vi(tn)),Cg=rf(function(n,t,e){t!=null&&typeof t.toString!="function"&&(t=ve.call(t)),P.call(n,t)?n[t].push(e):n[t]=[e]},A),mg=L(Zt);function $(n){return j(n)?Ru(n):Nr(n)}function nn(n){return j(n)?Ru(n,!0):fa(n)}function Og(n,t){var e={};return t=A(t,3),yn(n,function(r,i,f){Fn(e,t(r,i,f),r)}),e}function Wg(n,t){var e={};return t=A(t,3),yn(n,function(r,i,f){Fn(e,i,t(r,i,f))}),e}var bg=St(function(n,t,e){Oe(n,t,e)}),Yf=St(function(n,t,e,r){Oe(n,t,e,r)}),Pg=Un(function(n,t){var e={};if(n==null)return e;var r=!1;t=U(t,function(f){return f=Qn(f,n),r||(r=f.length>1),f}),Ln(n,jr(n),e),r&&(e=_n(e,qn|Ii|st,La));for(var i=t.length;i--;)zr(e,t[i]);return e});function Bg(n,t){return Xf(n,ze(A(t)))}var Fg=Un(function(n,t){return n==null?{}:oa(n,t)});function Xf(n,t){if(n==null)return{};var e=U(jr(n),function(r){return[r]});return t=A(t),Du(n,e,function(r,i){return t(r,i[0])})}function Mg(n,t,e){t=Qn(t,n);var r=-1,i=t.length;for(i||(i=1,n=o);++r<i;){var f=n==null?o:n[Cn(t[r])];f===o&&(r=i,f=e),n=Nn(f)?f.call(n):f}return n}function Ug(n,t,e){return n==null?n:Xt(n,t,e)}function Dg(n,t,e,r){return r=typeof r=="function"?r:o,n==null?n:Xt(n,t,e,r)}var Jf=lf($),Qf=lf(nn);function Ng(n,t,e){var r=E(n),i=r||kn(n)||yt(n);if(t=A(t,4),e==null){var f=n&&n.constructor;i?e=r?new f:[]:D(n)?e=Nn(f)?It(xe(n)):{}:e={}}return(i?cn:yn)(n,function(l,s,c){return t(e,l,s,c)}),e}function Gg(n,t){return n==null?!0:zr(n,t)}function Hg(n,t,e){return n==null?n:Ku(n,t,Xr(e))}function qg(n,t,e,r){return r=typeof r=="function"?r:o,n==null?n:Ku(n,t,Xr(e),r)}function Lt(n){return n==null?[]:yr(n,$(n))}function Kg(n){return n==null?[]:yr(n,nn(n))}function $g(n,t,e){return e===o&&(e=t,t=o),e!==o&&(e=dn(e),e=e===e?e:0),t!==o&&(t=dn(t),t=t===t?t:0),it(dn(n),t,e)}function zg(n,t,e){return t=Gn(t),e===o?(e=t,t=0):e=Gn(e),n=dn(n),Vs(n,t,e)}function Zg(n,t,e){if(e&&typeof e!="boolean"&&Q(n,t,e)&&(t=e=o),e===o&&(typeof t=="boolean"?(e=t,t=o):typeof n=="boolean"&&(e=n,n=o)),n===o&&t===o?(n=0,t=1):(n=Gn(n),t===o?(t=n,n=0):t=Gn(t)),n>t){var r=n;n=t,t=r}if(e||n%1||t%1){var i=xu();return Y(n+i*(t-n+Eo("1e-"+((i+"").length-1))),t)}return qr(n,t)}var Yg=Et(function(n,t,e){return t=t.toLowerCase(),n+(e?Vf(t):t)});function Vf(n){return pi(b(n).toLowerCase())}function kf(n){return n=b(n),n&&n.replace(Xl,Uo).replace(go,"")}function Xg(n,t,e){n=b(n),t=un(t);var r=n.length;e=e===o?r:it(T(e),0,r);var i=e;return e-=t.length,e>=0&&n.slice(e,i)==t}function Jg(n){return n=b(n),n&&Cl.test(n)?n.replace(Ci,Do):n}function Qg(n){return n=b(n),n&&Bl.test(n)?n.replace(ar,"\\$&"):n}var Vg=Et(function(n,t,e){return n+(e?"-":"")+t.toLowerCase()}),kg=Et(function(n,t,e){return n+(e?" ":"")+t.toLowerCase()}),jg=nf("toLowerCase");function n_(n,t,e){n=b(n),t=T(t);var r=t?dt(n):0;if(!t||r>=t)return n;var i=(t-r)/2;return Me(Se(i),e)+n+Me(Ie(i),e)}function t_(n,t,e){n=b(n),t=T(t);var r=t?dt(n):0;return t&&r<t?n+Me(t-r,e):n}function e_(n,t,e){n=b(n),t=T(t);var r=t?dt(n):0;return t&&r<t?Me(t-r,e)+n:n}function r_(n,t,e){return e||t==null?t=0:t&&(t=+t),as(b(n).replace(cr,""),t||0)}function i_(n,t,e){return(e?Q(n,t,e):t===o)?t=1:t=T(t),Kr(b(n),t)}function u_(){var n=arguments,t=b(n[0]);return n.length<3?t:t.replace(n[1],n[2])}var f_=Et(function(n,t,e){return n+(e?"_":"")+t.toLowerCase()});function l_(n,t,e){return e&&typeof e!="number"&&Q(n,t,e)&&(t=e=o),e=e===o?Tn:e>>>0,e?(n=b(n),n&&(typeof t=="string"||t!=null&&!hi(t))&&(t=un(t),!t&&vt(n))?Vn(Rn(n),0,e):n.split(t,e)):[]}var o_=Et(function(n,t,e){return n+(e?" ":"")+pi(t)});function s_(n,t,e){return n=b(n),e=e==null?0:it(T(e),0,n.length),t=un(t),n.slice(e,e+t.length)==t}function a_(n,t,e){var r=u.templateSettings;e&&Q(n,t,e)&&(t=o),n=b(n),t=Xe({},t,r,of);var i=Xe({},t.imports,r.imports,of),f=$(i),l=yr(i,f),s,c,_=0,p=t.interpolate||le,v="__p += '",d=Cr((t.escape||le).source+"|"+p.source+"|"+(p===mi?ql:le).source+"|"+(t.evaluate||le).source+"|$","g"),x="//# sourceURL="+(P.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++xo+"]")+`
11
- `;n.replace(d,function(I,C,O,ln,V,on){return O||(O=ln),v+=n.slice(_,on).replace(Jl,No),C&&(s=!0,v+=`' +
12
- __e(`+C+`) +
13
- '`),V&&(c=!0,v+=`';
14
- `+V+`;
15
- __p += '`),O&&(v+=`' +
16
- ((__t = (`+O+`)) == null ? '' : __t) +
17
- '`),_=on+I.length,I}),v+=`';
18
- `;var R=P.call(t,"variable")&&t.variable;if(!R)v=`with (obj) {
19
- `+v+`
20
- }
21
- `;else if(Gl.test(R))throw new S(fl);v=(c?v.replace(El,""):v).replace(Tl,"$1").replace(yl,"$1;"),v="function("+(R||"obj")+`) {
22
- `+(R?"":`obj || (obj = {});
23
- `)+"var __t, __p = ''"+(s?", __e = _.escape":"")+(c?`, __j = Array.prototype.join;
24
- function print() { __p += __j.call(arguments, '') }
25
- `:`;
26
- `)+v+`return __p
27
- }`;var y=nl(function(){return W(f,x+"return "+v).apply(o,l)});if(y.source=v,ci(y))throw y;return y}function c_(n){return b(n).toLowerCase()}function h_(n){return b(n).toUpperCase()}function g_(n,t,e){if(n=b(n),n&&(e||t===o))return ou(n);if(!n||!(t=un(t)))return n;var r=Rn(n),i=Rn(t),f=su(r,i),l=au(r,i)+1;return Vn(r,f,l).join("")}function __(n,t,e){if(n=b(n),n&&(e||t===o))return n.slice(0,hu(n)+1);if(!n||!(t=un(t)))return n;var r=Rn(n),i=au(r,Rn(t))+1;return Vn(r,0,i).join("")}function p_(n,t,e){if(n=b(n),n&&(e||t===o))return n.replace(cr,"");if(!n||!(t=un(t)))return n;var r=Rn(n),i=su(r,Rn(t));return Vn(r,i).join("")}function v_(n,t){var e=ol,r=sl;if(D(t)){var i="separator"in t?t.separator:i;e="length"in t?T(t.length):e,r="omission"in t?un(t.omission):r}n=b(n);var f=n.length;if(vt(n)){var l=Rn(n);f=l.length}if(e>=f)return n;var s=e-dt(r);if(s<1)return r;var c=l?Vn(l,0,s).join(""):n.slice(0,s);if(i===o)return c+r;if(l&&(s+=c.length-s),hi(i)){if(n.slice(s).search(i)){var _,p=c;for(i.global||(i=Cr(i.source,b(Oi.exec(i))+"g")),i.lastIndex=0;_=i.exec(p);)var v=_.index;c=c.slice(0,v===o?s:v)}}else if(n.indexOf(un(i),s)!=s){var d=c.lastIndexOf(i);d>-1&&(c=c.slice(0,d))}return c+r}function d_(n){return n=b(n),n&&Ll.test(n)?n.replace(Li,Zo):n}var w_=Et(function(n,t,e){return n+(e?" ":"")+t.toUpperCase()}),pi=nf("toUpperCase");function jf(n,t,e){return n=b(n),t=e?o:t,t===o?Ho(n)?Jo(n):bo(n):n.match(t)||[]}var nl=L(function(n,t){try{return en(n,o,t)}catch(e){return ci(e)?e:new S(e)}}),x_=Un(function(n,t){return cn(t,function(e){e=Cn(e),Fn(n,e,si(n[e],n))}),n});function A_(n){var t=n==null?0:n.length,e=A();return n=t?U(n,function(r){if(typeof r[1]!="function")throw new hn(sn);return[e(r[0]),r[1]]}):[],L(function(r){for(var i=-1;++i<t;){var f=n[i];if(en(f[0],this,r))return en(f[1],this,r)}})}function R_(n){return Zs(_n(n,qn))}function vi(n){return function(){return n}}function I_(n,t){return n==null||n!==n?t:n}var S_=ef(),E_=ef(!0);function tn(n){return n}function di(n){return bu(typeof n=="function"?n:_n(n,qn))}function T_(n){return Bu(_n(n,qn))}function y_(n,t){return Fu(n,_n(t,qn))}var L_=L(function(n,t){return function(e){return Zt(e,n,t)}}),C_=L(function(n,t){return function(e){return Zt(n,e,t)}});function wi(n,t,e){var r=$(t),i=me(t,r);e==null&&!(D(t)&&(i.length||!r.length))&&(e=t,t=n,n=this,i=me(t,$(t)));var f=!(D(e)&&"chain"in e)||!!e.chain,l=Nn(n);return cn(i,function(s){var c=t[s];n[s]=c,l&&(n.prototype[s]=function(){var _=this.__chain__;if(f||_){var p=n(this.__wrapped__),v=p.__actions__=k(this.__actions__);return v.push({func:c,args:arguments,thisArg:n}),p.__chain__=_,p}return c.apply(n,zn([this.value()],arguments))})}),n}function m_(){return z._===this&&(z._=ts),this}function xi(){}function O_(n){return n=T(n),L(function(t){return Mu(t,n)})}var W_=Qr(U),b_=Qr(ru),P_=Qr(Rr);function tl(n){return ri(n)?Ir(Cn(n)):sa(n)}function B_(n){return function(t){return n==null?o:ut(n,t)}}var F_=uf(),M_=uf(!0);function Ai(){return[]}function Ri(){return!1}function U_(){return{}}function D_(){return""}function N_(){return!0}function G_(n,t){if(n=T(n),n<1||n>Kn)return[];var e=Tn,r=Y(n,Tn);t=A(t),n-=Tn;for(var i=Tr(r,t);++e<n;)t(e);return i}function H_(n){return E(n)?U(n,Cn):fn(n)?[n]:k(Rf(b(n)))}function q_(n){var t=++jo;return b(n)+t}var K_=Fe(function(n,t){return n+t},0),$_=Vr("ceil"),z_=Fe(function(n,t){return n/t},1),Z_=Vr("floor");function Y_(n){return n&&n.length?Ce(n,tn,Mr):o}function X_(n,t){return n&&n.length?Ce(n,A(t,2),Mr):o}function J_(n){return fu(n,tn)}function Q_(n,t){return fu(n,A(t,2))}function V_(n){return n&&n.length?Ce(n,tn,Gr):o}function k_(n,t){return n&&n.length?Ce(n,A(t,2),Gr):o}var j_=Fe(function(n,t){return n*t},1),np=Vr("round"),tp=Fe(function(n,t){return n-t},0);function ep(n){return n&&n.length?Er(n,tn):0}function rp(n,t){return n&&n.length?Er(n,A(t,2)):0}return u.after=Th,u.ary=bf,u.assign=hg,u.assignIn=Zf,u.assignInWith=Xe,u.assignWith=gg,u.at=_g,u.before=Pf,u.bind=si,u.bindAll=x_,u.bindKey=Bf,u.castArray=Uh,u.chain=mf,u.chunk=Za,u.compact=Ya,u.concat=Xa,u.cond=A_,u.conforms=R_,u.constant=vi,u.countBy=eh,u.create=pg,u.curry=Ff,u.curryRight=Mf,u.debounce=Uf,u.defaults=vg,u.defaultsDeep=dg,u.defer=yh,u.delay=Lh,u.difference=Ja,u.differenceBy=Qa,u.differenceWith=Va,u.drop=ka,u.dropRight=ja,u.dropRightWhile=nc,u.dropWhile=tc,u.fill=ec,u.filter=ih,u.flatMap=lh,u.flatMapDeep=oh,u.flatMapDepth=sh,u.flatten=Tf,u.flattenDeep=rc,u.flattenDepth=ic,u.flip=Ch,u.flow=S_,u.flowRight=E_,u.fromPairs=uc,u.functions=Eg,u.functionsIn=Tg,u.groupBy=ah,u.initial=lc,u.intersection=oc,u.intersectionBy=sc,u.intersectionWith=ac,u.invert=Lg,u.invertBy=Cg,u.invokeMap=hh,u.iteratee=di,u.keyBy=gh,u.keys=$,u.keysIn=nn,u.map=qe,u.mapKeys=Og,u.mapValues=Wg,u.matches=T_,u.matchesProperty=y_,u.memoize=$e,u.merge=bg,u.mergeWith=Yf,u.method=L_,u.methodOf=C_,u.mixin=wi,u.negate=ze,u.nthArg=O_,u.omit=Pg,u.omitBy=Bg,u.once=mh,u.orderBy=_h,u.over=W_,u.overArgs=Oh,u.overEvery=b_,u.overSome=P_,u.partial=ai,u.partialRight=Df,u.partition=ph,u.pick=Fg,u.pickBy=Xf,u.property=tl,u.propertyOf=B_,u.pull=_c,u.pullAll=Lf,u.pullAllBy=pc,u.pullAllWith=vc,u.pullAt=dc,u.range=F_,u.rangeRight=M_,u.rearg=Wh,u.reject=wh,u.remove=wc,u.rest=bh,u.reverse=li,u.sampleSize=Ah,u.set=Ug,u.setWith=Dg,u.shuffle=Rh,u.slice=xc,u.sortBy=Eh,u.sortedUniq=yc,u.sortedUniqBy=Lc,u.split=l_,u.spread=Ph,u.tail=Cc,u.take=mc,u.takeRight=Oc,u.takeRightWhile=Wc,u.takeWhile=bc,u.tap=Yc,u.throttle=Bh,u.thru=He,u.toArray=Kf,u.toPairs=Jf,u.toPairsIn=Qf,u.toPath=H_,u.toPlainObject=zf,u.transform=Ng,u.unary=Fh,u.union=Pc,u.unionBy=Bc,u.unionWith=Fc,u.uniq=Mc,u.uniqBy=Uc,u.uniqWith=Dc,u.unset=Gg,u.unzip=oi,u.unzipWith=Cf,u.update=Hg,u.updateWith=qg,u.values=Lt,u.valuesIn=Kg,u.without=Nc,u.words=jf,u.wrap=Mh,u.xor=Gc,u.xorBy=Hc,u.xorWith=qc,u.zip=Kc,u.zipObject=$c,u.zipObjectDeep=zc,u.zipWith=Zc,u.entries=Jf,u.entriesIn=Qf,u.extend=Zf,u.extendWith=Xe,wi(u,u),u.add=K_,u.attempt=nl,u.camelCase=Yg,u.capitalize=Vf,u.ceil=$_,u.clamp=$g,u.clone=Dh,u.cloneDeep=Gh,u.cloneDeepWith=Hh,u.cloneWith=Nh,u.conformsTo=qh,u.deburr=kf,u.defaultTo=I_,u.divide=z_,u.endsWith=Xg,u.eq=Sn,u.escape=Jg,u.escapeRegExp=Qg,u.every=rh,u.find=uh,u.findIndex=Sf,u.findKey=wg,u.findLast=fh,u.findLastIndex=Ef,u.findLastKey=xg,u.floor=Z_,u.forEach=Of,u.forEachRight=Wf,u.forIn=Ag,u.forInRight=Rg,u.forOwn=Ig,u.forOwnRight=Sg,u.get=gi,u.gt=Kh,u.gte=$h,u.has=yg,u.hasIn=_i,u.head=yf,u.identity=tn,u.includes=ch,u.indexOf=fc,u.inRange=zg,u.invoke=mg,u.isArguments=ot,u.isArray=E,u.isArrayBuffer=zh,u.isArrayLike=j,u.isArrayLikeObject=G,u.isBoolean=Zh,u.isBuffer=kn,u.isDate=Yh,u.isElement=Xh,u.isEmpty=Jh,u.isEqual=Qh,u.isEqualWith=Vh,u.isError=ci,u.isFinite=kh,u.isFunction=Nn,u.isInteger=Nf,u.isLength=Ze,u.isMap=Gf,u.isMatch=jh,u.isMatchWith=ng,u.isNaN=tg,u.isNative=eg,u.isNil=ig,u.isNull=rg,u.isNumber=Hf,u.isObject=D,u.isObjectLike=N,u.isPlainObject=kt,u.isRegExp=hi,u.isSafeInteger=ug,u.isSet=qf,u.isString=Ye,u.isSymbol=fn,u.isTypedArray=yt,u.isUndefined=fg,u.isWeakMap=lg,u.isWeakSet=og,u.join=cc,u.kebabCase=Vg,u.last=vn,u.lastIndexOf=hc,u.lowerCase=kg,u.lowerFirst=jg,u.lt=sg,u.lte=ag,u.max=Y_,u.maxBy=X_,u.mean=J_,u.meanBy=Q_,u.min=V_,u.minBy=k_,u.stubArray=Ai,u.stubFalse=Ri,u.stubObject=U_,u.stubString=D_,u.stubTrue=N_,u.multiply=j_,u.nth=gc,u.noConflict=m_,u.noop=xi,u.now=Ke,u.pad=n_,u.padEnd=t_,u.padStart=e_,u.parseInt=r_,u.random=Zg,u.reduce=vh,u.reduceRight=dh,u.repeat=i_,u.replace=u_,u.result=Mg,u.round=np,u.runInContext=a,u.sample=xh,u.size=Ih,u.snakeCase=f_,u.some=Sh,u.sortedIndex=Ac,u.sortedIndexBy=Rc,u.sortedIndexOf=Ic,u.sortedLastIndex=Sc,u.sortedLastIndexBy=Ec,u.sortedLastIndexOf=Tc,u.startCase=o_,u.startsWith=s_,u.subtract=tp,u.sum=ep,u.sumBy=rp,u.template=a_,u.times=G_,u.toFinite=Gn,u.toInteger=T,u.toLength=$f,u.toLower=c_,u.toNumber=dn,u.toSafeInteger=cg,u.toString=b,u.toUpper=h_,u.trim=g_,u.trimEnd=__,u.trimStart=p_,u.truncate=v_,u.unescape=d_,u.uniqueId=q_,u.upperCase=w_,u.upperFirst=pi,u.each=Of,u.eachRight=Wf,u.first=yf,wi(u,(function(){var n={};return yn(u,function(t,e){P.call(u.prototype,e)||(n[e]=t)}),n})(),{chain:!1}),u.VERSION=il,cn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){u[n].placeholder=u}),cn(["drop","take"],function(n,t){m.prototype[n]=function(e){e=e===o?1:K(T(e),0);var r=this.__filtered__&&!t?new m(this):this.clone();return r.__filtered__?r.__takeCount__=Y(e,r.__takeCount__):r.__views__.push({size:Y(e,Tn),type:n+(r.__dir__<0?"Right":"")}),r},m.prototype[n+"Right"]=function(e){return this.reverse()[n](e).reverse()}}),cn(["filter","map","takeWhile"],function(n,t){var e=t+1,r=e==Ei||e==gl;m.prototype[n]=function(i){var f=this.clone();return f.__iteratees__.push({iteratee:A(i,3),type:e}),f.__filtered__=f.__filtered__||r,f}}),cn(["head","last"],function(n,t){var e="take"+(t?"Right":"");m.prototype[n]=function(){return this[e](1).value()[0]}}),cn(["initial","tail"],function(n,t){var e="drop"+(t?"":"Right");m.prototype[n]=function(){return this.__filtered__?new m(this):this[e](1)}}),m.prototype.compact=function(){return this.filter(tn)},m.prototype.find=function(n){return this.filter(n).head()},m.prototype.findLast=function(n){return this.reverse().find(n)},m.prototype.invokeMap=L(function(n,t){return typeof n=="function"?new m(this):this.map(function(e){return Zt(e,n,t)})}),m.prototype.reject=function(n){return this.filter(ze(A(n)))},m.prototype.slice=function(n,t){n=T(n);var e=this;return e.__filtered__&&(n>0||t<0)?new m(e):(n<0?e=e.takeRight(-n):n&&(e=e.drop(n)),t!==o&&(t=T(t),e=t<0?e.dropRight(-t):e.take(t-n)),e)},m.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},m.prototype.toArray=function(){return this.take(Tn)},yn(m.prototype,function(n,t){var e=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=u[r?"take"+(t=="last"?"Right":""):t],f=r||/^find/.test(t);i&&(u.prototype[t]=function(){var l=this.__wrapped__,s=r?[1]:arguments,c=l instanceof m,_=s[0],p=c||E(l),v=function(C){var O=i.apply(u,zn([C],s));return r&&d?O[0]:O};p&&e&&typeof _=="function"&&_.length!=1&&(c=p=!1);var d=this.__chain__,x=!!this.__actions__.length,R=f&&!d,y=c&&!x;if(!f&&p){l=y?l:new m(this);var I=n.apply(l,s);return I.__actions__.push({func:He,args:[v],thisArg:o}),new gn(I,d)}return R&&y?n.apply(this,s):(I=this.thru(v),R?r?I.value()[0]:I.value():I)})}),cn(["pop","push","shift","sort","splice","unshift"],function(n){var t=ge[n],e=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);u.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var f=this.value();return t.apply(E(f)?f:[],i)}return this[e](function(l){return t.apply(E(l)?l:[],i)})}}),yn(m.prototype,function(n,t){var e=u[t];if(e){var r=e.name+"";P.call(Rt,r)||(Rt[r]=[]),Rt[r].push({name:t,func:e})}}),Rt[Be(o,ct).name]=[{name:"wrapper",func:o}],m.prototype.clone=ds,m.prototype.reverse=ws,m.prototype.value=xs,u.prototype.at=Xc,u.prototype.chain=Jc,u.prototype.commit=Qc,u.prototype.next=Vc,u.prototype.plant=jc,u.prototype.reverse=nh,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=th,u.prototype.first=u.prototype.head,Nt&&(u.prototype[Nt]=kc),u}),wt=Qo();nt?((nt.exports=wt)._=wt,dr._=wt):z._=wt}).call(ip)})(jt,jt.exports)),jt.exports}var fp=up();exports.lodashExports=fp;