diff --git a/dist/copilot_web/App-BjVABi7E.js b/dist/copilot_web/App-BjVABi7E.js deleted file mode 100644 index 052b616..0000000 --- a/dist/copilot_web/App-BjVABi7E.js +++ /dev/null @@ -1,6 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["copilot_web/workflowChat-CnVi6gIQ.js","copilot_web/vendor-markdown-Dek94WS0.js","copilot_web/vendor-react-V04_Axys.js","copilot_web/message-components-B6pkQvDp.js","copilot_web/input.js","copilot_web/assets/input-CJq8z6H1.css"].map(path => { - const apiBase = window.comfyAPI?.api?.api?.api_base; - const prefix = apiBase ? `${apiBase.substring(1)}/` : ''; - return `${prefix}${path}`; - }))))=>i.map(i=>d[i]); -import{_ as E}from"./input.js";import{j as s}from"./vendor-markdown-Dek94WS0.js";import{r as t,R as w}from"./vendor-react-V04_Axys.js";import{C as v}from"./message-components-B6pkQvDp.js";const y=9999999,x={EXPLAIN_NODE:"copilot:explain-node"},D="/copilot_web/assets/logo-BTZhX0BN.png";function _(n={}){const[u,l]=t.useState({x:n.initialX??window.innerWidth-160,y:n.initialY??20}),[o,r]=t.useState(!1),[a,m]=t.useState({x:0,y:0}),[d,c]=t.useState(0),[g,b]=t.useState({x:0,y:0}),f=t.useCallback(e=>{if(o){const i=Math.min(Math.max(0,e.clientX-g.x),window.innerWidth-(n.boundaryPadding?.right??100)),h=Math.min(Math.max(0,e.clientY-g.y),window.innerHeight-(n.boundaryPadding?.bottom??40));l({x:i,y:h})}},[o,g,n.boundaryPadding]),p=t.useCallback(e=>{if(o){const i=Math.sqrt(Math.pow(e.clientX-a.x,2)+Math.pow(e.clientY-a.y,2)),h=Date.now()-d;i<5&&h<200&&n.onClick?.()}r(!1)},[o,a,d,n.onClick]);return t.useEffect(()=>(o&&(document.addEventListener("mousemove",f),document.addEventListener("mouseup",p)),()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",p)}),[o,f,p]),{position:u,isDragging:o,handleMouseDown:e=>{e.preventDefault(),r(!0),c(Date.now()),m({x:e.clientX,y:e.clientY});const i=e.currentTarget.getBoundingClientRect();b({x:e.clientX-i.left,y:e.clientY-i.top})}}}const C=w.lazy(()=>E(()=>import("./workflowChat-CnVi6gIQ.js"),__vite__mapDeps([0,1,2,3,4,5])).then(n=>({default:n.default})));function M(){const n=t.useRef(null),[u,l]=t.useState(!1),[o,r]=t.useState(!1),{position:a,isDragging:m,handleMouseDown:d}=_({boundaryPadding:{right:100,bottom:40},onClick:()=>l(!0)});return t.useEffect(()=>{const c=()=>{l(!0),r(!0)};return window.addEventListener(x.EXPLAIN_NODE,c),()=>window.removeEventListener(x.EXPLAIN_NODE,c)},[]),a?s.jsx(v,{children:s.jsx("div",{ref:n,children:s.jsxs("div",{className:"fixed",style:{zIndex:y,left:a.x,top:a.y,cursor:m?"grabbing":"grab"},children:[s.jsxs("button",{onMouseDown:d,className:"px-2 py-1 border border-gray-300 rounded-md bg-white text-black hover:bg-blue-300 hover:font-bold transition-colors select-none w-40 flex items-center space-x-1",style:{marginLeft:"-40px"},children:[s.jsx("img",{src:D,alt:"ComfyUI-Copilot Logo",className:"h-8 w-8"}),s.jsx("span",{className:"text-[14px] font-medium text-gray-800",children:"ComfyUI-Copilot"})]}),s.jsx(w.Suspense,{fallback:s.jsx("div",{children:"Loading..."}),children:s.jsx(C,{onClose:()=>{l(!1),r(!1)},visible:u,triggerUsage:o,onUsageTriggered:()=>r(!1)})})]})})}):null}const I=Object.freeze(Object.defineProperty({__proto__:null,default:M},Symbol.toStringTag,{value:"Module"}));export{I as A,D as l}; diff --git a/dist/copilot_web/App-CzPQ6Sqn.js b/dist/copilot_web/App-CzPQ6Sqn.js new file mode 100644 index 0000000..e4ded8d --- /dev/null +++ b/dist/copilot_web/App-CzPQ6Sqn.js @@ -0,0 +1,6 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["copilot_web/workflowChat-C0sNrgv8.js","copilot_web/input.js","copilot_web/vendor-markdown-Dek94WS0.js","copilot_web/vendor-react-V04_Axys.js","copilot_web/message-components-D3rPBq8S.js","copilot_web/assets/input-CbVoR7-h.css"].map(path => { + const apiBase = window.comfyAPI?.api?.api?.api_base; + const prefix = apiBase ? `${apiBase.substring(1)}/` : ''; + return `${prefix}${path}`; + }))))=>i.map(i=>d[i]); +import{_ as E}from"./input.js";import{j as s}from"./vendor-markdown-Dek94WS0.js";import{r as n,R as w}from"./vendor-react-V04_Axys.js";import{C as v}from"./message-components-D3rPBq8S.js";const y=9999999,x={EXPLAIN_NODE:"copilot:explain-node"},D="/copilot_web/assets/logo-BTZhX0BN.png";function _(e={}){const[u,l]=n.useState({x:e.initialX??window.innerWidth-160,y:e.initialY??20}),[o,r]=n.useState(!1),[a,m]=n.useState({x:0,y:0}),[d,c]=n.useState(0),[g,b]=n.useState({x:0,y:0}),f=n.useCallback(t=>{if(o){const i=Math.min(Math.max(0,t.clientX-g.x),window.innerWidth-(e.boundaryPadding?.right??100)),p=Math.min(Math.max(0,t.clientY-g.y),window.innerHeight-(e.boundaryPadding?.bottom??40));l({x:i,y:p})}},[o,g,e.boundaryPadding]),h=n.useCallback(t=>{if(o){const i=Math.sqrt(Math.pow(t.clientX-a.x,2)+Math.pow(t.clientY-a.y,2)),p=Date.now()-d;i<5&&p<200&&e.onClick?.()}r(!1)},[o,a,d,e.onClick]);return n.useEffect(()=>(o&&(document.addEventListener("mousemove",f),document.addEventListener("mouseup",h)),()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",h)}),[o,f,h]),{position:u,isDragging:o,handleMouseDown:t=>{t.preventDefault(),r(!0),c(Date.now()),m({x:t.clientX,y:t.clientY});const i=t.currentTarget.getBoundingClientRect();b({x:t.clientX-i.left,y:t.clientY-i.top})}}}const C=w.lazy(()=>E(()=>import("./workflowChat-C0sNrgv8.js").then(e=>e.w),__vite__mapDeps([0,1,2,3,4,5])).then(e=>({default:e.default})));function M(){const e=n.useRef(null),[u,l]=n.useState(!1),[o,r]=n.useState(!1),{position:a,isDragging:m,handleMouseDown:d}=_({boundaryPadding:{right:100,bottom:40},onClick:()=>l(!0)});return n.useEffect(()=>{const c=()=>{l(!0),r(!0)};return window.addEventListener(x.EXPLAIN_NODE,c),()=>window.removeEventListener(x.EXPLAIN_NODE,c)},[]),a?s.jsx(v,{children:s.jsx("div",{ref:e,children:s.jsxs("div",{className:"fixed",style:{zIndex:y,left:a.x,top:a.y,cursor:m?"grabbing":"grab"},children:[s.jsxs("button",{onMouseDown:d,className:"px-2 py-1 border border-gray-300 rounded-md bg-white text-black hover:bg-blue-300 hover:font-bold transition-colors select-none w-40 flex items-center space-x-1",style:{marginLeft:"-40px"},children:[s.jsx("img",{src:D,alt:"ComfyUI-Copilot Logo",className:"h-8 w-8"}),s.jsx("span",{className:"text-[14px] font-medium text-gray-800",children:"ComfyUI-Copilot"})]}),s.jsx(w.Suspense,{fallback:s.jsx("div",{children:"Loading..."}),children:s.jsx(C,{onClose:()=>{l(!1),r(!1)},visible:u,triggerUsage:o,onUsageTriggered:()=>r(!1)})})]})})}):null}const I=Object.freeze(Object.defineProperty({__proto__:null,default:M},Symbol.toStringTag,{value:"Module"}));export{I as A,D as l}; diff --git a/dist/copilot_web/ParameterDebugInterfaceNew-D6FB8RLq.js b/dist/copilot_web/ParameterDebugInterfaceNew-D6FB8RLq.js new file mode 100644 index 0000000..e709b02 --- /dev/null +++ b/dist/copilot_web/ParameterDebugInterfaceNew-D6FB8RLq.js @@ -0,0 +1,29 @@ +import{j as e}from"./vendor-markdown-Dek94WS0.js";import{r as b}from"./vendor-react-V04_Axys.js";import{r as Qe,g as Xe,m as Ze,i as et}from"./workflowChat-C0sNrgv8.js";import{a as Z,u as Ie,W as Me,g as tt}from"./message-components-D3rPBq8S.js";import"./input.js";import"./App-CzPQ6Sqn.js";function st(l,n){try{if(!l)return console.error("Invalid prompt_output: ",l),l;for(const r of n){if(!l[r.nodeId]){console.error(`Node with ID ${r.nodeId} not found`);continue}if(!l[r.nodeId].inputs){console.error(`Inputs not found for node with ID ${r.nodeId}`);continue}l[r.nodeId].inputs[r.paramName]=r.paramValue}return l}catch(r){return console.error("Error updating prompt:",r),l}}async function rt(l){const n=await Z.graphToPrompt(),r=st(n.output,l);console.log("queuePrompt updated_prompt:",r);const u={prompt:r,client_id:Z.api.clientId,extra_data:{extra_pageinfo:{workflow:n.workflow}}};console.debug("queuePrompt request_body.prompt:",r);const h=await Qe(u);return console.debug("queuePrompt response:",h),h}function Pe(l){const n=document.createElement("canvas"),r=n.getContext("2d");if(n.width=512,n.height=512,r){r.fillStyle="#f8d7da",r.fillRect(0,0,n.width,n.height),r.strokeStyle="#dc3545",r.lineWidth=4,r.strokeRect(10,10,n.width-20,n.height-20),r.fillStyle="#dc3545",r.beginPath(),r.arc(n.width/2,150,50,0,2*Math.PI),r.fill(),r.fillStyle="white",r.font="bold 80px Arial",r.textAlign="center",r.textBaseline="middle",r.fillText("!",n.width/2,150),r.fillStyle="#721c24",r.font="20px Arial",r.textAlign="center",r.textBaseline="middle";const u=n.width-60,h=30,d=l.split(" ");let c="",g=250;for(let f=0;fu&&f>0?(r.fillText(c,n.width/2,g),c=d[f]+" ",g+=h):c=M}r.fillText(c,n.width/2,g)}return n.toDataURL("image/png")}async function nt(l){try{if(!l||l==="")return console.log("No prompt ID provided"),{1:[Pe("Fail to generate prompt ID")]};const n=await Xe(l);if(!n||!n[l])return console.log("Not finished for prompt ID:",l),{};const r=n[l];if(r.status&&r.status.status_str==="error"){console.error("Error for prompt ID:",l);const h=r.status.messages;if(h&&h.length>0){const d=h[h.length-1];if(d&&d.length>0){const c=d[0];return{1:[Pe(c)]}}}}const u={};if(r.outputs)for(const h in r.outputs){const d=r.outputs[h];if(d&&d.images){u[h]=[];for(const c of d.images)if(c&&c.filename&&c.type){const g=Z.graph._nodes_by_id[h].imgs[0].currentSrc.split("?")[0];u[h].push(g+"?filename="+encodeURIComponent(c.filename)+"&type="+encodeURIComponent(c.type)+(c.subfolder?"&subfolder="+encodeURIComponent(c.subfolder):""))}console.log("outputImages for nodeId:",h,u[h])}}return u}catch(n){throw console.error("Error getting output images from prompt:",n),n}}function ot(){const l=Object.values(Z.graph._nodes_by_id),n=[],r=[];for(const u of l)u.type==="SaveImage"?n.push(u.id):u.type==="PreviewImage"&&r.push(u.id);if(console.log("saveNodeIds:",n),console.log("previewNodeIds:",r),n.length===0&&r.length===0)throw new Error("No SaveImage or PreviewImage node found, please add one to the graph");return n.length===1?n[0]:n.length==0&&r.length===1?r[0]:null}async function at(l,n){const r=await nt(l);return Object.keys(r).length===0?null:r[n.toString()]&&r[n.toString()].length>0?r[n.toString()][0]:null}const lt=({selectedNodes:l,handleParamSelect:n,selectedParams:r,handleNext:u,handleClose:h})=>e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-4",children:[e.jsxs("div",{className:"mb-4 border-b pb-2 flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-medium text-gray-800",children:"Select Parameters for Testing"}),e.jsx("p",{className:"text-xs text-gray-500",children:"Choose the parameters you want to include in your batch test"})]}),e.jsx("button",{className:"text-gray-400 hover:text-gray-600",onClick:h,children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),l.map((d,c)=>{const g=d.title||"Unknown Node",f=d.widgets||[];return e.jsxs("div",{className:"border rounded-md mb-4 overflow-hidden",children:[e.jsx("div",{className:"bg-gray-50 px-3 py-2 text-sm font-medium text-gray-700 border-b",children:g}),e.jsx("div",{className:"p-4 space-y-3",children:e.jsx("div",{className:"flex items-center gap-3 flex-wrap",children:f.map((M,L)=>{const S=M.name;return e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:`w-5 h-5 rounded-full border flex items-center justify-center ${r[S]?"border-red-500 bg-red-100":"border-gray-300"}`,onClick:W=>n(S,W),children:r[S]&&e.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"})}),e.jsx("span",{className:"ml-2 text-gray-700 text-xs",children:S})]},`widget-${L}`)})})})]},`node-${c}`)}),e.jsx("div",{className:"mt-6 flex justify-center",children:e.jsx("button",{onClick:d=>u(d),className:"px-3 py-1.5 text-xs bg-pink-200 text-pink-700 rounded-md hover:bg-pink-300 transition-colors",children:"Next"})})]}),it=({selectedNodes:l,paramTestValues:n,selectedParams:r,updateParamTestValues:u,toggleDropdown:h,openDropdowns:d,handleTestValueSelect:c,searchTerms:g,handleSearch:f,handleSelectAll:M,handleNext:L,handlePrevious:S,handleClose:W,inputValues:K,setInputValues:A,textInputs:B,handleTextInputChange:_,handleAddTextInput:T,handleRemoveTextInput:j,openAiWritingModal:w})=>{const C=(v,P,V,q=0)=>{if(v=isNaN(v)?0:v,P=isNaN(P)?100:P,V=isNaN(V)||V<=0?1:V,P{!l||l.length===0||l.forEach(v=>{const P=v.id.toString(),V=v.widgets||{};Object.values(V).forEach(m=>{const I=m.name;if(!r[I])return;if(!(n[P]?.[I]?.length>0)&&m.type==="number"){const x=m.options?.min||0,F=m.options?.max||100,D=(m.options?.step||10)/10,N=m.options?.precision||0,p=C(x,F,D,N);if(p.length>0){u(P,I,p);const G=`${P}_${I}`;A(H=>({...H,[G]:{min:x.toString(),max:F.toString(),step:D.toString()}}))}}if(m.type==="customtext"||m.type.toLowerCase().includes("text")){const x=`${P}_${I}`,F=B[x]||[""];JSON.stringify(F)!==JSON.stringify(n[P]?.[I]||[""])&&u(P,I,F)}})})},[l,r,n,B,u,A,C]),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-4",children:[e.jsxs("div",{className:"mb-4 border-b pb-2 flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-medium text-gray-800",children:"Parameter Options"}),e.jsx("p",{className:"text-xs text-gray-500",children:"Configure the test values for each parameter"})]}),e.jsx("button",{className:"text-gray-400 hover:text-gray-600",onClick:W,children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),l.length>0?l.map((v,P)=>{const V=v.widgets||{},q=Object.values(V),m=v.id;return e.jsxs("div",{className:"border rounded-md mb-4 overflow-hidden",children:[e.jsxs("div",{className:"bg-gray-50 px-3 py-2 text-xs font-medium text-gray-700 border-b flex justify-between items-center",children:[e.jsxs("span",{children:[v.type," (ID: ",m,")"]}),e.jsx("button",{className:"text-gray-400 hover:text-gray-600",onClick:I=>W(I,P),children:e.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("div",{className:"p-4 space-y-4",children:q.map((I,Y)=>{const x=I.name;if(!r[x])return null;const F=`${m}_${x}`;if(I.type==="customtext"||I.type.toLowerCase().includes("text")){const D=B[F]||[""];return e.jsxs("div",{className:"border-b pb-3",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsxs("label",{className:"text-xs font-medium text-gray-700",children:[x,":"]}),e.jsxs("button",{className:"px-2 py-1 bg-blue-100 text-blue-700 rounded text-xs flex items-center hover:bg-blue-200 transition-colors",onClick:()=>w(m,x),children:[e.jsx("svg",{className:"w-3 h-3 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})}),"AI Writing"]})]}),e.jsx("div",{className:"space-y-2",children:D.map((N,p)=>e.jsxs("div",{className:"flex items-start",children:[e.jsx("textarea",{className:"flex-1 border border-gray-300 rounded p-2 text-xs resize-y",rows:2,placeholder:"Enter text...",value:N,onChange:G=>_(m,x,p,G.target.value)}),e.jsx("button",{className:"ml-2 text-red-500 hover:text-red-700",onClick:()=>j(m,x,p),title:"Remove",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},p))}),e.jsxs("button",{className:"mt-2 px-2 py-1 border border-dashed border-gray-300 rounded text-xs text-gray-600 hover:bg-gray-50 flex items-center",onClick:()=>T(m,x),children:[e.jsx("svg",{className:"w-3 h-3 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),"Add Text"]})]},Y)}if(I.type==="number"){const D=I.options?.min||0,N=I.options?.max||100,p=(I.options?.step||10)/10,G=I.options?.precision||0,H=C(D,N,p,G),J=K[F]||{min:D.toString(),max:N.toString(),step:p.toString()};return e.jsxs("div",{className:"border-b pb-3",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("label",{className:"text-xs font-medium text-gray-700",children:[x,":"]}),e.jsx("div",{className:"w-4"})]}),e.jsxs("div",{className:"flex space-x-2 items-center",children:[e.jsx("label",{className:"text-xs text-gray-600",children:"Min"}),e.jsx("input",{type:"text",className:"w-12 h-6 border border-gray-300 rounded text-xs px-2",value:J.min,onClick:E=>{E.preventDefault(),E.stopPropagation()},onChange:E=>{E.preventDefault(),E.stopPropagation();const O=E.target.value;if(A($=>({...$,[F]:{...$[F],min:O}})),O===""||!isNaN(parseFloat(O))){const $=O===""?0:parseFloat(O),R=parseFloat(J.max||N.toString()),Q=parseFloat(J.step||p.toString()),U=C($,R,Q,G);u(m,x,U)}}}),e.jsx("label",{className:"text-xs text-gray-600",children:"Max"}),e.jsx("input",{type:"text",className:"w-12 h-6 border border-gray-300 rounded text-xs px-2",value:J.max,onClick:E=>{E.preventDefault(),E.stopPropagation()},onChange:E=>{E.preventDefault(),E.stopPropagation();const O=E.target.value;if(A($=>({...$,[F]:{...$[F],max:O}})),O===""||!isNaN(parseFloat(O))){const $=parseFloat(J.min||D.toString()),R=O===""?$:parseFloat(O),Q=parseFloat(J.step||p.toString()),U=C($,R,Q,G);u(m,x,U)}}}),e.jsx("label",{className:"text-xs text-gray-600",children:"Step"}),e.jsx("input",{type:"text",className:"w-12 h-6 border border-gray-300 rounded text-xs px-2",value:J.step,onClick:E=>{E.preventDefault(),E.stopPropagation()},onChange:E=>{E.preventDefault(),E.stopPropagation();const O=E.target.value;if(A($=>({...$,[F]:{...$[F],step:O}})),O===""||!isNaN(parseFloat(O))&&parseFloat(O)>0){const $=parseFloat(J.min||D.toString()),R=parseFloat(J.max||N.toString()),Q=O===""?1:parseFloat(O),U=C($,R,Q,G);u(m,x,U)}}})]}),e.jsxs("div",{className:"mt-1",children:[e.jsx("label",{className:"text-xs text-gray-600",children:"Test values"}),e.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:(()=>{const E=n[m]?.[x]||H;if(E.length<=10)return E.map((O,$)=>e.jsxs("div",{className:"px-2 py-0.5 bg-blue-100 text-blue-800 rounded-md flex items-center text-xs cursor-pointer hover:bg-blue-200",onClick:R=>{R.stopPropagation(),c(m,x,O,R)},children:[e.jsx("span",{children:O}),e.jsx("svg",{className:"w-4 h-4 ml-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})]},$));{const O=E.slice(0,5),$=E.slice(E.length-5);return e.jsxs(e.Fragment,{children:[O.map((R,Q)=>e.jsxs("div",{className:"px-2 py-0.5 bg-blue-100 text-blue-800 rounded-md flex items-center text-xs cursor-pointer hover:bg-blue-200",onClick:U=>{U.stopPropagation(),c(m,x,R,U)},children:[e.jsx("span",{children:R}),e.jsx("svg",{className:"w-4 h-4 ml-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})]},`first-${Q}`)),e.jsx("div",{className:"px-2 py-0.5 bg-gray-100 text-gray-600 rounded-md flex items-center text-xs",children:"..."}),$.map((R,Q)=>e.jsxs("div",{className:"px-2 py-0.5 bg-blue-100 text-blue-800 rounded-md flex items-center text-xs cursor-pointer hover:bg-blue-200",onClick:U=>{U.stopPropagation(),c(m,x,R,U)},children:[e.jsx("span",{children:R}),e.jsx("svg",{className:"w-4 h-4 ml-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})]},`last-${Q}`))]})}})()})]}),e.jsx("div",{className:"mt-1",children:e.jsx("p",{className:"text-xs text-gray-500",children:"Values are distributed evenly between Min and Max"})})]},Y)}else if(I.type==="combo"){const D=I.options?.values||[],N=`${m}_${x}`;return e.jsxs("div",{className:"border-b pb-3",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("label",{className:"text-xs font-medium text-gray-700",children:x}),e.jsxs("div",{className:"relative dropdown-container",children:[e.jsxs("button",{className:"appearance-none border border-gray-300 rounded px-2 py-0.5 pr-6 text-xs flex items-center bg-white text-gray-700",onClick:p=>{p.preventDefault(),p.stopPropagation(),h(m,x,p)},"data-dropdown":N,children:[e.jsx("span",{children:(n[m]?.[x]||[]).length>0?`${x}: ${(n[m]?.[x]||[]).length} selected`:`Select ${x}`}),e.jsx("div",{className:"ml-2",children:e.jsx("svg",{className:"fill-current h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:e.jsx("path",{d:"M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"})})})]}),d[N]&&e.jsxs("div",{className:"absolute z-[9999] mt-1 w-64 bg-white border border-gray-300 rounded-md shadow-lg dropdown-menu",style:{position:"fixed",top:typeof d[N]=="object"?`${d[N].y}px`:"0px",left:typeof d[N]=="object"?`${d[N].x}px`:"0px",maxHeight:"300px",overflowY:"auto"},children:[e.jsx("div",{className:"p-2 border-b sticky top-0 bg-white",children:e.jsx("input",{type:"text",className:"w-full px-2 py-0.5 text-xs border border-gray-300 rounded",placeholder:"Search...",value:g[N]||"",onChange:p=>{p.preventDefault(),p.stopPropagation(),f(m,x,p.target.value)},onClick:p=>{p.preventDefault(),p.stopPropagation()},autoFocus:!0})}),e.jsxs("div",{className:"px-3 py-1.5 bg-gray-50 border-b cursor-pointer text-xs flex items-center text-gray-700 hover:bg-gray-100",onClick:p=>{p.preventDefault(),p.stopPropagation();const G=D.filter(H=>!g[N]||H.toLowerCase().includes((g[N]||"").toLowerCase()));M(m,x,G)},children:[e.jsx("div",{className:`w-4 h-4 mr-2 border rounded-sm flex items-center justify-center ${D.length>0&&(n[m]?.[x]||[]).length===D.length?"bg-blue-500 border-blue-500":(n[m]?.[x]||[]).length>0?"bg-blue-500 border-blue-500 opacity-50":"border-gray-300"}`,children:(n[m]?.[x]||[]).length>0&&e.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),e.jsx("span",{className:"font-medium",children:D.length>0&&(n[m]?.[x]||[]).length===D.length?"Deselect All":"Select All"})]}),e.jsxs("div",{className:"max-h-60 overflow-y-auto",children:[D.filter(p=>!g[N]||p.toLowerCase().includes((g[N]||"").toLowerCase())).map((p,G)=>e.jsxs("div",{className:"px-3 py-1.5 hover:bg-gray-100 cursor-pointer text-xs flex items-center text-gray-700",onClick:H=>{H.preventDefault(),H.stopPropagation(),c(m,x,p,H)},children:[e.jsx("div",{className:`w-4 h-4 mr-2 border rounded-sm flex items-center justify-center ${(n[m]?.[x]||[]).includes(p)?"bg-blue-500 border-blue-500":"border-gray-300"}`,children:(n[m]?.[x]||[]).includes(p)&&e.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),e.jsx("span",{className:"whitespace-normal overflow-hidden text-ellipsis",children:p})]},G)),D.filter(p=>!g[N]||p.toLowerCase().includes((g[N]||"").toLowerCase())).length===0&&e.jsx("div",{className:"px-3 py-4 text-sm text-gray-500 text-center",children:"No matching options"})]})]})]})]}),e.jsxs("div",{className:"mt-2",children:[e.jsx("label",{className:"text-xs text-gray-600",children:"Test values"}),e.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:(n[m]?.[x]||[]).map((p,G)=>e.jsxs("div",{className:"px-2 py-0.5 bg-blue-100 text-blue-800 rounded-md flex items-center text-xs",children:[e.jsx("span",{children:p}),e.jsx("svg",{className:"w-4 h-4 ml-1 cursor-pointer hover:text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",onClick:H=>{H.preventDefault(),H.stopPropagation(),c(m,x,p,H)},children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})]},G))})]})]},Y)}else return e.jsxs("div",{className:"border-b pb-3",children:[e.jsx("div",{className:"flex justify-between items-center",children:e.jsx("label",{className:"text-xs font-medium text-gray-700",children:x})}),e.jsxs("div",{className:"mt-2",children:[e.jsx("label",{className:"text-xs text-gray-600",children:"Test values"}),e.jsxs("div",{className:"mt-1 flex flex-wrap gap-1",children:[(n[m]?.[x]||[]).map((D,N)=>e.jsxs("div",{className:"px-2 py-0.5 bg-blue-100 text-blue-800 rounded-md flex items-center text-xs",children:[e.jsx("span",{children:D}),e.jsx("svg",{className:"w-4 h-4 ml-1 cursor-pointer hover:text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",onClick:p=>{p.preventDefault(),p.stopPropagation(),c(m,x,D,p)},children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})]},N)),e.jsxs("button",{className:"px-2 py-0.5 border border-dashed border-blue-300 text-blue-600 rounded-md text-xs flex items-center hover:bg-blue-50",onClick:D=>{D.preventDefault(),D.stopPropagation();const N=`${x}${(n[m]?.[x]||[]).length+1}`;u(m,x,[...n[m]?.[x]||[],N])},children:[e.jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),e.jsx("span",{children:"Add"})]})]})]})]},Y)})})]},P)}):e.jsx("div",{className:"border rounded-md mb-4 p-4 text-center text-gray-500",children:"No nodes selected. Please select a node in the workflow to configure parameters."}),e.jsxs("div",{className:"mt-6 flex justify-between",children:[e.jsx("button",{onClick:v=>S(v),className:"px-3 py-1.5 text-xs bg-gray-100 text-gray-800 rounded-md hover:bg-gray-200 transition-colors",children:"Previous"}),e.jsx("button",{onClick:v=>L(v),className:"px-3 py-1.5 text-xs bg-pink-200 text-pink-700 rounded-md hover:bg-pink-300 transition-colors",children:"Next"})]})]})},ct=({selectedNodes:l,paramTestValues:n,selectedParams:r,totalCount:u,errorMessage:h,handlePrevious:d,handleStartGeneration:c,handleClose:g})=>{const[f,M]=b.useState([]),[L,S]=b.useState(null),[W,K]=b.useState(!1);Ie();const A=()=>{const _=Object.values(Z.graph._nodes_by_id),T=[],j=[];for(const C of _)C.type==="SaveImage"?T.push(C.id):C.type==="PreviewImage"&&j.push(C.id);const w=[...T,...j];M(w),w.length===1?S(w[0]):w.length>1&&(K(!0),S(null))};b.useEffect(()=>{A()},[]),b.useEffect(()=>{const _=()=>{if(!Z.canvas.selected_nodes)return;const T=Object.values(Z.canvas.selected_nodes);if(T.length===0)return;const j=T[0];j&&(j.type==="SaveImage"||j.type==="PreviewImage")&&(console.log("Selected image node:",j.id),S(j.id))};return document.addEventListener("click",_),()=>{document.removeEventListener("click",_)}},[]);const B=_=>{if(_&&(_.preventDefault(),_.stopPropagation()),f.length>1&&!L){K(!0);return}c(_,L||void 0)};return e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-4",children:[e.jsxs("div",{className:"mb-4 border-b pb-2 flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-medium text-gray-800",children:"Confirm Test Configuration"}),e.jsxs("p",{className:"text-xs text-gray-500",children:["In the selected parameter combinations, there are ",u," total runs. Each run will generate a separate image."]})]}),e.jsx("button",{className:"text-gray-400 hover:text-gray-600",onClick:g,children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),W&&f.length>1&&e.jsx("div",{className:"mb-4 p-3 bg-yellow-50 border border-yellow-200 rounded-md text-amber-600 text-xs",children:e.jsxs("div",{className:"flex items-start",children:[e.jsx("div",{className:"flex-shrink-0 mt-0.5",children:e.jsx("svg",{className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),e.jsx("div",{className:"ml-2",children:L===null?`Multiple SaveImage and PreviewImage nodes detected with IDs ${f.join(",")}. Please click the node on canvas.`:`Current node ID is ${L}, please click Start Generation again`})]})}),h&&e.jsx("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-md text-red-600 text-xs",children:e.jsxs("div",{className:"flex items-start",children:[e.jsx("div",{className:"flex-shrink-0 mt-0.5",children:e.jsx("svg",{className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),e.jsx("div",{className:"ml-2",children:h})]})}),l.length>0?l.map((_,T)=>{const j=_.type||"Unknown Node",w=_.widgets||[],C=_.id;return e.jsxs("div",{className:"border rounded-md mb-4 overflow-hidden",children:[e.jsxs("div",{className:"bg-gray-50 px-3 py-2 text-xs font-medium text-gray-700 border-b",children:[j," (ID: ",C,")"]}),e.jsx("div",{className:"p-4 space-y-3",children:w.map((v,P)=>{const V=v.name;if(!r[V])return null;const q=n[C]?.[V]||[],m=Array.isArray(q)?`[${q.join(", ")}]`:JSON.stringify(q);return e.jsxs("div",{className:PI.preventDefault()})})]},P)})})]},T)}):e.jsx("div",{className:"border rounded-md mb-4 p-4 text-center text-gray-500 text-xs",children:"No nodes selected. Please select a node in the workflow to configure parameters."}),e.jsxs("div",{className:"mt-6 flex justify-between",children:[e.jsx("button",{onClick:_=>d(_),className:"px-3 py-1.5 text-xs bg-gray-100 text-gray-800 rounded-md hover:bg-gray-200 transition-colors",children:"Previous"}),e.jsx("button",{onClick:_=>B(_),className:`px-3 py-1.5 text-xs rounded-md transition-colors ${f.length>1&&!L?"bg-gray-200 text-gray-500 cursor-not-allowed":"bg-pink-200 text-pink-700 hover:bg-pink-300"}`,disabled:f.length>1&&!L,children:"Start Generation"})]})]})},dt=({selectedNodes:l,paramTestValues:n,selectedParams:r,totalCount:u,completedCount:h,errorMessage:d,handleClose:c,setIsProcessing:g,setCurrentScreen:f,cleanupPolling:M})=>{const L=S=>{S.preventDefault(),S.stopPropagation(),Ze({clear:!0}),et(),M&&M(),g(!1),f(2)};return e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-4 relative",children:[e.jsx("div",{className:"absolute inset-0 bg-gray-500 bg-opacity-30 flex flex-col items-center justify-center z-10",children:e.jsxs("div",{className:"text-center text-gray-800 bg-white p-4 rounded-lg shadow-lg",children:[e.jsx("div",{className:"mb-2 text-sm font-medium",children:"Processing..."}),e.jsxs("div",{className:"text-xs mb-3",children:["Completed ",h," of ",u," runs"]}),e.jsx("div",{className:"w-48 h-2 bg-gray-200 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-pink-500 transition-all duration-200",style:{width:`${h/u*100}%`}})}),e.jsxs("div",{className:"mt-2 text-xs text-gray-600",children:["Already generated ",h," images"]}),e.jsx("button",{onClick:L,className:"mt-4 px-3 py-1.5 text-xs bg-gray-200 text-gray-800 rounded-md hover:bg-gray-300 transition-colors",children:"Cancel"})]})}),e.jsxs("div",{className:"mb-4 border-b pb-2 flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-medium text-gray-800",children:"Confirm Test Configuration"}),e.jsxs("p",{className:"text-xs text-gray-500",children:["In the selected parameter combinations, there are ",u," total runs. Each run will generate a separate image."]})]}),e.jsx("button",{className:"text-gray-400 hover:text-gray-600",onClick:c,children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d&&e.jsx("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-md text-red-600 text-xs",children:e.jsxs("div",{className:"flex items-start",children:[e.jsx("div",{className:"flex-shrink-0 mt-0.5",children:e.jsx("svg",{className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),e.jsx("div",{className:"ml-2",children:d})]})}),l.length>0?l.map((S,W)=>{const K=S.type||"Unknown Node",A=S.widgets||[],B=S.id;return e.jsxs("div",{className:"border rounded-md mb-4 overflow-hidden",children:[e.jsxs("div",{className:"bg-gray-50 px-3 py-2 text-xs font-medium text-gray-700 border-b",children:[K," (ID: ",B,")"]}),e.jsx("div",{className:"p-4 space-y-3",children:A.map((_,T)=>{const j=_.name;if(!r[j])return null;const w=n[B]?.[j]||[],C=Array.isArray(w)?`[${w.join(", ")}]`:JSON.stringify(w);return e.jsxs("div",{className:Tv.preventDefault()})})]},T)})})]},W)}):e.jsx("div",{className:"border rounded-md mb-4 p-4 text-center text-gray-500",children:"No nodes selected. Please select a node in the workflow to configure parameters."})]})},xt=({generatedImages:l,selectedImageIndex:n,handleSelectImage:r,handleApplySelected:u,handlePrevious:h,handleClose:d,currentPage:c,handlePageChange:g,imagesPerPage:f,notificationVisible:M,modalVisible:L,modalImageUrl:S,openImageModal:W,closeImageModal:K})=>{const A=Math.ceil(l.length/f),B=(c-1)*f,_=Math.min(B+f,l.length),T=l.slice(B,_);return e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-4",children:[e.jsxs("div",{className:"mb-4 border-b pb-2 flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-medium text-gray-800",children:"Generation Complete"}),e.jsxs("p",{className:"text-xs text-gray-500",children:["All ",l.length," images have been generated."]})]}),e.jsx("button",{className:"text-gray-400 hover:text-gray-600",onClick:d,children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),M&&e.jsx("div",{className:"fixed top-4 right-4 bg-green-100 border-l-4 border-green-500 text-green-700 p-3 shadow-md rounded animate-fade-in-out z-50",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"py-1",children:e.jsx("svg",{className:"h-4 w-4 text-green-500 mr-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),e.jsx("p",{className:"text-xs",children:"Parameters has been applied."})]})}),L&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center z-50",onClick:K,children:e.jsxs("div",{className:"bg-white rounded-lg p-2 max-w-4xl max-h-[90vh] relative",onClick:j=>j.stopPropagation(),children:[e.jsx("button",{className:"absolute top-2 right-2 text-gray-700 hover:text-gray-900 rounded-full hover:bg-gray-200 p-1",onClick:K,children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),e.jsx("div",{className:"overflow-auto max-h-[calc(90vh-4rem)]",children:e.jsx("img",{src:S,alt:"Enlarged image",className:"max-w-full h-auto"})})]})}),e.jsx("div",{className:"grid grid-cols-3 gap-4 mb-6",children:T.map((j,w)=>{const C=B+w;return e.jsxs("div",{className:`relative rounded-lg overflow-hidden border ${n===C?"border-pink-500 ring-2 ring-pink-300":"border-gray-200"}`,onClick:v=>r(C,v),children:[e.jsx("button",{className:"absolute top-2 right-2 bg-white bg-opacity-75 rounded-full p-0.5 text-gray-600 hover:text-gray-900 shadow-sm z-10",onClick:v=>W(j.url,v),children:e.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5v-4m0 4h-4m4 0l-5-5"})})}),e.jsx("div",{className:"aspect-square",children:e.jsx("img",{src:j.url,alt:`Generated image ${C+1}`,className:"w-full h-full object-cover"})}),e.jsx("div",{className:"p-2 text-xs text-gray-600 bg-white max-h-16 overflow-y-auto",children:Object.entries(j.params).filter(([v,P])=>v!=="nodeParams"&&typeof P!="object").map(([v,P])=>e.jsxs("div",{children:[v,": ",String(P)]},v))})]},C)})}),A>1&&e.jsxs("div",{className:"flex justify-center items-center space-x-2 mt-4 mb-4",children:[e.jsx("button",{onClick:j=>g(1,j),disabled:c===1,className:`px-2 py-1 rounded ${c===1?"text-gray-400 cursor-not-allowed":"text-gray-700 hover:bg-gray-100"}`,children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:[e.jsx("path",{fillRule:"evenodd",d:"M15.707 15.707a1 1 0 01-1.414 0l-5-5a1 1 0 010-1.414l5-5a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 010 1.414z",clipRule:"evenodd"}),e.jsx("path",{fillRule:"evenodd",d:"M8.707 15.707a1 1 0 01-1.414 0l-5-5a1 1 0 010-1.414l5-5a1 1 0 111.414 1.414L4.414 10l4.293 4.293a1 1 0 010 1.414z",clipRule:"evenodd"})]})}),e.jsx("button",{onClick:j=>g(c-1,j),disabled:c===1,className:`px-2 py-1 rounded ${c===1?"text-gray-400 cursor-not-allowed":"text-gray-700 hover:bg-gray-100"}`,children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z",clipRule:"evenodd"})})}),e.jsxs("div",{className:"px-2 py-1 text-xs text-gray-800",children:["Page ",c," of ",A]}),e.jsx("button",{onClick:j=>g(c+1,j),disabled:c===A,className:`px-2 py-1 rounded ${c===A?"text-gray-400 cursor-not-allowed":"text-gray-700 hover:bg-gray-100"}`,children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})})}),e.jsx("button",{onClick:j=>g(A,j),disabled:c===A,className:`px-2 py-1 rounded ${c===A?"text-gray-400 cursor-not-allowed":"text-gray-700 hover:bg-gray-100"}`,children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:[e.jsx("path",{fillRule:"evenodd",d:"M4.293 15.707a1 1 0 001.414 0l5-5a1 1 0 000-1.414l-5-5a1 1 0 00-1.414 1.414L8.586 10 4.293 14.293a1 1 0 000 1.414z",clipRule:"evenodd"}),e.jsx("path",{fillRule:"evenodd",d:"M11.293 15.707a1 1 0 001.414 0l5-5a1 1 0 000-1.414l-5-5a1 1 0 00-1.414 1.414L15.586 10l-4.293 4.293a1 1 0 000 1.414z",clipRule:"evenodd"})]})})]}),e.jsxs("div",{className:"mt-6 flex justify-between",children:[e.jsx("button",{onClick:j=>h(j),className:"px-3 py-1.5 text-xs bg-gray-100 text-gray-800 rounded-md hover:bg-gray-200 transition-colors",children:"Previous"}),e.jsx("button",{onClick:j=>u(j),className:"px-3 py-1.5 text-xs bg-pink-200 text-pink-700 rounded-md hover:bg-pink-300 transition-colors",disabled:n===null,children:"Apply Selected"})]})]})},ut=({visible:l,aiWritingModalText:n,setAiWritingModalText:r,aiGeneratedTexts:u,aiSelectedTexts:h,aiWritingLoading:d,aiWritingError:c,handleAiWriting:g,toggleTextSelection:f,addSelectedTexts:M,onClose:L})=>l?e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white rounded-lg shadow-lg w-full max-w-2xl max-h-[90vh] flex flex-col",children:[e.jsxs("div",{className:"p-4 border-b flex justify-between items-center",children:[e.jsx("h3",{className:"text-lg font-medium",children:"AI Writing Assistant"}),e.jsx("button",{className:"text-gray-400 hover:text-gray-600",onClick:L,children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsxs("div",{className:"p-4 overflow-y-auto flex-1",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Enter text and AI will generate variations"}),e.jsx("textarea",{className:"w-full border border-gray-300 rounded-md p-2 text-sm",rows:3,placeholder:"Enter some text here...",value:n,onChange:S=>r(S.target.value)}),e.jsx("button",{className:"mt-2 px-4 py-2 bg-blue-100 text-blue-700 rounded-md text-sm flex items-center hover:bg-blue-200 transition-colors",onClick:g,disabled:d,children:d?e.jsxs(e.Fragment,{children:[e.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-blue-700",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Generating..."]}):e.jsx(e.Fragment,{children:"Generate"})})]}),c&&e.jsx("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-md text-red-600 text-sm",children:c}),u.length>0&&e.jsxs("div",{className:"mb-4",children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"Generated variations (select items to add):"}),e.jsx("div",{className:"space-y-2 max-h-[40vh] overflow-y-auto p-2",children:u.map((S,W)=>e.jsxs("div",{className:"flex items-start border border-gray-200 rounded-md p-2",children:[e.jsx("div",{className:"mr-2 mt-1",children:e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"checkbox",id:`text${W+1}`,checked:!!h[`text${W+1}`],onChange:()=>f(`text${W+1}`),className:"sr-only"}),e.jsx("div",{className:`h-4 w-4 rounded border ${h[`text${W+1}`]?"bg-blue-600 border-blue-600":"bg-white border-gray-300"} flex items-center justify-center`,onClick:()=>f(`text${W+1}`),children:h[`text${W+1}`]&&e.jsx("svg",{className:"h-3 w-3 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})})]})}),e.jsx("label",{htmlFor:`text${W+1}`,className:"text-sm text-gray-700 cursor-pointer flex-1",children:S})]},W))})]})]}),e.jsxs("div",{className:"p-4 border-t flex justify-end flex-shrink-0",children:[e.jsx("button",{className:"px-4 py-2 bg-gray-100 text-gray-700 rounded-md text-sm mr-2 hover:bg-gray-200 transition-colors",onClick:L,children:"Cancel"}),e.jsx("button",{className:"px-4 py-2 bg-blue-500 text-white rounded-md text-sm hover:bg-blue-600 transition-colors",onClick:M,disabled:Object.values(h).every(S=>!S),children:"Add Selected"})]})]})}):null,ye=l=>{const n=[],r={};if(Object.keys(l).forEach(d=>{const c=parseInt(d),g=l[d]||{},f=Object.keys(g).filter(L=>g[L]&&g[L].length>0);if(f.length===0)return;const M=[[]];f.forEach(L=>{const S=g[L],W=[];M.forEach(K=>{S.forEach(A=>{const B=[...K,{nodeId:c,paramName:L,paramValue:String(A)}];W.push(B)})}),M.length=0,M.push(...W)}),r[d]=M}),Object.keys(r).length===0)return n;if(Object.keys(r).length===1){const d=Object.keys(r)[0];return r[d]}const u=Object.keys(r);let h=r[u[0]];for(let d=1;d{c.forEach(M=>{g.push([...f,...M])})}),h=g}return h},mt=(l,n)=>{const r={};r.nodeParams={};const u=ye(l);return n{const c=d.nodeId.toString(),g=d.paramName,f=d.paramValue;r.nodeParams[c]||(r.nodeParams[c]={}),r.nodeParams[c][g]=f,r[g]=f}),r},ht=` + @keyframes highlight-pulse { + 0% { + box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5); + } + 70% { + box-shadow: 0 0 0 15px rgba(59, 130, 246, 0); + } + 100% { + box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); + } + } + + .highlight-pulse { + animation: highlight-pulse 1.5s infinite; + border: 2px solid #3b82f6; + } + + @keyframes fade-in-out { + 0% { opacity: 0; transform: translateY(-20px); } + 10% { opacity: 1; transform: translateY(0); } + 90% { opacity: 1; transform: translateY(0); } + 100% { opacity: 0; transform: translateY(-20px); } + } + + .animate-fade-in-out { + animation: fade-in-out 3s forwards; + } +`,vt=({selectedNodes:l,visible:n,onClose:r})=>{const[u,h]=b.useState(0),[d,c]=b.useState({Steps:!0,CFG:!0,sampler_name:!0,threshold:!1,prompt:!1}),[g,f]=b.useState(!1),[M,L]=b.useState(!1),[S,W]=b.useState(0),[K,A]=b.useState(12),[B,_]=b.useState(null),[T,j]=b.useState(()=>Array(12).fill(null).map((t,s)=>({url:`https://source.unsplash.com/random/300x300?sig=${Math.random()}`,params:{step:s%3===0?5:s%3===1?10:15,sampler_name:"euler",cfg:1}}))),[w,C]=b.useState({}),[v,P]=b.useState({}),[V,q]=b.useState({}),[m,I]=b.useState({}),[Y,x]=b.useState(1),F=6,[D,N]=b.useState(null),[p,G]=b.useState(!1),[H,J]=b.useState(!1),[E,O]=b.useState(""),[$,R]=b.useState({}),[Q,U]=b.useState(!1),[pe,ge]=b.useState(""),[ve,de]=b.useState([]),[Ee,xe]=b.useState(!1),[we,Ne]=b.useState(""),[ke,Ce]=b.useState(""),[$e,ne]=b.useState(null),[Se,oe]=b.useState({}),{dispatch:ae}=Ie(),ue=b.useRef(null),le=b.useRef(null),We=async()=>{if(!pe.trim()){ne("Please enter some text to generate variations");return}xe(!0),ne(null),de([]),oe({});try{const t=await Me.generateSDPrompts(pe);de(t);const s={};t.forEach((i,o)=>{s[`text${o+1}`]=!1}),oe(s)}catch(t){console.error("Error generating text:",t),ne("Failed to generate text variations. Please try again.")}finally{xe(!1)}},_e=(t,s,i,o)=>{const a=`${t}_${s}`;R(y=>{const z=[...y[a]||[]];return z[i]=o,{...y,[a]:z}});const k=[...$[a]||[]];k[i]=o,ee(t,s,k)},De=(t,s)=>{const i=`${t}_${s}`;R(a=>{const k=[...a[i]||[]];return k.push(""),{...a,[i]:k}});const o=[...$[i]||[],""];ee(t,s,o)},Oe=(t,s,i)=>{const o=`${t}_${s}`;R(k=>{const y=[...k[o]||[]];return y.splice(i,1),{...k,[o]:y}});const a=[...$[o]||[]];a.splice(i,1),ee(t,s,a)},Ae=t=>{oe(s=>({...s,[t]:!s[t]}))},Be=()=>{const t=`${we}_${ke}`,s=Object.entries(Se).filter(([o,a])=>a).map(([o])=>{const a=parseInt(o.replace("text",""))-1;return ve[a]});if(s.length===0)return;R(o=>{const a=[...o[t]||[]];return{...o,[t]:[...a,...s]}});const i=[...$[t]||[],...s];ee(we,ke,i),U(!1)},Te=(t,s)=>{U(!0),Ne(t),Ce(s),ge(""),de([]),oe({}),xe(!1),ne(null)};b.useEffect(()=>{if(!l||l.length===0)return;const t={...w},s=l.map(o=>o.id.toString());Object.keys(t).forEach(o=>{s.includes(o)||delete t[o]}),l.forEach(o=>{const a=o.id.toString();t[a]||(t[a]={})}),JSON.stringify(t)!==JSON.stringify(w)&&C(t)},[l,w]),b.useEffect(()=>{ae({type:"SET_SCREEN_STATE",payload:{currentScreen:u,isProcessing:g,isCompleted:M}})},[u,g,M,ae]),b.useEffect(()=>{const t=document.createElement("style");return t.textContent=ht,document.head.appendChild(t),()=>{document.head.removeChild(t)}},[]),b.useEffect(()=>{const t=s=>{if(Object.values(v).some(i=>i)){const i=s.target,o=!!i.closest(".dropdown-menu"),a=!!i.closest("[data-dropdown]");!o&&!a&&P({})}};return document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}},[v]);const Le=t=>{if(t&&(t.preventDefault(),t.stopPropagation()),u===0){const s={...w};Object.keys(s).forEach(i=>{const o=s[i];Object.keys(o).forEach(a=>{d[a]||delete o[a]})}),C(s)}if(u===1){const s={...w};l.forEach(o=>{const a=o.id.toString(),k=o.widgets||{};Object.values(k).forEach(y=>{const z=y.name;if(d[z]&&(y.type==="customtext"||y.type.toLowerCase().includes("text"))){const te=`${a}_${z}`,se=$[te]||[""];s[a]=s[a]||{},s[a][z]=se}})}),C(s);const i=ye(s);A(i.length)}N(null),h(s=>Math.min(s+1,2))},fe=t=>{if(t&&(t.preventDefault(),t.stopPropagation()),N(null),M&&L(!1),u===1){const s=l.map(a=>a.id.toString()),i=Object.keys(w),o={...w};i.forEach(a=>{s.includes(a)||delete o[a]}),C(o)}if(u===2||M){const s={...w};Object.entries($).forEach(([i,o])=>{if(!o||o.length===0)return;const[a,k]=i.split("_");l.some(y=>y.id.toString()===a)&&(s[a]=s[a]||{},JSON.stringify(s[a][k])!==JSON.stringify(o)&&(s[a][k]=o))}),C(s)}h(s=>Math.max(s-1,0))},Re=(t,s)=>{s&&(s.preventDefault(),s.stopPropagation());const i=d[t];if(c(o=>({...o,[t]:!i})),i){const o={...w};Object.keys(o).forEach(a=>{o[a][t]&&delete o[a][t]}),C(o)}},ze=(t,s,i)=>{i.preventDefault(),i.stopPropagation();const o=`${t}_${s}`;P(a=>{if(a[o]&&typeof a[o]=="object"?a[o].isOpen:!!a[o])return{...a,[o]:!1};{let y=0,z=0;if(i.currentTarget){const ce=i.currentTarget.getBoundingClientRect();y=ce.left,z=ce.bottom}else y=i.clientX,z=i.clientY+20;const te=window.innerWidth,se=250;return y+se>te&&(y=te-se-10),y<0&&(y=10),{...a,[o]:{isOpen:!0,x:y,y:z}}}})},ee=(t,s,i)=>{C(o=>{const a={...o};return a[t]||(a[t]={}),a[t][s]=i,a})},Fe=(t,s,i,o)=>{o&&(o.preventDefault(),o.stopPropagation()),C(a=>{const k={...a};k[t]||(k[t]={}),k[t][s]||(k[t][s]=[]);const y=k[t][s];return y.includes(i)?k[t][s]=y.filter(z=>z!==i):k[t][s]=[...y,i],k})},Ge=(t,s,i)=>{const o=`${t}_${s}`;q(a=>({...a,[o]:i}))},Ve=(t,s,i)=>{if(!w[t]){ee(t,s,i);return}const o=w[t][s]||[];i.length===o.length?ee(t,s,[]):ee(t,s,[...i])},Ue=(t,s)=>{s&&(s.preventDefault(),s.stopPropagation()),x(Math.max(1,Math.min(t,Math.ceil(T.length/F))))},me=()=>{ue.current&&(clearTimeout(ue.current),ue.current=null),le.current=null};b.useEffect(()=>()=>{me()},[]);const He=async(t,s)=>{t&&(t.preventDefault(),t.stopPropagation()),me();const i=ye(w),o=i.length;if(o>100){N(`Cannot generate more than 100 images at once (currently: ${o} images)`);return}if(N(null),f(!0),W(0),console.log("Generated parameter combinations:",i),i.length===0){N("No valid parameter combinations found. Please check your parameter selections."),f(!1);return}let a=s||null;if(a===null){const y=ot();y!==null&&(a=y)}if(a===null){N("Please select a SaveImage or PreviewImage node first."),f(!1);return}const k=[];try{const y=Date.now().toString();le.current=y;for(const re of i){const X=await rt(re);X.prompt_id?k.push(X.prompt_id):(console.error("Failed to get prompt_id from response:",X),k.push(""))}const z=Array(i.length).fill(null).map((re,X)=>({url:`https://source.unsplash.com/random/300x300?sig=${Math.random()}`,params:mt(w,X)}));j(z);const te=Date.now(),se=5*60*1e3,ce=async()=>{if(le.current!==y){console.log("Another polling session has started, stopping this one");return}if(Date.now()-te>se){console.log("Timeout reached while waiting for images"),le.current===y&&(f(!1),L(!0),x(1));return}let re=0;for(let X=0;X{s&&(s.preventDefault(),s.stopPropagation()),_(t)},Je=(t,s)=>{s.preventDefault(),s.stopPropagation(),O(t),J(!0)},qe=t=>{t&&(t.preventDefault(),t.stopPropagation()),J(!1)},Ye=async t=>{if(t&&(t.preventDefault(),t.stopPropagation()),B!==null){console.log(`Applied image ${B+1} with parameters:`,T[B].params),Me.trackEvent({event_type:"parameter_debug_apply",message_type:"parameter_debug",message_id:tt(),data:{workflow:(await Z.graphToPrompt()).output,selected_params:T[B].params,all_params:w,count:Object.keys(w).length}});const s=T[B].params;s.nodeParams&&(Object.entries(s.nodeParams).forEach(([i,o])=>{const a=Z.graph._nodes_by_id[i];!a||!a.widgets||Object.entries(o).forEach(([k,y])=>{for(const z of a.widgets)if(z.name===k){z.value=y;break}})}),Z.graph.setDirtyCanvas(!1,!0),G(!0),setTimeout(()=>{G(!1)},3e3))}},ie=(t,s)=>{if(t&&(t.preventDefault(),t.stopPropagation()),u===1&&s!==void 0){const i=[...l],o=i[s];if(i.splice(s,1),o){const a=o.id.toString();C(k=>{const y={...k};return delete y[a],y})}i.length===0?r&&(ae({type:"SET_SCREEN_STATE",payload:null}),be(),r()):ae({type:"SET_SELECTED_NODE",payload:i});return}r?(ae({type:"SET_SCREEN_STATE",payload:null}),be(),r()):be()},be=()=>{h(0),c({Steps:!0,CFG:!0,sampler_name:!0,threshold:!1,prompt:!1}),me(),f(!1),L(!1),W(0),A(12),_(null),j(Array(12).fill(null).map((t,s)=>({url:`https://source.unsplash.com/random/300x300?sig=${Math.random()}`,params:{step:s%3===0?5:s%3===1?10:15,sampler_name:"euler",cfg:1}}))),C({}),P({}),q({}),I({}),x(1),N(null),G(!1),J(!1),O(""),R({}),U(!1),ge(""),de([]),xe(!1),Ne(""),Ce(""),ne(null),oe({})};return!n||l.length===0?e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-8 bg-gray-50 overflow-y-auto",onClick:t=>t.stopPropagation(),children:e.jsxs("div",{className:"max-w-lg p-8 bg-white rounded-lg shadow-sm border border-blue-100 relative",children:[e.jsxs("div",{className:"mb-6 text-center",children:[e.jsx("h3",{className:"text-base font-bold text-blue-800 mb-2",children:"GenLab"}),e.jsx("div",{className:"h-1 w-16 bg-blue-500 mx-auto rounded-full mb-4"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx("div",{className:"bg-blue-100 p-2 rounded-full text-blue-600",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{d:"M5 3a2 2 0 00-2 2v2a2 2 0 002 2h2a2 2 0 002-2V5a2 2 0 00-2-2H5zM5 11a2 2 0 00-2 2v2a2 2 0 002 2h2a2 2 0 002-2v-2a2 2 0 00-2-2H5zM11 5a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V5zM11 13a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"})})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-gray-800",children:"Batch Test Parameter Pairs"}),e.jsx("p",{className:"text-xs text-gray-600",children:"Select a node to batch test parameter pairs"})]})]}),e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx("div",{className:"bg-indigo-100 p-2 rounded-full text-indigo-600",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-gray-800",children:"How To Use"}),e.jsx("p",{className:"text-xs text-gray-600",children:"Click on any node in your workflow to start the parameter testing process"})]})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsx("p",{className:"text-xs text-gray-600 mb-3",children:"No node is currently selected"})})]})]})}):M?e.jsx("div",{className:"flex-1 overflow-y-auto bg-gray-50 p-4",onClick:t=>t.stopPropagation(),children:e.jsx(xt,{generatedImages:T,selectedImageIndex:B,handleSelectImage:Ke,handleApplySelected:Ye,handlePrevious:fe,handleClose:ie,currentPage:Y,handlePageChange:Ue,imagesPerPage:F,notificationVisible:p,modalVisible:H,modalImageUrl:E,openImageModal:Je,closeImageModal:qe})}):g?e.jsx("div",{className:"flex-1 overflow-y-auto bg-gray-50 p-4",onClick:t=>t.stopPropagation(),children:e.jsx(dt,{selectedNodes:l,paramTestValues:w,selectedParams:d,totalCount:K,completedCount:S,errorMessage:D,handleClose:ie,setIsProcessing:f,setCurrentScreen:h,cleanupPolling:me})}):u===0?e.jsx("div",{className:"flex-1 overflow-y-auto bg-gray-50 p-4",onClick:t=>t.stopPropagation(),children:e.jsx(lt,{selectedNodes:l,handleParamSelect:Re,selectedParams:d,handleNext:Le,handleClose:ie})}):u===1?e.jsxs("div",{className:"flex-1 overflow-y-auto bg-gray-50 p-4",onClick:t=>t.stopPropagation(),children:[e.jsx(it,{selectedNodes:l,paramTestValues:w,selectedParams:d,updateParamTestValues:ee,toggleDropdown:ze,openDropdowns:v,handleTestValueSelect:Fe,searchTerms:V,handleSearch:Ge,handleSelectAll:Ve,handleNext:Le,handlePrevious:fe,handleClose:ie,inputValues:m,setInputValues:I,textInputs:$,handleTextInputChange:_e,handleAddTextInput:De,handleRemoveTextInput:Oe,openAiWritingModal:Te}),e.jsx(ut,{visible:Q,aiWritingModalText:pe,setAiWritingModalText:ge,aiGeneratedTexts:ve,aiSelectedTexts:Se,aiWritingLoading:Ee,aiWritingError:$e,handleAiWriting:We,toggleTextSelection:Ae,addSelectedTexts:Be,onClose:()=>U(!1)})]}):e.jsx("div",{className:"flex-1 overflow-y-auto bg-gray-50 p-4",onClick:t=>t.stopPropagation(),children:e.jsx(ct,{selectedNodes:l,paramTestValues:w,selectedParams:d,totalCount:K,errorMessage:D,handlePrevious:fe,handleStartGeneration:He,handleClose:ie})})};export{vt as ParameterDebugInterface}; diff --git a/dist/copilot_web/WorkflowOption-BSTBilSm.js b/dist/copilot_web/WorkflowOption-DWEyFLfP.js similarity index 98% rename from dist/copilot_web/WorkflowOption-BSTBilSm.js rename to dist/copilot_web/WorkflowOption-DWEyFLfP.js index 6fdf63f..74cc986 100644 --- a/dist/copilot_web/WorkflowOption-BSTBilSm.js +++ b/dist/copilot_web/WorkflowOption-DWEyFLfP.js @@ -1 +1 @@ -import{j as t}from"./vendor-markdown-Dek94WS0.js";import{W as f,g as u,a as p}from"./message-components-B6pkQvDp.js";import{r as N}from"./vendor-react-V04_Axys.js";function z({content:v,name:C="Assistant",avatar:_,latestInput:y,installedNodes:k,onAddMessage:g}){const h=JSON.parse(v),w=h.ext?.find(e=>e.type==="workflow")?.data||[],[i,d]=N.useState({}),b=async e=>{if(!e.id){console.error("No workflow id provided");return}const r=String(e.id);if(!i[r]){d(o=>({...o,[r]:!0})),f.trackEvent({event_type:"workflow_accept",message_type:"workflow",message_id:h.message_id,data:{workflow_id:e.id,workflow_name:e.name}});try{const o=await f.getOptimizedWorkflow(e.id,y);if(o.workflow){const n=new Set;for(const s of o.workflow.nodes)n.add(s.type);const a=Array.from(n).filter(s=>!k.includes(s));if(console.log("[WorkflowOption] Missing node types:",a),a.length>0){try{console.log("[WorkflowOption] Fetching info for missing nodes");const s=await f.batchGetNodeInfo(a);console.log("[WorkflowOption] Received node infos:",s);const c={text:"",ext:[{type:"node_install_guide",data:s.map(l=>({name:l.name,repository_url:l.github_url}))}]},m={id:u(),role:"ai",content:JSON.stringify(c),format:"markdown",name:"Assistant",metadata:{pendingWorkflow:o.workflow,optimizedParams:o.optimized_params}};g?.(m)}catch(s){console.error("[WorkflowOption] Error fetching node info:",s),alert("Error checking required nodes. Please try again.")}finally{d(s=>({...s,[r]:!1}))}return}j(o.workflow,o.optimized_params)}}catch(o){console.error("Failed to optimize workflow:",o),alert("Failed to optimize workflow. Please try again.")}finally{d(o=>({...o,[r]:!1}))}}},j=(e,r)=>{p.loadGraphData(e);for(const[n,a,s,c,m]of r){const l=p.graph._nodes_by_id[n].widgets;for(const x of l)x.name===c&&(x.value=m)}p.graph.setDirtyCanvas(!1,!0);const o={id:u(),role:"tool",content:JSON.stringify({text:"The workflow has been successfully loaded to the canvas",ext:[]}),format:"markdown",name:"Assistant"};g?.(o)};return t.jsx("div",{className:"space-y-3",children:w.length>0&&t.jsx("div",{className:"flex flex-col space-y-4",children:w.map((e,r)=>{const o=e.id?String(e.id):"";return t.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-lg border border-gray-200 hover:bg-gray-50",children:[e.image&&t.jsx("img",{src:e.image,alt:e.name,className:"w-14 h-14 object-cover rounded-lg",onError:n=>{const a=n.target;a.onerror=null,a.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56' fill='none'%3E%3Crect width='56' height='56' fill='%23F3F4F6'/%3E%3Cpath d='M28 28C30.2091 28 32 26.2091 32 24C32 21.7909 30.2091 20 28 20C25.7909 20 24 21.7909 24 24C24 26.2091 25.7909 28 28 28Z' fill='%239CA3AF'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M18.7253 37.6307C19.8278 35.1533 22.6897 33.6 26 33.6H30C33.3103 33.6 36.1722 35.1533 37.2747 37.6307C37.6419 38.4561 37.0611 39.2 36.1694 39.2H19.8306C18.9389 39.2 18.3581 38.4561 18.7253 37.6307Z' fill='%239CA3AF'/%3E%3C/svg%3E"}}),t.jsxs("div",{className:"flex-1 break-words flex flex-col h-[4.5rem] justify-between",children:[t.jsx("div",{children:t.jsx("h3",{className:"font-medium text-sm line-clamp-2 h-10 overflow-hidden",children:e.name})}),t.jsxs("div",{className:"flex justify-between items-center mt-1",children:[e.description&&t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"w-5 h-5 flex items-center justify-center text-gray-500 cursor-help",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-4 h-4",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"})})}),t.jsx("div",{className:"absolute bottom-full left-0 mb-2 hidden group-hover:block",children:t.jsx("div",{className:"bg-gray-900 text-white text-xs rounded-md py-2 px-3 min-w-[400px] whitespace-normal break-words",children:e.description})})]}),t.jsx("button",{onClick:()=>b(e),disabled:i[o],className:`px-3 py-1.5 ${i[o]?"bg-gray-400 cursor-not-allowed":"bg-blue-500 hover:bg-blue-600"} text-white rounded-md transition-colors text-xs`,children:i[o]?"Loading...":"Accept"})]})]})]},r)})})})}export{z as WorkflowOption}; +import{j as t}from"./vendor-markdown-Dek94WS0.js";import{W as f,g as u,a as p}from"./message-components-D3rPBq8S.js";import{r as N}from"./vendor-react-V04_Axys.js";function z({content:v,name:C="Assistant",avatar:_,latestInput:y,installedNodes:k,onAddMessage:g}){const h=JSON.parse(v),w=h.ext?.find(e=>e.type==="workflow")?.data||[],[i,d]=N.useState({}),b=async e=>{if(!e.id){console.error("No workflow id provided");return}const r=String(e.id);if(!i[r]){d(o=>({...o,[r]:!0})),f.trackEvent({event_type:"workflow_accept",message_type:"workflow",message_id:h.message_id,data:{workflow_id:e.id,workflow_name:e.name}});try{const o=await f.getOptimizedWorkflow(e.id,y);if(o.workflow){const n=new Set;for(const s of o.workflow.nodes)n.add(s.type);const a=Array.from(n).filter(s=>!k.includes(s));if(console.log("[WorkflowOption] Missing node types:",a),a.length>0){try{console.log("[WorkflowOption] Fetching info for missing nodes");const s=await f.batchGetNodeInfo(a);console.log("[WorkflowOption] Received node infos:",s);const c={text:"",ext:[{type:"node_install_guide",data:s.map(l=>({name:l.name,repository_url:l.github_url}))}]},m={id:u(),role:"ai",content:JSON.stringify(c),format:"markdown",name:"Assistant",metadata:{pendingWorkflow:o.workflow,optimizedParams:o.optimized_params}};g?.(m)}catch(s){console.error("[WorkflowOption] Error fetching node info:",s),alert("Error checking required nodes. Please try again.")}finally{d(s=>({...s,[r]:!1}))}return}j(o.workflow,o.optimized_params)}}catch(o){console.error("Failed to optimize workflow:",o),alert("Failed to optimize workflow. Please try again.")}finally{d(o=>({...o,[r]:!1}))}}},j=(e,r)=>{p.loadGraphData(e);for(const[n,a,s,c,m]of r){const l=p.graph._nodes_by_id[n].widgets;for(const x of l)x.name===c&&(x.value=m)}p.graph.setDirtyCanvas(!1,!0);const o={id:u(),role:"tool",content:JSON.stringify({text:"The workflow has been successfully loaded to the canvas",ext:[]}),format:"markdown",name:"Assistant"};g?.(o)};return t.jsx("div",{className:"space-y-3",children:w.length>0&&t.jsx("div",{className:"flex flex-col space-y-4",children:w.map((e,r)=>{const o=e.id?String(e.id):"";return t.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-lg border border-gray-200 hover:bg-gray-50",children:[e.image&&t.jsx("img",{src:e.image,alt:e.name,className:"w-14 h-14 object-cover rounded-lg",onError:n=>{const a=n.target;a.onerror=null,a.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56' fill='none'%3E%3Crect width='56' height='56' fill='%23F3F4F6'/%3E%3Cpath d='M28 28C30.2091 28 32 26.2091 32 24C32 21.7909 30.2091 20 28 20C25.7909 20 24 21.7909 24 24C24 26.2091 25.7909 28 28 28Z' fill='%239CA3AF'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M18.7253 37.6307C19.8278 35.1533 22.6897 33.6 26 33.6H30C33.3103 33.6 36.1722 35.1533 37.2747 37.6307C37.6419 38.4561 37.0611 39.2 36.1694 39.2H19.8306C18.9389 39.2 18.3581 38.4561 18.7253 37.6307Z' fill='%239CA3AF'/%3E%3C/svg%3E"}}),t.jsxs("div",{className:"flex-1 break-words flex flex-col h-[4.5rem] justify-between",children:[t.jsx("div",{children:t.jsx("h3",{className:"font-medium text-sm line-clamp-2 h-10 overflow-hidden",children:e.name})}),t.jsxs("div",{className:"flex justify-between items-center mt-1",children:[e.description&&t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"w-5 h-5 flex items-center justify-center text-gray-500 cursor-help",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-4 h-4",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"})})}),t.jsx("div",{className:"absolute bottom-full left-0 mb-2 hidden group-hover:block",children:t.jsx("div",{className:"bg-gray-900 text-white text-xs rounded-md py-2 px-3 min-w-[400px] whitespace-normal break-words",children:e.description})})]}),t.jsx("button",{onClick:()=>b(e),disabled:i[o],className:`px-3 py-1.5 ${i[o]?"bg-gray-400 cursor-not-allowed":"bg-blue-500 hover:bg-blue-600"} text-white rounded-md transition-colors text-xs`,children:i[o]?"Loading...":"Accept"})]})]})]},r)})})})}export{z as WorkflowOption}; diff --git a/dist/copilot_web/assets/input-CJq8z6H1.css b/dist/copilot_web/assets/input-CJq8z6H1.css deleted file mode 100644 index c0cc0ac..0000000 --- a/dist/copilot_web/assets/input-CJq8z6H1.css +++ /dev/null @@ -1 +0,0 @@ -#comfyui-copilot-plugin *,#comfyui-copilot-plugin :before,#comfyui-copilot-plugin :after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }#comfyui-copilot-plugin ::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }#comfyui-copilot-plugin .container{width:100%}@media (min-width: 640px){#comfyui-copilot-plugin .container{max-width:640px}}@media (min-width: 768px){#comfyui-copilot-plugin .container{max-width:768px}}@media (min-width: 1024px){#comfyui-copilot-plugin .container{max-width:1024px}}@media (min-width: 1280px){#comfyui-copilot-plugin .container{max-width:1280px}}@media (min-width: 1536px){#comfyui-copilot-plugin .container{max-width:1536px}}#comfyui-copilot-plugin .prose{color:var(--tw-prose-body);max-width:65ch}#comfyui-copilot-plugin .prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}#comfyui-copilot-plugin .prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}#comfyui-copilot-plugin .prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}#comfyui-copilot-plugin .prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}#comfyui-copilot-plugin .prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}#comfyui-copilot-plugin .prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}#comfyui-copilot-plugin .prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}#comfyui-copilot-plugin .prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}#comfyui-copilot-plugin .prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}#comfyui-copilot-plugin .prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}#comfyui-copilot-plugin .prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}#comfyui-copilot-plugin .prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}#comfyui-copilot-plugin .prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}#comfyui-copilot-plugin .prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}#comfyui-copilot-plugin .prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}#comfyui-copilot-plugin .prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}#comfyui-copilot-plugin .prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}#comfyui-copilot-plugin .prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}#comfyui-copilot-plugin .prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}#comfyui-copilot-plugin .prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}#comfyui-copilot-plugin .prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}#comfyui-copilot-plugin .prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}#comfyui-copilot-plugin .prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}#comfyui-copilot-plugin .prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}#comfyui-copilot-plugin .prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}#comfyui-copilot-plugin .prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}#comfyui-copilot-plugin .prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}#comfyui-copilot-plugin .prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}#comfyui-copilot-plugin .prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}#comfyui-copilot-plugin .prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}#comfyui-copilot-plugin .prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}#comfyui-copilot-plugin .prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}#comfyui-copilot-plugin .prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}#comfyui-copilot-plugin .prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}#comfyui-copilot-plugin .prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}#comfyui-copilot-plugin .prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}#comfyui-copilot-plugin .prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}#comfyui-copilot-plugin .prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}#comfyui-copilot-plugin .prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}#comfyui-copilot-plugin .prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}#comfyui-copilot-plugin .prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}#comfyui-copilot-plugin .prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}#comfyui-copilot-plugin .prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}#comfyui-copilot-plugin .prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}#comfyui-copilot-plugin .prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}#comfyui-copilot-plugin .prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}#comfyui-copilot-plugin .prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}#comfyui-copilot-plugin .prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}#comfyui-copilot-plugin .prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}#comfyui-copilot-plugin .prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}#comfyui-copilot-plugin .prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}#comfyui-copilot-plugin .prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}#comfyui-copilot-plugin .prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}#comfyui-copilot-plugin .prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}#comfyui-copilot-plugin .prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}#comfyui-copilot-plugin .prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}#comfyui-copilot-plugin .prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}#comfyui-copilot-plugin .prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}#comfyui-copilot-plugin .prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}#comfyui-copilot-plugin .prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}#comfyui-copilot-plugin .prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}#comfyui-copilot-plugin .prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}#comfyui-copilot-plugin .prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}#comfyui-copilot-plugin .prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}#comfyui-copilot-plugin .prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}#comfyui-copilot-plugin .prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}#comfyui-copilot-plugin .prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}#comfyui-copilot-plugin .prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}#comfyui-copilot-plugin .prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}#comfyui-copilot-plugin .prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}#comfyui-copilot-plugin .prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}#comfyui-copilot-plugin .prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}#comfyui-copilot-plugin .prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}#comfyui-copilot-plugin .prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}#comfyui-copilot-plugin .prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}#comfyui-copilot-plugin .prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}#comfyui-copilot-plugin .prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}#comfyui-copilot-plugin .prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}#comfyui-copilot-plugin .prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}#comfyui-copilot-plugin .prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}#comfyui-copilot-plugin .prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}#comfyui-copilot-plugin .prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}#comfyui-copilot-plugin .prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}#comfyui-copilot-plugin .prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}#comfyui-copilot-plugin .prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}#comfyui-copilot-plugin .prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}#comfyui-copilot-plugin .prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}#comfyui-copilot-plugin .prose-neutral{--tw-prose-body: #404040;--tw-prose-headings: #171717;--tw-prose-lead: #525252;--tw-prose-links: #171717;--tw-prose-bold: #171717;--tw-prose-counters: #737373;--tw-prose-bullets: #d4d4d4;--tw-prose-hr: #e5e5e5;--tw-prose-quotes: #171717;--tw-prose-quote-borders: #e5e5e5;--tw-prose-captions: #737373;--tw-prose-kbd: #171717;--tw-prose-kbd-shadows: 23 23 23;--tw-prose-code: #171717;--tw-prose-pre-code: #e5e5e5;--tw-prose-pre-bg: #262626;--tw-prose-th-borders: #d4d4d4;--tw-prose-td-borders: #e5e5e5;--tw-prose-invert-body: #d4d4d4;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #a3a3a3;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #a3a3a3;--tw-prose-invert-bullets: #525252;--tw-prose-invert-hr: #404040;--tw-prose-invert-quotes: #f5f5f5;--tw-prose-invert-quote-borders: #404040;--tw-prose-invert-captions: #a3a3a3;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d4d4d4;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #525252;--tw-prose-invert-td-borders: #404040}#comfyui-copilot-plugin .visible{visibility:visible}#comfyui-copilot-plugin .collapse{visibility:collapse}#comfyui-copilot-plugin .static{position:static}#comfyui-copilot-plugin .fixed{position:fixed}#comfyui-copilot-plugin .absolute{position:absolute}#comfyui-copilot-plugin .relative{position:relative}#comfyui-copilot-plugin .sticky{position:sticky}#comfyui-copilot-plugin .inset-0{inset:0}#comfyui-copilot-plugin .inset-y-0{top:0;bottom:0}#comfyui-copilot-plugin .-bottom-1{bottom:-.25rem}#comfyui-copilot-plugin .-right-1{right:-.25rem}#comfyui-copilot-plugin .-top-1{top:-.25rem}#comfyui-copilot-plugin .-top-10{top:-2.5rem}#comfyui-copilot-plugin .-top-6{top:-1.5rem}#comfyui-copilot-plugin .bottom-0{bottom:0}#comfyui-copilot-plugin .bottom-1{bottom:.25rem}#comfyui-copilot-plugin .bottom-2{bottom:.5rem}#comfyui-copilot-plugin .bottom-3{bottom:.75rem}#comfyui-copilot-plugin .bottom-full{bottom:100%}#comfyui-copilot-plugin .left-0{left:0}#comfyui-copilot-plugin .left-1\/2{left:50%}#comfyui-copilot-plugin .left-3{left:.75rem}#comfyui-copilot-plugin .right-0{right:0}#comfyui-copilot-plugin .right-1\.5{right:.375rem}#comfyui-copilot-plugin .right-12{right:3rem}#comfyui-copilot-plugin .right-2{right:.5rem}#comfyui-copilot-plugin .right-3{right:.75rem}#comfyui-copilot-plugin .top-0{top:0}#comfyui-copilot-plugin .top-1\/2{top:50%}#comfyui-copilot-plugin .top-2{top:.5rem}#comfyui-copilot-plugin .z-10{z-index:10}#comfyui-copilot-plugin .z-20{z-index:20}#comfyui-copilot-plugin .z-50{z-index:50}#comfyui-copilot-plugin .z-\[9999\]{z-index:9999}#comfyui-copilot-plugin .\!my-0\.5{margin-top:.125rem!important;margin-bottom:.125rem!important}#comfyui-copilot-plugin .\!my-1{margin-top:.25rem!important;margin-bottom:.25rem!important}#comfyui-copilot-plugin .mx-auto{margin-left:auto;margin-right:auto}#comfyui-copilot-plugin .-ml-1{margin-left:-.25rem}#comfyui-copilot-plugin .-ml-2{margin-left:-.5rem}#comfyui-copilot-plugin .mb-1{margin-bottom:.25rem}#comfyui-copilot-plugin .mb-2{margin-bottom:.5rem}#comfyui-copilot-plugin .mb-3{margin-bottom:.75rem}#comfyui-copilot-plugin .mb-4{margin-bottom:1rem}#comfyui-copilot-plugin .mb-6{margin-bottom:1.5rem}#comfyui-copilot-plugin .ml-3{margin-left:.75rem}#comfyui-copilot-plugin .mr-1{margin-right:.25rem}#comfyui-copilot-plugin .mr-2{margin-right:.5rem}#comfyui-copilot-plugin .mt-1{margin-top:.25rem}#comfyui-copilot-plugin .mt-12{margin-top:3rem}#comfyui-copilot-plugin .mt-2{margin-top:.5rem}#comfyui-copilot-plugin .mt-4{margin-top:1rem}#comfyui-copilot-plugin .line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}#comfyui-copilot-plugin .block{display:block}#comfyui-copilot-plugin .inline{display:inline}#comfyui-copilot-plugin .flex{display:flex}#comfyui-copilot-plugin .inline-flex{display:inline-flex}#comfyui-copilot-plugin .table{display:table}#comfyui-copilot-plugin .grid{display:grid}#comfyui-copilot-plugin .contents{display:contents}#comfyui-copilot-plugin .hidden{display:none}#comfyui-copilot-plugin .h-10{height:2.5rem}#comfyui-copilot-plugin .h-12{height:3rem}#comfyui-copilot-plugin .h-14{height:3.5rem}#comfyui-copilot-plugin .h-2{height:.5rem}#comfyui-copilot-plugin .h-20{height:5rem}#comfyui-copilot-plugin .h-3{height:.75rem}#comfyui-copilot-plugin .h-3\.5{height:.875rem}#comfyui-copilot-plugin .h-4{height:1rem}#comfyui-copilot-plugin .h-5{height:1.25rem}#comfyui-copilot-plugin .h-8{height:2rem}#comfyui-copilot-plugin .h-\[4\.5rem\]{height:4.5rem}#comfyui-copilot-plugin .h-auto{height:auto}#comfyui-copilot-plugin .h-full{height:100%}#comfyui-copilot-plugin .max-h-\[400px\]{max-height:400px}#comfyui-copilot-plugin .min-h-\[80px\]{min-height:80px}#comfyui-copilot-plugin .w-1{width:.25rem}#comfyui-copilot-plugin .w-1\/2{width:50%}#comfyui-copilot-plugin .w-12{width:3rem}#comfyui-copilot-plugin .w-14{width:3.5rem}#comfyui-copilot-plugin .w-2{width:.5rem}#comfyui-copilot-plugin .w-3{width:.75rem}#comfyui-copilot-plugin .w-3\.5{width:.875rem}#comfyui-copilot-plugin .w-4{width:1rem}#comfyui-copilot-plugin .w-40{width:10rem}#comfyui-copilot-plugin .w-5{width:1.25rem}#comfyui-copilot-plugin .w-64{width:16rem}#comfyui-copilot-plugin .w-8{width:2rem}#comfyui-copilot-plugin .w-96{width:24rem}#comfyui-copilot-plugin .w-\[100\%\]{width:100%}#comfyui-copilot-plugin .w-\[480px\]{width:480px}#comfyui-copilot-plugin .w-\[500px\]{width:500px}#comfyui-copilot-plugin .w-\[calc\(50\%-0\.25rem\)\]{width:calc(50% - .25rem)}#comfyui-copilot-plugin .w-full{width:100%}#comfyui-copilot-plugin .min-w-\[400px\]{min-width:400px}#comfyui-copilot-plugin .flex-1{flex:1 1 0%}#comfyui-copilot-plugin .flex-shrink-0{flex-shrink:0}#comfyui-copilot-plugin .-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#comfyui-copilot-plugin .-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#comfyui-copilot-plugin .-translate-y-full{--tw-translate-y: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#comfyui-copilot-plugin{@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}}#comfyui-copilot-plugin .animate-bounce{animation:bounce 1s infinite}#comfyui-copilot-plugin{@keyframes spin{to{transform:rotate(360deg)}}}#comfyui-copilot-plugin .animate-spin{animation:spin 1s linear infinite}#comfyui-copilot-plugin .cursor-ew-resize{cursor:ew-resize}#comfyui-copilot-plugin .cursor-help{cursor:help}#comfyui-copilot-plugin .cursor-not-allowed{cursor:not-allowed}#comfyui-copilot-plugin .cursor-ns-resize{cursor:ns-resize}#comfyui-copilot-plugin .cursor-pointer{cursor:pointer}#comfyui-copilot-plugin .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}#comfyui-copilot-plugin .resize-none{resize:none}#comfyui-copilot-plugin .resize{resize:both}#comfyui-copilot-plugin .grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}#comfyui-copilot-plugin .grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}#comfyui-copilot-plugin .flex-col{flex-direction:column}#comfyui-copilot-plugin .flex-wrap{flex-wrap:wrap}#comfyui-copilot-plugin .items-start{align-items:flex-start}#comfyui-copilot-plugin .items-center{align-items:center}#comfyui-copilot-plugin .justify-end{justify-content:flex-end}#comfyui-copilot-plugin .justify-center{justify-content:center}#comfyui-copilot-plugin .justify-between{justify-content:space-between}#comfyui-copilot-plugin .gap-1{gap:.25rem}#comfyui-copilot-plugin .gap-2{gap:.5rem}#comfyui-copilot-plugin .gap-3{gap:.75rem}#comfyui-copilot-plugin .gap-4{gap:1rem}#comfyui-copilot-plugin .space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}#comfyui-copilot-plugin .space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}#comfyui-copilot-plugin .space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}#comfyui-copilot-plugin .space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}#comfyui-copilot-plugin .overflow-hidden{overflow:hidden}#comfyui-copilot-plugin .overflow-visible{overflow:visible}#comfyui-copilot-plugin .overflow-x-auto{overflow-x:auto}#comfyui-copilot-plugin .overflow-y-auto{overflow-y:auto}#comfyui-copilot-plugin .scroll-smooth{scroll-behavior:smooth}#comfyui-copilot-plugin .whitespace-normal{white-space:normal}#comfyui-copilot-plugin .whitespace-nowrap{white-space:nowrap}#comfyui-copilot-plugin .whitespace-pre-wrap{white-space:pre-wrap}#comfyui-copilot-plugin .break-words{overflow-wrap:break-word}#comfyui-copilot-plugin .rounded{border-radius:.25rem}#comfyui-copilot-plugin .rounded-full{border-radius:9999px}#comfyui-copilot-plugin .rounded-lg{border-radius:.5rem}#comfyui-copilot-plugin .rounded-md{border-radius:.375rem}#comfyui-copilot-plugin .rounded-xl{border-radius:.75rem}#comfyui-copilot-plugin .border{border-width:1px}#comfyui-copilot-plugin .border-0{border-width:0px}#comfyui-copilot-plugin .border-2{border-width:2px}#comfyui-copilot-plugin .border-4{border-width:4px}#comfyui-copilot-plugin .border-b{border-bottom-width:1px}#comfyui-copilot-plugin .border-t{border-top-width:1px}#comfyui-copilot-plugin .border-solid{border-style:solid}#comfyui-copilot-plugin .border-dashed{border-style:dashed}#comfyui-copilot-plugin .border-none{border-style:none}#comfyui-copilot-plugin .border-\[\#979797\]{--tw-border-opacity: 1;border-color:rgb(151 151 151 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-gray-900{--tw-border-opacity: 1;border-color:rgb(17 24 39 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-transparent{border-color:transparent}#comfyui-copilot-plugin .border-t-blue-500{--tw-border-opacity: 1;border-top-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-t-gray-800{--tw-border-opacity: 1;border-top-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .bg-\[\#E5E7ED\]{--tw-bg-opacity: 1;background-color:rgb(229 231 237 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-black\/40{background-color:#0006}#comfyui-copilot-plugin .bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-transparent{background-color:transparent}#comfyui-copilot-plugin .bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-opacity-50{--tw-bg-opacity: .5}#comfyui-copilot-plugin .bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}#comfyui-copilot-plugin .from-amber-50{--tw-gradient-from: #fffbeb var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 251 235 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}#comfyui-copilot-plugin .to-amber-100{--tw-gradient-to: #fef3c7 var(--tw-gradient-to-position)}#comfyui-copilot-plugin .object-cover{-o-object-fit:cover;object-fit:cover}#comfyui-copilot-plugin .p-0\.5{padding:.125rem}#comfyui-copilot-plugin .p-1{padding:.25rem}#comfyui-copilot-plugin .p-1\.5{padding:.375rem}#comfyui-copilot-plugin .p-2{padding:.5rem}#comfyui-copilot-plugin .p-3{padding:.75rem}#comfyui-copilot-plugin .p-4{padding:1rem}#comfyui-copilot-plugin .p-6{padding:1.5rem}#comfyui-copilot-plugin .p-8{padding:2rem}#comfyui-copilot-plugin .px-1{padding-left:.25rem;padding-right:.25rem}#comfyui-copilot-plugin .px-1\.5{padding-left:.375rem;padding-right:.375rem}#comfyui-copilot-plugin .px-2{padding-left:.5rem;padding-right:.5rem}#comfyui-copilot-plugin .px-3{padding-left:.75rem;padding-right:.75rem}#comfyui-copilot-plugin .px-4{padding-left:1rem;padding-right:1rem}#comfyui-copilot-plugin .px-5{padding-left:1.25rem;padding-right:1.25rem}#comfyui-copilot-plugin .py-0\.5{padding-top:.125rem;padding-bottom:.125rem}#comfyui-copilot-plugin .py-1{padding-top:.25rem;padding-bottom:.25rem}#comfyui-copilot-plugin .py-1\.5{padding-top:.375rem;padding-bottom:.375rem}#comfyui-copilot-plugin .py-2{padding-top:.5rem;padding-bottom:.5rem}#comfyui-copilot-plugin .py-2\.5{padding-top:.625rem;padding-bottom:.625rem}#comfyui-copilot-plugin .py-3{padding-top:.75rem;padding-bottom:.75rem}#comfyui-copilot-plugin .py-4{padding-top:1rem;padding-bottom:1rem}#comfyui-copilot-plugin .pb-10{padding-bottom:2.5rem}#comfyui-copilot-plugin .pr-12{padding-right:3rem}#comfyui-copilot-plugin .pr-4{padding-right:1rem}#comfyui-copilot-plugin .pr-6{padding-right:1.5rem}#comfyui-copilot-plugin .pt-1{padding-top:.25rem}#comfyui-copilot-plugin .pt-2{padding-top:.5rem}#comfyui-copilot-plugin .pt-6{padding-top:1.5rem}#comfyui-copilot-plugin .text-left{text-align:left}#comfyui-copilot-plugin .text-center{text-align:center}#comfyui-copilot-plugin .\!text-\[11px\]{font-size:11px!important}#comfyui-copilot-plugin .text-\[10px\]{font-size:10px}#comfyui-copilot-plugin .text-\[11px\]{font-size:11px}#comfyui-copilot-plugin .text-\[12px\]{font-size:12px}#comfyui-copilot-plugin .text-\[14px\]{font-size:14px}#comfyui-copilot-plugin .text-\[16px\]{font-size:16px}#comfyui-copilot-plugin .text-base{font-size:1rem;line-height:1.5rem}#comfyui-copilot-plugin .text-lg{font-size:1.125rem;line-height:1.75rem}#comfyui-copilot-plugin .text-sm{font-size:.875rem;line-height:1.25rem}#comfyui-copilot-plugin .text-xl{font-size:1.25rem;line-height:1.75rem}#comfyui-copilot-plugin .text-xs{font-size:.75rem;line-height:1rem}#comfyui-copilot-plugin .font-medium{font-weight:500}#comfyui-copilot-plugin .font-semibold{font-weight:600}#comfyui-copilot-plugin .leading-relaxed{line-height:1.625}#comfyui-copilot-plugin .leading-snug{line-height:1.375}#comfyui-copilot-plugin .text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-green-900{--tw-text-opacity: 1;color:rgb(20 83 45 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-purple-700{--tw-text-opacity: 1;color:rgb(126 34 206 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .underline{text-decoration-line:underline}#comfyui-copilot-plugin .placeholder-gray-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}#comfyui-copilot-plugin .placeholder-gray-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}#comfyui-copilot-plugin .opacity-0{opacity:0}#comfyui-copilot-plugin .opacity-25{opacity:.25}#comfyui-copilot-plugin .opacity-40{opacity:.4}#comfyui-copilot-plugin .opacity-75{opacity:.75}#comfyui-copilot-plugin .shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#comfyui-copilot-plugin .shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#comfyui-copilot-plugin .shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#comfyui-copilot-plugin .shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#comfyui-copilot-plugin .outline-none{outline:2px solid transparent;outline-offset:2px}#comfyui-copilot-plugin .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#comfyui-copilot-plugin .backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}#comfyui-copilot-plugin .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#comfyui-copilot-plugin .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#comfyui-copilot-plugin .transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#comfyui-copilot-plugin .transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#comfyui-copilot-plugin .duration-200{transition-duration:.2s}#comfyui-copilot-plugin .ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}#comfyui-copilot-plugin h1,#comfyui-copilot-plugin h2,#comfyui-copilot-plugin h3,#comfyui-copilot-plugin h4,#comfyui-copilot-plugin h5,#comfyui-copilot-plugin h6,#comfyui-copilot-plugin p,#comfyui-copilot-plugin ul,#comfyui-copilot-plugin ol,#comfyui-copilot-plugin button,#comfyui-copilot-plugin input,#comfyui-copilot-plugin textarea,#comfyui-copilot-plugin select{margin:0;padding:0;font-size:100%;font-weight:400}#comfyui-copilot-plugin *{box-sizing:border-box;border-width:0;border-style:solid}#comfyui-copilot-plugin img,#comfyui-copilot-plugin svg,#comfyui-copilot-plugin video,#comfyui-copilot-plugin canvas,#comfyui-copilot-plugin audio,#comfyui-copilot-plugin iframe,#comfyui-copilot-plugin embed,#comfyui-copilot-plugin object{display:block;vertical-align:middle}#comfyui-copilot-plugin button{background-color:transparent;background-image:none}.hover\:border-blue-500:hover{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.hover\:bg-amber-200\/50:hover{background-color:#fde68a80}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-300:hover{--tw-bg-opacity: 1;background-color:rgb(147 197 253 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-300:hover{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:bg-green-200:hover{--tw-bg-opacity: 1;background-color:rgb(187 247 208 / var(--tw-bg-opacity, 1))}.hover\:bg-purple-200:hover{--tw-bg-opacity: 1;background-color:rgb(233 213 255 / var(--tw-bg-opacity, 1))}.hover\:font-bold:hover{font-weight:700}.hover\:text-amber-700:hover{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.hover\:text-amber-800:hover{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.hover\:text-blue-700:hover{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-sm:hover{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\:border-transparent:focus{border-color:transparent}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.focus\:ring-blue-500\/20:focus{--tw-ring-color: rgb(59 130 246 / .2)}.active\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:block{display:block}.group:hover .group-hover\:translate-x-1{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:opacity-100{opacity:1}.prose-headings\:font-semibold :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))){font-weight:600}.prose-h1\:text-base :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:1rem;line-height:1.5rem}.prose-h2\:text-sm :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.875rem;line-height:1.25rem}.prose-h3\:text-xs :is(:where(h3):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-h4\:text-xs :is(:where(h4):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-p\:text-xs :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-a\:font-medium :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){font-weight:500}.prose-a\:text-amber-700 :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.prose-a\:underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-line:underline}.hover\:prose-a\:text-amber-800 :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))):hover{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.prose-code\:text-xs :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-pre\:text-xs :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-ol\:text-xs :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-ul\:text-xs :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-li\:text-xs :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}@media (prefers-color-scheme: dark){.dark\:border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.dark\:border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.dark\:bg-\[\#FFFFFF\]{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:bg-green-900\/20{background-color:#14532d33}.dark\:bg-red-900\/20{background-color:#7f1d1d33}.dark\:text-\[\#000000\]{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.dark\:text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:placeholder-gray-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.dark\:placeholder-gray-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.dark\:hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-gray-700:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-blue-300:hover{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:hover\:text-gray-200:hover{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:focus\:border-blue-400:focus{--tw-border-opacity: 1;border-color:rgb(96 165 250 / var(--tw-border-opacity, 1))}.dark\:focus\:ring-blue-400\/20:focus{--tw-ring-color: rgb(96 165 250 / .2)}}.\[\&\>\*\]\:\!my-1>*{margin-top:.25rem!important;margin-bottom:.25rem!important} diff --git a/dist/copilot_web/assets/input-CbVoR7-h.css b/dist/copilot_web/assets/input-CbVoR7-h.css new file mode 100644 index 0000000..b5fafc8 --- /dev/null +++ b/dist/copilot_web/assets/input-CbVoR7-h.css @@ -0,0 +1 @@ +#comfyui-copilot-plugin *,#comfyui-copilot-plugin :before,#comfyui-copilot-plugin :after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }#comfyui-copilot-plugin ::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }#comfyui-copilot-plugin .container{width:100%}@media (min-width: 640px){#comfyui-copilot-plugin .container{max-width:640px}}@media (min-width: 768px){#comfyui-copilot-plugin .container{max-width:768px}}@media (min-width: 1024px){#comfyui-copilot-plugin .container{max-width:1024px}}@media (min-width: 1280px){#comfyui-copilot-plugin .container{max-width:1280px}}@media (min-width: 1536px){#comfyui-copilot-plugin .container{max-width:1536px}}#comfyui-copilot-plugin .prose{color:var(--tw-prose-body);max-width:65ch}#comfyui-copilot-plugin .prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}#comfyui-copilot-plugin .prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}#comfyui-copilot-plugin .prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}#comfyui-copilot-plugin .prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}#comfyui-copilot-plugin .prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}#comfyui-copilot-plugin .prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}#comfyui-copilot-plugin .prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}#comfyui-copilot-plugin .prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}#comfyui-copilot-plugin .prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}#comfyui-copilot-plugin .prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}#comfyui-copilot-plugin .prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}#comfyui-copilot-plugin .prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}#comfyui-copilot-plugin .prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}#comfyui-copilot-plugin .prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}#comfyui-copilot-plugin .prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}#comfyui-copilot-plugin .prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}#comfyui-copilot-plugin .prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}#comfyui-copilot-plugin .prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}#comfyui-copilot-plugin .prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}#comfyui-copilot-plugin .prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}#comfyui-copilot-plugin .prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}#comfyui-copilot-plugin .prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}#comfyui-copilot-plugin .prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}#comfyui-copilot-plugin .prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}#comfyui-copilot-plugin .prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}#comfyui-copilot-plugin .prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}#comfyui-copilot-plugin .prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}#comfyui-copilot-plugin .prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}#comfyui-copilot-plugin .prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}#comfyui-copilot-plugin .prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}#comfyui-copilot-plugin .prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}#comfyui-copilot-plugin .prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}#comfyui-copilot-plugin .prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}#comfyui-copilot-plugin .prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}#comfyui-copilot-plugin .prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}#comfyui-copilot-plugin .prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}#comfyui-copilot-plugin .prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}#comfyui-copilot-plugin .prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}#comfyui-copilot-plugin .prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}#comfyui-copilot-plugin .prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}#comfyui-copilot-plugin .prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}#comfyui-copilot-plugin .prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}#comfyui-copilot-plugin .prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}#comfyui-copilot-plugin .prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}#comfyui-copilot-plugin .prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}#comfyui-copilot-plugin .prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}#comfyui-copilot-plugin .prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}#comfyui-copilot-plugin .prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}#comfyui-copilot-plugin .prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}#comfyui-copilot-plugin .prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}#comfyui-copilot-plugin .prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}#comfyui-copilot-plugin .prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}#comfyui-copilot-plugin .prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}#comfyui-copilot-plugin .prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}#comfyui-copilot-plugin .prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}#comfyui-copilot-plugin .prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}#comfyui-copilot-plugin .prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}#comfyui-copilot-plugin .prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}#comfyui-copilot-plugin .prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}#comfyui-copilot-plugin .prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}#comfyui-copilot-plugin .prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}#comfyui-copilot-plugin .prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}#comfyui-copilot-plugin .prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}#comfyui-copilot-plugin .prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}#comfyui-copilot-plugin .prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}#comfyui-copilot-plugin .prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}#comfyui-copilot-plugin .prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}#comfyui-copilot-plugin .prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}#comfyui-copilot-plugin .prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}#comfyui-copilot-plugin .prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}#comfyui-copilot-plugin .prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}#comfyui-copilot-plugin .prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}#comfyui-copilot-plugin .prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}#comfyui-copilot-plugin .prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}#comfyui-copilot-plugin .prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}#comfyui-copilot-plugin .prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}#comfyui-copilot-plugin .prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}#comfyui-copilot-plugin .prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}#comfyui-copilot-plugin .prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}#comfyui-copilot-plugin .prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}#comfyui-copilot-plugin .prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}#comfyui-copilot-plugin .prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}#comfyui-copilot-plugin .prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}#comfyui-copilot-plugin .prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}#comfyui-copilot-plugin .prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}#comfyui-copilot-plugin .prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}#comfyui-copilot-plugin .prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}#comfyui-copilot-plugin .prose-neutral{--tw-prose-body: #404040;--tw-prose-headings: #171717;--tw-prose-lead: #525252;--tw-prose-links: #171717;--tw-prose-bold: #171717;--tw-prose-counters: #737373;--tw-prose-bullets: #d4d4d4;--tw-prose-hr: #e5e5e5;--tw-prose-quotes: #171717;--tw-prose-quote-borders: #e5e5e5;--tw-prose-captions: #737373;--tw-prose-kbd: #171717;--tw-prose-kbd-shadows: 23 23 23;--tw-prose-code: #171717;--tw-prose-pre-code: #e5e5e5;--tw-prose-pre-bg: #262626;--tw-prose-th-borders: #d4d4d4;--tw-prose-td-borders: #e5e5e5;--tw-prose-invert-body: #d4d4d4;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #a3a3a3;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #a3a3a3;--tw-prose-invert-bullets: #525252;--tw-prose-invert-hr: #404040;--tw-prose-invert-quotes: #f5f5f5;--tw-prose-invert-quote-borders: #404040;--tw-prose-invert-captions: #a3a3a3;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d4d4d4;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #525252;--tw-prose-invert-td-borders: #404040}#comfyui-copilot-plugin .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}#comfyui-copilot-plugin .\!visible{visibility:visible!important}#comfyui-copilot-plugin .visible{visibility:visible}#comfyui-copilot-plugin .collapse{visibility:collapse}#comfyui-copilot-plugin .static{position:static}#comfyui-copilot-plugin .fixed{position:fixed}#comfyui-copilot-plugin .absolute{position:absolute}#comfyui-copilot-plugin .relative{position:relative}#comfyui-copilot-plugin .sticky{position:sticky}#comfyui-copilot-plugin .inset-0{inset:0}#comfyui-copilot-plugin .inset-y-0{top:0;bottom:0}#comfyui-copilot-plugin .-bottom-1{bottom:-.25rem}#comfyui-copilot-plugin .-right-1{right:-.25rem}#comfyui-copilot-plugin .-top-1{top:-.25rem}#comfyui-copilot-plugin .-top-10{top:-2.5rem}#comfyui-copilot-plugin .-top-6{top:-1.5rem}#comfyui-copilot-plugin .bottom-0{bottom:0}#comfyui-copilot-plugin .bottom-1{bottom:.25rem}#comfyui-copilot-plugin .bottom-2{bottom:.5rem}#comfyui-copilot-plugin .bottom-3{bottom:.75rem}#comfyui-copilot-plugin .bottom-full{bottom:100%}#comfyui-copilot-plugin .left-0{left:0}#comfyui-copilot-plugin .left-1\/2{left:50%}#comfyui-copilot-plugin .left-3{left:.75rem}#comfyui-copilot-plugin .right-0{right:0}#comfyui-copilot-plugin .right-1\.5{right:.375rem}#comfyui-copilot-plugin .right-12{right:3rem}#comfyui-copilot-plugin .right-2{right:.5rem}#comfyui-copilot-plugin .right-3{right:.75rem}#comfyui-copilot-plugin .right-4{right:1rem}#comfyui-copilot-plugin .top-0{top:0}#comfyui-copilot-plugin .top-1\/2{top:50%}#comfyui-copilot-plugin .top-2{top:.5rem}#comfyui-copilot-plugin .top-4{top:1rem}#comfyui-copilot-plugin .z-10{z-index:10}#comfyui-copilot-plugin .z-20{z-index:20}#comfyui-copilot-plugin .z-50{z-index:50}#comfyui-copilot-plugin .z-\[9999\]{z-index:9999}#comfyui-copilot-plugin .\!my-0\.5{margin-top:.125rem!important;margin-bottom:.125rem!important}#comfyui-copilot-plugin .\!my-1{margin-top:.25rem!important;margin-bottom:.25rem!important}#comfyui-copilot-plugin .mx-auto{margin-left:auto;margin-right:auto}#comfyui-copilot-plugin .-ml-1{margin-left:-.25rem}#comfyui-copilot-plugin .mb-1{margin-bottom:.25rem}#comfyui-copilot-plugin .mb-2{margin-bottom:.5rem}#comfyui-copilot-plugin .mb-3{margin-bottom:.75rem}#comfyui-copilot-plugin .mb-4{margin-bottom:1rem}#comfyui-copilot-plugin .mb-6{margin-bottom:1.5rem}#comfyui-copilot-plugin .ml-1{margin-left:.25rem}#comfyui-copilot-plugin .ml-2{margin-left:.5rem}#comfyui-copilot-plugin .ml-3{margin-left:.75rem}#comfyui-copilot-plugin .mr-1{margin-right:.25rem}#comfyui-copilot-plugin .mr-2{margin-right:.5rem}#comfyui-copilot-plugin .mr-3{margin-right:.75rem}#comfyui-copilot-plugin .mt-0\.5{margin-top:.125rem}#comfyui-copilot-plugin .mt-1{margin-top:.25rem}#comfyui-copilot-plugin .mt-12{margin-top:3rem}#comfyui-copilot-plugin .mt-2{margin-top:.5rem}#comfyui-copilot-plugin .mt-4{margin-top:1rem}#comfyui-copilot-plugin .mt-6{margin-top:1.5rem}#comfyui-copilot-plugin .line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}#comfyui-copilot-plugin .block{display:block}#comfyui-copilot-plugin .inline{display:inline}#comfyui-copilot-plugin .flex{display:flex}#comfyui-copilot-plugin .inline-flex{display:inline-flex}#comfyui-copilot-plugin .table{display:table}#comfyui-copilot-plugin .grid{display:grid}#comfyui-copilot-plugin .contents{display:contents}#comfyui-copilot-plugin .hidden{display:none}#comfyui-copilot-plugin .aspect-square{aspect-ratio:1 / 1}#comfyui-copilot-plugin .h-1{height:.25rem}#comfyui-copilot-plugin .h-10{height:2.5rem}#comfyui-copilot-plugin .h-14{height:3.5rem}#comfyui-copilot-plugin .h-2{height:.5rem}#comfyui-copilot-plugin .h-20{height:5rem}#comfyui-copilot-plugin .h-3{height:.75rem}#comfyui-copilot-plugin .h-3\.5{height:.875rem}#comfyui-copilot-plugin .h-4{height:1rem}#comfyui-copilot-plugin .h-5{height:1.25rem}#comfyui-copilot-plugin .h-6{height:1.5rem}#comfyui-copilot-plugin .h-7{height:1.75rem}#comfyui-copilot-plugin .h-8{height:2rem}#comfyui-copilot-plugin .h-\[4\.5rem\]{height:4.5rem}#comfyui-copilot-plugin .h-auto{height:auto}#comfyui-copilot-plugin .h-full{height:100%}#comfyui-copilot-plugin .max-h-16{max-height:4rem}#comfyui-copilot-plugin .max-h-60{max-height:15rem}#comfyui-copilot-plugin .max-h-\[400px\]{max-height:400px}#comfyui-copilot-plugin .max-h-\[40vh\]{max-height:40vh}#comfyui-copilot-plugin .max-h-\[90vh\]{max-height:90vh}#comfyui-copilot-plugin .max-h-\[calc\(90vh-4rem\)\]{max-height:calc(90vh - 4rem)}#comfyui-copilot-plugin .min-h-\[80px\]{min-height:80px}#comfyui-copilot-plugin .w-1{width:.25rem}#comfyui-copilot-plugin .w-1\/2{width:50%}#comfyui-copilot-plugin .w-10{width:2.5rem}#comfyui-copilot-plugin .w-12{width:3rem}#comfyui-copilot-plugin .w-14{width:3.5rem}#comfyui-copilot-plugin .w-16{width:4rem}#comfyui-copilot-plugin .w-2{width:.5rem}#comfyui-copilot-plugin .w-3{width:.75rem}#comfyui-copilot-plugin .w-3\.5{width:.875rem}#comfyui-copilot-plugin .w-4{width:1rem}#comfyui-copilot-plugin .w-40{width:10rem}#comfyui-copilot-plugin .w-48{width:12rem}#comfyui-copilot-plugin .w-5{width:1.25rem}#comfyui-copilot-plugin .w-64{width:16rem}#comfyui-copilot-plugin .w-8{width:2rem}#comfyui-copilot-plugin .w-96{width:24rem}#comfyui-copilot-plugin .w-\[100\%\]{width:100%}#comfyui-copilot-plugin .w-\[480px\]{width:480px}#comfyui-copilot-plugin .w-\[500px\]{width:500px}#comfyui-copilot-plugin .w-\[calc\(50\%-0\.25rem\)\]{width:calc(50% - .25rem)}#comfyui-copilot-plugin .w-full{width:100%}#comfyui-copilot-plugin .min-w-\[400px\]{min-width:400px}#comfyui-copilot-plugin .max-w-2xl{max-width:42rem}#comfyui-copilot-plugin .max-w-4xl{max-width:56rem}#comfyui-copilot-plugin .max-w-full{max-width:100%}#comfyui-copilot-plugin .max-w-lg{max-width:32rem}#comfyui-copilot-plugin .flex-1{flex:1 1 0%}#comfyui-copilot-plugin .flex-shrink-0{flex-shrink:0}#comfyui-copilot-plugin .-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#comfyui-copilot-plugin .-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#comfyui-copilot-plugin .-translate-y-full{--tw-translate-y: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#comfyui-copilot-plugin .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#comfyui-copilot-plugin{@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}}#comfyui-copilot-plugin .animate-bounce{animation:bounce 1s infinite}#comfyui-copilot-plugin{@keyframes spin{to{transform:rotate(360deg)}}}#comfyui-copilot-plugin .animate-spin{animation:spin 1s linear infinite}#comfyui-copilot-plugin .cursor-ew-resize{cursor:ew-resize}#comfyui-copilot-plugin .cursor-help{cursor:help}#comfyui-copilot-plugin .cursor-not-allowed{cursor:not-allowed}#comfyui-copilot-plugin .cursor-ns-resize{cursor:ns-resize}#comfyui-copilot-plugin .cursor-pointer{cursor:pointer}#comfyui-copilot-plugin .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}#comfyui-copilot-plugin .resize-none{resize:none}#comfyui-copilot-plugin .resize-y{resize:vertical}#comfyui-copilot-plugin .resize{resize:both}#comfyui-copilot-plugin .appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}#comfyui-copilot-plugin .grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}#comfyui-copilot-plugin .grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}#comfyui-copilot-plugin .flex-col{flex-direction:column}#comfyui-copilot-plugin .flex-wrap{flex-wrap:wrap}#comfyui-copilot-plugin .items-start{align-items:flex-start}#comfyui-copilot-plugin .items-center{align-items:center}#comfyui-copilot-plugin .justify-end{justify-content:flex-end}#comfyui-copilot-plugin .justify-center{justify-content:center}#comfyui-copilot-plugin .justify-between{justify-content:space-between}#comfyui-copilot-plugin .gap-1{gap:.25rem}#comfyui-copilot-plugin .gap-2{gap:.5rem}#comfyui-copilot-plugin .gap-3{gap:.75rem}#comfyui-copilot-plugin .gap-4{gap:1rem}#comfyui-copilot-plugin .space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}#comfyui-copilot-plugin .space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}#comfyui-copilot-plugin .space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}#comfyui-copilot-plugin .space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}#comfyui-copilot-plugin .space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}#comfyui-copilot-plugin .space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}#comfyui-copilot-plugin .overflow-auto{overflow:auto}#comfyui-copilot-plugin .overflow-hidden{overflow:hidden}#comfyui-copilot-plugin .overflow-visible{overflow:visible}#comfyui-copilot-plugin .overflow-x-auto{overflow-x:auto}#comfyui-copilot-plugin .overflow-y-auto{overflow-y:auto}#comfyui-copilot-plugin .scroll-smooth{scroll-behavior:smooth}#comfyui-copilot-plugin .text-ellipsis{text-overflow:ellipsis}#comfyui-copilot-plugin .whitespace-normal{white-space:normal}#comfyui-copilot-plugin .whitespace-nowrap{white-space:nowrap}#comfyui-copilot-plugin .whitespace-pre-wrap{white-space:pre-wrap}#comfyui-copilot-plugin .break-words{overflow-wrap:break-word}#comfyui-copilot-plugin .rounded{border-radius:.25rem}#comfyui-copilot-plugin .rounded-full{border-radius:9999px}#comfyui-copilot-plugin .rounded-lg{border-radius:.5rem}#comfyui-copilot-plugin .rounded-md{border-radius:.375rem}#comfyui-copilot-plugin .rounded-sm{border-radius:.125rem}#comfyui-copilot-plugin .rounded-xl{border-radius:.75rem}#comfyui-copilot-plugin .border{border-width:1px}#comfyui-copilot-plugin .border-0{border-width:0px}#comfyui-copilot-plugin .border-2{border-width:2px}#comfyui-copilot-plugin .border-4{border-width:4px}#comfyui-copilot-plugin .border-b{border-bottom-width:1px}#comfyui-copilot-plugin .border-b-2{border-bottom-width:2px}#comfyui-copilot-plugin .border-l-4{border-left-width:4px}#comfyui-copilot-plugin .border-t{border-top-width:1px}#comfyui-copilot-plugin .border-solid{border-style:solid}#comfyui-copilot-plugin .border-dashed{border-style:dashed}#comfyui-copilot-plugin .border-none{border-style:none}#comfyui-copilot-plugin .border-\[\#979797\]{--tw-border-opacity: 1;border-color:rgb(151 151 151 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-blue-100{--tw-border-opacity: 1;border-color:rgb(219 234 254 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-blue-300{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-blue-600{--tw-border-opacity: 1;border-color:rgb(37 99 235 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-gray-900{--tw-border-opacity: 1;border-color:rgb(17 24 39 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-green-500{--tw-border-opacity: 1;border-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-pink-500{--tw-border-opacity: 1;border-color:rgb(236 72 153 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-transparent{border-color:transparent}#comfyui-copilot-plugin .border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-t-blue-500{--tw-border-opacity: 1;border-top-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .border-t-gray-800{--tw-border-opacity: 1;border-top-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}#comfyui-copilot-plugin .bg-\[\#E5E7ED\]{--tw-bg-opacity: 1;background-color:rgb(229 231 237 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-black\/40{background-color:#0006}#comfyui-copilot-plugin .bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-indigo-100{--tw-bg-opacity: 1;background-color:rgb(224 231 255 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-pink-200{--tw-bg-opacity: 1;background-color:rgb(251 207 232 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-pink-500{--tw-bg-opacity: 1;background-color:rgb(236 72 153 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-transparent{background-color:transparent}#comfyui-copilot-plugin .bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}#comfyui-copilot-plugin .bg-opacity-30{--tw-bg-opacity: .3}#comfyui-copilot-plugin .bg-opacity-50{--tw-bg-opacity: .5}#comfyui-copilot-plugin .bg-opacity-75{--tw-bg-opacity: .75}#comfyui-copilot-plugin .bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}#comfyui-copilot-plugin .from-amber-50{--tw-gradient-from: #fffbeb var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 251 235 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}#comfyui-copilot-plugin .to-amber-100{--tw-gradient-to: #fef3c7 var(--tw-gradient-to-position)}#comfyui-copilot-plugin .fill-current{fill:currentColor}#comfyui-copilot-plugin .object-cover{-o-object-fit:cover;object-fit:cover}#comfyui-copilot-plugin .p-0\.5{padding:.125rem}#comfyui-copilot-plugin .p-1{padding:.25rem}#comfyui-copilot-plugin .p-1\.5{padding:.375rem}#comfyui-copilot-plugin .p-2{padding:.5rem}#comfyui-copilot-plugin .p-3{padding:.75rem}#comfyui-copilot-plugin .p-4{padding:1rem}#comfyui-copilot-plugin .p-6{padding:1.5rem}#comfyui-copilot-plugin .p-8{padding:2rem}#comfyui-copilot-plugin .px-1{padding-left:.25rem;padding-right:.25rem}#comfyui-copilot-plugin .px-1\.5{padding-left:.375rem;padding-right:.375rem}#comfyui-copilot-plugin .px-2{padding-left:.5rem;padding-right:.5rem}#comfyui-copilot-plugin .px-3{padding-left:.75rem;padding-right:.75rem}#comfyui-copilot-plugin .px-4{padding-left:1rem;padding-right:1rem}#comfyui-copilot-plugin .px-5{padding-left:1.25rem;padding-right:1.25rem}#comfyui-copilot-plugin .py-0\.5{padding-top:.125rem;padding-bottom:.125rem}#comfyui-copilot-plugin .py-1{padding-top:.25rem;padding-bottom:.25rem}#comfyui-copilot-plugin .py-1\.5{padding-top:.375rem;padding-bottom:.375rem}#comfyui-copilot-plugin .py-2{padding-top:.5rem;padding-bottom:.5rem}#comfyui-copilot-plugin .py-2\.5{padding-top:.625rem;padding-bottom:.625rem}#comfyui-copilot-plugin .py-3{padding-top:.75rem;padding-bottom:.75rem}#comfyui-copilot-plugin .py-4{padding-top:1rem;padding-bottom:1rem}#comfyui-copilot-plugin .pb-10{padding-bottom:2.5rem}#comfyui-copilot-plugin .pb-2{padding-bottom:.5rem}#comfyui-copilot-plugin .pb-3{padding-bottom:.75rem}#comfyui-copilot-plugin .pr-12{padding-right:3rem}#comfyui-copilot-plugin .pr-4{padding-right:1rem}#comfyui-copilot-plugin .pr-6{padding-right:1.5rem}#comfyui-copilot-plugin .pt-1{padding-top:.25rem}#comfyui-copilot-plugin .pt-2{padding-top:.5rem}#comfyui-copilot-plugin .pt-6{padding-top:1.5rem}#comfyui-copilot-plugin .text-left{text-align:left}#comfyui-copilot-plugin .text-center{text-align:center}#comfyui-copilot-plugin .\!text-\[11px\]{font-size:11px!important}#comfyui-copilot-plugin .text-\[10px\]{font-size:10px}#comfyui-copilot-plugin .text-\[11px\]{font-size:11px}#comfyui-copilot-plugin .text-\[12px\]{font-size:12px}#comfyui-copilot-plugin .text-\[14px\]{font-size:14px}#comfyui-copilot-plugin .text-\[16px\]{font-size:16px}#comfyui-copilot-plugin .text-base{font-size:1rem;line-height:1.5rem}#comfyui-copilot-plugin .text-lg{font-size:1.125rem;line-height:1.75rem}#comfyui-copilot-plugin .text-sm{font-size:.875rem;line-height:1.25rem}#comfyui-copilot-plugin .text-xl{font-size:1.25rem;line-height:1.75rem}#comfyui-copilot-plugin .text-xs{font-size:.75rem;line-height:1rem}#comfyui-copilot-plugin .font-bold{font-weight:700}#comfyui-copilot-plugin .font-medium{font-weight:500}#comfyui-copilot-plugin .font-semibold{font-weight:600}#comfyui-copilot-plugin .leading-relaxed{line-height:1.625}#comfyui-copilot-plugin .leading-snug{line-height:1.375}#comfyui-copilot-plugin .text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-green-900{--tw-text-opacity: 1;color:rgb(20 83 45 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-indigo-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-pink-700{--tw-text-opacity: 1;color:rgb(190 24 93 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-purple-700{--tw-text-opacity: 1;color:rgb(126 34 206 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}#comfyui-copilot-plugin .underline{text-decoration-line:underline}#comfyui-copilot-plugin .placeholder-gray-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}#comfyui-copilot-plugin .placeholder-gray-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}#comfyui-copilot-plugin .opacity-0{opacity:0}#comfyui-copilot-plugin .opacity-25{opacity:.25}#comfyui-copilot-plugin .opacity-40{opacity:.4}#comfyui-copilot-plugin .opacity-50{opacity:.5}#comfyui-copilot-plugin .opacity-75{opacity:.75}#comfyui-copilot-plugin .shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#comfyui-copilot-plugin .shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#comfyui-copilot-plugin .shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#comfyui-copilot-plugin .shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#comfyui-copilot-plugin .shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#comfyui-copilot-plugin .outline-none{outline:2px solid transparent;outline-offset:2px}#comfyui-copilot-plugin .ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}#comfyui-copilot-plugin .ring-pink-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(249 168 212 / var(--tw-ring-opacity, 1))}#comfyui-copilot-plugin .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#comfyui-copilot-plugin .backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}#comfyui-copilot-plugin .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#comfyui-copilot-plugin .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#comfyui-copilot-plugin .transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#comfyui-copilot-plugin .transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#comfyui-copilot-plugin .duration-200{transition-duration:.2s}#comfyui-copilot-plugin .ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}#comfyui-copilot-plugin h1,#comfyui-copilot-plugin h2,#comfyui-copilot-plugin h3,#comfyui-copilot-plugin h4,#comfyui-copilot-plugin h5,#comfyui-copilot-plugin h6,#comfyui-copilot-plugin p,#comfyui-copilot-plugin ul,#comfyui-copilot-plugin ol,#comfyui-copilot-plugin button,#comfyui-copilot-plugin input,#comfyui-copilot-plugin textarea,#comfyui-copilot-plugin select{margin:0;padding:0;font-size:100%;font-weight:400}#comfyui-copilot-plugin *{box-sizing:border-box;border-width:0;border-style:solid}#comfyui-copilot-plugin img,#comfyui-copilot-plugin svg,#comfyui-copilot-plugin video,#comfyui-copilot-plugin canvas,#comfyui-copilot-plugin audio,#comfyui-copilot-plugin iframe,#comfyui-copilot-plugin embed,#comfyui-copilot-plugin object{display:block;vertical-align:middle}#comfyui-copilot-plugin button{background-color:transparent;background-image:none}.hover\:border-b-2:hover{border-bottom-width:2px}.hover\:border-blue-300:hover{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity, 1))}.hover\:border-blue-500:hover{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.hover\:bg-amber-200\/50:hover{background-color:#fde68a80}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-200:hover{--tw-bg-opacity: 1;background-color:rgb(191 219 254 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-300:hover{--tw-bg-opacity: 1;background-color:rgb(147 197 253 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-50:hover{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-300:hover{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:bg-green-200:hover{--tw-bg-opacity: 1;background-color:rgb(187 247 208 / var(--tw-bg-opacity, 1))}.hover\:bg-pink-300:hover{--tw-bg-opacity: 1;background-color:rgb(249 168 212 / var(--tw-bg-opacity, 1))}.hover\:bg-purple-200:hover{--tw-bg-opacity: 1;background-color:rgb(233 213 255 / var(--tw-bg-opacity, 1))}.hover\:font-bold:hover{font-weight:700}.hover\:text-amber-700:hover{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.hover\:text-amber-800:hover{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.hover\:text-blue-500:hover{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.hover\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.hover\:text-blue-700:hover{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.hover\:text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-sm:hover{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\:border-transparent:focus{border-color:transparent}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.focus\:ring-blue-500\/20:focus{--tw-ring-color: rgb(59 130 246 / .2)}.active\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:block{display:block}.group:hover .group-hover\:translate-x-1{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:opacity-100{opacity:1}.prose-headings\:font-semibold :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))){font-weight:600}.prose-h1\:text-base :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:1rem;line-height:1.5rem}.prose-h2\:text-sm :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.875rem;line-height:1.25rem}.prose-h3\:text-xs :is(:where(h3):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-h4\:text-xs :is(:where(h4):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-p\:text-xs :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-a\:font-medium :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){font-weight:500}.prose-a\:text-amber-700 :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.prose-a\:underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-line:underline}.hover\:prose-a\:text-amber-800 :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))):hover{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.prose-code\:text-xs :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-pre\:text-xs :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-ol\:text-xs :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-ul\:text-xs :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-li\:text-xs :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}@media (prefers-color-scheme: dark){.dark\:border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.dark\:border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.dark\:bg-\[\#FFFFFF\]{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:bg-green-900\/20{background-color:#14532d33}.dark\:bg-red-900\/20{background-color:#7f1d1d33}.dark\:text-\[\#000000\]{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.dark\:text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:placeholder-gray-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.dark\:placeholder-gray-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.dark\:hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-gray-700:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-blue-300:hover{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:hover\:text-gray-200:hover{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:focus\:border-blue-400:focus{--tw-border-opacity: 1;border-color:rgb(96 165 250 / var(--tw-border-opacity, 1))}.dark\:focus\:ring-blue-400\/20:focus{--tw-ring-color: rgb(96 165 250 / .2)}}.\[\&\>\*\]\:\!my-1>*{margin-top:.25rem!important;margin-bottom:.25rem!important} diff --git a/dist/copilot_web/input.js b/dist/copilot_web/input.js index e6c4492..5dc2886 100644 --- a/dist/copilot_web/input.js +++ b/dist/copilot_web/input.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["copilot_web/App-BjVABi7E.js","copilot_web/vendor-markdown-Dek94WS0.js","copilot_web/vendor-react-V04_Axys.js","copilot_web/message-components-B6pkQvDp.js"])))=>i.map(i=>d[i]); -import{j as u}from"./vendor-markdown-Dek94WS0.js";import{a as v,R as p}from"./vendor-react-V04_Axys.js";import{w}from"./message-components-B6pkQvDp.js";const R="modulepreload",b=function(e){return"/"+e},m={},P=function(a,s,S){let d=Promise.resolve();if(s&&s.length>0){document.getElementsByTagName("link");const r=document.querySelector("meta[property=csp-nonce]"),t=r?.nonce||r?.getAttribute("nonce");d=Promise.allSettled(s.map(o=>{if(o=b(o),o in m)return;m[o]=!0;const c=o.endsWith(".css"),h=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${o}"]${h}`))return;const n=document.createElement("link");if(n.rel=c?"stylesheet":R,c||(n.as="script"),n.crossOrigin="",n.href=o,t&&n.setAttribute("nonce",t),document.head.appendChild(n),c)return new Promise((y,E)=>{n.addEventListener("load",y),n.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${o}`)))})}))}function l(r){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=r,window.dispatchEvent(t),!t.defaultPrevented)throw r}return d.then(r=>{for(const t of r||[])t.status==="rejected"&&l(t.reason);return a().catch(l)})};var i={},f=v;i.createRoot=f.createRoot,i.hydrateRoot=f.hydrateRoot;const _=p.lazy(()=>P(async()=>{const{default:e}=await import("./App-BjVABi7E.js").then(a=>a.A);return{default:e}},__vite__mapDeps([0,1,2,3])).then(({default:e})=>({default:e})));function A(){return new Promise(e=>{if(document.body)return e(document.body);document.addEventListener("DOMContentLoaded",()=>{e(document.body)})})}A().then(()=>w()).then(()=>{const e=document.createElement("div");e.id="comfyui-copilot-plugin",document.body.append(e),i.createRoot(e).render(u.jsx(p.StrictMode,{children:u.jsx(_,{})}))});export{P as _}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["copilot_web/App-CzPQ6Sqn.js","copilot_web/vendor-markdown-Dek94WS0.js","copilot_web/vendor-react-V04_Axys.js","copilot_web/message-components-D3rPBq8S.js"])))=>i.map(i=>d[i]); +import{j as u}from"./vendor-markdown-Dek94WS0.js";import{a as v,R as p}from"./vendor-react-V04_Axys.js";import{w}from"./message-components-D3rPBq8S.js";const R="modulepreload",b=function(e){return"/"+e},m={},P=function(a,s,S){let d=Promise.resolve();if(s&&s.length>0){document.getElementsByTagName("link");const r=document.querySelector("meta[property=csp-nonce]"),t=r?.nonce||r?.getAttribute("nonce");d=Promise.allSettled(s.map(o=>{if(o=b(o),o in m)return;m[o]=!0;const c=o.endsWith(".css"),h=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${o}"]${h}`))return;const n=document.createElement("link");if(n.rel=c?"stylesheet":R,c||(n.as="script"),n.crossOrigin="",n.href=o,t&&n.setAttribute("nonce",t),document.head.appendChild(n),c)return new Promise((y,E)=>{n.addEventListener("load",y),n.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${o}`)))})}))}function l(r){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=r,window.dispatchEvent(t),!t.defaultPrevented)throw r}return d.then(r=>{for(const t of r||[])t.status==="rejected"&&l(t.reason);return a().catch(l)})};var i={},f=v;i.createRoot=f.createRoot,i.hydrateRoot=f.hydrateRoot;const _=p.lazy(()=>P(async()=>{const{default:e}=await import("./App-CzPQ6Sqn.js").then(a=>a.A);return{default:e}},__vite__mapDeps([0,1,2,3])).then(({default:e})=>({default:e})));function A(){return new Promise(e=>{if(document.body)return e(document.body);document.addEventListener("DOMContentLoaded",()=>{e(document.body)})})}A().then(()=>w()).then(()=>{const e=document.createElement("div");e.id="comfyui-copilot-plugin",document.body.append(e),i.createRoot(e).render(u.jsx(p.StrictMode,{children:u.jsx(_,{})}))});export{P as _}; diff --git a/dist/copilot_web/message-components-B6pkQvDp.js b/dist/copilot_web/message-components-D3rPBq8S.js similarity index 82% rename from dist/copilot_web/message-components-B6pkQvDp.js rename to dist/copilot_web/message-components-D3rPBq8S.js index 05afd67..323362c 100644 --- a/dist/copilot_web/message-components-B6pkQvDp.js +++ b/dist/copilot_web/message-components-D3rPBq8S.js @@ -1,11 +1,11 @@ -import{r as We,R as QT}from"./vendor-react-V04_Axys.js";import{j as O,M as eI,r as tI,a as rI,b as iI,c as nI}from"./vendor-markdown-Dek94WS0.js";let Mt=null;const yp=location.pathname.split("/").slice(0,-1).join("/");let aI=null;async function Npe(){try{await Promise.all([import(yp+"/scripts/api.js").then(i=>{aI=i?.api}),import(yp+"/scripts/app.js").then(i=>{Mt=i?.app})])}catch(i){console.error("waitForApp error",i)}}const W$={messages:[],selectedNode:null,installedNodes:[],loading:!1,sessionId:null,showChat:!1};function oI(i,r){switch(r.type){case"SET_MESSAGES":return{...i,messages:r.payload};case"ADD_MESSAGE":return{...i,messages:[...i.messages,r.payload]};case"UPDATE_MESSAGE":return{...i,messages:i.messages.map(e=>e.id===r.payload.id&&!e.finished?r.payload:e)};case"SET_SELECTED_NODE":return{...i,selectedNode:r.payload};case"SET_INSTALLED_NODES":return{...i,installedNodes:r.payload};case"SET_LOADING":return{...i,loading:r.payload};case"SET_SESSION_ID":return{...i,sessionId:r.payload};case"SET_SHOW_CHAT":return{...i,showChat:r.payload};case"CLEAR_MESSAGES":return{...i,messages:[]};default:return i}}const V$=We.createContext({state:W$,dispatch:()=>null});function Mpe({children:i}){const[r,e]=We.useReducer(oI,W$);return QT.useEffect(()=>{r.sessionId&&r.messages.length>0&&localStorage.setItem(`messages_${r.sessionId}`,JSON.stringify(r.messages))},[r.messages,r.sessionId]),O.jsx(V$.Provider,{value:{state:r,dispatch:e},children:i})}function sI(){const i=We.useContext(V$);if(!i)throw new Error("useChatContext must be used within a ChatProvider");return i}const Bf={apiBaseUrl:"https://comfyui-copilot-server.onrender.com"};function Ur(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){const r=Math.random()*16|0;return(i==="x"?r:r&3|8).toString(16)})}var uI="0123456789abcdefghijklmnopqrstuvwxyz";function Sr(i){return uI.charAt(i)}function lI(i,r){return i&r}function gs(i,r){return i|r}function mp(i,r){return i^r}function bp(i,r){return i&~r}function hI(i){if(i==0)return-1;var r=0;return i&65535||(i>>=16,r+=16),i&255||(i>>=8,r+=8),i&15||(i>>=4,r+=4),i&3||(i>>=2,r+=2),i&1||++r,r}function cI(i){for(var r=0;i!=0;)i&=i-1,++r;return r}var kn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",U$="=";function Tu(i){var r,e,t="";for(r=0;r+3<=i.length;r+=3)e=parseInt(i.substring(r,r+3),16),t+=kn.charAt(e>>6)+kn.charAt(e&63);for(r+1==i.length?(e=parseInt(i.substring(r,r+1),16),t+=kn.charAt(e<<2)):r+2==i.length&&(e=parseInt(i.substring(r,r+2),16),t+=kn.charAt(e>>2)+kn.charAt((e&3)<<4));(t.length&3)>0;)t+=U$;return t}function $p(i){var r="",e,t=0,n=0;for(e=0;e>2),n=a&3,t=1):t==1?(r+=Sr(n<<2|a>>4),n=a&15,t=2):t==2?(r+=Sr(n),r+=Sr(a>>2),n=a&3,t=3):(r+=Sr(n<<2|a>>4),r+=Sr(a&15),t=0))}return t==1&&(r+=Sr(n<<2)),r}var dn,dI={decode:function(i){var r;if(dn===void 0){var e="0123456789ABCDEF",t=` \f -\r  \u2028\u2029`;for(dn={},r=0;r<16;++r)dn[e.charAt(r)]=r;for(e=e.toLowerCase(),r=10;r<16;++r)dn[e.charAt(r)]=r;for(r=0;r=2?(n[n.length]=a,a=0,o=0):a<<=4}}if(o)throw new Error("Hex encoding incomplete: 4 bits missing");return n}},Ei,$d={decode:function(i){var r;if(Ei===void 0){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=`= \f -\r  \u2028\u2029`;for(Ei=Object.create(null),r=0;r<64;++r)Ei[e.charAt(r)]=r;for(Ei["-"]=62,Ei._=63,r=0;r=4?(n[n.length]=a>>16,n[n.length]=a>>8&255,n[n.length]=a&255,a=0,o=0):a<<=6}}switch(o){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=a>>10;break;case 3:n[n.length]=a>>16,n[n.length]=a>>8&255;break}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(i){var r=$d.re.exec(i);if(r)if(r[1])i=r[1];else if(r[2])i=r[2];else throw new Error("RegExp out of sync");return $d.decode(i)}},fn=1e13,Va=function(){function i(r){this.buf=[+r||0]}return i.prototype.mulAdd=function(r,e){var t=this.buf,n=t.length,a,o;for(a=0;a0&&(t[a]=e)},i.prototype.sub=function(r){var e=this.buf,t=e.length,n,a;for(n=0;n=0;--n)t+=(fn+e[n]).toString().substring(1);return t},i.prototype.valueOf=function(){for(var r=this.buf,e=0,t=r.length-1;t>=0;--t)e=e*fn+r[t];return e},i.prototype.simplify=function(){var r=this.buf;return r.length==1?r[0]:this},i}(),K$="…",fI=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,vI=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function Wn(i,r){return i.length>r&&(i=i.substring(0,r)+K$),i}var ih=function(){function i(r,e){this.hexDigits="0123456789ABCDEF",r instanceof i?(this.enc=r.enc,this.pos=r.pos):(this.enc=r,this.pos=e)}return i.prototype.get=function(r){if(r===void 0&&(r=this.pos++),r>=this.enc.length)throw new Error("Requesting byte offset ".concat(r," on a stream of length ").concat(this.enc.length));return typeof this.enc=="string"?this.enc.charCodeAt(r):this.enc[r]},i.prototype.hexByte=function(r){return this.hexDigits.charAt(r>>4&15)+this.hexDigits.charAt(r&15)},i.prototype.hexDump=function(r,e,t){for(var n="",a=r;a{aI=i?.api}),import(yp+"/scripts/app.js").then(i=>{Mt=i?.app})])}catch(i){console.error("waitForApp error",i)}}const V$={messages:[],selectedNode:null,installedNodes:[],loading:!1,sessionId:null,showChat:!1,activeTab:"chat",screenState:null};function oI(i,r){switch(r.type){case"SET_MESSAGES":return{...i,messages:r.payload};case"ADD_MESSAGE":return{...i,messages:[...i.messages,r.payload]};case"UPDATE_MESSAGE":return{...i,messages:i.messages.map(e=>e.id===r.payload.id&&!e.finished?r.payload:e)};case"SET_SELECTED_NODE":return{...i,selectedNode:r.payload};case"SET_INSTALLED_NODES":return{...i,installedNodes:r.payload};case"SET_LOADING":return{...i,loading:r.payload};case"SET_SESSION_ID":return{...i,sessionId:r.payload};case"SET_SHOW_CHAT":return{...i,showChat:r.payload};case"SET_ACTIVE_TAB":return{...i,activeTab:r.payload};case"SET_SCREEN_STATE":return{...i,screenState:r.payload};case"CLEAR_MESSAGES":return{...i,messages:[]};default:return i}}const W$=Ve.createContext({state:V$,dispatch:()=>null});function Mpe({children:i}){const[r,e]=Ve.useReducer(oI,V$);return QT.useEffect(()=>{r.sessionId&&r.messages.length>0&&localStorage.setItem(`messages_${r.sessionId}`,JSON.stringify(r.messages))},[r.messages,r.sessionId]),O.jsx(W$.Provider,{value:{state:r,dispatch:e},children:i})}function sI(){const i=Ve.useContext(W$);if(!i)throw new Error("useChatContext must be used within a ChatProvider");return i}const Bf={apiBaseUrl:"https://comfyui-copilot-server.onrender.com"};function Sr(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){const r=Math.random()*16|0;return(i==="x"?r:r&3|8).toString(16)})}var uI="0123456789abcdefghijklmnopqrstuvwxyz";function Or(i){return uI.charAt(i)}function lI(i,r){return i&r}function gs(i,r){return i|r}function mp(i,r){return i^r}function bp(i,r){return i&~r}function hI(i){if(i==0)return-1;var r=0;return i&65535||(i>>=16,r+=16),i&255||(i>>=8,r+=8),i&15||(i>>=4,r+=4),i&3||(i>>=2,r+=2),i&1||++r,r}function cI(i){for(var r=0;i!=0;)i&=i-1,++r;return r}var kn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",U$="=";function Tu(i){var r,e,t="";for(r=0;r+3<=i.length;r+=3)e=parseInt(i.substring(r,r+3),16),t+=kn.charAt(e>>6)+kn.charAt(e&63);for(r+1==i.length?(e=parseInt(i.substring(r,r+1),16),t+=kn.charAt(e<<2)):r+2==i.length&&(e=parseInt(i.substring(r,r+2),16),t+=kn.charAt(e>>2)+kn.charAt((e&3)<<4));(t.length&3)>0;)t+=U$;return t}function $p(i){var r="",e,t=0,n=0;for(e=0;e>2),n=a&3,t=1):t==1?(r+=Or(n<<2|a>>4),n=a&15,t=2):t==2?(r+=Or(n),r+=Or(a>>2),n=a&3,t=3):(r+=Or(n<<2|a>>4),r+=Or(a&15),t=0))}return t==1&&(r+=Or(n<<2)),r}var pn,dI={decode:function(i){var r;if(pn===void 0){var e="0123456789ABCDEF",t=` \f +\r  \u2028\u2029`;for(pn={},r=0;r<16;++r)pn[e.charAt(r)]=r;for(e=e.toLowerCase(),r=10;r<16;++r)pn[e.charAt(r)]=r;for(r=0;r=2?(n[n.length]=a,a=0,o=0):a<<=4}}if(o)throw new Error("Hex encoding incomplete: 4 bits missing");return n}},Ei,$d={decode:function(i){var r;if(Ei===void 0){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=`= \f +\r  \u2028\u2029`;for(Ei=Object.create(null),r=0;r<64;++r)Ei[e.charAt(r)]=r;for(Ei["-"]=62,Ei._=63,r=0;r=4?(n[n.length]=a>>16,n[n.length]=a>>8&255,n[n.length]=a&255,a=0,o=0):a<<=6}}switch(o){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=a>>10;break;case 3:n[n.length]=a>>16,n[n.length]=a>>8&255;break}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(i){var r=$d.re.exec(i);if(r)if(r[1])i=r[1];else if(r[2])i=r[2];else throw new Error("RegExp out of sync");return $d.decode(i)}},gn=1e13,Wa=function(){function i(r){this.buf=[+r||0]}return i.prototype.mulAdd=function(r,e){var t=this.buf,n=t.length,a,o;for(a=0;a0&&(t[a]=e)},i.prototype.sub=function(r){var e=this.buf,t=e.length,n,a;for(n=0;n=0;--n)t+=(gn+e[n]).toString().substring(1);return t},i.prototype.valueOf=function(){for(var r=this.buf,e=0,t=r.length-1;t>=0;--t)e=e*gn+r[t];return e},i.prototype.simplify=function(){var r=this.buf;return r.length==1?r[0]:this},i}(),K$="…",fI=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,vI=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function Vn(i,r){return i.length>r&&(i=i.substring(0,r)+K$),i}var ih=function(){function i(r,e){this.hexDigits="0123456789ABCDEF",r instanceof i?(this.enc=r.enc,this.pos=r.pos):(this.enc=r,this.pos=e)}return i.prototype.get=function(r){if(r===void 0&&(r=this.pos++),r>=this.enc.length)throw new Error("Requesting byte offset ".concat(r," on a stream of length ").concat(this.enc.length));return typeof this.enc=="string"?this.enc.charCodeAt(r):this.enc[r]},i.prototype.hexByte=function(r){return this.hexDigits.charAt(r>>4&15)+this.hexDigits.charAt(r&15)},i.prototype.hexDump=function(r,e,t){for(var n="",a=r;a176)return!1}return!0},i.prototype.parseStringISO=function(r,e){for(var t="",n=r;n191&&a<224?t+=String.fromCharCode((a&31)<<6|this.get(n++)&63):t+=String.fromCharCode((a&15)<<12|(this.get(n++)&63)<<6|this.get(n++)&63)}return t},i.prototype.parseStringBMP=function(r,e){for(var t="",n,a,o=r;o127,a=n?255:0,o,s="";t==a&&++r4){for(s=t,o<<=3;!((+s^a)&128);)s=+s<<1,--o;s="("+o+` bit) -`}n&&(t=t-256);for(var u=new Va(t),l=r+1;l=h;--d)s+=l>>d&1?"1":"0";if(s.length>t)return o+Wn(s,t)}return o+s},i.prototype.parseOctetString=function(r,e,t){if(this.isASCII(r,e))return Wn(this.parseStringISO(r,e),t);var n=e-r,a="("+n+` byte) -`;t/=2,n>t&&(e=r+t);for(var o=r;ot&&(a+=K$),a},i.prototype.parseOID=function(r,e,t){for(var n="",a=new Va,o=0,s=r;st)return Wn(n,t);a=new Va,o=0}}return o>0&&(n+=".incomplete"),n},i}(),pI=function(){function i(r,e,t,n,a){if(!(n instanceof wp))throw new Error("Invalid tag value.");this.stream=r,this.header=e,this.length=t,this.tag=n,this.sub=a}return i.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},i.prototype.content=function(r){if(this.tag===void 0)return null;r===void 0&&(r=1/0);var e=this.posContent(),t=Math.abs(this.length);if(!this.tag.isUniversal())return this.sub!==null?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+t,r);switch(this.tag.tagNumber){case 1:return this.stream.get(e)===0?"false":"true";case 2:return this.stream.parseInteger(e,e+t);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(e,e+t,r);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+t,r);case 6:return this.stream.parseOID(e,e+t,r);case 16:case 17:return this.sub!==null?"("+this.sub.length+" elem)":"(no elem)";case 12:return Wn(this.stream.parseStringUTF(e,e+t),r);case 18:case 19:case 20:case 21:case 22:case 26:return Wn(this.stream.parseStringISO(e,e+t),r);case 30:return Wn(this.stream.parseStringBMP(e,e+t),r);case 23:case 24:return this.stream.parseTime(e,e+t,this.tag.tagNumber==23)}return null},i.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(this.sub===null?"null":this.sub.length)+"]"},i.prototype.toPrettyString=function(r){r===void 0&&(r="");var e=r+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(e+="+"),e+=this.length,this.tag.tagConstructed?e+=" (constructed)":this.tag.isUniversal()&&(this.tag.tagNumber==3||this.tag.tagNumber==4)&&this.sub!==null&&(e+=" (encapsulates)"),e+=` -`,this.sub!==null){r+=" ";for(var t=0,n=this.sub.length;t6)throw new Error("Length over 48 bits not supported at position "+(r.pos-1));if(t===0)return null;e=0;for(var n=0;n>6,this.tagConstructed=(e&32)!==0,this.tagNumber=e&31,this.tagNumber==31){var t=new Va;do e=r.get(),t.mulAdd(128,e&127);while(e&128);this.tagNumber=t.simplify()}}return i.prototype.isUniversal=function(){return this.tagClass===0},i.prototype.isEOC=function(){return this.tagClass===0&&this.tagNumber===0},i}(),ti,gI=0xdeadbeefcafe,_p=(gI&16777215)==15715070,ct=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],yI=(1<<26)/ct[ct.length-1],Q=function(){function i(r,e,t){r!=null&&(typeof r=="number"?this.fromNumber(r,e,t):e==null&&typeof r!="string"?this.fromString(r,256):this.fromString(r,e))}return i.prototype.toString=function(r){if(this.s<0)return"-"+this.negate().toString(r);var e;if(r==16)e=4;else if(r==8)e=3;else if(r==2)e=1;else if(r==32)e=5;else if(r==4)e=2;else return this.toRadix(r);var t=(1<0)for(u>u)>0&&(a=!0,o=Sr(n));s>=0;)u>(u+=this.DB-e)):(n=this[s]>>(u-=e)&t,u<=0&&(u+=this.DB,--s)),n>0&&(a=!0),a&&(o+=Sr(n));return a?o:"0"},i.prototype.negate=function(){var r=re();return i.ZERO.subTo(this,r),r},i.prototype.abs=function(){return this.s<0?this.negate():this},i.prototype.compareTo=function(r){var e=this.s-r.s;if(e!=0)return e;var t=this.t;if(e=t-r.t,e!=0)return this.s<0?-e:e;for(;--t>=0;)if((e=this[t]-r[t])!=0)return e;return 0},i.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+ys(this[this.t-1]^this.s&this.DM)},i.prototype.mod=function(r){var e=re();return this.abs().divRemTo(r,null,e),this.s<0&&e.compareTo(i.ZERO)>0&&r.subTo(e,e),e},i.prototype.modPowInt=function(r,e){var t;return r<256||e.isEven()?t=new Ep(e):t=new Sp(e),this.exp(r,t)},i.prototype.clone=function(){var r=re();return this.copyTo(r),r},i.prototype.intValue=function(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<>24},i.prototype.shortValue=function(){return this.t==0?this.s:this[0]<<16>>16},i.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1},i.prototype.toByteArray=function(){var r=this.t,e=[];e[0]=this.s;var t=this.DB-r*this.DB%8,n,a=0;if(r-- >0)for(t>t)!=(this.s&this.DM)>>t&&(e[a++]=n|this.s<=0;)t<8?(n=(this[r]&(1<>(t+=this.DB-8)):(n=this[r]>>(t-=8)&255,t<=0&&(t+=this.DB,--r)),n&128&&(n|=-256),a==0&&(this.s&128)!=(n&128)&&++a,(a>0||n!=this.s)&&(e[a++]=n);return e},i.prototype.equals=function(r){return this.compareTo(r)==0},i.prototype.min=function(r){return this.compareTo(r)<0?this:r},i.prototype.max=function(r){return this.compareTo(r)>0?this:r},i.prototype.and=function(r){var e=re();return this.bitwiseTo(r,lI,e),e},i.prototype.or=function(r){var e=re();return this.bitwiseTo(r,gs,e),e},i.prototype.xor=function(r){var e=re();return this.bitwiseTo(r,mp,e),e},i.prototype.andNot=function(r){var e=re();return this.bitwiseTo(r,bp,e),e},i.prototype.not=function(){for(var r=re(),e=0;e=this.t?this.s!=0:(this[e]&1<1){var d=re();for(o.sqrTo(s[1],d);u<=h;)s[u]=re(),o.mulTo(d,s[u-2],s[u]),u+=2}var c=r.t-1,f,v=!0,p=re(),g;for(t=ys(r[c])-1;c>=0;){for(t>=l?f=r[c]>>t-l&h:(f=(r[c]&(1<0&&(f|=r[c-1]>>this.DB+t-l)),u=n;!(f&1);)f>>=1,--u;if((t-=u)<0&&(t+=this.DB,--c),v)s[f].copyTo(a),v=!1;else{for(;u>1;)o.sqrTo(a,p),o.sqrTo(p,a),u-=2;u>0?o.sqrTo(a,p):(g=a,a=p,p=g),o.mulTo(p,s[f],a)}for(;c>=0&&!(r[c]&1<=0?(t.subTo(n,t),e&&a.subTo(s,a),o.subTo(u,o)):(n.subTo(t,n),e&&s.subTo(a,s),u.subTo(o,u))}if(n.compareTo(i.ONE)!=0)return i.ZERO;if(u.compareTo(r)>=0)return u.subtract(r);if(u.signum()<0)u.addTo(r,u);else return u;return u.signum()<0?u.add(r):u},i.prototype.pow=function(r){return this.exp(r,new mI)},i.prototype.gcd=function(r){var e=this.s<0?this.negate():this.clone(),t=r.s<0?r.negate():r.clone();if(e.compareTo(t)<0){var n=e;e=t,t=n}var a=e.getLowestSetBit(),o=t.getLowestSetBit();if(o<0)return e;for(a0&&(e.rShiftTo(o,e),t.rShiftTo(o,t));e.signum()>0;)(a=e.getLowestSetBit())>0&&e.rShiftTo(a,e),(a=t.getLowestSetBit())>0&&t.rShiftTo(a,t),e.compareTo(t)>=0?(e.subTo(t,e),e.rShiftTo(1,e)):(t.subTo(e,t),t.rShiftTo(1,t));return o>0&&t.lShiftTo(o,t),t},i.prototype.isProbablePrime=function(r){var e,t=this.abs();if(t.t==1&&t[0]<=ct[ct.length-1]){for(e=0;e=0;--e)r[e]=this[e];r.t=this.t,r.s=this.s},i.prototype.fromInt=function(r){this.t=1,this.s=r<0?-1:0,r>0?this[0]=r:r<-1?this[0]=r+this.DV:this.t=0},i.prototype.fromString=function(r,e){var t;if(e==16)t=4;else if(e==8)t=3;else if(e==256)t=8;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else{this.fromRadix(r,e);return}this.t=0,this.s=0;for(var n=r.length,a=!1,o=0;--n>=0;){var s=t==8?+r[n]&255:Tp(r,n);if(s<0){r.charAt(n)=="-"&&(a=!0);continue}a=!1,o==0?this[this.t++]=s:o+t>this.DB?(this[this.t-1]|=(s&(1<>this.DB-o):this[this.t-1]|=s<=this.DB&&(o-=this.DB)}t==8&&+r[0]&128&&(this.s=-1,o>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==r;)--this.t},i.prototype.dlShiftTo=function(r,e){var t;for(t=this.t-1;t>=0;--t)e[t+r]=this[t];for(t=r-1;t>=0;--t)e[t]=0;e.t=this.t+r,e.s=this.s},i.prototype.drShiftTo=function(r,e){for(var t=r;t=0;--u)e[u+o+1]=this[u]>>n|s,s=(this[u]&a)<=0;--u)e[u]=0;e[o]=s,e.t=this.t+o+1,e.s=this.s,e.clamp()},i.prototype.rShiftTo=function(r,e){e.s=this.s;var t=Math.floor(r/this.DB);if(t>=this.t){e.t=0;return}var n=r%this.DB,a=this.DB-n,o=(1<>n;for(var s=t+1;s>n;n>0&&(e[this.t-t-1]|=(this.s&o)<>=this.DB;if(r.t>=this.DB;n+=this.s}else{for(n+=this.s;t>=this.DB;n-=r.s}e.s=n<0?-1:0,n<-1?e[t++]=this.DV+n:n>0&&(e[t++]=n),e.t=t,e.clamp()},i.prototype.multiplyTo=function(r,e){var t=this.abs(),n=r.abs(),a=t.t;for(e.t=a+n.t;--a>=0;)e[a]=0;for(a=0;a=0;)r[t]=0;for(t=0;t=e.DV&&(r[t+e.t]-=e.DV,r[t+e.t+1]=1)}r.t>0&&(r[r.t-1]+=e.am(t,e[t],r,2*t,0,1)),r.s=0,r.clamp()},i.prototype.divRemTo=function(r,e,t){var n=r.abs();if(!(n.t<=0)){var a=this.abs();if(a.t0?(n.lShiftTo(l,o),a.lShiftTo(l,t)):(n.copyTo(o),a.copyTo(t));var h=o.t,d=o[h-1];if(d!=0){var c=d*(1<1?o[h-2]>>this.F2:0),f=this.FV/c,v=(1<=0&&(t[t.t++]=1,t.subTo(m,t)),i.ONE.dlShiftTo(h,m),m.subTo(o,o);o.t=0;){var b=t[--g]==d?this.DM:Math.floor(t[g]*f+(t[g-1]+p)*v);if((t[g]+=o.am(0,b,t,y,0,h))0&&t.rShiftTo(l,t),s<0&&i.ZERO.subTo(t,t)}}},i.prototype.invDigit=function(){if(this.t<1)return 0;var r=this[0];if(!(r&1))return 0;var e=r&3;return e=e*(2-(r&15)*e)&15,e=e*(2-(r&255)*e)&255,e=e*(2-((r&65535)*e&65535))&65535,e=e*(2-r*e%this.DV)%this.DV,e>0?this.DV-e:-e},i.prototype.isEven=function(){return(this.t>0?this[0]&1:this.s)==0},i.prototype.exp=function(r,e){if(r>4294967295||r<1)return i.ONE;var t=re(),n=re(),a=e.convert(this),o=ys(r)-1;for(a.copyTo(t);--o>=0;)if(e.sqrTo(t,n),(r&1<0)e.mulTo(n,a,t);else{var s=t;t=n,n=s}return e.revert(t)},i.prototype.chunkSize=function(r){return Math.floor(Math.LN2*this.DB/Math.log(r))},i.prototype.toRadix=function(r){if(r==null&&(r=10),this.signum()==0||r<2||r>36)return"0";var e=this.chunkSize(r),t=Math.pow(r,e),n=qr(t),a=re(),o=re(),s="";for(this.divRemTo(n,a,o);a.signum()>0;)s=(t+o.intValue()).toString(r).substr(1)+s,a.divRemTo(n,a,o);return o.intValue().toString(r)+s},i.prototype.fromRadix=function(r,e){this.fromInt(0),e==null&&(e=10);for(var t=this.chunkSize(e),n=Math.pow(e,t),a=!1,o=0,s=0,u=0;u=t&&(this.dMultiply(n),this.dAddOffset(s,0),o=0,s=0)}o>0&&(this.dMultiply(Math.pow(e,o)),this.dAddOffset(s,0)),a&&i.ZERO.subTo(this,this)},i.prototype.fromNumber=function(r,e,t){if(typeof e=="number")if(r<2)this.fromInt(1);else for(this.fromNumber(r,t),this.testBit(r-1)||this.bitwiseTo(i.ONE.shiftLeft(r-1),gs,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(i.ONE.shiftLeft(r-1),this);else{var n=[],a=r&7;n.length=(r>>3)+1,e.nextBytes(n),a>0?n[0]&=(1<>=this.DB;if(r.t>=this.DB;n+=this.s}else{for(n+=this.s;t>=this.DB;n+=r.s}e.s=n<0?-1:0,n>0?e[t++]=n:n<-1&&(e[t++]=this.DV+n),e.t=t,e.clamp()},i.prototype.dMultiply=function(r){this[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()},i.prototype.dAddOffset=function(r,e){if(r!=0){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=r;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},i.prototype.multiplyLowerTo=function(r,e,t){var n=Math.min(this.t+r.t,e);for(t.s=0,t.t=n;n>0;)t[--n]=0;for(var a=t.t-this.t;n=0;)t[n]=0;for(n=Math.max(e-this.t,0);n0)if(e==0)t=this[0]%r;else for(var n=this.t-1;n>=0;--n)t=(e*t+this[n])%r;return t},i.prototype.millerRabin=function(r){var e=this.subtract(i.ONE),t=e.getLowestSetBit();if(t<=0)return!1;var n=e.shiftRight(t);r=r+1>>1,r>ct.length&&(r=ct.length);for(var a=re(),o=0;o0&&(t.rShiftTo(s,t),n.rShiftTo(s,n));var u=function(){(o=t.getLowestSetBit())>0&&t.rShiftTo(o,t),(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n)),t.signum()>0?setTimeout(u,0):(s>0&&n.lShiftTo(s,n),setTimeout(function(){e(n)},0))};setTimeout(u,10)},i.prototype.fromNumberAsync=function(r,e,t,n){if(typeof e=="number")if(r<2)this.fromInt(1);else{this.fromNumber(r,t),this.testBit(r-1)||this.bitwiseTo(i.ONE.shiftLeft(r-1),gs,this),this.isEven()&&this.dAddOffset(1,0);var a=this,o=function(){a.dAddOffset(2,0),a.bitLength()>r&&a.subTo(i.ONE.shiftLeft(r-1),a),a.isProbablePrime(e)?setTimeout(function(){n()},0):setTimeout(o,0)};setTimeout(o,0)}else{var s=[],u=r&7;s.length=(r>>3)+1,e.nextBytes(s),u>0?s[0]&=(1<=0?r.mod(this.m):r},i.prototype.revert=function(r){return r},i.prototype.reduce=function(r){r.divRemTo(this.m,null,r)},i.prototype.mulTo=function(r,e,t){r.multiplyTo(e,t),this.reduce(t)},i.prototype.sqrTo=function(r,e){r.squareTo(e),this.reduce(e)},i}(),Sp=function(){function i(r){this.m=r,this.mp=r.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e},i.prototype.revert=function(r){var e=re();return r.copyTo(e),this.reduce(e),e},i.prototype.reduce=function(r){for(;r.t<=this.mt2;)r[r.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&r.DM;for(t=e+this.m.t,r[t]+=this.m.am(0,n,r,e,0,this.m.t);r[t]>=r.DV;)r[t]-=r.DV,r[++t]++}r.clamp(),r.drShiftTo(this.m.t,r),r.compareTo(this.m)>=0&&r.subTo(this.m,r)},i.prototype.mulTo=function(r,e,t){r.multiplyTo(e,t),this.reduce(t)},i.prototype.sqrTo=function(r,e){r.squareTo(e),this.reduce(e)},i}(),bI=function(){function i(r){this.m=r,this.r2=re(),this.q3=re(),Q.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r)}return i.prototype.convert=function(r){if(r.s<0||r.t>2*this.m.t)return r.mod(this.m);if(r.compareTo(this.m)<0)return r;var e=re();return r.copyTo(e),this.reduce(e),e},i.prototype.revert=function(r){return r},i.prototype.reduce=function(r){for(r.drShiftTo(this.m.t-1,this.r2),r.t>this.m.t+1&&(r.t=this.m.t+1,r.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);r.compareTo(this.r2)<0;)r.dAddOffset(1,this.m.t+1);for(r.subTo(this.r2,r);r.compareTo(this.m)>=0;)r.subTo(this.m,r)},i.prototype.mulTo=function(r,e,t){r.multiplyTo(e,t),this.reduce(t)},i.prototype.sqrTo=function(r,e){r.squareTo(e),this.reduce(e)},i}();function re(){return new Q(null)}function _e(i,r){return new Q(i,r)}var Op=typeof navigator<"u";Op&&_p&&navigator.appName=="Microsoft Internet Explorer"?(Q.prototype.am=function(r,e,t,n,a,o){for(var s=e&32767,u=e>>15;--o>=0;){var l=this[r]&32767,h=this[r++]>>15,d=u*l+h*s;l=s*l+((d&32767)<<15)+t[n]+(a&1073741823),a=(l>>>30)+(d>>>15)+u*h+(a>>>30),t[n++]=l&1073741823}return a},ti=30):Op&&_p&&navigator.appName!="Netscape"?(Q.prototype.am=function(r,e,t,n,a,o){for(;--o>=0;){var s=e*this[r++]+t[n]+a;a=Math.floor(s/67108864),t[n++]=s&67108863}return a},ti=26):(Q.prototype.am=function(r,e,t,n,a,o){for(var s=e&16383,u=e>>14;--o>=0;){var l=this[r]&16383,h=this[r++]>>14,d=u*l+h*s;l=s*l+((d&16383)<<14)+t[n]+a,a=(l>>28)+(d>>14)+u*h,t[n++]=l&268435455}return a},ti=28);Q.prototype.DB=ti;Q.prototype.DM=(1<>>16)!=0&&(i=e,r+=16),(e=i>>8)!=0&&(i=e,r+=8),(e=i>>4)!=0&&(i=e,r+=4),(e=i>>2)!=0&&(i=e,r+=2),(e=i>>1)!=0&&(i=e,r+=1),r}Q.ZERO=qr(0);Q.ONE=qr(1);var $I=function(){function i(){this.i=0,this.j=0,this.S=[]}return i.prototype.init=function(r){var e,t,n;for(e=0;e<256;++e)this.S[e]=e;for(t=0,e=0;e<256;++e)t=t+this.S[e]+r[e%r.length]&255,n=this.S[e],this.S[e]=this.S[t],this.S[t]=n;this.i=0,this.j=0},i.prototype.next=function(){var r;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,r=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=r,this.S[r+this.S[this.i]&255]},i}();function wI(){return new $I}var G$=256,ms,Jr=null,er;if(Jr==null){Jr=[],er=0;var bs=void 0;if(typeof window<"u"&&window.crypto&&window.crypto.getRandomValues){var nh=new Uint32Array(256);for(window.crypto.getRandomValues(nh),bs=0;bs=256||er>=G$){window.removeEventListener?window.removeEventListener("mousemove",ws,!1):window.detachEvent&&window.detachEvent("onmousemove",ws);return}try{var r=i.x+i.y;Jr[er++]=r&255,$s+=1}catch{}};typeof window<"u"&&(window.addEventListener?window.addEventListener("mousemove",ws,!1):window.attachEvent&&window.attachEvent("onmousemove",ws))}function _I(){if(ms==null){for(ms=wI();er=0&&r>0;){var n=i.charCodeAt(t--);n<128?e[--r]=n:n>127&&n<2048?(e[--r]=n&63|128,e[--r]=n>>6|192):(e[--r]=n&63|128,e[--r]=n>>6&63|128,e[--r]=n>>12|224)}e[--r]=0;for(var a=new wd,o=[];r>2;){for(o[0]=0;o[0]==0;)a.nextBytes(o);e[--r]=o[0]}return e[--r]=2,e[--r]=0,new Q(e)}var OI=function(){function i(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return i.prototype.doPublic=function(r){return r.modPowInt(this.e,this.n)},i.prototype.doPrivate=function(r){if(this.p==null||this.q==null)return r.modPow(this.d,this.n);for(var e=r.mod(this.p).modPow(this.dmp1,this.p),t=r.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(t)<0;)e=e.add(this.p);return e.subtract(t).multiply(this.coeff).mod(this.p).multiply(this.q).add(t)},i.prototype.setPublic=function(r,e){r!=null&&e!=null&&r.length>0&&e.length>0?(this.n=_e(r,16),this.e=parseInt(e,16)):console.error("Invalid RSA public key")},i.prototype.encrypt=function(r){var e=this.n.bitLength()+7>>3,t=SI(r,e);if(t==null)return null;var n=this.doPublic(t);if(n==null)return null;for(var a=n.toString(16),o=a.length,s=0;s0&&e.length>0?(this.n=_e(r,16),this.e=parseInt(e,16),this.d=_e(t,16)):console.error("Invalid RSA private key")},i.prototype.setPrivateEx=function(r,e,t,n,a,o,s,u){r!=null&&e!=null&&r.length>0&&e.length>0?(this.n=_e(r,16),this.e=parseInt(e,16),this.d=_e(t,16),this.p=_e(n,16),this.q=_e(a,16),this.dmp1=_e(o,16),this.dmq1=_e(s,16),this.coeff=_e(u,16)):console.error("Invalid RSA private key")},i.prototype.generate=function(r,e){var t=new wd,n=r>>1;this.e=parseInt(e,16);for(var a=new Q(e,16);;){for(;this.p=new Q(r-n,1,t),!(this.p.subtract(Q.ONE).gcd(a).compareTo(Q.ONE)==0&&this.p.isProbablePrime(10)););for(;this.q=new Q(n,1,t),!(this.q.subtract(Q.ONE).gcd(a).compareTo(Q.ONE)==0&&this.q.isProbablePrime(10)););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var s=this.p.subtract(Q.ONE),u=this.q.subtract(Q.ONE),l=s.multiply(u);if(l.gcd(a).compareTo(Q.ONE)==0){this.n=this.p.multiply(this.q),this.d=a.modInverse(l),this.dmp1=this.d.mod(s),this.dmq1=this.d.mod(u),this.coeff=this.q.modInverse(this.p);break}}},i.prototype.decrypt=function(r){var e=_e(r,16),t=this.doPrivate(e);return t==null?null:TI(t,this.n.bitLength()+7>>3)},i.prototype.generateAsync=function(r,e,t){var n=new wd,a=r>>1;this.e=parseInt(e,16);var o=new Q(e,16),s=this,u=function(){var l=function(){if(s.p.compareTo(s.q)<=0){var c=s.p;s.p=s.q,s.q=c}var f=s.p.subtract(Q.ONE),v=s.q.subtract(Q.ONE),p=f.multiply(v);p.gcd(o).compareTo(Q.ONE)==0?(s.n=s.p.multiply(s.q),s.d=o.modInverse(p),s.dmp1=s.d.mod(f),s.dmq1=s.d.mod(v),s.coeff=s.q.modInverse(s.p),setTimeout(function(){t()},0)):setTimeout(u,0)},h=function(){s.q=re(),s.q.fromNumberAsync(a,1,n,function(){s.q.subtract(Q.ONE).gcda(o,function(c){c.compareTo(Q.ONE)==0&&s.q.isProbablePrime(10)?setTimeout(l,0):setTimeout(h,0)})})},d=function(){s.p=re(),s.p.fromNumberAsync(r-a,1,n,function(){s.p.subtract(Q.ONE).gcda(o,function(c){c.compareTo(Q.ONE)==0&&s.p.isProbablePrime(10)?setTimeout(h,0):setTimeout(d,0)})})};setTimeout(d,0)};setTimeout(u,0)},i.prototype.sign=function(r,e,t){var n=II(t),a=n+e(r).toString(),o=EI(a,this.n.bitLength()/4);if(o==null)return null;var s=this.doPrivate(o);if(s==null)return null;var u=s.toString(16);return u.length&1?"0"+u:u},i.prototype.verify=function(r,e,t){var n=_e(e,16),a=this.doPublic(n);if(a==null)return null;var o=a.toString(16).replace(/^1f+00/,""),s=kI(o);return s==t(r).toString()},i}();function TI(i,r){for(var e=i.toByteArray(),t=0;t=e.length)return null;for(var n="";++t191&&a<224?(n+=String.fromCharCode((a&31)<<6|e[t+1]&63),++t):(n+=String.fromCharCode((a&15)<<12|(e[t+1]&63)<<6|e[t+2]&63),t+=2)}return n}var su={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function II(i){return su[i]||""}function kI(i){for(var r in su)if(su.hasOwnProperty(r)){var e=su[r],t=e.length;if(i.substr(0,t)==e)return i.substr(t)}return i}/*! +`}n&&(t=t-256);for(var u=new Wa(t),l=r+1;l=h;--d)s+=l>>d&1?"1":"0";if(s.length>t)return o+Vn(s,t)}return o+s},i.prototype.parseOctetString=function(r,e,t){if(this.isASCII(r,e))return Vn(this.parseStringISO(r,e),t);var n=e-r,a="("+n+` byte) +`;t/=2,n>t&&(e=r+t);for(var o=r;ot&&(a+=K$),a},i.prototype.parseOID=function(r,e,t){for(var n="",a=new Wa,o=0,s=r;st)return Vn(n,t);a=new Wa,o=0}}return o>0&&(n+=".incomplete"),n},i}(),pI=function(){function i(r,e,t,n,a){if(!(n instanceof wp))throw new Error("Invalid tag value.");this.stream=r,this.header=e,this.length=t,this.tag=n,this.sub=a}return i.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},i.prototype.content=function(r){if(this.tag===void 0)return null;r===void 0&&(r=1/0);var e=this.posContent(),t=Math.abs(this.length);if(!this.tag.isUniversal())return this.sub!==null?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+t,r);switch(this.tag.tagNumber){case 1:return this.stream.get(e)===0?"false":"true";case 2:return this.stream.parseInteger(e,e+t);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(e,e+t,r);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+t,r);case 6:return this.stream.parseOID(e,e+t,r);case 16:case 17:return this.sub!==null?"("+this.sub.length+" elem)":"(no elem)";case 12:return Vn(this.stream.parseStringUTF(e,e+t),r);case 18:case 19:case 20:case 21:case 22:case 26:return Vn(this.stream.parseStringISO(e,e+t),r);case 30:return Vn(this.stream.parseStringBMP(e,e+t),r);case 23:case 24:return this.stream.parseTime(e,e+t,this.tag.tagNumber==23)}return null},i.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(this.sub===null?"null":this.sub.length)+"]"},i.prototype.toPrettyString=function(r){r===void 0&&(r="");var e=r+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(e+="+"),e+=this.length,this.tag.tagConstructed?e+=" (constructed)":this.tag.isUniversal()&&(this.tag.tagNumber==3||this.tag.tagNumber==4)&&this.sub!==null&&(e+=" (encapsulates)"),e+=` +`,this.sub!==null){r+=" ";for(var t=0,n=this.sub.length;t6)throw new Error("Length over 48 bits not supported at position "+(r.pos-1));if(t===0)return null;e=0;for(var n=0;n>6,this.tagConstructed=(e&32)!==0,this.tagNumber=e&31,this.tagNumber==31){var t=new Wa;do e=r.get(),t.mulAdd(128,e&127);while(e&128);this.tagNumber=t.simplify()}}return i.prototype.isUniversal=function(){return this.tagClass===0},i.prototype.isEOC=function(){return this.tagClass===0&&this.tagNumber===0},i}(),ti,gI=0xdeadbeefcafe,_p=(gI&16777215)==15715070,ct=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],yI=(1<<26)/ct[ct.length-1],Q=function(){function i(r,e,t){r!=null&&(typeof r=="number"?this.fromNumber(r,e,t):e==null&&typeof r!="string"?this.fromString(r,256):this.fromString(r,e))}return i.prototype.toString=function(r){if(this.s<0)return"-"+this.negate().toString(r);var e;if(r==16)e=4;else if(r==8)e=3;else if(r==2)e=1;else if(r==32)e=5;else if(r==4)e=2;else return this.toRadix(r);var t=(1<0)for(u>u)>0&&(a=!0,o=Or(n));s>=0;)u>(u+=this.DB-e)):(n=this[s]>>(u-=e)&t,u<=0&&(u+=this.DB,--s)),n>0&&(a=!0),a&&(o+=Or(n));return a?o:"0"},i.prototype.negate=function(){var r=re();return i.ZERO.subTo(this,r),r},i.prototype.abs=function(){return this.s<0?this.negate():this},i.prototype.compareTo=function(r){var e=this.s-r.s;if(e!=0)return e;var t=this.t;if(e=t-r.t,e!=0)return this.s<0?-e:e;for(;--t>=0;)if((e=this[t]-r[t])!=0)return e;return 0},i.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+ys(this[this.t-1]^this.s&this.DM)},i.prototype.mod=function(r){var e=re();return this.abs().divRemTo(r,null,e),this.s<0&&e.compareTo(i.ZERO)>0&&r.subTo(e,e),e},i.prototype.modPowInt=function(r,e){var t;return r<256||e.isEven()?t=new Ep(e):t=new Sp(e),this.exp(r,t)},i.prototype.clone=function(){var r=re();return this.copyTo(r),r},i.prototype.intValue=function(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<>24},i.prototype.shortValue=function(){return this.t==0?this.s:this[0]<<16>>16},i.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1},i.prototype.toByteArray=function(){var r=this.t,e=[];e[0]=this.s;var t=this.DB-r*this.DB%8,n,a=0;if(r-- >0)for(t>t)!=(this.s&this.DM)>>t&&(e[a++]=n|this.s<=0;)t<8?(n=(this[r]&(1<>(t+=this.DB-8)):(n=this[r]>>(t-=8)&255,t<=0&&(t+=this.DB,--r)),n&128&&(n|=-256),a==0&&(this.s&128)!=(n&128)&&++a,(a>0||n!=this.s)&&(e[a++]=n);return e},i.prototype.equals=function(r){return this.compareTo(r)==0},i.prototype.min=function(r){return this.compareTo(r)<0?this:r},i.prototype.max=function(r){return this.compareTo(r)>0?this:r},i.prototype.and=function(r){var e=re();return this.bitwiseTo(r,lI,e),e},i.prototype.or=function(r){var e=re();return this.bitwiseTo(r,gs,e),e},i.prototype.xor=function(r){var e=re();return this.bitwiseTo(r,mp,e),e},i.prototype.andNot=function(r){var e=re();return this.bitwiseTo(r,bp,e),e},i.prototype.not=function(){for(var r=re(),e=0;e=this.t?this.s!=0:(this[e]&1<1){var d=re();for(o.sqrTo(s[1],d);u<=h;)s[u]=re(),o.mulTo(d,s[u-2],s[u]),u+=2}var c=r.t-1,f,v=!0,p=re(),g;for(t=ys(r[c])-1;c>=0;){for(t>=l?f=r[c]>>t-l&h:(f=(r[c]&(1<0&&(f|=r[c-1]>>this.DB+t-l)),u=n;!(f&1);)f>>=1,--u;if((t-=u)<0&&(t+=this.DB,--c),v)s[f].copyTo(a),v=!1;else{for(;u>1;)o.sqrTo(a,p),o.sqrTo(p,a),u-=2;u>0?o.sqrTo(a,p):(g=a,a=p,p=g),o.mulTo(p,s[f],a)}for(;c>=0&&!(r[c]&1<=0?(t.subTo(n,t),e&&a.subTo(s,a),o.subTo(u,o)):(n.subTo(t,n),e&&s.subTo(a,s),u.subTo(o,u))}if(n.compareTo(i.ONE)!=0)return i.ZERO;if(u.compareTo(r)>=0)return u.subtract(r);if(u.signum()<0)u.addTo(r,u);else return u;return u.signum()<0?u.add(r):u},i.prototype.pow=function(r){return this.exp(r,new mI)},i.prototype.gcd=function(r){var e=this.s<0?this.negate():this.clone(),t=r.s<0?r.negate():r.clone();if(e.compareTo(t)<0){var n=e;e=t,t=n}var a=e.getLowestSetBit(),o=t.getLowestSetBit();if(o<0)return e;for(a0&&(e.rShiftTo(o,e),t.rShiftTo(o,t));e.signum()>0;)(a=e.getLowestSetBit())>0&&e.rShiftTo(a,e),(a=t.getLowestSetBit())>0&&t.rShiftTo(a,t),e.compareTo(t)>=0?(e.subTo(t,e),e.rShiftTo(1,e)):(t.subTo(e,t),t.rShiftTo(1,t));return o>0&&t.lShiftTo(o,t),t},i.prototype.isProbablePrime=function(r){var e,t=this.abs();if(t.t==1&&t[0]<=ct[ct.length-1]){for(e=0;e=0;--e)r[e]=this[e];r.t=this.t,r.s=this.s},i.prototype.fromInt=function(r){this.t=1,this.s=r<0?-1:0,r>0?this[0]=r:r<-1?this[0]=r+this.DV:this.t=0},i.prototype.fromString=function(r,e){var t;if(e==16)t=4;else if(e==8)t=3;else if(e==256)t=8;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else{this.fromRadix(r,e);return}this.t=0,this.s=0;for(var n=r.length,a=!1,o=0;--n>=0;){var s=t==8?+r[n]&255:Tp(r,n);if(s<0){r.charAt(n)=="-"&&(a=!0);continue}a=!1,o==0?this[this.t++]=s:o+t>this.DB?(this[this.t-1]|=(s&(1<>this.DB-o):this[this.t-1]|=s<=this.DB&&(o-=this.DB)}t==8&&+r[0]&128&&(this.s=-1,o>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==r;)--this.t},i.prototype.dlShiftTo=function(r,e){var t;for(t=this.t-1;t>=0;--t)e[t+r]=this[t];for(t=r-1;t>=0;--t)e[t]=0;e.t=this.t+r,e.s=this.s},i.prototype.drShiftTo=function(r,e){for(var t=r;t=0;--u)e[u+o+1]=this[u]>>n|s,s=(this[u]&a)<=0;--u)e[u]=0;e[o]=s,e.t=this.t+o+1,e.s=this.s,e.clamp()},i.prototype.rShiftTo=function(r,e){e.s=this.s;var t=Math.floor(r/this.DB);if(t>=this.t){e.t=0;return}var n=r%this.DB,a=this.DB-n,o=(1<>n;for(var s=t+1;s>n;n>0&&(e[this.t-t-1]|=(this.s&o)<>=this.DB;if(r.t>=this.DB;n+=this.s}else{for(n+=this.s;t>=this.DB;n-=r.s}e.s=n<0?-1:0,n<-1?e[t++]=this.DV+n:n>0&&(e[t++]=n),e.t=t,e.clamp()},i.prototype.multiplyTo=function(r,e){var t=this.abs(),n=r.abs(),a=t.t;for(e.t=a+n.t;--a>=0;)e[a]=0;for(a=0;a=0;)r[t]=0;for(t=0;t=e.DV&&(r[t+e.t]-=e.DV,r[t+e.t+1]=1)}r.t>0&&(r[r.t-1]+=e.am(t,e[t],r,2*t,0,1)),r.s=0,r.clamp()},i.prototype.divRemTo=function(r,e,t){var n=r.abs();if(!(n.t<=0)){var a=this.abs();if(a.t0?(n.lShiftTo(l,o),a.lShiftTo(l,t)):(n.copyTo(o),a.copyTo(t));var h=o.t,d=o[h-1];if(d!=0){var c=d*(1<1?o[h-2]>>this.F2:0),f=this.FV/c,v=(1<=0&&(t[t.t++]=1,t.subTo(m,t)),i.ONE.dlShiftTo(h,m),m.subTo(o,o);o.t=0;){var b=t[--g]==d?this.DM:Math.floor(t[g]*f+(t[g-1]+p)*v);if((t[g]+=o.am(0,b,t,y,0,h))0&&t.rShiftTo(l,t),s<0&&i.ZERO.subTo(t,t)}}},i.prototype.invDigit=function(){if(this.t<1)return 0;var r=this[0];if(!(r&1))return 0;var e=r&3;return e=e*(2-(r&15)*e)&15,e=e*(2-(r&255)*e)&255,e=e*(2-((r&65535)*e&65535))&65535,e=e*(2-r*e%this.DV)%this.DV,e>0?this.DV-e:-e},i.prototype.isEven=function(){return(this.t>0?this[0]&1:this.s)==0},i.prototype.exp=function(r,e){if(r>4294967295||r<1)return i.ONE;var t=re(),n=re(),a=e.convert(this),o=ys(r)-1;for(a.copyTo(t);--o>=0;)if(e.sqrTo(t,n),(r&1<0)e.mulTo(n,a,t);else{var s=t;t=n,n=s}return e.revert(t)},i.prototype.chunkSize=function(r){return Math.floor(Math.LN2*this.DB/Math.log(r))},i.prototype.toRadix=function(r){if(r==null&&(r=10),this.signum()==0||r<2||r>36)return"0";var e=this.chunkSize(r),t=Math.pow(r,e),n=qr(t),a=re(),o=re(),s="";for(this.divRemTo(n,a,o);a.signum()>0;)s=(t+o.intValue()).toString(r).substr(1)+s,a.divRemTo(n,a,o);return o.intValue().toString(r)+s},i.prototype.fromRadix=function(r,e){this.fromInt(0),e==null&&(e=10);for(var t=this.chunkSize(e),n=Math.pow(e,t),a=!1,o=0,s=0,u=0;u=t&&(this.dMultiply(n),this.dAddOffset(s,0),o=0,s=0)}o>0&&(this.dMultiply(Math.pow(e,o)),this.dAddOffset(s,0)),a&&i.ZERO.subTo(this,this)},i.prototype.fromNumber=function(r,e,t){if(typeof e=="number")if(r<2)this.fromInt(1);else for(this.fromNumber(r,t),this.testBit(r-1)||this.bitwiseTo(i.ONE.shiftLeft(r-1),gs,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(i.ONE.shiftLeft(r-1),this);else{var n=[],a=r&7;n.length=(r>>3)+1,e.nextBytes(n),a>0?n[0]&=(1<>=this.DB;if(r.t>=this.DB;n+=this.s}else{for(n+=this.s;t>=this.DB;n+=r.s}e.s=n<0?-1:0,n>0?e[t++]=n:n<-1&&(e[t++]=this.DV+n),e.t=t,e.clamp()},i.prototype.dMultiply=function(r){this[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()},i.prototype.dAddOffset=function(r,e){if(r!=0){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=r;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},i.prototype.multiplyLowerTo=function(r,e,t){var n=Math.min(this.t+r.t,e);for(t.s=0,t.t=n;n>0;)t[--n]=0;for(var a=t.t-this.t;n=0;)t[n]=0;for(n=Math.max(e-this.t,0);n0)if(e==0)t=this[0]%r;else for(var n=this.t-1;n>=0;--n)t=(e*t+this[n])%r;return t},i.prototype.millerRabin=function(r){var e=this.subtract(i.ONE),t=e.getLowestSetBit();if(t<=0)return!1;var n=e.shiftRight(t);r=r+1>>1,r>ct.length&&(r=ct.length);for(var a=re(),o=0;o0&&(t.rShiftTo(s,t),n.rShiftTo(s,n));var u=function(){(o=t.getLowestSetBit())>0&&t.rShiftTo(o,t),(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n)),t.signum()>0?setTimeout(u,0):(s>0&&n.lShiftTo(s,n),setTimeout(function(){e(n)},0))};setTimeout(u,10)},i.prototype.fromNumberAsync=function(r,e,t,n){if(typeof e=="number")if(r<2)this.fromInt(1);else{this.fromNumber(r,t),this.testBit(r-1)||this.bitwiseTo(i.ONE.shiftLeft(r-1),gs,this),this.isEven()&&this.dAddOffset(1,0);var a=this,o=function(){a.dAddOffset(2,0),a.bitLength()>r&&a.subTo(i.ONE.shiftLeft(r-1),a),a.isProbablePrime(e)?setTimeout(function(){n()},0):setTimeout(o,0)};setTimeout(o,0)}else{var s=[],u=r&7;s.length=(r>>3)+1,e.nextBytes(s),u>0?s[0]&=(1<=0?r.mod(this.m):r},i.prototype.revert=function(r){return r},i.prototype.reduce=function(r){r.divRemTo(this.m,null,r)},i.prototype.mulTo=function(r,e,t){r.multiplyTo(e,t),this.reduce(t)},i.prototype.sqrTo=function(r,e){r.squareTo(e),this.reduce(e)},i}(),Sp=function(){function i(r){this.m=r,this.mp=r.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e},i.prototype.revert=function(r){var e=re();return r.copyTo(e),this.reduce(e),e},i.prototype.reduce=function(r){for(;r.t<=this.mt2;)r[r.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&r.DM;for(t=e+this.m.t,r[t]+=this.m.am(0,n,r,e,0,this.m.t);r[t]>=r.DV;)r[t]-=r.DV,r[++t]++}r.clamp(),r.drShiftTo(this.m.t,r),r.compareTo(this.m)>=0&&r.subTo(this.m,r)},i.prototype.mulTo=function(r,e,t){r.multiplyTo(e,t),this.reduce(t)},i.prototype.sqrTo=function(r,e){r.squareTo(e),this.reduce(e)},i}(),bI=function(){function i(r){this.m=r,this.r2=re(),this.q3=re(),Q.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r)}return i.prototype.convert=function(r){if(r.s<0||r.t>2*this.m.t)return r.mod(this.m);if(r.compareTo(this.m)<0)return r;var e=re();return r.copyTo(e),this.reduce(e),e},i.prototype.revert=function(r){return r},i.prototype.reduce=function(r){for(r.drShiftTo(this.m.t-1,this.r2),r.t>this.m.t+1&&(r.t=this.m.t+1,r.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);r.compareTo(this.r2)<0;)r.dAddOffset(1,this.m.t+1);for(r.subTo(this.r2,r);r.compareTo(this.m)>=0;)r.subTo(this.m,r)},i.prototype.mulTo=function(r,e,t){r.multiplyTo(e,t),this.reduce(t)},i.prototype.sqrTo=function(r,e){r.squareTo(e),this.reduce(e)},i}();function re(){return new Q(null)}function _e(i,r){return new Q(i,r)}var Op=typeof navigator<"u";Op&&_p&&navigator.appName=="Microsoft Internet Explorer"?(Q.prototype.am=function(r,e,t,n,a,o){for(var s=e&32767,u=e>>15;--o>=0;){var l=this[r]&32767,h=this[r++]>>15,d=u*l+h*s;l=s*l+((d&32767)<<15)+t[n]+(a&1073741823),a=(l>>>30)+(d>>>15)+u*h+(a>>>30),t[n++]=l&1073741823}return a},ti=30):Op&&_p&&navigator.appName!="Netscape"?(Q.prototype.am=function(r,e,t,n,a,o){for(;--o>=0;){var s=e*this[r++]+t[n]+a;a=Math.floor(s/67108864),t[n++]=s&67108863}return a},ti=26):(Q.prototype.am=function(r,e,t,n,a,o){for(var s=e&16383,u=e>>14;--o>=0;){var l=this[r]&16383,h=this[r++]>>14,d=u*l+h*s;l=s*l+((d&16383)<<14)+t[n]+a,a=(l>>28)+(d>>14)+u*h,t[n++]=l&268435455}return a},ti=28);Q.prototype.DB=ti;Q.prototype.DM=(1<>>16)!=0&&(i=e,r+=16),(e=i>>8)!=0&&(i=e,r+=8),(e=i>>4)!=0&&(i=e,r+=4),(e=i>>2)!=0&&(i=e,r+=2),(e=i>>1)!=0&&(i=e,r+=1),r}Q.ZERO=qr(0);Q.ONE=qr(1);var $I=function(){function i(){this.i=0,this.j=0,this.S=[]}return i.prototype.init=function(r){var e,t,n;for(e=0;e<256;++e)this.S[e]=e;for(t=0,e=0;e<256;++e)t=t+this.S[e]+r[e%r.length]&255,n=this.S[e],this.S[e]=this.S[t],this.S[t]=n;this.i=0,this.j=0},i.prototype.next=function(){var r;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,r=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=r,this.S[r+this.S[this.i]&255]},i}();function wI(){return new $I}var G$=256,ms,Jr=null,er;if(Jr==null){Jr=[],er=0;var bs=void 0;if(typeof window<"u"&&window.crypto&&window.crypto.getRandomValues){var nh=new Uint32Array(256);for(window.crypto.getRandomValues(nh),bs=0;bs=256||er>=G$){window.removeEventListener?window.removeEventListener("mousemove",ws,!1):window.detachEvent&&window.detachEvent("onmousemove",ws);return}try{var r=i.x+i.y;Jr[er++]=r&255,$s+=1}catch{}};typeof window<"u"&&(window.addEventListener?window.addEventListener("mousemove",ws,!1):window.attachEvent&&window.attachEvent("onmousemove",ws))}function _I(){if(ms==null){for(ms=wI();er=0&&r>0;){var n=i.charCodeAt(t--);n<128?e[--r]=n:n>127&&n<2048?(e[--r]=n&63|128,e[--r]=n>>6|192):(e[--r]=n&63|128,e[--r]=n>>6&63|128,e[--r]=n>>12|224)}e[--r]=0;for(var a=new wd,o=[];r>2;){for(o[0]=0;o[0]==0;)a.nextBytes(o);e[--r]=o[0]}return e[--r]=2,e[--r]=0,new Q(e)}var OI=function(){function i(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return i.prototype.doPublic=function(r){return r.modPowInt(this.e,this.n)},i.prototype.doPrivate=function(r){if(this.p==null||this.q==null)return r.modPow(this.d,this.n);for(var e=r.mod(this.p).modPow(this.dmp1,this.p),t=r.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(t)<0;)e=e.add(this.p);return e.subtract(t).multiply(this.coeff).mod(this.p).multiply(this.q).add(t)},i.prototype.setPublic=function(r,e){r!=null&&e!=null&&r.length>0&&e.length>0?(this.n=_e(r,16),this.e=parseInt(e,16)):console.error("Invalid RSA public key")},i.prototype.encrypt=function(r){var e=this.n.bitLength()+7>>3,t=SI(r,e);if(t==null)return null;var n=this.doPublic(t);if(n==null)return null;for(var a=n.toString(16),o=a.length,s=0;s0&&e.length>0?(this.n=_e(r,16),this.e=parseInt(e,16),this.d=_e(t,16)):console.error("Invalid RSA private key")},i.prototype.setPrivateEx=function(r,e,t,n,a,o,s,u){r!=null&&e!=null&&r.length>0&&e.length>0?(this.n=_e(r,16),this.e=parseInt(e,16),this.d=_e(t,16),this.p=_e(n,16),this.q=_e(a,16),this.dmp1=_e(o,16),this.dmq1=_e(s,16),this.coeff=_e(u,16)):console.error("Invalid RSA private key")},i.prototype.generate=function(r,e){var t=new wd,n=r>>1;this.e=parseInt(e,16);for(var a=new Q(e,16);;){for(;this.p=new Q(r-n,1,t),!(this.p.subtract(Q.ONE).gcd(a).compareTo(Q.ONE)==0&&this.p.isProbablePrime(10)););for(;this.q=new Q(n,1,t),!(this.q.subtract(Q.ONE).gcd(a).compareTo(Q.ONE)==0&&this.q.isProbablePrime(10)););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var s=this.p.subtract(Q.ONE),u=this.q.subtract(Q.ONE),l=s.multiply(u);if(l.gcd(a).compareTo(Q.ONE)==0){this.n=this.p.multiply(this.q),this.d=a.modInverse(l),this.dmp1=this.d.mod(s),this.dmq1=this.d.mod(u),this.coeff=this.q.modInverse(this.p);break}}},i.prototype.decrypt=function(r){var e=_e(r,16),t=this.doPrivate(e);return t==null?null:TI(t,this.n.bitLength()+7>>3)},i.prototype.generateAsync=function(r,e,t){var n=new wd,a=r>>1;this.e=parseInt(e,16);var o=new Q(e,16),s=this,u=function(){var l=function(){if(s.p.compareTo(s.q)<=0){var c=s.p;s.p=s.q,s.q=c}var f=s.p.subtract(Q.ONE),v=s.q.subtract(Q.ONE),p=f.multiply(v);p.gcd(o).compareTo(Q.ONE)==0?(s.n=s.p.multiply(s.q),s.d=o.modInverse(p),s.dmp1=s.d.mod(f),s.dmq1=s.d.mod(v),s.coeff=s.q.modInverse(s.p),setTimeout(function(){t()},0)):setTimeout(u,0)},h=function(){s.q=re(),s.q.fromNumberAsync(a,1,n,function(){s.q.subtract(Q.ONE).gcda(o,function(c){c.compareTo(Q.ONE)==0&&s.q.isProbablePrime(10)?setTimeout(l,0):setTimeout(h,0)})})},d=function(){s.p=re(),s.p.fromNumberAsync(r-a,1,n,function(){s.p.subtract(Q.ONE).gcda(o,function(c){c.compareTo(Q.ONE)==0&&s.p.isProbablePrime(10)?setTimeout(h,0):setTimeout(d,0)})})};setTimeout(d,0)};setTimeout(u,0)},i.prototype.sign=function(r,e,t){var n=II(t),a=n+e(r).toString(),o=EI(a,this.n.bitLength()/4);if(o==null)return null;var s=this.doPrivate(o);if(s==null)return null;var u=s.toString(16);return u.length&1?"0"+u:u},i.prototype.verify=function(r,e,t){var n=_e(e,16),a=this.doPublic(n);if(a==null)return null;var o=a.toString(16).replace(/^1f+00/,""),s=kI(o);return s==t(r).toString()},i}();function TI(i,r){for(var e=i.toByteArray(),t=0;t=e.length)return null;for(var n="";++t191&&a<224?(n+=String.fromCharCode((a&31)<<6|e[t+1]&63),++t):(n+=String.fromCharCode((a&15)<<12|(e[t+1]&63)<<6|e[t+2]&63),t+=2)}return n}var su={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function II(i){return su[i]||""}function kI(i){for(var r in su)if(su.hasOwnProperty(r)){var e=su[r],t=e.length;if(i.substr(0,t)==e)return i.substr(t)}return i}/*! Copyright (c) 2011, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html @@ -17,14 +17,14 @@ version: 2.9.0 * @version asn1 1.0.13 (2017-Jun-02) * @since jsrsasign 2.1 * @license MIT License - */var T={};(typeof T.asn1>"u"||!T.asn1)&&(T.asn1={});T.asn1.ASN1Util=new function(){this.integerToByteHex=function(i){var r=i.toString(16);return r.length%2==1&&(r="0"+r),r},this.bigIntToMinTwosComplementsHex=function(i){var r=i.toString(16);if(r.substr(0,1)!="-")r.length%2==1?r="0"+r:r.match(/^[0-7]/)||(r="00"+r);else{var e=r.substr(1),t=e.length;t%2==1?t+=1:r.match(/^[0-7]/)||(t+=2);for(var n="",a=0;a"u"||this.hV==null)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+i.length+",v="+this.hV;var r=this.hV.length/2,e=r.toString(16);if(e.length%2==1&&(e="0"+e),r<128)return e;var t=e.length/2;if(t>15)throw"ASN.1 length too long to represent by 8x: n = "+r.toString(16);var n=128+t;return n.toString(16)+e},this.getEncodedHex=function(){return(this.hTLV==null||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}};T.asn1.DERAbstractString=function(i){T.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(r){this.hTLV=null,this.isModified=!0,this.s=r,this.hV=stohex(this.s)},this.setStringHex=function(r){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=r},this.getFreshValueHex=function(){return this.hV},typeof i<"u"&&(typeof i=="string"?this.setString(i):typeof i.str<"u"?this.setString(i.str):typeof i.hex<"u"&&this.setStringHex(i.hex))};De.lang.extend(T.asn1.DERAbstractString,T.asn1.ASN1Object);T.asn1.DERAbstractTime=function(i){T.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(r){utc=r.getTime()+r.getTimezoneOffset()*6e4;var e=new Date(utc);return e},this.formatDate=function(r,e,t){var n=this.zeroPadding,a=this.localDateToUTC(r),o=String(a.getFullYear());e=="utc"&&(o=o.substr(2,2));var s=n(String(a.getMonth()+1),2),u=n(String(a.getDate()),2),l=n(String(a.getHours()),2),h=n(String(a.getMinutes()),2),d=n(String(a.getSeconds()),2),c=o+s+u+l+h+d;if(t===!0){var f=a.getMilliseconds();if(f!=0){var v=n(String(f),3);v=v.replace(/[0]+$/,""),c=c+"."+v}}return c+"Z"},this.zeroPadding=function(r,e){return r.length>=e?r:new Array(e-r.length+1).join("0")+r},this.getString=function(){return this.s},this.setString=function(r){this.hTLV=null,this.isModified=!0,this.s=r,this.hV=stohex(r)},this.setByDateValue=function(r,e,t,n,a,o){var s=new Date(Date.UTC(r,e-1,t,n,a,o,0));this.setByDate(s)},this.getFreshValueHex=function(){return this.hV}};De.lang.extend(T.asn1.DERAbstractTime,T.asn1.ASN1Object);T.asn1.DERAbstractStructured=function(i){T.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(r){this.hTLV=null,this.isModified=!0,this.asn1Array=r},this.appendASN1Object=function(r){this.hTLV=null,this.isModified=!0,this.asn1Array.push(r)},this.asn1Array=new Array,typeof i<"u"&&typeof i.array<"u"&&(this.asn1Array=i.array)};De.lang.extend(T.asn1.DERAbstractStructured,T.asn1.ASN1Object);T.asn1.DERBoolean=function(){T.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"};De.lang.extend(T.asn1.DERBoolean,T.asn1.ASN1Object);T.asn1.DERInteger=function(i){T.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(r){this.hTLV=null,this.isModified=!0,this.hV=T.asn1.ASN1Util.bigIntToMinTwosComplementsHex(r)},this.setByInteger=function(r){var e=new Q(String(r),10);this.setByBigInteger(e)},this.setValueHex=function(r){this.hV=r},this.getFreshValueHex=function(){return this.hV},typeof i<"u"&&(typeof i.bigint<"u"?this.setByBigInteger(i.bigint):typeof i.int<"u"?this.setByInteger(i.int):typeof i=="number"?this.setByInteger(i):typeof i.hex<"u"&&this.setValueHex(i.hex))};De.lang.extend(T.asn1.DERInteger,T.asn1.ASN1Object);T.asn1.DERBitString=function(i){if(i!==void 0&&typeof i.obj<"u"){var r=T.asn1.ASN1Util.newObject(i.obj);i.hex="00"+r.getEncodedHex()}T.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7"u"&&typeof this.s>"u"&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},i!==void 0&&(i.str!==void 0?this.setString(i.str):typeof i=="string"&&i.match(/^[0-9]{12}Z$/)?this.setString(i):i.hex!==void 0?this.setStringHex(i.hex):i.date!==void 0&&this.setByDate(i.date))};De.lang.extend(T.asn1.DERUTCTime,T.asn1.DERAbstractTime);T.asn1.DERGeneralizedTime=function(i){T.asn1.DERGeneralizedTime.superclass.constructor.call(this,i),this.hT="18",this.withMillis=!1,this.setByDate=function(r){this.hTLV=null,this.isModified=!0,this.date=r,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return this.date===void 0&&this.s===void 0&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},i!==void 0&&(i.str!==void 0?this.setString(i.str):typeof i=="string"&&i.match(/^[0-9]{14}Z$/)?this.setString(i):i.hex!==void 0?this.setStringHex(i.hex):i.date!==void 0&&this.setByDate(i.date),i.millis===!0&&(this.withMillis=!0))};De.lang.extend(T.asn1.DERGeneralizedTime,T.asn1.DERAbstractTime);T.asn1.DERSequence=function(i){T.asn1.DERSequence.superclass.constructor.call(this,i),this.hT="30",this.getFreshValueHex=function(){for(var r="",e=0;e"u"||!T.asn1)&&(T.asn1={});T.asn1.ASN1Util=new function(){this.integerToByteHex=function(i){var r=i.toString(16);return r.length%2==1&&(r="0"+r),r},this.bigIntToMinTwosComplementsHex=function(i){var r=i.toString(16);if(r.substr(0,1)!="-")r.length%2==1?r="0"+r:r.match(/^[0-7]/)||(r="00"+r);else{var e=r.substr(1),t=e.length;t%2==1?t+=1:r.match(/^[0-7]/)||(t+=2);for(var n="",a=0;a"u"||this.hV==null)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+i.length+",v="+this.hV;var r=this.hV.length/2,e=r.toString(16);if(e.length%2==1&&(e="0"+e),r<128)return e;var t=e.length/2;if(t>15)throw"ASN.1 length too long to represent by 8x: n = "+r.toString(16);var n=128+t;return n.toString(16)+e},this.getEncodedHex=function(){return(this.hTLV==null||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}};T.asn1.DERAbstractString=function(i){T.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(r){this.hTLV=null,this.isModified=!0,this.s=r,this.hV=stohex(this.s)},this.setStringHex=function(r){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=r},this.getFreshValueHex=function(){return this.hV},typeof i<"u"&&(typeof i=="string"?this.setString(i):typeof i.str<"u"?this.setString(i.str):typeof i.hex<"u"&&this.setStringHex(i.hex))};De.lang.extend(T.asn1.DERAbstractString,T.asn1.ASN1Object);T.asn1.DERAbstractTime=function(i){T.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(r){utc=r.getTime()+r.getTimezoneOffset()*6e4;var e=new Date(utc);return e},this.formatDate=function(r,e,t){var n=this.zeroPadding,a=this.localDateToUTC(r),o=String(a.getFullYear());e=="utc"&&(o=o.substr(2,2));var s=n(String(a.getMonth()+1),2),u=n(String(a.getDate()),2),l=n(String(a.getHours()),2),h=n(String(a.getMinutes()),2),d=n(String(a.getSeconds()),2),c=o+s+u+l+h+d;if(t===!0){var f=a.getMilliseconds();if(f!=0){var v=n(String(f),3);v=v.replace(/[0]+$/,""),c=c+"."+v}}return c+"Z"},this.zeroPadding=function(r,e){return r.length>=e?r:new Array(e-r.length+1).join("0")+r},this.getString=function(){return this.s},this.setString=function(r){this.hTLV=null,this.isModified=!0,this.s=r,this.hV=stohex(r)},this.setByDateValue=function(r,e,t,n,a,o){var s=new Date(Date.UTC(r,e-1,t,n,a,o,0));this.setByDate(s)},this.getFreshValueHex=function(){return this.hV}};De.lang.extend(T.asn1.DERAbstractTime,T.asn1.ASN1Object);T.asn1.DERAbstractStructured=function(i){T.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(r){this.hTLV=null,this.isModified=!0,this.asn1Array=r},this.appendASN1Object=function(r){this.hTLV=null,this.isModified=!0,this.asn1Array.push(r)},this.asn1Array=new Array,typeof i<"u"&&typeof i.array<"u"&&(this.asn1Array=i.array)};De.lang.extend(T.asn1.DERAbstractStructured,T.asn1.ASN1Object);T.asn1.DERBoolean=function(){T.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"};De.lang.extend(T.asn1.DERBoolean,T.asn1.ASN1Object);T.asn1.DERInteger=function(i){T.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(r){this.hTLV=null,this.isModified=!0,this.hV=T.asn1.ASN1Util.bigIntToMinTwosComplementsHex(r)},this.setByInteger=function(r){var e=new Q(String(r),10);this.setByBigInteger(e)},this.setValueHex=function(r){this.hV=r},this.getFreshValueHex=function(){return this.hV},typeof i<"u"&&(typeof i.bigint<"u"?this.setByBigInteger(i.bigint):typeof i.int<"u"?this.setByInteger(i.int):typeof i=="number"?this.setByInteger(i):typeof i.hex<"u"&&this.setValueHex(i.hex))};De.lang.extend(T.asn1.DERInteger,T.asn1.ASN1Object);T.asn1.DERBitString=function(i){if(i!==void 0&&typeof i.obj<"u"){var r=T.asn1.ASN1Util.newObject(i.obj);i.hex="00"+r.getEncodedHex()}T.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7"u"&&typeof this.s>"u"&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},i!==void 0&&(i.str!==void 0?this.setString(i.str):typeof i=="string"&&i.match(/^[0-9]{12}Z$/)?this.setString(i):i.hex!==void 0?this.setStringHex(i.hex):i.date!==void 0&&this.setByDate(i.date))};De.lang.extend(T.asn1.DERUTCTime,T.asn1.DERAbstractTime);T.asn1.DERGeneralizedTime=function(i){T.asn1.DERGeneralizedTime.superclass.constructor.call(this,i),this.hT="18",this.withMillis=!1,this.setByDate=function(r){this.hTLV=null,this.isModified=!0,this.date=r,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return this.date===void 0&&this.s===void 0&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},i!==void 0&&(i.str!==void 0?this.setString(i.str):typeof i=="string"&&i.match(/^[0-9]{14}Z$/)?this.setString(i):i.hex!==void 0?this.setStringHex(i.hex):i.date!==void 0&&this.setByDate(i.date),i.millis===!0&&(this.withMillis=!0))};De.lang.extend(T.asn1.DERGeneralizedTime,T.asn1.DERAbstractTime);T.asn1.DERSequence=function(i){T.asn1.DERSequence.superclass.constructor.call(this,i),this.hT="30",this.getFreshValueHex=function(){for(var r="",e=0;elocalStorage.getItem("chatApiKey"),Ma=()=>{const i=localStorage.getItem("openaiApiKey"),r=localStorage.getItem("openaiBaseUrl")||"https://api.openai.com/v1",e=localStorage.getItem("rsaPublicKey");return{openaiApiKey:i||"",openaiBaseUrl:r,rsaPublicKey:e}},gn=()=>navigator.language||"zh-CN";var Li;(i=>{async function r(s){try{const u=pn(),l=gn();s.session_id=localStorage.getItem("sessionId")||null,fetch(`${vn}/api/chat/track_event`,{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json","Access-Control-Allow-Origin":"*",Authorization:`Bearer ${u}`,"trace-id":Ur(),"Accept-Language":l},body:JSON.stringify(s)}).catch(h=>{console.warn("Track event failed:",h)})}catch(u){console.warn("Error preparing track event:",u)}return Promise.resolve()}i.trackEvent=r;async function*e(s,u,l=[],h=null,d=null,c){try{const f=pn(),v=gn(),{openaiApiKey:p,openaiBaseUrl:g,rsaPublicKey:y}=Ma(),m=Ur(),b=(l||[]).map(C=>new Promise((j,X)=>{const U=new FileReader;U.onloadend=()=>j(U.result),U.onerror=X,U.readAsDataURL(C)})),$=await Promise.all(b);let S=d?Array.isArray(d)?d:[d]:[];const _={"Content-Type":"application/json",accept:"application/json","Access-Control-Allow-Origin":"*",Authorization:`Bearer ${f}`,"trace-id":c||Ur(),"Accept-Language":v};if(p&&p.trim()!==""&&y)try{const C=await Pn(p,y);_["Encrypted-Openai-Api-Key"]=C,_["Openai-Base-Url"]=g}catch(C){console.error("Error encrypting OpenAI API key:",C)}const B=(await fetch(`${vn}/api/chat/invoke`,{method:"POST",headers:_,body:JSON.stringify({session_id:s,prompt:u,mock:!1,intent:h,ext:S,images:$.map((C,j)=>({filename:l[j].name,data:C}))})})).body.getReader();let I="";for(;;){const{done:C,value:j}=await B.read();if(C)break;I+=new TextDecoder().decode(j);const X=I.split(` -`);I=X.pop()||"";for(const U of X)U.trim()&&(yield{...JSON.parse(U),message_id:m})}I.trim()&&(yield{...JSON.parse(I),message_id:m})}catch(f){throw console.error("Error in streamInvokeServer:",f),alert(f instanceof Error?f.message:"An error occurred while streaming, please refresh the page and try again."),f}}i.streamInvokeServer=e;async function t(s,u){try{const l=pn(),h=gn(),{openaiApiKey:d,openaiBaseUrl:c,rsaPublicKey:f}=Ma(),v={"Content-Type":"application/json",accept:"application/json","Access-Control-Allow-Origin":"*",Authorization:`Bearer ${l}`,"trace-id":Ur(),"Accept-Language":h};if(d&&d.trim()!==""&&f)try{const y=await Pn(d,f);v["Encrypted-Openai-Api-Key"]=y,v["Openai-Base-Url"]=c}catch(y){console.error("Error encrypting OpenAI API key:",y)}const g=await(await fetch(`${vn}/api/chat/get_optimized_workflow`,{method:"POST",headers:v,body:JSON.stringify({workflow_id:s,prompt:u})})).json();if(!g.success){const y=g.message||"Failed to get optimized workflow";throw alert(y),new Error(y)}return g.data}catch(l){throw console.error("Error getting optimized workflow:",l),alert(l instanceof Error?l.message:"Failed to get optimized workflow"),l}}i.getOptimizedWorkflow=t;async function n(s){const u=pn(),l=gn(),{openaiApiKey:h,openaiBaseUrl:d,rsaPublicKey:c}=Ma(),f={"Content-Type":"application/json",Authorization:`Bearer ${u}`,"trace-id":Ur(),"Accept-Language":l};if(h&&h.trim()!==""&&c)try{const g=await Pn(h,c);f["Encrypted-Openai-Api-Key"]=g,f["Openai-Base-Url"]=d}catch(g){console.error("Error encrypting OpenAI API key:",g)}const p=await(await fetch(`${vn}/api/chat/get_node_info_by_types`,{method:"POST",headers:f,body:JSON.stringify({node_types:s})})).json();if(!p.success){const g=p.message||"Failed to get node info by types";throw alert(g),new Error(g)}return p.data}i.batchGetNodeInfo=n;async function a(s){try{const u=localStorage.getItem(`messages_${s}`);if(u)return console.log("Using cached messages from localStorage"),JSON.parse(u);const l=pn(),h=gn(),{openaiApiKey:d,openaiBaseUrl:c,rsaPublicKey:f}=Ma(),v={accept:"application/json",Authorization:`Bearer ${l}`,"trace-id":Ur(),"Accept-Language":h};if(d&&d.trim()!==""&&f)try{const m=await Pn(d,f);v["Encrypted-Openai-Api-Key"]=m,v["Openai-Base-Url"]=c}catch(m){console.error("Error encrypting OpenAI API key:",m)}const g=await(await fetch(`${vn}/api/chat/get_messages_by_session_id?session_id=${s}`,{method:"GET",headers:v})).json();if(!g.success){const m=g.message||"Failed to fetch messages";throw alert(m+", please refresh the page and try again."),new Error(m)}const y=g.data.map(m=>(console.log("msg.ext",m.ext),{id:m.id.toString(),content:m.role==="ai"?JSON.stringify({session_id:s,text:m.content,finished:m.finished||!1,format:m.format||"markdown",ext:m.ext}):m.content,role:m.role,name:m.role==="ai"?"Assistant":void 0,format:m.format||"markdown",finished:m.finished}));return localStorage.setItem(`messages_${s}`,JSON.stringify(y)),y}catch(u){throw console.error("Error fetching messages:",u),alert(u instanceof Error?u.message:"Failed to fetch messages, please refresh the page and try again."),u}}i.fetchMessages=a;async function o(){try{const s=pn(),u=gn(),{openaiApiKey:l,openaiBaseUrl:h,rsaPublicKey:d}=Ma(),c={accept:"application/json",Authorization:`Bearer ${s}`,"trace-id":Ur(),"Accept-Language":u};if(l&&l.trim()!==""&&d)try{const p=await Pn(l,d);c["Encrypted-Openai-Api-Key"]=p,c["Openai-Base-Url"]=h}catch(p){console.error("Error encrypting OpenAI API key:",p)}const v=await(await fetch(`${vn}/api/chat/announcement`,{method:"GET",headers:c})).json();if(!v.success){const p=v.message||"Failed to fetch announcement";return console.error(p),""}return v.data}catch(s){return console.error("Error fetching announcement:",s),""}}i.fetchAnnouncement=o})(Li||(Li={}));function q$({name:i,isUser:r=!1,children:e}){return O.jsx("div",{className:"flex flex-col w-full items-start gap-2 py-2 animate-fadeIn",children:O.jsx("div",{className:"w-full",children:e})})}function RI({title:i,titleId:r,...e},t){return We.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":r},e),i?We.createElement("title",{id:r},i):null,We.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))}const NI=We.forwardRef(RI);function jpe({content:i,trace_id:r}){const[e,t]=We.useState(!1),[n,a]=We.useState(!1),o=async()=>{r&&(await navigator.clipboard.writeText(r),a(!0),setTimeout(()=>a(!1),2e3))};return O.jsx(q$,{name:"User",isUser:!0,children:O.jsxs("div",{className:"w-full rounded-lg border border-gray-700 py-4 px-4 text-gray-700 text-sm break-words relative",children:[O.jsx("p",{className:"whitespace-pre-wrap leading-snug",children:i}),r&&O.jsxs("div",{className:"absolute bottom-1 right-1.5 cursor-pointer opacity-40 hover:opacity-100 transition-opacity",onMouseEnter:()=>t(!0),onMouseLeave:()=>t(!1),onClick:o,children:[O.jsx(NI,{className:"h-3.5 w-3.5 text-gray-500 hover:text-gray-700"}),e&&O.jsx("div",{className:"absolute right-0 -top-6 bg-gray-700 text-white text-[10px] py-0.5 px-1.5 rounded shadow-sm whitespace-nowrap",children:n?"Copied!":"Copy trace ID"})]})]})})}const MI=We.memo(eI,(i,r)=>i.children===r.children&&i.className===r.className),BI=({content:i})=>O.jsxs("div",{className:"rounded-lg border border-blue-200 bg-blue-50 p-1 shadow-sm",children:[O.jsxs("div",{className:"flex items-center mb-1",children:[O.jsx("div",{className:"bg-blue-100 rounded-full p-1 mr-1",children:O.jsx("svg",{className:"h-4 w-4 text-blue-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:O.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),O.jsx("h3",{className:"text-sm font-medium text-blue-800",children:"Node Usage Guide"})]}),O.jsx("div",{className:"markdown-content text-blue-900",children:i})]}),FI=({content:i})=>O.jsxs("div",{className:"rounded-lg border border-green-200 bg-green-50 p-1 shadow-sm",children:[O.jsxs("div",{className:"flex items-center mb-1",children:[O.jsx("div",{className:"bg-green-100 rounded-full p-1 mr-1",children:O.jsxs("svg",{className:"h-4 w-4 text-green-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[O.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),O.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),O.jsx("h3",{className:"text-sm font-medium text-green-800",children:"Node Parameter Reference"})]}),O.jsx("div",{className:"markdown-content text-green-900",children:i})]});function Lpe({content:i,name:r="Assistant",avatar:e,format:t,onOptionClick:n,extComponent:a,metadata:o}){const s=We.useRef(),u=(h,d)=>O.jsx(MI,{rehypePlugins:[[tI,{target:"_blank"}],rI],remarkPlugins:[iI,nI],className:`prose prose-xs prose-neutral prose-a:text-accent-foreground/50 break-words [&>*]:!my-1 leading-relaxed text-xs +`,e+="-----END PUBLIC KEY-----",e},r.hasPublicKeyProperty=function(e){return e=e||{},e.hasOwnProperty("n")&&e.hasOwnProperty("e")},r.hasPrivateKeyProperty=function(e){return e=e||{},e.hasOwnProperty("n")&&e.hasOwnProperty("e")&&e.hasOwnProperty("d")&&e.hasOwnProperty("p")&&e.hasOwnProperty("q")&&e.hasOwnProperty("dmp1")&&e.hasOwnProperty("dmq1")&&e.hasOwnProperty("coeff")},r.prototype.parsePropertiesFrom=function(e){this.n=e.n,this.e=e.e,e.hasOwnProperty("d")&&(this.d=e.d,this.p=e.p,this.q=e.q,this.dmp1=e.dmp1,this.dmq1=e.dmq1,this.coeff=e.coeff)},r}(OI),xI={},ah,CI=typeof process<"u"?(ah=xI)===null||ah===void 0?void 0:ah.npm_package_version:void 0,AI=function(){function i(r){r===void 0&&(r={}),r=r||{},this.default_key_size=r.default_key_size?parseInt(r.default_key_size,10):1024,this.default_public_exponent=r.default_public_exponent||"010001",this.log=r.log||!1,this.key=null}return i.prototype.setKey=function(r){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new Ip(r)},i.prototype.setPrivateKey=function(r){this.setKey(r)},i.prototype.setPublicKey=function(r){this.setKey(r)},i.prototype.decrypt=function(r){try{return this.getKey().decrypt($p(r))}catch{return!1}},i.prototype.encrypt=function(r){try{return Tu(this.getKey().encrypt(r))}catch{return!1}},i.prototype.sign=function(r,e,t){try{return Tu(this.getKey().sign(r,e,t))}catch{return!1}},i.prototype.verify=function(r,e,t){try{return this.getKey().verify(r,$p(e),t)}catch{return!1}},i.prototype.getKey=function(r){if(!this.key){if(this.key=new Ip,r&&{}.toString.call(r)==="[object Function]"){this.key.generateAsync(this.default_key_size,this.default_public_exponent,r);return}this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},i.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},i.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},i.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},i.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},i.version=CI,i}();async function Bpe(){try{const r=await(await fetch(`${Bf.apiBaseUrl}/api/chat/rsa_public_key`)).json();if(!r.success)throw new Error(r.message||"Failed to fetch RSA public key");return r.data}catch(i){throw console.error("Error fetching RSA public key:",i),i}}async function Pn(i,r){try{if(window.crypto&&window.crypto.subtle){const e="-----BEGIN PUBLIC KEY-----",n=r.substring(r.indexOf(e)+e.length,r.indexOf("-----END PUBLIC KEY-----")).replace(/\s/g,""),a=window.atob(n),o=new ArrayBuffer(a.length),s=new Uint8Array(o);for(let c=0;clocalStorage.getItem("chatApiKey"),Ma=()=>{const i=localStorage.getItem("openaiApiKey"),r=localStorage.getItem("openaiBaseUrl")||"https://api.openai.com/v1",e=localStorage.getItem("rsaPublicKey");return{openaiApiKey:i||"",openaiBaseUrl:r,rsaPublicKey:e}},Ti=()=>navigator.language||"zh-CN";var Vi;(i=>{async function r(u){try{const l=Oi(),h=Ti();u.session_id=localStorage.getItem("sessionId")||null,fetch(`${Si}/api/chat/track_event`,{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json","Access-Control-Allow-Origin":"*",Authorization:`Bearer ${l}`,"trace-id":Sr(),"Accept-Language":h},body:JSON.stringify(u)}).catch(d=>{console.warn("Track event failed:",d)})}catch(l){console.warn("Error preparing track event:",l)}return Promise.resolve()}i.trackEvent=r;async function*e(u,l,h=[],d=null,c=null,f){try{const v=Oi(),p=Ti(),{openaiApiKey:g,openaiBaseUrl:y,rsaPublicKey:m}=Ma(),b=Sr(),$=(h||[]).map(F=>new Promise((X,K)=>{const oe=new FileReader;oe.onloadend=()=>X(oe.result),oe.onerror=K,oe.readAsDataURL(F)})),S=await Promise.all($);let _=c?Array.isArray(c)?c:[c]:[];const C={"Content-Type":"application/json",accept:"application/json","Access-Control-Allow-Origin":"*",Authorization:`Bearer ${v}`,"trace-id":f||Sr(),"Accept-Language":p};if(g&&g.trim()!==""&&m)try{const F=await Pn(g,m);C["Encrypted-Openai-Api-Key"]=F,C["Openai-Base-Url"]=y}catch(F){console.error("Error encrypting OpenAI API key:",F)}const x=(await fetch(`${Si}/api/chat/invoke`,{method:"POST",headers:C,body:JSON.stringify({session_id:u,prompt:l,mock:!1,intent:d,ext:_,images:S.map((F,X)=>({filename:h[X].name,data:F}))})})).body.getReader();let B="";for(;;){const{done:F,value:X}=await x.read();if(F)break;B+=new TextDecoder().decode(X);const K=B.split(` +`);B=K.pop()||"";for(const oe of K)oe.trim()&&(yield{...JSON.parse(oe),message_id:b})}B.trim()&&(yield{...JSON.parse(B),message_id:b})}catch(v){throw console.error("Error in streamInvokeServer:",v),alert(v instanceof Error?v.message:"An error occurred while streaming, please refresh the page and try again."),v}}i.streamInvokeServer=e;async function t(u,l){try{const h=Oi(),d=Ti(),{openaiApiKey:c,openaiBaseUrl:f,rsaPublicKey:v}=Ma(),p={"Content-Type":"application/json",accept:"application/json","Access-Control-Allow-Origin":"*",Authorization:`Bearer ${h}`,"trace-id":Sr(),"Accept-Language":d};if(c&&c.trim()!==""&&v)try{const m=await Pn(c,v);p["Encrypted-Openai-Api-Key"]=m,p["Openai-Base-Url"]=f}catch(m){console.error("Error encrypting OpenAI API key:",m)}const y=await(await fetch(`${Si}/api/chat/get_optimized_workflow`,{method:"POST",headers:p,body:JSON.stringify({workflow_id:u,prompt:l})})).json();if(!y.success){const m=y.message||"Failed to get optimized workflow";throw alert(m),new Error(m)}return y.data}catch(h){throw console.error("Error getting optimized workflow:",h),alert(h instanceof Error?h.message:"Failed to get optimized workflow"),h}}i.getOptimizedWorkflow=t;async function n(u){const l=Oi(),h=Ti(),{openaiApiKey:d,openaiBaseUrl:c,rsaPublicKey:f}=Ma(),v={"Content-Type":"application/json",Authorization:`Bearer ${l}`,"trace-id":Sr(),"Accept-Language":h};if(d&&d.trim()!==""&&f)try{const y=await Pn(d,f);v["Encrypted-Openai-Api-Key"]=y,v["Openai-Base-Url"]=c}catch(y){console.error("Error encrypting OpenAI API key:",y)}const g=await(await fetch(`${Si}/api/chat/get_node_info_by_types`,{method:"POST",headers:v,body:JSON.stringify({node_types:u})})).json();if(!g.success){const y=g.message||"Failed to get node info by types";throw alert(y),new Error(y)}return g.data}i.batchGetNodeInfo=n;async function a(u){try{const l=localStorage.getItem(`messages_${u}`);if(l)return console.log("Using cached messages from localStorage"),JSON.parse(l);const h=Oi(),d=Ti(),{openaiApiKey:c,openaiBaseUrl:f,rsaPublicKey:v}=Ma(),p={accept:"application/json",Authorization:`Bearer ${h}`,"trace-id":Sr(),"Accept-Language":d};if(c&&c.trim()!==""&&v)try{const b=await Pn(c,v);p["Encrypted-Openai-Api-Key"]=b,p["Openai-Base-Url"]=f}catch(b){console.error("Error encrypting OpenAI API key:",b)}const y=await(await fetch(`${Si}/api/chat/get_messages_by_session_id?session_id=${u}`,{method:"GET",headers:p})).json();if(!y.success){const b=y.message||"Failed to fetch messages";throw alert(b+", please refresh the page and try again."),new Error(b)}const m=y.data.map(b=>(console.log("msg.ext",b.ext),{id:b.id.toString(),content:b.role==="ai"?JSON.stringify({session_id:u,text:b.content,finished:b.finished||!1,format:b.format||"markdown",ext:b.ext}):b.content,role:b.role,name:b.role==="ai"?"Assistant":void 0,format:b.format||"markdown",finished:b.finished}));return localStorage.setItem(`messages_${u}`,JSON.stringify(m)),m}catch(l){throw console.error("Error fetching messages:",l),alert(l instanceof Error?l.message:"Failed to fetch messages, please refresh the page and try again."),l}}i.fetchMessages=a;async function o(){try{const u=Oi(),l=Ti(),{openaiApiKey:h,openaiBaseUrl:d,rsaPublicKey:c}=Ma(),f={accept:"application/json",Authorization:`Bearer ${u}`,"trace-id":Sr(),"Accept-Language":l};if(h&&h.trim()!==""&&c)try{const g=await Pn(h,c);f["Encrypted-Openai-Api-Key"]=g,f["Openai-Base-Url"]=d}catch(g){console.error("Error encrypting OpenAI API key:",g)}const p=await(await fetch(`${Si}/api/chat/announcement`,{method:"GET",headers:f})).json();if(!p.success){const g=p.message||"Failed to fetch announcement";return console.error(g),""}return p.data}catch(u){return console.error("Error fetching announcement:",u),""}}i.fetchAnnouncement=o;async function s(u){let h=0,d;for(;h<3;)try{const c=Oi(),f=Ti(),v={"Content-Type":"application/json",accept:"application/json",Authorization:`Bearer ${c}`,"trace-id":Sr(),"Accept-Language":f},g=await(await fetch(`${Si}/api/param_debug/generate_sd_prompts`,{method:"POST",headers:v,body:JSON.stringify({text:u})})).json();if(!g.success){const y=g.message||"Failed to generate SD prompts";throw new Error(y)}return g.data}catch(c){if(d=c,h++,h>=3)throw console.error("Error generating SD prompts after 3 attempts:",c),c;console.warn(`Attempt ${h} failed, retrying... Error: ${c instanceof Error?c.message:"Unknown error"}`),await new Promise(f=>setTimeout(f,500*Math.pow(2,h-1)))}throw d}i.generateSDPrompts=s})(Vi||(Vi={}));function q$({name:i,isUser:r=!1,children:e}){return O.jsx("div",{className:"flex flex-col w-full items-start gap-2 py-2 animate-fadeIn",children:O.jsx("div",{className:"w-full",children:e})})}function RI({title:i,titleId:r,...e},t){return Ve.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":r},e),i?Ve.createElement("title",{id:r},i):null,Ve.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))}const NI=Ve.forwardRef(RI);function jpe({content:i,trace_id:r}){const[e,t]=Ve.useState(!1),[n,a]=Ve.useState(!1),o=async()=>{r&&(await navigator.clipboard.writeText(r),a(!0),setTimeout(()=>a(!1),2e3))};return O.jsx(q$,{name:"User",isUser:!0,children:O.jsxs("div",{className:"w-full rounded-lg border border-gray-700 py-4 px-4 text-gray-700 text-sm break-words relative",children:[O.jsx("p",{className:"whitespace-pre-wrap leading-snug",children:i}),r&&O.jsxs("div",{className:"absolute bottom-1 right-1.5 cursor-pointer opacity-40 hover:opacity-100 transition-opacity",onMouseEnter:()=>t(!0),onMouseLeave:()=>t(!1),onClick:o,children:[O.jsx(NI,{className:"h-3.5 w-3.5 text-gray-500 hover:text-gray-700"}),e&&O.jsx("div",{className:"absolute right-0 -top-6 bg-gray-700 text-white text-[10px] py-0.5 px-1.5 rounded shadow-sm whitespace-nowrap",children:n?"Copied!":"Copy trace ID"})]})]})})}const MI=Ve.memo(eI,(i,r)=>i.children===r.children&&i.className===r.className),BI=({content:i})=>O.jsxs("div",{className:"rounded-lg border border-blue-200 bg-blue-50 p-1 shadow-sm",children:[O.jsxs("div",{className:"flex items-center mb-1",children:[O.jsx("div",{className:"bg-blue-100 rounded-full p-1 mr-1",children:O.jsx("svg",{className:"h-4 w-4 text-blue-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:O.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),O.jsx("h3",{className:"text-sm font-medium text-blue-800",children:"Node Usage Guide"})]}),O.jsx("div",{className:"markdown-content text-blue-900",children:i})]}),FI=({content:i})=>O.jsxs("div",{className:"rounded-lg border border-green-200 bg-green-50 p-1 shadow-sm",children:[O.jsxs("div",{className:"flex items-center mb-1",children:[O.jsx("div",{className:"bg-green-100 rounded-full p-1 mr-1",children:O.jsxs("svg",{className:"h-4 w-4 text-green-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[O.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),O.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),O.jsx("h3",{className:"text-sm font-medium text-green-800",children:"Node Parameter Reference"})]}),O.jsx("div",{className:"markdown-content text-green-900",children:i})]});function Lpe({content:i,name:r="Assistant",avatar:e,format:t,onOptionClick:n,extComponent:a,metadata:o}){const s=Ve.useRef(),u=(h,d)=>O.jsx(MI,{rehypePlugins:[[tI,{target:"_blank"}],rI],remarkPlugins:[iI,nI],className:`prose prose-xs prose-neutral prose-a:text-accent-foreground/50 break-words [&>*]:!my-1 leading-relaxed text-xs prose-headings:font-semibold prose-h1:text-base prose-h2:text-sm @@ -36,14 +36,14 @@ version: 2.9.0 prose-li:text-xs prose-code:text-xs prose-pre:text-xs - `,components:{p:({children:c})=>O.jsx("p",{className:"!my-0.5 leading-relaxed text-xs",children:c}),h1:({children:c})=>O.jsx("h1",{className:"text-base font-semibold !my-1",children:c}),h2:({children:c})=>O.jsx("h2",{className:"text-sm font-semibold !my-1",children:c}),h3:({children:c})=>O.jsx("h3",{className:"text-xs font-semibold !my-1",children:c}),h4:({children:c})=>O.jsx("h4",{className:"text-xs font-semibold !my-1",children:c}),table:({children:c})=>O.jsx("table",{className:"border-solid border border-[#979797] w-[100%] text-xs",children:c}),th:({children:c})=>O.jsx("th",{className:"border-solid bg-[#E5E7ED] dark:bg-[#FFFFFF] dark:text-[#000000] border border-[#979797] text-center pt-2 text-xs",children:c}),td:({children:c})=>{if(Array.isArray(c)&&c?.length>0){const f=[],v=c.length;for(let p=0;p"?f.push(O.jsx("br",{})):f.push(c[p]);c=f}return O.jsx("td",{className:"border-solid border border-[#979797] text-center text-xs",children:c})},code:({children:c})=>{const[f,v]=We.useState(!1),p=async()=>{try{await navigator.clipboard.writeText(c),v(!0),setTimeout(()=>v(!1),2e3)}catch(g){console.error("Failed to copy text:",g)}};return O.jsxs("span",{className:"relative group inline-flex items-center",children:[O.jsx("code",{className:"text-xs bg-gray-100 text-gray-800 rounded px-1",children:c}),O.jsx("button",{onClick:p,className:"absolute top-0 right-0 bg-gray-200 rounded p-1 opacity-0 group-hover:opacity-100 transition-opacity hover:bg-gray-300 z-10","aria-label":"Copy code",children:f?O.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:O.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):O.jsxs("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:[O.jsx("path",{d:"M8 2a1 1 0 000 2h2a1 1 0 100-2H8z"}),O.jsx("path",{d:"M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5z"})]})})]})},pre:({children:c})=>O.jsx("pre",{className:"text-xs bg-gray-100 text-gray-800 rounded p-2 overflow-x-auto",children:c}),img:({node:c,...f})=>O.jsx("div",{className:"w-1/2 mx-auto",children:O.jsx("img",{...f,loading:"lazy",className:"w-full h-auto block",onError:v=>{console.warn("Image failed to load:",f.src,"Error:",v),v.currentTarget.style.opacity="0"}})}),a:({href:c,children:f})=>{let v="markdown",p=null;try{const g=JSON.parse(i);v=g.ext?.[0]?.type||"markdown",p=g?.message_id}catch(g){console.error("Error parsing content:",g)}return O.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",onClick:()=>{Li.trackEvent({event_type:"markdown_link_click",message_type:v,message_id:p,data:{link_url:c,link_text:f}})},children:f})}},children:h}),l=()=>{try{const h=JSON.parse(i),d=h.ext?.find(c=>c.type==="guides")?.data||[];if(o?.intent){const c=o.intent;if(c==="node_explain")return O.jsx(BI,{content:u(h.text||"")});if(c==="node_params")return O.jsx(FI,{content:u(h.text||"")})}return O.jsxs("div",{className:"space-y-3",children:[t==="markdown"&&h.text?O.jsx("div",{ref:s,children:u(h.text)}):h.text?O.jsx("p",{className:"whitespace-pre-wrap text-left",children:h.text}):null,d.length>0&&O.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:d.map((c,f)=>O.jsx("button",{className:"px-3 py-1.5 bg-white text-gray-700 rounded-md hover:bg-gray-50 transition-colors text-[12px] w-[calc(50%-0.25rem)]",onClick:()=>n?.(c),children:c},f))}),a]})}catch{return O.jsx("p",{className:"whitespace-pre-wrap text-left",children:i})}};return O.jsx(q$,{name:r,children:O.jsx("div",{className:"w-full rounded-lg bg-gray-50 p-4 text-gray-700 text-sm break-words overflow-hidden",children:l()})})}const jI=LiteGraph;function Y$(i,r={}){const e=jI.createNode(i,"",r);if(!r.pos){const t=Mt.canvas.canvas.getBoundingClientRect(),n=t.width/2/Mt.canvas.ds.scale+-Mt.canvas.ds.offset[0]/Mt.canvas.ds.scale,a=t.height/2/Mt.canvas.ds.scale+-Mt.canvas.ds.offset[1]/Mt.canvas.ds.scale;e.pos=[n-e.size[0]/2,a-e.size[1]/2]}return Mt.graph.add(e),e}function LI({content:i,name:r="Assistant",avatar:e,installedNodes:t}){const n=JSON.parse(i),[a,o]=We.useState(null),s=n.ext?.find(c=>c.type==="node")?.data||[],u=c=>t.some(f=>f===c),l=s.filter(c=>u(c.name)),h=s.filter(c=>!u(c.name)),d=c=>c>=1e4?`${(c/1e4).toFixed(1)}w`:c>=1e3?`${(c/1e3).toFixed(1)}k`:c.toString();return O.jsxs("div",{className:"rounded-lg bg-green-50 p-3 text-gray-700 text-xs break-words overflow-visible",children:[l.length>0&&O.jsxs("div",{className:"space-y-3",children:[O.jsx("p",{className:"text-xs font-medium",children:"Installed nodes:"}),O.jsx("div",{className:"grid grid-cols-2 gap-3",children:l.map(c=>O.jsxs("div",{className:`w-full p-3 bg-white rounded-lg border border-gray-200 + `,components:{p:({children:c})=>O.jsx("p",{className:"!my-0.5 leading-relaxed text-xs",children:c}),h1:({children:c})=>O.jsx("h1",{className:"text-base font-semibold !my-1",children:c}),h2:({children:c})=>O.jsx("h2",{className:"text-sm font-semibold !my-1",children:c}),h3:({children:c})=>O.jsx("h3",{className:"text-xs font-semibold !my-1",children:c}),h4:({children:c})=>O.jsx("h4",{className:"text-xs font-semibold !my-1",children:c}),table:({children:c})=>O.jsx("table",{className:"border-solid border border-[#979797] w-[100%] text-xs",children:c}),th:({children:c})=>O.jsx("th",{className:"border-solid bg-[#E5E7ED] dark:bg-[#FFFFFF] dark:text-[#000000] border border-[#979797] text-center pt-2 text-xs",children:c}),td:({children:c})=>{if(Array.isArray(c)&&c?.length>0){const f=[],v=c.length;for(let p=0;p"?f.push(O.jsx("br",{})):f.push(c[p]);c=f}return O.jsx("td",{className:"border-solid border border-[#979797] text-center text-xs",children:c})},code:({children:c})=>{const[f,v]=Ve.useState(!1),p=async()=>{try{await navigator.clipboard.writeText(c),v(!0),setTimeout(()=>v(!1),2e3)}catch(g){console.error("Failed to copy text:",g)}};return O.jsxs("span",{className:"relative group inline-flex items-center",children:[O.jsx("code",{className:"text-xs bg-gray-100 text-gray-800 rounded px-1",children:c}),O.jsx("button",{onClick:p,className:"absolute top-0 right-0 bg-gray-200 rounded p-1 opacity-0 group-hover:opacity-100 transition-opacity hover:bg-gray-300 z-10","aria-label":"Copy code",children:f?O.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:O.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):O.jsxs("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:[O.jsx("path",{d:"M8 2a1 1 0 000 2h2a1 1 0 100-2H8z"}),O.jsx("path",{d:"M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5z"})]})})]})},pre:({children:c})=>O.jsx("pre",{className:"text-xs bg-gray-100 text-gray-800 rounded p-2 overflow-x-auto",children:c}),img:({node:c,...f})=>O.jsx("div",{className:"w-1/2 mx-auto",children:O.jsx("img",{...f,loading:"lazy",className:"w-full h-auto block",onError:v=>{console.warn("Image failed to load:",f.src,"Error:",v),v.currentTarget.style.opacity="0"}})}),a:({href:c,children:f})=>{let v="markdown",p=null;try{const g=JSON.parse(i);v=g.ext?.[0]?.type||"markdown",p=g?.message_id}catch(g){console.error("Error parsing content:",g)}return O.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",onClick:()=>{Vi.trackEvent({event_type:"markdown_link_click",message_type:v,message_id:p,data:{link_url:c,link_text:f}})},children:f})}},children:h}),l=()=>{try{const h=JSON.parse(i),d=h.ext?.find(c=>c.type==="guides")?.data||[];if(o?.intent){const c=o.intent;if(c==="node_explain")return O.jsx(BI,{content:u(h.text||"")});if(c==="node_params")return O.jsx(FI,{content:u(h.text||"")})}return O.jsxs("div",{className:"space-y-3",children:[t==="markdown"&&h.text?O.jsx("div",{ref:s,children:u(h.text)}):h.text?O.jsx("p",{className:"whitespace-pre-wrap text-left",children:h.text}):null,d.length>0&&O.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:d.map((c,f)=>O.jsx("button",{className:"px-3 py-1.5 bg-white text-gray-700 rounded-md hover:bg-gray-50 transition-colors text-[12px] w-[calc(50%-0.25rem)]",onClick:()=>n?.(c),children:c},f))}),a]})}catch{return O.jsx("p",{className:"whitespace-pre-wrap text-left",children:i})}};return O.jsx(q$,{name:r,children:O.jsx("div",{className:"w-full rounded-lg bg-gray-50 p-4 text-gray-700 text-sm break-words overflow-hidden",children:l()})})}const jI=LiteGraph;function Y$(i,r={}){const e=jI.createNode(i,"",r);if(!r.pos){const t=Mt.canvas.canvas.getBoundingClientRect(),n=t.width/2/Mt.canvas.ds.scale+-Mt.canvas.ds.offset[0]/Mt.canvas.ds.scale,a=t.height/2/Mt.canvas.ds.scale+-Mt.canvas.ds.offset[1]/Mt.canvas.ds.scale;e.pos=[n-e.size[0]/2,a-e.size[1]/2]}return Mt.graph.add(e),e}function LI({content:i,name:r="Assistant",avatar:e,installedNodes:t}){const n=JSON.parse(i),[a,o]=Ve.useState(null),s=n.ext?.find(c=>c.type==="node")?.data||[],u=c=>t.some(f=>f===c),l=s.filter(c=>u(c.name)),h=s.filter(c=>!u(c.name)),d=c=>c>=1e4?`${(c/1e4).toFixed(1)}w`:c>=1e3?`${(c/1e3).toFixed(1)}k`:c.toString();return O.jsxs("div",{className:"rounded-lg bg-green-50 p-3 text-gray-700 text-xs break-words overflow-visible",children:[l.length>0&&O.jsxs("div",{className:"space-y-3",children:[O.jsx("p",{className:"text-xs font-medium",children:"Installed nodes:"}),O.jsx("div",{className:"grid grid-cols-2 gap-3",children:l.map(c=>O.jsxs("div",{className:`w-full p-3 bg-white rounded-lg border border-gray-200 hover:shadow-sm transition-all duration-200 relative group`,onMouseEnter:()=>o(c.name),onMouseLeave:()=>o(null),children:[O.jsx("h3",{className:"text-[12px] font-medium text-gray-800 mb-4",children:c.name}),O.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[O.jsxs("div",{className:"flex items-center gap-1 text-gray-600",children:[O.jsx("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:O.jsx("path",{d:"M12 .25a.75.75 0 0 1 .673.418l3.058 6.197 6.839.994a.75.75 0 0 1 .415 1.279l-4.948 4.823 1.168 6.811a.75.75 0 0 1-1.088.791L12 18.347l-6.117 3.216a.75.75 0 0 1-1.088-.79l1.168-6.812-4.948-4.823a.75.75 0 0 1 .416-1.28l6.838-.993L11.327.668A.75.75 0 0 1 12 .25z"})}),O.jsx("span",{children:d(c.github_stars||0)})]}),O.jsxs("button",{className:`px-2 py-1 bg-blue-500 text-white rounded-md - hover:bg-blue-600 transition-colors text-[10px] flex items-center gap-1`,onClick:()=>{const f=Y$(c.name);f&&(f.connect(c.from_index,f,c.to_index),Li.trackEvent({event_type:"node_add_to_canvas",message_type:"node",message_id:n.message_id,data:{node_name:c.name}}))},children:[O.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:O.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Add to Canvas"]})]}),a===c.name&&c.description&&O.jsxs("div",{className:`fixed -translate-y-full z-[9999] w-64 p-2 + hover:bg-blue-600 transition-colors text-[10px] flex items-center gap-1`,onClick:()=>{const f=Y$(c.name);f&&(f.connect(c.from_index,f,c.to_index),Vi.trackEvent({event_type:"node_add_to_canvas",message_type:"node",message_id:n.message_id,data:{node_name:c.name}}))},children:[O.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:O.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Add to Canvas"]})]}),a===c.name&&c.description&&O.jsxs("div",{className:`fixed -translate-y-full z-[9999] w-64 p-2 bg-gray-800 text-white text-xs rounded-md shadow-lg mb-2`,style:{left:"calc(var(--mouse-x, 0) + 16px)",top:"calc(var(--mouse-y, 0) - 8px)"},children:[c.description,O.jsx("div",{className:`absolute -bottom-1 left-1/2 -translate-x-1/2 border-4 border-transparent border-t-gray-800`})]})]},c.name))})]}),h.length>0&&O.jsxs("div",{className:`space-y-3 ${l.length>0?"mt-4":""}`,children:[O.jsx("p",{className:"text-xs font-medium",children:"Uninstalled nodes:"}),O.jsx("div",{className:"grid grid-cols-2 gap-3",children:h.map(c=>O.jsxs("div",{className:`w-full p-3 bg-white rounded-lg border border-gray-200 hover:shadow-sm transition-all duration-200 relative group`,onMouseEnter:()=>o(c.name),onMouseLeave:()=>o(null),children:[O.jsx("h3",{className:"text-[12px] font-medium text-gray-800 mb-4",children:c.name}),O.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[O.jsxs("div",{className:"flex items-center gap-1 text-gray-600",children:[O.jsx("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:O.jsx("path",{d:"M12 .25a.75.75 0 0 1 .673.418l3.058 6.197 6.839.994a.75.75 0 0 1 .415 1.279l-4.948 4.823 1.168 6.811a.75.75 0 0 1-1.088.791L12 18.347l-6.117 3.216a.75.75 0 0 1-1.088-.79l1.168-6.812-4.948-4.823a.75.75 0 0 1 .416-1.28l6.838-.993L11.327.668A.75.75 0 0 1 12 .25z"})}),O.jsx("span",{children:d(c.github_stars||0)})]}),O.jsxs("a",{href:c.github_url,target:"_blank",rel:"noopener noreferrer",className:`px-2 py-1 bg-white text-gray-900 rounded-md border border-gray-900 hover:bg-gray-100 - transition-colors text-[10px] flex items-center gap-1`,onClick:()=>{Li.trackEvent({event_type:"node_download",message_type:"node",message_id:n.message_id,data:{node_name:c.name,github_url:c.github_url}})},children:[O.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:O.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Download"]})]}),a===c.name&&c.description&&O.jsxs("div",{className:`fixed -translate-y-full z-[9999] w-64 p-2 + transition-colors text-[10px] flex items-center gap-1`,onClick:()=>{Vi.trackEvent({event_type:"node_download",message_type:"node",message_id:n.message_id,data:{node_name:c.name,github_url:c.github_url}})},children:[O.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:O.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Download"]})]}),a===c.name&&c.description&&O.jsxs("div",{className:`fixed -translate-y-full z-[9999] w-64 p-2 bg-gray-800 text-white text-xs rounded-md shadow-lg mb-2`,style:{left:"calc(var(--mouse-x, 0) + 16px)",top:"calc(var(--mouse-y, 0) - 8px)"},children:[c.description,O.jsx("div",{className:`absolute -bottom-1 left-1/2 -translate-x-1/2 border-4 border-transparent border-t-gray-800`})]})]},c.name))})]})]})}const zpe=Object.freeze(Object.defineProperty({__proto__:null,NodeSearch:LI},Symbol.toStringTag,{value:"Module"}));/** * vis-data @@ -69,19 +69,19 @@ version: 2.9.0 * http://opensource.org/licenses/MIT * * vis.js may be distributed under either license. - */function el(i,r){if(!(i instanceof r))throw new TypeError("Cannot call a class as a function")}var oh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Y(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var X$={exports:{}},_s=function(i){return i&&i.Math===Math&&i},me=_s(typeof globalThis=="object"&&globalThis)||_s(typeof window=="object"&&window)||_s(typeof self=="object"&&self)||_s(typeof oh=="object"&&oh)||function(){return this}()||oh||Function("return this")(),ue=function(i){try{return!!i()}catch{return!0}},zI=ue,So=!zI(function(){var i=function(){}.bind();return typeof i!="function"||i.hasOwnProperty("prototype")}),HI=So,J$=Function.prototype,kp=J$.apply,Pp=J$.call,la=typeof Reflect=="object"&&Reflect.apply||(HI?Pp.bind(kp):function(){return Pp.apply(kp,arguments)}),Z$=So,Q$=Function.prototype,_d=Q$.call,WI=Z$&&Q$.bind.bind(_d,_d),ye=Z$?WI:function(i){return function(){return _d.apply(i,arguments)}},e0=ye,VI=e0({}.toString),UI=e0("".slice),fi=function(i){return UI(VI(i),8,-1)},KI=fi,GI=ye,t0=function(i){if(KI(i)==="Function")return GI(i)},Ed=typeof document=="object"&&document.all,qI=typeof Ed>"u"&&Ed!==void 0,r0={all:Ed,IS_HTMLDDA:qI},i0=r0,YI=i0.all,Oe=i0.IS_HTMLDDA?function(i){return typeof i=="function"||i===YI}:function(i){return typeof i=="function"},Xi={},XI=ue,Ke=!XI(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),JI=So,Es=Function.prototype.call,Ge=JI?Es.bind(Es):function(){return Es.apply(Es,arguments)},tl={},n0={}.propertyIsEnumerable,a0=Object.getOwnPropertyDescriptor,ZI=a0&&!n0.call({1:2},1);tl.f=ZI?function(r){var e=a0(this,r);return!!e&&e.enumerable}:n0;var Ji=function(i,r){return{enumerable:!(i&1),configurable:!(i&2),writable:!(i&4),value:r}},QI=ye,ek=ue,tk=fi,sh=Object,rk=QI("".split),rl=ek(function(){return!sh("z").propertyIsEnumerable(0)})?function(i){return tk(i)==="String"?rk(i,""):sh(i)}:sh,ha=function(i){return i==null},ik=ha,nk=TypeError,jf=function(i){if(ik(i))throw new nk("Can't call method on "+i);return i},ak=rl,ok=jf,br=function(i){return ak(ok(i))},xp=Oe,o0=r0,sk=o0.all,it=o0.IS_HTMLDDA?function(i){return typeof i=="object"?i!==null:xp(i)||i===sk}:function(i){return typeof i=="object"?i!==null:xp(i)},be={},uh=be,lh=me,uk=Oe,Cp=function(i){return uk(i)?i:void 0},yt=function(i,r){return arguments.length<2?Cp(uh[i])||Cp(lh[i]):uh[i]&&uh[i][r]||lh[i]&&lh[i][r]},lk=ye,Le=lk({}.isPrototypeOf),vi=typeof navigator<"u"&&String(navigator.userAgent)||"",s0=me,hh=vi,Ap=s0.process,Dp=s0.Deno,Rp=Ap&&Ap.versions||Dp&&Dp.version,Np=Rp&&Rp.v8,tr,Iu;Np&&(tr=Np.split("."),Iu=tr[0]>0&&tr[0]<4?1:+(tr[0]+tr[1]));!Iu&&hh&&(tr=hh.match(/Edge\/(\d+)/),(!tr||tr[1]>=74)&&(tr=hh.match(/Chrome\/(\d+)/),tr&&(Iu=+tr[1])));var ca=Iu,Mp=ca,hk=ue,ck=me,dk=ck.String,da=!!Object.getOwnPropertySymbols&&!hk(function(){var i=Symbol("symbol detection");return!dk(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&Mp&&Mp<41}),fk=da,u0=fk&&!Symbol.sham&&typeof Symbol.iterator=="symbol",vk=yt,pk=Oe,gk=Le,yk=u0,mk=Object,Oo=yk?function(i){return typeof i=="symbol"}:function(i){var r=vk("Symbol");return pk(r)&&gk(r.prototype,mk(i))},bk=String,fa=function(i){try{return bk(i)}catch{return"Object"}},$k=Oe,wk=fa,_k=TypeError,kt=function(i){if($k(i))return i;throw new _k(wk(i)+" is not a function")},Ek=kt,Sk=ha,Lf=function(i,r){var e=i[r];return Sk(e)?void 0:Ek(e)},ch=Ge,dh=Oe,fh=it,Ok=TypeError,Tk=function(i,r){var e,t;if(r==="string"&&dh(e=i.toString)&&!fh(t=ch(e,i))||dh(e=i.valueOf)&&!fh(t=ch(e,i))||r!=="string"&&dh(e=i.toString)&&!fh(t=ch(e,i)))return t;throw new Ok("Can't convert object to primitive value")},l0={exports:{}},Ik=!0,Bp=me,kk=Object.defineProperty,Pk=function(i,r){try{kk(Bp,i,{value:r,configurable:!0,writable:!0})}catch{Bp[i]=r}return r},xk=me,Ck=Pk,Fp="__core-js_shared__",Ak=xk[Fp]||Ck(Fp,{}),zf=Ak,jp=zf;(l0.exports=function(i,r){return jp[i]||(jp[i]=r!==void 0?r:{})})("versions",[]).push({version:"3.33.2",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE",source:"https://github.com/zloirock/core-js"});var va=l0.exports,Dk=jf,Rk=Object,Pt=function(i){return Rk(Dk(i))},Nk=ye,Mk=Pt,Bk=Nk({}.hasOwnProperty),ze=Object.hasOwn||function(r,e){return Bk(Mk(r),e)},Fk=ye,jk=0,Lk=Math.random(),zk=Fk(1 .toString),il=function(i){return"Symbol("+(i===void 0?"":i)+")_"+zk(++jk+Lk,36)},Hk=me,Wk=va,Lp=ze,Vk=il,Uk=da,Kk=u0,Cn=Hk.Symbol,vh=Wk("wks"),Gk=Kk?Cn.for||Cn:Cn&&Cn.withoutSetter||Vk,we=function(i){return Lp(vh,i)||(vh[i]=Uk&&Lp(Cn,i)?Cn[i]:Gk("Symbol."+i)),vh[i]},qk=Ge,zp=it,Hp=Oo,Yk=Lf,Xk=Tk,Jk=we,Zk=TypeError,Qk=Jk("toPrimitive"),eP=function(i,r){if(!zp(i)||Hp(i))return i;var e=Yk(i,Qk),t;if(e){if(r===void 0&&(r="default"),t=qk(e,i,r),!zp(t)||Hp(t))return t;throw new Zk("Can't convert object to primitive value")}return r===void 0&&(r="number"),Xk(i,r)},tP=eP,rP=Oo,nl=function(i){var r=tP(i,"string");return rP(r)?r:r+""},iP=me,Wp=it,Sd=iP.document,nP=Wp(Sd)&&Wp(Sd.createElement),Hf=function(i){return nP?Sd.createElement(i):{}},aP=Ke,oP=ue,sP=Hf,h0=!aP&&!oP(function(){return Object.defineProperty(sP("div"),"a",{get:function(){return 7}}).a!==7}),uP=Ke,lP=Ge,hP=tl,cP=Ji,dP=br,fP=nl,vP=ze,pP=h0,Vp=Object.getOwnPropertyDescriptor;Xi.f=uP?Vp:function(r,e){if(r=dP(r),e=fP(e),pP)try{return Vp(r,e)}catch{}if(vP(r,e))return cP(!lP(hP.f,r,e),r[e])};var gP=ue,yP=Oe,mP=/#|\.prototype\./,To=function(i,r){var e=$P[bP(i)];return e===_P?!0:e===wP?!1:yP(r)?gP(r):!!r},bP=To.normalize=function(i){return String(i).replace(mP,".").toLowerCase()},$P=To.data={},wP=To.NATIVE="N",_P=To.POLYFILL="P",c0=To,Up=t0,EP=kt,SP=So,OP=Up(Up.bind),pi=function(i,r){return EP(i),r===void 0?i:SP?OP(i,r):function(){return i.apply(r,arguments)}},xt={},TP=Ke,IP=ue,d0=TP&&IP(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),kP=it,PP=String,xP=TypeError,jt=function(i){if(kP(i))return i;throw new xP(PP(i)+" is not an object")},CP=Ke,AP=h0,DP=d0,Ss=jt,Kp=nl,RP=TypeError,ph=Object.defineProperty,NP=Object.getOwnPropertyDescriptor,gh="enumerable",yh="configurable",mh="writable";xt.f=CP?DP?function(r,e,t){if(Ss(r),e=Kp(e),Ss(t),typeof r=="function"&&e==="prototype"&&"value"in t&&mh in t&&!t[mh]){var n=NP(r,e);n&&n[mh]&&(r[e]=t.value,t={configurable:yh in t?t[yh]:n[yh],enumerable:gh in t?t[gh]:n[gh],writable:!1})}return ph(r,e,t)}:ph:function(r,e,t){if(Ss(r),e=Kp(e),Ss(t),AP)try{return ph(r,e,t)}catch{}if("get"in t||"set"in t)throw new RP("Accessors not supported");return"value"in t&&(r[e]=t.value),r};var MP=Ke,BP=xt,FP=Ji,jr=MP?function(i,r,e){return BP.f(i,r,FP(1,e))}:function(i,r,e){return i[r]=e,i},Os=me,jP=la,LP=t0,zP=Oe,HP=Xi.f,WP=c0,yn=be,VP=pi,mn=jr,Gp=ze,UP=function(i){var r=function(e,t,n){if(this instanceof r){switch(arguments.length){case 0:return new i;case 1:return new i(e);case 2:return new i(e,t)}return new i(e,t,n)}return jP(i,this,arguments)};return r.prototype=i.prototype,r},K=function(i,r){var e=i.target,t=i.global,n=i.stat,a=i.proto,o=t?Os:n?Os[e]:(Os[e]||{}).prototype,s=t?yn:yn[e]||mn(yn,e,{})[e],u=s.prototype,l,h,d,c,f,v,p,g,y;for(c in r)l=WP(t?c:e+(n?".":"#")+c,i.forced),h=!l&&o&&Gp(o,c),v=s[c],h&&(i.dontCallGetSet?(y=HP(o,c),p=y&&y.value):p=o[c]),f=h&&p?p:r[c],!(h&&typeof v==typeof f)&&(i.bind&&h?g=VP(f,Os):i.wrap&&h?g=UP(f):a&&zP(f)?g=LP(f):g=f,(i.sham||f&&f.sham||v&&v.sham)&&mn(g,"sham",!0),mn(s,c,g),a&&(d=e+"Prototype",Gp(yn,d)||mn(yn,d,{}),mn(yn[d],c,f),i.real&&u&&(l||!u[c])&&mn(u,c,f)))},KP=K,GP=Ke,qp=xt.f;KP({target:"Object",stat:!0,forced:Object.defineProperty!==qp,sham:!GP},{defineProperty:qp});var qP=be,f0=qP.Object,YP=X$.exports=function(r,e,t){return f0.defineProperty(r,e,t)};f0.defineProperty.sham&&(YP.sham=!0);var XP=X$.exports,JP=XP,v0=JP,ZP=v0,QP=ZP,ex=QP,tx=ex,p0=tx,al=Y(p0),rx=fi,gi=Array.isArray||function(r){return rx(r)==="Array"},ix=Math.ceil,nx=Math.floor,ax=Math.trunc||function(r){var e=+r;return(e>0?nx:ix)(e)},ox=ax,ol=function(i){var r=+i;return r!==r||r===0?0:ox(r)},sx=ol,ux=Math.min,lx=function(i){return i>0?ux(sx(i),9007199254740991):0},hx=lx,Lt=function(i){return hx(i.length)},cx=TypeError,dx=9007199254740991,sl=function(i){if(i>dx)throw cx("Maximum allowed index exceeded");return i},fx=nl,vx=xt,px=Ji,pa=function(i,r,e){var t=fx(r);t in i?vx.f(i,t,px(0,e)):i[t]=e},gx=we,yx=gx("toStringTag"),g0={};g0[yx]="z";var Wf=String(g0)==="[object z]",mx=Wf,bx=Oe,uu=fi,$x=we,wx=$x("toStringTag"),_x=Object,Ex=uu(function(){return arguments}())==="Arguments",Sx=function(i,r){try{return i[r]}catch{}},Lr=mx?uu:function(i){var r,e,t;return i===void 0?"Undefined":i===null?"Null":typeof(e=Sx(r=_x(i),wx))=="string"?e:Ex?uu(r):(t=uu(r))==="Object"&&bx(r.callee)?"Arguments":t},Ox=ye,Tx=Oe,Od=zf,Ix=Ox(Function.toString);Tx(Od.inspectSource)||(Od.inspectSource=function(i){return Ix(i)});var y0=Od.inspectSource,kx=ye,Px=ue,m0=Oe,xx=Lr,Cx=yt,Ax=y0,b0=function(){},Dx=[],$0=Cx("Reflect","construct"),Vf=/^\s*(?:class|function)\b/,Rx=kx(Vf.exec),Nx=!Vf.test(b0),Ba=function(r){if(!m0(r))return!1;try{return $0(b0,Dx,r),!0}catch{return!1}},w0=function(r){if(!m0(r))return!1;switch(xx(r)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Nx||!!Rx(Vf,Ax(r))}catch{return!0}};w0.sham=!0;var ul=!$0||Px(function(){var i;return Ba(Ba.call)||!Ba(Object)||!Ba(function(){i=!0})||i})?w0:Ba,Yp=gi,Mx=ul,Bx=it,Fx=we,jx=Fx("species"),Xp=Array,Lx=function(i){var r;return Yp(i)&&(r=i.constructor,Mx(r)&&(r===Xp||Yp(r.prototype))?r=void 0:Bx(r)&&(r=r[jx],r===null&&(r=void 0))),r===void 0?Xp:r},zx=Lx,ll=function(i,r){return new(zx(i))(r===0?0:r)},Hx=ue,Wx=we,Vx=ca,Ux=Wx("species"),Io=function(i){return Vx>=51||!Hx(function(){var r=[],e=r.constructor={};return e[Ux]=function(){return{foo:1}},r[i](Boolean).foo!==1})},Kx=K,Gx=ue,qx=gi,Yx=it,Xx=Pt,Jx=Lt,Jp=sl,Zp=pa,Zx=ll,Qx=Io,eC=we,tC=ca,_0=eC("isConcatSpreadable"),rC=tC>=51||!Gx(function(){var i=[];return i[_0]=!1,i.concat()[0]!==i}),iC=function(i){if(!Yx(i))return!1;var r=i[_0];return r!==void 0?!!r:qx(i)},nC=!rC||!Qx("concat");Kx({target:"Array",proto:!0,arity:1,forced:nC},{concat:function(r){var e=Xx(this),t=Zx(e,0),n=0,a,o,s,u,l;for(a=-1,s=arguments.length;ao;)if(s=n[o++],s!==s)return!0}else for(;a>o;o++)if((i||o in n)&&n[o]===e)return i||o||0;return!i&&-1}},fC={includes:Qp(!0),indexOf:Qp(!1)},ko={},vC=ye,bh=ze,pC=br,gC=fC.indexOf,yC=ko,eg=vC([].push),E0=function(i,r){var e=pC(i),t=0,n=[],a;for(a in e)!bh(yC,a)&&bh(e,a)&&eg(n,a);for(;r.length>t;)bh(e,a=r[t++])&&(~gC(n,a)||eg(n,a));return n},Uf=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],mC=E0,bC=Uf,dl=Object.keys||function(r){return mC(r,bC)},$C=Ke,wC=d0,_C=xt,EC=jt,SC=br,OC=dl;hl.f=$C&&!wC?Object.defineProperties:function(r,e){EC(r);for(var t=SC(e),n=OC(e),a=n.length,o=0,s;a>o;)_C.f(r,s=n[o++],t[s]);return r};var TC=yt,S0=TC("document","documentElement"),IC=va,kC=il,tg=IC("keys"),fl=function(i){return tg[i]||(tg[i]=kC(i))},PC=jt,xC=hl,rg=Uf,CC=ko,AC=S0,DC=Hf,RC=fl,ig=">",ng="<",Td="prototype",Id="script",O0=RC("IE_PROTO"),$h=function(){},T0=function(i){return ng+Id+ig+i+ng+"/"+Id+ig},ag=function(i){i.write(T0("")),i.close();var r=i.parentWindow.Object;return i=null,r},NC=function(){var i=DC("iframe"),r="java"+Id+":",e;return i.style.display="none",AC.appendChild(i),i.src=String(r),e=i.contentWindow.document,e.open(),e.write(T0("document.F=Object")),e.close(),e.F},Ts,lu=function(){try{Ts=new ActiveXObject("htmlfile")}catch{}lu=typeof document<"u"?document.domain&&Ts?ag(Ts):NC():ag(Ts);for(var i=rg.length;i--;)delete lu[Td][rg[i]];return lu()};CC[O0]=!0;var Qi=Object.create||function(r,e){var t;return r!==null?($h[Td]=PC(r),t=new $h,$h[Td]=null,t[O0]=r):t=lu(),e===void 0?t:xC.f(t,e)},Po={},MC=E0,BC=Uf,FC=BC.concat("length","prototype");Po.f=Object.getOwnPropertyNames||function(r){return MC(r,FC)};var Kf={},og=cl,jC=Lt,LC=pa,zC=Array,HC=Math.max,I0=function(i,r,e){for(var t=jC(i),n=og(r,t),a=og(e===void 0?t:e,t),o=zC(HC(a-n,0)),s=0;ng;g++)if((s||g in f)&&(b=f[g],$=v(b,g,c),i))if(r)m[g]=$;else if($)switch(i){case 3:return!0;case 5:return b;case 6:return g;case 2:cg(m,b)}else switch(i){case 4:return!1;case 7:cg(m,b)}return a?-1:t||n?n:m}},ma={forEach:Wr(0),map:Wr(1),filter:Wr(2),some:Wr(3),every:Wr(4),find:Wr(5),findIndex:Wr(6),filterReject:Wr(7)},vl=K,Ao=me,qf=Ge,P2=ye,qn=Ke,Yn=da,x2=ue,Ve=ze,C2=Le,Pd=jt,pl=br,Yf=nl,A2=Zi,xd=Ji,so=Qi,A0=dl,D2=Po,D0=Kf,R2=xo,R0=Xi,N0=xt,N2=hl,M0=tl,dg=ga,M2=Gf,Xf=va,B2=fl,B0=ko,fg=il,F2=we,j2=Co,L2=Te,z2=x0,H2=en,F0=ya,gl=ma.forEach,_t=B2("hidden"),yl="Symbol",uo="prototype",W2=F0.set,vg=F0.getterFor(yl),ar=Object[uo],xi=Ao.Symbol,Ua=xi&&xi[uo],V2=Ao.RangeError,U2=Ao.TypeError,Eh=Ao.QObject,j0=R0.f,Ci=N0.f,L0=D0.f,K2=M0.f,z0=P2([].push),Nr=Xf("symbols"),Do=Xf("op-symbols"),G2=Xf("wks"),Cd=!Eh||!Eh[uo]||!Eh[uo].findChild,H0=function(i,r,e){var t=j0(ar,r);t&&delete ar[r],Ci(i,r,e),t&&i!==ar&&Ci(ar,r,t)},Ad=qn&&x2(function(){return so(Ci({},"a",{get:function(){return Ci(this,"a",{value:7}).a}})).a!==7})?H0:Ci,Sh=function(i,r){var e=Nr[i]=so(Ua);return W2(e,{type:yl,tag:i,description:r}),qn||(e.description=r),e},ml=function(r,e,t){r===ar&&ml(Do,e,t),Pd(r);var n=Yf(e);return Pd(t),Ve(Nr,n)?(t.enumerable?(Ve(r,_t)&&r[_t][n]&&(r[_t][n]=!1),t=so(t,{enumerable:xd(0,!1)})):(Ve(r,_t)||Ci(r,_t,xd(1,{})),r[_t][n]=!0),Ad(r,n,t)):Ci(r,n,t)},Jf=function(r,e){Pd(r);var t=pl(e),n=A0(t).concat(K0(t));return gl(n,function(a){(!qn||qf(W0,t,a))&&ml(r,a,t[a])}),r},q2=function(r,e){return e===void 0?so(r):Jf(so(r),e)},W0=function(r){var e=Yf(r),t=qf(K2,this,e);return this===ar&&Ve(Nr,e)&&!Ve(Do,e)?!1:t||!Ve(this,e)||!Ve(Nr,e)||Ve(this,_t)&&this[_t][e]?t:!0},V0=function(r,e){var t=pl(r),n=Yf(e);if(!(t===ar&&Ve(Nr,n)&&!Ve(Do,n))){var a=j0(t,n);return a&&Ve(Nr,n)&&!(Ve(t,_t)&&t[_t][n])&&(a.enumerable=!0),a}},U0=function(r){var e=L0(pl(r)),t=[];return gl(e,function(n){!Ve(Nr,n)&&!Ve(B0,n)&&z0(t,n)}),t},K0=function(i){var r=i===ar,e=L0(r?Do:pl(i)),t=[];return gl(e,function(n){Ve(Nr,n)&&(!r||Ve(ar,n))&&z0(t,Nr[n])}),t};Yn||(xi=function(){if(C2(Ua,this))throw new U2("Symbol is not a constructor");var r=!arguments.length||arguments[0]===void 0?void 0:A2(arguments[0]),e=fg(r),t=function(n){var a=this===void 0?Ao:this;a===ar&&qf(t,Do,n),Ve(a,_t)&&Ve(a[_t],e)&&(a[_t][e]=!1);var o=xd(1,n);try{Ad(a,e,o)}catch(s){if(!(s instanceof V2))throw s;H0(a,e,o)}};return qn&&Cd&&Ad(ar,e,{configurable:!0,set:t}),Sh(e,r)},Ua=xi[uo],dg(Ua,"toString",function(){return vg(this).tag}),dg(xi,"withoutSetter",function(i){return Sh(fg(i),i)}),M0.f=W0,N0.f=ml,N2.f=Jf,R0.f=V0,D2.f=D0.f=U0,R2.f=K0,j2.f=function(i){return Sh(F2(i),i)},qn&&M2(Ua,"description",{configurable:!0,get:function(){return vg(this).description}}));vl({global:!0,constructor:!0,wrap:!0,forced:!Yn,sham:!Yn},{Symbol:xi});gl(A0(G2),function(i){L2(i)});vl({target:yl,stat:!0,forced:!Yn},{useSetter:function(){Cd=!0},useSimple:function(){Cd=!1}});vl({target:"Object",stat:!0,forced:!Yn,sham:!qn},{create:q2,defineProperty:ml,defineProperties:Jf,getOwnPropertyDescriptor:V0});vl({target:"Object",stat:!0,forced:!Yn},{getOwnPropertyNames:U0});z2();H2(xi,yl);B0[_t]=!0;var Y2=da,G0=Y2&&!!Symbol.for&&!!Symbol.keyFor,X2=K,J2=yt,Z2=ze,Q2=Zi,q0=va,eA=G0,Oh=q0("string-to-symbol-registry"),tA=q0("symbol-to-string-registry");X2({target:"Symbol",stat:!0,forced:!eA},{for:function(i){var r=Q2(i);if(Z2(Oh,r))return Oh[r];var e=J2("Symbol")(r);return Oh[r]=e,tA[e]=r,e}});var rA=K,iA=ze,nA=Oo,aA=fa,oA=va,sA=G0,pg=oA("symbol-to-string-registry");rA({target:"Symbol",stat:!0,forced:!sA},{keyFor:function(r){if(!nA(r))throw new TypeError(aA(r)+" is not a symbol");if(iA(pg,r))return pg[r]}});var uA=ye,Ro=uA([].slice),lA=ye,gg=gi,hA=Oe,yg=fi,cA=Zi,mg=lA([].push),dA=function(i){if(hA(i))return i;if(gg(i)){for(var r=i.length,e=[],t=0;t=r.length)return i.target=void 0,xs(void 0,!0);switch(i.kind){case"keys":return xs(e,!1);case"values":return xs(r[e],!1)}return xs([e,r[e]],!1)},"values");Ag.Arguments=Ag.Array;var UD={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},KD=UD,GD=me,qD=Lr,YD=jr,Dg=ba,XD=we,Rg=XD("toStringTag");for(var Ph in KD){var Ng=GD[Ph],xh=Ng&&Ng.prototype;xh&&qD(xh)!==Rg&&YD(xh,Rg,Ph),Dg[Ph]=Dg.Array}var JD=qA,sw=JD,ZD=we,QD=xt.f,Mg=ZD("metadata"),Bg=Function.prototype;Bg[Mg]===void 0&&QD(Bg,Mg,{value:null});var eR=Te;eR("asyncDispose");var tR=Te;tR("dispose");var rR=Te;rR("metadata");var iR=sw,nR=iR,aR=yt,oR=ye,tv=aR("Symbol"),sR=tv.keyFor,uR=oR(tv.prototype.valueOf),uw=tv.isRegisteredSymbol||function(r){try{return sR(uR(r))!==void 0}catch{return!1}},lR=K,hR=uw;lR({target:"Symbol",stat:!0},{isRegisteredSymbol:hR});var cR=va,lw=yt,dR=ye,fR=Oo,vR=we,xu=lw("Symbol"),Fg=xu.isWellKnownSymbol,hw=lw("Object","getOwnPropertyNames"),pR=dR(xu.prototype.valueOf),jg=cR("wks");for(var Ch=0,Lg=hw(xu),gR=Lg.length;Ch=a?i?"":void 0:(o=Hg(t,n),o<55296||o>56319||n+1===a||(s=Hg(t,n+1))<56320||s>57343?i?DR(t,n):o:i?RR(t,n,n+2):(o-55296<<10)+(s-56320)+65536)}},NR={codeAt:Wg(!1),charAt:Wg(!0)},MR=NR.charAt,BR=Zi,dw=ya,FR=Qf,Vg=ev,fw="String Iterator",jR=dw.set,LR=dw.getterFor(fw);FR(String,"String",function(i){jR(this,{type:fw,string:BR(i),index:0})},function(){var r=LR(this),e=r.string,t=r.index,n;return t>=e.length?Vg(void 0,!0):(n=MR(e,t),r.index+=n.length,Vg(n,!1))});var zR=Co,HR=zR.f("iterator"),WR=HR,vw=WR,VR=vw,UR=VR,KR=UR,GR=KR,pw=GR,qR=Y(pw);function Xn(i){"@babel/helpers - typeof";return Xn=typeof An=="function"&&typeof qR=="symbol"?function(r){return typeof r}:function(r){return r&&typeof An=="function"&&r.constructor===An&&r!==An.prototype?"symbol":typeof r},Xn(i)}var YR=Co,XR=YR.f("toPrimitive"),JR=XR,ZR=JR,QR=ZR,eN=QR,tN=eN,rN=tN,iN=rN,nN=Y(iN);function aN(i,r){if(Xn(i)!=="object"||i===null)return i;var e=i[nN];if(e!==void 0){var t=e.call(i,r||"default");if(Xn(t)!=="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(i)}function gw(i){var r=aN(i,"string");return Xn(r)==="symbol"?r:String(r)}function Ug(i,r){for(var e=0;e=0:s>u;u+=l)u in o&&(n=e(n,o[u],u,a));return n}},kN={left:qg(!1),right:qg(!0)},PN=ue,wl=function(i,r){var e=[][i];return!!e&&PN(function(){e.call(null,r||function(){return 1},1)})},xN=me,CN=fi,Mo=CN(xN.process)==="process",AN=K,DN=kN.left,RN=wl,Yg=ca,NN=Mo,MN=!NN&&Yg>79&&Yg<83,BN=MN||!RN("reduce");AN({target:"Array",proto:!0,forced:BN},{reduce:function(r){var e=arguments.length;return DN(this,r,e,e>1?arguments[1]:void 0)}});var FN=ut,jN=FN("Array","reduce"),LN=Le,zN=jN,Rh=Array.prototype,HN=function(i){var r=i.reduce;return i===Rh||LN(Rh,i)&&r===Rh.reduce?zN:r},WN=HN,VN=WN,UN=VN,KN=Y(UN),GN=K,qN=ma.filter,YN=Io,XN=YN("filter");GN({target:"Array",proto:!0,forced:!XN},{filter:function(r){return qN(this,r,arguments.length>1?arguments[1]:void 0)}});var JN=ut,ZN=JN("Array","filter"),QN=Le,eM=ZN,Nh=Array.prototype,tM=function(i){var r=i.filter;return i===Nh||QN(Nh,i)&&r===Nh.filter?eM:r},rM=tM,iM=rM,nM=iM,Dn=Y(nM),aM=K,oM=ma.map,sM=Io,uM=sM("map");aM({target:"Array",proto:!0,forced:!uM},{map:function(r){return oM(this,r,arguments.length>1?arguments[1]:void 0)}});var lM=ut,hM=lM("Array","map"),cM=Le,dM=hM,Mh=Array.prototype,fM=function(i){var r=i.map;return i===Mh||cM(Mh,i)&&r===Mh.map?dM:r},vM=fM,pM=vM,gM=pM,rr=Y(gM),yM=gi,mM=Lt,bM=sl,$M=pi,_w=function(i,r,e,t,n,a,o,s){for(var u=n,l=0,h=o?$M(o,s):!1,d,c;l0&&yM(d)?(c=mM(d),u=_w(i,r,d,c,u,a-1)-1):(bM(u+1),i[u]=d),u++),l++;return u},wM=_w,_M=K,EM=wM,SM=kt,OM=Pt,TM=Lt,IM=ll;_M({target:"Array",proto:!0},{flatMap:function(r){var e=OM(this),t=TM(e),n;return SM(r),n=IM(e,0),n.length=EM(n,e,e,t,0,1,r,arguments.length>1?arguments[1]:void 0),n}});var kM=ut;kM("Array","flatMap");var PM=Ge,Xg=jt,xM=Lf,Ew=function(i,r,e){var t,n;Xg(i);try{if(t=xM(i,"return"),!t){if(r==="throw")throw e;return e}t=PM(t,i)}catch(a){n=!0,t=a}if(r==="throw")throw e;if(n)throw t;return Xg(t),e},CM=jt,AM=Ew,DM=function(i,r,e,t){try{return t?r(CM(e)[0],e[1]):r(e)}catch(n){AM(i,"throw",n)}},RM=we,NM=ba,MM=RM("iterator"),BM=Array.prototype,Sw=function(i){return i!==void 0&&(NM.Array===i||BM[MM]===i)},FM=Lr,Jg=Lf,jM=ha,LM=ba,zM=we,HM=zM("iterator"),_l=function(i){if(!jM(i))return Jg(i,HM)||Jg(i,"@@iterator")||LM[FM(i)]},WM=Ge,VM=kt,UM=jt,KM=fa,GM=_l,qM=TypeError,nv=function(i,r){var e=arguments.length<2?GM(i):r;if(VM(e))return UM(WM(e,i));throw new qM(KM(i)+" is not iterable")},YM=pi,XM=Ge,JM=Pt,ZM=DM,QM=Sw,eB=ul,tB=Lt,Zg=pa,rB=nv,iB=_l,Qg=Array,nB=function(r){var e=JM(r),t=eB(this),n=arguments.length,a=n>1?arguments[1]:void 0,o=a!==void 0;o&&(a=YM(a,n>2?arguments[2]:void 0));var s=iB(e),u=0,l,h,d,c,f,v;if(s&&!(this===Qg&&QM(s)))for(c=rB(e,s),f=c.next,h=t?new this:[];!(d=XM(f,c)).done;u++)v=o?ZM(c,a,[d.value,u],!0):d.value,Zg(h,u,v);else for(l=tB(e),h=t?new this(l):Qg(l);l>u;u++)v=o?a(e[u],u):e[u],Zg(h,u,v);return h.length=u,h},aB=we,Ow=aB("iterator"),Tw=!1;try{var oB=0,ey={next:function(){return{done:!!oB++}},return:function(){Tw=!0}};ey[Ow]=function(){return this},Array.from(ey,function(){throw 2})}catch{}var Iw=function(i,r){try{if(!r&&!Tw)return!1}catch{return!1}var e=!1;try{var t={};t[Ow]=function(){return{next:function(){return{done:e=!0}}}},i(t)}catch{}return e},sB=K,uB=nB,lB=Iw,hB=!lB(function(i){Array.from(i)});sB({target:"Array",stat:!0,forced:hB},{from:uB});var cB=be,dB=cB.Array.from,fB=dB,kw=fB,vB=kw,av=Y(vB),pB=_l,gB=pB,yB=gB,mB=yB,bB=mB,$B=bB,wB=$B,_B=wB,Pw=_B,xw=Y(Pw),EB=Pw,ov=Y(EB),SB=K,OB=gi;SB({target:"Array",stat:!0},{isArray:OB});var TB=be,IB=TB.Array.isArray,kB=IB,Cw=kB,PB=Cw,xB=PB,CB=xB,AB=CB,DB=AB,Aw=Y(DB);function RB(i){if(Aw(i))return i}var NB=Ke,MB=gi,BB=TypeError,FB=Object.getOwnPropertyDescriptor,jB=NB&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(i){return i instanceof TypeError}}(),Dw=jB?function(i,r){if(MB(i)&&!FB(i,"length").writable)throw new BB("Cannot set read only .length");return i.length=r}:function(i,r){return i.length=r},LB=K,zB=Pt,HB=Lt,WB=Dw,VB=sl,UB=ue,KB=UB(function(){return[].push.call({length:4294967296},1)!==4294967297}),GB=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(i){return i instanceof TypeError}},qB=KB||!GB();LB({target:"Array",proto:!0,arity:1,forced:qB},{push:function(r){var e=zB(this),t=HB(e),n=arguments.length;VB(t+n);for(var a=0;ai.length)&&(r=i.length);for(var e=0,t=new Array(r);e"u"&&Ed!==void 0,r0={all:Ed,IS_HTMLDDA:qI},i0=r0,YI=i0.all,Oe=i0.IS_HTMLDDA?function(i){return typeof i=="function"||i===YI}:function(i){return typeof i=="function"},Qi={},XI=le,Ke=!XI(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),JI=So,Es=Function.prototype.call,Ge=JI?Es.bind(Es):function(){return Es.apply(Es,arguments)},tl={},n0={}.propertyIsEnumerable,a0=Object.getOwnPropertyDescriptor,ZI=a0&&!n0.call({1:2},1);tl.f=ZI?function(r){var e=a0(this,r);return!!e&&e.enumerable}:n0;var en=function(i,r){return{enumerable:!(i&1),configurable:!(i&2),writable:!(i&4),value:r}},QI=me,ek=le,tk=fi,sh=Object,rk=QI("".split),rl=ek(function(){return!sh("z").propertyIsEnumerable(0)})?function(i){return tk(i)==="String"?rk(i,""):sh(i)}:sh,ha=function(i){return i==null},ik=ha,nk=TypeError,jf=function(i){if(ik(i))throw new nk("Can't call method on "+i);return i},ak=rl,ok=jf,br=function(i){return ak(ok(i))},xp=Oe,o0=r0,sk=o0.all,it=o0.IS_HTMLDDA?function(i){return typeof i=="object"?i!==null:xp(i)||i===sk}:function(i){return typeof i=="object"?i!==null:xp(i)},$e={},uh=$e,lh=be,uk=Oe,Cp=function(i){return uk(i)?i:void 0},yt=function(i,r){return arguments.length<2?Cp(uh[i])||Cp(lh[i]):uh[i]&&uh[i][r]||lh[i]&&lh[i][r]},lk=me,Le=lk({}.isPrototypeOf),vi=typeof navigator<"u"&&String(navigator.userAgent)||"",s0=be,hh=vi,Ap=s0.process,Dp=s0.Deno,Rp=Ap&&Ap.versions||Dp&&Dp.version,Np=Rp&&Rp.v8,tr,Iu;Np&&(tr=Np.split("."),Iu=tr[0]>0&&tr[0]<4?1:+(tr[0]+tr[1]));!Iu&&hh&&(tr=hh.match(/Edge\/(\d+)/),(!tr||tr[1]>=74)&&(tr=hh.match(/Chrome\/(\d+)/),tr&&(Iu=+tr[1])));var ca=Iu,Mp=ca,hk=le,ck=be,dk=ck.String,da=!!Object.getOwnPropertySymbols&&!hk(function(){var i=Symbol("symbol detection");return!dk(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&Mp&&Mp<41}),fk=da,u0=fk&&!Symbol.sham&&typeof Symbol.iterator=="symbol",vk=yt,pk=Oe,gk=Le,yk=u0,mk=Object,Oo=yk?function(i){return typeof i=="symbol"}:function(i){var r=vk("Symbol");return pk(r)&&gk(r.prototype,mk(i))},bk=String,fa=function(i){try{return bk(i)}catch{return"Object"}},$k=Oe,wk=fa,_k=TypeError,kt=function(i){if($k(i))return i;throw new _k(wk(i)+" is not a function")},Ek=kt,Sk=ha,Lf=function(i,r){var e=i[r];return Sk(e)?void 0:Ek(e)},ch=Ge,dh=Oe,fh=it,Ok=TypeError,Tk=function(i,r){var e,t;if(r==="string"&&dh(e=i.toString)&&!fh(t=ch(e,i))||dh(e=i.valueOf)&&!fh(t=ch(e,i))||r!=="string"&&dh(e=i.toString)&&!fh(t=ch(e,i)))return t;throw new Ok("Can't convert object to primitive value")},l0={exports:{}},Ik=!0,Bp=be,kk=Object.defineProperty,Pk=function(i,r){try{kk(Bp,i,{value:r,configurable:!0,writable:!0})}catch{Bp[i]=r}return r},xk=be,Ck=Pk,Fp="__core-js_shared__",Ak=xk[Fp]||Ck(Fp,{}),zf=Ak,jp=zf;(l0.exports=function(i,r){return jp[i]||(jp[i]=r!==void 0?r:{})})("versions",[]).push({version:"3.33.2",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE",source:"https://github.com/zloirock/core-js"});var va=l0.exports,Dk=jf,Rk=Object,Pt=function(i){return Rk(Dk(i))},Nk=me,Mk=Pt,Bk=Nk({}.hasOwnProperty),ze=Object.hasOwn||function(r,e){return Bk(Mk(r),e)},Fk=me,jk=0,Lk=Math.random(),zk=Fk(1 .toString),il=function(i){return"Symbol("+(i===void 0?"":i)+")_"+zk(++jk+Lk,36)},Hk=be,Vk=va,Lp=ze,Wk=il,Uk=da,Kk=u0,Cn=Hk.Symbol,vh=Vk("wks"),Gk=Kk?Cn.for||Cn:Cn&&Cn.withoutSetter||Wk,we=function(i){return Lp(vh,i)||(vh[i]=Uk&&Lp(Cn,i)?Cn[i]:Gk("Symbol."+i)),vh[i]},qk=Ge,zp=it,Hp=Oo,Yk=Lf,Xk=Tk,Jk=we,Zk=TypeError,Qk=Jk("toPrimitive"),eP=function(i,r){if(!zp(i)||Hp(i))return i;var e=Yk(i,Qk),t;if(e){if(r===void 0&&(r="default"),t=qk(e,i,r),!zp(t)||Hp(t))return t;throw new Zk("Can't convert object to primitive value")}return r===void 0&&(r="number"),Xk(i,r)},tP=eP,rP=Oo,nl=function(i){var r=tP(i,"string");return rP(r)?r:r+""},iP=be,Vp=it,Sd=iP.document,nP=Vp(Sd)&&Vp(Sd.createElement),Hf=function(i){return nP?Sd.createElement(i):{}},aP=Ke,oP=le,sP=Hf,h0=!aP&&!oP(function(){return Object.defineProperty(sP("div"),"a",{get:function(){return 7}}).a!==7}),uP=Ke,lP=Ge,hP=tl,cP=en,dP=br,fP=nl,vP=ze,pP=h0,Wp=Object.getOwnPropertyDescriptor;Qi.f=uP?Wp:function(r,e){if(r=dP(r),e=fP(e),pP)try{return Wp(r,e)}catch{}if(vP(r,e))return cP(!lP(hP.f,r,e),r[e])};var gP=le,yP=Oe,mP=/#|\.prototype\./,To=function(i,r){var e=$P[bP(i)];return e===_P?!0:e===wP?!1:yP(r)?gP(r):!!r},bP=To.normalize=function(i){return String(i).replace(mP,".").toLowerCase()},$P=To.data={},wP=To.NATIVE="N",_P=To.POLYFILL="P",c0=To,Up=t0,EP=kt,SP=So,OP=Up(Up.bind),pi=function(i,r){return EP(i),r===void 0?i:SP?OP(i,r):function(){return i.apply(r,arguments)}},xt={},TP=Ke,IP=le,d0=TP&&IP(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),kP=it,PP=String,xP=TypeError,jt=function(i){if(kP(i))return i;throw new xP(PP(i)+" is not an object")},CP=Ke,AP=h0,DP=d0,Ss=jt,Kp=nl,RP=TypeError,ph=Object.defineProperty,NP=Object.getOwnPropertyDescriptor,gh="enumerable",yh="configurable",mh="writable";xt.f=CP?DP?function(r,e,t){if(Ss(r),e=Kp(e),Ss(t),typeof r=="function"&&e==="prototype"&&"value"in t&&mh in t&&!t[mh]){var n=NP(r,e);n&&n[mh]&&(r[e]=t.value,t={configurable:yh in t?t[yh]:n[yh],enumerable:gh in t?t[gh]:n[gh],writable:!1})}return ph(r,e,t)}:ph:function(r,e,t){if(Ss(r),e=Kp(e),Ss(t),AP)try{return ph(r,e,t)}catch{}if("get"in t||"set"in t)throw new RP("Accessors not supported");return"value"in t&&(r[e]=t.value),r};var MP=Ke,BP=xt,FP=en,Lr=MP?function(i,r,e){return BP.f(i,r,FP(1,e))}:function(i,r,e){return i[r]=e,i},Os=be,jP=la,LP=t0,zP=Oe,HP=Qi.f,VP=c0,yn=$e,WP=pi,mn=Lr,Gp=ze,UP=function(i){var r=function(e,t,n){if(this instanceof r){switch(arguments.length){case 0:return new i;case 1:return new i(e);case 2:return new i(e,t)}return new i(e,t,n)}return jP(i,this,arguments)};return r.prototype=i.prototype,r},U=function(i,r){var e=i.target,t=i.global,n=i.stat,a=i.proto,o=t?Os:n?Os[e]:(Os[e]||{}).prototype,s=t?yn:yn[e]||mn(yn,e,{})[e],u=s.prototype,l,h,d,c,f,v,p,g,y;for(c in r)l=VP(t?c:e+(n?".":"#")+c,i.forced),h=!l&&o&&Gp(o,c),v=s[c],h&&(i.dontCallGetSet?(y=HP(o,c),p=y&&y.value):p=o[c]),f=h&&p?p:r[c],!(h&&typeof v==typeof f)&&(i.bind&&h?g=WP(f,Os):i.wrap&&h?g=UP(f):a&&zP(f)?g=LP(f):g=f,(i.sham||f&&f.sham||v&&v.sham)&&mn(g,"sham",!0),mn(s,c,g),a&&(d=e+"Prototype",Gp(yn,d)||mn(yn,d,{}),mn(yn[d],c,f),i.real&&u&&(l||!u[c])&&mn(u,c,f)))},KP=U,GP=Ke,qp=xt.f;KP({target:"Object",stat:!0,forced:Object.defineProperty!==qp,sham:!GP},{defineProperty:qp});var qP=$e,f0=qP.Object,YP=X$.exports=function(r,e,t){return f0.defineProperty(r,e,t)};f0.defineProperty.sham&&(YP.sham=!0);var XP=X$.exports,JP=XP,v0=JP,ZP=v0,QP=ZP,ex=QP,tx=ex,p0=tx,al=Y(p0),rx=fi,gi=Array.isArray||function(r){return rx(r)==="Array"},ix=Math.ceil,nx=Math.floor,ax=Math.trunc||function(r){var e=+r;return(e>0?nx:ix)(e)},ox=ax,ol=function(i){var r=+i;return r!==r||r===0?0:ox(r)},sx=ol,ux=Math.min,lx=function(i){return i>0?ux(sx(i),9007199254740991):0},hx=lx,Lt=function(i){return hx(i.length)},cx=TypeError,dx=9007199254740991,sl=function(i){if(i>dx)throw cx("Maximum allowed index exceeded");return i},fx=nl,vx=xt,px=en,pa=function(i,r,e){var t=fx(r);t in i?vx.f(i,t,px(0,e)):i[t]=e},gx=we,yx=gx("toStringTag"),g0={};g0[yx]="z";var Vf=String(g0)==="[object z]",mx=Vf,bx=Oe,uu=fi,$x=we,wx=$x("toStringTag"),_x=Object,Ex=uu(function(){return arguments}())==="Arguments",Sx=function(i,r){try{return i[r]}catch{}},zr=mx?uu:function(i){var r,e,t;return i===void 0?"Undefined":i===null?"Null":typeof(e=Sx(r=_x(i),wx))=="string"?e:Ex?uu(r):(t=uu(r))==="Object"&&bx(r.callee)?"Arguments":t},Ox=me,Tx=Oe,Od=zf,Ix=Ox(Function.toString);Tx(Od.inspectSource)||(Od.inspectSource=function(i){return Ix(i)});var y0=Od.inspectSource,kx=me,Px=le,m0=Oe,xx=zr,Cx=yt,Ax=y0,b0=function(){},Dx=[],$0=Cx("Reflect","construct"),Wf=/^\s*(?:class|function)\b/,Rx=kx(Wf.exec),Nx=!Wf.test(b0),Ba=function(r){if(!m0(r))return!1;try{return $0(b0,Dx,r),!0}catch{return!1}},w0=function(r){if(!m0(r))return!1;switch(xx(r)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Nx||!!Rx(Wf,Ax(r))}catch{return!0}};w0.sham=!0;var ul=!$0||Px(function(){var i;return Ba(Ba.call)||!Ba(Object)||!Ba(function(){i=!0})||i})?w0:Ba,Yp=gi,Mx=ul,Bx=it,Fx=we,jx=Fx("species"),Xp=Array,Lx=function(i){var r;return Yp(i)&&(r=i.constructor,Mx(r)&&(r===Xp||Yp(r.prototype))?r=void 0:Bx(r)&&(r=r[jx],r===null&&(r=void 0))),r===void 0?Xp:r},zx=Lx,ll=function(i,r){return new(zx(i))(r===0?0:r)},Hx=le,Vx=we,Wx=ca,Ux=Vx("species"),Io=function(i){return Wx>=51||!Hx(function(){var r=[],e=r.constructor={};return e[Ux]=function(){return{foo:1}},r[i](Boolean).foo!==1})},Kx=U,Gx=le,qx=gi,Yx=it,Xx=Pt,Jx=Lt,Jp=sl,Zp=pa,Zx=ll,Qx=Io,eC=we,tC=ca,_0=eC("isConcatSpreadable"),rC=tC>=51||!Gx(function(){var i=[];return i[_0]=!1,i.concat()[0]!==i}),iC=function(i){if(!Yx(i))return!1;var r=i[_0];return r!==void 0?!!r:qx(i)},nC=!rC||!Qx("concat");Kx({target:"Array",proto:!0,arity:1,forced:nC},{concat:function(r){var e=Xx(this),t=Zx(e,0),n=0,a,o,s,u,l;for(a=-1,s=arguments.length;ao;)if(s=n[o++],s!==s)return!0}else for(;a>o;o++)if((i||o in n)&&n[o]===e)return i||o||0;return!i&&-1}},fC={includes:Qp(!0),indexOf:Qp(!1)},ko={},vC=me,bh=ze,pC=br,gC=fC.indexOf,yC=ko,eg=vC([].push),E0=function(i,r){var e=pC(i),t=0,n=[],a;for(a in e)!bh(yC,a)&&bh(e,a)&&eg(n,a);for(;r.length>t;)bh(e,a=r[t++])&&(~gC(n,a)||eg(n,a));return n},Uf=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],mC=E0,bC=Uf,dl=Object.keys||function(r){return mC(r,bC)},$C=Ke,wC=d0,_C=xt,EC=jt,SC=br,OC=dl;hl.f=$C&&!wC?Object.defineProperties:function(r,e){EC(r);for(var t=SC(e),n=OC(e),a=n.length,o=0,s;a>o;)_C.f(r,s=n[o++],t[s]);return r};var TC=yt,S0=TC("document","documentElement"),IC=va,kC=il,tg=IC("keys"),fl=function(i){return tg[i]||(tg[i]=kC(i))},PC=jt,xC=hl,rg=Uf,CC=ko,AC=S0,DC=Hf,RC=fl,ig=">",ng="<",Td="prototype",Id="script",O0=RC("IE_PROTO"),$h=function(){},T0=function(i){return ng+Id+ig+i+ng+"/"+Id+ig},ag=function(i){i.write(T0("")),i.close();var r=i.parentWindow.Object;return i=null,r},NC=function(){var i=DC("iframe"),r="java"+Id+":",e;return i.style.display="none",AC.appendChild(i),i.src=String(r),e=i.contentWindow.document,e.open(),e.write(T0("document.F=Object")),e.close(),e.F},Ts,lu=function(){try{Ts=new ActiveXObject("htmlfile")}catch{}lu=typeof document<"u"?document.domain&&Ts?ag(Ts):NC():ag(Ts);for(var i=rg.length;i--;)delete lu[Td][rg[i]];return lu()};CC[O0]=!0;var rn=Object.create||function(r,e){var t;return r!==null?($h[Td]=PC(r),t=new $h,$h[Td]=null,t[O0]=r):t=lu(),e===void 0?t:xC.f(t,e)},Po={},MC=E0,BC=Uf,FC=BC.concat("length","prototype");Po.f=Object.getOwnPropertyNames||function(r){return MC(r,FC)};var Kf={},og=cl,jC=Lt,LC=pa,zC=Array,HC=Math.max,I0=function(i,r,e){for(var t=jC(i),n=og(r,t),a=og(e===void 0?t:e,t),o=zC(HC(a-n,0)),s=0;ng;g++)if((s||g in f)&&(b=f[g],$=v(b,g,c),i))if(r)m[g]=$;else if($)switch(i){case 3:return!0;case 5:return b;case 6:return g;case 2:cg(m,b)}else switch(i){case 4:return!1;case 7:cg(m,b)}return a?-1:t||n?n:m}},ma={forEach:Wr(0),map:Wr(1),filter:Wr(2),some:Wr(3),every:Wr(4),find:Wr(5),findIndex:Wr(6),filterReject:Wr(7)},vl=U,Ao=be,qf=Ge,P2=me,qn=Ke,Yn=da,x2=le,We=ze,C2=Le,Pd=jt,pl=br,Yf=nl,A2=tn,xd=en,so=rn,A0=dl,D2=Po,D0=Kf,R2=xo,R0=Qi,N0=xt,N2=hl,M0=tl,dg=ga,M2=Gf,Xf=va,B2=fl,B0=ko,fg=il,F2=we,j2=Co,L2=Te,z2=x0,H2=nn,F0=ya,gl=ma.forEach,_t=B2("hidden"),yl="Symbol",uo="prototype",V2=F0.set,vg=F0.getterFor(yl),ar=Object[uo],Di=Ao.Symbol,Ua=Di&&Di[uo],W2=Ao.RangeError,U2=Ao.TypeError,Eh=Ao.QObject,j0=R0.f,Ri=N0.f,L0=D0.f,K2=M0.f,z0=P2([].push),Mr=Xf("symbols"),Do=Xf("op-symbols"),G2=Xf("wks"),Cd=!Eh||!Eh[uo]||!Eh[uo].findChild,H0=function(i,r,e){var t=j0(ar,r);t&&delete ar[r],Ri(i,r,e),t&&i!==ar&&Ri(ar,r,t)},Ad=qn&&x2(function(){return so(Ri({},"a",{get:function(){return Ri(this,"a",{value:7}).a}})).a!==7})?H0:Ri,Sh=function(i,r){var e=Mr[i]=so(Ua);return V2(e,{type:yl,tag:i,description:r}),qn||(e.description=r),e},ml=function(r,e,t){r===ar&&ml(Do,e,t),Pd(r);var n=Yf(e);return Pd(t),We(Mr,n)?(t.enumerable?(We(r,_t)&&r[_t][n]&&(r[_t][n]=!1),t=so(t,{enumerable:xd(0,!1)})):(We(r,_t)||Ri(r,_t,xd(1,{})),r[_t][n]=!0),Ad(r,n,t)):Ri(r,n,t)},Jf=function(r,e){Pd(r);var t=pl(e),n=A0(t).concat(K0(t));return gl(n,function(a){(!qn||qf(V0,t,a))&&ml(r,a,t[a])}),r},q2=function(r,e){return e===void 0?so(r):Jf(so(r),e)},V0=function(r){var e=Yf(r),t=qf(K2,this,e);return this===ar&&We(Mr,e)&&!We(Do,e)?!1:t||!We(this,e)||!We(Mr,e)||We(this,_t)&&this[_t][e]?t:!0},W0=function(r,e){var t=pl(r),n=Yf(e);if(!(t===ar&&We(Mr,n)&&!We(Do,n))){var a=j0(t,n);return a&&We(Mr,n)&&!(We(t,_t)&&t[_t][n])&&(a.enumerable=!0),a}},U0=function(r){var e=L0(pl(r)),t=[];return gl(e,function(n){!We(Mr,n)&&!We(B0,n)&&z0(t,n)}),t},K0=function(i){var r=i===ar,e=L0(r?Do:pl(i)),t=[];return gl(e,function(n){We(Mr,n)&&(!r||We(ar,n))&&z0(t,Mr[n])}),t};Yn||(Di=function(){if(C2(Ua,this))throw new U2("Symbol is not a constructor");var r=!arguments.length||arguments[0]===void 0?void 0:A2(arguments[0]),e=fg(r),t=function(n){var a=this===void 0?Ao:this;a===ar&&qf(t,Do,n),We(a,_t)&&We(a[_t],e)&&(a[_t][e]=!1);var o=xd(1,n);try{Ad(a,e,o)}catch(s){if(!(s instanceof W2))throw s;H0(a,e,o)}};return qn&&Cd&&Ad(ar,e,{configurable:!0,set:t}),Sh(e,r)},Ua=Di[uo],dg(Ua,"toString",function(){return vg(this).tag}),dg(Di,"withoutSetter",function(i){return Sh(fg(i),i)}),M0.f=V0,N0.f=ml,N2.f=Jf,R0.f=W0,D2.f=D0.f=U0,R2.f=K0,j2.f=function(i){return Sh(F2(i),i)},qn&&M2(Ua,"description",{configurable:!0,get:function(){return vg(this).description}}));vl({global:!0,constructor:!0,wrap:!0,forced:!Yn,sham:!Yn},{Symbol:Di});gl(A0(G2),function(i){L2(i)});vl({target:yl,stat:!0,forced:!Yn},{useSetter:function(){Cd=!0},useSimple:function(){Cd=!1}});vl({target:"Object",stat:!0,forced:!Yn,sham:!qn},{create:q2,defineProperty:ml,defineProperties:Jf,getOwnPropertyDescriptor:W0});vl({target:"Object",stat:!0,forced:!Yn},{getOwnPropertyNames:U0});z2();H2(Di,yl);B0[_t]=!0;var Y2=da,G0=Y2&&!!Symbol.for&&!!Symbol.keyFor,X2=U,J2=yt,Z2=ze,Q2=tn,q0=va,eA=G0,Oh=q0("string-to-symbol-registry"),tA=q0("symbol-to-string-registry");X2({target:"Symbol",stat:!0,forced:!eA},{for:function(i){var r=Q2(i);if(Z2(Oh,r))return Oh[r];var e=J2("Symbol")(r);return Oh[r]=e,tA[e]=r,e}});var rA=U,iA=ze,nA=Oo,aA=fa,oA=va,sA=G0,pg=oA("symbol-to-string-registry");rA({target:"Symbol",stat:!0,forced:!sA},{keyFor:function(r){if(!nA(r))throw new TypeError(aA(r)+" is not a symbol");if(iA(pg,r))return pg[r]}});var uA=me,Ro=uA([].slice),lA=me,gg=gi,hA=Oe,yg=fi,cA=tn,mg=lA([].push),dA=function(i){if(hA(i))return i;if(gg(i)){for(var r=i.length,e=[],t=0;t=r.length)return i.target=void 0,xs(void 0,!0);switch(i.kind){case"keys":return xs(e,!1);case"values":return xs(r[e],!1)}return xs([e,r[e]],!1)},"values");Ag.Arguments=Ag.Array;var UD={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},KD=UD,GD=be,qD=zr,YD=Lr,Dg=ba,XD=we,Rg=XD("toStringTag");for(var Ph in KD){var Ng=GD[Ph],xh=Ng&&Ng.prototype;xh&&qD(xh)!==Rg&&YD(xh,Rg,Ph),Dg[Ph]=Dg.Array}var JD=qA,sw=JD,ZD=we,QD=xt.f,Mg=ZD("metadata"),Bg=Function.prototype;Bg[Mg]===void 0&&QD(Bg,Mg,{value:null});var eR=Te;eR("asyncDispose");var tR=Te;tR("dispose");var rR=Te;rR("metadata");var iR=sw,nR=iR,aR=yt,oR=me,tv=aR("Symbol"),sR=tv.keyFor,uR=oR(tv.prototype.valueOf),uw=tv.isRegisteredSymbol||function(r){try{return sR(uR(r))!==void 0}catch{return!1}},lR=U,hR=uw;lR({target:"Symbol",stat:!0},{isRegisteredSymbol:hR});var cR=va,lw=yt,dR=me,fR=Oo,vR=we,xu=lw("Symbol"),Fg=xu.isWellKnownSymbol,hw=lw("Object","getOwnPropertyNames"),pR=dR(xu.prototype.valueOf),jg=cR("wks");for(var Ch=0,Lg=hw(xu),gR=Lg.length;Ch=a?i?"":void 0:(o=Hg(t,n),o<55296||o>56319||n+1===a||(s=Hg(t,n+1))<56320||s>57343?i?DR(t,n):o:i?RR(t,n,n+2):(o-55296<<10)+(s-56320)+65536)}},NR={codeAt:Vg(!1),charAt:Vg(!0)},MR=NR.charAt,BR=tn,dw=ya,FR=Qf,Wg=ev,fw="String Iterator",jR=dw.set,LR=dw.getterFor(fw);FR(String,"String",function(i){jR(this,{type:fw,string:BR(i),index:0})},function(){var r=LR(this),e=r.string,t=r.index,n;return t>=e.length?Wg(void 0,!0):(n=MR(e,t),r.index+=n.length,Wg(n,!1))});var zR=Co,HR=zR.f("iterator"),VR=HR,vw=VR,WR=vw,UR=WR,KR=UR,GR=KR,pw=GR,qR=Y(pw);function Xn(i){"@babel/helpers - typeof";return Xn=typeof An=="function"&&typeof qR=="symbol"?function(r){return typeof r}:function(r){return r&&typeof An=="function"&&r.constructor===An&&r!==An.prototype?"symbol":typeof r},Xn(i)}var YR=Co,XR=YR.f("toPrimitive"),JR=XR,ZR=JR,QR=ZR,eN=QR,tN=eN,rN=tN,iN=rN,nN=Y(iN);function aN(i,r){if(Xn(i)!=="object"||i===null)return i;var e=i[nN];if(e!==void 0){var t=e.call(i,r||"default");if(Xn(t)!=="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(i)}function gw(i){var r=aN(i,"string");return Xn(r)==="symbol"?r:String(r)}function Ug(i,r){for(var e=0;e=0:s>u;u+=l)u in o&&(n=e(n,o[u],u,a));return n}},kN={left:qg(!1),right:qg(!0)},PN=le,wl=function(i,r){var e=[][i];return!!e&&PN(function(){e.call(null,r||function(){return 1},1)})},xN=be,CN=fi,Mo=CN(xN.process)==="process",AN=U,DN=kN.left,RN=wl,Yg=ca,NN=Mo,MN=!NN&&Yg>79&&Yg<83,BN=MN||!RN("reduce");AN({target:"Array",proto:!0,forced:BN},{reduce:function(r){var e=arguments.length;return DN(this,r,e,e>1?arguments[1]:void 0)}});var FN=ut,jN=FN("Array","reduce"),LN=Le,zN=jN,Rh=Array.prototype,HN=function(i){var r=i.reduce;return i===Rh||LN(Rh,i)&&r===Rh.reduce?zN:r},VN=HN,WN=VN,UN=WN,KN=Y(UN),GN=U,qN=ma.filter,YN=Io,XN=YN("filter");GN({target:"Array",proto:!0,forced:!XN},{filter:function(r){return qN(this,r,arguments.length>1?arguments[1]:void 0)}});var JN=ut,ZN=JN("Array","filter"),QN=Le,eM=ZN,Nh=Array.prototype,tM=function(i){var r=i.filter;return i===Nh||QN(Nh,i)&&r===Nh.filter?eM:r},rM=tM,iM=rM,nM=iM,Dn=Y(nM),aM=U,oM=ma.map,sM=Io,uM=sM("map");aM({target:"Array",proto:!0,forced:!uM},{map:function(r){return oM(this,r,arguments.length>1?arguments[1]:void 0)}});var lM=ut,hM=lM("Array","map"),cM=Le,dM=hM,Mh=Array.prototype,fM=function(i){var r=i.map;return i===Mh||cM(Mh,i)&&r===Mh.map?dM:r},vM=fM,pM=vM,gM=pM,rr=Y(gM),yM=gi,mM=Lt,bM=sl,$M=pi,_w=function(i,r,e,t,n,a,o,s){for(var u=n,l=0,h=o?$M(o,s):!1,d,c;l0&&yM(d)?(c=mM(d),u=_w(i,r,d,c,u,a-1)-1):(bM(u+1),i[u]=d),u++),l++;return u},wM=_w,_M=U,EM=wM,SM=kt,OM=Pt,TM=Lt,IM=ll;_M({target:"Array",proto:!0},{flatMap:function(r){var e=OM(this),t=TM(e),n;return SM(r),n=IM(e,0),n.length=EM(n,e,e,t,0,1,r,arguments.length>1?arguments[1]:void 0),n}});var kM=ut;kM("Array","flatMap");var PM=Ge,Xg=jt,xM=Lf,Ew=function(i,r,e){var t,n;Xg(i);try{if(t=xM(i,"return"),!t){if(r==="throw")throw e;return e}t=PM(t,i)}catch(a){n=!0,t=a}if(r==="throw")throw e;if(n)throw t;return Xg(t),e},CM=jt,AM=Ew,DM=function(i,r,e,t){try{return t?r(CM(e)[0],e[1]):r(e)}catch(n){AM(i,"throw",n)}},RM=we,NM=ba,MM=RM("iterator"),BM=Array.prototype,Sw=function(i){return i!==void 0&&(NM.Array===i||BM[MM]===i)},FM=zr,Jg=Lf,jM=ha,LM=ba,zM=we,HM=zM("iterator"),_l=function(i){if(!jM(i))return Jg(i,HM)||Jg(i,"@@iterator")||LM[FM(i)]},VM=Ge,WM=kt,UM=jt,KM=fa,GM=_l,qM=TypeError,nv=function(i,r){var e=arguments.length<2?GM(i):r;if(WM(e))return UM(VM(e,i));throw new qM(KM(i)+" is not iterable")},YM=pi,XM=Ge,JM=Pt,ZM=DM,QM=Sw,eB=ul,tB=Lt,Zg=pa,rB=nv,iB=_l,Qg=Array,nB=function(r){var e=JM(r),t=eB(this),n=arguments.length,a=n>1?arguments[1]:void 0,o=a!==void 0;o&&(a=YM(a,n>2?arguments[2]:void 0));var s=iB(e),u=0,l,h,d,c,f,v;if(s&&!(this===Qg&&QM(s)))for(c=rB(e,s),f=c.next,h=t?new this:[];!(d=XM(f,c)).done;u++)v=o?ZM(c,a,[d.value,u],!0):d.value,Zg(h,u,v);else for(l=tB(e),h=t?new this(l):Qg(l);l>u;u++)v=o?a(e[u],u):e[u],Zg(h,u,v);return h.length=u,h},aB=we,Ow=aB("iterator"),Tw=!1;try{var oB=0,ey={next:function(){return{done:!!oB++}},return:function(){Tw=!0}};ey[Ow]=function(){return this},Array.from(ey,function(){throw 2})}catch{}var Iw=function(i,r){try{if(!r&&!Tw)return!1}catch{return!1}var e=!1;try{var t={};t[Ow]=function(){return{next:function(){return{done:e=!0}}}},i(t)}catch{}return e},sB=U,uB=nB,lB=Iw,hB=!lB(function(i){Array.from(i)});sB({target:"Array",stat:!0,forced:hB},{from:uB});var cB=$e,dB=cB.Array.from,fB=dB,kw=fB,vB=kw,av=Y(vB),pB=_l,gB=pB,yB=gB,mB=yB,bB=mB,$B=bB,wB=$B,_B=wB,Pw=_B,xw=Y(Pw),EB=Pw,ov=Y(EB),SB=U,OB=gi;SB({target:"Array",stat:!0},{isArray:OB});var TB=$e,IB=TB.Array.isArray,kB=IB,Cw=kB,PB=Cw,xB=PB,CB=xB,AB=CB,DB=AB,Aw=Y(DB);function RB(i){if(Aw(i))return i}var NB=Ke,MB=gi,BB=TypeError,FB=Object.getOwnPropertyDescriptor,jB=NB&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(i){return i instanceof TypeError}}(),Dw=jB?function(i,r){if(MB(i)&&!FB(i,"length").writable)throw new BB("Cannot set read only .length");return i.length=r}:function(i,r){return i.length=r},LB=U,zB=Pt,HB=Lt,VB=Dw,WB=sl,UB=le,KB=UB(function(){return[].push.call({length:4294967296},1)!==4294967297}),GB=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(i){return i instanceof TypeError}},qB=KB||!GB();LB({target:"Array",proto:!0,arity:1,forced:qB},{push:function(r){var e=zB(this),t=HB(e),n=arguments.length;WB(t+n);for(var a=0;ai.length)&&(r=i.length);for(var e=0,t=new Array(r);e1?arguments[1]:void 0)},Sj=K,iy=Ej;Sj({target:"Array",proto:!0,forced:[].forEach!==iy},{forEach:iy});var Oj=ut,Tj=Oj("Array","forEach"),Ij=Tj,kj=Ij,Pj=Lr,xj=ze,Cj=Le,Aj=kj,zh=Array.prototype,Dj={DOMTokenList:!0,NodeList:!0},Lw=function(i){var r=i.forEach;return i===zh||Cj(zh,i)&&r===zh.forEach||xj(Dj,Pj(i))?Aj:r},Rj=Lw,zi=Y(Rj),Nj=K,Mj=ye,Bj=gi,Fj=Mj([].reverse),ny=[1,2];Nj({target:"Array",proto:!0,forced:String(ny)===String(ny.reverse())},{reverse:function(){return Bj(this)&&(this.length=this.length),Fj(this)}});var jj=ut,Lj=jj("Array","reverse"),zj=Le,Hj=Lj,Hh=Array.prototype,Wj=function(i){var r=i.reverse;return i===Hh||zj(Hh,i)&&r===Hh.reverse?Hj:r},Vj=Wj,zw=Vj,Uj=zw,Kj=Y(Uj),ay=fa,Gj=TypeError,Hw=function(i,r){if(!delete i[r])throw new Gj("Cannot delete property "+ay(r)+" of "+ay(i))},qj=K,Yj=Pt,Xj=cl,Jj=ol,Zj=Lt,Qj=Dw,e3=sl,t3=ll,r3=pa,Wh=Hw,i3=Io,n3=i3("splice"),a3=Math.max,o3=Math.min;qj({target:"Array",proto:!0,forced:!n3},{splice:function(r,e){var t=Yj(this),n=Zj(t),a=Xj(r,n),o=arguments.length,s,u,l,h,d,c;for(o===0?s=u=0:o===1?(s=0,u=n-a):(s=o-2,u=o3(a3(Jj(e),0),n-a)),e3(n+s-u),l=t3(t,u),h=0;hn-u+s;h--)Wh(t,h-1)}else if(s>u)for(h=n-u;h>a;h--)d=h+u-1,c=h+s-1,d in t?t[c]=t[d]:Wh(t,c);for(h=0;ha;)for(var u=w3(arguments[a++]),l=o?_3(Uh(u),o(u)):Uh(u),h=l.length,d=0,c;h>d;)c=l[d++],(!oy||g3(s,u,c))&&(t[c]=u[c]);return t}:$n,S3=K,uy=E3;S3({target:"Object",stat:!0,arity:2,forced:Object.assign!==uy},{assign:uy});var O3=be,T3=O3.Object.assign,I3=T3,k3=I3,P3=k3,x3=Y(P3),C3=K,A3=ue,D3=Pt,Vw=bl,R3=tw,N3=A3(function(){Vw(1)});C3({target:"Object",stat:!0,forced:N3,sham:!R3},{getPrototypeOf:function(r){return Vw(D3(r))}});var M3=be,B3=M3.Object.getPrototypeOf,F3=B3,j3=F3,L3=K,z3=Ke,H3=Qi;L3({target:"Object",stat:!0,sham:!z3},{create:H3});var W3=be,V3=W3.Object,U3=function(r,e){return V3.create(r,e)},K3=U3,Uw=K3,G3=Uw,q3=Y(G3),Bd=be,Y3=la;Bd.JSON||(Bd.JSON={stringify:JSON.stringify});var X3=function(r,e,t){return Y3(Bd.JSON.stringify,null,arguments)},J3=X3,Z3=J3,Q3=Z3,eL=Y(Q3),tL=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",rL=TypeError,Kw=function(i,r){if(ie,o=nL(t)?t:lL(t),s=a?sL(arguments,e):[],u=a?function(){iL(o,this,s)}:o;return r?i(u,n):i(u)}:i},cL=K,Yw=me,dL=qw,ly=dL(Yw.setInterval,!0);cL({global:!0,bind:!0,forced:Yw.setInterval!==ly},{setInterval:ly});var fL=K,Xw=me,vL=qw,hy=vL(Xw.setTimeout,!0);fL({global:!0,bind:!0,forced:Xw.setTimeout!==hy},{setTimeout:hy});var pL=be,gL=pL.setTimeout,yL=gL,mL=Y(yL),Jw={exports:{}};(function(i){function r(t){if(t)return e(t);this._callbacks=new Map}function e(t){return Object.assign(t,r.prototype),t._callbacks=new Map,t}r.prototype.on=function(t,n){const a=this._callbacks.get(t)??[];return a.push(n),this._callbacks.set(t,a),this},r.prototype.once=function(t,n){const a=(...o)=>{this.off(t,a),n.apply(this,o)};return a.fn=n,this.on(t,a),this},r.prototype.off=function(t,n){if(t===void 0&&n===void 0)return this._callbacks.clear(),this;if(n===void 0)return this._callbacks.delete(t),this;const a=this._callbacks.get(t);if(a){for(const[o,s]of a.entries())if(s===n||s.fn===n){a.splice(o,1);break}a.length===0?this._callbacks.delete(t):this._callbacks.set(t,a)}return this},r.prototype.emit=function(t,...n){const a=this._callbacks.get(t);if(a){const o=[...a];for(const s of o)s.apply(this,n)}return this},r.prototype.listeners=function(t){return this._callbacks.get(t)??[]},r.prototype.listenerCount=function(t){if(t)return this.listeners(t).length;let n=0;for(const a of this._callbacks.values())n+=a.length;return n},r.prototype.hasListeners=function(t){return this.listenerCount(t)>0},r.prototype.addEventListener=r.prototype.on,r.prototype.removeListener=r.prototype.off,r.prototype.removeEventListener=r.prototype.off,r.prototype.removeAllListeners=r.prototype.off,i.exports=r})(Jw);var bL=Jw.exports,$L=Y(bL);/*! Hammer.JS - v2.0.17-rc - 2019-12-16 +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Et(i){return BF(i)||FF(i)||Fw(i)||jF()}var LF=sw,El=Y(LF),zF=ut,HF=zF("Array","concat"),VF=Le,WF=HF,Lh=Array.prototype,UF=function(i){var r=i.concat;return i===Lh||VF(Lh,i)&&r===Lh.concat?WF:r},KF=UF,GF=KF,qF=GF,Sl=Y(qF),YF=Nw,Ol=Y(YF),XF=yt,JF=me,ZF=Po,QF=xo,ej=jt,tj=JF([].concat),sv=XF("Reflect","ownKeys")||function(r){var e=ZF.f(ej(r)),t=QF.f;return t?tj(e,t(r)):e},rj=U,ij=sv;rj({target:"Reflect",stat:!0},{ownKeys:ij});var nj=$e,aj=nj.Reflect.ownKeys,oj=aj,sj=oj,uj=sj,lj=Y(uj),hj=Cw,Bt=Y(hj),cj=U,dj=Pt,jw=dl,fj=le,vj=fj(function(){jw(1)});cj({target:"Object",stat:!0,forced:vj},{keys:function(r){return jw(dj(r))}});var pj=$e,gj=pj.Object.keys,yj=gj,mj=yj,bj=mj,uv=Y(bj),$j=ma.forEach,wj=wl,_j=wj("forEach"),Ej=_j?[].forEach:function(r){return $j(this,r,arguments.length>1?arguments[1]:void 0)},Sj=U,iy=Ej;Sj({target:"Array",proto:!0,forced:[].forEach!==iy},{forEach:iy});var Oj=ut,Tj=Oj("Array","forEach"),Ij=Tj,kj=Ij,Pj=zr,xj=ze,Cj=Le,Aj=kj,zh=Array.prototype,Dj={DOMTokenList:!0,NodeList:!0},Lw=function(i){var r=i.forEach;return i===zh||Cj(zh,i)&&r===zh.forEach||xj(Dj,Pj(i))?Aj:r},Rj=Lw,Wi=Y(Rj),Nj=U,Mj=me,Bj=gi,Fj=Mj([].reverse),ny=[1,2];Nj({target:"Array",proto:!0,forced:String(ny)===String(ny.reverse())},{reverse:function(){return Bj(this)&&(this.length=this.length),Fj(this)}});var jj=ut,Lj=jj("Array","reverse"),zj=Le,Hj=Lj,Hh=Array.prototype,Vj=function(i){var r=i.reverse;return i===Hh||zj(Hh,i)&&r===Hh.reverse?Hj:r},Wj=Vj,zw=Wj,Uj=zw,Kj=Y(Uj),ay=fa,Gj=TypeError,Hw=function(i,r){if(!delete i[r])throw new Gj("Cannot delete property "+ay(r)+" of "+ay(i))},qj=U,Yj=Pt,Xj=cl,Jj=ol,Zj=Lt,Qj=Dw,e3=sl,t3=ll,r3=pa,Vh=Hw,i3=Io,n3=i3("splice"),a3=Math.max,o3=Math.min;qj({target:"Array",proto:!0,forced:!n3},{splice:function(r,e){var t=Yj(this),n=Zj(t),a=Xj(r,n),o=arguments.length,s,u,l,h,d,c;for(o===0?s=u=0:o===1?(s=0,u=n-a):(s=o-2,u=o3(a3(Jj(e),0),n-a)),e3(n+s-u),l=t3(t,u),h=0;hn-u+s;h--)Vh(t,h-1)}else if(s>u)for(h=n-u;h>a;h--)d=h+u-1,c=h+s-1,d in t?t[c]=t[d]:Vh(t,c);for(h=0;ha;)for(var u=w3(arguments[a++]),l=o?_3(Uh(u),o(u)):Uh(u),h=l.length,d=0,c;h>d;)c=l[d++],(!oy||g3(s,u,c))&&(t[c]=u[c]);return t}:$n,S3=U,uy=E3;S3({target:"Object",stat:!0,arity:2,forced:Object.assign!==uy},{assign:uy});var O3=$e,T3=O3.Object.assign,I3=T3,k3=I3,P3=k3,x3=Y(P3),C3=U,A3=le,D3=Pt,Ww=bl,R3=tw,N3=A3(function(){Ww(1)});C3({target:"Object",stat:!0,forced:N3,sham:!R3},{getPrototypeOf:function(r){return Ww(D3(r))}});var M3=$e,B3=M3.Object.getPrototypeOf,F3=B3,j3=F3,L3=U,z3=Ke,H3=rn;L3({target:"Object",stat:!0,sham:!z3},{create:H3});var V3=$e,W3=V3.Object,U3=function(r,e){return W3.create(r,e)},K3=U3,Uw=K3,G3=Uw,q3=Y(G3),Bd=$e,Y3=la;Bd.JSON||(Bd.JSON={stringify:JSON.stringify});var X3=function(r,e,t){return Y3(Bd.JSON.stringify,null,arguments)},J3=X3,Z3=J3,Q3=Z3,eL=Y(Q3),tL=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",rL=TypeError,Kw=function(i,r){if(ie,o=nL(t)?t:lL(t),s=a?sL(arguments,e):[],u=a?function(){iL(o,this,s)}:o;return r?i(u,n):i(u)}:i},cL=U,Yw=be,dL=qw,ly=dL(Yw.setInterval,!0);cL({global:!0,bind:!0,forced:Yw.setInterval!==ly},{setInterval:ly});var fL=U,Xw=be,vL=qw,hy=vL(Xw.setTimeout,!0);fL({global:!0,bind:!0,forced:Xw.setTimeout!==hy},{setTimeout:hy});var pL=$e,gL=pL.setTimeout,yL=gL,mL=Y(yL),Jw={exports:{}};(function(i){function r(t){if(t)return e(t);this._callbacks=new Map}function e(t){return Object.assign(t,r.prototype),t._callbacks=new Map,t}r.prototype.on=function(t,n){const a=this._callbacks.get(t)??[];return a.push(n),this._callbacks.set(t,a),this},r.prototype.once=function(t,n){const a=(...o)=>{this.off(t,a),n.apply(this,o)};return a.fn=n,this.on(t,a),this},r.prototype.off=function(t,n){if(t===void 0&&n===void 0)return this._callbacks.clear(),this;if(n===void 0)return this._callbacks.delete(t),this;const a=this._callbacks.get(t);if(a){for(const[o,s]of a.entries())if(s===n||s.fn===n){a.splice(o,1);break}a.length===0?this._callbacks.delete(t):this._callbacks.set(t,a)}return this},r.prototype.emit=function(t,...n){const a=this._callbacks.get(t);if(a){const o=[...a];for(const s of o)s.apply(this,n)}return this},r.prototype.listeners=function(t){return this._callbacks.get(t)??[]},r.prototype.listenerCount=function(t){if(t)return this.listeners(t).length;let n=0;for(const a of this._callbacks.values())n+=a.length;return n},r.prototype.hasListeners=function(t){return this.listenerCount(t)>0},r.prototype.addEventListener=r.prototype.on,r.prototype.removeListener=r.prototype.off,r.prototype.removeEventListener=r.prototype.off,r.prototype.removeAllListeners=r.prototype.off,i.exports=r})(Jw);var bL=Jw.exports,$L=Y(bL);/*! Hammer.JS - v2.0.17-rc - 2019-12-16 * http://naver.github.io/egjs * * Forked By Naver egjs * Copyright (c) hammerjs - * Licensed under the MIT license */function sr(){return sr=Object.assign||function(i){for(var r=1;r"u"?{style:{}}:document.createElement("div"),_L="function",Rn=Math.round,Wi=Math.abs,lv=Date.now;function Tl(i,r){for(var e,t,n=r[0].toUpperCase()+r.slice(1),a=0;a"u"?Ir={}:Ir=window;var Zw=Tl(wL.style,"touchAction"),Qw=Zw!==void 0;function EL(){if(!Qw)return!1;var i={},r=Ir.CSS&&Ir.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(e){return i[e]=r?Ir.CSS.supports("touch-action",e):!0}),i}var e_="compute",t_="auto",jd="manipulation",Ai="none",lo="pan-x",ho="pan-y",As=EL(),SL=/mobile|tablet|ip(ad|hone|od)|android/i,r_="ontouchstart"in Ir,OL=Tl(Ir,"PointerEvent")!==void 0,TL=r_&&SL.test(navigator.userAgent),Bo="touch",IL="pen",hv="mouse",kL="kinect",PL=25,pt=1,tn=2,Be=4,Tt=8,Cu=1,Fo=2,jo=4,Lo=8,Jn=16,gr=Fo|jo,Di=Lo|Jn,i_=gr|Di,n_=["x","y"],Au=["clientX","clientY"];function kr(i,r,e){var t;if(i)if(i.forEach)i.forEach(r,e);else if(i.length!==void 0)for(t=0;t-1}function xL(i){if(Ii(i,Ai))return Ai;var r=Ii(i,lo),e=Ii(i,ho);return r&&e?Ai:r||e?r?lo:ho:Ii(i,jd)?jd:t_}var a_=function(){function i(e,t){this.manager=e,this.set(t)}var r=i.prototype;return r.set=function(t){t===e_&&(t=this.compute()),Qw&&this.manager.element.style&&As[t]&&(this.manager.element.style[Zw]=t),this.actions=t.toLowerCase().trim()},r.update=function(){this.set(this.manager.options.touchAction)},r.compute=function(){var t=[];return kr(this.manager.recognizers,function(n){Il(n.options.enable,[n])&&(t=t.concat(n.getTouchAction()))}),xL(t.join(" "))},r.preventDefaults=function(t){var n=t.srcEvent,a=t.offsetDirection;if(this.manager.session.prevented){n.preventDefault();return}var o=this.actions,s=Ii(o,Ai)&&!As[Ai],u=Ii(o,ho)&&!As[ho],l=Ii(o,lo)&&!As[lo];if(s){var h=t.pointers.length===1,d=t.distance<2,c=t.deltaTime<250;if(h&&d&&c)return}if(!(l&&u)&&(s||u&&a&gr||l&&a&Di))return this.preventSrc(n)},r.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},i}();function cv(i,r){for(;i;){if(i===r)return!0;i=i.parentNode}return!1}function o_(i){var r=i.length;if(r===1)return{x:Rn(i[0].clientX),y:Rn(i[0].clientY)};for(var e=0,t=0,n=0;n=Wi(r)?i<0?Fo:jo:r<0?Lo:Jn}function CL(i,r){var e=r.center,t=i.offsetDelta||{},n=i.prevDelta||{},a=i.prevInput||{};(r.eventType===pt||a.eventType===Be)&&(n=i.prevDelta={x:a.deltaX||0,y:a.deltaY||0},t=i.offsetDelta={x:e.x,y:e.y}),r.deltaX=n.x+(e.x-t.x),r.deltaY=n.y+(e.y-t.y)}function u_(i,r,e){return{x:r/i||0,y:e/i||0}}function AL(i,r){return Du(r[0],r[1],Au)/Du(i[0],i[1],Au)}function DL(i,r){return Ld(r[1],r[0],Au)+Ld(i[1],i[0],Au)}function RL(i,r){var e=i.lastInterval||r,t=r.timeStamp-e.timeStamp,n,a,o,s;if(r.eventType!==Tt&&(t>PL||e.velocity===void 0)){var u=r.deltaX-e.deltaX,l=r.deltaY-e.deltaY,h=u_(t,u,l);a=h.x,o=h.y,n=Wi(h.x)>Wi(h.y)?h.x:h.y,s=s_(u,l),i.lastInterval=r}else n=e.velocity,a=e.velocityX,o=e.velocityY,s=e.direction;r.velocity=n,r.velocityX=a,r.velocityY=o,r.direction=s}function NL(i,r){var e=i.session,t=r.pointers,n=t.length;e.firstInput||(e.firstInput=dy(r)),n>1&&!e.firstMultiple?e.firstMultiple=dy(r):n===1&&(e.firstMultiple=!1);var a=e.firstInput,o=e.firstMultiple,s=o?o.center:a.center,u=r.center=o_(t);r.timeStamp=lv(),r.deltaTime=r.timeStamp-a.timeStamp,r.angle=Ld(s,u),r.distance=Du(s,u),CL(e,r),r.offsetDirection=s_(r.deltaX,r.deltaY);var l=u_(r.deltaTime,r.deltaX,r.deltaY);r.overallVelocityX=l.x,r.overallVelocityY=l.y,r.overallVelocity=Wi(l.x)>Wi(l.y)?l.x:l.y,r.scale=o?AL(o.pointers,t):1,r.rotation=o?DL(o.pointers,t):0,r.maxPointers=e.prevInput?r.pointers.length>e.prevInput.maxPointers?r.pointers.length:e.prevInput.maxPointers:r.pointers.length,RL(e,r);var h=i.element,d=r.srcEvent,c;d.composedPath?c=d.composedPath()[0]:d.path?c=d.path[0]:c=d.target,cv(c,h)&&(h=c),r.target=h}function ML(i,r,e){var t=e.pointers.length,n=e.changedPointers.length,a=r&pt&&t-n===0,o=r&(Be|Tt)&&t-n===0;e.isFirst=!!a,e.isFinal=!!o,a&&(i.session={}),e.eventType=r,NL(i,e),i.emit("hammer.input",e),i.recognize(e),i.session.prevInput=e}function co(i){return i.trim().split(/\s+/g)}function Ya(i,r,e){kr(co(r),function(t){i.addEventListener(t,e,!1)})}function Xa(i,r,e){kr(co(r),function(t){i.removeEventListener(t,e,!1)})}function fy(i){var r=i.ownerDocument||i;return r.defaultView||r.parentWindow||window}var $a=function(){function i(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(a){Il(e.options.enable,[e])&&n.handler(a)},this.init()}var r=i.prototype;return r.handler=function(){},r.init=function(){this.evEl&&Ya(this.element,this.evEl,this.domHandler),this.evTarget&&Ya(this.target,this.evTarget,this.domHandler),this.evWin&&Ya(fy(this.element),this.evWin,this.domHandler)},r.destroy=function(){this.evEl&&Xa(this.element,this.evEl,this.domHandler),this.evTarget&&Xa(this.target,this.evTarget,this.domHandler),this.evWin&&Xa(fy(this.element),this.evWin,this.domHandler)},i}();function Vi(i,r,e){if(i.indexOf&&!e)return i.indexOf(r);for(var t=0;tu[r]}):t=t.sort()),t}var jL={touchstart:pt,touchmove:tn,touchend:Be,touchcancel:Tt},LL="touchstart touchmove touchend touchcancel",fv=function(i){Xt(r,i);function r(){var t;return r.prototype.evTarget=LL,t=i.apply(this,arguments)||this,t.targetIds={},t}var e=r.prototype;return e.handler=function(n){var a=jL[n.type],o=zL.call(this,n,a);o&&this.callback(this.manager,a,{pointers:o[0],changedPointers:o[1],pointerType:Bo,srcEvent:n})},r}($a);function zL(i,r){var e=fo(i.touches),t=this.targetIds;if(r&(pt|tn)&&e.length===1)return t[e[0].identifier]=!0,[e,e];var n,a,o=fo(i.changedTouches),s=[],u=this.target;if(a=e.filter(function(l){return cv(l.target,u)}),r===pt)for(n=0;n-1&&n.splice(s,1)};setTimeout(a,UL)}}function KL(i,r){i&pt?(this.primaryTouch=r.changedPointers[0].identifier,py.call(this,r)):i&(Be|Tt)&&py.call(this,r)}function GL(i){for(var r=i.srcEvent.clientX,e=i.srcEvent.clientY,t=0;t-1&&this.requireFail.splice(n,1),this},r.hasRequireFailures=function(){return this.requireFail.length>0},r.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},r.emit=function(t){var n=this,a=this.state;function o(s){n.manager.emit(s,t)}a=ni&&o(n.options.event+gy(a))},r.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=fr},r.canEmit=function(){for(var t=0;ta.threshold&&u&a.direction},e.attrTest=function(n){return Qn.prototype.attrTest.call(this,n)&&(this.state&qt||!(this.state&qt)&&this.directionTest(n))},e.emit=function(n){this.pX=n.deltaX,this.pY=n.deltaY;var a=f_(n.direction);a&&(n.additionalEvent=this.options.event+a),i.prototype.emit.call(this,n)},r}(Qn),v_=function(i){Xt(r,i);function r(t){return t===void 0&&(t={}),i.call(this,sr({event:"swipe",threshold:10,velocity:.3,direction:gr|Di,pointers:1},t))||this}var e=r.prototype;return e.getTouchAction=function(){return pv.prototype.getTouchAction.call(this)},e.attrTest=function(n){var a=this.options.direction,o;return a&(gr|Di)?o=n.overallVelocity:a&gr?o=n.overallVelocityX:a&Di&&(o=n.overallVelocityY),i.prototype.attrTest.call(this,n)&&a&n.offsetDirection&&n.distance>this.options.threshold&&n.maxPointers===this.options.pointers&&Wi(o)>this.options.velocity&&n.eventType&Be},e.emit=function(n){var a=f_(n.offsetDirection);a&&this.manager.emit(this.options.event+a,n),this.manager.emit(this.options.event,n)},r}(Qn),p_=function(i){Xt(r,i);function r(t){return t===void 0&&(t={}),i.call(this,sr({event:"pinch",threshold:0,pointers:2},t))||this}var e=r.prototype;return e.getTouchAction=function(){return[Ai]},e.attrTest=function(n){return i.prototype.attrTest.call(this,n)&&(Math.abs(n.scale-1)>this.options.threshold||this.state&qt)},e.emit=function(n){if(n.scale!==1){var a=n.scale<1?"in":"out";n.additionalEvent=this.options.event+a}i.prototype.emit.call(this,n)},r}(Qn),g_=function(i){Xt(r,i);function r(t){return t===void 0&&(t={}),i.call(this,sr({event:"rotate",threshold:0,pointers:2},t))||this}var e=r.prototype;return e.getTouchAction=function(){return[Ai]},e.attrTest=function(n){return i.prototype.attrTest.call(this,n)&&(Math.abs(n.rotation)>this.options.threshold||this.state&qt)},r}(Qn),y_=function(i){Xt(r,i);function r(t){var n;return t===void 0&&(t={}),n=i.call(this,sr({event:"press",pointers:1,time:251,threshold:9},t))||this,n._timer=null,n._input=null,n}var e=r.prototype;return e.getTouchAction=function(){return[t_]},e.process=function(n){var a=this,o=this.options,s=n.pointers.length===o.pointers,u=n.distanceo.time;if(this._input=n,!u||!s||n.eventType&(Be|Tt)&&!l)this.reset();else if(n.eventType&pt)this.reset(),this._timer=setTimeout(function(){a.state=Pr,a.tryEmit()},o.time);else if(n.eventType&Be)return Pr;return fr},e.reset=function(){clearTimeout(this._timer)},e.emit=function(n){this.state===Pr&&(n&&n.eventType&Be?this.manager.emit(this.options.event+"up",n):(this._input.timeStamp=lv(),this.manager.emit(this.options.event,this._input)))},r}(zo),m_={domEvents:!1,touchAction:e_,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},yy=[[g_,{enable:!1}],[p_,{enable:!1},["rotate"]],[v_,{direction:gr}],[pv,{direction:gr},["swipe"]],[zd],[zd,{event:"doubletap",taps:2},["tap"]],[y_]],JL=1,my=2;function by(i,r){var e=i.element;if(e.style){var t;kr(i.options.cssProps,function(n,a){t=Tl(e.style,a),r?(i.oldCssProps[t]=e.style[t],e.style[t]=n):e.style[t]=i.oldCssProps[t]||""}),r||(i.oldCssProps={})}}function ZL(i,r){var e=document.createEvent("Event");e.initEvent(i,!0,!0),e.gesture=r,r.target.dispatchEvent(e)}var $y=function(){function i(e,t){var n=this;this.options=Hi({},m_,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=qL(this),this.touchAction=new a_(this,this.options.touchAction),by(this,!0),kr(this.options.recognizers,function(a){var o=n.add(new a[0](a[1]));a[2]&&o.recognizeWith(a[2]),a[3]&&o.requireFailure(a[3])},this)}var r=i.prototype;return r.set=function(t){return Hi(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},r.stop=function(t){this.session.stopped=t?my:JL},r.recognize=function(t){var n=this.session;if(!n.stopped){this.touchAction.preventDefaults(t);var a,o=this.recognizers,s=n.curRecognizer;(!s||s&&s.state&Pr)&&(n.curRecognizer=null,s=null);for(var u=0;u"u"?{style:{}}:document.createElement("div"),_L="function",Rn=Math.round,Ki=Math.abs,lv=Date.now;function Tl(i,r){for(var e,t,n=r[0].toUpperCase()+r.slice(1),a=0;a"u"?kr={}:kr=window;var Zw=Tl(wL.style,"touchAction"),Qw=Zw!==void 0;function EL(){if(!Qw)return!1;var i={},r=kr.CSS&&kr.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(e){return i[e]=r?kr.CSS.supports("touch-action",e):!0}),i}var e_="compute",t_="auto",jd="manipulation",Ni="none",lo="pan-x",ho="pan-y",As=EL(),SL=/mobile|tablet|ip(ad|hone|od)|android/i,r_="ontouchstart"in kr,OL=Tl(kr,"PointerEvent")!==void 0,TL=r_&&SL.test(navigator.userAgent),Bo="touch",IL="pen",hv="mouse",kL="kinect",PL=25,pt=1,an=2,Be=4,Tt=8,Cu=1,Fo=2,jo=4,Lo=8,Jn=16,gr=Fo|jo,Mi=Lo|Jn,i_=gr|Mi,n_=["x","y"],Au=["clientX","clientY"];function Pr(i,r,e){var t;if(i)if(i.forEach)i.forEach(r,e);else if(i.length!==void 0)for(t=0;t-1}function xL(i){if(xi(i,Ni))return Ni;var r=xi(i,lo),e=xi(i,ho);return r&&e?Ni:r||e?r?lo:ho:xi(i,jd)?jd:t_}var a_=function(){function i(e,t){this.manager=e,this.set(t)}var r=i.prototype;return r.set=function(t){t===e_&&(t=this.compute()),Qw&&this.manager.element.style&&As[t]&&(this.manager.element.style[Zw]=t),this.actions=t.toLowerCase().trim()},r.update=function(){this.set(this.manager.options.touchAction)},r.compute=function(){var t=[];return Pr(this.manager.recognizers,function(n){Il(n.options.enable,[n])&&(t=t.concat(n.getTouchAction()))}),xL(t.join(" "))},r.preventDefaults=function(t){var n=t.srcEvent,a=t.offsetDirection;if(this.manager.session.prevented){n.preventDefault();return}var o=this.actions,s=xi(o,Ni)&&!As[Ni],u=xi(o,ho)&&!As[ho],l=xi(o,lo)&&!As[lo];if(s){var h=t.pointers.length===1,d=t.distance<2,c=t.deltaTime<250;if(h&&d&&c)return}if(!(l&&u)&&(s||u&&a&gr||l&&a&Mi))return this.preventSrc(n)},r.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},i}();function cv(i,r){for(;i;){if(i===r)return!0;i=i.parentNode}return!1}function o_(i){var r=i.length;if(r===1)return{x:Rn(i[0].clientX),y:Rn(i[0].clientY)};for(var e=0,t=0,n=0;n=Ki(r)?i<0?Fo:jo:r<0?Lo:Jn}function CL(i,r){var e=r.center,t=i.offsetDelta||{},n=i.prevDelta||{},a=i.prevInput||{};(r.eventType===pt||a.eventType===Be)&&(n=i.prevDelta={x:a.deltaX||0,y:a.deltaY||0},t=i.offsetDelta={x:e.x,y:e.y}),r.deltaX=n.x+(e.x-t.x),r.deltaY=n.y+(e.y-t.y)}function u_(i,r,e){return{x:r/i||0,y:e/i||0}}function AL(i,r){return Du(r[0],r[1],Au)/Du(i[0],i[1],Au)}function DL(i,r){return Ld(r[1],r[0],Au)+Ld(i[1],i[0],Au)}function RL(i,r){var e=i.lastInterval||r,t=r.timeStamp-e.timeStamp,n,a,o,s;if(r.eventType!==Tt&&(t>PL||e.velocity===void 0)){var u=r.deltaX-e.deltaX,l=r.deltaY-e.deltaY,h=u_(t,u,l);a=h.x,o=h.y,n=Ki(h.x)>Ki(h.y)?h.x:h.y,s=s_(u,l),i.lastInterval=r}else n=e.velocity,a=e.velocityX,o=e.velocityY,s=e.direction;r.velocity=n,r.velocityX=a,r.velocityY=o,r.direction=s}function NL(i,r){var e=i.session,t=r.pointers,n=t.length;e.firstInput||(e.firstInput=dy(r)),n>1&&!e.firstMultiple?e.firstMultiple=dy(r):n===1&&(e.firstMultiple=!1);var a=e.firstInput,o=e.firstMultiple,s=o?o.center:a.center,u=r.center=o_(t);r.timeStamp=lv(),r.deltaTime=r.timeStamp-a.timeStamp,r.angle=Ld(s,u),r.distance=Du(s,u),CL(e,r),r.offsetDirection=s_(r.deltaX,r.deltaY);var l=u_(r.deltaTime,r.deltaX,r.deltaY);r.overallVelocityX=l.x,r.overallVelocityY=l.y,r.overallVelocity=Ki(l.x)>Ki(l.y)?l.x:l.y,r.scale=o?AL(o.pointers,t):1,r.rotation=o?DL(o.pointers,t):0,r.maxPointers=e.prevInput?r.pointers.length>e.prevInput.maxPointers?r.pointers.length:e.prevInput.maxPointers:r.pointers.length,RL(e,r);var h=i.element,d=r.srcEvent,c;d.composedPath?c=d.composedPath()[0]:d.path?c=d.path[0]:c=d.target,cv(c,h)&&(h=c),r.target=h}function ML(i,r,e){var t=e.pointers.length,n=e.changedPointers.length,a=r&pt&&t-n===0,o=r&(Be|Tt)&&t-n===0;e.isFirst=!!a,e.isFinal=!!o,a&&(i.session={}),e.eventType=r,NL(i,e),i.emit("hammer.input",e),i.recognize(e),i.session.prevInput=e}function co(i){return i.trim().split(/\s+/g)}function Ya(i,r,e){Pr(co(r),function(t){i.addEventListener(t,e,!1)})}function Xa(i,r,e){Pr(co(r),function(t){i.removeEventListener(t,e,!1)})}function fy(i){var r=i.ownerDocument||i;return r.defaultView||r.parentWindow||window}var $a=function(){function i(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(a){Il(e.options.enable,[e])&&n.handler(a)},this.init()}var r=i.prototype;return r.handler=function(){},r.init=function(){this.evEl&&Ya(this.element,this.evEl,this.domHandler),this.evTarget&&Ya(this.target,this.evTarget,this.domHandler),this.evWin&&Ya(fy(this.element),this.evWin,this.domHandler)},r.destroy=function(){this.evEl&&Xa(this.element,this.evEl,this.domHandler),this.evTarget&&Xa(this.target,this.evTarget,this.domHandler),this.evWin&&Xa(fy(this.element),this.evWin,this.domHandler)},i}();function Gi(i,r,e){if(i.indexOf&&!e)return i.indexOf(r);for(var t=0;tu[r]}):t=t.sort()),t}var jL={touchstart:pt,touchmove:an,touchend:Be,touchcancel:Tt},LL="touchstart touchmove touchend touchcancel",fv=function(i){Xt(r,i);function r(){var t;return r.prototype.evTarget=LL,t=i.apply(this,arguments)||this,t.targetIds={},t}var e=r.prototype;return e.handler=function(n){var a=jL[n.type],o=zL.call(this,n,a);o&&this.callback(this.manager,a,{pointers:o[0],changedPointers:o[1],pointerType:Bo,srcEvent:n})},r}($a);function zL(i,r){var e=fo(i.touches),t=this.targetIds;if(r&(pt|an)&&e.length===1)return t[e[0].identifier]=!0,[e,e];var n,a,o=fo(i.changedTouches),s=[],u=this.target;if(a=e.filter(function(l){return cv(l.target,u)}),r===pt)for(n=0;n-1&&n.splice(s,1)};setTimeout(a,UL)}}function KL(i,r){i&pt?(this.primaryTouch=r.changedPointers[0].identifier,py.call(this,r)):i&(Be|Tt)&&py.call(this,r)}function GL(i){for(var r=i.srcEvent.clientX,e=i.srcEvent.clientY,t=0;t-1&&this.requireFail.splice(n,1),this},r.hasRequireFailures=function(){return this.requireFail.length>0},r.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},r.emit=function(t){var n=this,a=this.state;function o(s){n.manager.emit(s,t)}a=ni&&o(n.options.event+gy(a))},r.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=fr},r.canEmit=function(){for(var t=0;ta.threshold&&u&a.direction},e.attrTest=function(n){return Qn.prototype.attrTest.call(this,n)&&(this.state&qt||!(this.state&qt)&&this.directionTest(n))},e.emit=function(n){this.pX=n.deltaX,this.pY=n.deltaY;var a=f_(n.direction);a&&(n.additionalEvent=this.options.event+a),i.prototype.emit.call(this,n)},r}(Qn),v_=function(i){Xt(r,i);function r(t){return t===void 0&&(t={}),i.call(this,sr({event:"swipe",threshold:10,velocity:.3,direction:gr|Mi,pointers:1},t))||this}var e=r.prototype;return e.getTouchAction=function(){return pv.prototype.getTouchAction.call(this)},e.attrTest=function(n){var a=this.options.direction,o;return a&(gr|Mi)?o=n.overallVelocity:a&gr?o=n.overallVelocityX:a&Mi&&(o=n.overallVelocityY),i.prototype.attrTest.call(this,n)&&a&n.offsetDirection&&n.distance>this.options.threshold&&n.maxPointers===this.options.pointers&&Ki(o)>this.options.velocity&&n.eventType&Be},e.emit=function(n){var a=f_(n.offsetDirection);a&&this.manager.emit(this.options.event+a,n),this.manager.emit(this.options.event,n)},r}(Qn),p_=function(i){Xt(r,i);function r(t){return t===void 0&&(t={}),i.call(this,sr({event:"pinch",threshold:0,pointers:2},t))||this}var e=r.prototype;return e.getTouchAction=function(){return[Ni]},e.attrTest=function(n){return i.prototype.attrTest.call(this,n)&&(Math.abs(n.scale-1)>this.options.threshold||this.state&qt)},e.emit=function(n){if(n.scale!==1){var a=n.scale<1?"in":"out";n.additionalEvent=this.options.event+a}i.prototype.emit.call(this,n)},r}(Qn),g_=function(i){Xt(r,i);function r(t){return t===void 0&&(t={}),i.call(this,sr({event:"rotate",threshold:0,pointers:2},t))||this}var e=r.prototype;return e.getTouchAction=function(){return[Ni]},e.attrTest=function(n){return i.prototype.attrTest.call(this,n)&&(Math.abs(n.rotation)>this.options.threshold||this.state&qt)},r}(Qn),y_=function(i){Xt(r,i);function r(t){var n;return t===void 0&&(t={}),n=i.call(this,sr({event:"press",pointers:1,time:251,threshold:9},t))||this,n._timer=null,n._input=null,n}var e=r.prototype;return e.getTouchAction=function(){return[t_]},e.process=function(n){var a=this,o=this.options,s=n.pointers.length===o.pointers,u=n.distanceo.time;if(this._input=n,!u||!s||n.eventType&(Be|Tt)&&!l)this.reset();else if(n.eventType&pt)this.reset(),this._timer=setTimeout(function(){a.state=xr,a.tryEmit()},o.time);else if(n.eventType&Be)return xr;return fr},e.reset=function(){clearTimeout(this._timer)},e.emit=function(n){this.state===xr&&(n&&n.eventType&Be?this.manager.emit(this.options.event+"up",n):(this._input.timeStamp=lv(),this.manager.emit(this.options.event,this._input)))},r}(zo),m_={domEvents:!1,touchAction:e_,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},yy=[[g_,{enable:!1}],[p_,{enable:!1},["rotate"]],[v_,{direction:gr}],[pv,{direction:gr},["swipe"]],[zd],[zd,{event:"doubletap",taps:2},["tap"]],[y_]],JL=1,my=2;function by(i,r){var e=i.element;if(e.style){var t;Pr(i.options.cssProps,function(n,a){t=Tl(e.style,a),r?(i.oldCssProps[t]=e.style[t],e.style[t]=n):e.style[t]=i.oldCssProps[t]||""}),r||(i.oldCssProps={})}}function ZL(i,r){var e=document.createEvent("Event");e.initEvent(i,!0,!0),e.gesture=r,r.target.dispatchEvent(e)}var $y=function(){function i(e,t){var n=this;this.options=Ui({},m_,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=qL(this),this.touchAction=new a_(this,this.options.touchAction),by(this,!0),Pr(this.options.recognizers,function(a){var o=n.add(new a[0](a[1]));a[2]&&o.recognizeWith(a[2]),a[3]&&o.requireFailure(a[3])},this)}var r=i.prototype;return r.set=function(t){return Ui(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},r.stop=function(t){this.session.stopped=t?my:JL},r.recognize=function(t){var n=this.session;if(!n.stopped){this.touchAction.preventDefaults(t);var a,o=this.recognizers,s=n.curRecognizer;(!s||s&&s.state&xr)&&(n.curRecognizer=null,s=null);for(var u=0;u\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=window.console&&(window.console.warn||window.console.log);return o&&o.call(window.console,t,a),i.apply(this,arguments)}}var $_=b_(function(i,r,e){for(var t=Object.keys(r),n=0;n=i.length?{done:!0}:{done:!1,value:i[t++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(i)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function u5(i,r){var e;if(i){if(typeof i=="string")return _y(i,r);var t=Ol(e=Object.prototype.toString.call(i)).call(e,8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return av(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _y(i,r)}}function _y(i,r){(r==null||r>i.length)&&(r=i.length);for(var e=0,t=new Array(r);e1?e-1:0),n=1;n2){var t;return Ru.apply(void 0,Sl(t=[E_(r[0],r[1])]).call(t,Et(Ol(r).call(r,2))))}var n=r[0],a=r[1];if(n instanceof Date&&a instanceof Date)return n.setTime(a.getTime()),n;var o=w_(lj(a)),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;Object.prototype.propertyIsEnumerable.call(a,u)&&(a[u]===__?delete n[u]:n[u]!==null&&a[u]!==null&&typeof n[u]=="object"&&typeof a[u]=="object"&&!Bt(n[u])&&!Bt(a[u])?n[u]=Ru(n[u],a[u]):n[u]=S_(a[u]))}}catch(l){o.e(l)}finally{o.f()}return n}function S_(i){return Bt(i)?rr(i).call(i,function(r){return S_(r)}):typeof i=="object"&&i!==null?i instanceof Date?new Date(i.getTime()):Ru({},i):i}function O_(i){for(var r=0,e=uv(i);ro;)u=t(e,s=n[o++]),u!==void 0&&q5(a,s,u);return a}});var Y5=be,X5=Y5.Object.getOwnPropertyDescriptors,J5=X5,Z5=J5,Q5=Z5,Iy=Y(Q5),N_={exports:{}},ez=K,tz=Ke,ky=hl.f;ez({target:"Object",stat:!0,forced:Object.defineProperties!==ky,sham:!tz},{defineProperties:ky});var rz=be,M_=rz.Object,iz=N_.exports=function(r,e){return M_.defineProperties(r,e)};M_.defineProperties.sham&&(iz.sham=!0);var nz=N_.exports,az=nz,oz=az,sz=oz,uz=Y(sz),lz=v0,hz=Y(lz);function B_(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}var cz=Uw,dz=cz,fz=dz,vz=fz,F_=vz,pz=Y(F_),gz=K,yz=nw;gz({target:"Object",stat:!0},{setPrototypeOf:yz});var mz=be,bz=mz.Object.setPrototypeOf,$z=bz,wz=$z,_z=wz,Ez=_z,Sz=Ez,Oz=Sz,j_=Oz,Hd=Y(j_),Tz=$w,Iz=Tz,kz=Iz,Pz=kz,xz=Pz,L_=Y(xz);function Wd(i,r){var e;return Wd=Hd?L_(e=Hd).call(e):function(n,a){return n.__proto__=a,n},Wd(i,r)}function Cz(i,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=pz(r.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),al(i,"prototype",{writable:!1}),Wd(i,r)}function Az(i,r){if(r&&(Xn(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return B_(i)}var Dz=j3,Rz=Dz,Nz=Rz,Mz=Nz,z_=Mz,Py=Y(z_);function Nu(i){var r;return Nu=Hd?L_(r=Py).call(r):function(t){return t.__proto__||Py(t)},Nu(i)}var H_={exports:{}},W_={exports:{}};(function(i){var r=rv,e=pw;function t(n){"@babel/helpers - typeof";return i.exports=t=typeof r=="function"&&typeof e=="symbol"?function(a){return typeof a}:function(a){return a&&typeof r=="function"&&a.constructor===r&&a!==r.prototype?"symbol":typeof a},i.exports.__esModule=!0,i.exports.default=i.exports,t(n)}i.exports=t,i.exports.__esModule=!0,i.exports.default=i.exports})(W_);var Bz=W_.exports,Fz=Lw,jz=Fz,Lz=jz,zz=Lz,Hz=zz,xy=ze,Wz=sv,Vz=Xi,Uz=xt,Kz=function(i,r,e){for(var t=Wz(r),n=Uz.f,a=Vz.f,o=0;od;d++)if(f=y(i[d]),f&&Ay(Ry,f))return f;return new du(!1)}l=v4(i,h)}for(v=a?i.next:l.next;!(p=l4(v,l)).done;){try{f=y(p.value)}catch(m){Dy(l,"throw",m)}if(typeof f=="object"&&f&&Ay(Ry,f))return f}return new du(!1)},y4=Zi,m4=function(i,r){return i===void 0?arguments.length<2?"":r:y4(i)},b4=K,$4=Le,w4=bl,Mu=nw,_4=Kz,K_=Qi,Gh=jr,qh=Ji,E4=Yz,S4=s4,O4=rn,T4=m4,I4=we,k4=I4("toStringTag"),Bu=Error,P4=[].push,ea=function(r,e){var t=$4(Yh,this),n;Mu?n=Mu(new Bu,t?w4(this):Yh):(n=t?this:K_(Yh),Gh(n,k4,"Error")),e!==void 0&&Gh(n,"message",T4(e)),S4(n,ea,n.stack,1),arguments.length>2&&E4(n,arguments[2]);var a=[];return O4(r,P4,{that:a}),Gh(n,"errors",a),n};Mu?Mu(ea,Bu):_4(ea,Bu,{name:!0});var Yh=ea.prototype=K_(Bu.prototype,{constructor:qh(1,ea),message:qh(1,""),name:qh(1,"AggregateError")});b4({global:!0,constructor:!0,arity:2},{AggregateError:ea});var x4=yt,C4=Gf,A4=we,D4=Ke,Ny=A4("species"),G_=function(i){var r=x4(i);D4&&r&&!r[Ny]&&C4(r,Ny,{configurable:!0,get:function(){return this}})},R4=Le,N4=TypeError,yv=function(i,r){if(R4(r,i))return i;throw new N4("Incorrect invocation")},My=jt,M4=T_,B4=ha,F4=we,j4=F4("species"),q_=function(i,r){var e=My(i).constructor,t;return e===void 0||B4(t=My(e)[j4])?r:M4(t)},L4=vi,Y_=/(?:ipad|iphone|ipod).*applewebkit/i.test(L4),Ft=me,z4=la,H4=pi,By=Oe,W4=ze,X_=ue,Fy=S0,V4=Ro,jy=Hf,U4=Kw,K4=Y_,G4=Mo,Vd=Ft.setImmediate,Ud=Ft.clearImmediate,q4=Ft.process,Xh=Ft.Dispatch,Y4=Ft.Function,Ly=Ft.MessageChannel,X4=Ft.String,Jh=0,Ja={},zy="onreadystatechange",po,Si,Zh,Qh;X_(function(){po=Ft.location});var mv=function(i){if(W4(Ja,i)){var r=Ja[i];delete Ja[i],r()}},ec=function(i){return function(){mv(i)}},Hy=function(i){mv(i.data)},Wy=function(i){Ft.postMessage(X4(i),po.protocol+"//"+po.host)};(!Vd||!Ud)&&(Vd=function(r){U4(arguments.length,1);var e=By(r)?r:Y4(r),t=V4(arguments,1);return Ja[++Jh]=function(){z4(e,void 0,t)},Si(Jh),Jh},Ud=function(r){delete Ja[r]},G4?Si=function(i){q4.nextTick(ec(i))}:Xh&&Xh.now?Si=function(i){Xh.now(ec(i))}:Ly&&!K4?(Zh=new Ly,Qh=Zh.port2,Zh.port1.onmessage=Hy,Si=H4(Qh.postMessage,Qh)):Ft.addEventListener&&By(Ft.postMessage)&&!Ft.importScripts&&po&&po.protocol!=="file:"&&!X_(Wy)?(Si=Wy,Ft.addEventListener("message",Hy,!1)):zy in jy("script")?Si=function(i){Fy.appendChild(jy("script"))[zy]=function(){Fy.removeChild(this),mv(i)}}:Si=function(i){setTimeout(ec(i),0)});var J_={set:Vd,clear:Ud},Z_=function(){this.head=null,this.tail=null};Z_.prototype={add:function(i){var r={item:i,next:null},e=this.tail;e?e.next=r:this.head=r,this.tail=r},get:function(){var i=this.head;if(i){var r=this.head=i.next;return r===null&&(this.tail=null),i.item}}};var Q_=Z_,J4=vi,Z4=/ipad|iphone|ipod/i.test(J4)&&typeof Pebble<"u",Q4=vi,e6=/web0s(?!.*chrome)/i.test(Q4),Ui=me,Vy=pi,t6=Xi.f,tc=J_.set,r6=Q_,i6=Y_,n6=Z4,a6=e6,rc=Mo,Uy=Ui.MutationObserver||Ui.WebKitMutationObserver,Ky=Ui.document,Gy=Ui.process,Rs=Ui.Promise,qy=t6(Ui,"queueMicrotask"),Kd=qy&&qy.value,wn,ic,nc,Ns,Yy;if(!Kd){var Ms=new r6,Bs=function(){var i,r;for(rc&&(i=Gy.domain)&&i.exit();r=Ms.get();)try{r()}catch(e){throw Ms.head&&wn(),e}i&&i.enter()};!i6&&!rc&&!a6&&Uy&&Ky?(ic=!0,nc=Ky.createTextNode(""),new Uy(Bs).observe(nc,{characterData:!0}),wn=function(){nc.data=ic=!ic}):!n6&&Rs&&Rs.resolve?(Ns=Rs.resolve(void 0),Ns.constructor=Rs,Yy=Vy(Ns.then,Ns),wn=function(){Yy(Bs)}):rc?wn=function(){Gy.nextTick(Bs)}:(tc=Vy(tc,Ui),wn=function(){tc(Bs)}),Kd=function(i){Ms.head||wn(),Ms.add(i)}}var o6=Kd,s6=function(i,r){try{arguments.length===1?console.error(i):console.error(i,r)}catch{}},wa=function(i){try{return{error:!1,value:i()}}catch(r){return{error:!0,value:r}}},u6=me,_a=u6.Promise,eE=typeof Deno=="object"&&Deno&&typeof Deno.version=="object",l6=eE,h6=Mo,c6=!l6&&!h6&&typeof window=="object"&&typeof document=="object",d6=me,Za=_a,f6=Oe,v6=c0,p6=y0,g6=we,y6=c6,m6=eE,ac=ca,Xy=Za&&Za.prototype,b6=g6("species"),Gd=!1,tE=f6(d6.PromiseRejectionEvent),$6=v6("Promise",function(){var i=p6(Za),r=i!==String(Za);if(!r&&ac===66||!(Xy.catch&&Xy.finally))return!0;if(!ac||ac<51||!/native code/.test(i)){var e=new Za(function(a){a(1)}),t=function(a){a(function(){},function(){})},n=e.constructor={};if(n[b6]=t,Gd=e.then(function(){})instanceof t,!Gd)return!0}return!r&&(y6||m6)&&!tE}),Ho={CONSTRUCTOR:$6,REJECTION_EVENT:tE,SUBCLASSING:Gd},$r={},Jy=kt,w6=TypeError,_6=function(i){var r,e;this.promise=new i(function(t,n){if(r!==void 0||e!==void 0)throw new w6("Bad Promise constructor");r=t,e=n}),this.resolve=Jy(r),this.reject=Jy(e)};$r.f=function(i){return new _6(i)};var E6=K,Fu=Mo,li=me,Wo=Ge,S6=ga,O6=en,T6=G_,I6=kt,qd=Oe,k6=it,P6=yv,x6=q_,rE=J_.set,bv=o6,C6=s6,A6=wa,D6=Q_,iE=ya,Yd=_a,nE=Ho,aE=$r,kl="Promise",oE=nE.CONSTRUCTOR,R6=nE.REJECTION_EVENT,oc=iE.getterFor(kl),N6=iE.set,M6=Yd&&Yd.prototype,Mn=Yd,sc=M6,sE=li.TypeError,Xd=li.document,$v=li.process,Jd=aE.f,B6=Jd,F6=!!(Xd&&Xd.createEvent&&li.dispatchEvent),uE="unhandledrejection",j6="rejectionhandled",Zy=0,lE=1,L6=2,wv=1,hE=2,Fs,Qy,z6,cE=function(i){var r;return k6(i)&&qd(r=i.then)?r:!1},dE=function(i,r){var e=r.value,t=r.state===lE,n=t?i.ok:i.fail,a=i.resolve,o=i.reject,s=i.domain,u,l,h;try{n?(t||(r.rejection===hE&&W6(r),r.rejection=wv),n===!0?u=e:(s&&s.enter(),u=n(e),s&&(s.exit(),h=!0)),u===i.promise?o(new sE("Promise-chain cycle")):(l=cE(u))?Wo(l,u,a,o):a(u)):o(e)}catch(d){s&&!h&&s.exit(),o(d)}},fE=function(i,r){i.notified||(i.notified=!0,bv(function(){for(var e=i.reactions,t;t=e.get();)dE(t,i);i.notified=!1,r&&!i.rejection&&H6(i)}))},vE=function(i,r,e){var t,n;F6?(t=Xd.createEvent("Event"),t.promise=r,t.reason=e,t.initEvent(i,!1,!0),li.dispatchEvent(t)):t={promise:r,reason:e},!R6&&(n=li["on"+i])?n(t):i===uE&&C6("Unhandled promise rejection",e)},H6=function(i){Wo(rE,li,function(){var r=i.facade,e=i.value,t=em(i),n;if(t&&(n=A6(function(){Fu?$v.emit("unhandledRejection",e,r):vE(uE,r,e)}),i.rejection=Fu||em(i)?hE:wv,n.error))throw n.value})},em=function(i){return i.rejection!==wv&&!i.parent},W6=function(i){Wo(rE,li,function(){var r=i.facade;Fu?$v.emit("rejectionHandled",r):vE(j6,r,i.value)})},Bn=function(i,r,e){return function(t){i(r,t,e)}},Vn=function(i,r,e){i.done||(i.done=!0,e&&(i=e),i.value=r,i.state=L6,fE(i,!0))},Zd=function(i,r,e){if(!i.done){i.done=!0,e&&(i=e);try{if(i.facade===r)throw new sE("Promise can't be resolved itself");var t=cE(r);t?bv(function(){var n={done:!1};try{Wo(t,r,Bn(Zd,n,i),Bn(Vn,n,i))}catch(a){Vn(n,a,i)}}):(i.value=r,i.state=lE,fE(i,!1))}catch(n){Vn({done:!1},n,i)}}};oE&&(Mn=function(r){P6(this,sc),I6(r),Wo(Fs,this);var e=oc(this);try{r(Bn(Zd,e),Bn(Vn,e))}catch(t){Vn(e,t)}},sc=Mn.prototype,Fs=function(r){N6(this,{type:kl,done:!1,notified:!1,parent:!1,reactions:new D6,rejection:!1,state:Zy,value:void 0})},Fs.prototype=S6(sc,"then",function(r,e){var t=oc(this),n=Jd(x6(this,Mn));return t.parent=!0,n.ok=qd(r)?r:!0,n.fail=qd(e)&&e,n.domain=Fu?$v.domain:void 0,t.state===Zy?t.reactions.add(n):bv(function(){dE(n,t)}),n.promise}),Qy=function(){var i=new Fs,r=oc(i);this.promise=i,this.resolve=Bn(Zd,r),this.reject=Bn(Vn,r)},aE.f=Jd=function(i){return i===Mn||i===z6?new Qy(i):B6(i)});E6({global:!0,constructor:!0,wrap:!0,forced:oE},{Promise:Mn});O6(Mn,kl,!1,!0);T6(kl);var V6=_a,U6=Iw,K6=Ho.CONSTRUCTOR,Pl=K6||!U6(function(i){V6.all(i).then(void 0,function(){})}),G6=K,q6=Ge,Y6=kt,X6=$r,J6=wa,Z6=rn,Q6=Pl;G6({target:"Promise",stat:!0,forced:Q6},{all:function(r){var e=this,t=X6.f(e),n=t.resolve,a=t.reject,o=J6(function(){var s=Y6(e.resolve),u=[],l=0,h=1;Z6(r,function(d){var c=l++,f=!1;h++,q6(s,e,d).then(function(v){f||(f=!0,u[c]=v,--h||n(u))},a)}),--h||n(u)});return o.error&&a(o.value),t.promise}});var eH=K,tH=Ho.CONSTRUCTOR,tm=_a;tm&&tm.prototype;eH({target:"Promise",proto:!0,forced:tH,real:!0},{catch:function(i){return this.then(void 0,i)}});var rH=K,iH=Ge,nH=kt,aH=$r,oH=wa,sH=rn,uH=Pl;rH({target:"Promise",stat:!0,forced:uH},{race:function(r){var e=this,t=aH.f(e),n=t.reject,a=oH(function(){var o=nH(e.resolve);sH(r,function(s){iH(o,e,s).then(t.resolve,n)})});return a.error&&n(a.value),t.promise}});var lH=K,hH=Ge,cH=$r,dH=Ho.CONSTRUCTOR;lH({target:"Promise",stat:!0,forced:dH},{reject:function(r){var e=cH.f(this);return hH(e.reject,void 0,r),e.promise}});var fH=jt,vH=it,pH=$r,pE=function(i,r){if(fH(i),vH(r)&&r.constructor===i)return r;var e=pH.f(i),t=e.resolve;return t(r),e.promise},gH=K,yH=yt,mH=Ik,bH=_a,$H=Ho.CONSTRUCTOR,wH=pE,_H=yH("Promise"),EH=!$H;gH({target:"Promise",stat:!0,forced:mH},{resolve:function(r){return wH(EH&&this===_H?bH:this,r)}});var SH=K,OH=Ge,TH=kt,IH=$r,kH=wa,PH=rn,xH=Pl;SH({target:"Promise",stat:!0,forced:xH},{allSettled:function(r){var e=this,t=IH.f(e),n=t.resolve,a=t.reject,o=kH(function(){var s=TH(e.resolve),u=[],l=0,h=1;PH(r,function(d){var c=l++,f=!1;h++,OH(s,e,d).then(function(v){f||(f=!0,u[c]={status:"fulfilled",value:v},--h||n(u))},function(v){f||(f=!0,u[c]={status:"rejected",reason:v},--h||n(u))})}),--h||n(u)});return o.error&&a(o.value),t.promise}});var CH=K,AH=Ge,DH=kt,RH=yt,NH=$r,MH=wa,BH=rn,FH=Pl,rm="No one promise resolved";CH({target:"Promise",stat:!0,forced:FH},{any:function(r){var e=this,t=RH("AggregateError"),n=NH.f(e),a=n.resolve,o=n.reject,s=MH(function(){var u=DH(e.resolve),l=[],h=0,d=1,c=!1;BH(r,function(f){var v=h++,p=!1;d++,AH(u,e,f).then(function(g){p||c||(c=!0,a(g))},function(g){p||c||(p=!0,l[v]=g,--d||o(new t(l,rm)))})}),--d||o(new t(l,rm))});return s.error&&o(s.value),n.promise}});var jH=K,Qd=_a,LH=ue,zH=yt,HH=Oe,WH=q_,im=pE,VH=Qd&&Qd.prototype,UH=!!Qd&&LH(function(){VH.finally.call({then:function(){}},function(){})});jH({target:"Promise",proto:!0,real:!0,forced:UH},{finally:function(i){var r=WH(this,zH("Promise")),e=HH(i);return this.then(e?function(t){return im(r,i()).then(function(){return t})}:i,e?function(t){return im(r,i()).then(function(){throw t})}:i)}});var KH=be,GH=KH.Promise,qH=GH,YH=qH,XH=K,JH=$r;XH({target:"Promise",stat:!0},{withResolvers:function(){var r=JH.f(this);return{promise:r.promise,resolve:r.resolve,reject:r.reject}}});var ZH=YH,QH=ZH,e8=K,t8=$r,r8=wa;e8({target:"Promise",stat:!0,forced:!0},{try:function(i){var r=t8.f(this),e=r8(i);return(e.error?r.reject:r.resolve)(e.value),r.promise}});var i8=QH,n8=i8,a8=n8,o8=zw,s8=o8,u8=s8,l8=u8,h8=l8;(function(i){var r=Bz.default,e=p0,t=rv,n=F_,a=z_,o=Hz,s=Rw,u=j_,l=a8,h=h8,d=Mw;function c(){i.exports=c=function(){return v},i.exports.__esModule=!0,i.exports.default=i.exports;var f,v={},p=Object.prototype,g=p.hasOwnProperty,y=e||function(F,x,A){F[x]=A.value},m=typeof t=="function"?t:{},b=m.iterator||"@@iterator",$=m.asyncIterator||"@@asyncIterator",S=m.toStringTag||"@@toStringTag";function _(F,x,A){return e(F,x,{value:A,enumerable:!0,configurable:!0,writable:!0}),F[x]}try{_({},"")}catch{_=function(A,V,Z){return A[V]=Z}}function R(F,x,A,V){var Z=x&&x.prototype instanceof $e?x:$e,J=n(Z.prototype),Ce=new Rt(V||[]);return y(J,"_invoke",{value:Me(F,A,Ce)}),J}function B(F,x,A){try{return{type:"normal",arg:F.call(x,A)}}catch(V){return{type:"throw",arg:V}}}v.wrap=R;var I="suspendedStart",C="suspendedYield",j="executing",X="completed",U={};function $e(){}function Qe(){}function Ne(){}var At={};_(At,b,function(){return this});var lt=a,nt=lt&<(lt(st([])));nt&&nt!==p&&g.call(nt,b)&&(At=nt);var Dt=Ne.prototype=$e.prototype=n(At);function at(F){var x;o(x=["next","throw","return"]).call(x,function(A){_(F,A,function(V){return this._invoke(A,V)})})}function ge(F,x){function A(Z,J,Ce,ht){var mt=B(F[Z],F,J);if(mt.type!=="throw"){var wi=mt.arg,Hr=wi.value;return Hr&&r(Hr)=="object"&&g.call(Hr,"__await")?x.resolve(Hr.__await).then(function(_i){A("next",_i,Ce,ht)},function(_i){A("throw",_i,Ce,ht)}):x.resolve(Hr).then(function(_i){wi.value=_i,Ce(wi)},function(_i){return A("throw",_i,Ce,ht)})}ht(mt.arg)}var V;y(this,"_invoke",{value:function(J,Ce){function ht(){return new x(function(mt,wi){A(J,Ce,mt,wi)})}return V=V?V.then(ht,ht):ht()}})}function Me(F,x,A){var V=I;return function(Z,J){if(V===j)throw new Error("Generator is already running");if(V===X){if(Z==="throw")throw J;return{value:f,done:!0}}for(A.method=Z,A.arg=J;;){var Ce=A.delegate;if(Ce){var ht=xe(Ce,A);if(ht){if(ht===U)continue;return ht}}if(A.method==="next")A.sent=A._sent=A.arg;else if(A.method==="throw"){if(V===I)throw V=X,A.arg;A.dispatchException(A.arg)}else A.method==="return"&&A.abrupt("return",A.arg);V=j;var mt=B(F,x,A);if(mt.type==="normal"){if(V=A.done?X:C,mt.arg===U)continue;return{value:mt.arg,done:A.done}}mt.type==="throw"&&(V=X,A.method="throw",A.arg=mt.arg)}}}function xe(F,x){var A=x.method,V=F.iterator[A];if(V===f)return x.delegate=null,A==="throw"&&F.iterator.return&&(x.method="return",x.arg=f,xe(F,x),x.method==="throw")||A!=="return"&&(x.method="throw",x.arg=new TypeError("The iterator does not provide a '"+A+"' method")),U;var Z=B(V,F.iterator,x.arg);if(Z.type==="throw")return x.method="throw",x.arg=Z.arg,x.delegate=null,U;var J=Z.arg;return J?J.done?(x[F.resultName]=J.value,x.next=F.nextLoc,x.method!=="return"&&(x.method="next",x.arg=f),x.delegate=null,U):J:(x.method="throw",x.arg=new TypeError("iterator result is not an object"),x.delegate=null,U)}function ot(F){var x,A={tryLoc:F[0]};1 in F&&(A.catchLoc=F[1]),2 in F&&(A.finallyLoc=F[2],A.afterLoc=F[3]),s(x=this.tryEntries).call(x,A)}function Er(F){var x=F.completion||{};x.type="normal",delete x.arg,F.completion=x}function Rt(F){this.tryEntries=[{tryLoc:"root"}],o(F).call(F,ot,this),this.reset(!0)}function st(F){if(F||F===""){var x=F[b];if(x)return x.call(F);if(typeof F.next=="function")return F;if(!isNaN(F.length)){var A=-1,V=function Z(){for(;++A=0;--Z){var J=this.tryEntries[Z],Ce=J.completion;if(J.tryLoc==="root")return V("end");if(J.tryLoc<=this.prev){var ht=g.call(J,"catchLoc"),mt=g.call(J,"finallyLoc");if(ht&&mt){if(this.prev=0;--V){var Z=this.tryEntries[V];if(Z.tryLoc<=this.prev&&g.call(Z,"finallyLoc")&&this.prev=0;--A){var V=this.tryEntries[A];if(V.finallyLoc===x)return this.complete(V.completion,V.afterLoc),Er(V),U}},catch:function(x){for(var A=this.tryEntries.length-1;A>=0;--A){var V=this.tryEntries[A];if(V.tryLoc===x){var Z=V.completion;if(Z.type==="throw"){var J=Z.arg;Er(V)}return J}}throw new Error("illegal catch attempt")},delegateYield:function(x,A,V){return this.delegate={iterator:st(x),resultName:A,nextLoc:V},this.method==="next"&&(this.arg=f),U}},v}i.exports=c,i.exports.__esModule=!0,i.exports.default=i.exports})(H_);var c8=H_.exports,fu=c8(),d8=fu;try{regeneratorRuntime=fu}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=fu:Function("r","regeneratorRuntime = r")(fu)}var $t=Y(d8),gE={exports:{}},f8=ue,v8=f8(function(){if(typeof ArrayBuffer=="function"){var i=new ArrayBuffer(8);Object.isExtensible(i)&&Object.defineProperty(i,"a",{value:8})}}),p8=ue,g8=it,y8=fi,nm=v8,vu=Object.isExtensible,m8=p8(function(){vu(1)}),b8=m8||nm?function(r){return!g8(r)||nm&&y8(r)==="ArrayBuffer"?!1:vu?vu(r):!0}:vu,$8=ue,w8=!$8(function(){return Object.isExtensible(Object.preventExtensions({}))}),_8=K,E8=ye,S8=ko,O8=it,_v=ze,T8=xt.f,am=Po,I8=Kf,Ev=b8,k8=il,P8=w8,yE=!1,Mr=k8("meta"),x8=0,Sv=function(i){T8(i,Mr,{value:{objectID:"O"+x8++,weakData:{}}})},C8=function(i,r){if(!O8(i))return typeof i=="symbol"?i:(typeof i=="string"?"S":"P")+i;if(!_v(i,Mr)){if(!Ev(i))return"F";if(!r)return"E";Sv(i)}return i[Mr].objectID},A8=function(i,r){if(!_v(i,Mr)){if(!Ev(i))return!0;if(!r)return!1;Sv(i)}return i[Mr].weakData},D8=function(i){return P8&&yE&&Ev(i)&&!_v(i,Mr)&&Sv(i),i},R8=function(){N8.enable=function(){},yE=!0;var i=am.f,r=E8([].splice),e={};e[Mr]=1,i(e).length&&(am.f=function(t){for(var n=i(t),a=0,o=n.length;a1?arguments[1]:void 0),f;f=f?f.next:d.first;)for(c(f.value,f.key,this);f&&f.removed;)f=f.previous},has:function(h){return!!u(this,h)}}),om(a,e?{get:function(h){var d=u(this,h);return d&&d.value},set:function(h,d){return s(this,h===0?0:h,d)}}:{add:function(h){return s(this,h=h===0?0:h,h)}}),Fa&&t7(a,"size",{configurable:!0,get:function(){return o(this).size}}),n},setStrong:function(i,r,e){var t=r+" Iterator",n=uc(r),a=uc(t);o7(i,r,function(o,s){um(this,{type:t,target:o,state:n(o),kind:s,last:void 0})},function(){for(var o=a(this),s=o.kind,u=o.last;u&&u.removed;)u=u.previous;return!o.target||!(o.last=u=u?u.next:o.state.first)?(o.target=void 0,js(void 0,!0)):js(s==="keys"?u.key:s==="values"?u.value:[u.key,u.value],!1)},e?"entries":"values",!e,!0),s7(r)}},u7=$E,l7=_E;u7("Map",function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},l7);var h7=be,c7=h7.Map,d7=c7,f7=d7,v7=f7,EE=Y(v7),p7=K,g7=ma.some,y7=wl,m7=y7("some");p7({target:"Array",proto:!0,forced:!m7},{some:function(r){return g7(this,r,arguments.length>1?arguments[1]:void 0)}});var b7=ut,$7=b7("Array","some"),w7=Le,_7=$7,lc=Array.prototype,E7=function(i){var r=i.some;return i===lc||w7(lc,i)&&r===lc.some?_7:r},S7=E7,O7=S7,T7=O7,I7=Y(T7),k7=ut,P7=k7("Array","keys"),x7=P7,C7=x7,A7=Lr,D7=ze,R7=Le,N7=C7,hc=Array.prototype,M7={DOMTokenList:!0,NodeList:!0},B7=function(i){var r=i.keys;return i===hc||R7(hc,i)&&r===hc.keys||D7(M7,A7(i))?N7:r},F7=B7,_n=Y(F7),lm=I0,j7=Math.floor,ef=function(i,r){var e=i.length,t=j7(e/2);return e<8?L7(i,r):z7(i,ef(lm(i,0,t),r),ef(lm(i,t),r),r)},L7=function(i,r){for(var e=i.length,t=1,n,a;t0;)i[a]=i[--a];a!==t++&&(i[a]=n)}return i},z7=function(i,r,e,t){for(var n=r.length,a=e.length,o=0,s=0;o3)){if(tW)return!0;if(gm)return gm<603;var i="",r,e,t,n;for(r=65;r<76;r++){switch(e=String.fromCharCode(r),r){case 66:case 69:case 70:case 72:t=3;break;case 68:case 71:t=4;break;default:t=2}for(n=0;n<47;n++)Zr.push({k:e+n,v:t})}for(Zr.sort(function(a,o){return o.v-a.v}),n=0;nfm(e)?1:-1}};Y7({target:"Array",proto:!0,forced:oW},{sort:function(r){r!==void 0&&X7(r);var e=J7(this);if(OE)return r===void 0?ym(e):ym(e,r);var t=[],n=dm(e),a,o;for(o=0;othis.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay=="number"&&(this._timeout=mL(function(){e.flush()},this.delay))}},{key:"flush",value:function(){var e,t;zi(e=Ww(t=this._queue).call(t,0)).call(e,function(n){n.fn.apply(n.context||n.fn,n.args||[])})}}],[{key:"extend",value:function(e,t){var n=new i(t);if(e.flush!==void 0)throw new Error("Target object already has a property flush");e.flush=function(){n.flush()};var a=[{name:"flush",original:void 0}];if(t&&t.replace)for(var o=0;o=i.length?{done:!0}:{done:!1,value:i[t++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(i)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function hV(i,r){var e;if(i){if(typeof i=="string")return wm(i,r);var t=Ol(e=Object.prototype.toString.call(i)).call(e,8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return av(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return wm(i,r)}}function wm(i,r){(r==null||r>i.length)&&(r=i.length);for(var e=0,t=new Array(r);es&&(s=d,o=h)}return o}},{key:"min",value:function(t){var n=pc(this._pairs),a=n.next();if(a.done)return null;for(var o=a.value[1],s=t(a.value[1],a.value[0]);!(a=n.next()).done;){var u=bt(a.value,2),l=u[0],h=u[1],d=t(h,l);d=i.length?{done:!0}:{done:!1,value:i[t++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(i)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function cV(i,r){var e;if(i){if(typeof i=="string")return Om(i,r);var t=Ol(e=Object.prototype.toString.call(i)).call(e,8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return av(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Om(i,r)}}function Om(i,r){(r==null||r>i.length)&&(r=i.length);for(var e=0,t=new Array(r);e"u"||!cu||cu.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(cu(Boolean,[],function(){})),!0}catch{return!1}}function vV(i,r){return i[r]==null&&(i[r]=VW()),i}var ju=function(i){Cz(e,i);var r=dV(e);function e(t,n){var a;return el(this,e),a=r.call(this),ii(B_(a),"_queue",null),t&&!Bt(t)&&(n=t,t=[]),a._options=n||{},a._data=new EE,a.length=0,a._idProp=a._options.fieldId||"id",t&&t.length&&a.add(t),a.setOptions(n),a}return $l(e,[{key:"idProp",get:function(){return this._idProp}},{key:"setOptions",value:function(n){n&&n.queue!==void 0&&(n.queue===!1?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=UW.extend(this,{replace:["add","update","remove"]})),n.queue&&typeof n.queue=="object"&&this._queue.setOptions(n.queue)))}},{key:"add",value:function(n,a){var o=this,s=[],u;if(Bt(n)){var l=rr(n).call(n,function(c){return c[o._idProp]});if(I7(l).call(l,function(c){return o._data.has(c)}))throw new Error("A duplicate id was found in the parameter array.");for(var h=0,d=n.length;hh?1:ls)&&(o=h,s=d)}}catch(c){u.e(c)}finally{u.f()}return o||null}},{key:"min",value:function(n){var a,o=null,s=null,u=gc(mm(a=this._data).call(a)),l;try{for(u.s();!(l=u.n()).done;){var h=l.value,d=h[n];typeof d=="number"&&(s==null||d\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=window.console&&(window.console.warn||window.console.log);return o&&o.call(window.console,t,a),i.apply(this,arguments)}}var $_=b_(function(i,r,e){for(var t=Object.keys(r),n=0;n=i.length?{done:!0}:{done:!1,value:i[t++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(i)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function u5(i,r){var e;if(i){if(typeof i=="string")return _y(i,r);var t=Ol(e=Object.prototype.toString.call(i)).call(e,8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return av(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _y(i,r)}}function _y(i,r){(r==null||r>i.length)&&(r=i.length);for(var e=0,t=new Array(r);e1?e-1:0),n=1;n2){var t;return Ru.apply(void 0,Sl(t=[E_(r[0],r[1])]).call(t,Et(Ol(r).call(r,2))))}var n=r[0],a=r[1];if(n instanceof Date&&a instanceof Date)return n.setTime(a.getTime()),n;var o=w_(lj(a)),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;Object.prototype.propertyIsEnumerable.call(a,u)&&(a[u]===__?delete n[u]:n[u]!==null&&a[u]!==null&&typeof n[u]=="object"&&typeof a[u]=="object"&&!Bt(n[u])&&!Bt(a[u])?n[u]=Ru(n[u],a[u]):n[u]=S_(a[u]))}}catch(l){o.e(l)}finally{o.f()}return n}function S_(i){return Bt(i)?rr(i).call(i,function(r){return S_(r)}):typeof i=="object"&&i!==null?i instanceof Date?new Date(i.getTime()):Ru({},i):i}function O_(i){for(var r=0,e=uv(i);ro;)u=t(e,s=n[o++]),u!==void 0&&q5(a,s,u);return a}});var Y5=$e,X5=Y5.Object.getOwnPropertyDescriptors,J5=X5,Z5=J5,Q5=Z5,Iy=Y(Q5),N_={exports:{}},ez=U,tz=Ke,ky=hl.f;ez({target:"Object",stat:!0,forced:Object.defineProperties!==ky,sham:!tz},{defineProperties:ky});var rz=$e,M_=rz.Object,iz=N_.exports=function(r,e){return M_.defineProperties(r,e)};M_.defineProperties.sham&&(iz.sham=!0);var nz=N_.exports,az=nz,oz=az,sz=oz,uz=Y(sz),lz=v0,hz=Y(lz);function B_(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}var cz=Uw,dz=cz,fz=dz,vz=fz,F_=vz,pz=Y(F_),gz=U,yz=nw;gz({target:"Object",stat:!0},{setPrototypeOf:yz});var mz=$e,bz=mz.Object.setPrototypeOf,$z=bz,wz=$z,_z=wz,Ez=_z,Sz=Ez,Oz=Sz,j_=Oz,Hd=Y(j_),Tz=$w,Iz=Tz,kz=Iz,Pz=kz,xz=Pz,L_=Y(xz);function Vd(i,r){var e;return Vd=Hd?L_(e=Hd).call(e):function(n,a){return n.__proto__=a,n},Vd(i,r)}function Cz(i,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=pz(r.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),al(i,"prototype",{writable:!1}),Vd(i,r)}function Az(i,r){if(r&&(Xn(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return B_(i)}var Dz=j3,Rz=Dz,Nz=Rz,Mz=Nz,z_=Mz,Py=Y(z_);function Nu(i){var r;return Nu=Hd?L_(r=Py).call(r):function(t){return t.__proto__||Py(t)},Nu(i)}var H_={exports:{}},V_={exports:{}};(function(i){var r=rv,e=pw;function t(n){"@babel/helpers - typeof";return i.exports=t=typeof r=="function"&&typeof e=="symbol"?function(a){return typeof a}:function(a){return a&&typeof r=="function"&&a.constructor===r&&a!==r.prototype?"symbol":typeof a},i.exports.__esModule=!0,i.exports.default=i.exports,t(n)}i.exports=t,i.exports.__esModule=!0,i.exports.default=i.exports})(V_);var Bz=V_.exports,Fz=Lw,jz=Fz,Lz=jz,zz=Lz,Hz=zz,xy=ze,Vz=sv,Wz=Qi,Uz=xt,Kz=function(i,r,e){for(var t=Vz(r),n=Uz.f,a=Wz.f,o=0;od;d++)if(f=y(i[d]),f&&Ay(Ry,f))return f;return new du(!1)}l=v4(i,h)}for(v=a?i.next:l.next;!(p=l4(v,l)).done;){try{f=y(p.value)}catch(m){Dy(l,"throw",m)}if(typeof f=="object"&&f&&Ay(Ry,f))return f}return new du(!1)},y4=tn,m4=function(i,r){return i===void 0?arguments.length<2?"":r:y4(i)},b4=U,$4=Le,w4=bl,Mu=nw,_4=Kz,K_=rn,Gh=Lr,qh=en,E4=Yz,S4=s4,O4=on,T4=m4,I4=we,k4=I4("toStringTag"),Bu=Error,P4=[].push,ea=function(r,e){var t=$4(Yh,this),n;Mu?n=Mu(new Bu,t?w4(this):Yh):(n=t?this:K_(Yh),Gh(n,k4,"Error")),e!==void 0&&Gh(n,"message",T4(e)),S4(n,ea,n.stack,1),arguments.length>2&&E4(n,arguments[2]);var a=[];return O4(r,P4,{that:a}),Gh(n,"errors",a),n};Mu?Mu(ea,Bu):_4(ea,Bu,{name:!0});var Yh=ea.prototype=K_(Bu.prototype,{constructor:qh(1,ea),message:qh(1,""),name:qh(1,"AggregateError")});b4({global:!0,constructor:!0,arity:2},{AggregateError:ea});var x4=yt,C4=Gf,A4=we,D4=Ke,Ny=A4("species"),G_=function(i){var r=x4(i);D4&&r&&!r[Ny]&&C4(r,Ny,{configurable:!0,get:function(){return this}})},R4=Le,N4=TypeError,yv=function(i,r){if(R4(r,i))return i;throw new N4("Incorrect invocation")},My=jt,M4=T_,B4=ha,F4=we,j4=F4("species"),q_=function(i,r){var e=My(i).constructor,t;return e===void 0||B4(t=My(e)[j4])?r:M4(t)},L4=vi,Y_=/(?:ipad|iphone|ipod).*applewebkit/i.test(L4),Ft=be,z4=la,H4=pi,By=Oe,V4=ze,X_=le,Fy=S0,W4=Ro,jy=Hf,U4=Kw,K4=Y_,G4=Mo,Wd=Ft.setImmediate,Ud=Ft.clearImmediate,q4=Ft.process,Xh=Ft.Dispatch,Y4=Ft.Function,Ly=Ft.MessageChannel,X4=Ft.String,Jh=0,Ja={},zy="onreadystatechange",po,Ii,Zh,Qh;X_(function(){po=Ft.location});var mv=function(i){if(V4(Ja,i)){var r=Ja[i];delete Ja[i],r()}},ec=function(i){return function(){mv(i)}},Hy=function(i){mv(i.data)},Vy=function(i){Ft.postMessage(X4(i),po.protocol+"//"+po.host)};(!Wd||!Ud)&&(Wd=function(r){U4(arguments.length,1);var e=By(r)?r:Y4(r),t=W4(arguments,1);return Ja[++Jh]=function(){z4(e,void 0,t)},Ii(Jh),Jh},Ud=function(r){delete Ja[r]},G4?Ii=function(i){q4.nextTick(ec(i))}:Xh&&Xh.now?Ii=function(i){Xh.now(ec(i))}:Ly&&!K4?(Zh=new Ly,Qh=Zh.port2,Zh.port1.onmessage=Hy,Ii=H4(Qh.postMessage,Qh)):Ft.addEventListener&&By(Ft.postMessage)&&!Ft.importScripts&&po&&po.protocol!=="file:"&&!X_(Vy)?(Ii=Vy,Ft.addEventListener("message",Hy,!1)):zy in jy("script")?Ii=function(i){Fy.appendChild(jy("script"))[zy]=function(){Fy.removeChild(this),mv(i)}}:Ii=function(i){setTimeout(ec(i),0)});var J_={set:Wd,clear:Ud},Z_=function(){this.head=null,this.tail=null};Z_.prototype={add:function(i){var r={item:i,next:null},e=this.tail;e?e.next=r:this.head=r,this.tail=r},get:function(){var i=this.head;if(i){var r=this.head=i.next;return r===null&&(this.tail=null),i.item}}};var Q_=Z_,J4=vi,Z4=/ipad|iphone|ipod/i.test(J4)&&typeof Pebble<"u",Q4=vi,e6=/web0s(?!.*chrome)/i.test(Q4),qi=be,Wy=pi,t6=Qi.f,tc=J_.set,r6=Q_,i6=Y_,n6=Z4,a6=e6,rc=Mo,Uy=qi.MutationObserver||qi.WebKitMutationObserver,Ky=qi.document,Gy=qi.process,Rs=qi.Promise,qy=t6(qi,"queueMicrotask"),Kd=qy&&qy.value,wn,ic,nc,Ns,Yy;if(!Kd){var Ms=new r6,Bs=function(){var i,r;for(rc&&(i=Gy.domain)&&i.exit();r=Ms.get();)try{r()}catch(e){throw Ms.head&&wn(),e}i&&i.enter()};!i6&&!rc&&!a6&&Uy&&Ky?(ic=!0,nc=Ky.createTextNode(""),new Uy(Bs).observe(nc,{characterData:!0}),wn=function(){nc.data=ic=!ic}):!n6&&Rs&&Rs.resolve?(Ns=Rs.resolve(void 0),Ns.constructor=Rs,Yy=Wy(Ns.then,Ns),wn=function(){Yy(Bs)}):rc?wn=function(){Gy.nextTick(Bs)}:(tc=Wy(tc,qi),wn=function(){tc(Bs)}),Kd=function(i){Ms.head||wn(),Ms.add(i)}}var o6=Kd,s6=function(i,r){try{arguments.length===1?console.error(i):console.error(i,r)}catch{}},wa=function(i){try{return{error:!1,value:i()}}catch(r){return{error:!0,value:r}}},u6=be,_a=u6.Promise,eE=typeof Deno=="object"&&Deno&&typeof Deno.version=="object",l6=eE,h6=Mo,c6=!l6&&!h6&&typeof window=="object"&&typeof document=="object",d6=be,Za=_a,f6=Oe,v6=c0,p6=y0,g6=we,y6=c6,m6=eE,ac=ca,Xy=Za&&Za.prototype,b6=g6("species"),Gd=!1,tE=f6(d6.PromiseRejectionEvent),$6=v6("Promise",function(){var i=p6(Za),r=i!==String(Za);if(!r&&ac===66||!(Xy.catch&&Xy.finally))return!0;if(!ac||ac<51||!/native code/.test(i)){var e=new Za(function(a){a(1)}),t=function(a){a(function(){},function(){})},n=e.constructor={};if(n[b6]=t,Gd=e.then(function(){})instanceof t,!Gd)return!0}return!r&&(y6||m6)&&!tE}),Ho={CONSTRUCTOR:$6,REJECTION_EVENT:tE,SUBCLASSING:Gd},$r={},Jy=kt,w6=TypeError,_6=function(i){var r,e;this.promise=new i(function(t,n){if(r!==void 0||e!==void 0)throw new w6("Bad Promise constructor");r=t,e=n}),this.resolve=Jy(r),this.reject=Jy(e)};$r.f=function(i){return new _6(i)};var E6=U,Fu=Mo,li=be,Vo=Ge,S6=ga,O6=nn,T6=G_,I6=kt,qd=Oe,k6=it,P6=yv,x6=q_,rE=J_.set,bv=o6,C6=s6,A6=wa,D6=Q_,iE=ya,Yd=_a,nE=Ho,aE=$r,kl="Promise",oE=nE.CONSTRUCTOR,R6=nE.REJECTION_EVENT,oc=iE.getterFor(kl),N6=iE.set,M6=Yd&&Yd.prototype,Mn=Yd,sc=M6,sE=li.TypeError,Xd=li.document,$v=li.process,Jd=aE.f,B6=Jd,F6=!!(Xd&&Xd.createEvent&&li.dispatchEvent),uE="unhandledrejection",j6="rejectionhandled",Zy=0,lE=1,L6=2,wv=1,hE=2,Fs,Qy,z6,cE=function(i){var r;return k6(i)&&qd(r=i.then)?r:!1},dE=function(i,r){var e=r.value,t=r.state===lE,n=t?i.ok:i.fail,a=i.resolve,o=i.reject,s=i.domain,u,l,h;try{n?(t||(r.rejection===hE&&V6(r),r.rejection=wv),n===!0?u=e:(s&&s.enter(),u=n(e),s&&(s.exit(),h=!0)),u===i.promise?o(new sE("Promise-chain cycle")):(l=cE(u))?Vo(l,u,a,o):a(u)):o(e)}catch(d){s&&!h&&s.exit(),o(d)}},fE=function(i,r){i.notified||(i.notified=!0,bv(function(){for(var e=i.reactions,t;t=e.get();)dE(t,i);i.notified=!1,r&&!i.rejection&&H6(i)}))},vE=function(i,r,e){var t,n;F6?(t=Xd.createEvent("Event"),t.promise=r,t.reason=e,t.initEvent(i,!1,!0),li.dispatchEvent(t)):t={promise:r,reason:e},!R6&&(n=li["on"+i])?n(t):i===uE&&C6("Unhandled promise rejection",e)},H6=function(i){Vo(rE,li,function(){var r=i.facade,e=i.value,t=em(i),n;if(t&&(n=A6(function(){Fu?$v.emit("unhandledRejection",e,r):vE(uE,r,e)}),i.rejection=Fu||em(i)?hE:wv,n.error))throw n.value})},em=function(i){return i.rejection!==wv&&!i.parent},V6=function(i){Vo(rE,li,function(){var r=i.facade;Fu?$v.emit("rejectionHandled",r):vE(j6,r,i.value)})},Bn=function(i,r,e){return function(t){i(r,t,e)}},Wn=function(i,r,e){i.done||(i.done=!0,e&&(i=e),i.value=r,i.state=L6,fE(i,!0))},Zd=function(i,r,e){if(!i.done){i.done=!0,e&&(i=e);try{if(i.facade===r)throw new sE("Promise can't be resolved itself");var t=cE(r);t?bv(function(){var n={done:!1};try{Vo(t,r,Bn(Zd,n,i),Bn(Wn,n,i))}catch(a){Wn(n,a,i)}}):(i.value=r,i.state=lE,fE(i,!1))}catch(n){Wn({done:!1},n,i)}}};oE&&(Mn=function(r){P6(this,sc),I6(r),Vo(Fs,this);var e=oc(this);try{r(Bn(Zd,e),Bn(Wn,e))}catch(t){Wn(e,t)}},sc=Mn.prototype,Fs=function(r){N6(this,{type:kl,done:!1,notified:!1,parent:!1,reactions:new D6,rejection:!1,state:Zy,value:void 0})},Fs.prototype=S6(sc,"then",function(r,e){var t=oc(this),n=Jd(x6(this,Mn));return t.parent=!0,n.ok=qd(r)?r:!0,n.fail=qd(e)&&e,n.domain=Fu?$v.domain:void 0,t.state===Zy?t.reactions.add(n):bv(function(){dE(n,t)}),n.promise}),Qy=function(){var i=new Fs,r=oc(i);this.promise=i,this.resolve=Bn(Zd,r),this.reject=Bn(Wn,r)},aE.f=Jd=function(i){return i===Mn||i===z6?new Qy(i):B6(i)});E6({global:!0,constructor:!0,wrap:!0,forced:oE},{Promise:Mn});O6(Mn,kl,!1,!0);T6(kl);var W6=_a,U6=Iw,K6=Ho.CONSTRUCTOR,Pl=K6||!U6(function(i){W6.all(i).then(void 0,function(){})}),G6=U,q6=Ge,Y6=kt,X6=$r,J6=wa,Z6=on,Q6=Pl;G6({target:"Promise",stat:!0,forced:Q6},{all:function(r){var e=this,t=X6.f(e),n=t.resolve,a=t.reject,o=J6(function(){var s=Y6(e.resolve),u=[],l=0,h=1;Z6(r,function(d){var c=l++,f=!1;h++,q6(s,e,d).then(function(v){f||(f=!0,u[c]=v,--h||n(u))},a)}),--h||n(u)});return o.error&&a(o.value),t.promise}});var eH=U,tH=Ho.CONSTRUCTOR,tm=_a;tm&&tm.prototype;eH({target:"Promise",proto:!0,forced:tH,real:!0},{catch:function(i){return this.then(void 0,i)}});var rH=U,iH=Ge,nH=kt,aH=$r,oH=wa,sH=on,uH=Pl;rH({target:"Promise",stat:!0,forced:uH},{race:function(r){var e=this,t=aH.f(e),n=t.reject,a=oH(function(){var o=nH(e.resolve);sH(r,function(s){iH(o,e,s).then(t.resolve,n)})});return a.error&&n(a.value),t.promise}});var lH=U,hH=Ge,cH=$r,dH=Ho.CONSTRUCTOR;lH({target:"Promise",stat:!0,forced:dH},{reject:function(r){var e=cH.f(this);return hH(e.reject,void 0,r),e.promise}});var fH=jt,vH=it,pH=$r,pE=function(i,r){if(fH(i),vH(r)&&r.constructor===i)return r;var e=pH.f(i),t=e.resolve;return t(r),e.promise},gH=U,yH=yt,mH=Ik,bH=_a,$H=Ho.CONSTRUCTOR,wH=pE,_H=yH("Promise"),EH=!$H;gH({target:"Promise",stat:!0,forced:mH},{resolve:function(r){return wH(EH&&this===_H?bH:this,r)}});var SH=U,OH=Ge,TH=kt,IH=$r,kH=wa,PH=on,xH=Pl;SH({target:"Promise",stat:!0,forced:xH},{allSettled:function(r){var e=this,t=IH.f(e),n=t.resolve,a=t.reject,o=kH(function(){var s=TH(e.resolve),u=[],l=0,h=1;PH(r,function(d){var c=l++,f=!1;h++,OH(s,e,d).then(function(v){f||(f=!0,u[c]={status:"fulfilled",value:v},--h||n(u))},function(v){f||(f=!0,u[c]={status:"rejected",reason:v},--h||n(u))})}),--h||n(u)});return o.error&&a(o.value),t.promise}});var CH=U,AH=Ge,DH=kt,RH=yt,NH=$r,MH=wa,BH=on,FH=Pl,rm="No one promise resolved";CH({target:"Promise",stat:!0,forced:FH},{any:function(r){var e=this,t=RH("AggregateError"),n=NH.f(e),a=n.resolve,o=n.reject,s=MH(function(){var u=DH(e.resolve),l=[],h=0,d=1,c=!1;BH(r,function(f){var v=h++,p=!1;d++,AH(u,e,f).then(function(g){p||c||(c=!0,a(g))},function(g){p||c||(p=!0,l[v]=g,--d||o(new t(l,rm)))})}),--d||o(new t(l,rm))});return s.error&&o(s.value),n.promise}});var jH=U,Qd=_a,LH=le,zH=yt,HH=Oe,VH=q_,im=pE,WH=Qd&&Qd.prototype,UH=!!Qd&&LH(function(){WH.finally.call({then:function(){}},function(){})});jH({target:"Promise",proto:!0,real:!0,forced:UH},{finally:function(i){var r=VH(this,zH("Promise")),e=HH(i);return this.then(e?function(t){return im(r,i()).then(function(){return t})}:i,e?function(t){return im(r,i()).then(function(){throw t})}:i)}});var KH=$e,GH=KH.Promise,qH=GH,YH=qH,XH=U,JH=$r;XH({target:"Promise",stat:!0},{withResolvers:function(){var r=JH.f(this);return{promise:r.promise,resolve:r.resolve,reject:r.reject}}});var ZH=YH,QH=ZH,e8=U,t8=$r,r8=wa;e8({target:"Promise",stat:!0,forced:!0},{try:function(i){var r=t8.f(this),e=r8(i);return(e.error?r.reject:r.resolve)(e.value),r.promise}});var i8=QH,n8=i8,a8=n8,o8=zw,s8=o8,u8=s8,l8=u8,h8=l8;(function(i){var r=Bz.default,e=p0,t=rv,n=F_,a=z_,o=Hz,s=Rw,u=j_,l=a8,h=h8,d=Mw;function c(){i.exports=c=function(){return v},i.exports.__esModule=!0,i.exports.default=i.exports;var f,v={},p=Object.prototype,g=p.hasOwnProperty,y=e||function(j,P,A){j[P]=A.value},m=typeof t=="function"?t:{},b=m.iterator||"@@iterator",$=m.asyncIterator||"@@asyncIterator",S=m.toStringTag||"@@toStringTag";function _(j,P,A){return e(j,P,{value:A,enumerable:!0,configurable:!0,writable:!0}),j[P]}try{_({},"")}catch{_=function(A,W,Z){return A[W]=Z}}function C(j,P,A,W){var Z=P&&P.prototype instanceof oe?P:oe,J=n(Z.prototype),Ce=new Rt(W||[]);return y(J,"_invoke",{value:Me(j,A,Ce)}),J}function M(j,P,A){try{return{type:"normal",arg:j.call(P,A)}}catch(W){return{type:"throw",arg:W}}}v.wrap=C;var x="suspendedStart",B="suspendedYield",F="executing",X="completed",K={};function oe(){}function Qe(){}function Ne(){}var At={};_(At,b,function(){return this});var lt=a,nt=lt&<(lt(st([])));nt&&nt!==p&&g.call(nt,b)&&(At=nt);var Dt=Ne.prototype=oe.prototype=n(At);function at(j){var P;o(P=["next","throw","return"]).call(P,function(A){_(j,A,function(W){return this._invoke(A,W)})})}function ye(j,P){function A(Z,J,Ce,ht){var mt=M(j[Z],j,J);if(mt.type!=="throw"){var wi=mt.arg,Vr=wi.value;return Vr&&r(Vr)=="object"&&g.call(Vr,"__await")?P.resolve(Vr.__await).then(function(_i){A("next",_i,Ce,ht)},function(_i){A("throw",_i,Ce,ht)}):P.resolve(Vr).then(function(_i){wi.value=_i,Ce(wi)},function(_i){return A("throw",_i,Ce,ht)})}ht(mt.arg)}var W;y(this,"_invoke",{value:function(J,Ce){function ht(){return new P(function(mt,wi){A(J,Ce,mt,wi)})}return W=W?W.then(ht,ht):ht()}})}function Me(j,P,A){var W=x;return function(Z,J){if(W===F)throw new Error("Generator is already running");if(W===X){if(Z==="throw")throw J;return{value:f,done:!0}}for(A.method=Z,A.arg=J;;){var Ce=A.delegate;if(Ce){var ht=xe(Ce,A);if(ht){if(ht===K)continue;return ht}}if(A.method==="next")A.sent=A._sent=A.arg;else if(A.method==="throw"){if(W===x)throw W=X,A.arg;A.dispatchException(A.arg)}else A.method==="return"&&A.abrupt("return",A.arg);W=F;var mt=M(j,P,A);if(mt.type==="normal"){if(W=A.done?X:B,mt.arg===K)continue;return{value:mt.arg,done:A.done}}mt.type==="throw"&&(W=X,A.method="throw",A.arg=mt.arg)}}}function xe(j,P){var A=P.method,W=j.iterator[A];if(W===f)return P.delegate=null,A==="throw"&&j.iterator.return&&(P.method="return",P.arg=f,xe(j,P),P.method==="throw")||A!=="return"&&(P.method="throw",P.arg=new TypeError("The iterator does not provide a '"+A+"' method")),K;var Z=M(W,j.iterator,P.arg);if(Z.type==="throw")return P.method="throw",P.arg=Z.arg,P.delegate=null,K;var J=Z.arg;return J?J.done?(P[j.resultName]=J.value,P.next=j.nextLoc,P.method!=="return"&&(P.method="next",P.arg=f),P.delegate=null,K):J:(P.method="throw",P.arg=new TypeError("iterator result is not an object"),P.delegate=null,K)}function ot(j){var P,A={tryLoc:j[0]};1 in j&&(A.catchLoc=j[1]),2 in j&&(A.finallyLoc=j[2],A.afterLoc=j[3]),s(P=this.tryEntries).call(P,A)}function Er(j){var P=j.completion||{};P.type="normal",delete P.arg,j.completion=P}function Rt(j){this.tryEntries=[{tryLoc:"root"}],o(j).call(j,ot,this),this.reset(!0)}function st(j){if(j||j===""){var P=j[b];if(P)return P.call(j);if(typeof j.next=="function")return j;if(!isNaN(j.length)){var A=-1,W=function Z(){for(;++A=0;--Z){var J=this.tryEntries[Z],Ce=J.completion;if(J.tryLoc==="root")return W("end");if(J.tryLoc<=this.prev){var ht=g.call(J,"catchLoc"),mt=g.call(J,"finallyLoc");if(ht&&mt){if(this.prev=0;--W){var Z=this.tryEntries[W];if(Z.tryLoc<=this.prev&&g.call(Z,"finallyLoc")&&this.prev=0;--A){var W=this.tryEntries[A];if(W.finallyLoc===P)return this.complete(W.completion,W.afterLoc),Er(W),K}},catch:function(P){for(var A=this.tryEntries.length-1;A>=0;--A){var W=this.tryEntries[A];if(W.tryLoc===P){var Z=W.completion;if(Z.type==="throw"){var J=Z.arg;Er(W)}return J}}throw new Error("illegal catch attempt")},delegateYield:function(P,A,W){return this.delegate={iterator:st(P),resultName:A,nextLoc:W},this.method==="next"&&(this.arg=f),K}},v}i.exports=c,i.exports.__esModule=!0,i.exports.default=i.exports})(H_);var c8=H_.exports,fu=c8(),d8=fu;try{regeneratorRuntime=fu}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=fu:Function("r","regeneratorRuntime = r")(fu)}var $t=Y(d8),gE={exports:{}},f8=le,v8=f8(function(){if(typeof ArrayBuffer=="function"){var i=new ArrayBuffer(8);Object.isExtensible(i)&&Object.defineProperty(i,"a",{value:8})}}),p8=le,g8=it,y8=fi,nm=v8,vu=Object.isExtensible,m8=p8(function(){vu(1)}),b8=m8||nm?function(r){return!g8(r)||nm&&y8(r)==="ArrayBuffer"?!1:vu?vu(r):!0}:vu,$8=le,w8=!$8(function(){return Object.isExtensible(Object.preventExtensions({}))}),_8=U,E8=me,S8=ko,O8=it,_v=ze,T8=xt.f,am=Po,I8=Kf,Ev=b8,k8=il,P8=w8,yE=!1,Br=k8("meta"),x8=0,Sv=function(i){T8(i,Br,{value:{objectID:"O"+x8++,weakData:{}}})},C8=function(i,r){if(!O8(i))return typeof i=="symbol"?i:(typeof i=="string"?"S":"P")+i;if(!_v(i,Br)){if(!Ev(i))return"F";if(!r)return"E";Sv(i)}return i[Br].objectID},A8=function(i,r){if(!_v(i,Br)){if(!Ev(i))return!0;if(!r)return!1;Sv(i)}return i[Br].weakData},D8=function(i){return P8&&yE&&Ev(i)&&!_v(i,Br)&&Sv(i),i},R8=function(){N8.enable=function(){},yE=!0;var i=am.f,r=E8([].splice),e={};e[Br]=1,i(e).length&&(am.f=function(t){for(var n=i(t),a=0,o=n.length;a1?arguments[1]:void 0),f;f=f?f.next:d.first;)for(c(f.value,f.key,this);f&&f.removed;)f=f.previous},has:function(h){return!!u(this,h)}}),om(a,e?{get:function(h){var d=u(this,h);return d&&d.value},set:function(h,d){return s(this,h===0?0:h,d)}}:{add:function(h){return s(this,h=h===0?0:h,h)}}),Fa&&t7(a,"size",{configurable:!0,get:function(){return o(this).size}}),n},setStrong:function(i,r,e){var t=r+" Iterator",n=uc(r),a=uc(t);o7(i,r,function(o,s){um(this,{type:t,target:o,state:n(o),kind:s,last:void 0})},function(){for(var o=a(this),s=o.kind,u=o.last;u&&u.removed;)u=u.previous;return!o.target||!(o.last=u=u?u.next:o.state.first)?(o.target=void 0,js(void 0,!0)):js(s==="keys"?u.key:s==="values"?u.value:[u.key,u.value],!1)},e?"entries":"values",!e,!0),s7(r)}},u7=$E,l7=_E;u7("Map",function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},l7);var h7=$e,c7=h7.Map,d7=c7,f7=d7,v7=f7,EE=Y(v7),p7=U,g7=ma.some,y7=wl,m7=y7("some");p7({target:"Array",proto:!0,forced:!m7},{some:function(r){return g7(this,r,arguments.length>1?arguments[1]:void 0)}});var b7=ut,$7=b7("Array","some"),w7=Le,_7=$7,lc=Array.prototype,E7=function(i){var r=i.some;return i===lc||w7(lc,i)&&r===lc.some?_7:r},S7=E7,O7=S7,T7=O7,I7=Y(T7),k7=ut,P7=k7("Array","keys"),x7=P7,C7=x7,A7=zr,D7=ze,R7=Le,N7=C7,hc=Array.prototype,M7={DOMTokenList:!0,NodeList:!0},B7=function(i){var r=i.keys;return i===hc||R7(hc,i)&&r===hc.keys||D7(M7,A7(i))?N7:r},F7=B7,_n=Y(F7),lm=I0,j7=Math.floor,ef=function(i,r){var e=i.length,t=j7(e/2);return e<8?L7(i,r):z7(i,ef(lm(i,0,t),r),ef(lm(i,t),r),r)},L7=function(i,r){for(var e=i.length,t=1,n,a;t0;)i[a]=i[--a];a!==t++&&(i[a]=n)}return i},z7=function(i,r,e,t){for(var n=r.length,a=e.length,o=0,s=0;o3)){if(tV)return!0;if(gm)return gm<603;var i="",r,e,t,n;for(r=65;r<76;r++){switch(e=String.fromCharCode(r),r){case 66:case 69:case 70:case 72:t=3;break;case 68:case 71:t=4;break;default:t=2}for(n=0;n<47;n++)Zr.push({k:e+n,v:t})}for(Zr.sort(function(a,o){return o.v-a.v}),n=0;nfm(e)?1:-1}};Y7({target:"Array",proto:!0,forced:oV},{sort:function(r){r!==void 0&&X7(r);var e=J7(this);if(OE)return r===void 0?ym(e):ym(e,r);var t=[],n=dm(e),a,o;for(o=0;othis.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay=="number"&&(this._timeout=mL(function(){e.flush()},this.delay))}},{key:"flush",value:function(){var e,t;Wi(e=Vw(t=this._queue).call(t,0)).call(e,function(n){n.fn.apply(n.context||n.fn,n.args||[])})}}],[{key:"extend",value:function(e,t){var n=new i(t);if(e.flush!==void 0)throw new Error("Target object already has a property flush");e.flush=function(){n.flush()};var a=[{name:"flush",original:void 0}];if(t&&t.replace)for(var o=0;o=i.length?{done:!0}:{done:!1,value:i[t++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(i)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function hW(i,r){var e;if(i){if(typeof i=="string")return wm(i,r);var t=Ol(e=Object.prototype.toString.call(i)).call(e,8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return av(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return wm(i,r)}}function wm(i,r){(r==null||r>i.length)&&(r=i.length);for(var e=0,t=new Array(r);es&&(s=d,o=h)}return o}},{key:"min",value:function(t){var n=pc(this._pairs),a=n.next();if(a.done)return null;for(var o=a.value[1],s=t(a.value[1],a.value[0]);!(a=n.next()).done;){var u=bt(a.value,2),l=u[0],h=u[1],d=t(h,l);d=i.length?{done:!0}:{done:!1,value:i[t++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(i)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function cW(i,r){var e;if(i){if(typeof i=="string")return Om(i,r);var t=Ol(e=Object.prototype.toString.call(i)).call(e,8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return av(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Om(i,r)}}function Om(i,r){(r==null||r>i.length)&&(r=i.length);for(var e=0,t=new Array(r);e"u"||!cu||cu.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(cu(Boolean,[],function(){})),!0}catch{return!1}}function vW(i,r){return i[r]==null&&(i[r]=WV()),i}var ju=function(i){Cz(e,i);var r=dW(e);function e(t,n){var a;return el(this,e),a=r.call(this),ii(B_(a),"_queue",null),t&&!Bt(t)&&(n=t,t=[]),a._options=n||{},a._data=new EE,a.length=0,a._idProp=a._options.fieldId||"id",t&&t.length&&a.add(t),a.setOptions(n),a}return $l(e,[{key:"idProp",get:function(){return this._idProp}},{key:"setOptions",value:function(n){n&&n.queue!==void 0&&(n.queue===!1?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=UV.extend(this,{replace:["add","update","remove"]})),n.queue&&typeof n.queue=="object"&&this._queue.setOptions(n.queue)))}},{key:"add",value:function(n,a){var o=this,s=[],u;if(Bt(n)){var l=rr(n).call(n,function(c){return c[o._idProp]});if(I7(l).call(l,function(c){return o._data.has(c)}))throw new Error("A duplicate id was found in the parameter array.");for(var h=0,d=n.length;hh?1:ls)&&(o=h,s=d)}}catch(c){u.e(c)}finally{u.f()}return o||null}},{key:"min",value:function(n){var a,o=null,s=null,u=gc(mm(a=this._data).call(a)),l;try{for(u.s();!(l=u.n()).done;){var h=l.value,d=h[n];typeof d=="number"&&(s==null||d"u"&&nf!==void 0,CE={all:nf,IS_HTMLDDA:EV},AE=CE,SV=AE.all,qe=AE.IS_HTMLDDA?function(i){return typeof i=="function"||i===SV}:function(i){return typeof i=="function"},Ea={},OV=ne,Ye=!OV(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),TV=Vo,Hs=Function.prototype.call,zt=TV?Hs.bind(Hs):function(){return Hs.apply(Hs,arguments)},xl={},DE={}.propertyIsEnumerable,RE=Object.getOwnPropertyDescriptor,IV=RE&&!DE.call({1:2},1);xl.f=IV?function(r){var e=RE(this,r);return!!e&&e.enumerable}:DE;var Ko=function(i,r){return{enumerable:!(i&1),configurable:!(i&2),writable:!(i&4),value:r}},kV=oe,PV=ne,xV=zr,mc=Object,CV=kV("".split),Cl=PV(function(){return!mc("z").propertyIsEnumerable(0)})?function(i){return xV(i)==="String"?CV(i,""):mc(i)}:mc,Sa=function(i){return i==null},AV=Sa,DV=TypeError,Go=function(i){if(AV(i))throw new DV("Can't call method on "+i);return i},RV=Cl,NV=Go,wr=function(i){return RV(NV(i))},km=qe,NE=CE,MV=NE.all,Xe=NE.IS_HTMLDDA?function(i){return typeof i=="object"?i!==null:km(i)||i===MV}:function(i){return typeof i=="object"?i!==null:km(i)},ae={},bc=ae,$c=Ie,BV=qe,Pm=function(i){return BV(i)?i:void 0},Jt=function(i,r){return arguments.length<2?Pm(bc[i])||Pm($c[i]):bc[i]&&bc[i][r]||$c[i]&&$c[i][r]},FV=oe,Re=FV({}.isPrototypeOf),qo=typeof navigator<"u"&&String(navigator.userAgent)||"",ME=Ie,wc=qo,xm=ME.process,Cm=ME.Deno,Am=xm&&xm.versions||Cm&&Cm.version,Dm=Am&&Am.v8,ir,Lu;Dm&&(ir=Dm.split("."),Lu=ir[0]>0&&ir[0]<4?1:+(ir[0]+ir[1]));!Lu&&wc&&(ir=wc.match(/Edge\/(\d+)/),(!ir||ir[1]>=74)&&(ir=wc.match(/Chrome\/(\d+)/),ir&&(Lu=+ir[1])));var Yo=Lu,Rm=Yo,jV=ne,LV=Ie,zV=LV.String,Oa=!!Object.getOwnPropertySymbols&&!jV(function(){var i=Symbol("symbol detection");return!zV(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&Rm&&Rm<41}),HV=Oa,BE=HV&&!Symbol.sham&&typeof Symbol.iterator=="symbol",WV=Jt,VV=qe,UV=Re,KV=BE,GV=Object,Xo=KV?function(i){return typeof i=="symbol"}:function(i){var r=WV("Symbol");return VV(r)&&UV(r.prototype,GV(i))},qV=String,Ta=function(i){try{return qV(i)}catch{return"Object"}},YV=qe,XV=Ta,JV=TypeError,nn=function(i){if(YV(i))return i;throw new JV(XV(i)+" is not a function")},ZV=nn,QV=Sa,Iv=function(i,r){var e=i[r];return QV(e)?void 0:ZV(e)},_c=zt,Ec=qe,Sc=Xe,e9=TypeError,t9=function(i,r){var e,t;if(r==="string"&&Ec(e=i.toString)&&!Sc(t=_c(e,i))||Ec(e=i.valueOf)&&!Sc(t=_c(e,i))||r!=="string"&&Ec(e=i.toString)&&!Sc(t=_c(e,i)))return t;throw new e9("Can't convert object to primitive value")},FE={exports:{}},Nm=Ie,r9=Object.defineProperty,i9=function(i,r){try{r9(Nm,i,{value:r,configurable:!0,writable:!0})}catch{Nm[i]=r}return r},n9=Ie,a9=i9,Mm="__core-js_shared__",o9=n9[Mm]||a9(Mm,{}),kv=o9,Bm=kv;(FE.exports=function(i,r){return Bm[i]||(Bm[i]=r!==void 0?r:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Ia=FE.exports,s9=Go,u9=Object,Ct=function(i){return u9(s9(i))},l9=oe,h9=Ct,c9=l9({}.hasOwnProperty),Je=Object.hasOwn||function(r,e){return c9(h9(r),e)},d9=oe,f9=0,v9=Math.random(),p9=d9(1 .toString),Al=function(i){return"Symbol("+(i===void 0?"":i)+")_"+p9(++f9+v9,36)},g9=Ie,y9=Ia,Fm=Je,m9=Al,b9=Oa,$9=BE,jn=g9.Symbol,Oc=y9("wks"),w9=$9?jn.for||jn:jn&&jn.withoutSetter||m9,ke=function(i){return Fm(Oc,i)||(Oc[i]=b9&&Fm(jn,i)?jn[i]:w9("Symbol."+i)),Oc[i]},_9=zt,jm=Xe,Lm=Xo,E9=Iv,S9=t9,O9=ke,T9=TypeError,I9=O9("toPrimitive"),k9=function(i,r){if(!jm(i)||Lm(i))return i;var e=E9(i,I9),t;if(e){if(r===void 0&&(r="default"),t=_9(e,i,r),!jm(t)||Lm(t))return t;throw new T9("Can't convert object to primitive value")}return r===void 0&&(r="number"),S9(i,r)},P9=k9,x9=Xo,Dl=function(i){var r=P9(i,"string");return x9(r)?r:r+""},C9=Ie,zm=Xe,af=C9.document,A9=zm(af)&&zm(af.createElement),jE=function(i){return A9?af.createElement(i):{}},D9=Ye,R9=ne,N9=jE,LE=!D9&&!R9(function(){return Object.defineProperty(N9("div"),"a",{get:function(){return 7}}).a!==7}),M9=Ye,B9=zt,F9=xl,j9=Ko,L9=wr,z9=Dl,H9=Je,W9=LE,Hm=Object.getOwnPropertyDescriptor;Ea.f=M9?Hm:function(r,e){if(r=L9(r),e=z9(e),W9)try{return Hm(r,e)}catch{}if(H9(r,e))return j9(!B9(F9.f,r,e),r[e])};var V9=ne,U9=qe,K9=/#|\.prototype\./,Jo=function(i,r){var e=q9[G9(i)];return e===X9?!0:e===Y9?!1:U9(r)?V9(r):!!r},G9=Jo.normalize=function(i){return String(i).replace(K9,".").toLowerCase()},q9=Jo.data={},Y9=Jo.NATIVE="N",X9=Jo.POLYFILL="P",J9=Jo,Wm=Tv,Z9=nn,Q9=Vo,eU=Wm(Wm.bind),Zo=function(i,r){return Z9(i),r===void 0?i:Q9?eU(i,r):function(){return i.apply(r,arguments)}},Ht={},tU=Ye,rU=ne,zE=tU&&rU(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),iU=Xe,nU=String,aU=TypeError,Wt=function(i){if(iU(i))return i;throw new aU(nU(i)+" is not an object")},oU=Ye,sU=LE,uU=zE,Ws=Wt,Vm=Dl,lU=TypeError,Tc=Object.defineProperty,hU=Object.getOwnPropertyDescriptor,Ic="enumerable",kc="configurable",Pc="writable";Ht.f=oU?uU?function(r,e,t){if(Ws(r),e=Vm(e),Ws(t),typeof r=="function"&&e==="prototype"&&"value"in t&&Pc in t&&!t[Pc]){var n=hU(r,e);n&&n[Pc]&&(r[e]=t.value,t={configurable:kc in t?t[kc]:n[kc],enumerable:Ic in t?t[Ic]:n[Ic],writable:!1})}return Tc(r,e,t)}:Tc:function(r,e,t){if(Ws(r),e=Vm(e),Ws(t),sU)try{return Tc(r,e,t)}catch{}if("get"in t||"set"in t)throw new lU("Accessors not supported");return"value"in t&&(r[e]=t.value),r};var cU=Ye,dU=Ht,fU=Ko,ka=cU?function(i,r,e){return dU.f(i,r,fU(1,e))}:function(i,r,e){return i[r]=e,i},Vs=Ie,vU=Uo,pU=Tv,gU=qe,yU=Ea.f,mU=J9,En=ae,bU=Zo,Sn=ka,Um=Je,$U=function(i){var r=function(e,t,n){if(this instanceof r){switch(arguments.length){case 0:return new i;case 1:return new i(e);case 2:return new i(e,t)}return new i(e,t,n)}return vU(i,this,arguments)};return r.prototype=i.prototype,r},q=function(i,r){var e=i.target,t=i.global,n=i.stat,a=i.proto,o=t?Vs:n?Vs[e]:(Vs[e]||{}).prototype,s=t?En:En[e]||Sn(En,e,{})[e],u=s.prototype,l,h,d,c,f,v,p,g,y;for(c in r)l=mU(t?c:e+(n?".":"#")+c,i.forced),h=!l&&o&&Um(o,c),v=s[c],h&&(i.dontCallGetSet?(y=yU(o,c),p=y&&y.value):p=o[c]),f=h&&p?p:r[c],!(h&&typeof v==typeof f)&&(i.bind&&h?g=bU(f,Vs):i.wrap&&h?g=$U(f):a&&gU(f)?g=pU(f):g=f,(i.sham||f&&f.sham||v&&v.sham)&&Sn(g,"sham",!0),Sn(s,c,g),a&&(d=e+"Prototype",Um(En,d)||Sn(En,d,{}),Sn(En[d],c,f),i.real&&u&&(l||!u[c])&&Sn(u,c,f)))},wU=Math.ceil,_U=Math.floor,EU=Math.trunc||function(r){var e=+r;return(e>0?_U:wU)(e)},SU=EU,Rl=function(i){var r=+i;return r!==r||r===0?0:SU(r)},OU=Rl,TU=Math.max,IU=Math.min,Qo=function(i,r){var e=OU(i);return e<0?TU(e+r,0):IU(e,r)},kU=Rl,PU=Math.min,xU=function(i){return i>0?PU(kU(i),9007199254740991):0},CU=xU,Zt=function(i){return CU(i.length)},AU=wr,DU=Qo,RU=Zt,Km=function(i){return function(r,e,t){var n=AU(r),a=RU(n),o=DU(t,a),s;if(i&&e!==e){for(;a>o;)if(s=n[o++],s!==s)return!0}else for(;a>o;o++)if((i||o in n)&&n[o]===e)return i||o||0;return!i&&-1}},Pv={includes:Km(!0),indexOf:Km(!1)},es={},NU=oe,xc=Je,MU=wr,BU=Pv.indexOf,FU=es,Gm=NU([].push),HE=function(i,r){var e=MU(i),t=0,n=[],a;for(a in e)!xc(FU,a)&&xc(e,a)&&Gm(n,a);for(;r.length>t;)xc(e,a=r[t++])&&(~BU(n,a)||Gm(n,a));return n},xv=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],jU=HE,LU=xv,Nl=Object.keys||function(r){return jU(r,LU)},ts={};ts.f=Object.getOwnPropertySymbols;var qm=Ye,zU=oe,HU=zt,WU=ne,Cc=Nl,VU=ts,UU=xl,KU=Ct,GU=Cl,On=Object.assign,Ym=Object.defineProperty,qU=zU([].concat),YU=!On||WU(function(){if(qm&&On({b:1},On(Ym({},"a",{enumerable:!0,get:function(){Ym(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var i={},r={},e=Symbol("assign detection"),t="abcdefghijklmnopqrst";return i[e]=7,t.split("").forEach(function(n){r[n]=n}),On({},i)[e]!==7||Cc(On({},r)).join("")!==t})?function(r,e){for(var t=KU(r),n=arguments.length,a=1,o=VU.f,s=UU.f;n>a;)for(var u=GU(arguments[a++]),l=o?qU(Cc(u),o(u)):Cc(u),h=l.length,d=0,c;h>d;)c=l[d++],(!qm||HU(s,u,c))&&(t[c]=u[c]);return t}:On,XU=q,Xm=YU;XU({target:"Object",stat:!0,arity:2,forced:Object.assign!==Xm},{assign:Xm});var JU=ae,ZU=JU.Object.assign,QU=ZU,eK=QU,tK=eK,Fe=W(tK),rK=oe,Ml=rK([].slice),WE=oe,iK=nn,nK=Xe,aK=Je,Jm=Ml,oK=Vo,VE=Function,sK=WE([].concat),uK=WE([].join),Ac={},lK=function(i,r,e){if(!aK(Ac,r)){for(var t=[],n=0;n=.1;)v=+a[d++%o],v>h&&(v=h),f=Math.sqrt(v*v/(1+l*l)),f=s<0?-f:f,r+=f,e+=l*f,c===!0?i.lineTo(r,e):i.moveTo(r,e),h-=v,c=!c}function SK(i,r,e,t){i.beginPath();var n=6,a=Math.PI*2/n;i.moveTo(r+t,e);for(var o=1;o1?e-1:0),n=1;n=a?i?"":void 0:(o=eb(t,n),o<55296||o>56319||n+1===a||(s=eb(t,n+1))<56320||s>57343?i?zK(t,n):o:i?HK(t,n,n+2):(o-55296<<10)+(s-56320)+65536)}},WK={codeAt:tb(!1),charAt:tb(!0)},VK=Ie,UK=qe,rb=VK.WeakMap,QE=UK(rb)&&/native code/.test(String(rb)),KK=Ia,GK=Al,ib=KK("keys"),Bl=function(i){return ib[i]||(ib[i]=GK(i))},qK=QE,eS=Ie,YK=Xe,XK=ka,Rc=Je,Nc=kv,JK=Bl,ZK=es,nb="Object already initialized",sf=eS.TypeError,QK=eS.WeakMap,zu,go,Hu,eG=function(i){return Hu(i)?go(i):zu(i,{})},tG=function(i){return function(r){var e;if(!YK(r)||(e=go(r)).type!==i)throw new sf("Incompatible receiver, "+i+" required");return e}};if(qK||Nc.state){var cr=Nc.state||(Nc.state=new QK);cr.get=cr.get,cr.has=cr.has,cr.set=cr.set,zu=function(i,r){if(cr.has(i))throw new sf(nb);return r.facade=i,cr.set(i,r),r},go=function(i){return cr.get(i)||{}},Hu=function(i){return cr.has(i)}}else{var Tn=JK("state");ZK[Tn]=!0,zu=function(i,r){if(Rc(i,Tn))throw new sf(nb);return r.facade=i,XK(i,Tn,r),r},go=function(i){return Rc(i,Tn)?i[Tn]:{}},Hu=function(i){return Rc(i,Tn)}}var on={set:zu,get:go,has:Hu,enforce:eG,getterFor:tG},uf=Ye,rG=Je,tS=Function.prototype,iG=uf&&Object.getOwnPropertyDescriptor,Rv=rG(tS,"name"),nG=Rv&&function(){}.name==="something",aG=Rv&&(!uf||uf&&iG(tS,"name").configurable),oG={EXISTS:Rv,PROPER:nG,CONFIGURABLE:aG},Fl={},sG=Ye,uG=zE,lG=Ht,hG=Wt,cG=wr,dG=Nl;Fl.f=sG&&!uG?Object.defineProperties:function(r,e){hG(r);for(var t=cG(e),n=dG(e),a=n.length,o=0,s;a>o;)lG.f(r,s=n[o++],t[s]);return r};var fG=Jt,vG=fG("document","documentElement"),pG=Wt,gG=Fl,ab=xv,yG=es,mG=vG,bG=jE,$G=Bl,ob=">",sb="<",lf="prototype",hf="script",rS=$G("IE_PROTO"),Mc=function(){},iS=function(i){return sb+hf+ob+i+sb+"/"+hf+ob},ub=function(i){i.write(iS("")),i.close();var r=i.parentWindow.Object;return i=null,r},wG=function(){var i=bG("iframe"),r="java"+hf+":",e;return i.style.display="none",mG.appendChild(i),i.src=String(r),e=i.contentWindow.document,e.open(),e.write(iS("document.F=Object")),e.close(),e.F},Us,gu=function(){try{Us=new ActiveXObject("htmlfile")}catch{}gu=typeof document<"u"?document.domain&&Us?ub(Us):wG():ub(Us);for(var i=ab.length;i--;)delete gu[lf][ab[i]];return gu()};yG[rS]=!0;var Pa=Object.create||function(r,e){var t;return r!==null?(Mc[lf]=pG(r),t=new Mc,Mc[lf]=null,t[rS]=r):t=gu(),e===void 0?t:gG.f(t,e)},_G=ne,nS=!_G(function(){function i(){}return i.prototype.constructor=null,Object.getPrototypeOf(new i)!==i.prototype}),EG=Je,SG=qe,OG=Ct,TG=Bl,IG=nS,lb=TG("IE_PROTO"),cf=Object,kG=cf.prototype,jl=IG?cf.getPrototypeOf:function(i){var r=OG(i);if(EG(r,lb))return r[lb];var e=r.constructor;return SG(e)&&r instanceof e?e.prototype:r instanceof cf?kG:null},PG=ka,rs=function(i,r,e,t){return t&&t.enumerable?i[r]=e:PG(i,r,e),i},xG=ne,CG=qe,AG=Xe,DG=Pa,hb=jl,RG=rs,NG=ke,df=NG("iterator"),aS=!1,xr,Bc,Fc;[].keys&&(Fc=[].keys(),"next"in Fc?(Bc=hb(hb(Fc)),Bc!==Object.prototype&&(xr=Bc)):aS=!0);var MG=!AG(xr)||xG(function(){var i={};return xr[df].call(i)!==i});MG?xr={}:xr=DG(xr);CG(xr[df])||RG(xr,df,function(){return this});var oS={IteratorPrototype:xr,BUGGY_SAFARI_ITERATORS:aS},BG=Av,FG=an,jG=BG?{}.toString:function(){return"[object "+FG(this)+"]"},LG=Av,zG=Ht.f,HG=ka,WG=Je,VG=jG,UG=ke,cb=UG("toStringTag"),xa=function(i,r,e,t){if(i){var n=e?i:i.prototype;WG(n,cb)||zG(n,cb,{configurable:!0,value:r}),t&&!LG&&HG(n,"toString",VG)}},Ca={},KG=oS.IteratorPrototype,GG=Pa,qG=Ko,YG=xa,XG=Ca,JG=function(){return this},ZG=function(i,r,e,t){var n=r+" Iterator";return i.prototype=GG(KG,{next:qG(+!t,e)}),YG(i,n,!1,!0),XG[n]=JG,i},QG=oe,eq=nn,tq=function(i,r,e){try{return QG(eq(Object.getOwnPropertyDescriptor(i,r)[e]))}catch{}},rq=qe,iq=String,nq=TypeError,aq=function(i){if(typeof i=="object"||rq(i))return i;throw new nq("Can't set "+iq(i)+" as a prototype")},oq=tq,sq=Wt,uq=aq,lq=Object.setPrototypeOf||("__proto__"in{}?function(){var i=!1,r={},e;try{e=oq(Object.prototype,"__proto__","set"),e(r,[]),i=r instanceof Array}catch{}return function(n,a){return sq(n),uq(a),i?e(n,a):n.__proto__=a,n}}():void 0),hq=q,cq=zt,dq=oG,fq=ZG,vq=jl,pq=xa,db=rs,gq=ke,fb=Ca,yq=oS,mq=dq.PROPER,Ks=yq.BUGGY_SAFARI_ITERATORS,jc=gq("iterator"),vb="keys",Gs="values",pb="entries",bq=function(){return this},Nv=function(i,r,e,t,n,a,o){fq(e,r,t);var s=function(y){if(y===n&&c)return c;if(!Ks&&y&&y in h)return h[y];switch(y){case vb:return function(){return new e(this,y)};case Gs:return function(){return new e(this,y)};case pb:return function(){return new e(this,y)}}return function(){return new e(this)}},u=r+" Iterator",l=!1,h=i.prototype,d=h[jc]||h["@@iterator"]||n&&h[n],c=!Ks&&d||s(n),f=r==="Array"&&h.entries||d,v,p,g;if(f&&(v=vq(f.call(new i)),v!==Object.prototype&&v.next&&(pq(v,u,!0,!0),fb[u]=bq)),mq&&n===Gs&&d&&d.name!==Gs&&(l=!0,c=function(){return cq(d,this)}),n)if(p={values:s(Gs),keys:a?c:s(vb),entries:s(pb)},o)for(g in p)(Ks||l||!(g in h))&&db(h,g,p[g]);else hq({target:r,proto:!0,forced:Ks||l},p);return o&&h[jc]!==c&&db(h,jc,c,{name:n}),fb[r]=c,p},Mv=function(i,r){return{value:i,done:r}},$q=WK.charAt,wq=_r,sS=on,_q=Nv,gb=Mv,uS="String Iterator",Eq=sS.set,Sq=sS.getterFor(uS);_q(String,"String",function(i){Eq(this,{type:uS,string:wq(i),index:0})},function(){var r=Sq(this),e=r.string,t=r.index,n;return t>=e.length?gb(void 0,!0):(n=$q(e,t),r.index+=n.length,gb(n,!1))});var Oq=zt,yb=Wt,Tq=Iv,lS=function(i,r,e){var t,n;yb(i);try{if(t=Tq(i,"return"),!t){if(r==="throw")throw e;return e}t=Oq(t,i)}catch(a){n=!0,t=a}if(r==="throw")throw e;if(n)throw t;return yb(t),e},Iq=Wt,kq=lS,Pq=function(i,r,e,t){try{return t?r(Iq(e)[0],e[1]):r(e)}catch(n){kq(i,"throw",n)}},xq=ke,Cq=Ca,Aq=xq("iterator"),Dq=Array.prototype,hS=function(i){return i!==void 0&&(Cq.Array===i||Dq[Aq]===i)},Rq=oe,Nq=qe,ff=kv,Mq=Rq(Function.toString);Nq(ff.inspectSource)||(ff.inspectSource=function(i){return Mq(i)});var Bq=ff.inspectSource,Fq=oe,jq=ne,cS=qe,Lq=an,zq=Jt,Hq=Bq,dS=function(){},Wq=[],fS=zq("Reflect","construct"),Bv=/^\s*(?:class|function)\b/,Vq=Fq(Bv.exec),Uq=!Bv.test(dS),ja=function(r){if(!cS(r))return!1;try{return fS(dS,Wq,r),!0}catch{return!1}},vS=function(r){if(!cS(r))return!1;switch(Lq(r)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Uq||!!Vq(Bv,Hq(r))}catch{return!0}};vS.sham=!0;var Ll=!fS||jq(function(){var i;return ja(ja.call)||!ja(Object)||!ja(function(){i=!0})||i})?vS:ja,Kq=Dl,Gq=Ht,qq=Ko,Aa=function(i,r,e){var t=Kq(r);t in i?Gq.f(i,t,qq(0,e)):i[t]=e},Yq=an,mb=Iv,Xq=Sa,Jq=Ca,Zq=ke,Qq=Zq("iterator"),zl=function(i){if(!Xq(i))return mb(i,Qq)||mb(i,"@@iterator")||Jq[Yq(i)]},eY=zt,tY=nn,rY=Wt,iY=Ta,nY=zl,aY=TypeError,pS=function(i,r){var e=arguments.length<2?nY(i):r;if(tY(e))return rY(eY(e,i));throw new aY(iY(i)+" is not iterable")},oY=Zo,sY=zt,uY=Ct,lY=Pq,hY=hS,cY=Ll,dY=Zt,bb=Aa,fY=pS,vY=zl,$b=Array,pY=function(r){var e=uY(r),t=cY(this),n=arguments.length,a=n>1?arguments[1]:void 0,o=a!==void 0;o&&(a=oY(a,n>2?arguments[2]:void 0));var s=vY(e),u=0,l,h,d,c,f,v;if(s&&!(this===$b&&hY(s)))for(c=fY(e,s),f=c.next,h=t?new this:[];!(d=sY(f,c)).done;u++)v=o?lY(c,a,[d.value,u],!0):d.value,bb(h,u,v);else for(l=dY(e),h=t?new this(l):$b(l);l>u;u++)v=o?a(e[u],u):e[u],bb(h,u,v);return h.length=u,h},gY=ke,gS=gY("iterator"),yS=!1;try{var yY=0,wb={next:function(){return{done:!!yY++}},return:function(){yS=!0}};wb[gS]=function(){return this},Array.from(wb,function(){throw 2})}catch{}var mY=function(i,r){try{if(!r&&!yS)return!1}catch{return!1}var e=!1;try{var t={};t[gS]=function(){return{next:function(){return{done:e=!0}}}},i(t)}catch{}return e},bY=q,$Y=pY,wY=mY,_Y=!wY(function(i){Array.from(i)});bY({target:"Array",stat:!0,forced:_Y},{from:$Y});var EY=ae,SY=EY.Array.from,OY=SY,mS=OY,TY=mS,sn=W(TY),IY=wr,_b=Ca,bS=on;Ht.f;var kY=Nv,qs=Mv,$S="Array Iterator",PY=bS.set,xY=bS.getterFor($S);kY(Array,"Array",function(i,r){PY(this,{type:$S,target:IY(i),index:0,kind:r})},function(){var i=xY(this),r=i.target,e=i.kind,t=i.index++;if(!r||t>=r.length)return i.target=void 0,qs(void 0,!0);switch(e){case"keys":return qs(t,!1);case"values":return qs(r[t],!1)}return qs([t,r[t]],!1)},"values");_b.Arguments=_b.Array;var CY=zl,AY=CY,DY={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},RY=DY,NY=Ie,MY=an,BY=ka,Eb=Ca,FY=ke,Sb=FY("toStringTag");for(var Lc in RY){var Ob=NY[Lc],zc=Ob&&Ob.prototype;zc&&MY(zc)!==Sb&&BY(zc,Sb,Lc),Eb[Lc]=Eb.Array}var jY=AY,LY=jY,zY=LY,HY=zY,WY=HY,VY=WY,wS=VY,_S=W(wS),UY=wS,un=W(UY);function N(i,r){if(!(i instanceof r))throw new TypeError("Cannot call a class as a function")}var ES={exports:{}},KY=q,GY=Ye,Tb=Ht.f;KY({target:"Object",stat:!0,forced:Object.defineProperty!==Tb,sham:!GY},{defineProperty:Tb});var qY=ae,SS=qY.Object,YY=ES.exports=function(r,e,t){return SS.defineProperty(r,e,t)};SS.defineProperty.sham&&(YY.sham=!0);var XY=ES.exports,JY=XY,OS=JY,ZY=OS,QY=ZY,eX=QY,tX=eX,rX=tX,Hl=W(rX),iX=zr,ln=Array.isArray||function(r){return iX(r)==="Array"},nX=TypeError,aX=9007199254740991,Fv=function(i){if(i>aX)throw nX("Maximum allowed index exceeded");return i},Ib=ln,oX=Ll,sX=Xe,uX=ke,lX=uX("species"),kb=Array,hX=function(i){var r;return Ib(i)&&(r=i.constructor,oX(r)&&(r===kb||Ib(r.prototype))?r=void 0:sX(r)&&(r=r[lX],r===null&&(r=void 0))),r===void 0?kb:r},cX=hX,jv=function(i,r){return new(cX(i))(r===0?0:r)},dX=ne,fX=ke,vX=Yo,pX=fX("species"),is=function(i){return vX>=51||!dX(function(){var r=[],e=r.constructor={};return e[pX]=function(){return{foo:1}},r[i](Boolean).foo!==1})},gX=q,yX=ne,mX=ln,bX=Xe,$X=Ct,wX=Zt,Pb=Fv,xb=Aa,_X=jv,EX=is,SX=ke,OX=Yo,TS=SX("isConcatSpreadable"),TX=OX>=51||!yX(function(){var i=[];return i[TS]=!1,i.concat()[0]!==i}),IX=function(i){if(!bX(i))return!1;var r=i[TS];return r!==void 0?!!r:mX(i)},kX=!TX||!EX("concat");gX({target:"Array",proto:!0,arity:1,forced:kX},{concat:function(r){var e=$X(this),t=_X(e,0),n=0,a,o,s,u,l;for(a=-1,s=arguments.length;ag;g++)if((s||g in f)&&(b=f[g],$=v(b,g,c),i))if(r)m[g]=$;else if($)switch(i){case 3:return!0;case 5:return b;case 6:return g;case 2:Db(m,b)}else switch(i){case 4:return!1;case 7:Db(m,b)}return a?-1:t||n?n:m}},yi={forEach:Vr(0),map:Vr(1),filter:Vr(2),some:Vr(3),every:Vr(4),find:Vr(5),findIndex:Vr(6),filterReject:Vr(7)},Vl=q,Ul=Ie,zv=zt,tJ=oe,ta=Ye,ra=Oa,rJ=ne,Ue=Je,iJ=Re,vf=Wt,Kl=wr,Hv=Dl,nJ=_r,pf=Ko,yo=Pa,CS=Nl,aJ=ns,AS=Wl,oJ=ts,DS=Ea,RS=Ht,sJ=Fl,NS=xl,Rb=rs,uJ=Lv,Wv=Ia,lJ=Bl,MS=es,Nb=Al,hJ=ke,cJ=as,dJ=Pe,fJ=xS,vJ=xa,BS=on,Gl=yi.forEach,St=lJ("hidden"),ql="Symbol",mo="prototype",pJ=BS.set,Mb=BS.getterFor(ql),or=Object[mo],Ri=Ul.Symbol,Ka=Ri&&Ri[mo],gJ=Ul.RangeError,yJ=Ul.TypeError,Hc=Ul.QObject,FS=DS.f,Ni=RS.f,jS=AS.f,mJ=NS.f,LS=tJ([].push),Br=Wv("symbols"),os=Wv("op-symbols"),bJ=Wv("wks"),gf=!Hc||!Hc[mo]||!Hc[mo].findChild,zS=function(i,r,e){var t=FS(or,r);t&&delete or[r],Ni(i,r,e),t&&i!==or&&Ni(or,r,t)},yf=ta&&rJ(function(){return yo(Ni({},"a",{get:function(){return Ni(this,"a",{value:7}).a}})).a!==7})?zS:Ni,Wc=function(i,r){var e=Br[i]=yo(Ka);return pJ(e,{type:ql,tag:i,description:r}),ta||(e.description=r),e},Yl=function(r,e,t){r===or&&Yl(os,e,t),vf(r);var n=Hv(e);return vf(t),Ue(Br,n)?(t.enumerable?(Ue(r,St)&&r[St][n]&&(r[St][n]=!1),t=yo(t,{enumerable:pf(0,!1)})):(Ue(r,St)||Ni(r,St,pf(1,{})),r[St][n]=!0),yf(r,n,t)):Ni(r,n,t)},Vv=function(r,e){vf(r);var t=Kl(e),n=CS(t).concat(US(t));return Gl(n,function(a){(!ta||zv(HS,t,a))&&Yl(r,a,t[a])}),r},$J=function(r,e){return e===void 0?yo(r):Vv(yo(r),e)},HS=function(r){var e=Hv(r),t=zv(mJ,this,e);return this===or&&Ue(Br,e)&&!Ue(os,e)?!1:t||!Ue(this,e)||!Ue(Br,e)||Ue(this,St)&&this[St][e]?t:!0},WS=function(r,e){var t=Kl(r),n=Hv(e);if(!(t===or&&Ue(Br,n)&&!Ue(os,n))){var a=FS(t,n);return a&&Ue(Br,n)&&!(Ue(t,St)&&t[St][n])&&(a.enumerable=!0),a}},VS=function(r){var e=jS(Kl(r)),t=[];return Gl(e,function(n){!Ue(Br,n)&&!Ue(MS,n)&&LS(t,n)}),t},US=function(i){var r=i===or,e=jS(r?os:Kl(i)),t=[];return Gl(e,function(n){Ue(Br,n)&&(!r||Ue(or,n))&&LS(t,Br[n])}),t};ra||(Ri=function(){if(iJ(Ka,this))throw new yJ("Symbol is not a constructor");var r=!arguments.length||arguments[0]===void 0?void 0:nJ(arguments[0]),e=Nb(r),t=function(n){this===or&&zv(t,os,n),Ue(this,St)&&Ue(this[St],e)&&(this[St][e]=!1);var a=pf(1,n);try{yf(this,e,a)}catch(o){if(!(o instanceof gJ))throw o;zS(this,e,a)}};return ta&&gf&&yf(or,e,{configurable:!0,set:t}),Wc(e,r)},Ka=Ri[mo],Rb(Ka,"toString",function(){return Mb(this).tag}),Rb(Ri,"withoutSetter",function(i){return Wc(Nb(i),i)}),NS.f=HS,RS.f=Yl,sJ.f=Vv,DS.f=WS,aJ.f=AS.f=VS,oJ.f=US,cJ.f=function(i){return Wc(hJ(i),i)},ta&&uJ(Ka,"description",{configurable:!0,get:function(){return Mb(this).description}}));Vl({global:!0,constructor:!0,wrap:!0,forced:!ra,sham:!ra},{Symbol:Ri});Gl(CS(bJ),function(i){dJ(i)});Vl({target:ql,stat:!0,forced:!ra},{useSetter:function(){gf=!0},useSimple:function(){gf=!1}});Vl({target:"Object",stat:!0,forced:!ra,sham:!ta},{create:$J,defineProperty:Yl,defineProperties:Vv,getOwnPropertyDescriptor:WS});Vl({target:"Object",stat:!0,forced:!ra},{getOwnPropertyNames:VS});fJ();vJ(Ri,ql);MS[St]=!0;var wJ=Oa,KS=wJ&&!!Symbol.for&&!!Symbol.keyFor,_J=q,EJ=Jt,SJ=Je,OJ=_r,GS=Ia,TJ=KS,Vc=GS("string-to-symbol-registry"),IJ=GS("symbol-to-string-registry");_J({target:"Symbol",stat:!0,forced:!TJ},{for:function(i){var r=OJ(i);if(SJ(Vc,r))return Vc[r];var e=EJ("Symbol")(r);return Vc[r]=e,IJ[e]=r,e}});var kJ=q,PJ=Je,xJ=Xo,CJ=Ta,AJ=Ia,DJ=KS,Bb=AJ("symbol-to-string-registry");kJ({target:"Symbol",stat:!0,forced:!DJ},{keyFor:function(r){if(!xJ(r))throw new TypeError(CJ(r)+" is not a symbol");if(PJ(Bb,r))return Bb[r]}});var RJ=oe,Fb=ln,NJ=qe,jb=zr,MJ=_r,Lb=RJ([].push),BJ=function(i){if(NJ(i))return i;if(Fb(i)){for(var r=i.length,e=[],t=0;ti.length)&&(r=i.length);for(var e=0,t=new Array(r);e"u"&&nf!==void 0,CE={all:nf,IS_HTMLDDA:EW},AE=CE,SW=AE.all,qe=AE.IS_HTMLDDA?function(i){return typeof i=="function"||i===SW}:function(i){return typeof i=="function"},Ea={},OW=ne,Ye=!OW(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),TW=Wo,Hs=Function.prototype.call,zt=TW?Hs.bind(Hs):function(){return Hs.apply(Hs,arguments)},xl={},DE={}.propertyIsEnumerable,RE=Object.getOwnPropertyDescriptor,IW=RE&&!DE.call({1:2},1);xl.f=IW?function(r){var e=RE(this,r);return!!e&&e.enumerable}:DE;var Ko=function(i,r){return{enumerable:!(i&1),configurable:!(i&2),writable:!(i&4),value:r}},kW=se,PW=ne,xW=Hr,mc=Object,CW=kW("".split),Cl=PW(function(){return!mc("z").propertyIsEnumerable(0)})?function(i){return xW(i)==="String"?CW(i,""):mc(i)}:mc,Sa=function(i){return i==null},AW=Sa,DW=TypeError,Go=function(i){if(AW(i))throw new DW("Can't call method on "+i);return i},RW=Cl,NW=Go,wr=function(i){return RW(NW(i))},km=qe,NE=CE,MW=NE.all,Xe=NE.IS_HTMLDDA?function(i){return typeof i=="object"?i!==null:km(i)||i===MW}:function(i){return typeof i=="object"?i!==null:km(i)},ae={},bc=ae,$c=Ie,BW=qe,Pm=function(i){return BW(i)?i:void 0},Jt=function(i,r){return arguments.length<2?Pm(bc[i])||Pm($c[i]):bc[i]&&bc[i][r]||$c[i]&&$c[i][r]},FW=se,Re=FW({}.isPrototypeOf),qo=typeof navigator<"u"&&String(navigator.userAgent)||"",ME=Ie,wc=qo,xm=ME.process,Cm=ME.Deno,Am=xm&&xm.versions||Cm&&Cm.version,Dm=Am&&Am.v8,ir,Lu;Dm&&(ir=Dm.split("."),Lu=ir[0]>0&&ir[0]<4?1:+(ir[0]+ir[1]));!Lu&&wc&&(ir=wc.match(/Edge\/(\d+)/),(!ir||ir[1]>=74)&&(ir=wc.match(/Chrome\/(\d+)/),ir&&(Lu=+ir[1])));var Yo=Lu,Rm=Yo,jW=ne,LW=Ie,zW=LW.String,Oa=!!Object.getOwnPropertySymbols&&!jW(function(){var i=Symbol("symbol detection");return!zW(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&Rm&&Rm<41}),HW=Oa,BE=HW&&!Symbol.sham&&typeof Symbol.iterator=="symbol",VW=Jt,WW=qe,UW=Re,KW=BE,GW=Object,Xo=KW?function(i){return typeof i=="symbol"}:function(i){var r=VW("Symbol");return WW(r)&&UW(r.prototype,GW(i))},qW=String,Ta=function(i){try{return qW(i)}catch{return"Object"}},YW=qe,XW=Ta,JW=TypeError,sn=function(i){if(YW(i))return i;throw new JW(XW(i)+" is not a function")},ZW=sn,QW=Sa,Iv=function(i,r){var e=i[r];return QW(e)?void 0:ZW(e)},_c=zt,Ec=qe,Sc=Xe,e9=TypeError,t9=function(i,r){var e,t;if(r==="string"&&Ec(e=i.toString)&&!Sc(t=_c(e,i))||Ec(e=i.valueOf)&&!Sc(t=_c(e,i))||r!=="string"&&Ec(e=i.toString)&&!Sc(t=_c(e,i)))return t;throw new e9("Can't convert object to primitive value")},FE={exports:{}},Nm=Ie,r9=Object.defineProperty,i9=function(i,r){try{r9(Nm,i,{value:r,configurable:!0,writable:!0})}catch{Nm[i]=r}return r},n9=Ie,a9=i9,Mm="__core-js_shared__",o9=n9[Mm]||a9(Mm,{}),kv=o9,Bm=kv;(FE.exports=function(i,r){return Bm[i]||(Bm[i]=r!==void 0?r:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Ia=FE.exports,s9=Go,u9=Object,Ct=function(i){return u9(s9(i))},l9=se,h9=Ct,c9=l9({}.hasOwnProperty),Je=Object.hasOwn||function(r,e){return c9(h9(r),e)},d9=se,f9=0,v9=Math.random(),p9=d9(1 .toString),Al=function(i){return"Symbol("+(i===void 0?"":i)+")_"+p9(++f9+v9,36)},g9=Ie,y9=Ia,Fm=Je,m9=Al,b9=Oa,$9=BE,jn=g9.Symbol,Oc=y9("wks"),w9=$9?jn.for||jn:jn&&jn.withoutSetter||m9,ke=function(i){return Fm(Oc,i)||(Oc[i]=b9&&Fm(jn,i)?jn[i]:w9("Symbol."+i)),Oc[i]},_9=zt,jm=Xe,Lm=Xo,E9=Iv,S9=t9,O9=ke,T9=TypeError,I9=O9("toPrimitive"),k9=function(i,r){if(!jm(i)||Lm(i))return i;var e=E9(i,I9),t;if(e){if(r===void 0&&(r="default"),t=_9(e,i,r),!jm(t)||Lm(t))return t;throw new T9("Can't convert object to primitive value")}return r===void 0&&(r="number"),S9(i,r)},P9=k9,x9=Xo,Dl=function(i){var r=P9(i,"string");return x9(r)?r:r+""},C9=Ie,zm=Xe,af=C9.document,A9=zm(af)&&zm(af.createElement),jE=function(i){return A9?af.createElement(i):{}},D9=Ye,R9=ne,N9=jE,LE=!D9&&!R9(function(){return Object.defineProperty(N9("div"),"a",{get:function(){return 7}}).a!==7}),M9=Ye,B9=zt,F9=xl,j9=Ko,L9=wr,z9=Dl,H9=Je,V9=LE,Hm=Object.getOwnPropertyDescriptor;Ea.f=M9?Hm:function(r,e){if(r=L9(r),e=z9(e),V9)try{return Hm(r,e)}catch{}if(H9(r,e))return j9(!B9(F9.f,r,e),r[e])};var W9=ne,U9=qe,K9=/#|\.prototype\./,Jo=function(i,r){var e=q9[G9(i)];return e===X9?!0:e===Y9?!1:U9(r)?W9(r):!!r},G9=Jo.normalize=function(i){return String(i).replace(K9,".").toLowerCase()},q9=Jo.data={},Y9=Jo.NATIVE="N",X9=Jo.POLYFILL="P",J9=Jo,Vm=Tv,Z9=sn,Q9=Wo,eU=Vm(Vm.bind),Zo=function(i,r){return Z9(i),r===void 0?i:Q9?eU(i,r):function(){return i.apply(r,arguments)}},Ht={},tU=Ye,rU=ne,zE=tU&&rU(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),iU=Xe,nU=String,aU=TypeError,Vt=function(i){if(iU(i))return i;throw new aU(nU(i)+" is not an object")},oU=Ye,sU=LE,uU=zE,Vs=Vt,Wm=Dl,lU=TypeError,Tc=Object.defineProperty,hU=Object.getOwnPropertyDescriptor,Ic="enumerable",kc="configurable",Pc="writable";Ht.f=oU?uU?function(r,e,t){if(Vs(r),e=Wm(e),Vs(t),typeof r=="function"&&e==="prototype"&&"value"in t&&Pc in t&&!t[Pc]){var n=hU(r,e);n&&n[Pc]&&(r[e]=t.value,t={configurable:kc in t?t[kc]:n[kc],enumerable:Ic in t?t[Ic]:n[Ic],writable:!1})}return Tc(r,e,t)}:Tc:function(r,e,t){if(Vs(r),e=Wm(e),Vs(t),sU)try{return Tc(r,e,t)}catch{}if("get"in t||"set"in t)throw new lU("Accessors not supported");return"value"in t&&(r[e]=t.value),r};var cU=Ye,dU=Ht,fU=Ko,ka=cU?function(i,r,e){return dU.f(i,r,fU(1,e))}:function(i,r,e){return i[r]=e,i},Ws=Ie,vU=Uo,pU=Tv,gU=qe,yU=Ea.f,mU=J9,En=ae,bU=Zo,Sn=ka,Um=Je,$U=function(i){var r=function(e,t,n){if(this instanceof r){switch(arguments.length){case 0:return new i;case 1:return new i(e);case 2:return new i(e,t)}return new i(e,t,n)}return vU(i,this,arguments)};return r.prototype=i.prototype,r},q=function(i,r){var e=i.target,t=i.global,n=i.stat,a=i.proto,o=t?Ws:n?Ws[e]:(Ws[e]||{}).prototype,s=t?En:En[e]||Sn(En,e,{})[e],u=s.prototype,l,h,d,c,f,v,p,g,y;for(c in r)l=mU(t?c:e+(n?".":"#")+c,i.forced),h=!l&&o&&Um(o,c),v=s[c],h&&(i.dontCallGetSet?(y=yU(o,c),p=y&&y.value):p=o[c]),f=h&&p?p:r[c],!(h&&typeof v==typeof f)&&(i.bind&&h?g=bU(f,Ws):i.wrap&&h?g=$U(f):a&&gU(f)?g=pU(f):g=f,(i.sham||f&&f.sham||v&&v.sham)&&Sn(g,"sham",!0),Sn(s,c,g),a&&(d=e+"Prototype",Um(En,d)||Sn(En,d,{}),Sn(En[d],c,f),i.real&&u&&(l||!u[c])&&Sn(u,c,f)))},wU=Math.ceil,_U=Math.floor,EU=Math.trunc||function(r){var e=+r;return(e>0?_U:wU)(e)},SU=EU,Rl=function(i){var r=+i;return r!==r||r===0?0:SU(r)},OU=Rl,TU=Math.max,IU=Math.min,Qo=function(i,r){var e=OU(i);return e<0?TU(e+r,0):IU(e,r)},kU=Rl,PU=Math.min,xU=function(i){return i>0?PU(kU(i),9007199254740991):0},CU=xU,Zt=function(i){return CU(i.length)},AU=wr,DU=Qo,RU=Zt,Km=function(i){return function(r,e,t){var n=AU(r),a=RU(n),o=DU(t,a),s;if(i&&e!==e){for(;a>o;)if(s=n[o++],s!==s)return!0}else for(;a>o;o++)if((i||o in n)&&n[o]===e)return i||o||0;return!i&&-1}},Pv={includes:Km(!0),indexOf:Km(!1)},es={},NU=se,xc=Je,MU=wr,BU=Pv.indexOf,FU=es,Gm=NU([].push),HE=function(i,r){var e=MU(i),t=0,n=[],a;for(a in e)!xc(FU,a)&&xc(e,a)&&Gm(n,a);for(;r.length>t;)xc(e,a=r[t++])&&(~BU(n,a)||Gm(n,a));return n},xv=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],jU=HE,LU=xv,Nl=Object.keys||function(r){return jU(r,LU)},ts={};ts.f=Object.getOwnPropertySymbols;var qm=Ye,zU=se,HU=zt,VU=ne,Cc=Nl,WU=ts,UU=xl,KU=Ct,GU=Cl,On=Object.assign,Ym=Object.defineProperty,qU=zU([].concat),YU=!On||VU(function(){if(qm&&On({b:1},On(Ym({},"a",{enumerable:!0,get:function(){Ym(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var i={},r={},e=Symbol("assign detection"),t="abcdefghijklmnopqrst";return i[e]=7,t.split("").forEach(function(n){r[n]=n}),On({},i)[e]!==7||Cc(On({},r)).join("")!==t})?function(r,e){for(var t=KU(r),n=arguments.length,a=1,o=WU.f,s=UU.f;n>a;)for(var u=GU(arguments[a++]),l=o?qU(Cc(u),o(u)):Cc(u),h=l.length,d=0,c;h>d;)c=l[d++],(!qm||HU(s,u,c))&&(t[c]=u[c]);return t}:On,XU=q,Xm=YU;XU({target:"Object",stat:!0,arity:2,forced:Object.assign!==Xm},{assign:Xm});var JU=ae,ZU=JU.Object.assign,QU=ZU,eK=QU,tK=eK,Fe=V(tK),rK=se,Ml=rK([].slice),VE=se,iK=sn,nK=Xe,aK=Je,Jm=Ml,oK=Wo,WE=Function,sK=VE([].concat),uK=VE([].join),Ac={},lK=function(i,r,e){if(!aK(Ac,r)){for(var t=[],n=0;n=.1;)v=+a[d++%o],v>h&&(v=h),f=Math.sqrt(v*v/(1+l*l)),f=s<0?-f:f,r+=f,e+=l*f,c===!0?i.lineTo(r,e):i.moveTo(r,e),h-=v,c=!c}function SK(i,r,e,t){i.beginPath();var n=6,a=Math.PI*2/n;i.moveTo(r+t,e);for(var o=1;o1?e-1:0),n=1;n=a?i?"":void 0:(o=eb(t,n),o<55296||o>56319||n+1===a||(s=eb(t,n+1))<56320||s>57343?i?zK(t,n):o:i?HK(t,n,n+2):(o-55296<<10)+(s-56320)+65536)}},VK={codeAt:tb(!1),charAt:tb(!0)},WK=Ie,UK=qe,rb=WK.WeakMap,QE=UK(rb)&&/native code/.test(String(rb)),KK=Ia,GK=Al,ib=KK("keys"),Bl=function(i){return ib[i]||(ib[i]=GK(i))},qK=QE,eS=Ie,YK=Xe,XK=ka,Rc=Je,Nc=kv,JK=Bl,ZK=es,nb="Object already initialized",sf=eS.TypeError,QK=eS.WeakMap,zu,go,Hu,eG=function(i){return Hu(i)?go(i):zu(i,{})},tG=function(i){return function(r){var e;if(!YK(r)||(e=go(r)).type!==i)throw new sf("Incompatible receiver, "+i+" required");return e}};if(qK||Nc.state){var cr=Nc.state||(Nc.state=new QK);cr.get=cr.get,cr.has=cr.has,cr.set=cr.set,zu=function(i,r){if(cr.has(i))throw new sf(nb);return r.facade=i,cr.set(i,r),r},go=function(i){return cr.get(i)||{}},Hu=function(i){return cr.has(i)}}else{var Tn=JK("state");ZK[Tn]=!0,zu=function(i,r){if(Rc(i,Tn))throw new sf(nb);return r.facade=i,XK(i,Tn,r),r},go=function(i){return Rc(i,Tn)?i[Tn]:{}},Hu=function(i){return Rc(i,Tn)}}var ln={set:zu,get:go,has:Hu,enforce:eG,getterFor:tG},uf=Ye,rG=Je,tS=Function.prototype,iG=uf&&Object.getOwnPropertyDescriptor,Rv=rG(tS,"name"),nG=Rv&&function(){}.name==="something",aG=Rv&&(!uf||uf&&iG(tS,"name").configurable),oG={EXISTS:Rv,PROPER:nG,CONFIGURABLE:aG},Fl={},sG=Ye,uG=zE,lG=Ht,hG=Vt,cG=wr,dG=Nl;Fl.f=sG&&!uG?Object.defineProperties:function(r,e){hG(r);for(var t=cG(e),n=dG(e),a=n.length,o=0,s;a>o;)lG.f(r,s=n[o++],t[s]);return r};var fG=Jt,vG=fG("document","documentElement"),pG=Vt,gG=Fl,ab=xv,yG=es,mG=vG,bG=jE,$G=Bl,ob=">",sb="<",lf="prototype",hf="script",rS=$G("IE_PROTO"),Mc=function(){},iS=function(i){return sb+hf+ob+i+sb+"/"+hf+ob},ub=function(i){i.write(iS("")),i.close();var r=i.parentWindow.Object;return i=null,r},wG=function(){var i=bG("iframe"),r="java"+hf+":",e;return i.style.display="none",mG.appendChild(i),i.src=String(r),e=i.contentWindow.document,e.open(),e.write(iS("document.F=Object")),e.close(),e.F},Us,gu=function(){try{Us=new ActiveXObject("htmlfile")}catch{}gu=typeof document<"u"?document.domain&&Us?ub(Us):wG():ub(Us);for(var i=ab.length;i--;)delete gu[lf][ab[i]];return gu()};yG[rS]=!0;var Pa=Object.create||function(r,e){var t;return r!==null?(Mc[lf]=pG(r),t=new Mc,Mc[lf]=null,t[rS]=r):t=gu(),e===void 0?t:gG.f(t,e)},_G=ne,nS=!_G(function(){function i(){}return i.prototype.constructor=null,Object.getPrototypeOf(new i)!==i.prototype}),EG=Je,SG=qe,OG=Ct,TG=Bl,IG=nS,lb=TG("IE_PROTO"),cf=Object,kG=cf.prototype,jl=IG?cf.getPrototypeOf:function(i){var r=OG(i);if(EG(r,lb))return r[lb];var e=r.constructor;return SG(e)&&r instanceof e?e.prototype:r instanceof cf?kG:null},PG=ka,rs=function(i,r,e,t){return t&&t.enumerable?i[r]=e:PG(i,r,e),i},xG=ne,CG=qe,AG=Xe,DG=Pa,hb=jl,RG=rs,NG=ke,df=NG("iterator"),aS=!1,Cr,Bc,Fc;[].keys&&(Fc=[].keys(),"next"in Fc?(Bc=hb(hb(Fc)),Bc!==Object.prototype&&(Cr=Bc)):aS=!0);var MG=!AG(Cr)||xG(function(){var i={};return Cr[df].call(i)!==i});MG?Cr={}:Cr=DG(Cr);CG(Cr[df])||RG(Cr,df,function(){return this});var oS={IteratorPrototype:Cr,BUGGY_SAFARI_ITERATORS:aS},BG=Av,FG=un,jG=BG?{}.toString:function(){return"[object "+FG(this)+"]"},LG=Av,zG=Ht.f,HG=ka,VG=Je,WG=jG,UG=ke,cb=UG("toStringTag"),xa=function(i,r,e,t){if(i){var n=e?i:i.prototype;VG(n,cb)||zG(n,cb,{configurable:!0,value:r}),t&&!LG&&HG(n,"toString",WG)}},Ca={},KG=oS.IteratorPrototype,GG=Pa,qG=Ko,YG=xa,XG=Ca,JG=function(){return this},ZG=function(i,r,e,t){var n=r+" Iterator";return i.prototype=GG(KG,{next:qG(+!t,e)}),YG(i,n,!1,!0),XG[n]=JG,i},QG=se,eq=sn,tq=function(i,r,e){try{return QG(eq(Object.getOwnPropertyDescriptor(i,r)[e]))}catch{}},rq=qe,iq=String,nq=TypeError,aq=function(i){if(typeof i=="object"||rq(i))return i;throw new nq("Can't set "+iq(i)+" as a prototype")},oq=tq,sq=Vt,uq=aq,lq=Object.setPrototypeOf||("__proto__"in{}?function(){var i=!1,r={},e;try{e=oq(Object.prototype,"__proto__","set"),e(r,[]),i=r instanceof Array}catch{}return function(n,a){return sq(n),uq(a),i?e(n,a):n.__proto__=a,n}}():void 0),hq=q,cq=zt,dq=oG,fq=ZG,vq=jl,pq=xa,db=rs,gq=ke,fb=Ca,yq=oS,mq=dq.PROPER,Ks=yq.BUGGY_SAFARI_ITERATORS,jc=gq("iterator"),vb="keys",Gs="values",pb="entries",bq=function(){return this},Nv=function(i,r,e,t,n,a,o){fq(e,r,t);var s=function(y){if(y===n&&c)return c;if(!Ks&&y&&y in h)return h[y];switch(y){case vb:return function(){return new e(this,y)};case Gs:return function(){return new e(this,y)};case pb:return function(){return new e(this,y)}}return function(){return new e(this)}},u=r+" Iterator",l=!1,h=i.prototype,d=h[jc]||h["@@iterator"]||n&&h[n],c=!Ks&&d||s(n),f=r==="Array"&&h.entries||d,v,p,g;if(f&&(v=vq(f.call(new i)),v!==Object.prototype&&v.next&&(pq(v,u,!0,!0),fb[u]=bq)),mq&&n===Gs&&d&&d.name!==Gs&&(l=!0,c=function(){return cq(d,this)}),n)if(p={values:s(Gs),keys:a?c:s(vb),entries:s(pb)},o)for(g in p)(Ks||l||!(g in h))&&db(h,g,p[g]);else hq({target:r,proto:!0,forced:Ks||l},p);return o&&h[jc]!==c&&db(h,jc,c,{name:n}),fb[r]=c,p},Mv=function(i,r){return{value:i,done:r}},$q=VK.charAt,wq=_r,sS=ln,_q=Nv,gb=Mv,uS="String Iterator",Eq=sS.set,Sq=sS.getterFor(uS);_q(String,"String",function(i){Eq(this,{type:uS,string:wq(i),index:0})},function(){var r=Sq(this),e=r.string,t=r.index,n;return t>=e.length?gb(void 0,!0):(n=$q(e,t),r.index+=n.length,gb(n,!1))});var Oq=zt,yb=Vt,Tq=Iv,lS=function(i,r,e){var t,n;yb(i);try{if(t=Tq(i,"return"),!t){if(r==="throw")throw e;return e}t=Oq(t,i)}catch(a){n=!0,t=a}if(r==="throw")throw e;if(n)throw t;return yb(t),e},Iq=Vt,kq=lS,Pq=function(i,r,e,t){try{return t?r(Iq(e)[0],e[1]):r(e)}catch(n){kq(i,"throw",n)}},xq=ke,Cq=Ca,Aq=xq("iterator"),Dq=Array.prototype,hS=function(i){return i!==void 0&&(Cq.Array===i||Dq[Aq]===i)},Rq=se,Nq=qe,ff=kv,Mq=Rq(Function.toString);Nq(ff.inspectSource)||(ff.inspectSource=function(i){return Mq(i)});var Bq=ff.inspectSource,Fq=se,jq=ne,cS=qe,Lq=un,zq=Jt,Hq=Bq,dS=function(){},Vq=[],fS=zq("Reflect","construct"),Bv=/^\s*(?:class|function)\b/,Wq=Fq(Bv.exec),Uq=!Bv.test(dS),ja=function(r){if(!cS(r))return!1;try{return fS(dS,Vq,r),!0}catch{return!1}},vS=function(r){if(!cS(r))return!1;switch(Lq(r)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Uq||!!Wq(Bv,Hq(r))}catch{return!0}};vS.sham=!0;var Ll=!fS||jq(function(){var i;return ja(ja.call)||!ja(Object)||!ja(function(){i=!0})||i})?vS:ja,Kq=Dl,Gq=Ht,qq=Ko,Aa=function(i,r,e){var t=Kq(r);t in i?Gq.f(i,t,qq(0,e)):i[t]=e},Yq=un,mb=Iv,Xq=Sa,Jq=Ca,Zq=ke,Qq=Zq("iterator"),zl=function(i){if(!Xq(i))return mb(i,Qq)||mb(i,"@@iterator")||Jq[Yq(i)]},eY=zt,tY=sn,rY=Vt,iY=Ta,nY=zl,aY=TypeError,pS=function(i,r){var e=arguments.length<2?nY(i):r;if(tY(e))return rY(eY(e,i));throw new aY(iY(i)+" is not iterable")},oY=Zo,sY=zt,uY=Ct,lY=Pq,hY=hS,cY=Ll,dY=Zt,bb=Aa,fY=pS,vY=zl,$b=Array,pY=function(r){var e=uY(r),t=cY(this),n=arguments.length,a=n>1?arguments[1]:void 0,o=a!==void 0;o&&(a=oY(a,n>2?arguments[2]:void 0));var s=vY(e),u=0,l,h,d,c,f,v;if(s&&!(this===$b&&hY(s)))for(c=fY(e,s),f=c.next,h=t?new this:[];!(d=sY(f,c)).done;u++)v=o?lY(c,a,[d.value,u],!0):d.value,bb(h,u,v);else for(l=dY(e),h=t?new this(l):$b(l);l>u;u++)v=o?a(e[u],u):e[u],bb(h,u,v);return h.length=u,h},gY=ke,gS=gY("iterator"),yS=!1;try{var yY=0,wb={next:function(){return{done:!!yY++}},return:function(){yS=!0}};wb[gS]=function(){return this},Array.from(wb,function(){throw 2})}catch{}var mY=function(i,r){try{if(!r&&!yS)return!1}catch{return!1}var e=!1;try{var t={};t[gS]=function(){return{next:function(){return{done:e=!0}}}},i(t)}catch{}return e},bY=q,$Y=pY,wY=mY,_Y=!wY(function(i){Array.from(i)});bY({target:"Array",stat:!0,forced:_Y},{from:$Y});var EY=ae,SY=EY.Array.from,OY=SY,mS=OY,TY=mS,hn=V(TY),IY=wr,_b=Ca,bS=ln;Ht.f;var kY=Nv,qs=Mv,$S="Array Iterator",PY=bS.set,xY=bS.getterFor($S);kY(Array,"Array",function(i,r){PY(this,{type:$S,target:IY(i),index:0,kind:r})},function(){var i=xY(this),r=i.target,e=i.kind,t=i.index++;if(!r||t>=r.length)return i.target=void 0,qs(void 0,!0);switch(e){case"keys":return qs(t,!1);case"values":return qs(r[t],!1)}return qs([t,r[t]],!1)},"values");_b.Arguments=_b.Array;var CY=zl,AY=CY,DY={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},RY=DY,NY=Ie,MY=un,BY=ka,Eb=Ca,FY=ke,Sb=FY("toStringTag");for(var Lc in RY){var Ob=NY[Lc],zc=Ob&&Ob.prototype;zc&&MY(zc)!==Sb&&BY(zc,Sb,Lc),Eb[Lc]=Eb.Array}var jY=AY,LY=jY,zY=LY,HY=zY,VY=HY,WY=VY,wS=WY,_S=V(wS),UY=wS,cn=V(UY);function R(i,r){if(!(i instanceof r))throw new TypeError("Cannot call a class as a function")}var ES={exports:{}},KY=q,GY=Ye,Tb=Ht.f;KY({target:"Object",stat:!0,forced:Object.defineProperty!==Tb,sham:!GY},{defineProperty:Tb});var qY=ae,SS=qY.Object,YY=ES.exports=function(r,e,t){return SS.defineProperty(r,e,t)};SS.defineProperty.sham&&(YY.sham=!0);var XY=ES.exports,JY=XY,OS=JY,ZY=OS,QY=ZY,eX=QY,tX=eX,rX=tX,Hl=V(rX),iX=Hr,dn=Array.isArray||function(r){return iX(r)==="Array"},nX=TypeError,aX=9007199254740991,Fv=function(i){if(i>aX)throw nX("Maximum allowed index exceeded");return i},Ib=dn,oX=Ll,sX=Xe,uX=ke,lX=uX("species"),kb=Array,hX=function(i){var r;return Ib(i)&&(r=i.constructor,oX(r)&&(r===kb||Ib(r.prototype))?r=void 0:sX(r)&&(r=r[lX],r===null&&(r=void 0))),r===void 0?kb:r},cX=hX,jv=function(i,r){return new(cX(i))(r===0?0:r)},dX=ne,fX=ke,vX=Yo,pX=fX("species"),is=function(i){return vX>=51||!dX(function(){var r=[],e=r.constructor={};return e[pX]=function(){return{foo:1}},r[i](Boolean).foo!==1})},gX=q,yX=ne,mX=dn,bX=Xe,$X=Ct,wX=Zt,Pb=Fv,xb=Aa,_X=jv,EX=is,SX=ke,OX=Yo,TS=SX("isConcatSpreadable"),TX=OX>=51||!yX(function(){var i=[];return i[TS]=!1,i.concat()[0]!==i}),IX=function(i){if(!bX(i))return!1;var r=i[TS];return r!==void 0?!!r:mX(i)},kX=!TX||!EX("concat");gX({target:"Array",proto:!0,arity:1,forced:kX},{concat:function(r){var e=$X(this),t=_X(e,0),n=0,a,o,s,u,l;for(a=-1,s=arguments.length;ag;g++)if((s||g in f)&&(b=f[g],$=v(b,g,c),i))if(r)m[g]=$;else if($)switch(i){case 3:return!0;case 5:return b;case 6:return g;case 2:Db(m,b)}else switch(i){case 4:return!1;case 7:Db(m,b)}return a?-1:t||n?n:m}},yi={forEach:Ur(0),map:Ur(1),filter:Ur(2),some:Ur(3),every:Ur(4),find:Ur(5),findIndex:Ur(6),filterReject:Ur(7)},Wl=q,Ul=Ie,zv=zt,tJ=se,ta=Ye,ra=Oa,rJ=ne,Ue=Je,iJ=Re,vf=Vt,Kl=wr,Hv=Dl,nJ=_r,pf=Ko,yo=Pa,CS=Nl,aJ=ns,AS=Vl,oJ=ts,DS=Ea,RS=Ht,sJ=Fl,NS=xl,Rb=rs,uJ=Lv,Vv=Ia,lJ=Bl,MS=es,Nb=Al,hJ=ke,cJ=as,dJ=Pe,fJ=xS,vJ=xa,BS=ln,Gl=yi.forEach,St=lJ("hidden"),ql="Symbol",mo="prototype",pJ=BS.set,Mb=BS.getterFor(ql),or=Object[mo],Bi=Ul.Symbol,Ka=Bi&&Bi[mo],gJ=Ul.RangeError,yJ=Ul.TypeError,Hc=Ul.QObject,FS=DS.f,Fi=RS.f,jS=AS.f,mJ=NS.f,LS=tJ([].push),Fr=Vv("symbols"),os=Vv("op-symbols"),bJ=Vv("wks"),gf=!Hc||!Hc[mo]||!Hc[mo].findChild,zS=function(i,r,e){var t=FS(or,r);t&&delete or[r],Fi(i,r,e),t&&i!==or&&Fi(or,r,t)},yf=ta&&rJ(function(){return yo(Fi({},"a",{get:function(){return Fi(this,"a",{value:7}).a}})).a!==7})?zS:Fi,Vc=function(i,r){var e=Fr[i]=yo(Ka);return pJ(e,{type:ql,tag:i,description:r}),ta||(e.description=r),e},Yl=function(r,e,t){r===or&&Yl(os,e,t),vf(r);var n=Hv(e);return vf(t),Ue(Fr,n)?(t.enumerable?(Ue(r,St)&&r[St][n]&&(r[St][n]=!1),t=yo(t,{enumerable:pf(0,!1)})):(Ue(r,St)||Fi(r,St,pf(1,{})),r[St][n]=!0),yf(r,n,t)):Fi(r,n,t)},Wv=function(r,e){vf(r);var t=Kl(e),n=CS(t).concat(US(t));return Gl(n,function(a){(!ta||zv(HS,t,a))&&Yl(r,a,t[a])}),r},$J=function(r,e){return e===void 0?yo(r):Wv(yo(r),e)},HS=function(r){var e=Hv(r),t=zv(mJ,this,e);return this===or&&Ue(Fr,e)&&!Ue(os,e)?!1:t||!Ue(this,e)||!Ue(Fr,e)||Ue(this,St)&&this[St][e]?t:!0},VS=function(r,e){var t=Kl(r),n=Hv(e);if(!(t===or&&Ue(Fr,n)&&!Ue(os,n))){var a=FS(t,n);return a&&Ue(Fr,n)&&!(Ue(t,St)&&t[St][n])&&(a.enumerable=!0),a}},WS=function(r){var e=jS(Kl(r)),t=[];return Gl(e,function(n){!Ue(Fr,n)&&!Ue(MS,n)&&LS(t,n)}),t},US=function(i){var r=i===or,e=jS(r?os:Kl(i)),t=[];return Gl(e,function(n){Ue(Fr,n)&&(!r||Ue(or,n))&&LS(t,Fr[n])}),t};ra||(Bi=function(){if(iJ(Ka,this))throw new yJ("Symbol is not a constructor");var r=!arguments.length||arguments[0]===void 0?void 0:nJ(arguments[0]),e=Nb(r),t=function(n){this===or&&zv(t,os,n),Ue(this,St)&&Ue(this[St],e)&&(this[St][e]=!1);var a=pf(1,n);try{yf(this,e,a)}catch(o){if(!(o instanceof gJ))throw o;zS(this,e,a)}};return ta&&gf&&yf(or,e,{configurable:!0,set:t}),Vc(e,r)},Ka=Bi[mo],Rb(Ka,"toString",function(){return Mb(this).tag}),Rb(Bi,"withoutSetter",function(i){return Vc(Nb(i),i)}),NS.f=HS,RS.f=Yl,sJ.f=Wv,DS.f=VS,aJ.f=AS.f=WS,oJ.f=US,cJ.f=function(i){return Vc(hJ(i),i)},ta&&uJ(Ka,"description",{configurable:!0,get:function(){return Mb(this).description}}));Wl({global:!0,constructor:!0,wrap:!0,forced:!ra,sham:!ra},{Symbol:Bi});Gl(CS(bJ),function(i){dJ(i)});Wl({target:ql,stat:!0,forced:!ra},{useSetter:function(){gf=!0},useSimple:function(){gf=!1}});Wl({target:"Object",stat:!0,forced:!ra,sham:!ta},{create:$J,defineProperty:Yl,defineProperties:Wv,getOwnPropertyDescriptor:VS});Wl({target:"Object",stat:!0,forced:!ra},{getOwnPropertyNames:WS});fJ();vJ(Bi,ql);MS[St]=!0;var wJ=Oa,KS=wJ&&!!Symbol.for&&!!Symbol.keyFor,_J=q,EJ=Jt,SJ=Je,OJ=_r,GS=Ia,TJ=KS,Wc=GS("string-to-symbol-registry"),IJ=GS("symbol-to-string-registry");_J({target:"Symbol",stat:!0,forced:!TJ},{for:function(i){var r=OJ(i);if(SJ(Wc,r))return Wc[r];var e=EJ("Symbol")(r);return Wc[r]=e,IJ[e]=r,e}});var kJ=q,PJ=Je,xJ=Xo,CJ=Ta,AJ=Ia,DJ=KS,Bb=AJ("symbol-to-string-registry");kJ({target:"Symbol",stat:!0,forced:!DJ},{keyFor:function(r){if(!xJ(r))throw new TypeError(CJ(r)+" is not a symbol");if(PJ(Bb,r))return Bb[r]}});var RJ=se,Fb=dn,NJ=qe,jb=Hr,MJ=_r,Lb=RJ([].push),BJ=function(i){if(NJ(i))return i;if(Fb(i)){for(var r=i.length,e=[],t=0;ti.length)&&(r=i.length);for(var e=0,t=new Array(r);e1?arguments[1]:void 0)}});var ste=Ze,ute=ste("Array").map,lte=Re,hte=ute,Xc=Array.prototype,cte=function(i){var r=i.map;return i===Xc||lte(Xc,i)&&r===Xc.map?hte:r},dte=cte,fte=dte,vte=fte,ia=W(vte),pte=q,gte=Ct,cO=Nl,yte=ne,mte=yte(function(){cO(1)});pte({target:"Object",stat:!0,forced:mte},{keys:function(r){return cO(gte(r))}});var bte=ae,$te=bte.Object.keys,wte=$te,_te=wte,Ete=_te,Ee=W(Ete),Ste=q,Ote=oe,dO=Date,Tte=Ote(dO.prototype.getTime);Ste({target:"Date",stat:!0},{now:function(){return Tte(new dO)}});var Ite=ae,kte=Ite.Date.now,Pte=kte,xte=Pte,Cte=xte,Vu=W(Cte),Ate=ne,Da=function(i,r){var e=[][i];return!!e&&Ate(function(){e.call(null,r||function(){return 1},1)})},Dte=yi.forEach,Rte=Da,Nte=Rte("forEach"),Mte=Nte?[].forEach:function(r){return Dte(this,r,arguments.length>1?arguments[1]:void 0)},Bte=q,i1=Mte;Bte({target:"Array",proto:!0,forced:[].forEach!==i1},{forEach:i1});var Fte=Ze,jte=Fte("Array").forEach,Lte=jte,zte=Lte,Hte=an,Wte=Je,Vte=Re,Ute=zte,Jc=Array.prototype,Kte={DOMTokenList:!0,NodeList:!0},Gte=function(i){var r=i.forEach;return i===Jc||Vte(Jc,i)&&r===Jc.forEach||Wte(Kte,Hte(i))?Ute:r},qte=Gte,de=W(qte),Yte=q,Xte=oe,Jte=ln,Zte=Xte([].reverse),n1=[1,2];Yte({target:"Array",proto:!0,forced:String(n1)===String(n1.reverse())},{reverse:function(){return Jte(this)&&(this.length=this.length),Zte(this)}});var Qte=Ze,ere=Qte("Array").reverse,tre=Re,rre=ere,Zc=Array.prototype,ire=function(i){var r=i.reverse;return i===Zc||tre(Zc,i)&&r===Zc.reverse?rre:r},nre=ire,are=nre,ore=are,Mi=W(ore),a1=Ta,sre=TypeError,fO=function(i,r){if(!delete i[r])throw new sre("Cannot delete property "+a1(r)+" of "+a1(i))},ure=q,lre=Ct,hre=Qo,cre=Rl,dre=Zt,fre=sO,vre=Fv,pre=jv,gre=Aa,Qc=fO,yre=is,mre=yre("splice"),bre=Math.max,$re=Math.min;ure({target:"Array",proto:!0,forced:!mre},{splice:function(r,e){var t=lre(this),n=dre(t),a=hre(r,n),o=arguments.length,s,u,l,h,d,c;for(o===0?s=u=0:o===1?(s=0,u=n-a):(s=o-2,u=$re(bre(cre(e),0),n-a)),vre(n+s-u),l=pre(t,u),h=0;hn-u+s;h--)Qc(t,h-1)}else if(s>u)for(h=n-u;h>a;h--)d=h+u-1,c=h+s-1,d in t?t[c]=t[d]:Qc(t,c);for(h=0;h1?arguments[1]:void 0)}});var Dre=Ze,Rre=Dre("Array").includes,Nre=Xe,Mre=zr,Bre=ke,Fre=Bre("match"),jre=function(i){var r;return Nre(i)&&((r=i[Fre])!==void 0?!!r:Mre(i)==="RegExp")},Lre=jre,zre=TypeError,Hre=function(i){if(Lre(i))throw new zre("The method doesn't accept regular expressions");return i},Wre=ke,Vre=Wre("match"),Ure=function(i){var r=/./;try{"/./"[i](r)}catch{try{return r[Vre]=!1,"/./"[i](r)}catch{}}return!1},Kre=q,Gre=oe,qre=Hre,Yre=Go,o1=_r,Xre=Ure,Jre=Gre("".indexOf);Kre({target:"String",proto:!0,forced:!Xre("includes")},{includes:function(r){return!!~Jre(o1(Yre(this)),o1(qre(r)),arguments.length>1?arguments[1]:void 0)}});var Zre=Ze,Qre=Zre("String").includes,s1=Re,eie=Rre,tie=Qre,td=Array.prototype,rd=String.prototype,rie=function(i){var r=i.includes;return i===td||s1(td,i)&&r===td.includes?eie:typeof i=="string"||i===rd||s1(rd,i)&&r===rd.includes?tie:r},iie=rie,nie=iie,aie=nie,oi=W(aie),oie=q,sie=ne,uie=Ct,vO=jl,lie=nS,hie=sie(function(){vO(1)});oie({target:"Object",stat:!0,forced:hie,sham:!lie},{getPrototypeOf:function(r){return vO(uie(r))}});var cie=ae,die=cie.Object.getPrototypeOf,fie=die,pO=fie,vie=pO,u1=W(vie),pie=q,gie=yi.filter,yie=is,mie=yie("filter");pie({target:"Array",proto:!0,forced:!mie},{filter:function(r){return gie(this,r,arguments.length>1?arguments[1]:void 0)}});var bie=Ze,$ie=bie("Array").filter,wie=Re,_ie=$ie,id=Array.prototype,Eie=function(i){var r=i.filter;return i===id||wie(id,i)&&r===id.filter?_ie:r},Sie=Eie,Oie=Sie,Tie=Oie,Ot=W(Tie),Gv=` -\v\f\r                 \u2028\u2029\uFEFF`,Iie=oe,kie=Go,Pie=_r,bf=Gv,l1=Iie("".replace),xie=RegExp("^["+bf+"]+"),Cie=RegExp("(^|[^"+bf+"])["+bf+"]+$"),nd=function(i){return function(r){var e=Pie(kie(r));return i&1&&(e=l1(e,xie,"")),i&2&&(e=l1(e,Cie,"$1")),e}},gO={start:nd(1),end:nd(2),trim:nd(3)},yO=Ie,Aie=ne,Die=oe,Rie=_r,Nie=gO.trim,h1=Gv,Qa=yO.parseInt,c1=yO.Symbol,d1=c1&&c1.iterator,mO=/^[+-]?0x/i,Mie=Die(mO.exec),Bie=Qa(h1+"08")!==8||Qa(h1+"0x16")!==22||d1&&!Aie(function(){Qa(Object(d1))}),Fie=Bie?function(r,e){var t=Nie(Rie(r));return Qa(t,e>>>0||(Mie(mO,t)?16:10))}:Qa,jie=q,f1=Fie;jie({global:!0,forced:parseInt!==f1},{parseInt:f1});var Lie=ae,zie=Lie.parseInt,Hie=zie,Wie=Hie,Vie=Wie,nr=W(Vie),Uie=q,Kie=Tv,Gie=Pv.indexOf,qie=Da,$f=Kie([].indexOf),bO=!!$f&&1/$f([1],1,-0)<0,Yie=bO||!qie("indexOf");Uie({target:"Array",proto:!0,forced:Yie},{indexOf:function(r){var e=arguments.length>1?arguments[1]:void 0;return bO?$f(this,r,e)||0:Gie(this,r,e)}});var Xie=Ze,Jie=Xie("Array").indexOf,Zie=Re,Qie=Jie,ad=Array.prototype,ene=function(i){var r=i.indexOf;return i===ad||Zie(ad,i)&&r===ad.indexOf?Qie:r},tne=ene,rne=tne,ine=rne,ie=W(ine),nne=q,ane=Ye,one=Pa;nne({target:"Object",stat:!0,sham:!ane},{create:one});var sne=ae,une=sne.Object,lne=function(r,e){return une.create(r,e)},hne=lne,$O=hne,cne=$O,Bi=W(cne),wf=ae,dne=Uo;wf.JSON||(wf.JSON={stringify:JSON.stringify});var fne=function(r,e,t){return dne(wf.JSON.stringify,null,arguments)},vne=fne,pne=vne,gne=pne,us=W(gne),yne=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",mne=TypeError,bne=function(i,r){if(ie,o=wne(t)?t:Tne(t),s=a?Sne(arguments,e):[],u=a?function(){$ne(o,this,s)}:o;return r?i(u,n):i(u)}:i},kne=q,EO=Ie,Pne=_O,v1=Pne(EO.setInterval,!0);kne({global:!0,bind:!0,forced:EO.setInterval!==v1},{setInterval:v1});var xne=q,SO=Ie,Cne=_O,p1=Cne(SO.setTimeout,!0);xne({global:!0,bind:!0,forced:SO.setTimeout!==p1},{setTimeout:p1});var Ane=ae,Dne=Ane.setTimeout,Rne=Dne,yr=W(Rne),Nne=Ct,g1=Qo,Mne=Zt,Bne=function(r){for(var e=Nne(this),t=Mne(e),n=arguments.length,a=g1(n>1?arguments[1]:void 0,t),o=n>2?arguments[2]:void 0,s=o===void 0?t:g1(o,t);s>a;)e[a++]=r;return e},Fne=q,jne=Bne;Fne({target:"Array",proto:!0},{fill:jne});var Lne=Ze,zne=Lne("Array").fill,Hne=Re,Wne=zne,od=Array.prototype,Vne=function(i){var r=i.fill;return i===od||Hne(od,i)&&r===od.fill?Wne:r},Une=Vne,Kne=Une,Gne=Kne,ls=W(Gne);/*! Hammer.JS - v2.0.17-rc - 2019-12-16 +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dr(i){return Mee(i)||Bee(i)||hO(i)||Fee()}var jee=QS,mi=V(jee),Lee=Ze,zee=Lee("Array").concat,Hee=Re,Vee=zee,Yc=Array.prototype,Wee=function(i){var r=i.concat;return i===Yc||Hee(Yc,i)&&r===Yc.concat?Vee:r},Uee=Wee,Kee=Uee,Gee=Kee,Kv=V(Gee),qee=uO,rt=V(qee),Yee=Jt,Xee=se,Jee=ns,Zee=ts,Qee=Vt,ete=Xee([].concat),tte=Yee("Reflect","ownKeys")||function(r){var e=Jee.f(Qee(r)),t=Zee.f;return t?ete(e,t(r)):e},rte=aO,he=V(rte),ite=q,nte=yi.map,ate=is,ote=ate("map");ite({target:"Array",proto:!0,forced:!ote},{map:function(r){return nte(this,r,arguments.length>1?arguments[1]:void 0)}});var ste=Ze,ute=ste("Array").map,lte=Re,hte=ute,Xc=Array.prototype,cte=function(i){var r=i.map;return i===Xc||lte(Xc,i)&&r===Xc.map?hte:r},dte=cte,fte=dte,vte=fte,ia=V(vte),pte=q,gte=Ct,cO=Nl,yte=ne,mte=yte(function(){cO(1)});pte({target:"Object",stat:!0,forced:mte},{keys:function(r){return cO(gte(r))}});var bte=ae,$te=bte.Object.keys,wte=$te,_te=wte,Ete=_te,Ee=V(Ete),Ste=q,Ote=se,dO=Date,Tte=Ote(dO.prototype.getTime);Ste({target:"Date",stat:!0},{now:function(){return Tte(new dO)}});var Ite=ae,kte=Ite.Date.now,Pte=kte,xte=Pte,Cte=xte,Wu=V(Cte),Ate=ne,Da=function(i,r){var e=[][i];return!!e&&Ate(function(){e.call(null,r||function(){return 1},1)})},Dte=yi.forEach,Rte=Da,Nte=Rte("forEach"),Mte=Nte?[].forEach:function(r){return Dte(this,r,arguments.length>1?arguments[1]:void 0)},Bte=q,i1=Mte;Bte({target:"Array",proto:!0,forced:[].forEach!==i1},{forEach:i1});var Fte=Ze,jte=Fte("Array").forEach,Lte=jte,zte=Lte,Hte=un,Vte=Je,Wte=Re,Ute=zte,Jc=Array.prototype,Kte={DOMTokenList:!0,NodeList:!0},Gte=function(i){var r=i.forEach;return i===Jc||Wte(Jc,i)&&r===Jc.forEach||Vte(Kte,Hte(i))?Ute:r},qte=Gte,fe=V(qte),Yte=q,Xte=se,Jte=dn,Zte=Xte([].reverse),n1=[1,2];Yte({target:"Array",proto:!0,forced:String(n1)===String(n1.reverse())},{reverse:function(){return Jte(this)&&(this.length=this.length),Zte(this)}});var Qte=Ze,ere=Qte("Array").reverse,tre=Re,rre=ere,Zc=Array.prototype,ire=function(i){var r=i.reverse;return i===Zc||tre(Zc,i)&&r===Zc.reverse?rre:r},nre=ire,are=nre,ore=are,ji=V(ore),a1=Ta,sre=TypeError,fO=function(i,r){if(!delete i[r])throw new sre("Cannot delete property "+a1(r)+" of "+a1(i))},ure=q,lre=Ct,hre=Qo,cre=Rl,dre=Zt,fre=sO,vre=Fv,pre=jv,gre=Aa,Qc=fO,yre=is,mre=yre("splice"),bre=Math.max,$re=Math.min;ure({target:"Array",proto:!0,forced:!mre},{splice:function(r,e){var t=lre(this),n=dre(t),a=hre(r,n),o=arguments.length,s,u,l,h,d,c;for(o===0?s=u=0:o===1?(s=0,u=n-a):(s=o-2,u=$re(bre(cre(e),0),n-a)),vre(n+s-u),l=pre(t,u),h=0;hn-u+s;h--)Qc(t,h-1)}else if(s>u)for(h=n-u;h>a;h--)d=h+u-1,c=h+s-1,d in t?t[c]=t[d]:Qc(t,c);for(h=0;h1?arguments[1]:void 0)}});var Dre=Ze,Rre=Dre("Array").includes,Nre=Xe,Mre=Hr,Bre=ke,Fre=Bre("match"),jre=function(i){var r;return Nre(i)&&((r=i[Fre])!==void 0?!!r:Mre(i)==="RegExp")},Lre=jre,zre=TypeError,Hre=function(i){if(Lre(i))throw new zre("The method doesn't accept regular expressions");return i},Vre=ke,Wre=Vre("match"),Ure=function(i){var r=/./;try{"/./"[i](r)}catch{try{return r[Wre]=!1,"/./"[i](r)}catch{}}return!1},Kre=q,Gre=se,qre=Hre,Yre=Go,o1=_r,Xre=Ure,Jre=Gre("".indexOf);Kre({target:"String",proto:!0,forced:!Xre("includes")},{includes:function(r){return!!~Jre(o1(Yre(this)),o1(qre(r)),arguments.length>1?arguments[1]:void 0)}});var Zre=Ze,Qre=Zre("String").includes,s1=Re,eie=Rre,tie=Qre,td=Array.prototype,rd=String.prototype,rie=function(i){var r=i.includes;return i===td||s1(td,i)&&r===td.includes?eie:typeof i=="string"||i===rd||s1(rd,i)&&r===rd.includes?tie:r},iie=rie,nie=iie,aie=nie,oi=V(aie),oie=q,sie=ne,uie=Ct,vO=jl,lie=nS,hie=sie(function(){vO(1)});oie({target:"Object",stat:!0,forced:hie,sham:!lie},{getPrototypeOf:function(r){return vO(uie(r))}});var cie=ae,die=cie.Object.getPrototypeOf,fie=die,pO=fie,vie=pO,u1=V(vie),pie=q,gie=yi.filter,yie=is,mie=yie("filter");pie({target:"Array",proto:!0,forced:!mie},{filter:function(r){return gie(this,r,arguments.length>1?arguments[1]:void 0)}});var bie=Ze,$ie=bie("Array").filter,wie=Re,_ie=$ie,id=Array.prototype,Eie=function(i){var r=i.filter;return i===id||wie(id,i)&&r===id.filter?_ie:r},Sie=Eie,Oie=Sie,Tie=Oie,Ot=V(Tie),Gv=` +\v\f\r                 \u2028\u2029\uFEFF`,Iie=se,kie=Go,Pie=_r,bf=Gv,l1=Iie("".replace),xie=RegExp("^["+bf+"]+"),Cie=RegExp("(^|[^"+bf+"])["+bf+"]+$"),nd=function(i){return function(r){var e=Pie(kie(r));return i&1&&(e=l1(e,xie,"")),i&2&&(e=l1(e,Cie,"$1")),e}},gO={start:nd(1),end:nd(2),trim:nd(3)},yO=Ie,Aie=ne,Die=se,Rie=_r,Nie=gO.trim,h1=Gv,Qa=yO.parseInt,c1=yO.Symbol,d1=c1&&c1.iterator,mO=/^[+-]?0x/i,Mie=Die(mO.exec),Bie=Qa(h1+"08")!==8||Qa(h1+"0x16")!==22||d1&&!Aie(function(){Qa(Object(d1))}),Fie=Bie?function(r,e){var t=Nie(Rie(r));return Qa(t,e>>>0||(Mie(mO,t)?16:10))}:Qa,jie=q,f1=Fie;jie({global:!0,forced:parseInt!==f1},{parseInt:f1});var Lie=ae,zie=Lie.parseInt,Hie=zie,Vie=Hie,Wie=Vie,nr=V(Wie),Uie=q,Kie=Tv,Gie=Pv.indexOf,qie=Da,$f=Kie([].indexOf),bO=!!$f&&1/$f([1],1,-0)<0,Yie=bO||!qie("indexOf");Uie({target:"Array",proto:!0,forced:Yie},{indexOf:function(r){var e=arguments.length>1?arguments[1]:void 0;return bO?$f(this,r,e)||0:Gie(this,r,e)}});var Xie=Ze,Jie=Xie("Array").indexOf,Zie=Re,Qie=Jie,ad=Array.prototype,ene=function(i){var r=i.indexOf;return i===ad||Zie(ad,i)&&r===ad.indexOf?Qie:r},tne=ene,rne=tne,ine=rne,ie=V(ine),nne=q,ane=Ye,one=Pa;nne({target:"Object",stat:!0,sham:!ane},{create:one});var sne=ae,une=sne.Object,lne=function(r,e){return une.create(r,e)},hne=lne,$O=hne,cne=$O,Li=V(cne),wf=ae,dne=Uo;wf.JSON||(wf.JSON={stringify:JSON.stringify});var fne=function(r,e,t){return dne(wf.JSON.stringify,null,arguments)},vne=fne,pne=vne,gne=pne,us=V(gne),yne=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",mne=TypeError,bne=function(i,r){if(ie,o=wne(t)?t:Tne(t),s=a?Sne(arguments,e):[],u=a?function(){$ne(o,this,s)}:o;return r?i(u,n):i(u)}:i},kne=q,EO=Ie,Pne=_O,v1=Pne(EO.setInterval,!0);kne({global:!0,bind:!0,forced:EO.setInterval!==v1},{setInterval:v1});var xne=q,SO=Ie,Cne=_O,p1=Cne(SO.setTimeout,!0);xne({global:!0,bind:!0,forced:SO.setTimeout!==p1},{setTimeout:p1});var Ane=ae,Dne=Ane.setTimeout,Rne=Dne,yr=V(Rne),Nne=Ct,g1=Qo,Mne=Zt,Bne=function(r){for(var e=Nne(this),t=Mne(e),n=arguments.length,a=g1(n>1?arguments[1]:void 0,t),o=n>2?arguments[2]:void 0,s=o===void 0?t:g1(o,t);s>a;)e[a++]=r;return e},Fne=q,jne=Bne;Fne({target:"Array",proto:!0},{fill:jne});var Lne=Ze,zne=Lne("Array").fill,Hne=Re,Vne=zne,od=Array.prototype,Wne=function(i){var r=i.fill;return i===od||Hne(od,i)&&r===od.fill?Vne:r},Une=Wne,Kne=Une,Gne=Kne,ls=V(Gne);/*! Hammer.JS - v2.0.17-rc - 2019-12-16 * http://naver.github.io/egjs * * Forked By Naver egjs * Copyright (c) hammerjs - * Licensed under the MIT license */function ur(){return ur=Object.assign||function(i){for(var r=1;r"u"?{style:{}}:document.createElement("div"),Yne="function",zn=Math.round,Gi=Math.abs,qv=Date.now;function Xl(i,r){for(var e,t,n=r[0].toUpperCase()+r.slice(1),a=0;a"u"?Ar={}:Ar=window;var OO=Xl(qne.style,"touchAction"),TO=OO!==void 0;function Xne(){if(!TO)return!1;var i={},r=Ar.CSS&&Ar.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(e){return i[e]=r?Ar.CSS.supports("touch-action",e):!0}),i}var IO="compute",kO="auto",Ef="manipulation",Fi="none",bo="pan-x",$o="pan-y",Js=Xne(),Jne=/mobile|tablet|ip(ad|hone|od)|android/i,PO="ontouchstart"in Ar,Zne=Xl(Ar,"PointerEvent")!==void 0,Qne=PO&&Jne.test(navigator.userAgent),hs="touch",eae="pen",Yv="mouse",tae="kinect",rae=25,gt=1,hn=2,je=4,It=8,Uu=1,cs=2,ds=4,fs=8,na=16,mr=cs|ds,ji=fs|na,xO=mr|ji,CO=["x","y"],Ku=["clientX","clientY"];function Dr(i,r,e){var t;if(i)if(i.forEach)i.forEach(r,e);else if(i.length!==void 0)for(t=0;t-1}function iae(i){if(ki(i,Fi))return Fi;var r=ki(i,bo),e=ki(i,$o);return r&&e?Fi:r||e?r?bo:$o:ki(i,Ef)?Ef:kO}var AO=function(){function i(e,t){this.manager=e,this.set(t)}var r=i.prototype;return r.set=function(t){t===IO&&(t=this.compute()),TO&&this.manager.element.style&&Js[t]&&(this.manager.element.style[OO]=t),this.actions=t.toLowerCase().trim()},r.update=function(){this.set(this.manager.options.touchAction)},r.compute=function(){var t=[];return Dr(this.manager.recognizers,function(n){Jl(n.options.enable,[n])&&(t=t.concat(n.getTouchAction()))}),iae(t.join(" "))},r.preventDefaults=function(t){var n=t.srcEvent,a=t.offsetDirection;if(this.manager.session.prevented){n.preventDefault();return}var o=this.actions,s=ki(o,Fi)&&!Js[Fi],u=ki(o,$o)&&!Js[$o],l=ki(o,bo)&&!Js[bo];if(s){var h=t.pointers.length===1,d=t.distance<2,c=t.deltaTime<250;if(h&&d&&c)return}if(!(l&&u)&&(s||u&&a&mr||l&&a&ji))return this.preventSrc(n)},r.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},i}();function Xv(i,r){for(;i;){if(i===r)return!0;i=i.parentNode}return!1}function DO(i){var r=i.length;if(r===1)return{x:zn(i[0].clientX),y:zn(i[0].clientY)};for(var e=0,t=0,n=0;n=Gi(r)?i<0?cs:ds:r<0?fs:na}function nae(i,r){var e=r.center,t=i.offsetDelta||{},n=i.prevDelta||{},a=i.prevInput||{};(r.eventType===gt||a.eventType===je)&&(n=i.prevDelta={x:a.deltaX||0,y:a.deltaY||0},t=i.offsetDelta={x:e.x,y:e.y}),r.deltaX=n.x+(e.x-t.x),r.deltaY=n.y+(e.y-t.y)}function NO(i,r,e){return{x:r/i||0,y:e/i||0}}function aae(i,r){return Gu(r[0],r[1],Ku)/Gu(i[0],i[1],Ku)}function oae(i,r){return Sf(r[1],r[0],Ku)+Sf(i[1],i[0],Ku)}function sae(i,r){var e=i.lastInterval||r,t=r.timeStamp-e.timeStamp,n,a,o,s;if(r.eventType!==It&&(t>rae||e.velocity===void 0)){var u=r.deltaX-e.deltaX,l=r.deltaY-e.deltaY,h=NO(t,u,l);a=h.x,o=h.y,n=Gi(h.x)>Gi(h.y)?h.x:h.y,s=RO(u,l),i.lastInterval=r}else n=e.velocity,a=e.velocityX,o=e.velocityY,s=e.direction;r.velocity=n,r.velocityX=a,r.velocityY=o,r.direction=s}function uae(i,r){var e=i.session,t=r.pointers,n=t.length;e.firstInput||(e.firstInput=m1(r)),n>1&&!e.firstMultiple?e.firstMultiple=m1(r):n===1&&(e.firstMultiple=!1);var a=e.firstInput,o=e.firstMultiple,s=o?o.center:a.center,u=r.center=DO(t);r.timeStamp=qv(),r.deltaTime=r.timeStamp-a.timeStamp,r.angle=Sf(s,u),r.distance=Gu(s,u),nae(e,r),r.offsetDirection=RO(r.deltaX,r.deltaY);var l=NO(r.deltaTime,r.deltaX,r.deltaY);r.overallVelocityX=l.x,r.overallVelocityY=l.y,r.overallVelocity=Gi(l.x)>Gi(l.y)?l.x:l.y,r.scale=o?aae(o.pointers,t):1,r.rotation=o?oae(o.pointers,t):0,r.maxPointers=e.prevInput?r.pointers.length>e.prevInput.maxPointers?r.pointers.length:e.prevInput.maxPointers:r.pointers.length,sae(e,r);var h=i.element,d=r.srcEvent,c;d.composedPath?c=d.composedPath()[0]:d.path?c=d.path[0]:c=d.target,Xv(c,h)&&(h=c),r.target=h}function lae(i,r,e){var t=e.pointers.length,n=e.changedPointers.length,a=r>&&t-n===0,o=r&(je|It)&&t-n===0;e.isFirst=!!a,e.isFinal=!!o,a&&(i.session={}),e.eventType=r,uae(i,e),i.emit("hammer.input",e),i.recognize(e),i.session.prevInput=e}function wo(i){return i.trim().split(/\s+/g)}function eo(i,r,e){Dr(wo(r),function(t){i.addEventListener(t,e,!1)})}function to(i,r,e){Dr(wo(r),function(t){i.removeEventListener(t,e,!1)})}function b1(i){var r=i.ownerDocument||i;return r.defaultView||r.parentWindow||window}var Ra=function(){function i(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(a){Jl(e.options.enable,[e])&&n.handler(a)},this.init()}var r=i.prototype;return r.handler=function(){},r.init=function(){this.evEl&&eo(this.element,this.evEl,this.domHandler),this.evTarget&&eo(this.target,this.evTarget,this.domHandler),this.evWin&&eo(b1(this.element),this.evWin,this.domHandler)},r.destroy=function(){this.evEl&&to(this.element,this.evEl,this.domHandler),this.evTarget&&to(this.target,this.evTarget,this.domHandler),this.evWin&&to(b1(this.element),this.evWin,this.domHandler)},i}();function qi(i,r,e){if(i.indexOf&&!e)return i.indexOf(r);for(var t=0;tu[r]}):t=t.sort()),t}var dae={touchstart:gt,touchmove:hn,touchend:je,touchcancel:It},fae="touchstart touchmove touchend touchcancel",Zv=function(i){Qt(r,i);function r(){var t;return r.prototype.evTarget=fae,t=i.apply(this,arguments)||this,t.targetIds={},t}var e=r.prototype;return e.handler=function(n){var a=dae[n.type],o=vae.call(this,n,a);o&&this.callback(this.manager,a,{pointers:o[0],changedPointers:o[1],pointerType:hs,srcEvent:n})},r}(Ra);function vae(i,r){var e=_o(i.touches),t=this.targetIds;if(r&(gt|hn)&&e.length===1)return t[e[0].identifier]=!0,[e,e];var n,a,o=_o(i.changedTouches),s=[],u=this.target;if(a=e.filter(function(l){return Xv(l.target,u)}),r===gt)for(n=0;n-1&&n.splice(s,1)};setTimeout(a,mae)}}function bae(i,r){i>?(this.primaryTouch=r.changedPointers[0].identifier,w1.call(this,r)):i&(je|It)&&w1.call(this,r)}function $ae(i){for(var r=i.srcEvent.clientX,e=i.srcEvent.clientY,t=0;t-1&&this.requireFail.splice(n,1),this},r.hasRequireFailures=function(){return this.requireFail.length>0},r.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},r.emit=function(t){var n=this,a=this.state;function o(s){n.manager.emit(s,t)}a=si&&o(n.options.event+_1(a))},r.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=vr},r.canEmit=function(){for(var t=0;ta.threshold&&u&a.direction},e.attrTest=function(n){return oa.prototype.attrTest.call(this,n)&&(this.state&Yt||!(this.state&Yt)&&this.directionTest(n))},e.emit=function(n){this.pX=n.deltaX,this.pY=n.deltaY;var a=LO(n.direction);a&&(n.additionalEvent=this.options.event+a),i.prototype.emit.call(this,n)},r}(oa),zO=function(i){Qt(r,i);function r(t){return t===void 0&&(t={}),i.call(this,ur({event:"swipe",threshold:10,velocity:.3,direction:mr|ji,pointers:1},t))||this}var e=r.prototype;return e.getTouchAction=function(){return ep.prototype.getTouchAction.call(this)},e.attrTest=function(n){var a=this.options.direction,o;return a&(mr|ji)?o=n.overallVelocity:a&mr?o=n.overallVelocityX:a&ji&&(o=n.overallVelocityY),i.prototype.attrTest.call(this,n)&&a&n.offsetDirection&&n.distance>this.options.threshold&&n.maxPointers===this.options.pointers&&Gi(o)>this.options.velocity&&n.eventType&je},e.emit=function(n){var a=LO(n.offsetDirection);a&&this.manager.emit(this.options.event+a,n),this.manager.emit(this.options.event,n)},r}(oa),HO=function(i){Qt(r,i);function r(t){return t===void 0&&(t={}),i.call(this,ur({event:"pinch",threshold:0,pointers:2},t))||this}var e=r.prototype;return e.getTouchAction=function(){return[Fi]},e.attrTest=function(n){return i.prototype.attrTest.call(this,n)&&(Math.abs(n.scale-1)>this.options.threshold||this.state&Yt)},e.emit=function(n){if(n.scale!==1){var a=n.scale<1?"in":"out";n.additionalEvent=this.options.event+a}i.prototype.emit.call(this,n)},r}(oa),WO=function(i){Qt(r,i);function r(t){return t===void 0&&(t={}),i.call(this,ur({event:"rotate",threshold:0,pointers:2},t))||this}var e=r.prototype;return e.getTouchAction=function(){return[Fi]},e.attrTest=function(n){return i.prototype.attrTest.call(this,n)&&(Math.abs(n.rotation)>this.options.threshold||this.state&Yt)},r}(oa),VO=function(i){Qt(r,i);function r(t){var n;return t===void 0&&(t={}),n=i.call(this,ur({event:"press",pointers:1,time:251,threshold:9},t))||this,n._timer=null,n._input=null,n}var e=r.prototype;return e.getTouchAction=function(){return[kO]},e.process=function(n){var a=this,o=this.options,s=n.pointers.length===o.pointers,u=n.distanceo.time;if(this._input=n,!u||!s||n.eventType&(je|It)&&!l)this.reset();else if(n.eventType>)this.reset(),this._timer=setTimeout(function(){a.state=Rr,a.tryEmit()},o.time);else if(n.eventType&je)return Rr;return vr},e.reset=function(){clearTimeout(this._timer)},e.emit=function(n){this.state===Rr&&(n&&n.eventType&je?this.manager.emit(this.options.event+"up",n):(this._input.timeStamp=qv(),this.manager.emit(this.options.event,this._input)))},r}(vs),UO={domEvents:!1,touchAction:IO,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},E1=[[WO,{enable:!1}],[HO,{enable:!1},["rotate"]],[zO,{direction:mr}],[ep,{direction:mr},["swipe"]],[Of],[Of,{event:"doubletap",taps:2},["tap"]],[VO]],Sae=1,S1=2;function O1(i,r){var e=i.element;if(e.style){var t;Dr(i.options.cssProps,function(n,a){t=Xl(e.style,a),r?(i.oldCssProps[t]=e.style[t],e.style[t]=n):e.style[t]=i.oldCssProps[t]||""}),r||(i.oldCssProps={})}}function Oae(i,r){var e=document.createEvent("Event");e.initEvent(i,!0,!0),e.gesture=r,r.target.dispatchEvent(e)}var T1=function(){function i(e,t){var n=this;this.options=Ki({},UO,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=wae(this),this.touchAction=new AO(this,this.options.touchAction),O1(this,!0),Dr(this.options.recognizers,function(a){var o=n.add(new a[0](a[1]));a[2]&&o.recognizeWith(a[2]),a[3]&&o.requireFailure(a[3])},this)}var r=i.prototype;return r.set=function(t){return Ki(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},r.stop=function(t){this.session.stopped=t?S1:Sae},r.recognize=function(t){var n=this.session;if(!n.stopped){this.touchAction.preventDefaults(t);var a,o=this.recognizers,s=n.curRecognizer;(!s||s&&s.state&Rr)&&(n.curRecognizer=null,s=null);for(var u=0;u"u"?{style:{}}:document.createElement("div"),Yne="function",zn=Math.round,Xi=Math.abs,qv=Date.now;function Xl(i,r){for(var e,t,n=r[0].toUpperCase()+r.slice(1),a=0;a"u"?Dr={}:Dr=window;var OO=Xl(qne.style,"touchAction"),TO=OO!==void 0;function Xne(){if(!TO)return!1;var i={},r=Dr.CSS&&Dr.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(e){return i[e]=r?Dr.CSS.supports("touch-action",e):!0}),i}var IO="compute",kO="auto",Ef="manipulation",zi="none",bo="pan-x",$o="pan-y",Js=Xne(),Jne=/mobile|tablet|ip(ad|hone|od)|android/i,PO="ontouchstart"in Dr,Zne=Xl(Dr,"PointerEvent")!==void 0,Qne=PO&&Jne.test(navigator.userAgent),hs="touch",eae="pen",Yv="mouse",tae="kinect",rae=25,gt=1,fn=2,je=4,It=8,Uu=1,cs=2,ds=4,fs=8,na=16,mr=cs|ds,Hi=fs|na,xO=mr|Hi,CO=["x","y"],Ku=["clientX","clientY"];function Rr(i,r,e){var t;if(i)if(i.forEach)i.forEach(r,e);else if(i.length!==void 0)for(t=0;t-1}function iae(i){if(Ci(i,zi))return zi;var r=Ci(i,bo),e=Ci(i,$o);return r&&e?zi:r||e?r?bo:$o:Ci(i,Ef)?Ef:kO}var AO=function(){function i(e,t){this.manager=e,this.set(t)}var r=i.prototype;return r.set=function(t){t===IO&&(t=this.compute()),TO&&this.manager.element.style&&Js[t]&&(this.manager.element.style[OO]=t),this.actions=t.toLowerCase().trim()},r.update=function(){this.set(this.manager.options.touchAction)},r.compute=function(){var t=[];return Rr(this.manager.recognizers,function(n){Jl(n.options.enable,[n])&&(t=t.concat(n.getTouchAction()))}),iae(t.join(" "))},r.preventDefaults=function(t){var n=t.srcEvent,a=t.offsetDirection;if(this.manager.session.prevented){n.preventDefault();return}var o=this.actions,s=Ci(o,zi)&&!Js[zi],u=Ci(o,$o)&&!Js[$o],l=Ci(o,bo)&&!Js[bo];if(s){var h=t.pointers.length===1,d=t.distance<2,c=t.deltaTime<250;if(h&&d&&c)return}if(!(l&&u)&&(s||u&&a&mr||l&&a&Hi))return this.preventSrc(n)},r.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},i}();function Xv(i,r){for(;i;){if(i===r)return!0;i=i.parentNode}return!1}function DO(i){var r=i.length;if(r===1)return{x:zn(i[0].clientX),y:zn(i[0].clientY)};for(var e=0,t=0,n=0;n=Xi(r)?i<0?cs:ds:r<0?fs:na}function nae(i,r){var e=r.center,t=i.offsetDelta||{},n=i.prevDelta||{},a=i.prevInput||{};(r.eventType===gt||a.eventType===je)&&(n=i.prevDelta={x:a.deltaX||0,y:a.deltaY||0},t=i.offsetDelta={x:e.x,y:e.y}),r.deltaX=n.x+(e.x-t.x),r.deltaY=n.y+(e.y-t.y)}function NO(i,r,e){return{x:r/i||0,y:e/i||0}}function aae(i,r){return Gu(r[0],r[1],Ku)/Gu(i[0],i[1],Ku)}function oae(i,r){return Sf(r[1],r[0],Ku)+Sf(i[1],i[0],Ku)}function sae(i,r){var e=i.lastInterval||r,t=r.timeStamp-e.timeStamp,n,a,o,s;if(r.eventType!==It&&(t>rae||e.velocity===void 0)){var u=r.deltaX-e.deltaX,l=r.deltaY-e.deltaY,h=NO(t,u,l);a=h.x,o=h.y,n=Xi(h.x)>Xi(h.y)?h.x:h.y,s=RO(u,l),i.lastInterval=r}else n=e.velocity,a=e.velocityX,o=e.velocityY,s=e.direction;r.velocity=n,r.velocityX=a,r.velocityY=o,r.direction=s}function uae(i,r){var e=i.session,t=r.pointers,n=t.length;e.firstInput||(e.firstInput=m1(r)),n>1&&!e.firstMultiple?e.firstMultiple=m1(r):n===1&&(e.firstMultiple=!1);var a=e.firstInput,o=e.firstMultiple,s=o?o.center:a.center,u=r.center=DO(t);r.timeStamp=qv(),r.deltaTime=r.timeStamp-a.timeStamp,r.angle=Sf(s,u),r.distance=Gu(s,u),nae(e,r),r.offsetDirection=RO(r.deltaX,r.deltaY);var l=NO(r.deltaTime,r.deltaX,r.deltaY);r.overallVelocityX=l.x,r.overallVelocityY=l.y,r.overallVelocity=Xi(l.x)>Xi(l.y)?l.x:l.y,r.scale=o?aae(o.pointers,t):1,r.rotation=o?oae(o.pointers,t):0,r.maxPointers=e.prevInput?r.pointers.length>e.prevInput.maxPointers?r.pointers.length:e.prevInput.maxPointers:r.pointers.length,sae(e,r);var h=i.element,d=r.srcEvent,c;d.composedPath?c=d.composedPath()[0]:d.path?c=d.path[0]:c=d.target,Xv(c,h)&&(h=c),r.target=h}function lae(i,r,e){var t=e.pointers.length,n=e.changedPointers.length,a=r>&&t-n===0,o=r&(je|It)&&t-n===0;e.isFirst=!!a,e.isFinal=!!o,a&&(i.session={}),e.eventType=r,uae(i,e),i.emit("hammer.input",e),i.recognize(e),i.session.prevInput=e}function wo(i){return i.trim().split(/\s+/g)}function eo(i,r,e){Rr(wo(r),function(t){i.addEventListener(t,e,!1)})}function to(i,r,e){Rr(wo(r),function(t){i.removeEventListener(t,e,!1)})}function b1(i){var r=i.ownerDocument||i;return r.defaultView||r.parentWindow||window}var Ra=function(){function i(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(a){Jl(e.options.enable,[e])&&n.handler(a)},this.init()}var r=i.prototype;return r.handler=function(){},r.init=function(){this.evEl&&eo(this.element,this.evEl,this.domHandler),this.evTarget&&eo(this.target,this.evTarget,this.domHandler),this.evWin&&eo(b1(this.element),this.evWin,this.domHandler)},r.destroy=function(){this.evEl&&to(this.element,this.evEl,this.domHandler),this.evTarget&&to(this.target,this.evTarget,this.domHandler),this.evWin&&to(b1(this.element),this.evWin,this.domHandler)},i}();function Ji(i,r,e){if(i.indexOf&&!e)return i.indexOf(r);for(var t=0;tu[r]}):t=t.sort()),t}var dae={touchstart:gt,touchmove:fn,touchend:je,touchcancel:It},fae="touchstart touchmove touchend touchcancel",Zv=function(i){Qt(r,i);function r(){var t;return r.prototype.evTarget=fae,t=i.apply(this,arguments)||this,t.targetIds={},t}var e=r.prototype;return e.handler=function(n){var a=dae[n.type],o=vae.call(this,n,a);o&&this.callback(this.manager,a,{pointers:o[0],changedPointers:o[1],pointerType:hs,srcEvent:n})},r}(Ra);function vae(i,r){var e=_o(i.touches),t=this.targetIds;if(r&(gt|fn)&&e.length===1)return t[e[0].identifier]=!0,[e,e];var n,a,o=_o(i.changedTouches),s=[],u=this.target;if(a=e.filter(function(l){return Xv(l.target,u)}),r===gt)for(n=0;n-1&&n.splice(s,1)};setTimeout(a,mae)}}function bae(i,r){i>?(this.primaryTouch=r.changedPointers[0].identifier,w1.call(this,r)):i&(je|It)&&w1.call(this,r)}function $ae(i){for(var r=i.srcEvent.clientX,e=i.srcEvent.clientY,t=0;t-1&&this.requireFail.splice(n,1),this},r.hasRequireFailures=function(){return this.requireFail.length>0},r.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},r.emit=function(t){var n=this,a=this.state;function o(s){n.manager.emit(s,t)}a=si&&o(n.options.event+_1(a))},r.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=vr},r.canEmit=function(){for(var t=0;ta.threshold&&u&a.direction},e.attrTest=function(n){return oa.prototype.attrTest.call(this,n)&&(this.state&Yt||!(this.state&Yt)&&this.directionTest(n))},e.emit=function(n){this.pX=n.deltaX,this.pY=n.deltaY;var a=LO(n.direction);a&&(n.additionalEvent=this.options.event+a),i.prototype.emit.call(this,n)},r}(oa),zO=function(i){Qt(r,i);function r(t){return t===void 0&&(t={}),i.call(this,ur({event:"swipe",threshold:10,velocity:.3,direction:mr|Hi,pointers:1},t))||this}var e=r.prototype;return e.getTouchAction=function(){return ep.prototype.getTouchAction.call(this)},e.attrTest=function(n){var a=this.options.direction,o;return a&(mr|Hi)?o=n.overallVelocity:a&mr?o=n.overallVelocityX:a&Hi&&(o=n.overallVelocityY),i.prototype.attrTest.call(this,n)&&a&n.offsetDirection&&n.distance>this.options.threshold&&n.maxPointers===this.options.pointers&&Xi(o)>this.options.velocity&&n.eventType&je},e.emit=function(n){var a=LO(n.offsetDirection);a&&this.manager.emit(this.options.event+a,n),this.manager.emit(this.options.event,n)},r}(oa),HO=function(i){Qt(r,i);function r(t){return t===void 0&&(t={}),i.call(this,ur({event:"pinch",threshold:0,pointers:2},t))||this}var e=r.prototype;return e.getTouchAction=function(){return[zi]},e.attrTest=function(n){return i.prototype.attrTest.call(this,n)&&(Math.abs(n.scale-1)>this.options.threshold||this.state&Yt)},e.emit=function(n){if(n.scale!==1){var a=n.scale<1?"in":"out";n.additionalEvent=this.options.event+a}i.prototype.emit.call(this,n)},r}(oa),VO=function(i){Qt(r,i);function r(t){return t===void 0&&(t={}),i.call(this,ur({event:"rotate",threshold:0,pointers:2},t))||this}var e=r.prototype;return e.getTouchAction=function(){return[zi]},e.attrTest=function(n){return i.prototype.attrTest.call(this,n)&&(Math.abs(n.rotation)>this.options.threshold||this.state&Yt)},r}(oa),WO=function(i){Qt(r,i);function r(t){var n;return t===void 0&&(t={}),n=i.call(this,ur({event:"press",pointers:1,time:251,threshold:9},t))||this,n._timer=null,n._input=null,n}var e=r.prototype;return e.getTouchAction=function(){return[kO]},e.process=function(n){var a=this,o=this.options,s=n.pointers.length===o.pointers,u=n.distanceo.time;if(this._input=n,!u||!s||n.eventType&(je|It)&&!l)this.reset();else if(n.eventType>)this.reset(),this._timer=setTimeout(function(){a.state=Nr,a.tryEmit()},o.time);else if(n.eventType&je)return Nr;return vr},e.reset=function(){clearTimeout(this._timer)},e.emit=function(n){this.state===Nr&&(n&&n.eventType&je?this.manager.emit(this.options.event+"up",n):(this._input.timeStamp=qv(),this.manager.emit(this.options.event,this._input)))},r}(vs),UO={domEvents:!1,touchAction:IO,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},E1=[[VO,{enable:!1}],[HO,{enable:!1},["rotate"]],[zO,{direction:mr}],[ep,{direction:mr},["swipe"]],[Of],[Of,{event:"doubletap",taps:2},["tap"]],[WO]],Sae=1,S1=2;function O1(i,r){var e=i.element;if(e.style){var t;Rr(i.options.cssProps,function(n,a){t=Xl(e.style,a),r?(i.oldCssProps[t]=e.style[t],e.style[t]=n):e.style[t]=i.oldCssProps[t]||""}),r||(i.oldCssProps={})}}function Oae(i,r){var e=document.createEvent("Event");e.initEvent(i,!0,!0),e.gesture=r,r.target.dispatchEvent(e)}var T1=function(){function i(e,t){var n=this;this.options=Yi({},UO,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=wae(this),this.touchAction=new AO(this,this.options.touchAction),O1(this,!0),Rr(this.options.recognizers,function(a){var o=n.add(new a[0](a[1]));a[2]&&o.recognizeWith(a[2]),a[3]&&o.requireFailure(a[3])},this)}var r=i.prototype;return r.set=function(t){return Yi(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},r.stop=function(t){this.session.stopped=t?S1:Sae},r.recognize=function(t){var n=this.session;if(!n.stopped){this.touchAction.preventDefaults(t);var a,o=this.recognizers,s=n.curRecognizer;(!s||s&&s.state&Nr)&&(n.curRecognizer=null,s=null);for(var u=0;u\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=window.console&&(window.console.warn||window.console.log);return o&&o.call(window.console,t,a),i.apply(this,arguments)}}var GO=KO(function(i,r,e){for(var t=Object.keys(r),n=0;n=i.length?{done:!0}:{done:!1,value:i[t++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(i)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Rae(i,r){var e;if(i){if(typeof i=="string")return k1(i,r);var t=rt(e=Object.prototype.toString.call(i)).call(e,8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return sn(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return k1(i,r)}}function k1(i,r){(r==null||r>i.length)&&(r=i.length);for(var e=0,t=new Array(r);e>>0,n-=i,n*=i,i=n>>>0,n-=i,i+=n*4294967296}return(i>>>0)*23283064365386963e-26}}function Fae(){var i=function(){};return{on:i,off:i,destroy:i,emit:i,get:function(){return{set:i}}}}var tp=typeof window<"u"?window.Hammer||Dae:function(){return Fae()};function pr(i){var r=this,e;this._cleanupQueue=[],this.active=!1,this._dom={container:i,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(function(){r._dom.overlay.parentNode.removeChild(r._dom.overlay)});var t=tp(this._dom.overlay);t.on("tap",P(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(function(){t.destroy()});var n=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];de(n).call(n,function(a){t.on(a,function(o){o.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=function(a){jae(a.target,i)||r.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(function(){document.body.removeEventListener("click",r._onClick)})),this._escListener=function(a){("key"in a?a.key==="Escape":a.keyCode===27)&&r.deactivate()}}JE(pr.prototype);pr.current=null;pr.prototype.destroy=function(){var i,r;this.deactivate();var e=YO(Mi(i=Cr(r=this._cleanupQueue).call(r,0)).call(i)),t;try{for(e.s();!(t=e.n()).done;){var n=t.value;n()}}catch(a){e.e(a)}finally{e.f()}};pr.prototype.activate=function(){pr.current&&pr.current.deactivate(),pr.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)};pr.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")};pr.prototype._onTapOverlay=function(i){this.activate(),i.srcEvent.stopPropagation()};function jae(i,r){for(;i;){if(i===r)return!0;i=i.parentNode}return!1}var Lae=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,zae=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Hae=/^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i,Wae=/^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i;function Yr(i){if(i)for(;i.hasChildNodes()===!0;){var r=i.firstChild;r&&(Yr(r),i.removeChild(r))}}function Un(i){return i instanceof String||typeof i=="string"}function P1(i){return ce(i)==="object"&&i!==null}function Yi(i,r,e,t){var n=!1;t===!0&&(n=r[e]===null&&i[e]!==void 0),n?delete i[e]:i[e]=r[e]}function XO(i,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;for(var t in i)if(r[t]!==void 0)if(r[t]===null||ce(r[t])!=="object")Yi(i,r,t,e);else{var n=i[t],a=r[t];P1(n)&&P1(a)&&XO(n,a,e)}}function Na(i,r,e){var t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(le(e))throw new TypeError("Arrays are not supported by deepExtend");for(var n=0;n3&&arguments[3]!==void 0?arguments[3]:!1;if(le(e))throw new TypeError("Arrays are not supported by deepExtend");for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&!oi(i).call(i,n))if(e[n]&&e[n].constructor===Object)r[n]===void 0&&(r[n]={}),r[n].constructor===Object?ve(r[n],e[n]):Yi(r,e,n,t);else if(le(e[n])){r[n]=[];for(var a=0;a2&&arguments[2]!==void 0?arguments[2]:!1,t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)||e===!0)if(ce(r[n])==="object"&&r[n]!==null&&u1(r[n])===Object.prototype)i[n]===void 0?i[n]=ve({},r[n],e):ce(i[n])==="object"&&i[n]!==null&&u1(i[n])===Object.prototype?ve(i[n],r[n],e):Yi(i,r,n,t);else if(le(r[n])){var a;i[n]=rt(a=r[n]).call(a)}else Yi(i,r,n,t);return i}function Yu(i,r){var e;return Kv(e=[]).call(e,dr(i),[r])}function Vae(i){return rt(i).call(i)}function Uae(i){return i.getBoundingClientRect().left}function Kae(i){return i.getBoundingClientRect().top}function te(i,r){if(le(i))for(var e=i.length,t=0;t3&&arguments[3]!==void 0?arguments[3]:{},n=function(v){return v!=null},a=function(v){return v!==null&&ce(v)==="object"},o=function(v){for(var p in v)if(Object.prototype.hasOwnProperty.call(v,p))return!1;return!0};if(!a(i))throw new Error("Parameter mergeTarget must be an object");if(!a(r))throw new Error("Parameter options must be an object");if(!n(e))throw new Error("Parameter option must have a value");if(!a(t))throw new Error("Parameter globalOptions must be an object");var s=function(v,p,g){a(v[g])||(v[g]={});var y=p[g],m=v[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(m[b]=y[b])},u=r[e],l=a(t)&&!o(t),h=l?t[e]:void 0,d=h?h.enabled:void 0;if(u!==void 0){if(typeof u=="boolean"){a(i[e])||(i[e]={}),i[e].enabled=u;return}if(u===null&&!a(i[e]))if(n(h))i[e]=Bi(h);else return;if(a(u)){var c=!0;u.enabled!==void 0?c=u.enabled:d!==void 0&&(c=h.enabled),s(i,r,e),i[e].enabled=c}}}var Yae={linear:function(r){return r},easeInQuad:function(r){return r*r},easeOutQuad:function(r){return r*(2-r)},easeInOutQuad:function(r){return r<.5?2*r*r:-1+(4-2*r)*r},easeInCubic:function(r){return r*r*r},easeOutCubic:function(r){return--r*r*r+1},easeInOutCubic:function(r){return r<.5?4*r*r*r:(r-1)*(2*r-2)*(2*r-2)+1},easeInQuart:function(r){return r*r*r*r},easeOutQuart:function(r){return 1- --r*r*r*r},easeInOutQuart:function(r){return r<.5?8*r*r*r*r:1-8*--r*r*r*r},easeInQuint:function(r){return r*r*r*r*r},easeOutQuint:function(r){return 1+--r*r*r*r*r},easeInOutQuint:function(r){return r<.5?16*r*r*r*r*r:1+16*--r*r*r*r*r}};function Xr(i,r){var e;le(r)||(r=[r]);var t=YO(i),n;try{for(t.s();!(n=t.n()).done;){var a=n.value;if(a){e=a[r[0]];for(var o=1;o0&&arguments[0]!==void 0?arguments[0]:1;N(this,i),this.pixelRatio=r,this.generated=!1,this.centerCoordinates={x:289/2,y:289/2},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=function(){},this.closeCallback=function(){},this._create()}return M(i,[{key:"insertTo",value:function(e){this.hammer!==void 0&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:"setUpdateCallback",value:function(e){if(typeof e=="function")this.updateCallback=e;else throw new Error("Function attempted to set as colorPicker update callback is not a function.")}},{key:"setCloseCallback",value:function(e){if(typeof e=="function")this.closeCallback=e;else throw new Error("Function attempted to set as colorPicker closing callback is not a function.")}},{key:"_isColorString",value:function(e){if(typeof e=="string")return Xae[e]}},{key:"setColor",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e!=="none"){var n,a=this._isColorString(e);if(a!==void 0&&(e=a),Un(e)===!0){if(QO(e)===!0){var o=e.substr(4).substr(0,e.length-5).split(",");n={r:o[0],g:o[1],b:o[2],a:1}}else if(qae(e)===!0){var s=e.substr(5).substr(0,e.length-6).split(",");n={r:s[0],g:s[1],b:s[2],a:s[3]}}else if(ZO(e)===!0){var u=rp(e);n={r:u.r,g:u.g,b:u.b,a:1}}}else if(e instanceof Object&&e.r!==void 0&&e.g!==void 0&&e.b!==void 0){var l=e.a!==void 0?e.a:"1.0";n={r:e.r,g:e.g,b:e.b,a:l}}if(n===void 0)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+us(e));this._setColor(n,t)}}},{key:"show",value:function(){this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}},{key:"_hide",value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;t===!0&&(this.previousColor=Fe({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",yr(function(){e.closeCallback!==void 0&&(e.closeCallback(),e.closeCallback=void 0)},0)}},{key:"_save",value:function(){this.updateCallback(this.color),this.applied=!1,this._hide()}},{key:"_apply",value:function(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}},{key:"_loadLast",value:function(){this.previousColor!==void 0?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}},{key:"_setColor",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;t===!0&&(this.initialColor=Fe({},e)),this.color=e;var n=Ga(e.r,e.g,e.b),a=2*Math.PI,o=this.r*n.s,s=this.centerCoordinates.x+o*Math.sin(a*n.h),u=this.centerCoordinates.y+o*Math.cos(a*n.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=u-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}},{key:"_setOpacity",value:function(e){this.color.a=e/100,this._updatePicker(this.color)}},{key:"_setBrightness",value:function(e){var t=Ga(this.color.r,this.color.g,this.color.b);t.v=e/100;var n=mu(t.h,t.s,t.v);n.a=this.color.a,this.color=n,this._updatePicker()}},{key:"_updatePicker",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.color,t=Ga(e.r,e.g,e.b),n=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(n.webkitBackingStorePixelRatio||n.mozBackingStorePixelRatio||n.msBackingStorePixelRatio||n.oBackingStorePixelRatio||n.backingStorePixelRatio||1)),n.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var a=this.colorPickerCanvas.clientWidth,o=this.colorPickerCanvas.clientHeight;n.clearRect(0,0,a,o),n.putImageData(this.hueCircle,0,0),n.fillStyle="rgba(0,0,0,"+(1-t.v)+")",n.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),ls(n).call(n),this.brightnessRange.value=100*t.v,this.opacityRange.value=100*e.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}},{key:"_setSize",value:function(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}},{key:"_create",value:function(){var e,t,n,a;if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){var s=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(s.webkitBackingStorePixelRatio||s.mozBackingStorePixelRatio||s.msBackingStorePixelRatio||s.oBackingStorePixelRatio||s.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{var o=document.createElement("DIV");o.style.color="red",o.style.fontWeight="bold",o.style.padding="10px",o.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(o)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch{}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch{}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var u=this;this.opacityRange.onchange=function(){u._setOpacity(this.value)},this.opacityRange.oninput=function(){u._setOpacity(this.value)},this.brightnessRange.onchange=function(){u._setBrightness(this.value)},this.brightnessRange.oninput=function(){u._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerText="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerText="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerText="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerText="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerText="cancel",this.cancelButton.onclick=P(e=this._hide).call(e,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=P(t=this._apply).call(t,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=P(n=this._save).call(n,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=P(a=this._loadLast).call(a,this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}},{key:"_bindHammer",value:function(){var e=this;this.drag={},this.pinch={},this.hammer=new tp(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",function(t){t.isFirst&&e._moveSelector(t)}),this.hammer.on("tap",function(t){e._moveSelector(t)}),this.hammer.on("panstart",function(t){e._moveSelector(t)}),this.hammer.on("panmove",function(t){e._moveSelector(t)}),this.hammer.on("panend",function(t){e._moveSelector(t)})}},{key:"_generateHueCircle",value:function(){if(this.generated===!1){var e=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var t=this.colorPickerCanvas.clientWidth,n=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,t,n);var a,o,s,u;this.centerCoordinates={x:t*.5,y:n*.5},this.r=.49*t;var l=2*Math.PI/360,h=1/360,d=1/this.r,c;for(s=0;s<360;s++)for(u=0;u3&&arguments[3]!==void 0?arguments[3]:1,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:function(){return!1};N(this,i),this.parent=r,this.changedOptions=[],this.container=e,this.allowCreation=!1,this.hideOption=a,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},Fe(this.options,this.defaultOptions),this.configureOptions=t,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new Jae(n),this.wrapper=void 0}return M(i,[{key:"setOptions",value:function(e){if(e!==void 0){this.popupHistory={},this._removePopup();var t=!0;if(typeof e=="string")this.options.filter=e;else if(le(e))this.options.filter=e.join();else if(ce(e)==="object"){if(e==null)throw new TypeError("options cannot be null");e.container!==void 0&&(this.options.container=e.container),Ot(e)!==void 0&&(this.options.filter=Ot(e)),e.showButton!==void 0&&(this.options.showButton=e.showButton),e.enabled!==void 0&&(t=e.enabled)}else typeof e=="boolean"?(this.options.filter=!0,t=e):typeof e=="function"&&(this.options.filter=e,t=!0);Ot(this.options)===!1&&(t=!1),this.options.enabled=t}this._clean()}},{key:"setModuleOptions",value:function(e){this.moduleOptions=e,this.options.enabled===!0&&(this._clean(),this.options.container!==void 0&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){this._clean(),this.changedOptions=[];var e=Ot(this.options),t=0,n=!1;for(var a in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,a)&&(this.allowCreation=!1,n=!1,typeof e=="function"?(n=e(a,[]),n=n||this._handleObject(this.configureOptions[a],[a],!0)):(e===!0||ie(e).call(e,a)!==-1)&&(n=!0),n!==!1&&(this.allowCreation=!0,t>0&&this._makeItem([]),this._makeHeader(a),this._handleObject(this.configureOptions[a],[a])),t++);this._makeButton(),this._push()}},{key:"_push",value:function(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var e=0;e1?n-1:0),o=1;o2&&arguments[2]!==void 0?arguments[2]:!1,a=document.createElement("div");if(a.className="vis-configuration vis-config-label vis-config-s"+t.length,n===!0){for(;a.firstChild;)a.removeChild(a.firstChild);a.appendChild(kf("i","b",e))}else a.innerText=e+":";return a}},{key:"_makeDropdown",value:function(e,t,n){var a=document.createElement("select");a.className="vis-configuration vis-config-select";var o=0;t!==void 0&&ie(e).call(e,t)!==-1&&(o=ie(e).call(e,t));for(var s=0;ss&&s!==1&&(l.max=Math.ceil(t*c),d=l.max,h="range increased"),l.value=t}else l.value=a;var f=document.createElement("input");f.className="vis-configuration vis-config-rangeinput",f.value=l.value;var v=this;l.onchange=function(){f.value=this.value,v._update(Number(this.value),n)},l.oninput=function(){f.value=this.value};var p=this._makeLabel(n[n.length-1],n),g=this._makeItem(n,p,l,f);h!==""&&this.popupHistory[g]!==d&&(this.popupHistory[g]=d,this._setupPopup(h,g))}},{key:"_makeButton",value:function(){var e=this;if(this.options.showButton===!0){var t=document.createElement("div");t.className="vis-configuration vis-config-button",t.innerText="generate options",t.onclick=function(){e._printOptions()},t.onmouseover=function(){t.className="vis-configuration vis-config-button hover"},t.onmouseout=function(){t.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(t)}}},{key:"_setupPopup",value:function(e,t){var n=this;if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=!1,o=Ot(this.options),s=!1;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){a=!0;var l=e[u],h=Yu(t,u);if(typeof o=="function"&&(a=o(u,t),a===!1&&!le(l)&&typeof l!="string"&&typeof l!="boolean"&&l instanceof Object&&(this.allowCreation=!1,a=this._handleObject(l,h,!0),this.allowCreation=n===!1)),a!==!1){s=!0;var d=this._getValue(h);if(le(l))this._handleArray(l,d,h);else if(typeof l=="string")this._makeTextInput(l,d,h);else if(typeof l=="boolean")this._makeCheckbox(l,d,h);else if(l instanceof Object){if(!this.hideOption(t,u,this.moduleOptions))if(l.enabled!==void 0){var c=Yu(h,"enabled"),f=this._getValue(c);if(f===!0){var v=this._makeLabel(u,h,!0);this._makeItem(h,v),s=this._handleObject(l,h)||s}else this._makeCheckbox(l,f,h)}else{var p=this._makeLabel(u,h,!0);this._makeItem(h,p),s=this._handleObject(l,h)||s}}else console.error("dont know how to handle",l,u,h)}}return s}},{key:"_handleArray",value:function(e,t,n){typeof e[0]=="string"&&e[0]==="color"?(this._makeColorField(e,t,n),e[1]!==t&&this.changedOptions.push({path:n,value:t})):typeof e[0]=="string"?(this._makeDropdown(e,t,n),e[0]!==t&&this.changedOptions.push({path:n,value:t})):typeof e[0]=="number"&&(this._makeRange(e,t,n),e[0]!==t&&this.changedOptions.push({path:n,value:Number(t)}))}},{key:"_update",value:function(e,t){var n=this._constructOptions(e,t);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",n),this.initialized=!0,this.parent.setOptions(n)}},{key:"_constructOptions",value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=n;e=e==="true"?!0:e,e=e==="false"?!1:e;for(var o=0;oo-this.padding&&(l=!0),l?s=this.x-n:s=this.x,h?u=this.y-t:u=this.y}else u=this.y-t,u+t+this.padding>a&&(u=a-t-this.padding),uo&&(s=o-n-this.padding),s\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=window.console&&(window.console.warn||window.console.log);return o&&o.call(window.console,t,a),i.apply(this,arguments)}}var GO=KO(function(i,r,e){for(var t=Object.keys(r),n=0;n=i.length?{done:!0}:{done:!1,value:i[t++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(i)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Rae(i,r){var e;if(i){if(typeof i=="string")return k1(i,r);var t=rt(e=Object.prototype.toString.call(i)).call(e,8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return hn(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return k1(i,r)}}function k1(i,r){(r==null||r>i.length)&&(r=i.length);for(var e=0,t=new Array(r);e>>0,n-=i,n*=i,i=n>>>0,n-=i,i+=n*4294967296}return(i>>>0)*23283064365386963e-26}}function Fae(){var i=function(){};return{on:i,off:i,destroy:i,emit:i,get:function(){return{set:i}}}}var tp=typeof window<"u"?window.Hammer||Dae:function(){return Fae()};function pr(i){var r=this,e;this._cleanupQueue=[],this.active=!1,this._dom={container:i,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(function(){r._dom.overlay.parentNode.removeChild(r._dom.overlay)});var t=tp(this._dom.overlay);t.on("tap",k(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(function(){t.destroy()});var n=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];fe(n).call(n,function(a){t.on(a,function(o){o.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=function(a){jae(a.target,i)||r.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(function(){document.body.removeEventListener("click",r._onClick)})),this._escListener=function(a){("key"in a?a.key==="Escape":a.keyCode===27)&&r.deactivate()}}JE(pr.prototype);pr.current=null;pr.prototype.destroy=function(){var i,r;this.deactivate();var e=YO(ji(i=Ar(r=this._cleanupQueue).call(r,0)).call(i)),t;try{for(e.s();!(t=e.n()).done;){var n=t.value;n()}}catch(a){e.e(a)}finally{e.f()}};pr.prototype.activate=function(){pr.current&&pr.current.deactivate(),pr.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)};pr.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")};pr.prototype._onTapOverlay=function(i){this.activate(),i.srcEvent.stopPropagation()};function jae(i,r){for(;i;){if(i===r)return!0;i=i.parentNode}return!1}var Lae=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,zae=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Hae=/^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i,Vae=/^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i;function Yr(i){if(i)for(;i.hasChildNodes()===!0;){var r=i.firstChild;r&&(Yr(r),i.removeChild(r))}}function Un(i){return i instanceof String||typeof i=="string"}function P1(i){return de(i)==="object"&&i!==null}function Zi(i,r,e,t){var n=!1;t===!0&&(n=r[e]===null&&i[e]!==void 0),n?delete i[e]:i[e]=r[e]}function XO(i,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;for(var t in i)if(r[t]!==void 0)if(r[t]===null||de(r[t])!=="object")Zi(i,r,t,e);else{var n=i[t],a=r[t];P1(n)&&P1(a)&&XO(n,a,e)}}function Na(i,r,e){var t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(he(e))throw new TypeError("Arrays are not supported by deepExtend");for(var n=0;n3&&arguments[3]!==void 0?arguments[3]:!1;if(he(e))throw new TypeError("Arrays are not supported by deepExtend");for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&!oi(i).call(i,n))if(e[n]&&e[n].constructor===Object)r[n]===void 0&&(r[n]={}),r[n].constructor===Object?pe(r[n],e[n]):Zi(r,e,n,t);else if(he(e[n])){r[n]=[];for(var a=0;a2&&arguments[2]!==void 0?arguments[2]:!1,t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)||e===!0)if(de(r[n])==="object"&&r[n]!==null&&u1(r[n])===Object.prototype)i[n]===void 0?i[n]=pe({},r[n],e):de(i[n])==="object"&&i[n]!==null&&u1(i[n])===Object.prototype?pe(i[n],r[n],e):Zi(i,r,n,t);else if(he(r[n])){var a;i[n]=rt(a=r[n]).call(a)}else Zi(i,r,n,t);return i}function Yu(i,r){var e;return Kv(e=[]).call(e,dr(i),[r])}function Wae(i){return rt(i).call(i)}function Uae(i){return i.getBoundingClientRect().left}function Kae(i){return i.getBoundingClientRect().top}function te(i,r){if(he(i))for(var e=i.length,t=0;t3&&arguments[3]!==void 0?arguments[3]:{},n=function(v){return v!=null},a=function(v){return v!==null&&de(v)==="object"},o=function(v){for(var p in v)if(Object.prototype.hasOwnProperty.call(v,p))return!1;return!0};if(!a(i))throw new Error("Parameter mergeTarget must be an object");if(!a(r))throw new Error("Parameter options must be an object");if(!n(e))throw new Error("Parameter option must have a value");if(!a(t))throw new Error("Parameter globalOptions must be an object");var s=function(v,p,g){a(v[g])||(v[g]={});var y=p[g],m=v[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(m[b]=y[b])},u=r[e],l=a(t)&&!o(t),h=l?t[e]:void 0,d=h?h.enabled:void 0;if(u!==void 0){if(typeof u=="boolean"){a(i[e])||(i[e]={}),i[e].enabled=u;return}if(u===null&&!a(i[e]))if(n(h))i[e]=Li(h);else return;if(a(u)){var c=!0;u.enabled!==void 0?c=u.enabled:d!==void 0&&(c=h.enabled),s(i,r,e),i[e].enabled=c}}}var Yae={linear:function(r){return r},easeInQuad:function(r){return r*r},easeOutQuad:function(r){return r*(2-r)},easeInOutQuad:function(r){return r<.5?2*r*r:-1+(4-2*r)*r},easeInCubic:function(r){return r*r*r},easeOutCubic:function(r){return--r*r*r+1},easeInOutCubic:function(r){return r<.5?4*r*r*r:(r-1)*(2*r-2)*(2*r-2)+1},easeInQuart:function(r){return r*r*r*r},easeOutQuart:function(r){return 1- --r*r*r*r},easeInOutQuart:function(r){return r<.5?8*r*r*r*r:1-8*--r*r*r*r},easeInQuint:function(r){return r*r*r*r*r},easeOutQuint:function(r){return 1+--r*r*r*r*r},easeInOutQuint:function(r){return r<.5?16*r*r*r*r*r:1+16*--r*r*r*r*r}};function Xr(i,r){var e;he(r)||(r=[r]);var t=YO(i),n;try{for(t.s();!(n=t.n()).done;){var a=n.value;if(a){e=a[r[0]];for(var o=1;o0&&arguments[0]!==void 0?arguments[0]:1;R(this,i),this.pixelRatio=r,this.generated=!1,this.centerCoordinates={x:289/2,y:289/2},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=function(){},this.closeCallback=function(){},this._create()}return N(i,[{key:"insertTo",value:function(e){this.hammer!==void 0&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:"setUpdateCallback",value:function(e){if(typeof e=="function")this.updateCallback=e;else throw new Error("Function attempted to set as colorPicker update callback is not a function.")}},{key:"setCloseCallback",value:function(e){if(typeof e=="function")this.closeCallback=e;else throw new Error("Function attempted to set as colorPicker closing callback is not a function.")}},{key:"_isColorString",value:function(e){if(typeof e=="string")return Xae[e]}},{key:"setColor",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e!=="none"){var n,a=this._isColorString(e);if(a!==void 0&&(e=a),Un(e)===!0){if(QO(e)===!0){var o=e.substr(4).substr(0,e.length-5).split(",");n={r:o[0],g:o[1],b:o[2],a:1}}else if(qae(e)===!0){var s=e.substr(5).substr(0,e.length-6).split(",");n={r:s[0],g:s[1],b:s[2],a:s[3]}}else if(ZO(e)===!0){var u=rp(e);n={r:u.r,g:u.g,b:u.b,a:1}}}else if(e instanceof Object&&e.r!==void 0&&e.g!==void 0&&e.b!==void 0){var l=e.a!==void 0?e.a:"1.0";n={r:e.r,g:e.g,b:e.b,a:l}}if(n===void 0)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+us(e));this._setColor(n,t)}}},{key:"show",value:function(){this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}},{key:"_hide",value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;t===!0&&(this.previousColor=Fe({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",yr(function(){e.closeCallback!==void 0&&(e.closeCallback(),e.closeCallback=void 0)},0)}},{key:"_save",value:function(){this.updateCallback(this.color),this.applied=!1,this._hide()}},{key:"_apply",value:function(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}},{key:"_loadLast",value:function(){this.previousColor!==void 0?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}},{key:"_setColor",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;t===!0&&(this.initialColor=Fe({},e)),this.color=e;var n=Ga(e.r,e.g,e.b),a=2*Math.PI,o=this.r*n.s,s=this.centerCoordinates.x+o*Math.sin(a*n.h),u=this.centerCoordinates.y+o*Math.cos(a*n.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=u-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}},{key:"_setOpacity",value:function(e){this.color.a=e/100,this._updatePicker(this.color)}},{key:"_setBrightness",value:function(e){var t=Ga(this.color.r,this.color.g,this.color.b);t.v=e/100;var n=mu(t.h,t.s,t.v);n.a=this.color.a,this.color=n,this._updatePicker()}},{key:"_updatePicker",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.color,t=Ga(e.r,e.g,e.b),n=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(n.webkitBackingStorePixelRatio||n.mozBackingStorePixelRatio||n.msBackingStorePixelRatio||n.oBackingStorePixelRatio||n.backingStorePixelRatio||1)),n.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var a=this.colorPickerCanvas.clientWidth,o=this.colorPickerCanvas.clientHeight;n.clearRect(0,0,a,o),n.putImageData(this.hueCircle,0,0),n.fillStyle="rgba(0,0,0,"+(1-t.v)+")",n.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),ls(n).call(n),this.brightnessRange.value=100*t.v,this.opacityRange.value=100*e.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}},{key:"_setSize",value:function(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}},{key:"_create",value:function(){var e,t,n,a;if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){var s=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(s.webkitBackingStorePixelRatio||s.mozBackingStorePixelRatio||s.msBackingStorePixelRatio||s.oBackingStorePixelRatio||s.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{var o=document.createElement("DIV");o.style.color="red",o.style.fontWeight="bold",o.style.padding="10px",o.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(o)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch{}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch{}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var u=this;this.opacityRange.onchange=function(){u._setOpacity(this.value)},this.opacityRange.oninput=function(){u._setOpacity(this.value)},this.brightnessRange.onchange=function(){u._setBrightness(this.value)},this.brightnessRange.oninput=function(){u._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerText="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerText="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerText="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerText="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerText="cancel",this.cancelButton.onclick=k(e=this._hide).call(e,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=k(t=this._apply).call(t,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=k(n=this._save).call(n,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=k(a=this._loadLast).call(a,this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}},{key:"_bindHammer",value:function(){var e=this;this.drag={},this.pinch={},this.hammer=new tp(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",function(t){t.isFirst&&e._moveSelector(t)}),this.hammer.on("tap",function(t){e._moveSelector(t)}),this.hammer.on("panstart",function(t){e._moveSelector(t)}),this.hammer.on("panmove",function(t){e._moveSelector(t)}),this.hammer.on("panend",function(t){e._moveSelector(t)})}},{key:"_generateHueCircle",value:function(){if(this.generated===!1){var e=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var t=this.colorPickerCanvas.clientWidth,n=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,t,n);var a,o,s,u;this.centerCoordinates={x:t*.5,y:n*.5},this.r=.49*t;var l=2*Math.PI/360,h=1/360,d=1/this.r,c;for(s=0;s<360;s++)for(u=0;u3&&arguments[3]!==void 0?arguments[3]:1,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:function(){return!1};R(this,i),this.parent=r,this.changedOptions=[],this.container=e,this.allowCreation=!1,this.hideOption=a,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},Fe(this.options,this.defaultOptions),this.configureOptions=t,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new Jae(n),this.wrapper=void 0}return N(i,[{key:"setOptions",value:function(e){if(e!==void 0){this.popupHistory={},this._removePopup();var t=!0;if(typeof e=="string")this.options.filter=e;else if(he(e))this.options.filter=e.join();else if(de(e)==="object"){if(e==null)throw new TypeError("options cannot be null");e.container!==void 0&&(this.options.container=e.container),Ot(e)!==void 0&&(this.options.filter=Ot(e)),e.showButton!==void 0&&(this.options.showButton=e.showButton),e.enabled!==void 0&&(t=e.enabled)}else typeof e=="boolean"?(this.options.filter=!0,t=e):typeof e=="function"&&(this.options.filter=e,t=!0);Ot(this.options)===!1&&(t=!1),this.options.enabled=t}this._clean()}},{key:"setModuleOptions",value:function(e){this.moduleOptions=e,this.options.enabled===!0&&(this._clean(),this.options.container!==void 0&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){this._clean(),this.changedOptions=[];var e=Ot(this.options),t=0,n=!1;for(var a in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,a)&&(this.allowCreation=!1,n=!1,typeof e=="function"?(n=e(a,[]),n=n||this._handleObject(this.configureOptions[a],[a],!0)):(e===!0||ie(e).call(e,a)!==-1)&&(n=!0),n!==!1&&(this.allowCreation=!0,t>0&&this._makeItem([]),this._makeHeader(a),this._handleObject(this.configureOptions[a],[a])),t++);this._makeButton(),this._push()}},{key:"_push",value:function(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var e=0;e1?n-1:0),o=1;o2&&arguments[2]!==void 0?arguments[2]:!1,a=document.createElement("div");if(a.className="vis-configuration vis-config-label vis-config-s"+t.length,n===!0){for(;a.firstChild;)a.removeChild(a.firstChild);a.appendChild(kf("i","b",e))}else a.innerText=e+":";return a}},{key:"_makeDropdown",value:function(e,t,n){var a=document.createElement("select");a.className="vis-configuration vis-config-select";var o=0;t!==void 0&&ie(e).call(e,t)!==-1&&(o=ie(e).call(e,t));for(var s=0;ss&&s!==1&&(l.max=Math.ceil(t*c),d=l.max,h="range increased"),l.value=t}else l.value=a;var f=document.createElement("input");f.className="vis-configuration vis-config-rangeinput",f.value=l.value;var v=this;l.onchange=function(){f.value=this.value,v._update(Number(this.value),n)},l.oninput=function(){f.value=this.value};var p=this._makeLabel(n[n.length-1],n),g=this._makeItem(n,p,l,f);h!==""&&this.popupHistory[g]!==d&&(this.popupHistory[g]=d,this._setupPopup(h,g))}},{key:"_makeButton",value:function(){var e=this;if(this.options.showButton===!0){var t=document.createElement("div");t.className="vis-configuration vis-config-button",t.innerText="generate options",t.onclick=function(){e._printOptions()},t.onmouseover=function(){t.className="vis-configuration vis-config-button hover"},t.onmouseout=function(){t.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(t)}}},{key:"_setupPopup",value:function(e,t){var n=this;if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=!1,o=Ot(this.options),s=!1;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){a=!0;var l=e[u],h=Yu(t,u);if(typeof o=="function"&&(a=o(u,t),a===!1&&!he(l)&&typeof l!="string"&&typeof l!="boolean"&&l instanceof Object&&(this.allowCreation=!1,a=this._handleObject(l,h,!0),this.allowCreation=n===!1)),a!==!1){s=!0;var d=this._getValue(h);if(he(l))this._handleArray(l,d,h);else if(typeof l=="string")this._makeTextInput(l,d,h);else if(typeof l=="boolean")this._makeCheckbox(l,d,h);else if(l instanceof Object){if(!this.hideOption(t,u,this.moduleOptions))if(l.enabled!==void 0){var c=Yu(h,"enabled"),f=this._getValue(c);if(f===!0){var v=this._makeLabel(u,h,!0);this._makeItem(h,v),s=this._handleObject(l,h)||s}else this._makeCheckbox(l,f,h)}else{var p=this._makeLabel(u,h,!0);this._makeItem(h,p),s=this._handleObject(l,h)||s}}else console.error("dont know how to handle",l,u,h)}}return s}},{key:"_handleArray",value:function(e,t,n){typeof e[0]=="string"&&e[0]==="color"?(this._makeColorField(e,t,n),e[1]!==t&&this.changedOptions.push({path:n,value:t})):typeof e[0]=="string"?(this._makeDropdown(e,t,n),e[0]!==t&&this.changedOptions.push({path:n,value:t})):typeof e[0]=="number"&&(this._makeRange(e,t,n),e[0]!==t&&this.changedOptions.push({path:n,value:Number(t)}))}},{key:"_update",value:function(e,t){var n=this._constructOptions(e,t);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",n),this.initialized=!0,this.parent.setOptions(n)}},{key:"_constructOptions",value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=n;e=e==="true"?!0:e,e=e==="false"?!1:e;for(var o=0;oo-this.padding&&(l=!0),l?s=this.x-n:s=this.x,h?u=this.y-t:u=this.y}else u=this.y-t,u+t+this.padding>a&&(u=a-t-this.padding),uo&&(s=o-n-this.padding),so.distance?l=" in "+i.printLocation(a.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+i.printLocation(o.path,o.closestMatch,""):a.distance<=s?l='. Did you mean "'+a.closestMatch+'"?'+i.printLocation(a.path,e):l=". Did you mean one of these: "+i.print(Ee(t))+i.printLocation(n,e),console.error('%cUnknown option detected: "'+e+'"'+l,Pf),La=!0}},{key:"findInOptions",value:function(e,t,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=1e9,s="",u=[],l=e.toLowerCase(),h=void 0;for(var d in t){var c=void 0;if(t[d].__type__!==void 0&&a===!0){var f=i.findInOptions(e,t[d],Yu(n,d));o>f.distance&&(s=f.closestMatch,u=f.path,o=f.distance,h=f.indexMatch)}else{var v;ie(v=d.toLowerCase()).call(v,l)!==-1&&(h=d),c=i.levenshteinDistance(e,d),o>c&&(s=d,u=Vae(n),o=c)}}return{closestMatch:s,path:u,distance:o,indexMatch:h}}},{key:"printLocation",value:function(e,t){for(var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`Problem value found at: +`:o.distance<=u&&a.distance>o.distance?l=" in "+i.printLocation(a.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+i.printLocation(o.path,o.closestMatch,""):a.distance<=s?l='. Did you mean "'+a.closestMatch+'"?'+i.printLocation(a.path,e):l=". Did you mean one of these: "+i.print(Ee(t))+i.printLocation(n,e),console.error('%cUnknown option detected: "'+e+'"'+l,Pf),La=!0}},{key:"findInOptions",value:function(e,t,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=1e9,s="",u=[],l=e.toLowerCase(),h=void 0;for(var d in t){var c=void 0;if(t[d].__type__!==void 0&&a===!0){var f=i.findInOptions(e,t[d],Yu(n,d));o>f.distance&&(s=f.closestMatch,u=f.path,o=f.distance,h=f.indexMatch)}else{var v;ie(v=d.toLowerCase()).call(v,l)!==-1&&(h=d),c=i.levenshteinDistance(e,d),o>c&&(s=d,u=Wae(n),o=c)}}return{closestMatch:s,path:u,distance:o,indexMatch:h}}},{key:"printLocation",value:function(e,t){for(var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`Problem value found at: `,a=` `+n+`options = { @@ -127,22 +127,22 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `;for(var l=0;l":!0,"--":!0},Qr="",sa=0,ee="",G="",wt=dt.NULL;function ooe(){sa=0,ee=Qr.charAt(0)}function He(){sa++,ee=Qr.charAt(sa)}function In(){return Qr.charAt(sa+1)}function A1(i){var r=i.charCodeAt(0);return r<47?r===35||r===46:r<59?r>47:r<91?r>64:r<96?r===95:r<123?r>96:!1}function hi(i,r){if(i||(i={}),r)for(var e in r)r.hasOwnProperty(e)&&(i[e]=r[e]);return i}function soe(i,r,e){for(var t=r.split("."),n=i;t.length;){var a=t.shift();t.length?(n[a]||(n[a]={}),n=n[a]):n[a]=e}}function rT(i,r){for(var e,t,n=null,a=[i],o=i;o.parent;)a.push(o.parent),o=o.parent;if(o.nodes){for(e=0,t=o.nodes.length;e=0;e--){var s,u=a[e];u.nodes||(u.nodes=[]),ie(s=u.nodes).call(s,n)===-1&&u.nodes.push(n)}r.attr&&(n.attr=hi(n.attr,r.attr))}function uoe(i,r){if(i.edges||(i.edges=[]),i.edges.push(r),i.edge){var e=hi({},i.edge);r.attr=hi(e,r.attr)}}function iT(i,r,e,t,n){var a={from:r,to:e,type:t};return i.edge&&(a.attr=hi({},i.edge)),a.attr=hi(a.attr||{},n),n!=null&&n.hasOwnProperty("arrows")&&n.arrows!=null&&(a.arrows={to:{enabled:!0,type:n.arrows.type}},n.arrows=null),a}function pe(){for(wt=dt.NULL,G="";ee===" "||ee===" "||ee===` +`}},{key:"print",value:function(e){return us(e).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}},{key:"levenshteinDistance",value:function(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;var n=[],a;for(a=0;a<=t.length;a++)n[a]=[a];var o;for(o=0;o<=e.length;o++)n[0][o]=o;for(a=1;a<=t.length;a++)for(o=1;o<=e.length;o++)t.charAt(a-1)==e.charAt(o-1)?n[a][o]=n[a-1][o-1]:n[a][o]=Math.min(n[a-1][o-1]+1,Math.min(n[a][o-1]+1,n[a-1][o]+1));return n[t.length][e.length]}}]),i}(),toe=pr,roe=Zae,Kn=tp,ioe=Qae,eT=Pf,noe=eoe;function aoe(i){return Qr=i,loe()}var tT={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},ip=Li(tT);ip.color="color.color";ip.style="dashes";var dt={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},C1={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},Qr="",sa=0,ee="",G="",wt=dt.NULL;function ooe(){sa=0,ee=Qr.charAt(0)}function He(){sa++,ee=Qr.charAt(sa)}function In(){return Qr.charAt(sa+1)}function A1(i){var r=i.charCodeAt(0);return r<47?r===35||r===46:r<59?r>47:r<91?r>64:r<96?r===95:r<123?r>96:!1}function hi(i,r){if(i||(i={}),r)for(var e in r)r.hasOwnProperty(e)&&(i[e]=r[e]);return i}function soe(i,r,e){for(var t=r.split("."),n=i;t.length;){var a=t.shift();t.length?(n[a]||(n[a]={}),n=n[a]):n[a]=e}}function rT(i,r){for(var e,t,n=null,a=[i],o=i;o.parent;)a.push(o.parent),o=o.parent;if(o.nodes){for(e=0,t=o.nodes.length;e=0;e--){var s,u=a[e];u.nodes||(u.nodes=[]),ie(s=u.nodes).call(s,n)===-1&&u.nodes.push(n)}r.attr&&(n.attr=hi(n.attr,r.attr))}function uoe(i,r){if(i.edges||(i.edges=[]),i.edges.push(r),i.edge){var e=hi({},i.edge);r.attr=hi(e,r.attr)}}function iT(i,r,e,t,n){var a={from:r,to:e,type:t};return i.edge&&(a.attr=hi({},i.edge)),a.attr=hi(a.attr||{},n),n!=null&&n.hasOwnProperty("arrows")&&n.arrows!=null&&(a.arrows={to:{enabled:!0,type:n.arrows.type}},n.arrows=null),a}function ge(){for(wt=dt.NULL,G="";ee===" "||ee===" "||ee===` `||ee==="\r";)He();do{var i=!1;if(ee==="#"){for(var r=sa-1;Qr.charAt(r)===" "||Qr.charAt(r)===" ";)r--;if(Qr.charAt(r)===` `||Qr.charAt(r)===""){for(;ee!=""&&ee!=` `;)He();i=!0}}if(ee==="/"&&In()==="/"){for(;ee!=""&&ee!=` `;)He();i=!0}if(ee==="/"&&In()==="*"){for(;ee!="";)if(ee==="*"&&In()==="/"){He(),He();break}else He();i=!0}for(;ee===" "||ee===" "||ee===` `||ee==="\r";)He()}while(i);if(ee===""){wt=dt.DELIMITER;return}var e=ee+In();if(C1[e]){wt=dt.DELIMITER,G=e,He(),He();return}if(C1[ee]){wt=dt.DELIMITER,G=ee,He();return}if(A1(ee)||ee==="-"){for(G+=ee,He();A1(ee);)G+=ee,He();G==="false"?G=!1:G==="true"?G=!0:isNaN(Number(G))||(G=Number(G)),wt=dt.IDENTIFIER;return}if(ee==='"'){for(He();ee!=""&&(ee!='"'||ee==='"'&&In()==='"');)ee==='"'?(G+=ee,He()):ee==="\\"&&In()==="n"?(G+=` -`,He()):G+=ee,He();if(ee!='"')throw ft('End of string " expected');He(),wt=dt.IDENTIFIER;return}for(wt=dt.UNKNOWN;ee!="";)G+=ee,He();throw new SyntaxError('Syntax error in part "'+sT(G,30)+'"')}function loe(){var i={};if(ooe(),pe(),G==="strict"&&(i.strict=!0,pe()),(G==="graph"||G==="digraph")&&(i.type=G,pe()),wt===dt.IDENTIFIER&&(i.id=G,pe()),G!="{")throw ft("Angle bracket { expected");if(pe(),nT(i),G!="}")throw ft("Angle bracket } expected");if(pe(),G!=="")throw ft("End of file expected");return pe(),delete i.node,delete i.edge,delete i.graph,i}function nT(i){for(;G!==""&&G!="}";)hoe(i),G===";"&&pe()}function hoe(i){var r=aT(i);if(r){oT(i,r);return}var e=coe(i);if(!e){if(wt!=dt.IDENTIFIER)throw ft("Identifier expected");var t=G;if(pe(),G==="="){if(pe(),wt!=dt.IDENTIFIER)throw ft("Identifier expected");i[t]=G,pe()}else doe(i,t)}}function aT(i){var r=null;if(G==="subgraph"&&(r={},r.type="subgraph",pe(),wt===dt.IDENTIFIER&&(r.id=G,pe())),G==="{"){if(pe(),r||(r={}),r.parent=i,r.node=i.node,r.edge=i.edge,r.graph=i.graph,nT(r),G!="}")throw ft("Angle bracket } expected");pe(),delete r.node,delete r.edge,delete r.graph,delete r.parent,i.subgraphs||(i.subgraphs=[]),i.subgraphs.push(r)}return r}function coe(i){return G==="node"?(pe(),i.node=ro(),"node"):G==="edge"?(pe(),i.edge=ro(),"edge"):G==="graph"?(pe(),i.graph=ro(),"graph"):null}function doe(i,r){var e={id:r},t=ro();t&&(e.attr=t),rT(i,e),oT(i,r)}function oT(i,r){for(;G==="->"||G==="--";){var e,t=G;pe();var n=aT(i);if(n)e=n;else{if(wt!=dt.IDENTIFIER)throw ft("Identifier or subgraph expected");e=G,rT(i,{id:e}),pe()}var a=ro(),o=iT(i,r,e,t,a);uoe(i,o),r=e}}function ro(){for(var i,r=null,e={dashed:!0,solid:!1,dotted:[1,5]},t={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},n=new Array,a=new Array;G==="[";){for(pe(),r={};G!==""&&G!="]";){if(wt!=dt.IDENTIFIER)throw ft("Attribute name expected");var o=G;if(pe(),G!="=")throw ft("Equal sign = expected");if(pe(),wt!=dt.IDENTIFIER)throw ft("Attribute value expected");var s=G;o==="style"&&(s=e[s]);var u;o==="arrowhead"&&(u=t[s],o="arrows",s={to:{enabled:!0,type:u}}),o==="arrowtail"&&(u=t[s],o="arrows",s={from:{enabled:!0,type:u}}),n.push({attr:r,name:o,value:s}),a.push(o),pe(),G==","&&pe()}if(G!="]")throw ft("Bracket ] expected");pe()}if(oi(a).call(a,"dir")){var l={};for(l.arrows={},i=0;i"&&(u.arrows="to"),u};de(n=r.edges).call(n,function(o){var s,u;if(o.from instanceof Object?s=o.from.nodes:s={id:o.from},o.to instanceof Object?u=o.to.nodes:u={id:o.to},o.from instanceof Object&&o.from.edges){var l;de(l=o.from.edges).call(l,function(d){var c=a(d);e.edges.push(c)})}if(foe(s,u,function(d,c){var f=iT(e,d.id,c.id,o.type,o.attr),v=a(f);e.edges.push(v)}),o.to instanceof Object&&o.to.edges){var h;de(h=o.to.edges).call(h,function(d){var c=a(d);e.edges.push(c)})}})}return r.attr&&(e.options=r.attr),e}function poe(i,r){var e,t={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};r!=null&&(r.fixed!=null&&(t.nodes.fixed=r.fixed),r.parseColor!=null&&(t.nodes.parseColor=r.parseColor),r.inheritColor!=null&&(t.edges.inheritColor=r.inheritColor));var n=i.edges,a=ia(n).call(n,function(s){var u={from:s.source,id:s.id,to:s.target};return s.attributes!=null&&(u.attributes=s.attributes),s.label!=null&&(u.label=s.label),s.attributes!=null&&s.attributes.title!=null&&(u.title=s.attributes.title),s.type==="Directed"&&(u.arrows="to"),s.color&&t.edges.inheritColor===!1&&(u.color=s.color),u}),o=ia(e=i.nodes).call(e,function(s){var u={id:s.id,fixed:t.nodes.fixed&&s.x!=null&&s.y!=null};return s.attributes!=null&&(u.attributes=s.attributes),s.label!=null&&(u.label=s.label),s.size!=null&&(u.size=s.size),s.attributes!=null&&s.attributes.title!=null&&(u.title=s.attributes.title),s.title!=null&&(u.title=s.title),s.x!=null&&(u.x=s.x),s.y!=null&&(u.y=s.y),s.color!=null&&(t.nodes.parseColor===!0?u.color=s.color:u.color={background:s.color,border:s.color,highlight:{background:s.color,border:s.color},hover:{background:s.color,border:s.color}}),u});return{nodes:o,edges:a}}var goe={addDescription:"Click in an empty space to place a new node.",addEdge:"Add Edge",addNode:"Add Node",back:"Back",close:"Close",createEdgeError:"Cannot link edges to a cluster.",del:"Delete selected",deleteClusterError:"Clusters cannot be deleted.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",edit:"Edit",editClusterError:"Clusters cannot be edited.",editEdge:"Edit Edge",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",editNode:"Edit Node"},yoe={addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",addEdge:"Kante hinzufügen",addNode:"Knoten hinzufügen",back:"Zurück",close:"Schließen",createEdgeError:"Es ist nicht möglich, Kanten mit Clustern zu verbinden.",del:"Lösche Auswahl",deleteClusterError:"Cluster können nicht gelöscht werden.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",edit:"Editieren",editClusterError:"Cluster können nicht editiert werden.",editEdge:"Kante editieren",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",editNode:"Knoten editieren"},moe={addDescription:"Haga clic en un lugar vacío para colocar un nuevo nodo.",addEdge:"Añadir arista",addNode:"Añadir nodo",back:"Atrás",close:"Cerrar",createEdgeError:"No se puede conectar una arista a un grupo.",del:"Eliminar selección",deleteClusterError:"No es posible eliminar grupos.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",edit:"Editar",editClusterError:"No es posible editar grupos.",editEdge:"Editar arista",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",editNode:"Editar nodo"},boe={addDescription:"Clicca per aggiungere un nuovo nodo",addEdge:"Aggiungi un vertice",addNode:"Aggiungi un nodo",back:"Indietro",close:"Chiudere",createEdgeError:"Non si possono collegare vertici ad un cluster",del:"Cancella la selezione",deleteClusterError:"I cluster non possono essere cancellati",edgeDescription:"Clicca su un nodo e trascinalo ad un altro nodo per connetterli.",edit:"Modifica",editClusterError:"I clusters non possono essere modificati.",editEdge:"Modifica il vertice",editEdgeDescription:"Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.",editNode:"Modifica il nodo"},$oe={addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",addEdge:"Link toevoegen",addNode:"Node toevoegen",back:"Terug",close:"Sluiten",createEdgeError:"Kan geen link maken naar een cluster.",del:"Selectie verwijderen",deleteClusterError:"Clusters kunnen niet worden verwijderd.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",edit:"Wijzigen",editClusterError:"Clusters kunnen niet worden aangepast.",editEdge:"Link wijzigen",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",editNode:"Node wijzigen"},woe={addDescription:"Clique em um espaço em branco para adicionar um novo nó",addEdge:"Adicionar aresta",addNode:"Adicionar nó",back:"Voltar",close:"Fechar",createEdgeError:"Não foi possível linkar arestas a um cluster.",del:"Remover selecionado",deleteClusterError:"Clusters não puderam ser removidos.",edgeDescription:"Clique em um nó e arraste a aresta até outro nó para conectá-los",edit:"Editar",editClusterError:"Clusters não puderam ser editados.",editEdge:"Editar aresta",editEdgeDescription:"Clique nos pontos de controle e os arraste para um nó para conectá-los",editNode:"Editar nó"},_oe={addDescription:"Кликните в свободное место, чтобы добавить новый узел.",addEdge:"Добавить ребро",addNode:"Добавить узел",back:"Назад",close:"Закрывать",createEdgeError:"Невозможно соединить ребра в кластер.",del:"Удалить выбранное",deleteClusterError:"Кластеры не могут быть удалены",edgeDescription:"Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.",edit:"Редактировать",editClusterError:"Кластеры недоступны для редактирования.",editEdge:"Редактировать ребро",editEdgeDescription:"Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.",editNode:"Редактировать узел"},Eoe={addDescription:"单击空白处放置新节点。",addEdge:"添加连接线",addNode:"添加节点",back:"返回",close:"關閉",createEdgeError:"无法将连接线连接到群集。",del:"删除选定",deleteClusterError:"无法删除群集。",edgeDescription:"单击某个节点并将该连接线拖动到另一个节点以连接它们。",edit:"编辑",editClusterError:"无法编辑群集。",editEdge:"编辑连接线",editEdgeDescription:"单击控制节点并将它们拖到节点上连接。",editNode:"编辑节点"},Soe={addDescription:"Kлікніть на вільне місце, щоб додати новий вузол.",addEdge:"Додати край",addNode:"Додати вузол",back:"Назад",close:"Закрити",createEdgeError:"Не можливо об'єднати краї в групу.",del:"Видалити обране",deleteClusterError:"Групи не можуть бути видалені.",edgeDescription:"Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.",edit:"Редагувати",editClusterError:"Групи недоступні для редагування.",editEdge:"Редагувати край",editEdgeDescription:"Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.",editNode:"Редагувати вузол"},Ooe={addDescription:"Cliquez dans un endroit vide pour placer un nœud.",addEdge:"Ajouter un lien",addNode:"Ajouter un nœud",back:"Retour",close:"Fermer",createEdgeError:"Impossible de créer un lien vers un cluster.",del:"Effacer la sélection",deleteClusterError:"Les clusters ne peuvent pas être effacés.",edgeDescription:"Cliquez sur un nœud et glissez le lien vers un autre nœud pour les connecter.",edit:"Éditer",editClusterError:"Les clusters ne peuvent pas être édités.",editEdge:"Éditer le lien",editEdgeDescription:"Cliquez sur les points de contrôle et glissez-les pour connecter un nœud.",editNode:"Éditer le nœud"},Toe={addDescription:"Kluknutím do prázdného prostoru můžete přidat nový vrchol.",addEdge:"Přidat hranu",addNode:"Přidat vrchol",back:"Zpět",close:"Zavřít",createEdgeError:"Nelze připojit hranu ke shluku.",del:"Smazat výběr",deleteClusterError:"Nelze mazat shluky.",edgeDescription:"Přetažením z jednoho vrcholu do druhého můžete spojit tyto vrcholy novou hranou.",edit:"Upravit",editClusterError:"Nelze upravovat shluky.",editEdge:"Upravit hranu",editEdgeDescription:"Přetažením kontrolního vrcholu hrany ji můžete připojit k jinému vrcholu.",editNode:"Upravit vrchol"},Ioe=Object.freeze({__proto__:null,cn:Eoe,cs:Toe,de:yoe,en:goe,es:moe,fr:Ooe,it:boe,nl:$oe,pt:woe,ru:_oe,uk:Soe});function koe(i,r){try{var e=r.split(/[-_ /]/,2),t=Se(e,2),n=t[0],a=t[1],o=n!=null?n.toLowerCase():null,s=a!=null?a.toUpperCase():null;if(o&&s){var u=o+"-"+s;if(Object.prototype.hasOwnProperty.call(i,u))return u;var l;console.warn(Kv(l="Unknown variant ".concat(s," of language ")).call(l,o,"."))}if(o){var h=o;if(Object.prototype.hasOwnProperty.call(i,h))return h;console.warn("Unknown language ".concat(o))}return console.warn("Unknown locale ".concat(r,", falling back to English.")),"en"}catch(d){return console.error(d),console.warn("Unexpected error while normalizing locale ".concat(r,", falling back to English.")),"en"}}var Poe=function(){function i(){N(this,i),this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}return M(i,[{key:"init",value:function(){if(!this.initialized()){this.src=this.image.src;var e=this.image.width,t=this.image.height;this.width=e,this.height=t;var n=Math.floor(t/2),a=Math.floor(t/4),o=Math.floor(t/8),s=Math.floor(t/16),u=Math.floor(e/2),l=Math.floor(e/4),h=Math.floor(e/8),d=Math.floor(e/16);this.canvas.width=3*l,this.canvas.height=n,this.coordinates=[[0,0,u,n],[u,0,l,a],[u,a,h,o],[5*h,a,d,s]],this._fillMipMap()}}},{key:"initialized",value:function(){return this.coordinates!==void 0}},{key:"_fillMipMap",value:function(){var e=this.canvas.getContext("2d"),t=this.coordinates[0];e.drawImage(this.image,t[0],t[1],t[2],t[3]);for(var n=1;n2){t*=.5;for(var u=0;t>2&&u=this.NUM_ITERATIONS&&(u=this.NUM_ITERATIONS-1);var l=this.coordinates[u];e.drawImage(this.canvas,l[0],l[1],l[2],l[3],n,a,o,s)}else e.drawImage(this.image,n,a,o,s)}}]),i}(),xoe=function(){function i(r){N(this,i),this.images={},this.imageBroken={},this.callback=r}return M(i,[{key:"_tryloadBrokenUrl",value:function(e,t,n){if(!(e===void 0||n===void 0)){if(t===void 0){console.warn("No broken url image defined");return}n.image.onerror=function(){console.error("Could not load brokenImage:",t)},n.image.src=t}}},{key:"_redrawWithImage",value:function(e){this.callback&&this.callback(e)}},{key:"load",value:function(e,t){var n=this,a=this.images[e];if(a)return a;var o=new Poe;return this.images[e]=o,o.image.onload=function(){n._fixImageCoordinates(o.image),o.init(),n._redrawWithImage(o)},o.image.onerror=function(){console.error("Could not load image:",e),n._tryloadBrokenUrl(e,t,o)},o.image.src=e,o}},{key:"_fixImageCoordinates",value:function(e){e.width===0&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}}]),i}(),uT={exports:{}},Coe=ne,Aoe=Coe(function(){if(typeof ArrayBuffer=="function"){var i=new ArrayBuffer(8);Object.isExtensible(i)&&Object.defineProperty(i,"a",{value:8})}}),Doe=ne,Roe=Xe,Noe=zr,R1=Aoe,bu=Object.isExtensible,Moe=Doe(function(){bu(1)}),Boe=Moe||R1?function(r){return!Roe(r)||R1&&Noe(r)==="ArrayBuffer"?!1:bu?bu(r):!0}:bu,Foe=ne,lT=!Foe(function(){return Object.isExtensible(Object.preventExtensions({}))}),joe=q,Loe=oe,zoe=es,Hoe=Xe,np=Je,Woe=Ht.f,N1=ns,Voe=Wl,ap=Boe,Uoe=Al,Koe=lT,hT=!1,Fr=Uoe("meta"),Goe=0,op=function(i){Woe(i,Fr,{value:{objectID:"O"+Goe++,weakData:{}}})},qoe=function(i,r){if(!Hoe(i))return typeof i=="symbol"?i:(typeof i=="string"?"S":"P")+i;if(!np(i,Fr)){if(!ap(i))return"F";if(!r)return"E";op(i)}return i[Fr].objectID},Yoe=function(i,r){if(!np(i,Fr)){if(!ap(i))return!0;if(!r)return!1;op(i)}return i[Fr].weakData},Xoe=function(i){return Koe&&hT&&ap(i)&&!np(i,Fr)&&op(i),i},Joe=function(){Zoe.enable=function(){},hT=!0;var i=N1.f,r=Loe([].splice),e={};e[Fr]=1,i(e).length&&(N1.f=function(t){for(var n=i(t),a=0,o=n.length;ad;d++)if(f=y(i[d]),f&&M1(F1,f))return f;return new $u(!1)}l=ase(i,h)}for(v=a?i.next:l.next;!(p=ese(v,l)).done;){try{f=y(p.value)}catch(m){B1(l,"throw",m)}if(typeof f=="object"&&f&&M1(F1,f))return f}return new $u(!1)},use=Re,lse=TypeError,up=function(i,r){if(use(r,i))return i;throw new lse("Incorrect invocation")},hse=q,cse=Ie,dse=Ql,fse=ne,vse=ka,pse=sp,gse=up,yse=qe,mse=Xe,bse=Sa,$se=xa,wse=Ht.f,_se=yi.forEach,Ese=Ye,cT=on,Sse=cT.set,Ose=cT.getterFor,lp=function(i,r,e){var t=i.indexOf("Map")!==-1,n=i.indexOf("Weak")!==-1,a=t?"set":"add",o=cse[i],s=o&&o.prototype,u={},l;if(!Ese||!yse(o)||!(n||s.forEach&&!fse(function(){new o().entries().next()})))l=e.getConstructor(r,i,t,a),dse.enable();else{l=r(function(c,f){Sse(gse(c,h),{type:i,collection:new o}),bse(f)||pse(f,c[a],{that:c,AS_ENTRIES:t})});var h=l.prototype,d=Ose(i);_se(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(c){var f=c==="add"||c==="set";c in s&&!(n&&c==="clear")&&vse(h,c,function(v,p){var g=d(this).collection;if(!f&&n&&!mse(v))return c==="get"?void 0:!1;var y=g[c](v===0?0:v,p);return f?this:y})}),n||wse(h,"size",{configurable:!0,get:function(){return d(this).collection.size}})}return $se(l,i,!1,!0),u[i]=l,hse({global:!0,forced:!0},u),n||e.setStrong(l,i,t),l},Tse=rs,hp=function(i,r,e){for(var t in r)e&&e.unsafe&&i[t]?i[t]=r[t]:Tse(i,t,r[t],e);return i},Ise=Jt,kse=Lv,Pse=ke,xse=Ye,j1=Pse("species"),Cse=function(i){var r=Ise(i);xse&&r&&!r[j1]&&kse(r,j1,{configurable:!0,get:function(){return this}})},Ase=Pa,Dse=Lv,L1=hp,Rse=Zo,Nse=up,Mse=Sa,Bse=sp,Fse=Nv,Qs=Mv,jse=Cse,za=Ye,z1=Ql.fastKey,dT=on,H1=dT.set,ud=dT.getterFor,fT={getConstructor:function(i,r,e,t){var n=i(function(l,h){Nse(l,a),H1(l,{type:r,index:Ase(null),first:void 0,last:void 0,size:0}),za||(l.size=0),Mse(h)||Bse(h,l[t],{that:l,AS_ENTRIES:e})}),a=n.prototype,o=ud(r),s=function(l,h,d){var c=o(l),f=u(l,h),v,p;return f?f.value=d:(c.last=f={index:p=z1(h,!0),key:h,value:d,previous:v=c.last,next:void 0,removed:!1},c.first||(c.first=f),v&&(v.next=f),za?c.size++:l.size++,p!=="F"&&(c.index[p]=f)),l},u=function(l,h){var d=o(l),c=z1(h),f;if(c!=="F")return d.index[c];for(f=d.first;f;f=f.next)if(f.key===h)return f};return L1(a,{clear:function(){for(var h=this,d=o(h),c=d.index,f=d.first;f;)f.removed=!0,f.previous&&(f.previous=f.previous.next=void 0),delete c[f.index],f=f.next;d.first=d.last=void 0,za?d.size=0:h.size=0},delete:function(l){var h=this,d=o(h),c=u(h,l);if(c){var f=c.next,v=c.previous;delete d.index[c.index],c.removed=!0,v&&(v.next=f),f&&(f.previous=v),d.first===c&&(d.first=f),d.last===c&&(d.last=v),za?d.size--:h.size--}return!!c},forEach:function(h){for(var d=o(this),c=Rse(h,arguments.length>1?arguments[1]:void 0),f;f=f?f.next:d.first;)for(c(f.value,f.key,this);f&&f.removed;)f=f.previous},has:function(h){return!!u(this,h)}}),L1(a,e?{get:function(h){var d=u(this,h);return d&&d.value},set:function(h,d){return s(this,h===0?0:h,d)}}:{add:function(h){return s(this,h=h===0?0:h,h)}}),za&&Dse(a,"size",{configurable:!0,get:function(){return o(this).size}}),n},setStrong:function(i,r,e){var t=r+" Iterator",n=ud(r),a=ud(t);Fse(i,r,function(o,s){H1(this,{type:t,target:o,state:n(o),kind:s,last:void 0})},function(){for(var o=a(this),s=o.kind,u=o.last;u&&u.removed;)u=u.previous;return!o.target||!(o.last=u=u?u.next:o.state.first)?(o.target=void 0,Qs(void 0,!0)):Qs(s==="keys"?u.key:s==="values"?u.value:[u.key,u.value],!1)},e?"entries":"values",!e,!0),jse(r)}},Lse=lp,zse=fT;Lse("Map",function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},zse);var Hse=ae,Wse=Hse.Map,Vse=Wse,Use=Vse,Kse=Use,vT=W(Kse),Gse=function(){function i(){N(this,i),this.clear(),this._defaultIndex=0,this._groupIndex=0,this._defaultGroups=[{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},{border:"#FFA500",background:"#FFFF00",highlight:{border:"#FFA500",background:"#FFFFA3"},hover:{border:"#FFA500",background:"#FFFFA3"}},{border:"#FA0A10",background:"#FB7E81",highlight:{border:"#FA0A10",background:"#FFAFB1"},hover:{border:"#FA0A10",background:"#FFAFB1"}},{border:"#41A906",background:"#7BE141",highlight:{border:"#41A906",background:"#A1EC76"},hover:{border:"#41A906",background:"#A1EC76"}},{border:"#E129F0",background:"#EB7DF4",highlight:{border:"#E129F0",background:"#F0B3F5"},hover:{border:"#E129F0",background:"#F0B3F5"}},{border:"#7C29F0",background:"#AD85E4",highlight:{border:"#7C29F0",background:"#D3BDF0"},hover:{border:"#7C29F0",background:"#D3BDF0"}},{border:"#C37F00",background:"#FFA807",highlight:{border:"#C37F00",background:"#FFCA66"},hover:{border:"#C37F00",background:"#FFCA66"}},{border:"#4220FB",background:"#6E6EFD",highlight:{border:"#4220FB",background:"#9B9BFD"},hover:{border:"#4220FB",background:"#9B9BFD"}},{border:"#FD5A77",background:"#FFC0CB",highlight:{border:"#FD5A77",background:"#FFD1D9"},hover:{border:"#FD5A77",background:"#FFD1D9"}},{border:"#4AD63A",background:"#C2FABC",highlight:{border:"#4AD63A",background:"#E6FFE3"},hover:{border:"#4AD63A",background:"#E6FFE3"}},{border:"#990000",background:"#EE0000",highlight:{border:"#BB0000",background:"#FF3333"},hover:{border:"#BB0000",background:"#FF3333"}},{border:"#FF6000",background:"#FF6000",highlight:{border:"#FF6000",background:"#FF6000"},hover:{border:"#FF6000",background:"#FF6000"}},{border:"#97C2FC",background:"#2B7CE9",highlight:{border:"#D2E5FF",background:"#2B7CE9"},hover:{border:"#D2E5FF",background:"#2B7CE9"}},{border:"#399605",background:"#255C03",highlight:{border:"#399605",background:"#255C03"},hover:{border:"#399605",background:"#255C03"}},{border:"#B70054",background:"#FF007E",highlight:{border:"#B70054",background:"#FF007E"},hover:{border:"#B70054",background:"#FF007E"}},{border:"#AD85E4",background:"#7C29F0",highlight:{border:"#D3BDF0",background:"#7C29F0"},hover:{border:"#D3BDF0",background:"#7C29F0"}},{border:"#4557FA",background:"#000EA1",highlight:{border:"#6E6EFD",background:"#000EA1"},hover:{border:"#6E6EFD",background:"#000EA1"}},{border:"#FFC0CB",background:"#FD5A77",highlight:{border:"#FFD1D9",background:"#FD5A77"},hover:{border:"#FFD1D9",background:"#FD5A77"}},{border:"#C2FABC",background:"#74D66A",highlight:{border:"#E6FFE3",background:"#74D66A"},hover:{border:"#E6FFE3",background:"#74D66A"}},{border:"#EE0000",background:"#990000",highlight:{border:"#FF3333",background:"#BB0000"},hover:{border:"#FF3333",background:"#BB0000"}}],this.options={},this.defaultOptions={useDefaultGroups:!0},Fe(this.options,this.defaultOptions)}return M(i,[{key:"setOptions",value:function(e){var t=["useDefaultGroups"];if(e!==void 0){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&ie(t).call(t,n)===-1){var a=e[n];this.add(n,a)}}}},{key:"clear",value:function(){this._groups=new vT,this._groupNames=[]}},{key:"get",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this._groups.get(e);if(n===void 0&&t)if(this.options.useDefaultGroups===!1&&this._groupNames.length>0){var a=this._groupIndex%this._groupNames.length;++this._groupIndex,n={},n.color=this._groups.get(this._groupNames[a]),this._groups.set(e,n)}else{var o=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,n={},n.color=this._defaultGroups[o],this._groups.set(e,n)}return n}},{key:"add",value:function(e,t){return this._groups.has(e)||this._groupNames.push(e),this._groups.set(e,t),t}}]),i}(),qse=q;qse({target:"Number",stat:!0},{isNaN:function(r){return r!==r}});var Yse=ae,Xse=Yse.Number.isNaN,Jse=Xse,Zse=Jse,Qse=Zse,xf=W(Qse),eue=Ie,tue=eue.isFinite,rue=Number.isFinite||function(r){return typeof r=="number"&&tue(r)},iue=q,nue=rue;iue({target:"Number",stat:!0},{isFinite:nue});var aue=ae,oue=aue.Number.isFinite,sue=oue,uue=sue,lue=uue,Pi=W(lue),hue=q,cue=yi.some,due=Da,fue=due("some");hue({target:"Array",proto:!0,forced:!fue},{some:function(r){return cue(this,r,arguments.length>1?arguments[1]:void 0)}});var vue=Ze,pue=vue("Array").some,gue=Re,yue=pue,ld=Array.prototype,mue=function(i){var r=i.some;return i===ld||gue(ld,i)&&r===ld.some?yue:r},bue=mue,$ue=bue,wue=$ue,_ue=W(wue),Eue=ae,Sue=Eue.Object.getOwnPropertySymbols,Oue=Sue,Tue=Oue,Iue=Tue,ci=W(Iue),pT={exports:{}},kue=q,Pue=ne,xue=wr,gT=Ea.f,yT=Ye,Cue=!yT||Pue(function(){gT(1)});kue({target:"Object",stat:!0,forced:Cue,sham:!yT},{getOwnPropertyDescriptor:function(r,e){return gT(xue(r),e)}});var Aue=ae,mT=Aue.Object,Due=pT.exports=function(r,e){return mT.getOwnPropertyDescriptor(r,e)};mT.getOwnPropertyDescriptor.sham&&(Due.sham=!0);var Rue=pT.exports,Nue=Rue,bT=Nue,Mue=bT,bi=W(Mue),Bue=q,Fue=Ye,jue=tte,Lue=wr,zue=Ea,Hue=Aa;Bue({target:"Object",stat:!0,sham:!Fue},{getOwnPropertyDescriptors:function(r){for(var e=Lue(r),t=zue.f,n=jue(e),a={},o=0,s,u;n.length>o;)u=t(e,s=n[o++]),u!==void 0&&Hue(a,s,u);return a}});var Wue=ae,Vue=Wue.Object.getOwnPropertyDescriptors,Uue=Vue,Kue=Uue,Gue=Kue,di=W(Gue),$T={exports:{}},que=q,Yue=Ye,W1=Fl.f;que({target:"Object",stat:!0,forced:Object.defineProperties!==W1,sham:!Yue},{defineProperties:W1});var Xue=ae,wT=Xue.Object,Jue=$T.exports=function(r,e){return wT.defineProperties(r,e)};wT.defineProperties.sham&&(Jue.sham=!0);var Zue=$T.exports,Que=Zue,ele=Que,tle=ele,eh=W(tle),rle=OS,th=W(rle);function rh(i,r,e){return r=nO(r),r in i?Hl(i,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[r]=e,i}var _T=Ie,ile=ne,nle=oe,ale=_r,ole=gO.trim,sle=Gv,ule=nle("".charAt),Xu=_T.parseFloat,V1=_T.Symbol,U1=V1&&V1.iterator,lle=1/Xu(sle+"-0")!==-1/0||U1&&!ile(function(){Xu(Object(U1))}),hle=lle?function(r){var e=ole(ale(r)),t=Xu(e);return t===0&&ule(e,0)==="-"?-0:t}:Xu,cle=q,K1=hle;cle({global:!0,forced:parseFloat!==K1},{parseFloat:K1});var dle=ae,fle=dle.parseFloat,vle=fle,ple=vle,gle=ple,ET=W(gle),yle=q,mle=ne,ble=Wl.f,$le=mle(function(){return!Object.getOwnPropertyNames(1)});yle({target:"Object",stat:!0,forced:$le},{getOwnPropertyNames:ble});var wle=ae,_le=wle.Object,Ele=function(r){return _le.getOwnPropertyNames(r)},Sle=Ele,Ole=Sle,Tle=Ole,Ile=W(Tle);function cp(i,r){var e=["node","edge","label"],t=!0,n=Xr(r,"chosen");if(typeof n=="boolean")t=n;else if(ce(n)==="object"){if(ie(e).call(e,i)===-1)throw new Error("choosify: subOption '"+i+"' should be one of '"+e.join("', '")+"'");var a=Xr(r,["chosen",i]);(typeof a=="boolean"||typeof a=="function")&&(t=a)}return t}function Cf(i,r,e){if(i.width<=0||i.height<=0)return!1;if(e!==void 0){var t={x:r.x-e.x,y:r.y-e.y};if(e.angle!==0){var n=-e.angle,a={x:Math.cos(n)*t.x-Math.sin(n)*t.y,y:Math.sin(n)*t.x+Math.cos(n)*t.y};r=a}else r=t}var o=i.x+i.width,s=i.y+i.width;return i.leftr.x&&i.topr.y}function Ju(i){return typeof i=="string"&&i!==""}function ST(i,r,e,t){var n=t.x,a=t.y;if(typeof t.distanceToBorder=="function"){var o=t.distanceToBorder(i,r),s=Math.sin(r)*o,u=Math.cos(r)*o;u===o?(n+=o,a=t.y):s===o?(n=t.x,a-=o):(n+=u,a-=s)}else t.shape.width>t.shape.height?(n=t.x+t.shape.width*.5,a=t.y-e):(n=t.x+e,a=t.y-t.shape.height*.5);return{x:n,y:a}}var kle=Ze,Ple=kle("Array").values,xle=Ple,Cle=xle,Ale=an,Dle=Je,Rle=Re,Nle=Cle,hd=Array.prototype,Mle={DOMTokenList:!0,NodeList:!0},Ble=function(i){var r=i.values;return i===hd||Rle(hd,i)&&r===hd.values||Dle(Mle,Ale(i))?Nle:r},Fle=Ble,OT=W(Fle),jle=function(){function i(r){N(this,i),this.measureText=r,this.current=0,this.width=0,this.height=0,this.lines=[]}return M(i,[{key:"_add",value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"normal";this.lines[e]===void 0&&(this.lines[e]={width:0,height:0,blocks:[]});var a=t;(t===void 0||t==="")&&(a=" ");var o=this.measureText(a,n),s=Fe({},OT(o));s.text=t,s.width=o.width,s.mod=n,(t===void 0||t==="")&&(s.width=0),this.lines[e].blocks.push(s),this.lines[e].width+=s.width}},{key:"curWidth",value:function(){var e=this.lines[this.current];return e===void 0?0:e.width}},{key:"append",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t)}},{key:"newLine",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t),this.current++}},{key:"determineLineHeights",value:function(){for(var e=0;ee&&(e=a.width),t+=a.height}this.width=e,this.height=t}},{key:"removeEmptyBlocks",value:function(){for(var e=[],t=0;t"://,""://,""://,"":/<\/b>/,"":/<\/i>/,"":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/},G1=function(){function i(r){N(this,i),this.text=r,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}return M(i,[{key:"mod",value:function(){return this.modStack.length===0?"normal":this.modStack[0]}},{key:"modName",value:function(){if(this.modStack.length===0)return"normal";if(this.modStack[0]==="mono")return"mono";if(this.bold&&this.ital)return"boldital";if(this.bold)return"bold";if(this.ital)return"ital"}},{key:"emitBlock",value:function(){this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}},{key:"add",value:function(e){e===" "&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1),e!=" "&&(this.buffer+=e)}},{key:"parseWS",value:function(e){return/[ \t]/.test(e)?(this.mono?this.add(e):this.spacing=!0,!0):!1}},{key:"setTag",value:function(e){this.emitBlock(),this[e]=!0,this.modStack.unshift(e)}},{key:"unsetTag",value:function(e){this.emitBlock(),this[e]=!1,this.modStack.shift()}},{key:"parseStartTag",value:function(e,t){return!this.mono&&!this[e]&&this.match(t)?(this.setTag(e),!0):!1}},{key:"match",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this.prepareRegExp(e),a=Se(n,2),o=a[0],s=a[1],u=o.test(this.text.substr(this.position,s));return u&&t&&(this.position+=s-1),u}},{key:"parseEndTag",value:function(e,t,n){var a=this.mod()===e;return e==="mono"?a=a&&this.mono:a=a&&!this.mono,a&&this.match(t)?(n!==void 0?(this.position===this.text.length-1||this.match(n,!1))&&this.unsetTag(e):this.unsetTag(e),!0):!1}},{key:"replace",value:function(e,t){return this.match(e)?(this.add(t),this.position+=length-1,!0):!1}},{key:"prepareRegExp",value:function(e){var t,n;if(e instanceof RegExp)n=e,t=1;else{var a=Lle[e];a!==void 0?n=a:n=new RegExp(e),t=e.length}return[n,t]}}]),i}(),zle=function(){function i(r,e,t,n){var a=this;N(this,i),this.ctx=r,this.parent=e,this.selected=t,this.hover=n;var o=function(u,l){if(u===void 0)return 0;var h=a.parent.getFormattingValues(r,t,n,l),d=0;if(u!==""){var c=a.ctx.measureText(u);d=c.width}return{width:d,values:h}};this.lines=new jle(o)}return M(i,[{key:"process",value:function(e){if(!Ju(e))return this.lines.finalize();var t=this.parent.fontOptions;e=e.replace(/\r\n/g,` +`,He()):G+=ee,He();if(ee!='"')throw ft('End of string " expected');He(),wt=dt.IDENTIFIER;return}for(wt=dt.UNKNOWN;ee!="";)G+=ee,He();throw new SyntaxError('Syntax error in part "'+sT(G,30)+'"')}function loe(){var i={};if(ooe(),ge(),G==="strict"&&(i.strict=!0,ge()),(G==="graph"||G==="digraph")&&(i.type=G,ge()),wt===dt.IDENTIFIER&&(i.id=G,ge()),G!="{")throw ft("Angle bracket { expected");if(ge(),nT(i),G!="}")throw ft("Angle bracket } expected");if(ge(),G!=="")throw ft("End of file expected");return ge(),delete i.node,delete i.edge,delete i.graph,i}function nT(i){for(;G!==""&&G!="}";)hoe(i),G===";"&&ge()}function hoe(i){var r=aT(i);if(r){oT(i,r);return}var e=coe(i);if(!e){if(wt!=dt.IDENTIFIER)throw ft("Identifier expected");var t=G;if(ge(),G==="="){if(ge(),wt!=dt.IDENTIFIER)throw ft("Identifier expected");i[t]=G,ge()}else doe(i,t)}}function aT(i){var r=null;if(G==="subgraph"&&(r={},r.type="subgraph",ge(),wt===dt.IDENTIFIER&&(r.id=G,ge())),G==="{"){if(ge(),r||(r={}),r.parent=i,r.node=i.node,r.edge=i.edge,r.graph=i.graph,nT(r),G!="}")throw ft("Angle bracket } expected");ge(),delete r.node,delete r.edge,delete r.graph,delete r.parent,i.subgraphs||(i.subgraphs=[]),i.subgraphs.push(r)}return r}function coe(i){return G==="node"?(ge(),i.node=ro(),"node"):G==="edge"?(ge(),i.edge=ro(),"edge"):G==="graph"?(ge(),i.graph=ro(),"graph"):null}function doe(i,r){var e={id:r},t=ro();t&&(e.attr=t),rT(i,e),oT(i,r)}function oT(i,r){for(;G==="->"||G==="--";){var e,t=G;ge();var n=aT(i);if(n)e=n;else{if(wt!=dt.IDENTIFIER)throw ft("Identifier or subgraph expected");e=G,rT(i,{id:e}),ge()}var a=ro(),o=iT(i,r,e,t,a);uoe(i,o),r=e}}function ro(){for(var i,r=null,e={dashed:!0,solid:!1,dotted:[1,5]},t={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},n=new Array,a=new Array;G==="[";){for(ge(),r={};G!==""&&G!="]";){if(wt!=dt.IDENTIFIER)throw ft("Attribute name expected");var o=G;if(ge(),G!="=")throw ft("Equal sign = expected");if(ge(),wt!=dt.IDENTIFIER)throw ft("Attribute value expected");var s=G;o==="style"&&(s=e[s]);var u;o==="arrowhead"&&(u=t[s],o="arrows",s={to:{enabled:!0,type:u}}),o==="arrowtail"&&(u=t[s],o="arrows",s={from:{enabled:!0,type:u}}),n.push({attr:r,name:o,value:s}),a.push(o),ge(),G==","&&ge()}if(G!="]")throw ft("Bracket ] expected");ge()}if(oi(a).call(a,"dir")){var l={};for(l.arrows={},i=0;i"&&(u.arrows="to"),u};fe(n=r.edges).call(n,function(o){var s,u;if(o.from instanceof Object?s=o.from.nodes:s={id:o.from},o.to instanceof Object?u=o.to.nodes:u={id:o.to},o.from instanceof Object&&o.from.edges){var l;fe(l=o.from.edges).call(l,function(d){var c=a(d);e.edges.push(c)})}if(foe(s,u,function(d,c){var f=iT(e,d.id,c.id,o.type,o.attr),v=a(f);e.edges.push(v)}),o.to instanceof Object&&o.to.edges){var h;fe(h=o.to.edges).call(h,function(d){var c=a(d);e.edges.push(c)})}})}return r.attr&&(e.options=r.attr),e}function poe(i,r){var e,t={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};r!=null&&(r.fixed!=null&&(t.nodes.fixed=r.fixed),r.parseColor!=null&&(t.nodes.parseColor=r.parseColor),r.inheritColor!=null&&(t.edges.inheritColor=r.inheritColor));var n=i.edges,a=ia(n).call(n,function(s){var u={from:s.source,id:s.id,to:s.target};return s.attributes!=null&&(u.attributes=s.attributes),s.label!=null&&(u.label=s.label),s.attributes!=null&&s.attributes.title!=null&&(u.title=s.attributes.title),s.type==="Directed"&&(u.arrows="to"),s.color&&t.edges.inheritColor===!1&&(u.color=s.color),u}),o=ia(e=i.nodes).call(e,function(s){var u={id:s.id,fixed:t.nodes.fixed&&s.x!=null&&s.y!=null};return s.attributes!=null&&(u.attributes=s.attributes),s.label!=null&&(u.label=s.label),s.size!=null&&(u.size=s.size),s.attributes!=null&&s.attributes.title!=null&&(u.title=s.attributes.title),s.title!=null&&(u.title=s.title),s.x!=null&&(u.x=s.x),s.y!=null&&(u.y=s.y),s.color!=null&&(t.nodes.parseColor===!0?u.color=s.color:u.color={background:s.color,border:s.color,highlight:{background:s.color,border:s.color},hover:{background:s.color,border:s.color}}),u});return{nodes:o,edges:a}}var goe={addDescription:"Click in an empty space to place a new node.",addEdge:"Add Edge",addNode:"Add Node",back:"Back",close:"Close",createEdgeError:"Cannot link edges to a cluster.",del:"Delete selected",deleteClusterError:"Clusters cannot be deleted.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",edit:"Edit",editClusterError:"Clusters cannot be edited.",editEdge:"Edit Edge",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",editNode:"Edit Node"},yoe={addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",addEdge:"Kante hinzufügen",addNode:"Knoten hinzufügen",back:"Zurück",close:"Schließen",createEdgeError:"Es ist nicht möglich, Kanten mit Clustern zu verbinden.",del:"Lösche Auswahl",deleteClusterError:"Cluster können nicht gelöscht werden.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",edit:"Editieren",editClusterError:"Cluster können nicht editiert werden.",editEdge:"Kante editieren",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",editNode:"Knoten editieren"},moe={addDescription:"Haga clic en un lugar vacío para colocar un nuevo nodo.",addEdge:"Añadir arista",addNode:"Añadir nodo",back:"Atrás",close:"Cerrar",createEdgeError:"No se puede conectar una arista a un grupo.",del:"Eliminar selección",deleteClusterError:"No es posible eliminar grupos.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",edit:"Editar",editClusterError:"No es posible editar grupos.",editEdge:"Editar arista",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",editNode:"Editar nodo"},boe={addDescription:"Clicca per aggiungere un nuovo nodo",addEdge:"Aggiungi un vertice",addNode:"Aggiungi un nodo",back:"Indietro",close:"Chiudere",createEdgeError:"Non si possono collegare vertici ad un cluster",del:"Cancella la selezione",deleteClusterError:"I cluster non possono essere cancellati",edgeDescription:"Clicca su un nodo e trascinalo ad un altro nodo per connetterli.",edit:"Modifica",editClusterError:"I clusters non possono essere modificati.",editEdge:"Modifica il vertice",editEdgeDescription:"Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.",editNode:"Modifica il nodo"},$oe={addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",addEdge:"Link toevoegen",addNode:"Node toevoegen",back:"Terug",close:"Sluiten",createEdgeError:"Kan geen link maken naar een cluster.",del:"Selectie verwijderen",deleteClusterError:"Clusters kunnen niet worden verwijderd.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",edit:"Wijzigen",editClusterError:"Clusters kunnen niet worden aangepast.",editEdge:"Link wijzigen",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",editNode:"Node wijzigen"},woe={addDescription:"Clique em um espaço em branco para adicionar um novo nó",addEdge:"Adicionar aresta",addNode:"Adicionar nó",back:"Voltar",close:"Fechar",createEdgeError:"Não foi possível linkar arestas a um cluster.",del:"Remover selecionado",deleteClusterError:"Clusters não puderam ser removidos.",edgeDescription:"Clique em um nó e arraste a aresta até outro nó para conectá-los",edit:"Editar",editClusterError:"Clusters não puderam ser editados.",editEdge:"Editar aresta",editEdgeDescription:"Clique nos pontos de controle e os arraste para um nó para conectá-los",editNode:"Editar nó"},_oe={addDescription:"Кликните в свободное место, чтобы добавить новый узел.",addEdge:"Добавить ребро",addNode:"Добавить узел",back:"Назад",close:"Закрывать",createEdgeError:"Невозможно соединить ребра в кластер.",del:"Удалить выбранное",deleteClusterError:"Кластеры не могут быть удалены",edgeDescription:"Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.",edit:"Редактировать",editClusterError:"Кластеры недоступны для редактирования.",editEdge:"Редактировать ребро",editEdgeDescription:"Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.",editNode:"Редактировать узел"},Eoe={addDescription:"单击空白处放置新节点。",addEdge:"添加连接线",addNode:"添加节点",back:"返回",close:"關閉",createEdgeError:"无法将连接线连接到群集。",del:"删除选定",deleteClusterError:"无法删除群集。",edgeDescription:"单击某个节点并将该连接线拖动到另一个节点以连接它们。",edit:"编辑",editClusterError:"无法编辑群集。",editEdge:"编辑连接线",editEdgeDescription:"单击控制节点并将它们拖到节点上连接。",editNode:"编辑节点"},Soe={addDescription:"Kлікніть на вільне місце, щоб додати новий вузол.",addEdge:"Додати край",addNode:"Додати вузол",back:"Назад",close:"Закрити",createEdgeError:"Не можливо об'єднати краї в групу.",del:"Видалити обране",deleteClusterError:"Групи не можуть бути видалені.",edgeDescription:"Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.",edit:"Редагувати",editClusterError:"Групи недоступні для редагування.",editEdge:"Редагувати край",editEdgeDescription:"Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.",editNode:"Редагувати вузол"},Ooe={addDescription:"Cliquez dans un endroit vide pour placer un nœud.",addEdge:"Ajouter un lien",addNode:"Ajouter un nœud",back:"Retour",close:"Fermer",createEdgeError:"Impossible de créer un lien vers un cluster.",del:"Effacer la sélection",deleteClusterError:"Les clusters ne peuvent pas être effacés.",edgeDescription:"Cliquez sur un nœud et glissez le lien vers un autre nœud pour les connecter.",edit:"Éditer",editClusterError:"Les clusters ne peuvent pas être édités.",editEdge:"Éditer le lien",editEdgeDescription:"Cliquez sur les points de contrôle et glissez-les pour connecter un nœud.",editNode:"Éditer le nœud"},Toe={addDescription:"Kluknutím do prázdného prostoru můžete přidat nový vrchol.",addEdge:"Přidat hranu",addNode:"Přidat vrchol",back:"Zpět",close:"Zavřít",createEdgeError:"Nelze připojit hranu ke shluku.",del:"Smazat výběr",deleteClusterError:"Nelze mazat shluky.",edgeDescription:"Přetažením z jednoho vrcholu do druhého můžete spojit tyto vrcholy novou hranou.",edit:"Upravit",editClusterError:"Nelze upravovat shluky.",editEdge:"Upravit hranu",editEdgeDescription:"Přetažením kontrolního vrcholu hrany ji můžete připojit k jinému vrcholu.",editNode:"Upravit vrchol"},Ioe=Object.freeze({__proto__:null,cn:Eoe,cs:Toe,de:yoe,en:goe,es:moe,fr:Ooe,it:boe,nl:$oe,pt:woe,ru:_oe,uk:Soe});function koe(i,r){try{var e=r.split(/[-_ /]/,2),t=Se(e,2),n=t[0],a=t[1],o=n!=null?n.toLowerCase():null,s=a!=null?a.toUpperCase():null;if(o&&s){var u=o+"-"+s;if(Object.prototype.hasOwnProperty.call(i,u))return u;var l;console.warn(Kv(l="Unknown variant ".concat(s," of language ")).call(l,o,"."))}if(o){var h=o;if(Object.prototype.hasOwnProperty.call(i,h))return h;console.warn("Unknown language ".concat(o))}return console.warn("Unknown locale ".concat(r,", falling back to English.")),"en"}catch(d){return console.error(d),console.warn("Unexpected error while normalizing locale ".concat(r,", falling back to English.")),"en"}}var Poe=function(){function i(){R(this,i),this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}return N(i,[{key:"init",value:function(){if(!this.initialized()){this.src=this.image.src;var e=this.image.width,t=this.image.height;this.width=e,this.height=t;var n=Math.floor(t/2),a=Math.floor(t/4),o=Math.floor(t/8),s=Math.floor(t/16),u=Math.floor(e/2),l=Math.floor(e/4),h=Math.floor(e/8),d=Math.floor(e/16);this.canvas.width=3*l,this.canvas.height=n,this.coordinates=[[0,0,u,n],[u,0,l,a],[u,a,h,o],[5*h,a,d,s]],this._fillMipMap()}}},{key:"initialized",value:function(){return this.coordinates!==void 0}},{key:"_fillMipMap",value:function(){var e=this.canvas.getContext("2d"),t=this.coordinates[0];e.drawImage(this.image,t[0],t[1],t[2],t[3]);for(var n=1;n2){t*=.5;for(var u=0;t>2&&u=this.NUM_ITERATIONS&&(u=this.NUM_ITERATIONS-1);var l=this.coordinates[u];e.drawImage(this.canvas,l[0],l[1],l[2],l[3],n,a,o,s)}else e.drawImage(this.image,n,a,o,s)}}]),i}(),xoe=function(){function i(r){R(this,i),this.images={},this.imageBroken={},this.callback=r}return N(i,[{key:"_tryloadBrokenUrl",value:function(e,t,n){if(!(e===void 0||n===void 0)){if(t===void 0){console.warn("No broken url image defined");return}n.image.onerror=function(){console.error("Could not load brokenImage:",t)},n.image.src=t}}},{key:"_redrawWithImage",value:function(e){this.callback&&this.callback(e)}},{key:"load",value:function(e,t){var n=this,a=this.images[e];if(a)return a;var o=new Poe;return this.images[e]=o,o.image.onload=function(){n._fixImageCoordinates(o.image),o.init(),n._redrawWithImage(o)},o.image.onerror=function(){console.error("Could not load image:",e),n._tryloadBrokenUrl(e,t,o)},o.image.src=e,o}},{key:"_fixImageCoordinates",value:function(e){e.width===0&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}}]),i}(),uT={exports:{}},Coe=ne,Aoe=Coe(function(){if(typeof ArrayBuffer=="function"){var i=new ArrayBuffer(8);Object.isExtensible(i)&&Object.defineProperty(i,"a",{value:8})}}),Doe=ne,Roe=Xe,Noe=Hr,R1=Aoe,bu=Object.isExtensible,Moe=Doe(function(){bu(1)}),Boe=Moe||R1?function(r){return!Roe(r)||R1&&Noe(r)==="ArrayBuffer"?!1:bu?bu(r):!0}:bu,Foe=ne,lT=!Foe(function(){return Object.isExtensible(Object.preventExtensions({}))}),joe=q,Loe=se,zoe=es,Hoe=Xe,np=Je,Voe=Ht.f,N1=ns,Woe=Vl,ap=Boe,Uoe=Al,Koe=lT,hT=!1,jr=Uoe("meta"),Goe=0,op=function(i){Voe(i,jr,{value:{objectID:"O"+Goe++,weakData:{}}})},qoe=function(i,r){if(!Hoe(i))return typeof i=="symbol"?i:(typeof i=="string"?"S":"P")+i;if(!np(i,jr)){if(!ap(i))return"F";if(!r)return"E";op(i)}return i[jr].objectID},Yoe=function(i,r){if(!np(i,jr)){if(!ap(i))return!0;if(!r)return!1;op(i)}return i[jr].weakData},Xoe=function(i){return Koe&&hT&&ap(i)&&!np(i,jr)&&op(i),i},Joe=function(){Zoe.enable=function(){},hT=!0;var i=N1.f,r=Loe([].splice),e={};e[jr]=1,i(e).length&&(N1.f=function(t){for(var n=i(t),a=0,o=n.length;ad;d++)if(f=y(i[d]),f&&M1(F1,f))return f;return new $u(!1)}l=ase(i,h)}for(v=a?i.next:l.next;!(p=ese(v,l)).done;){try{f=y(p.value)}catch(m){B1(l,"throw",m)}if(typeof f=="object"&&f&&M1(F1,f))return f}return new $u(!1)},use=Re,lse=TypeError,up=function(i,r){if(use(r,i))return i;throw new lse("Incorrect invocation")},hse=q,cse=Ie,dse=Ql,fse=ne,vse=ka,pse=sp,gse=up,yse=qe,mse=Xe,bse=Sa,$se=xa,wse=Ht.f,_se=yi.forEach,Ese=Ye,cT=ln,Sse=cT.set,Ose=cT.getterFor,lp=function(i,r,e){var t=i.indexOf("Map")!==-1,n=i.indexOf("Weak")!==-1,a=t?"set":"add",o=cse[i],s=o&&o.prototype,u={},l;if(!Ese||!yse(o)||!(n||s.forEach&&!fse(function(){new o().entries().next()})))l=e.getConstructor(r,i,t,a),dse.enable();else{l=r(function(c,f){Sse(gse(c,h),{type:i,collection:new o}),bse(f)||pse(f,c[a],{that:c,AS_ENTRIES:t})});var h=l.prototype,d=Ose(i);_se(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(c){var f=c==="add"||c==="set";c in s&&!(n&&c==="clear")&&vse(h,c,function(v,p){var g=d(this).collection;if(!f&&n&&!mse(v))return c==="get"?void 0:!1;var y=g[c](v===0?0:v,p);return f?this:y})}),n||wse(h,"size",{configurable:!0,get:function(){return d(this).collection.size}})}return $se(l,i,!1,!0),u[i]=l,hse({global:!0,forced:!0},u),n||e.setStrong(l,i,t),l},Tse=rs,hp=function(i,r,e){for(var t in r)e&&e.unsafe&&i[t]?i[t]=r[t]:Tse(i,t,r[t],e);return i},Ise=Jt,kse=Lv,Pse=ke,xse=Ye,j1=Pse("species"),Cse=function(i){var r=Ise(i);xse&&r&&!r[j1]&&kse(r,j1,{configurable:!0,get:function(){return this}})},Ase=Pa,Dse=Lv,L1=hp,Rse=Zo,Nse=up,Mse=Sa,Bse=sp,Fse=Nv,Qs=Mv,jse=Cse,za=Ye,z1=Ql.fastKey,dT=ln,H1=dT.set,ud=dT.getterFor,fT={getConstructor:function(i,r,e,t){var n=i(function(l,h){Nse(l,a),H1(l,{type:r,index:Ase(null),first:void 0,last:void 0,size:0}),za||(l.size=0),Mse(h)||Bse(h,l[t],{that:l,AS_ENTRIES:e})}),a=n.prototype,o=ud(r),s=function(l,h,d){var c=o(l),f=u(l,h),v,p;return f?f.value=d:(c.last=f={index:p=z1(h,!0),key:h,value:d,previous:v=c.last,next:void 0,removed:!1},c.first||(c.first=f),v&&(v.next=f),za?c.size++:l.size++,p!=="F"&&(c.index[p]=f)),l},u=function(l,h){var d=o(l),c=z1(h),f;if(c!=="F")return d.index[c];for(f=d.first;f;f=f.next)if(f.key===h)return f};return L1(a,{clear:function(){for(var h=this,d=o(h),c=d.index,f=d.first;f;)f.removed=!0,f.previous&&(f.previous=f.previous.next=void 0),delete c[f.index],f=f.next;d.first=d.last=void 0,za?d.size=0:h.size=0},delete:function(l){var h=this,d=o(h),c=u(h,l);if(c){var f=c.next,v=c.previous;delete d.index[c.index],c.removed=!0,v&&(v.next=f),f&&(f.previous=v),d.first===c&&(d.first=f),d.last===c&&(d.last=v),za?d.size--:h.size--}return!!c},forEach:function(h){for(var d=o(this),c=Rse(h,arguments.length>1?arguments[1]:void 0),f;f=f?f.next:d.first;)for(c(f.value,f.key,this);f&&f.removed;)f=f.previous},has:function(h){return!!u(this,h)}}),L1(a,e?{get:function(h){var d=u(this,h);return d&&d.value},set:function(h,d){return s(this,h===0?0:h,d)}}:{add:function(h){return s(this,h=h===0?0:h,h)}}),za&&Dse(a,"size",{configurable:!0,get:function(){return o(this).size}}),n},setStrong:function(i,r,e){var t=r+" Iterator",n=ud(r),a=ud(t);Fse(i,r,function(o,s){H1(this,{type:t,target:o,state:n(o),kind:s,last:void 0})},function(){for(var o=a(this),s=o.kind,u=o.last;u&&u.removed;)u=u.previous;return!o.target||!(o.last=u=u?u.next:o.state.first)?(o.target=void 0,Qs(void 0,!0)):Qs(s==="keys"?u.key:s==="values"?u.value:[u.key,u.value],!1)},e?"entries":"values",!e,!0),jse(r)}},Lse=lp,zse=fT;Lse("Map",function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},zse);var Hse=ae,Vse=Hse.Map,Wse=Vse,Use=Wse,Kse=Use,vT=V(Kse),Gse=function(){function i(){R(this,i),this.clear(),this._defaultIndex=0,this._groupIndex=0,this._defaultGroups=[{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},{border:"#FFA500",background:"#FFFF00",highlight:{border:"#FFA500",background:"#FFFFA3"},hover:{border:"#FFA500",background:"#FFFFA3"}},{border:"#FA0A10",background:"#FB7E81",highlight:{border:"#FA0A10",background:"#FFAFB1"},hover:{border:"#FA0A10",background:"#FFAFB1"}},{border:"#41A906",background:"#7BE141",highlight:{border:"#41A906",background:"#A1EC76"},hover:{border:"#41A906",background:"#A1EC76"}},{border:"#E129F0",background:"#EB7DF4",highlight:{border:"#E129F0",background:"#F0B3F5"},hover:{border:"#E129F0",background:"#F0B3F5"}},{border:"#7C29F0",background:"#AD85E4",highlight:{border:"#7C29F0",background:"#D3BDF0"},hover:{border:"#7C29F0",background:"#D3BDF0"}},{border:"#C37F00",background:"#FFA807",highlight:{border:"#C37F00",background:"#FFCA66"},hover:{border:"#C37F00",background:"#FFCA66"}},{border:"#4220FB",background:"#6E6EFD",highlight:{border:"#4220FB",background:"#9B9BFD"},hover:{border:"#4220FB",background:"#9B9BFD"}},{border:"#FD5A77",background:"#FFC0CB",highlight:{border:"#FD5A77",background:"#FFD1D9"},hover:{border:"#FD5A77",background:"#FFD1D9"}},{border:"#4AD63A",background:"#C2FABC",highlight:{border:"#4AD63A",background:"#E6FFE3"},hover:{border:"#4AD63A",background:"#E6FFE3"}},{border:"#990000",background:"#EE0000",highlight:{border:"#BB0000",background:"#FF3333"},hover:{border:"#BB0000",background:"#FF3333"}},{border:"#FF6000",background:"#FF6000",highlight:{border:"#FF6000",background:"#FF6000"},hover:{border:"#FF6000",background:"#FF6000"}},{border:"#97C2FC",background:"#2B7CE9",highlight:{border:"#D2E5FF",background:"#2B7CE9"},hover:{border:"#D2E5FF",background:"#2B7CE9"}},{border:"#399605",background:"#255C03",highlight:{border:"#399605",background:"#255C03"},hover:{border:"#399605",background:"#255C03"}},{border:"#B70054",background:"#FF007E",highlight:{border:"#B70054",background:"#FF007E"},hover:{border:"#B70054",background:"#FF007E"}},{border:"#AD85E4",background:"#7C29F0",highlight:{border:"#D3BDF0",background:"#7C29F0"},hover:{border:"#D3BDF0",background:"#7C29F0"}},{border:"#4557FA",background:"#000EA1",highlight:{border:"#6E6EFD",background:"#000EA1"},hover:{border:"#6E6EFD",background:"#000EA1"}},{border:"#FFC0CB",background:"#FD5A77",highlight:{border:"#FFD1D9",background:"#FD5A77"},hover:{border:"#FFD1D9",background:"#FD5A77"}},{border:"#C2FABC",background:"#74D66A",highlight:{border:"#E6FFE3",background:"#74D66A"},hover:{border:"#E6FFE3",background:"#74D66A"}},{border:"#EE0000",background:"#990000",highlight:{border:"#FF3333",background:"#BB0000"},hover:{border:"#FF3333",background:"#BB0000"}}],this.options={},this.defaultOptions={useDefaultGroups:!0},Fe(this.options,this.defaultOptions)}return N(i,[{key:"setOptions",value:function(e){var t=["useDefaultGroups"];if(e!==void 0){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&ie(t).call(t,n)===-1){var a=e[n];this.add(n,a)}}}},{key:"clear",value:function(){this._groups=new vT,this._groupNames=[]}},{key:"get",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this._groups.get(e);if(n===void 0&&t)if(this.options.useDefaultGroups===!1&&this._groupNames.length>0){var a=this._groupIndex%this._groupNames.length;++this._groupIndex,n={},n.color=this._groups.get(this._groupNames[a]),this._groups.set(e,n)}else{var o=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,n={},n.color=this._defaultGroups[o],this._groups.set(e,n)}return n}},{key:"add",value:function(e,t){return this._groups.has(e)||this._groupNames.push(e),this._groups.set(e,t),t}}]),i}(),qse=q;qse({target:"Number",stat:!0},{isNaN:function(r){return r!==r}});var Yse=ae,Xse=Yse.Number.isNaN,Jse=Xse,Zse=Jse,Qse=Zse,xf=V(Qse),eue=Ie,tue=eue.isFinite,rue=Number.isFinite||function(r){return typeof r=="number"&&tue(r)},iue=q,nue=rue;iue({target:"Number",stat:!0},{isFinite:nue});var aue=ae,oue=aue.Number.isFinite,sue=oue,uue=sue,lue=uue,Ai=V(lue),hue=q,cue=yi.some,due=Da,fue=due("some");hue({target:"Array",proto:!0,forced:!fue},{some:function(r){return cue(this,r,arguments.length>1?arguments[1]:void 0)}});var vue=Ze,pue=vue("Array").some,gue=Re,yue=pue,ld=Array.prototype,mue=function(i){var r=i.some;return i===ld||gue(ld,i)&&r===ld.some?yue:r},bue=mue,$ue=bue,wue=$ue,_ue=V(wue),Eue=ae,Sue=Eue.Object.getOwnPropertySymbols,Oue=Sue,Tue=Oue,Iue=Tue,ci=V(Iue),pT={exports:{}},kue=q,Pue=ne,xue=wr,gT=Ea.f,yT=Ye,Cue=!yT||Pue(function(){gT(1)});kue({target:"Object",stat:!0,forced:Cue,sham:!yT},{getOwnPropertyDescriptor:function(r,e){return gT(xue(r),e)}});var Aue=ae,mT=Aue.Object,Due=pT.exports=function(r,e){return mT.getOwnPropertyDescriptor(r,e)};mT.getOwnPropertyDescriptor.sham&&(Due.sham=!0);var Rue=pT.exports,Nue=Rue,bT=Nue,Mue=bT,bi=V(Mue),Bue=q,Fue=Ye,jue=tte,Lue=wr,zue=Ea,Hue=Aa;Bue({target:"Object",stat:!0,sham:!Fue},{getOwnPropertyDescriptors:function(r){for(var e=Lue(r),t=zue.f,n=jue(e),a={},o=0,s,u;n.length>o;)u=t(e,s=n[o++]),u!==void 0&&Hue(a,s,u);return a}});var Vue=ae,Wue=Vue.Object.getOwnPropertyDescriptors,Uue=Wue,Kue=Uue,Gue=Kue,di=V(Gue),$T={exports:{}},que=q,Yue=Ye,V1=Fl.f;que({target:"Object",stat:!0,forced:Object.defineProperties!==V1,sham:!Yue},{defineProperties:V1});var Xue=ae,wT=Xue.Object,Jue=$T.exports=function(r,e){return wT.defineProperties(r,e)};wT.defineProperties.sham&&(Jue.sham=!0);var Zue=$T.exports,Que=Zue,ele=Que,tle=ele,eh=V(tle),rle=OS,th=V(rle);function rh(i,r,e){return r=nO(r),r in i?Hl(i,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[r]=e,i}var _T=Ie,ile=ne,nle=se,ale=_r,ole=gO.trim,sle=Gv,ule=nle("".charAt),Xu=_T.parseFloat,W1=_T.Symbol,U1=W1&&W1.iterator,lle=1/Xu(sle+"-0")!==-1/0||U1&&!ile(function(){Xu(Object(U1))}),hle=lle?function(r){var e=ole(ale(r)),t=Xu(e);return t===0&&ule(e,0)==="-"?-0:t}:Xu,cle=q,K1=hle;cle({global:!0,forced:parseFloat!==K1},{parseFloat:K1});var dle=ae,fle=dle.parseFloat,vle=fle,ple=vle,gle=ple,ET=V(gle),yle=q,mle=ne,ble=Vl.f,$le=mle(function(){return!Object.getOwnPropertyNames(1)});yle({target:"Object",stat:!0,forced:$le},{getOwnPropertyNames:ble});var wle=ae,_le=wle.Object,Ele=function(r){return _le.getOwnPropertyNames(r)},Sle=Ele,Ole=Sle,Tle=Ole,Ile=V(Tle);function cp(i,r){var e=["node","edge","label"],t=!0,n=Xr(r,"chosen");if(typeof n=="boolean")t=n;else if(de(n)==="object"){if(ie(e).call(e,i)===-1)throw new Error("choosify: subOption '"+i+"' should be one of '"+e.join("', '")+"'");var a=Xr(r,["chosen",i]);(typeof a=="boolean"||typeof a=="function")&&(t=a)}return t}function Cf(i,r,e){if(i.width<=0||i.height<=0)return!1;if(e!==void 0){var t={x:r.x-e.x,y:r.y-e.y};if(e.angle!==0){var n=-e.angle,a={x:Math.cos(n)*t.x-Math.sin(n)*t.y,y:Math.sin(n)*t.x+Math.cos(n)*t.y};r=a}else r=t}var o=i.x+i.width,s=i.y+i.width;return i.leftr.x&&i.topr.y}function Ju(i){return typeof i=="string"&&i!==""}function ST(i,r,e,t){var n=t.x,a=t.y;if(typeof t.distanceToBorder=="function"){var o=t.distanceToBorder(i,r),s=Math.sin(r)*o,u=Math.cos(r)*o;u===o?(n+=o,a=t.y):s===o?(n=t.x,a-=o):(n+=u,a-=s)}else t.shape.width>t.shape.height?(n=t.x+t.shape.width*.5,a=t.y-e):(n=t.x+e,a=t.y-t.shape.height*.5);return{x:n,y:a}}var kle=Ze,Ple=kle("Array").values,xle=Ple,Cle=xle,Ale=un,Dle=Je,Rle=Re,Nle=Cle,hd=Array.prototype,Mle={DOMTokenList:!0,NodeList:!0},Ble=function(i){var r=i.values;return i===hd||Rle(hd,i)&&r===hd.values||Dle(Mle,Ale(i))?Nle:r},Fle=Ble,OT=V(Fle),jle=function(){function i(r){R(this,i),this.measureText=r,this.current=0,this.width=0,this.height=0,this.lines=[]}return N(i,[{key:"_add",value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"normal";this.lines[e]===void 0&&(this.lines[e]={width:0,height:0,blocks:[]});var a=t;(t===void 0||t==="")&&(a=" ");var o=this.measureText(a,n),s=Fe({},OT(o));s.text=t,s.width=o.width,s.mod=n,(t===void 0||t==="")&&(s.width=0),this.lines[e].blocks.push(s),this.lines[e].width+=s.width}},{key:"curWidth",value:function(){var e=this.lines[this.current];return e===void 0?0:e.width}},{key:"append",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t)}},{key:"newLine",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t),this.current++}},{key:"determineLineHeights",value:function(){for(var e=0;ee&&(e=a.width),t+=a.height}this.width=e,this.height=t}},{key:"removeEmptyBlocks",value:function(){for(var e=[],t=0;t"://,""://,""://,"":/<\/b>/,"":/<\/i>/,"":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/},G1=function(){function i(r){R(this,i),this.text=r,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}return N(i,[{key:"mod",value:function(){return this.modStack.length===0?"normal":this.modStack[0]}},{key:"modName",value:function(){if(this.modStack.length===0)return"normal";if(this.modStack[0]==="mono")return"mono";if(this.bold&&this.ital)return"boldital";if(this.bold)return"bold";if(this.ital)return"ital"}},{key:"emitBlock",value:function(){this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}},{key:"add",value:function(e){e===" "&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1),e!=" "&&(this.buffer+=e)}},{key:"parseWS",value:function(e){return/[ \t]/.test(e)?(this.mono?this.add(e):this.spacing=!0,!0):!1}},{key:"setTag",value:function(e){this.emitBlock(),this[e]=!0,this.modStack.unshift(e)}},{key:"unsetTag",value:function(e){this.emitBlock(),this[e]=!1,this.modStack.shift()}},{key:"parseStartTag",value:function(e,t){return!this.mono&&!this[e]&&this.match(t)?(this.setTag(e),!0):!1}},{key:"match",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this.prepareRegExp(e),a=Se(n,2),o=a[0],s=a[1],u=o.test(this.text.substr(this.position,s));return u&&t&&(this.position+=s-1),u}},{key:"parseEndTag",value:function(e,t,n){var a=this.mod()===e;return e==="mono"?a=a&&this.mono:a=a&&!this.mono,a&&this.match(t)?(n!==void 0?(this.position===this.text.length-1||this.match(n,!1))&&this.unsetTag(e):this.unsetTag(e),!0):!1}},{key:"replace",value:function(e,t){return this.match(e)?(this.add(t),this.position+=length-1,!0):!1}},{key:"prepareRegExp",value:function(e){var t,n;if(e instanceof RegExp)n=e,t=1;else{var a=Lle[e];a!==void 0?n=a:n=new RegExp(e),t=e.length}return[n,t]}}]),i}(),zle=function(){function i(r,e,t,n){var a=this;R(this,i),this.ctx=r,this.parent=e,this.selected=t,this.hover=n;var o=function(u,l){if(u===void 0)return 0;var h=a.parent.getFormattingValues(r,t,n,l),d=0;if(u!==""){var c=a.ctx.measureText(u);d=c.width}return{width:d,values:h}};this.lines=new jle(o)}return N(i,[{key:"process",value:function(e){if(!Ju(e))return this.lines.finalize();var t=this.parent.fontOptions;e=e.replace(/\r\n/g,` `),e=e.replace(/\r/g,` `);var n=String(e).split(` -`),a=n.length;if(t.multi)for(var o=0;o0)for(var u=0;u0)for(var v=0;v")||t.parseStartTag("ital","")||t.parseStartTag("mono","")||t.parseEndTag("bold","")||t.parseEndTag("ital","")||t.parseEndTag("mono",""))||n(a);o||t.add(a),t.position++}return t.emitBlock(),t.blocks}},{key:"splitMarkdownBlocks",value:function(e){for(var t=this,n=new G1(e),a=!0,o=function(h){return/\\/.test(h)?(n.positionthis.parent.fontOptions.maxWdt}},{key:"getLongestFit",value:function(e){for(var t="",n=0;n1&&arguments[1]!==void 0?arguments[1]:"normal",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");for(var a=e.split("\r");a.length>0;){var o=this.getLongestFit(a);if(o===0){var s=a[0],u=this.getLongestFitWord(s);this.lines.newLine(rt(s).call(s,0,u),t),a[0]=rt(s).call(s,u)}else{var l=o;a[o-1]===" "?o--:a[l]===" "&&l++;var h=rt(a).call(a,0,o).join("");o==a.length&&n?this.lines.append(h,t):this.lines.newLine(h,t),a=rt(a).call(a,l)}}}}]),i}(),Ha=["bold","ital","boldital","mono"],TT=function(){function i(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;N(this,i),this.body=r,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(e),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=t}return M(i,[{key:"setOptions",value:function(e){if(this.elementOptions=e,this.initFontOptions(e.font),Ju(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font=="string")this.baseSize=this.fontOptions.size;else if(ce(e.font)==="object"){var t=e.font.size;t!==void 0&&(this.baseSize=t)}}}},{key:"initFontOptions",value:function(e){var t=this;if(te(Ha,function(n){t.fontOptions[n]={}}),i.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}te(e,function(n,a){n!=null&&ce(n)!=="object"&&(t.fontOptions[a]=n)})}},{key:"constrain",value:function(e){var t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},n=Xr(e,"widthConstraint");if(typeof n=="number")t.maxWdt=Number(n),t.minWdt=Number(n);else if(ce(n)==="object"){var a=Xr(e,["widthConstraint","maximum"]);typeof a=="number"&&(t.maxWdt=Number(a));var o=Xr(e,["widthConstraint","minimum"]);typeof o=="number"&&(t.minWdt=Number(o))}var s=Xr(e,"heightConstraint");if(typeof s=="number")t.minHgt=Number(s);else if(ce(s)==="object"){var u=Xr(e,["heightConstraint","minimum"]);typeof u=="number"&&(t.minHgt=Number(u));var l=Xr(e,["heightConstraint","valign"]);typeof l=="string"&&(l==="top"||l==="bottom")&&(t.valign=l)}return t}},{key:"update",value:function(e,t){this.setOptions(e,!0),this.propagateFonts(t),ve(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=cp("label",t)}},{key:"adjustSizes",value:function(e){var t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);var n=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=n)}},{key:"addFontOptionsToPile",value:function(e,t){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:"middle";if(this.elementOptions.label!==void 0){var u=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&u=this.elementOptions.scaling.label.maxVisible&&(u=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,a,o,t,n,s),this._drawBackground(e),this._drawText(e,t,this.size.yLine,s,u))}}},{key:"_drawBackground",value:function(e){if(this.fontOptions.background!==void 0&&this.fontOptions.background!=="none"){e.fillStyle=this.fontOptions.background;var t=this.getSize();e.fillRect(t.left,t.top,t.width,t.height)}}},{key:"_drawText",value:function(e,t,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"middle",o=arguments.length>4?arguments[4]:void 0,s=this._setAlignment(e,t,n,a),u=Se(s,2);t=u[0],n=u[1],e.textAlign="left",t=t-this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign==="top"&&(n-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign==="bottom"&&(n+=(this.size.height-this.size.labelHeight)/2));for(var l=0;l0&&(e.lineWidth=f.strokeWidth,e.strokeStyle=y,e.lineJoin="round"),e.fillStyle=g,f.strokeWidth>0&&e.strokeText(f.text,t+d,n+f.vadjust),e.fillText(f.text,t+d,n+f.vadjust),d+=f.width}n+=h.height}}}},{key:"_setAlignment",value:function(e,t,n,a){if(this.isEdgeLabel&&this.fontOptions.align!=="horizontal"&&this.pointToSelf===!1){t=0,n=0;var o=2;this.fontOptions.align==="top"?(e.textBaseline="alphabetic",n-=2*o):this.fontOptions.align==="bottom"?(e.textBaseline="hanging",n+=2*o):e.textBaseline="middle"}else e.textBaseline=a;return[t,n]}},{key:"_getColor",value:function(e,t,n){var a=e||"#000000",o=n||"#ffffff";if(t<=this.elementOptions.scaling.label.drawThreshold){var s=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-t)));a=Kt(a,s),o=Kt(o,s)}return[a,o]}},{key:"getTextSize",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this._processLabel(e,t,n),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}},{key:"getSize",value:function(){var e=2,t=this.size.left,n=this.size.top-.5*e;if(this.isEdgeLabel){var a=-this.size.width*.5;switch(this.fontOptions.align){case"middle":t=a,n=-this.size.height*.5;break;case"top":t=a,n=-(this.size.height+e);break;case"bottom":t=a,n=e;break}}var o={left:t,top:n,width:this.size.width,height:this.size.height};return o}},{key:"calculateLabelSize",value:function(e,t,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";this._processLabel(e,t,n),this.size.left=a-this.size.width*.5,this.size.top=o-this.size.height*.5,this.size.yLine=o+(1-this.lineCount)*.5*this.fontOptions.size,s==="hanging"&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}},{key:"getFormattingValues",value:function(e,t,n,a){var o=function(h,d,c){return d==="normal"?c==="mod"?"":h[c]:h[d][c]!==void 0?h[d][c]:h[c]},s={color:o(this.fontOptions,a,"color"),size:o(this.fontOptions,a,"size"),face:o(this.fontOptions,a,"face"),mod:o(this.fontOptions,a,"mod"),vadjust:o(this.fontOptions,a,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(t||n)&&(a==="normal"&&this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?s.mod="bold":typeof this.fontOptions.chooser=="function"&&this.fontOptions.chooser(s,this.elementOptions.id,t,n));var u="";return s.mod!==void 0&&s.mod!==""&&(u+=s.mod+" "),u+=s.size+"px "+s.face,e.font=u.replace(/"/g,""),s.font=e.font,s.height=s.size,s}},{key:"differentState",value:function(e,t){return e!==this.selectedState||t!==this.hoverState}},{key:"_processLabelText",value:function(e,t,n,a){var o=new zle(e,this,t,n);return o.process(a)}},{key:"_processLabel",value:function(e,t,n){if(!(this.labelDirty===!1&&!this.differentState(t,n))){var a=this._processLabelText(e,t,n,this.elementOptions.label);this.fontOptions.minWdt>0&&a.width0&&a.height0&&(this.enableBorderDashes(e,t),e.stroke(),this.disableBorderDashes(e,t)),e.restore()}},{key:"performFill",value:function(e,t){e.save(),e.fillStyle=t.color,this.enableShadow(e,t),ls(e).call(e),this.disableShadow(e,t),e.restore(),this.performStroke(e,t)}},{key:"_addBoundingBoxMargin",value:function(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}},{key:"_updateBoundingBox",value:function(e,t,n,a,o){n!==void 0&&this.resize(n,a,o),this.left=e-this.width/2,this.top=t-this.height/2,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}},{key:"updateBoundingBox",value:function(e,t,n,a,o){this._updateBoundingBox(e,t,n,a,o)}},{key:"getDimensionsFromLabel",value:function(e,t,n){this.textSize=this.labelModule.getTextSize(e,t,n);var a=this.textSize.width,o=this.textSize.height,s=14;return a===0&&(a=s,o=s),{width:a,height:o}}}]),i}();function Ahe(i){var r=Dhe();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function Dhe(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var Rhe=function(i){se(e,i);var r=Ahe(e);function e(t,n,a){var o;return N(this,e),o=r.call(this,t,n,a),o._setMargins(a),o}return M(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(a,o)){var s=this.getDimensionsFromLabel(n,a,o);this.width=s.width+this.margin.right+this.margin.left,this.height=s.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}},{key:"draw",value:function(n,a,o,s,u,l){this.resize(n,s,u),this.left=a-this.width/2,this.top=o-this.height/2,this.initContextForDraw(n,l),GE(n,this.left,this.top,this.width,this.height,l.borderRadius),this.performFill(n,l),this.updateBoundingBox(a,o,n,s,u),this.labelModule.draw(n,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,s,u)}},{key:"updateBoundingBox",value:function(n,a,o,s,u){this._updateBoundingBox(n,a,o,s,u);var l=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(l)}},{key:"distanceToBorder",value:function(n,a){n&&this.resize(n);var o=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(a)),Math.abs(this.height/2/Math.sin(a)))+o}}]),e}(cn);function Nhe(i){var r=Mhe();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function Mhe(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var vp=function(i){se(e,i);var r=Nhe(e);function e(t,n,a){var o;return N(this,e),o=r.call(this,t,n,a),o.labelOffset=0,o.selected=!1,o}return M(e,[{key:"setOptions",value:function(n,a,o){this.options=n,a===void 0&&o===void 0||this.setImages(a,o)}},{key:"setImages",value:function(n,a){a&&this.selected?(this.imageObj=a,this.imageObjAlt=n):(this.imageObj=n,this.imageObjAlt=a)}},{key:"switchImages",value:function(n){var a=n&&!this.selected||!n&&this.selected;if(this.selected=n,this.imageObjAlt!==void 0&&a){var o=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=o}}},{key:"_getImagePadding",value:function(){var n={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){var a=this.options.imagePadding;ce(a)=="object"?(n.top=a.top,n.right=a.right,n.bottom=a.bottom,n.left=a.left):(n.top=a,n.right=a,n.bottom=a,n.left=a)}return n}},{key:"_resizeImage",value:function(){var n,a;if(this.options.shapeProperties.useImageSize===!1){var o=1,s=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?o=this.imageObj.width/this.imageObj.height:s=this.imageObj.height/this.imageObj.width),n=this.options.size*2*o,a=this.options.size*2*s}else{var u=this._getImagePadding();n=this.imageObj.width+u.left+u.right,a=this.imageObj.height+u.top+u.bottom}this.width=n,this.height=a,this.radius=.5*this.width}},{key:"_drawRawCircle",value:function(n,a,o,s){this.initContextForDraw(n,s),Cv(n,a,o,s.size),this.performFill(n,s)}},{key:"_drawImageAtPosition",value:function(n,a){if(this.imageObj.width!=0){n.globalAlpha=a.opacity!==void 0?a.opacity:1,this.enableShadow(n,a);var o=1;this.options.shapeProperties.interpolation===!0&&(o=this.imageObj.width/this.width/this.body.view.scale);var s=this._getImagePadding(),u=this.left+s.left,l=this.top+s.top,h=this.width-s.left-s.right,d=this.height-s.top-s.bottom;this.imageObj.drawImageAtPosition(n,o,u,l,h,d),this.disableShadow(n,a)}}},{key:"_drawImageLabel",value:function(n,a,o,s,u){var l=0;if(this.height!==void 0){l=this.height*.5;var h=this.labelModule.getTextSize(n,s,u);h.lineCount>=1&&(l+=h.height/2)}var d=o+l;this.options.label&&(this.labelOffset=l),this.labelModule.draw(n,a,d,s,u,"hanging")}}]),e}(cn);function Bhe(i){var r=Fhe();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function Fhe(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var jhe=function(i){se(e,i);var r=Bhe(e);function e(t,n,a){var o;return N(this,e),o=r.call(this,t,n,a),o._setMargins(a),o}return M(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(a,o)){var s=this.getDimensionsFromLabel(n,a,o),u=Math.max(s.width+this.margin.right+this.margin.left,s.height+this.margin.top+this.margin.bottom);this.options.size=u/2,this.width=u,this.height=u,this.radius=this.width/2}}},{key:"draw",value:function(n,a,o,s,u,l){this.resize(n,s,u),this.left=a-this.width/2,this.top=o-this.height/2,this._drawRawCircle(n,a,o,l),this.updateBoundingBox(a,o),this.labelModule.draw(n,this.left+this.textSize.width/2+this.margin.left,o,s,u)}},{key:"updateBoundingBox",value:function(n,a){this.boundingBox.top=a-this.options.size,this.boundingBox.left=n-this.options.size,this.boundingBox.right=n+this.options.size,this.boundingBox.bottom=a+this.options.size}},{key:"distanceToBorder",value:function(n){return n&&this.resize(n),this.width*.5}}]),e}(vp);function Lhe(i){var r=zhe();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function zhe(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var Hhe=function(i){se(e,i);var r=Lhe(e);function e(t,n,a,o,s){var u;return N(this,e),u=r.call(this,t,n,a),u.setImages(o,s),u}return M(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,s=this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0;if(s){var u=this.options.size*2;this.width=u,this.height=u,this.radius=.5*this.width;return}this.needsRefresh(a,o)&&this._resizeImage()}},{key:"draw",value:function(n,a,o,s,u,l){this.switchImages(s),this.resize();var h=a,d=o;this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=a,this.top=o,h+=this.width/2,d+=this.height/2):(this.left=a-this.width/2,this.top=o-this.height/2),this._drawRawCircle(n,h,d,l),n.save(),n.clip(),this._drawImageAtPosition(n,l),n.restore(),this._drawImageLabel(n,h,d,s,u),this.updateBoundingBox(a,o)}},{key:"updateBoundingBox",value:function(n,a){this.options.shapeProperties.coordinateOrigin==="top-left"?(this.boundingBox.top=a,this.boundingBox.left=n,this.boundingBox.right=n+this.options.size*2,this.boundingBox.bottom=a+this.options.size*2):(this.boundingBox.top=a-this.options.size,this.boundingBox.left=n-this.options.size,this.boundingBox.right=n+this.options.size,this.boundingBox.bottom=a+this.options.size),this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}},{key:"distanceToBorder",value:function(n){return n&&this.resize(n),this.width*.5}}]),e}(vp);function Whe(i){var r=Vhe();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function Vhe(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var $i=function(i){se(e,i);var r=Whe(e);function e(t,n,a){return N(this,e),r.call(this,t,n,a)}return M(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(a,o)){var u,l;this.labelModule.getTextSize(n,a,o);var h=2*s.size;this.width=(u=this.customSizeWidth)!==null&&u!==void 0?u:h,this.height=(l=this.customSizeHeight)!==null&&l!==void 0?l:h,this.radius=.5*this.width}}},{key:"_drawShape",value:function(n,a,o,s,u,l,h,d){var c=this;return this.resize(n,l,h,d),this.left=s-this.width/2,this.top=u-this.height/2,this.initContextForDraw(n,d),OK(a)(n,s,u,d.size),this.performFill(n,d),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(n.font=(l?"bold ":"")+this.height/2+"px "+(this.options.icon.face||"FontAwesome"),n.fillStyle=this.options.icon.color||"black",n.textAlign="center",n.textBaseline="middle",n.fillText(this.options.icon.code,s,u)),{drawExternalLabel:function(){if(c.options.label!==void 0){c.labelModule.calculateLabelSize(n,l,h,s,u,"hanging");var v=u+.5*c.height+.5*c.labelModule.size.height;c.labelModule.draw(n,s,v,l,h,"hanging")}c.updateBoundingBox(s,u)}}}},{key:"updateBoundingBox",value:function(n,a){this.boundingBox.top=a-this.options.size,this.boundingBox.left=n-this.options.size,this.boundingBox.right=n+this.options.size,this.boundingBox.bottom=a+this.options.size,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}}]),e}(cn);function Z1(i,r){var e=Ee(i);if(ci){var t=ci(i);r&&(t=Ot(t).call(t,function(n){return bi(i,n).enumerable})),e.push.apply(e,t)}return e}function Uhe(i){for(var r=1;r"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var qhe=function(i){se(e,i);var r=Khe(e);function e(t,n,a,o){var s;return N(this,e),s=r.call(this,t,n,a,o),s.ctxRenderer=o,s}return M(e,[{key:"draw",value:function(n,a,o,s,u,l){this.resize(n,s,u,l),this.left=a-this.width/2,this.top=o-this.height/2,n.save();var h=this.ctxRenderer({ctx:n,id:this.options.id,x:a,y:o,state:{selected:s,hover:u},style:Uhe({},l),label:this.options.label});if(h.drawNode!=null&&h.drawNode(),n.restore(),h.drawExternalLabel){var d=h.drawExternalLabel;h.drawExternalLabel=function(){n.save(),d(),n.restore()}}return h.nodeDimensions&&(this.customSizeWidth=h.nodeDimensions.width,this.customSizeHeight=h.nodeDimensions.height),h}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}($i);function Yhe(i){var r=Xhe();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function Xhe(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var Jhe=function(i){se(e,i);var r=Yhe(e);function e(t,n,a){var o;return N(this,e),o=r.call(this,t,n,a),o._setMargins(a),o}return M(e,[{key:"resize",value:function(n,a,o){if(this.needsRefresh(a,o)){var s=this.getDimensionsFromLabel(n,a,o),u=s.width+this.margin.right+this.margin.left;this.width=u,this.height=u,this.radius=this.width/2}}},{key:"draw",value:function(n,a,o,s,u,l){this.resize(n,s,u),this.left=a-this.width/2,this.top=o-this.height/2,this.initContextForDraw(n,l),qE(n,a-this.width/2,o-this.height/2,this.width,this.height),this.performFill(n,l),this.updateBoundingBox(a,o,n,s,u),this.labelModule.draw(n,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,s,u)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(cn);function Zhe(i){var r=Qhe();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function Qhe(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var ece=function(i){se(e,i);var r=Zhe(e);function e(t,n,a){return N(this,e),r.call(this,t,n,a)}return M(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"diamond",4,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}($i);function tce(i){var r=rce();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function rce(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var ice=function(i){se(e,i);var r=tce(e);function e(t,n,a){return N(this,e),r.call(this,t,n,a)}return M(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"circle",2,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n){return n&&this.resize(n),this.options.size}}]),e}($i);function nce(i){var r=ace();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function ace(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var Q1=function(i){se(e,i);var r=nce(e);function e(t,n,a){return N(this,e),r.call(this,t,n,a)}return M(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(a,o)){var s=this.getDimensionsFromLabel(n,a,o);this.height=s.height*2,this.width=s.width+s.height,this.radius=.5*this.width}}},{key:"draw",value:function(n,a,o,s,u,l){this.resize(n,s,u),this.left=a-this.width*.5,this.top=o-this.height*.5,this.initContextForDraw(n,l),of(n,this.left,this.top,this.width,this.height),this.performFill(n,l),this.updateBoundingBox(a,o,n,s,u),this.labelModule.draw(n,a,o,s,u)}},{key:"distanceToBorder",value:function(n,a){n&&this.resize(n);var o=this.width*.5,s=this.height*.5,u=Math.sin(a)*o,l=Math.cos(a)*s;return o*s/Math.sqrt(u*u+l*l)}}]),e}(cn);function oce(i){var r=sce();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function sce(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var uce=function(i){se(e,i);var r=oce(e);function e(t,n,a){var o;return N(this,e),o=r.call(this,t,n,a),o._setMargins(a),o}return M(e,[{key:"resize",value:function(n,a,o){this.needsRefresh(a,o)&&(this.iconSize={width:Number(this.options.icon.size),height:Number(this.options.icon.size)},this.width=this.iconSize.width+this.margin.right+this.margin.left,this.height=this.iconSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}},{key:"draw",value:function(n,a,o,s,u,l){var h=this;return this.resize(n,s,u),this.options.icon.size=this.options.icon.size||50,this.left=a-this.width/2,this.top=o-this.height/2,this._icon(n,a,o,s,u,l),{drawExternalLabel:function(){if(h.options.label!==void 0){var c=5;h.labelModule.draw(n,h.left+h.iconSize.width/2+h.margin.left,o+h.height/2+c,s)}h.updateBoundingBox(a,o)}}}},{key:"updateBoundingBox",value:function(n,a){if(this.boundingBox.top=a-this.options.icon.size*.5,this.boundingBox.left=n-this.options.icon.size*.5,this.boundingBox.right=n+this.options.icon.size*.5,this.boundingBox.bottom=a+this.options.icon.size*.5,this.options.label!==void 0&&this.labelModule.size.width>0){var o=5;this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+o)}}},{key:"_icon",value:function(n,a,o,s,u,l){var h=Number(this.options.icon.size);this.options.icon.code!==void 0?(n.font=[this.options.icon.weight!=null?this.options.icon.weight:s?"bold":"",(this.options.icon.weight!=null&&s?5:0)+h+"px",this.options.icon.face].join(" "),n.fillStyle=this.options.icon.color||"black",n.textAlign="center",n.textBaseline="middle",this.enableShadow(n,l),n.fillText(this.options.icon.code,a,o),this.disableShadow(n,l)):console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.")}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(cn);function lce(i){var r=hce();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function hce(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var cce=function(i){se(e,i);var r=lce(e);function e(t,n,a,o,s){var u;return N(this,e),u=r.call(this,t,n,a),u.setImages(o,s),u}return M(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,s=this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0;if(s){var u=this.options.size*2;this.width=u,this.height=u;return}this.needsRefresh(a,o)&&this._resizeImage()}},{key:"draw",value:function(n,a,o,s,u,l){n.save(),this.switchImages(s),this.resize();var h=a,d=o;if(this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=a,this.top=o,h+=this.width/2,d+=this.height/2):(this.left=a-this.width/2,this.top=o-this.height/2),this.options.shapeProperties.useBorderWithImage===!0){var c=this.options.borderWidth,f=this.options.borderWidthSelected||2*this.options.borderWidth,v=(s?f:c)/this.body.view.scale;n.lineWidth=Math.min(this.width,v),n.beginPath();var p=s?this.options.color.highlight.border:u?this.options.color.hover.border:this.options.color.border,g=s?this.options.color.highlight.background:u?this.options.color.hover.background:this.options.color.background;l.opacity!==void 0&&(p=Kt(p,l.opacity),g=Kt(g,l.opacity)),n.strokeStyle=p,n.fillStyle=g,n.rect(this.left-.5*n.lineWidth,this.top-.5*n.lineWidth,this.width+n.lineWidth,this.height+n.lineWidth),ls(n).call(n),this.performStroke(n,l),n.closePath()}this._drawImageAtPosition(n,l),this._drawImageLabel(n,h,d,s,u),this.updateBoundingBox(a,o),n.restore()}},{key:"updateBoundingBox",value:function(n,a){this.resize(),this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=n,this.top=a):(this.left=n-this.width/2,this.top=a-this.height/2),this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(vp);function dce(i){var r=fce();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function fce(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var vce=function(i){se(e,i);var r=dce(e);function e(t,n,a){return N(this,e),r.call(this,t,n,a)}return M(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"square",2,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}($i);function pce(i){var r=gce();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function gce(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var yce=function(i){se(e,i);var r=pce(e);function e(t,n,a){return N(this,e),r.call(this,t,n,a)}return M(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"hexagon",4,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}($i);function mce(i){var r=bce();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function bce(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var $ce=function(i){se(e,i);var r=mce(e);function e(t,n,a){return N(this,e),r.call(this,t,n,a)}return M(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"star",4,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}($i);function wce(i){var r=_ce();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function _ce(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var Ece=function(i){se(e,i);var r=wce(e);function e(t,n,a){var o;return N(this,e),o=r.call(this,t,n,a),o._setMargins(a),o}return M(e,[{key:"resize",value:function(n,a,o){this.needsRefresh(a,o)&&(this.textSize=this.labelModule.getTextSize(n,a,o),this.width=this.textSize.width+this.margin.right+this.margin.left,this.height=this.textSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}},{key:"draw",value:function(n,a,o,s,u,l){this.resize(n,s,u),this.left=a-this.width/2,this.top=o-this.height/2,this.enableShadow(n,l),this.labelModule.draw(n,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,s,u),this.disableShadow(n,l),this.updateBoundingBox(a,o,n,s,u)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(cn);function Sce(i){var r=Oce();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function Oce(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var Tce=function(i){se(e,i);var r=Sce(e);function e(t,n,a){return N(this,e),r.call(this,t,n,a)}return M(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"triangle",3,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}($i);function Ice(i){var r=kce();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function kce(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var Pce=function(i){se(e,i);var r=Ice(e);function e(t,n,a){return N(this,e),r.call(this,t,n,a)}return M(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"triangleDown",3,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}($i);function e$(i,r){var e=Ee(i);if(ci){var t=ci(i);r&&(t=Ot(t).call(t,function(n){return bi(i,n).enumerable})),e.push.apply(e,t)}return e}function t$(i){for(var r=1;re.left&&this.shape.tope.top}},{key:"isBoundingBoxOverlappingWith",value:function(e){return this.shape.boundingBox.lefte.left&&this.shape.boundingBox.tope.top}}],[{key:"checkOpacity",value:function(e){return 0<=e&&e<=1}},{key:"checkCoordinateOrigin",value:function(e){return e===void 0||e==="center"||e==="top-left"}},{key:"updateGroupOptions",value:function(e,t,n){var a;if(n!==void 0){var o=e.group;if(t!==void 0&&t.group!==void 0&&o!==t.group)throw new Error("updateGroupOptions: group values in options don't match.");var s=typeof o=="number"||typeof o=="string"&&o!="";if(s){var u=n.get(o);u.opacity!==void 0&&t.opacity===void 0&&(i.checkOpacity(u.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+u.opacity),u.opacity=void 0));var l=Ot(a=Ile(t)).call(a,function(h){return t[h]!=null});l.push("font"),qu(l,e,u),e.color=Tf(e.color)}}}},{key:"parseOptions",value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=arguments.length>4?arguments[4]:void 0,s=["color","fixed","shadow"];if(qu(s,e,t,n),i.checkMass(t),e.opacity!==void 0&&(i.checkOpacity(e.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity),e.opacity=void 0)),t.opacity!==void 0&&(i.checkOpacity(t.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+t.opacity),t.opacity=void 0)),t.shapeProperties&&!i.checkCoordinateOrigin(t.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+t.shapeProperties.coordinateOrigin),Ut(e,t,"shadow",a),t.color!==void 0&&t.color!==null){var u=Tf(t.color);XO(e.color,u)}else n===!0&&t.color===null&&(e.color=ui(a.color));t.fixed!==void 0&&t.fixed!==null&&(typeof t.fixed=="boolean"?(e.fixed.x=t.fixed,e.fixed.y=t.fixed):(t.fixed.x!==void 0&&typeof t.fixed.x=="boolean"&&(e.fixed.x=t.fixed.x),t.fixed.y!==void 0&&typeof t.fixed.y=="boolean"&&(e.fixed.y=t.fixed.y))),n===!0&&t.font===null&&(e.font=ui(a.font)),i.updateGroupOptions(e,t,o),t.scaling!==void 0&&Ut(e.scaling,t.scaling,"label",a.scaling)}},{key:"checkMass",value:function(e,t){if(e.mass!==void 0&&e.mass<=0){var n="";t!==void 0&&(n=" in node id: "+t),console.error("%cNegative or zero mass disallowed"+n+", setting mass to 1.",eT),e.mass=1}}}]),i}();function xce(i,r){var e=typeof mi<"u"&&un(i)||i["@@iterator"];if(!e){if(le(i)||(e=Cce(i))||r){e&&(i=e);var t=0,n=function(){};return{s:n,n:function(){return t>=i.length?{done:!0}:{done:!1,value:i[t++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(i)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Cce(i,r){var e;if(i){if(typeof i=="string")return r$(i,r);var t=rt(e=Object.prototype.toString.call(i)).call(e,8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return sn(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return r$(i,r)}}function r$(i,r){(r==null||r>i.length)&&(r=i.length);for(var e=0,t=new Array(r);e1?console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity):this.options.opacity=e.opacity),e.shape!==void 0)for(var t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].updateShape();if(typeof e.font<"u"||typeof e.widthConstraint<"u"||typeof e.heightConstraint<"u")for(var n=0,a=Ee(this.body.nodes);n1&&arguments[1]!==void 0?arguments[1]:!1,n=this.body.data.nodes;if(TE("id",e))this.body.data.nodes=e;else if(le(e))this.body.data.nodes=new ju,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new ju;else throw new TypeError("Array or DataSet expected");if(n&&te(this.nodesListeners,function(s,u){n.off(u,s)}),this.body.nodes={},this.body.data.nodes){var a=this;te(this.nodesListeners,function(s,u){a.body.data.nodes.on(u,s)});var o=this.body.data.nodes.getIds();this.add(o,!0)}t===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n,a=[],o=0;o1&&arguments[1]!==void 0?arguments[1]:Nt;return new t(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}},{key:"refresh",value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;te(this.body.nodes,function(n,a){var o=e.body.data.nodes.get(a);o!==void 0&&(t===!0&&n.setOptions({x:null,y:null}),n.setOptions({fixed:!1}),n.setOptions(o))})}},{key:"getPositions",value:function(e){var t={};if(e!==void 0){if(le(e)===!0){for(var n=0;n0?(u=s/o,t+=u*u):t+=s;return o===1/0?1/0:o*ade(t)}});var sde=ae,ude=sde.Math.hypot,lde=ude,hde=lde,cde=hde,dde=W(cde);function CT(i){var r=fde();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function fde(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var Ae=function(){function i(){N(this,i)}return M(i,null,[{key:"transform",value:function(e,t){le(e)||(e=[e]);for(var n=t.point.x,a=t.point.y,o=t.angle,s=t.length,u=0;u4&&arguments[4]!==void 0?arguments[4]:this.getViaNode();e.strokeStyle=this.getColor(e,t),e.lineWidth=t.width,t.dashes!==!1?this._drawDashedLine(e,t,o):this._drawLine(e,t,o)}},{key:"_drawLine",value:function(e,t,n,a,o){if(this.from!=this.to)this._line(e,t,n,a,o);else{var s=this._getCircleData(e),u=Se(s,3),l=u[0],h=u[1],d=u[2];this._circle(e,t,l,h,d)}}},{key:"_drawDashedLine",value:function(e,t,n,a,o){e.lineCap="round";var s=le(t.dashes)?t.dashes:[5,5];if(e.setLineDash!==void 0){if(e.save(),e.setLineDash(s),e.lineDashOffset=0,this.from!=this.to)this._line(e,t,n);else{var u=this._getCircleData(e),l=Se(u,3),h=l[0],d=l[1],c=l[2];this._circle(e,t,h,d,c)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)YE(e,this.from.x,this.from.y,this.to.x,this.to.y,s);else{var f=this._getCircleData(e),v=Se(f,3),p=v[0],g=v[1],y=v[2];this._circle(e,t,p,g,y)}this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}}},{key:"findBorderPosition",value:function(e,t,n){return this.from!=this.to?this._findBorderPosition(e,t,n):this._findBorderPositionCircle(e,t,n)}},{key:"findBorderPositions",value:function(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};var t,n=rt(t=this._getCircleData(e)).call(t,0,2),a=Se(n,2),o=a[0],s=a[1];return{from:this._findBorderPositionCircle(this.from,e,{x:o,y:s,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:o,y:s,low:.6,high:.8,direction:1})}}},{key:"_getCircleData",value:function(e){var t=this.options.selfReference.size;e!==void 0&&this.from.shape.width===void 0&&this.from.shape.resize(e);var n=ST(e,this.options.selfReference.angle,t,this.from);return[n.x,n.y,t]}},{key:"_pointOnCircle",value:function(e,t,n,a){var o=a*2*Math.PI;return{x:e+n*Math.cos(o),y:t-n*Math.sin(o)}}},{key:"_findBorderPositionCircle",value:function(e,t,n){var a=n.x,o=n.y,s=n.low,u=n.high,l=n.direction,h=10,d=this.options.selfReference.size,c=.05,f,v=(s+u)*.5,p=0;this.options.arrowStrikethrough===!0&&(l===-1?p=this.options.endPointOffset.from:l===1&&(p=this.options.endPointOffset.to));var g=0;do{v=(s+u)*.5,f=this._pointOnCircle(a,o,d,v);var y=Math.atan2(e.y-f.y,e.x-f.x),m=e.distanceToBorder(t,y)+p,b=Math.sqrt(Math.pow(f.x-e.x,2)+Math.pow(f.y-e.y,2)),$=m-b;if(Math.abs($)0?l>0?s=v:u=v:l>0?u=v:s=v,++g}while(s<=u&&g1?d=1:d<0&&(d=0);var c=e+d*u,f=t+d*l,v=c-o,p=f-s;return Math.sqrt(v*v+p*p)}},{key:"getArrowData",value:function(e,t,n,a,o,s){var u,l,h,d,c,f,v,p=s.width;t==="from"?(h=this.from,d=this.to,c=s.fromArrowScale<0,f=Math.abs(s.fromArrowScale),v=s.fromArrowType):t==="to"?(h=this.to,d=this.from,c=s.toArrowScale<0,f=Math.abs(s.toArrowScale),v=s.toArrowType):(h=this.to,d=this.from,c=s.middleArrowScale<0,f=Math.abs(s.middleArrowScale),v=s.middleArrowType);var g=15*f+3*p;if(h!=d){var y=dde(h.x-d.x,h.y-d.y),m=g/y;if(t!=="middle")if(this.options.smooth.enabled===!0){var b=this._findBorderPosition(h,e,{via:n}),$=this.getPoint(b.t+m*(t==="from"?1:-1),n);u=Math.atan2(b.y-$.y,b.x-$.x),l=b}else u=Math.atan2(h.y-d.y,h.x-d.x),l=this._findBorderPosition(h,e);else{var S=(c?-m:m)/2,_=this.getPoint(.5+S,n),R=this.getPoint(.5-S,n);u=Math.atan2(_.y-R.y,_.x-R.x),l=this.getPoint(.5,n)}}else{var B=this._getCircleData(e),I=Se(B,3),C=I[0],j=I[1],X=I[2];if(t==="from"){var U=this.options.selfReference.angle,$e=this.options.selfReference.angle+Math.PI,Qe=this._findBorderPositionCircle(this.from,e,{x:C,y:j,low:U,high:$e,direction:-1});u=Qe.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI,l=Qe}else if(t==="to"){var Ne=this.options.selfReference.angle,At=this.options.selfReference.angle+Math.PI,lt=this._findBorderPositionCircle(this.from,e,{x:C,y:j,low:Ne,high:At,direction:1});u=lt.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI,l=lt}else{var nt=this.options.selfReference.angle/(2*Math.PI);l=this._pointOnCircle(C,j,X,nt),u=nt*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}var Dt=l.x-g*.9*Math.cos(u),at=l.y-g*.9*Math.sin(u),ge={x:Dt,y:at};return{point:l,core:ge,angle:u,length:g,type:v}}},{key:"drawArrowHead",value:function(e,t,n,a,o){e.strokeStyle=this.getColor(e,t),e.fillStyle=e.strokeStyle,e.lineWidth=t.width;var s=AT.draw(e,o);s&&(this.enableShadow(e,t),ls(e).call(e),this.disableShadow(e,t))}},{key:"enableShadow",value:function(e,t){t.shadow===!0&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}},{key:"disableShadow",value:function(e,t){t.shadow===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}},{key:"drawBackground",value:function(e,t){if(t.background!==!1){var n={strokeStyle:e.strokeStyle,lineWidth:e.lineWidth,dashes:e.dashes};e.strokeStyle=t.backgroundColor,e.lineWidth=t.backgroundSize,this.setStrokeDashed(e,t.backgroundDashes),e.stroke(),e.strokeStyle=n.strokeStyle,e.lineWidth=n.lineWidth,e.dashes=n.dashes,this.setStrokeDashed(e,t.dashes)}}},{key:"setStrokeDashed",value:function(e,t){if(t!==!1)if(e.setLineDash!==void 0){var n=le(t)?t:[5,5];e.setLineDash(n)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else e.setLineDash!==void 0?e.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}}]),i}();function u$(i,r){var e=Ee(i);if(ci){var t=ci(i);r&&(t=Ot(t).call(t,function(n){return bi(i,n).enumerable})),e.push.apply(e,t)}return e}function l$(i){for(var r=1;r"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var pp=function(i){se(e,i);var r=Tde(e);function e(t,n,a){return N(this,e),r.call(this,t,n,a)}return M(e,[{key:"_findBorderPositionBezier",value:function(n,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates(),s=10,u=.2,l=!1,h=1,d=0,c=this.to,f,v,p=this.options.endPointOffset?this.options.endPointOffset.to:0;n.id===this.from.id&&(c=this.from,l=!0,p=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(p=0);var g=0;do{v=(d+h)*.5,f=this.getPoint(v,o);var y=Math.atan2(c.y-f.y,c.x-f.x),m=c.distanceToBorder(a,y)+p,b=Math.sqrt(Math.pow(f.x-c.x,2)+Math.pow(f.y-c.y,2)),$=m-b;if(Math.abs($)0&&(c=this._getDistanceToLine(y,m,p,g,u,l),d=c"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var h$=function(i){se(e,i);var r=kde(e);function e(t,n,a){var o;return N(this,e),o=r.call(this,t,n,a),o.via=o.via,o._boundFunction=function(){o.positionBezierNode()},o._body.emitter.on("_repositionBezierNodes",o._boundFunction),o}return M(e,[{key:"setOptions",value:function(n){wu(L(e.prototype),"setOptions",this).call(this,n);var a=!1;this.options.physics!==n.physics&&(a=!0),this.options=n,this.id=this.options.id,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.setupSupportNode(),this.connect(),a===!0&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}},{key:"connect",value:function(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.from===void 0||this.to===void 0||this.options.physics===!1?this.via.setOptions({physics:!1}):this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}},{key:"cleanup",value:function(){return this._body.emitter.off("_repositionBezierNodes",this._boundFunction),this.via!==void 0?(delete this._body.nodes[this.via.id],this.via=void 0,!0):!1}},{key:"setupSupportNode",value:function(){if(this.via===void 0){var n="edgeId:"+this.id,a=this._body.functions.createNode({id:n,shape:"circle",physics:!0,hidden:!0});this._body.nodes[n]=a,this.via=a,this.via.parentEdgeId=this.id,this.positionBezierNode()}}},{key:"positionBezierNode",value:function(){this.via!==void 0&&this.from!==void 0&&this.to!==void 0?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):this.via!==void 0&&(this.via.x=0,this.via.y=0)}},{key:"_line",value:function(n,a,o){this._bezierCurve(n,a,o)}},{key:"_getViaCoordinates",value:function(){return this.via}},{key:"getViaNode",value:function(){return this.via}},{key:"getPoint",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.via;if(this.from===this.to){var o=this._getCircleData(),s=Se(o,3),u=s[0],l=s[1],h=s[2],d=2*Math.PI*(1-n);return{x:u+h*Math.sin(d),y:l+h-h*(1-Math.cos(d))}}else return{x:Math.pow(1-n,2)*this.fromPoint.x+2*n*(1-n)*a.x+Math.pow(n,2)*this.toPoint.x,y:Math.pow(1-n,2)*this.fromPoint.y+2*n*(1-n)*a.y+Math.pow(n,2)*this.toPoint.y}}},{key:"_findBorderPosition",value:function(n,a){return this._findBorderPositionBezier(n,a,this.via)}},{key:"_getDistanceToEdge",value:function(n,a,o,s,u,l){return this._getDistanceToBezierEdge(n,a,o,s,u,l,this.via)}}]),e}(pp);function xde(i){var r=Cde();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function Cde(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var c$=function(i){se(e,i);var r=xde(e);function e(t,n,a){return N(this,e),r.call(this,t,n,a)}return M(e,[{key:"_line",value:function(n,a,o){this._bezierCurve(n,a,o)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_getViaCoordinates",value:function(){var n=this.options.smooth.roundness,a=this.options.smooth.type,o=Math.abs(this.from.x-this.to.x),s=Math.abs(this.from.y-this.to.y);if(a==="discrete"||a==="diagonalCross"){var u,l;o<=s?u=l=n*s:u=l=n*o,this.from.x>this.to.x&&(u=-u),this.from.y>=this.to.y&&(l=-l);var h=this.from.x+u,d=this.from.y+l;return a==="discrete"&&(o<=s?h=othis.to.x&&(B=-B),this.from.y>=this.to.y&&(I=-I);var C=this.from.x+B,j=this.from.y+I;return o<=s?this.from.x<=this.to.x?C=this.to.xC?this.to.x:C:this.from.y>=this.to.y?j=this.to.y>j?this.to.y:j:j=this.to.y2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(n,a,o.via)}},{key:"_getDistanceToEdge",value:function(n,a,o,s,u,l){var h=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(n,a,o,s,u,l,h)}},{key:"getPoint",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),o=n,s=Math.pow(1-o,2)*this.fromPoint.x+2*o*(1-o)*a.x+Math.pow(o,2)*this.toPoint.x,u=Math.pow(1-o,2)*this.fromPoint.y+2*o*(1-o)*a.y+Math.pow(o,2)*this.toPoint.y;return{x:s,y:u}}}]),e}(pp);function Ade(i){var r=Dde();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function Dde(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var Rde=function(i){se(e,i);var r=Ade(e);function e(t,n,a){return N(this,e),r.call(this,t,n,a)}return M(e,[{key:"_getDistanceToBezierEdge2",value:function(n,a,o,s,u,l,h,d){for(var c=1e9,f=n,v=a,p=[0,0,0,0],g=1;g<10;g++){var y=.1*g;p[0]=Math.pow(1-y,3),p[1]=3*y*Math.pow(1-y,2),p[2]=3*Math.pow(y,2)*(1-y),p[3]=Math.pow(y,3);var m=p[0]*n+p[1]*h.x+p[2]*d.x+p[3]*o,b=p[0]*a+p[1]*h.y+p[2]*d.y+p[3]*s;if(g>0){var $=this._getDistanceToLine(f,v,m,b,u,l);c=$"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var d$=function(i){se(e,i);var r=Nde(e);function e(t,n,a){return N(this,e),r.call(this,t,n,a)}return M(e,[{key:"_line",value:function(n,a,o){var s=o[0],u=o[1];this._bezierCurve(n,a,s,u)}},{key:"_getViaCoordinates",value:function(){var n=this.from.x-this.to.x,a=this.from.y-this.to.y,o,s,u,l,h=this.options.smooth.roundness;return(Math.abs(n)>Math.abs(a)||this.options.smooth.forceDirection===!0||this.options.smooth.forceDirection==="horizontal")&&this.options.smooth.forceDirection!=="vertical"?(s=this.from.y,l=this.to.y,o=this.from.x-h*n,u=this.to.x+h*n):(s=this.from.y-h*a,l=this.to.y+h*a,o=this.from.x,u=this.to.x),[{x:o,y:s},{x:u,y:l}]}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_findBorderPosition",value:function(n,a){return this._findBorderPositionBezier(n,a)}},{key:"_getDistanceToEdge",value:function(n,a,o,s,u,l){var h=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates(),d=Se(h,2),c=d[0],f=d[1];return this._getDistanceToBezierEdge2(n,a,o,s,u,l,c,f)}},{key:"getPoint",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),o=Se(a,2),s=o[0],u=o[1],l=n,h=[Math.pow(1-l,3),3*l*Math.pow(1-l,2),3*Math.pow(l,2)*(1-l),Math.pow(l,3)],d=h[0]*this.fromPoint.x+h[1]*s.x+h[2]*u.x+h[3]*this.toPoint.x,c=h[0]*this.fromPoint.y+h[1]*s.y+h[2]*u.y+h[3]*this.toPoint.y;return{x:d,y:c}}}]),e}(Rde);function Bde(i){var r=Fde();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function Fde(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var f$=function(i){se(e,i);var r=Bde(e);function e(t,n,a){return N(this,e),r.call(this,t,n,a)}return M(e,[{key:"_line",value:function(n,a){n.beginPath(),n.moveTo(this.fromPoint.x,this.fromPoint.y),n.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(n,a),n.stroke(),this.disableShadow(n,a)}},{key:"getViaNode",value:function(){}},{key:"getPoint",value:function(n){return{x:(1-n)*this.fromPoint.x+n*this.toPoint.x,y:(1-n)*this.fromPoint.y+n*this.toPoint.y}}},{key:"_findBorderPosition",value:function(n,a){var o=this.to,s=this.from;n.id===this.from.id&&(o=this.from,s=this.to);var u=Math.atan2(o.y-s.y,o.x-s.x),l=o.x-s.x,h=o.y-s.y,d=Math.sqrt(l*l+h*h),c=n.distanceToBorder(a,u),f=(d-c)/d;return{x:(1-f)*s.x+f*o.x,y:(1-f)*s.y+f*o.y,t:0}}},{key:"_getDistanceToEdge",value:function(n,a,o,s,u,l){return this._getDistanceToLine(n,a,o,s,u,l)}}]),e}(DT),Gn=function(){function i(r,e,t,n,a){if(N(this,i),e===void 0)throw new Error("No body provided");this.options=ui(n),this.globalOptions=n,this.defaultOptions=a,this.body=e,this.imagelist=t,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new TT(this.body,this.options,!0),this.setOptions(r)}return M(i,[{key:"setOptions",value:function(e){if(e){var t=typeof e.physics<"u"&&this.options.physics!==e.physics||typeof e.hidden<"u"&&(this.options.hidden||!1)!==(e.hidden||!1)||typeof e.from<"u"&&this.options.from!==e.from||typeof e.to<"u"&&this.options.to!==e.to;i.parseOptions(this.options,e,!0,this.globalOptions),e.id!==void 0&&(this.id=e.id),e.from!==void 0&&(this.fromId=e.from),e.to!==void 0&&(this.toId=e.to),e.title!==void 0&&(this.title=e.title),e.value!==void 0&&(e.value=ET(e.value));var n=[e,this.options,this.defaultOptions];return this.chooser=cp("edge",n),this.updateLabelModule(e),t=this.updateEdgeType()||t,this._setInteractionWidths(),this.connect(),t}}},{key:"getFormattingValues",value:function(){var e=this.options.arrows.to===!0||this.options.arrows.to.enabled===!0,t=this.options.arrows.from===!0||this.options.arrows.from.enabled===!0,n=this.options.arrows.middle===!0||this.options.arrows.middle.enabled===!0,a=this.options.color.inherit,o={toArrow:e,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,toArrowSrc:this.options.arrows.to.src,toArrowImageWidth:this.options.arrows.to.imageWidth,toArrowImageHeight:this.options.arrows.to.imageHeight,middleArrow:n,middleArrowScale:this.options.arrows.middle.scaleFactor,middleArrowType:this.options.arrows.middle.type,middleArrowSrc:this.options.arrows.middle.src,middleArrowImageWidth:this.options.arrows.middle.imageWidth,middleArrowImageHeight:this.options.arrows.middle.imageHeight,fromArrow:t,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,fromArrowSrc:this.options.arrows.from.src,fromArrowImageWidth:this.options.arrows.from.imageWidth,fromArrowImageHeight:this.options.arrows.from.imageHeight,arrowStrikethrough:this.options.arrowStrikethrough,color:a?void 0:this.options.color.color,inheritsColor:a,opacity:this.options.color.opacity,hidden:this.options.hidden,length:this.options.length,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y,dashes:this.options.dashes,width:this.options.width,background:this.options.background.enabled,backgroundColor:this.options.background.color,backgroundSize:this.options.background.size,backgroundDashes:this.options.background.dashes};if(this.selected||this.hover)if(this.chooser===!0){if(this.selected){var s=this.options.selectionWidth;typeof s=="function"?o.width=s(o.width):typeof s=="number"&&(o.width+=s),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.highlight,o.shadow=this.options.shadow.enabled}else if(this.hover){var u=this.options.hoverWidth;typeof u=="function"?o.width=u(o.width):typeof u=="number"&&(o.width+=u),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.hover,o.shadow=this.options.shadow.enabled}}else typeof this.chooser=="function"&&(this.chooser(o,this.options.id,this.selected,this.hover),o.color!==void 0&&(o.inheritsColor=!1),o.shadow===!1&&(o.shadowColor!==this.options.shadow.color||o.shadowSize!==this.options.shadow.size||o.shadowX!==this.options.shadow.x||o.shadowY!==this.options.shadow.y)&&(o.shadow=!0));else o.shadow=this.options.shadow.enabled,o.width=Math.max(o.width,.3/this.body.view.scale);return o}},{key:"updateLabelModule",value:function(e){var t=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateEdgeType",value:function(){var e=this.options.smooth,t=!1,n=!0;return this.edgeType!==void 0&&((this.edgeType instanceof h$&&e.enabled===!0&&e.type==="dynamic"||this.edgeType instanceof d$&&e.enabled===!0&&e.type==="cubicBezier"||this.edgeType instanceof c$&&e.enabled===!0&&e.type!=="dynamic"&&e.type!=="cubicBezier"||this.edgeType instanceof f$&&e.type.enabled===!1)&&(n=!1),n===!0&&(t=this.cleanup())),n===!0?e.enabled===!0?e.type==="dynamic"?(t=!0,this.edgeType=new h$(this.options,this.body,this.labelModule)):e.type==="cubicBezier"?this.edgeType=new d$(this.options,this.body,this.labelModule):this.edgeType=new c$(this.options,this.body,this.labelModule):this.edgeType=new f$(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),t}},{key:"connect",value:function(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=this.from!==void 0&&this.to!==void 0,this.connected===!0?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}},{key:"disconnect",value:function(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}},{key:"getTitle",value:function(){return this.title}},{key:"isSelected",value:function(){return this.selected}},{key:"getValue",value:function(){return this.options.value}},{key:"setValueRange",value:function(e,t,n){if(this.options.value!==void 0){var a=this.options.scaling.customScalingFunction(e,t,n,this.options.value),o=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){var s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+a*s}this.options.width=this.options.scaling.min+a*o}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}},{key:"_setInteractionWidths",value:function(){typeof this.options.hoverWidth=="function"?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,typeof this.options.selectionWidth=="function"?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}},{key:"draw",value:function(e){var t=this.getFormattingValues();if(!t.hidden){var n=this.edgeType.getViaNode();this.edgeType.drawLine(e,t,this.selected,this.hover,n),this.drawLabel(e,n)}}},{key:"drawArrows",value:function(e){var t=this.getFormattingValues();if(!t.hidden){var n=this.edgeType.getViaNode(),a={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,t.fromArrow&&(a.from=this.edgeType.getArrowData(e,"from",n,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.fromPoint=a.from.core),t.fromArrowSrc&&(a.from.image=this.imagelist.load(t.fromArrowSrc)),t.fromArrowImageWidth&&(a.from.imageWidth=t.fromArrowImageWidth),t.fromArrowImageHeight&&(a.from.imageHeight=t.fromArrowImageHeight)),t.toArrow&&(a.to=this.edgeType.getArrowData(e,"to",n,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.toPoint=a.to.core),t.toArrowSrc&&(a.to.image=this.imagelist.load(t.toArrowSrc)),t.toArrowImageWidth&&(a.to.imageWidth=t.toArrowImageWidth),t.toArrowImageHeight&&(a.to.imageHeight=t.toArrowImageHeight)),t.middleArrow&&(a.middle=this.edgeType.getArrowData(e,"middle",n,this.selected,this.hover,t),t.middleArrowSrc&&(a.middle.image=this.imagelist.load(t.middleArrowSrc)),t.middleArrowImageWidth&&(a.middle.imageWidth=t.middleArrowImageWidth),t.middleArrowImageHeight&&(a.middle.imageHeight=t.middleArrowImageHeight)),t.fromArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,a.from),t.middleArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,a.middle),t.toArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,a.to)}}},{key:"drawLabel",value:function(e,t){if(this.options.label!==void 0){var n=this.from,a=this.to;this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover);var o;if(n.id!=a.id){this.labelModule.pointToSelf=!1,o=this.edgeType.getPoint(.5,t),e.save();var s=this._getRotation(e);s.angle!=0&&(e.translate(s.x,s.y),e.rotate(s.angle)),this.labelModule.draw(e,o.x,o.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;var u=ST(e,this.options.selfReference.angle,this.options.selfReference.size,n);o=this._pointOnCircle(u.x,u.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(e,o.x,o.y,this.selected,this.hover)}}}},{key:"getItemsOnPoint",value:function(e){var t=[];if(this.labelModule.visible()){var n=this._getRotation();Cf(this.labelModule.getSize(),e,n)&&t.push({edgeId:this.id,labelId:0})}var a={left:e.x,top:e.y};return this.isOverlappingWith(a)&&t.push({edgeId:this.id}),t}},{key:"isOverlappingWith",value:function(e){if(this.connected){var t=10,n=this.from.x,a=this.from.y,o=this.to.x,s=this.to.y,u=e.left,l=e.top,h=this.edgeType.getDistanceToEdge(n,a,o,s,u,l);return h0&&s<0)&&(u+=Math.PI),a.angle=u,a}},{key:"_pointOnCircle",value:function(e,t,n,a){return{x:e+n*Math.cos(a),y:t-n*Math.sin(a)}}},{key:"select",value:function(){this.selected=!0}},{key:"unselect",value:function(){this.selected=!1}},{key:"cleanup",value:function(){return this.edgeType.cleanup()}},{key:"remove",value:function(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}},{key:"endPointsValid",value:function(){return this.body.nodes[this.fromId]!==void 0&&this.body.nodes[this.toId]!==void 0}}],[{key:"parseOptions",value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,s=["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"];if(Na(s,e,t,n),t.endPointOffset!==void 0&&t.endPointOffset.from!==void 0&&(Pi(t.endPointOffset.from)?e.endPointOffset.from=t.endPointOffset.from:(e.endPointOffset.from=a.endPointOffset.from!==void 0?a.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),t.endPointOffset!==void 0&&t.endPointOffset.to!==void 0&&(Pi(t.endPointOffset.to)?e.endPointOffset.to=t.endPointOffset.to:(e.endPointOffset.to=a.endPointOffset.to!==void 0?a.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),Ju(t.label)?e.label=t.label:Ju(e.label)||(e.label=void 0),Ut(e,t,"smooth",a),Ut(e,t,"shadow",a),Ut(e,t,"background",a),t.dashes!==void 0&&t.dashes!==null?e.dashes=t.dashes:n===!0&&t.dashes===null&&(e.dashes=Bi(a.dashes)),t.scaling!==void 0&&t.scaling!==null?(t.scaling.min!==void 0&&(e.scaling.min=t.scaling.min),t.scaling.max!==void 0&&(e.scaling.max=t.scaling.max),Ut(e.scaling,t.scaling,"label",a.scaling)):n===!0&&t.scaling===null&&(e.scaling=Bi(a.scaling)),t.arrows!==void 0&&t.arrows!==null)if(typeof t.arrows=="string"){var u=t.arrows.toLowerCase();e.arrows.to.enabled=ie(u).call(u,"to")!=-1,e.arrows.middle.enabled=ie(u).call(u,"middle")!=-1,e.arrows.from.enabled=ie(u).call(u,"from")!=-1}else if(ce(t.arrows)==="object")Ut(e.arrows,t.arrows,"to",a.arrows),Ut(e.arrows,t.arrows,"middle",a.arrows),Ut(e.arrows,t.arrows,"from",a.arrows);else throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+us(t.arrows));else n===!0&&t.arrows===null&&(e.arrows=Bi(a.arrows));if(t.color!==void 0&&t.color!==null){var l=Un(t.color)?{color:t.color,highlight:t.color,hover:t.color,inherit:!1,opacity:1}:t.color,h=e.color;if(o)ve(h,a.color,!1,n);else for(var d in h)Object.prototype.hasOwnProperty.call(h,d)&&delete h[d];if(Un(h))h.color=h,h.highlight=h,h.hover=h,h.inherit=!1,l.opacity===void 0&&(h.opacity=1);else{var c=!1;l.color!==void 0&&(h.color=l.color,c=!0),l.highlight!==void 0&&(h.highlight=l.highlight,c=!0),l.hover!==void 0&&(h.hover=l.hover,c=!0),l.inherit!==void 0&&(h.inherit=l.inherit),l.opacity!==void 0&&(h.opacity=Math.min(1,Math.max(0,l.opacity))),c===!0?h.inherit=!1:h.inherit===void 0&&(h.inherit="from")}}else n===!0&&t.color===null&&(e.color=ui(a.color));n===!0&&t.font===null&&(e.font=ui(a.font)),Object.prototype.hasOwnProperty.call(t,"selfReferenceSize")&&(console.warn("The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}"),e.selfReference.size=t.selfReferenceSize)}}]),i}(),jde=function(){function i(r,e,t){var n,a=this;N(this,i),this.body=r,this.images=e,this.groups=t,this.body.functions.createEdge=P(n=this.create).call(n,this),this.edgesListeners={add:function(s,u){a.add(u.items)},update:function(s,u){a.update(u.items)},remove:function(s,u){a.remove(u.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1,type:"arrow"},middle:{enabled:!1,scaleFactor:1,type:"arrow"},from:{enabled:!1,scaleFactor:1,type:"arrow"}},endPointOffset:{from:0,to:0},arrowStrikethrough:!0,color:{color:"#848484",highlight:"#848484",hover:"#848484",inherit:"from",opacity:1},dashes:!1,font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:2,strokeColor:"#ffffff",align:"horizontal",multi:!1,vadjust:0,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"courier new",vadjust:2}},hidden:!1,hoverWidth:1.5,label:void 0,labelHighlightBold:!0,length:void 0,physics:!0,scaling:{min:1,max:15,label:{enabled:!0,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(s,u,l,h){if(u===s)return .5;var d=1/(u-s);return Math.max(0,(h-s)*d)}},selectionWidth:1.5,selfReference:{size:20,angle:Math.PI/4,renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},background:{enabled:!1,color:"rgba(111,111,111,1)",size:10,dashes:!1},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},ve(this.options,this.defaultOptions),this.bindEventListeners()}return M(i,[{key:"bindEventListeners",value:function(){var e=this,t,n;this.body.emitter.on("_forceDisableDynamicCurves",function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;a==="dynamic"&&(a="continuous");var s=!1;for(var u in e.body.edges)if(Object.prototype.hasOwnProperty.call(e.body.edges,u)){var l=e.body.edges[u],h=e.body.data.edges.get(u);if(h!=null){var d=h.smooth;d!==void 0&&d.enabled===!0&&d.type==="dynamic"&&(a===void 0?l.setOptions({smooth:!1}):l.setOptions({smooth:{type:a}}),s=!0)}}o===!0&&s===!0&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",function(){e.reconnectEdges()}),this.body.emitter.on("refreshEdges",P(t=this.refresh).call(t,this)),this.body.emitter.on("refresh",P(n=this.refresh).call(n,this)),this.body.emitter.on("destroy",function(){te(e.edgesListeners,function(a,o){e.body.data.edges&&e.body.data.edges.off(o,a)}),delete e.body.functions.createEdge,delete e.edgesListeners.add,delete e.edgesListeners.update,delete e.edgesListeners.remove,delete e.edgesListeners})}},{key:"setOptions",value:function(e){if(e!==void 0){Gn.parseOptions(this.options,e,!0,this.defaultOptions,!0);var t=!1;if(e.smooth!==void 0)for(var n in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,n)&&(t=this.body.edges[n].updateEdgeType()||t);if(e.font!==void 0)for(var a in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,a)&&this.body.edges[a].updateLabelModule();(e.hidden!==void 0||e.physics!==void 0||t===!0)&&this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.body.data.edges;if(TE("id",e))this.body.data.edges=e;else if(le(e))this.body.data.edges=new ju,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new ju;else throw new TypeError("Array or DataSet expected");if(a&&te(this.edgesListeners,function(s,u){a.off(u,s)}),this.body.edges={},this.body.data.edges){te(this.edgesListeners,function(s,u){t.body.data.edges.on(u,s)});var o=this.body.data.edges.getIds();this.add(o,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),n===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.body.edges,a=this.body.data.edges,o=0;o1&&arguments[1]!==void 0?arguments[1]:!0;if(e.length!==0){var n=this.body.edges;te(e,function(a){var o=n[a];o!==void 0&&o.remove()}),t&&this.body.emitter.emit("_dataChanged")}}},{key:"refresh",value:function(){var e=this;te(this.body.edges,function(t,n){var a=e.body.data.edges.get(n);a!==void 0&&t.setOptions(a)})}},{key:"create",value:function(e){return new Gn(e,this.body,this.images,this.options,this.defaultOptions)}},{key:"reconnectEdges",value:function(){var e,t=this.body.nodes,n=this.body.edges;for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(t[e].edges=[]);for(e in n)if(Object.prototype.hasOwnProperty.call(n,e)){var a=n[e];a.from=null,a.to=null,a.connect()}}},{key:"getConnectedNodes",value:function(e){var t=[];if(this.body.edges[e]!==void 0){var n=this.body.edges[e];n.fromId!==void 0&&t.push(n.fromId),n.toId!==void 0&&t.push(n.toId)}return t}},{key:"_updateState",value:function(){this._addMissingEdges(),this._removeInvalidEdges()}},{key:"_removeInvalidEdges",value:function(){var e=this,t=[];te(this.body.edges,function(n,a){var o=e.body.nodes[n.toId],s=e.body.nodes[n.fromId];o!==void 0&&o.isCluster===!0||s!==void 0&&s.isCluster===!0||(o===void 0||s===void 0)&&t.push(a)}),this.remove(t,!1)}},{key:"_addMissingEdges",value:function(){var e=this.body.data.edges;if(e!=null){var t=this.body.edges,n=[];de(e).call(e,function(a,o){var s=t[o];s===void 0&&n.push(o)}),this.add(n,!0)}}}]),i}(),RT=function(){function i(r,e,t){N(this,i),this.body=r,this.physicsBody=e,this.barnesHutTree,this.setOptions(t),this._rng=Zl("BARNES HUT SOLVER")}return M(i,[{key:"setOptions",value:function(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}},{key:"solve",value:function(){if(this.options.gravitationalConstant!==0&&this.physicsBody.physicsNodeIndices.length>0){var e,t=this.body.nodes,n=this.physicsBody.physicsNodeIndices,a=n.length,o=this._formBarnesHutTree(t,n);this.barnesHutTree=o;for(var s=0;s0&&this._getForceContributions(o.root,e)}}},{key:"_getForceContributions",value:function(e,t){this._getForceContribution(e.children.NW,t),this._getForceContribution(e.children.NE,t),this._getForceContribution(e.children.SW,t),this._getForceContribution(e.children.SE,t)}},{key:"_getForceContribution",value:function(e,t){if(e.childrenCount>0){var n=e.centerOfMass.x-t.x,a=e.centerOfMass.y-t.y,o=Math.sqrt(n*n+a*a);o*e.calcSize>this.thetaInversed?this._calculateForces(o,n,a,t,e):e.childrenCount===4?this._getForceContributions(e,t):e.children.data.id!=t.id&&this._calculateForces(o,n,a,t,e)}}},{key:"_calculateForces",value:function(e,t,n,a,o){e===0&&(e=.1,t=e),this.overlapAvoidanceFactor<1&&a.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*a.shape.radius,e-a.shape.radius));var s=this.options.gravitationalConstant*o.mass*a.options.mass/Math.pow(e,3),u=t*s,l=n*s;this.physicsBody.forces[a.id].x+=u,this.physicsBody.forces[a.id].y+=l}},{key:"_formBarnesHutTree",value:function(e,t){for(var n,a=t.length,o=e[t[0]].x,s=e[t[0]].y,u=e[t[0]].x,l=e[t[0]].y,h=1;h0&&(cu&&(u=c),fl&&(l=f))}var v=Math.abs(u-o)-Math.abs(l-s);v>0?(s-=.5*v,l+=.5*v):(o+=.5*v,u-=.5*v);var p=1e-5,g=Math.max(p,Math.abs(u-o)),y=.5*g,m=.5*(o+u),b=.5*(s+l),$={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:m-y,maxX:m+y,minY:b-y,maxY:b+y},size:g,calcSize:1/g,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch($.root);for(var S=0;S0&&this._placeInTree($.root,n);return $}},{key:"_updateBranchMass",value:function(e,t){var n=e.centerOfMass,a=e.mass+t.options.mass,o=1/a;n.x=n.x*e.mass+t.x*t.options.mass,n.x*=o,n.y=n.y*e.mass+t.y*t.options.mass,n.y*=o,e.mass=a;var s=Math.max(Math.max(t.height,t.radius),t.width);e.maxWidth=e.maxWidtht.x?a.maxY>t.y?o="NW":o="SW":a.maxY>t.y?o="NE":o="SE",this._placeInRegion(e,t,o)}},{key:"_placeInRegion",value:function(e,t,n){var a=e.children[n];switch(a.childrenCount){case 0:a.children.data=t,a.childrenCount=1,this._updateBranchMass(a,t);break;case 1:a.children.data.x===t.x&&a.children.data.y===t.y?(t.x+=this._rng(),t.y+=this._rng()):(this._splitBranch(a),this._placeInTree(a,t));break;case 4:this._placeInTree(a,t);break}}},{key:"_splitBranch",value:function(e){var t=null;e.childrenCount===1&&(t=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,"NW"),this._insertRegion(e,"NE"),this._insertRegion(e,"SW"),this._insertRegion(e,"SE"),t!=null&&this._placeInTree(e,t)}},{key:"_insertRegion",value:function(e,t){var n,a,o,s,u=.5*e.size;switch(t){case"NW":n=e.range.minX,a=e.range.minX+u,o=e.range.minY,s=e.range.minY+u;break;case"NE":n=e.range.minX+u,a=e.range.maxX,o=e.range.minY,s=e.range.minY+u;break;case"SW":n=e.range.minX,a=e.range.minX+u,o=e.range.minY+u,s=e.range.maxY;break;case"SE":n=e.range.minX+u,a=e.range.maxX,o=e.range.minY+u,s=e.range.maxY;break}e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:n,maxX:a,minY:o,maxY:s},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}},{key:"_debug",value:function(e,t){this.barnesHutTree!==void 0&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}},{key:"_drawBranch",value:function(e,t,n){n===void 0&&(n="#FF0000"),e.childrenCount===4&&(this._drawBranch(e.children.NW,t),this._drawBranch(e.children.NE,t),this._drawBranch(e.children.SE,t),this._drawBranch(e.children.SW,t)),t.strokeStyle=n,t.beginPath(),t.moveTo(e.range.minX,e.range.minY),t.lineTo(e.range.maxX,e.range.minY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.minY),t.lineTo(e.range.maxX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.maxY),t.lineTo(e.range.minX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.minX,e.range.maxY),t.lineTo(e.range.minX,e.range.minY),t.stroke()}}]),i}(),Lde=function(){function i(r,e,t){N(this,i),this._rng=Zl("REPULSION SOLVER"),this.body=r,this.physicsBody=e,this.setOptions(t)}return M(i,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,t,n,a,o,s,u,l,h=this.body.nodes,d=this.physicsBody.physicsNodeIndices,c=this.physicsBody.forces,f=this.options.nodeDistance,v=-2/3/f,p=4/3,g=0;g"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var Ude=function(i){se(e,i);var r=Wde(e);function e(t,n,a){var o;return N(this,e),o=r.call(this,t,n,a),o._rng=Zl("FORCE ATLAS 2 BASED REPULSION SOLVER"),o}return M(e,[{key:"_calculateForces",value:function(n,a,o,s,u){n===0&&(n=.1*this._rng(),a=n),this.overlapAvoidanceFactor<1&&s.shape.radius&&(n=Math.max(.1+this.overlapAvoidanceFactor*s.shape.radius,n-s.shape.radius));var l=s.edges.length+1,h=this.options.gravitationalConstant*u.mass*s.options.mass*l/Math.pow(n,2),d=a*h,c=o*h;this.physicsBody.forces[s.id].x+=d,this.physicsBody.forces[s.id].y+=c}}]),e}(RT);function Kde(i){var r=Gde();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function Gde(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var qde=function(i){se(e,i);var r=Kde(e);function e(t,n,a){return N(this,e),r.call(this,t,n,a)}return M(e,[{key:"_calculateForces",value:function(n,a,o,s,u){if(n>0){var l=u.edges.length+1,h=this.options.centralGravity*l*u.options.mass;s[u.id].x=a*h,s[u.id].y=o*h}}}]),e}(_u),Yde=function(){function i(r){N(this,i),this.body=r,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:"barnesHut",stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0,wind:{x:0,y:0}},Fe(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}return M(i,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("initPhysics",function(){e.initPhysics()}),this.body.emitter.on("_layoutFailed",function(){e.layoutFailed=!0}),this.body.emitter.on("resetPhysics",function(){e.stopSimulation(),e.ready=!1}),this.body.emitter.on("disablePhysics",function(){e.physicsEnabled=!1,e.stopSimulation()}),this.body.emitter.on("restorePhysics",function(){e.setOptions(e.options),e.ready===!0&&e.startSimulation()}),this.body.emitter.on("startSimulation",function(){e.ready===!0&&e.startSimulation()}),this.body.emitter.on("stopSimulation",function(){e.stopSimulation()}),this.body.emitter.on("destroy",function(){e.stopSimulation(!1),e.body.emitter.off()}),this.body.emitter.on("_dataChanged",function(){e.updatePhysicsData()})}},{key:"setOptions",value:function(e){if(e!==void 0)if(e===!1)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(e===!0)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,qu(["stabilization"],this.options,e),Ut(this.options,e,"stabilization"),e.enabled===void 0&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation());var t=this.options.wind;t&&((typeof t.x!="number"||xf(t.x))&&(t.x=0),(typeof t.y!="number"||xf(t.y))&&(t.y=0)),this.timestep=this.options.timestep}this.init()}},{key:"init",value:function(){var e;this.options.solver==="forceAtlas2Based"?(e=this.options.forceAtlas2Based,this.nodesSolver=new Ude(this.body,this.physicsBody,e),this.edgesSolver=new dd(this.body,this.physicsBody,e),this.gravitySolver=new qde(this.body,this.physicsBody,e)):this.options.solver==="repulsion"?(e=this.options.repulsion,this.nodesSolver=new Lde(this.body,this.physicsBody,e),this.edgesSolver=new dd(this.body,this.physicsBody,e),this.gravitySolver=new _u(this.body,this.physicsBody,e)):this.options.solver==="hierarchicalRepulsion"?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new zde(this.body,this.physicsBody,e),this.edgesSolver=new Hde(this.body,this.physicsBody,e),this.gravitySolver=new _u(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new RT(this.body,this.physicsBody,e),this.edgesSolver=new dd(this.body,this.physicsBody,e),this.gravitySolver=new _u(this.body,this.physicsBody,e)),this.modelOptions=e}},{key:"initPhysics",value:function(){this.physicsEnabled===!0&&this.options.enabled===!0?this.options.stabilization.enabled===!0?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}},{key:"startSimulation",value:function(){if(this.physicsEnabled===!0&&this.options.enabled===!0){if(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),this.viewFunction===void 0){var e;this.viewFunction=P(e=this.simulationStep).call(e,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}else this.body.emitter.emit("_redraw")}},{key:"stopSimulation",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.stabilized=!0,e===!0&&this._emitStabilized(),this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,e===!0&&this.body.emitter.emit("_stopRendering"))}},{key:"simulationStep",value:function(){var e=Vu();this.physicsTick();var t=Vu()-e;(t<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}},{key:"_emitStabilized",value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&yr(function(){e.body.emitter.emit("stabilized",{iterations:t}),e.startedStabilization=!1,e.stabilizationIterations=0},0)}},{key:"physicsStep",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}},{key:"adjustTimeStep",value:function(){var e=1.2;this._evaluateStepQuality()===!0?this.timestep=e*this.timestep:this.timestep/es))return!1;return!0}},{key:"moveNodes",value:function(){for(var e=this.physicsBody.physicsNodeIndices,t=0,n=0,a=5,o=0;os&&(e=e>0?s:-s),e}},{key:"_performStep",value:function(e){var t=this.body.nodes[e],n=this.physicsBody.forces[e];this.options.wind&&(n.x+=this.options.wind.x,n.y+=this.options.wind.y);var a=this.physicsBody.velocities[e];this.previousStates[e]={x:t.x,y:t.y,vx:a.x,vy:a.y},t.options.fixed.x===!1?(a.x=this.calculateComponentVelocity(a.x,n.x,t.options.mass),t.x+=a.x*this.timestep):(n.x=0,a.x=0),t.options.fixed.y===!1?(a.y=this.calculateComponentVelocity(a.y,n.y,t.options.mass),t.y+=a.y*this.timestep):(n.y=0,a.y=0);var o=Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2));return o}},{key:"_freezeNodes",value:function(){var e=this.body.nodes;for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t].x&&e[t].y){var n=e[t].options.fixed;this.freezeCache[t]={x:n.x,y:n.y},n.x=!0,n.y=!0}}},{key:"_restoreFrozenNodes",value:function(){var e=this.body.nodes;for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.freezeCache[t]!==void 0&&(e[t].options.fixed.x=this.freezeCache[t].x,e[t].options.fixed.y=this.freezeCache[t].y);this.freezeCache={}}},{key:"stabilize",value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.stabilization.iterations;if(typeof t!="number"&&(t=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",t)),this.physicsBody.physicsNodeIndices.length===0){this.ready=!0;return}this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=t,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,yr(function(){return e._stabilizationBatch()},0)}},{key:"_startStabilizing",value:function(){return this.startedStabilization===!0?!1:(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}},{key:"_stabilizationBatch",value:function(){var e=this,t=function(){return e.stabilized===!1&&e.stabilizationIterations1&&arguments[1]!==void 0?arguments[1]:[],n=1e9,a=-1e9,o=1e9,s=-1e9,u;if(t.length>0)for(var l=0;lu.shape.boundingBox.left&&(o=u.shape.boundingBox.left),su.shape.boundingBox.top&&(n=u.shape.boundingBox.top),a1&&arguments[1]!==void 0?arguments[1]:[],n=1e9,a=-1e9,o=1e9,s=-1e9,u;if(t.length>0)for(var l=0;lu.x&&(o=u.x),su.y&&(n=u.y),a"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var rfe=function(i){se(e,i);var r=efe(e);function e(t,n,a,o,s,u){var l;return N(this,e),l=r.call(this,t,n,a,o,s,u),l.isCluster=!0,l.containedNodes={},l.containedEdges={},l}return M(e,[{key:"_openChildCluster",value:function(n){var a=this,o=this.body.nodes[n];if(this.containedNodes[n]===void 0)throw new Error("node with id: "+n+" not in current cluster");if(!o.isCluster)throw new Error("node with id: "+n+" is not a cluster");delete this.containedNodes[n],te(o.edges,function(s){delete a.containedEdges[s.id]}),te(o.containedNodes,function(s,u){a.containedNodes[u]=s}),o.containedNodes={},te(o.containedEdges,function(s,u){a.containedEdges[u]=s}),o.containedEdges={},te(o.edges,function(s){te(a.edges,function(u){var l,h,d=ie(l=u.clusteringEdgeReplacingIds).call(l,s.id);d!==-1&&(te(s.clusteringEdgeReplacingIds,function(c){u.clusteringEdgeReplacingIds.push(c),a.body.edges[c].edgeReplacedById=u.id}),Cr(h=u.clusteringEdgeReplacingIds).call(h,d,1))})}),o.edges=[]}}]),e}(Nt),ife=function(){function i(r){var e=this;N(this,i),this.body=r,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},Fe(this.options,this.defaultOptions),this.body.emitter.on("_resetData",function(){e.clusteredNodes={},e.clusteredEdges={}})}return M(i,[{key:"clusterByHubsize",value:function(e,t){e===void 0?e=this._getHubSize():ce(e)==="object"&&(t=this._checkOptions(e),e=this._getHubSize());for(var n=[],a=0;a=e&&n.push(o.id)}for(var s=0;s0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(t.joinCondition===void 0)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");t=this._checkOptions(t);var a={},o={};te(this.body.nodes,function(s,u){s.options&&t.joinCondition(s.options)===!0&&(a[u]=s,te(s.edges,function(l){e.clusteredEdges[l.id]===void 0&&(o[l.id]=l)}))}),this._cluster(a,o,t,n)}},{key:"clusterByEdgeCount",value:function(e,t){var n=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;t=this._checkOptions(t);for(var o=[],s={},u,l,h,d=function(){var p={},g={},y=n.body.nodeIndices[c],m=n.body.nodes[y];if(s[y]===void 0){h=0,l=[];for(var b=0;b0&&Ee(g).length>0&&S===!0){var B=function(){for(var U=0;U1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(1,e,t)}},{key:"clusterBridges",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(2,e,t)}},{key:"clusterByConnection",value:function(e,t){var n,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No nodeId supplied to clusterByConnection!");if(this.body.nodes[e]===void 0)throw new Error("The nodeId given to clusterByConnection does not exist!");var o=this.body.nodes[e];t=this._checkOptions(t,o),t.clusterNodeProperties.x===void 0&&(t.clusterNodeProperties.x=o.x),t.clusterNodeProperties.y===void 0&&(t.clusterNodeProperties.y=o.y),t.clusterNodeProperties.fixed===void 0&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=o.options.fixed.x,t.clusterNodeProperties.fixed.y=o.options.fixed.y);var s={},u={},l=o.id,h=vt.cloneOptions(o);s[l]=o;for(var d=0;d-1&&(u[b.id]=b)}this._cluster(s,u,t,a)}},{key:"_createClusterEdges",value:function(e,t,n,a){for(var o,s,u,l,h,d,c=Ee(e),f=[],v=0;v0&&arguments[0]!==void 0?arguments[0]:{};return e.clusterEdgeProperties===void 0&&(e.clusterEdgeProperties={}),e.clusterNodeProperties===void 0&&(e.clusterNodeProperties={}),e}},{key:"_cluster",value:function(e,t,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&this.clusteredNodes[s]!==void 0&&o.push(s);for(var u=0;ua?u.x:a,o=u.ys?u.y:s;return{x:.5*(n+a),y:.5*(o+s)}}},{key:"openCluster",value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No clusterNodeId supplied to openCluster.");var a=this.body.nodes[e];if(a===void 0)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(a.isCluster!==!0||a.containedNodes===void 0||a.containedEdges===void 0)throw new Error("The node:"+e+" is not a valid cluster.");var o=this.findNode(e),s=ie(o).call(o,e)-1;if(s>=0){var u=o[s],l=this.body.nodes[u];l._openChildCluster(e),delete this.body.nodes[e],n===!0&&this.body.emitter.emit("_dataChanged");return}var h=a.containedNodes,d=a.containedEdges;if(t!==void 0&&t.releaseFunction!==void 0&&typeof t.releaseFunction=="function"){var c={},f={x:a.x,y:a.y};for(var v in h)if(Object.prototype.hasOwnProperty.call(h,v)){var p=this.body.nodes[v];c[v]={x:p.x,y:p.y}}var g=t.releaseFunction(f,c);for(var y in h)if(Object.prototype.hasOwnProperty.call(h,y)){var m=this.body.nodes[y];g[y]!==void 0&&(m.x=g[y].x===void 0?a.x:g[y].x,m.y=g[y].y===void 0?a.y:g[y].y)}}else te(h,function(lt){lt.options.fixed.x===!1&&(lt.x=a.x),lt.options.fixed.y===!1&&(lt.y=a.y)});for(var b in h)if(Object.prototype.hasOwnProperty.call(h,b)){var $=this.body.nodes[b];$.vx=a.vx,$.vy=a.vy,$.setOptions({physics:!0}),delete this.clusteredNodes[b]}for(var S=[],_=0;_0&&sa&&(a=s.edges.length),e+=s.edges.length,t+=Math.pow(s.edges.length,2),n+=1}e=e/n,t=t/n;var u=t-Math.pow(e,2),l=Math.sqrt(u),h=Math.floor(e+2*l);return h>a&&(h=a),h}},{key:"_createClusteredEdge",value:function(e,t,n,a,o){var s=vt.cloneOptions(n,"edge");ve(s,a),s.from=e,s.to=t,s.id="clusterEdge:"+io(),o!==void 0&&ve(s,o);var u=this.body.functions.createEdge(s);return u.clusteringEdgeReplacingIds=[n.id],u.connect(),this.body.edges[u.id]=u,u}},{key:"_clusterEdges",value:function(e,t,n,a){if(t instanceof Gn){var o=t,s={};s[o.id]=o,t=s}if(e instanceof Nt){var u=e,l={};l[u.id]=u,e=l}if(n==null)throw new Error("_clusterEdges: parameter clusterNode required");a===void 0&&(a=n.clusterEdgeProperties),this._createClusterEdges(e,t,n,a);for(var h in t)if(Object.prototype.hasOwnProperty.call(t,h)&&this.body.edges[h]!==void 0){var d=this.body.edges[h];this._backupEdgeOptions(d),d.setOptions({physics:!1})}for(var c in e)Object.prototype.hasOwnProperty.call(e,c)&&(this.clusteredNodes[c]={clusterId:n.id,node:this.body.nodes[c]},this.body.nodes[c].setOptions({physics:!1}))}},{key:"_getClusterNodeForNode",value:function(e){if(e!==void 0){var t=this.clusteredNodes[e];if(t!==void 0){var n=t.clusterId;if(n!==void 0)return this.body.nodes[n]}}}},{key:"_filter",value:function(e,t){var n=[];return te(e,function(a){t(a)&&n.push(a)}),n}},{key:"_updateState",value:function(){var e=this,t,n=[],a={},o=function(v){te(e.body.nodes,function(p){p.isCluster===!0&&v(p)})};for(t in this.clusteredNodes)if(Object.prototype.hasOwnProperty.call(this.clusteredNodes,t)){var s=this.body.nodes[t];s===void 0&&n.push(t)}o(function(f){for(var v=0;v0}(!f.endPointsValid()||!p)&&(a[v]=v)}),o(function(f){te(a,function(v){delete f.containedEdges[v],te(f.edges,function(p,g){if(p.id===v){f.edges[g]=null;return}p.clusteringEdgeReplacingIds=e._filter(p.clusteringEdgeReplacingIds,function(y){return!a[y]})}),f.edges=e._filter(f.edges,function(p){return p!==null})})}),te(a,function(f){delete e.clusteredEdges[f]}),te(a,function(f){delete e.body.edges[f]});var l=Ee(this.body.edges);te(l,function(f){var v=e.body.edges[f],p=e._isClusteredNode(v.fromId)||e._isClusteredNode(v.toId);if(p!==e._isClusteredEdge(v.id))if(p){var g=e._getClusterNodeForNode(v.fromId);g!==void 0&&e._clusterEdges(e.body.nodes[v.fromId],v,g);var y=e._getClusterNodeForNode(v.toId);y!==void 0&&e._clusterEdges(e.body.nodes[v.toId],v,y)}else delete e._clusterEdges[f],e._restoreEdge(v)});for(var h=!1,d=!0,c=function(){var v=[];o(function(g){var y=Ee(g.containedNodes).length,m=g.options.allowSingleNodeCluster===!0;(m&&y<1||!m&&y<2)&&v.push(g.id)});for(var p=0;p0,h=h||d};d;)c();h&&this._updateState()}},{key:"_isClusteredNode",value:function(e){return this.clusteredNodes[e]!==void 0}},{key:"_isClusteredEdge",value:function(e){return this.clusteredEdges[e]!==void 0}}]),i}();function nfe(){var i;window!==void 0&&(i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),i===void 0?window.requestAnimationFrame=function(r){r()}:window.requestAnimationFrame=i}var afe=function(){function i(r,e){N(this,i),nfe(),this.body=r,this.canvas=e,this.redrawRequested=!1,this.renderTimer=void 0,this.requiresTimeout=!0,this.renderingActive=!1,this.renderRequests=0,this.allowRedraw=!0,this.dragging=!1,this.zooming=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1},Fe(this.options,this.defaultOptions),this._determineBrowserMethod(),this.bindEventListeners()}return M(i,[{key:"bindEventListeners",value:function(){var e=this,t;this.body.emitter.on("dragStart",function(){e.dragging=!0}),this.body.emitter.on("dragEnd",function(){e.dragging=!1}),this.body.emitter.on("zoom",function(){e.zooming=!0,window.clearTimeout(e.zoomTimeoutId),e.zoomTimeoutId=yr(function(){var n;e.zooming=!1,P(n=e._requestRedraw).call(n,e)()},250)}),this.body.emitter.on("_resizeNodes",function(){e._resizeNodes()}),this.body.emitter.on("_redraw",function(){e.renderingActive===!1&&e._redraw()}),this.body.emitter.on("_blockRedraw",function(){e.allowRedraw=!1}),this.body.emitter.on("_allowRedraw",function(){e.allowRedraw=!0,e.redrawRequested=!1}),this.body.emitter.on("_requestRedraw",P(t=this._requestRedraw).call(t,this)),this.body.emitter.on("_startRendering",function(){e.renderRequests+=1,e.renderingActive=!0,e._startRendering()}),this.body.emitter.on("_stopRendering",function(){e.renderRequests-=1,e.renderingActive=e.renderRequests>0,e.renderTimer=void 0}),this.body.emitter.on("destroy",function(){e.renderRequests=0,e.allowRedraw=!1,e.renderingActive=!1,e.requiresTimeout===!0?clearTimeout(e.renderTimer):window.cancelAnimationFrame(e.renderTimer),e.body.emitter.off()})}},{key:"setOptions",value:function(e){if(e!==void 0){var t=["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"];Na(t,this.options,e)}}},{key:"_requestNextFrame",value:function(e,t){if(!(typeof window>"u")){var n,a=window;return this.requiresTimeout===!0?n=yr(e,t):a.requestAnimationFrame&&(n=a.requestAnimationFrame(e)),n}}},{key:"_startRendering",value:function(){if(this.renderingActive===!0&&this.renderTimer===void 0){var e;this.renderTimer=this._requestNextFrame(P(e=this._renderStep).call(e,this),this.simulationInterval)}}},{key:"_renderStep",value:function(){this.renderingActive===!0&&(this.renderTimer=void 0,this.requiresTimeout===!0&&this._startRendering(),this._redraw(),this.requiresTimeout===!1&&this._startRendering())}},{key:"redraw",value:function(){this.body.emitter.emit("setSize"),this._redraw()}},{key:"_requestRedraw",value:function(){var e=this;this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,this._requestNextFrame(function(){e._redraw(!1)},0))}},{key:"_redraw",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;var t={drawExternalLabels:null};(this.canvas.frame.canvas.width===0||this.canvas.frame.canvas.height===0)&&this.canvas.setSize(),this.canvas.setTransform();var n=this.canvas.getContext(),a=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;if(n.clearRect(0,0,a,o),this.canvas.frame.clientWidth===0)return;if(n.save(),n.translate(this.body.view.translation.x,this.body.view.translation.y),n.scale(this.body.view.scale,this.body.view.scale),n.beginPath(),this.body.emitter.emit("beforeDrawing",n),n.closePath(),e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawEdges(n),this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1){var s=this._drawNodes(n,e),u=s.drawExternalLabels;t.drawExternalLabels=u}e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawArrows(n),t.drawExternalLabels!=null&&t.drawExternalLabels(),e===!1&&this._drawSelectionBox(n),n.beginPath(),this.body.emitter.emit("afterDrawing",n),n.closePath(),n.restore(),e===!0&&n.clearRect(0,0,a,o)}}},{key:"_resizeNodes",value:function(){this.canvas.setTransform();var e=this.canvas.getContext();e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);var t=this.body.nodes,n;for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(n=t[a],n.resize(e),n.updateBoundingBox(e,n.selected));e.restore()}},{key:"_drawNodes",value:function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.body.nodes,a=this.body.nodeIndices,o,s=[],u=[],l=20,h=this.canvas.DOMtoCanvas({x:-20,y:-20}),d=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+l,y:this.canvas.frame.canvas.clientHeight+l}),c={top:h.y,left:h.x,bottom:d.y,right:d.x},f=[],v=0;v0&&arguments[0]!==void 0?arguments[0]:this.pixelRatio;this.initialized===!0&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}},{key:"_setCameraState",value:function(){if(this.cameraState.scale!==void 0&&this.frame.canvas.clientWidth!==0&&this.frame.canvas.clientHeight!==0&&this.pixelRatio!==0&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){var e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,n=this.cameraState.scale;e!=1&&t!=1?n=this.cameraState.scale*.5*(e+t):e!=1?n=this.cameraState.scale*e:t!=1&&(n=this.cameraState.scale*t),this.body.view.scale=n;var a=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),o={x:a.x-this.cameraState.position.x,y:a.y-this.cameraState.position.y};this.body.view.translation.x+=o.x*this.body.view.scale,this.body.view.translation.y+=o.y*this.body.view.scale}}},{key:"_prepareValue",value:function(e){if(typeof e=="number")return e+"px";if(typeof e=="string"){if(ie(e).call(e,"%")!==-1||ie(e).call(e,"px")!==-1)return e;if(ie(e).call(e,"%")===-1)return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}},{key:"_create",value:function(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=0,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext)this._setPixelRatio(),this.setTransform();else{var e=document.createElement("DIV");e.style.color="red",e.style.fontWeight="bold",e.style.padding="10px",e.innerText="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(e)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}},{key:"_bindHammer",value:function(){var e=this;this.hammer!==void 0&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new Kn(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:Kn.DIRECTION_ALL}),Zu(this.hammer,function(t){e.body.eventListeners.onTouch(t)}),this.hammer.on("tap",function(t){e.body.eventListeners.onTap(t)}),this.hammer.on("doubletap",function(t){e.body.eventListeners.onDoubleTap(t)}),this.hammer.on("press",function(t){e.body.eventListeners.onHold(t)}),this.hammer.on("panstart",function(t){e.body.eventListeners.onDragStart(t)}),this.hammer.on("panmove",function(t){e.body.eventListeners.onDrag(t)}),this.hammer.on("panend",function(t){e.body.eventListeners.onDragEnd(t)}),this.hammer.on("pinch",function(t){e.body.eventListeners.onPinch(t)}),this.frame.canvas.addEventListener("wheel",function(t){e.body.eventListeners.onMouseWheel(t)}),this.frame.canvas.addEventListener("mousemove",function(t){e.body.eventListeners.onMouseMove(t)}),this.frame.canvas.addEventListener("contextmenu",function(t){e.body.eventListeners.onContext(t)}),this.hammerFrame=new Kn(this.frame),NT(this.hammerFrame,function(t){e.body.eventListeners.onRelease(t)})}},{key:"setSize",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.width,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.height;e=this._prepareValue(e),t=this._prepareValue(t);var n=!1,a=this.frame.canvas.width,o=this.frame.canvas.height,s=this.pixelRatio;if(this._setPixelRatio(),e!=this.options.width||t!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=t)this._getCameraState(s),this.frame.style.width=e,this.frame.style.height=t,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=e,this.options.height=t,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},n=!0;else{var u=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),l=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==u||this.frame.canvas.height!==l)&&this._getCameraState(s),this.frame.canvas.width!==u&&(this.frame.canvas.width=u,n=!0),this.frame.canvas.height!==l&&(this.frame.canvas.height=l,n=!0)}return n===!0&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(a/this.pixelRatio),oldHeight:Math.round(o/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,n}},{key:"getContext",value:function(){return this.frame.canvas.getContext("2d")}},{key:"_determinePixelRatio",value:function(){var e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");var t=1;typeof window<"u"&&(t=window.devicePixelRatio||1);var n=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/n}},{key:"_setPixelRatio",value:function(){this.pixelRatio=this._determinePixelRatio()}},{key:"setTransform",value:function(){var e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}},{key:"_XconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.x)/this.body.view.scale}},{key:"_XconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.x}},{key:"_YconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.y)/this.body.view.scale}},{key:"_YconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.y}},{key:"canvasToDOM",value:function(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}},{key:"DOMtoCanvas",value:function(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}}]),i}();function cfe(i,r){var e=Fe({nodes:r,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},i??{});if(!le(e.nodes))throw new TypeError("Nodes has to be an array of ids.");if(e.nodes.length===0&&(e.nodes=r),!(typeof e.minZoomLevel=="number"&&e.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!(typeof e.maxZoomLevel=="number"&&e.minZoomLevel<=e.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return e}var dfe=function(){function i(r,e){var t,n=this,a;N(this,i),this.body=r,this.canvas=e,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction="easeInOutQuint",this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on("fit",P(t=this.fit).call(t,this)),this.body.emitter.on("animationFinished",function(){n.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",P(a=this.releaseNode).call(a,this))}return M(i,[{key:"setOptions",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=e}},{key:"fit",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;e=cfe(e,this.body.nodeIndices);var n=this.canvas.frame.canvas.clientWidth,a=this.canvas.frame.canvas.clientHeight,o,s;if(n===0||a===0)s=1,o=vt.getRange(this.body.nodes,e.nodes);else if(t===!0){var u=0;for(var l in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,l)){var h=this.body.nodes[l];h.predefinedPosition===!0&&(u+=1)}if(u>.5*this.body.nodeIndices.length){this.fit(e,!1);return}o=vt.getRange(this.body.nodes,e.nodes);var d=this.body.nodeIndices.length;s=12.662/(d+7.4147)+.0964822;var c=Math.min(n/600,a/600);s*=c}else{this.body.emitter.emit("_resizeNodes"),o=vt.getRange(this.body.nodes,e.nodes);var f=Math.abs(o.maxX-o.minX)*1.1,v=Math.abs(o.maxY-o.minY)*1.1,p=n/f,g=a/v;s=p<=g?p:g}s>e.maxZoomLevel?s=e.maxZoomLevel:s1&&arguments[1]!==void 0?arguments[1]:{};if(this.body.nodes[e]!==void 0){var n={x:this.body.nodes[e].x,y:this.body.nodes[e].y};t.position=n,t.lockedOnNode=e,this.moveTo(t)}else console.error("Node: "+e+" cannot be found.")}},{key:"moveTo",value:function(e){if(e===void 0){e={};return}if(e.offset!=null){if(e.offset.x!=null){if(e.offset.x=+e.offset.x,!Pi(e.offset.x))throw new TypeError('The option "offset.x" has to be a finite number.')}else e.offset.x=0;if(e.offset.y!=null){if(e.offset.y=+e.offset.y,!Pi(e.offset.y))throw new TypeError('The option "offset.y" has to be a finite number.')}else e.offset.x=0}else e.offset={x:0,y:0};if(e.position!=null){if(e.position.x!=null){if(e.position.x=+e.position.x,!Pi(e.position.x))throw new TypeError('The option "position.x" has to be a finite number.')}else e.position.x=0;if(e.position.y!=null){if(e.position.y=+e.position.y,!Pi(e.position.y))throw new TypeError('The option "position.y" has to be a finite number.')}else e.position.x=0}else e.position=this.getViewPosition();if(e.scale!=null){if(e.scale=+e.scale,!(e.scale>0))throw new TypeError('The option "scale" has to be a number greater than zero.')}else e.scale=this.body.view.scale;e.animation===void 0&&(e.animation={duration:0}),e.animation===!1&&(e.animation={duration:0}),e.animation===!0&&(e.animation={}),e.animation.duration===void 0&&(e.animation.duration=1e3),e.animation.easingFunction===void 0&&(e.animation.easingFunction="easeInOutQuad"),this.animateView(e)}},{key:"animateView",value:function(e){if(e!==void 0){this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),e.locked===!0&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),this.easingTime!=0&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;var t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),n={x:t.x-e.position.x,y:t.y-e.position.y};if(this.targetTranslation={x:this.sourceTranslation.x+n.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+n.y*this.targetScale+e.offset.y},e.animation.duration===0)if(this.lockedOnNodeId!=null){var a;this.viewFunction=P(a=this._lockedRedraw).call(a,this),this.body.emitter.on("initRedraw",this.viewFunction)}else this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw");else{var o;this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=P(o=this._transitionRedraw).call(o,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}}},{key:"_lockedRedraw",value:function(){var e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),n={x:t.x-e.x,y:t.y-e.y},a=this.body.view.translation,o={x:a.x+n.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:a.y+n.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=o}},{key:"releaseNode",value:function(){this.lockedOnNodeId!==void 0&&this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}},{key:"_transitionRedraw",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;var t=Yae[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},this.easingTime>=1){if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,this.lockedOnNodeId!=null){var n;this.viewFunction=P(n=this._lockedRedraw).call(n,this),this.body.emitter.on("initRedraw",this.viewFunction)}this.body.emitter.emit("animationFinished")}}},{key:"getScale",value:function(){return this.body.view.scale}},{key:"getViewPosition",value:function(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}]),i}();function p$(i){var r=i&&i.preventDefault||!1,e=i&&i.container||window,t={},n={keydown:{},keyup:{}},a={},o;for(o=97;o<=122;o++)a[String.fromCharCode(o)]={code:65+(o-97),shift:!1};for(o=65;o<=90;o++)a[String.fromCharCode(o)]={code:o,shift:!0};for(o=0;o<=9;o++)a[""+o]={code:48+o,shift:!1};for(o=1;o<=12;o++)a["F"+o]={code:111+o,shift:!1};for(o=0;o<=9;o++)a["num"+o]={code:96+o,shift:!1};a["num*"]={code:106,shift:!1},a["num+"]={code:107,shift:!1},a["num-"]={code:109,shift:!1},a["num/"]={code:111,shift:!1},a["num."]={code:110,shift:!1},a.left={code:37,shift:!1},a.up={code:38,shift:!1},a.right={code:39,shift:!1},a.down={code:40,shift:!1},a.space={code:32,shift:!1},a.enter={code:13,shift:!1},a.shift={code:16,shift:void 0},a.esc={code:27,shift:!1},a.backspace={code:8,shift:!1},a.tab={code:9,shift:!1},a.ctrl={code:17,shift:!1},a.alt={code:18,shift:!1},a.delete={code:46,shift:!1},a.pageup={code:33,shift:!1},a.pagedown={code:34,shift:!1},a["="]={code:187,shift:!1},a["-"]={code:189,shift:!1},a["]"]={code:221,shift:!1},a["["]={code:219,shift:!1};var s=function(h){l(h,"keydown")},u=function(h){l(h,"keyup")},l=function(h,d){if(n[d][h.keyCode]!==void 0){for(var c=n[d][h.keyCode],f=0;f700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=new Date().valueOf())}},{key:"_stopMovement",value:function(){for(var e in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,e)&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}},{key:"_moveUp",value:function(){this.body.view.translation.y+=this.options.keyboard.speed.y}},{key:"_moveDown",value:function(){this.body.view.translation.y-=this.options.keyboard.speed.y}},{key:"_moveLeft",value:function(){this.body.view.translation.x+=this.options.keyboard.speed.x}},{key:"_moveRight",value:function(){this.body.view.translation.x-=this.options.keyboard.speed.x}},{key:"_zoomIn",value:function(){var e=this.body.view.scale,t=this.body.view.scale*(1+this.options.keyboard.speed.zoom),n=this.body.view.translation,a=t/e,o=(1-a)*this.canvas.canvasViewCenter.x+n.x*a,s=(1-a)*this.canvas.canvasViewCenter.y+n.y*a;this.body.view.scale=t,this.body.view.translation={x:o,y:s},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}},{key:"_zoomOut",value:function(){var e=this.body.view.scale,t=this.body.view.scale/(1+this.options.keyboard.speed.zoom),n=this.body.view.translation,a=t/e,o=(1-a)*this.canvas.canvasViewCenter.x+n.x*a,s=(1-a)*this.canvas.canvasViewCenter.y+n.y*a;this.body.view.scale=t,this.body.view.translation={x:o,y:s},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}},{key:"configureKeyboardBindings",value:function(){var e=this;if(this.keycharm!==void 0&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=p$({container:window,preventDefault:!0}):this.keycharm=p$({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0)){var t,n,a,o,s,u,l,h,d,c,f,v,p,g,y,m,b,$,S,_,R,B,I,C;P(t=this.keycharm).call(t,"up",function(){e.bindToRedraw("_moveUp")},"keydown"),P(n=this.keycharm).call(n,"down",function(){e.bindToRedraw("_moveDown")},"keydown"),P(a=this.keycharm).call(a,"left",function(){e.bindToRedraw("_moveLeft")},"keydown"),P(o=this.keycharm).call(o,"right",function(){e.bindToRedraw("_moveRight")},"keydown"),P(s=this.keycharm).call(s,"=",function(){e.bindToRedraw("_zoomIn")},"keydown"),P(u=this.keycharm).call(u,"num+",function(){e.bindToRedraw("_zoomIn")},"keydown"),P(l=this.keycharm).call(l,"num-",function(){e.bindToRedraw("_zoomOut")},"keydown"),P(h=this.keycharm).call(h,"-",function(){e.bindToRedraw("_zoomOut")},"keydown"),P(d=this.keycharm).call(d,"[",function(){e.bindToRedraw("_zoomOut")},"keydown"),P(c=this.keycharm).call(c,"]",function(){e.bindToRedraw("_zoomIn")},"keydown"),P(f=this.keycharm).call(f,"pageup",function(){e.bindToRedraw("_zoomIn")},"keydown"),P(v=this.keycharm).call(v,"pagedown",function(){e.bindToRedraw("_zoomOut")},"keydown"),P(p=this.keycharm).call(p,"up",function(){e.unbindFromRedraw("_moveUp")},"keyup"),P(g=this.keycharm).call(g,"down",function(){e.unbindFromRedraw("_moveDown")},"keyup"),P(y=this.keycharm).call(y,"left",function(){e.unbindFromRedraw("_moveLeft")},"keyup"),P(m=this.keycharm).call(m,"right",function(){e.unbindFromRedraw("_moveRight")},"keyup"),P(b=this.keycharm).call(b,"=",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),P($=this.keycharm).call($,"num+",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),P(S=this.keycharm).call(S,"num-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),P(_=this.keycharm).call(_,"-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),P(R=this.keycharm).call(R,"[",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),P(B=this.keycharm).call(B,"]",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),P(I=this.keycharm).call(I,"pageup",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),P(C=this.keycharm).call(C,"pagedown",function(){e.unbindFromRedraw("_zoomOut")},"keyup")}}}]),i}();function vfe(i,r){var e=typeof mi<"u"&&un(i)||i["@@iterator"];if(!e){if(le(i)||(e=pfe(i))||r){e&&(i=e);var t=0,n=function(){};return{s:n,n:function(){return t>=i.length?{done:!0}:{done:!1,value:i[t++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(i)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function pfe(i,r){var e;if(i){if(typeof i=="string")return g$(i,r);var t=rt(e=Object.prototype.toString.call(i)).call(e,8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return sn(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return g$(i,r)}}function g$(i,r){(r==null||r>i.length)&&(r=i.length);for(var e=0,t=new Array(r);e50&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=new Date().valueOf())}},{key:"onTap",value:function(e){var t=this.getPointer(e.center),n=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,n),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t)}},{key:"onDoubleTap",value:function(e){var t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("doubleClick",e,t)}},{key:"onHold",value:function(e){var t=this.getPointer(e.center),n=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,n),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t),this.selectionHandler.generateClickEvent("hold",e,t)}},{key:"onRelease",value:function(e){if(new Date().valueOf()-this.touchTime>10){var t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("release",e,t),this.touchTime=new Date().valueOf()}}},{key:"onContext",value:function(e){var t=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler.generateClickEvent("oncontext",e,t)}},{key:"checkSelectionChanges",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;t===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e)}},{key:"_determineDifference",value:function(e,t){var n=function(o,s){for(var u=[],l=0;l=o.minX&&d.x<=o.maxX&&d.y>=o.minY&&d.y<=o.maxY});de(s).call(s,function(h){return t.selectionHandler.selectObject(t.body.nodes[h])});var u=this.getPointer(e.center);this.selectionHandler.commitAndEmit(u,e),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{var l=this.drag.selection;l&&l.length?(de(l).call(l,function(h){h.node.options.fixed.x=h.xFixed,h.node.options.fixed.y=h.yFixed}),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}}},{key:"onPinch",value:function(e){var t=this.getPointer(e.center);this.drag.pinched=!0,this.pinch.scale===void 0&&(this.pinch.scale=1);var n=this.pinch.scale*e.scale;this.zoom(n,t)}},{key:"zoom",value:function(e,t){if(this.options.zoomView===!0){var n=this.body.view.scale;e<1e-5&&(e=1e-5),e>10&&(e=10);var a=void 0;this.drag!==void 0&&this.drag.dragging===!0&&(a=this.canvas.DOMtoCanvas(this.drag.pointer));var o=this.body.view.translation,s=e/n,u=(1-s)*t.x+o.x*s,l=(1-s)*t.y+o.y*s;if(this.body.view.scale=e,this.body.view.translation={x:u,y:l},a!=null){var h=this.canvas.canvasToDOM(a);this.drag.pointer.x=h.x,this.drag.pointer.y=h.y}this.body.emitter.emit("_requestRedraw"),n0&&(this.popupObj=h[c[c.length-1]],s=!0)}if(this.popupObj===void 0&&s===!1){for(var v=this.body.edgeIndices,p=this.body.edges,g,y=[],m=0;m0&&(this.popupObj=p[y[y.length-1]],u="edge")}this.popupObj!==void 0?this.popupObj.id!==o&&(this.popup===void 0&&(this.popup=new ioe(this.canvas.frame)),this.popup.popupTargetType=u,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):this.popup!==void 0&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}},{key:"_checkHidePopup",value:function(e){var t=this.selectionHandler._pointerToPositionObject(e),n=!1;if(this.popup.popupTargetType==="node"){if(this.body.nodes[this.popup.popupTargetId]!==void 0&&(n=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t),n===!0)){var a=this.selectionHandler.getNodeAt(e);n=a===void 0?!1:a.id===this.popup.popupTargetId}}else this.selectionHandler.getNodeAt(e)===void 0&&this.body.edges[this.popup.popupTargetId]!==void 0&&(n=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));n===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}]),i}(),yfe=lp,mfe=fT;yfe("Set",function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},mfe);var bfe=ae,$fe=bfe.Set,wfe=$fe,_fe=wfe,Efe=_fe,Ti=W(Efe),Sfe=oe,y$=hp,tu=Ql.getWeakData,Ofe=up,Tfe=Wt,Ife=Sa,fd=Xe,kfe=sp,MT=yi,m$=Je,BT=on,Pfe=BT.set,xfe=BT.getterFor,Cfe=MT.find,Afe=MT.findIndex,Dfe=Sfe([].splice),Rfe=0,ru=function(i){return i.frozen||(i.frozen=new FT)},FT=function(){this.entries=[]},vd=function(i,r){return Cfe(i.entries,function(e){return e[0]===r})};FT.prototype={get:function(i){var r=vd(this,i);if(r)return r[1]},has:function(i){return!!vd(this,i)},set:function(i,r){var e=vd(this,i);e?e[1]=r:this.entries.push([i,r])},delete:function(i){var r=Afe(this.entries,function(e){return e[0]===i});return~r&&Dfe(this.entries,r,1),!!~r}};var Nfe={getConstructor:function(i,r,e,t){var n=i(function(u,l){Ofe(u,a),Pfe(u,{type:r,id:Rfe++,frozen:void 0}),Ife(l)||kfe(l,u[t],{that:u,AS_ENTRIES:e})}),a=n.prototype,o=xfe(r),s=function(u,l,h){var d=o(u),c=tu(Tfe(l),!0);return c===!0?ru(d).set(l,h):c[d.id]=h,u};return y$(a,{delete:function(u){var l=o(this);if(!fd(u))return!1;var h=tu(u);return h===!0?ru(l).delete(u):h&&m$(h,l.id)&&delete h[l.id]},has:function(l){var h=o(this);if(!fd(l))return!1;var d=tu(l);return d===!0?ru(h).has(l):d&&m$(d,h.id)}}),y$(a,e?{get:function(l){var h=o(this);if(fd(l)){var d=tu(l);return d===!0?ru(h).get(l):d?d[h.id]:void 0}},set:function(l,h){return s(this,l,h)}}:{add:function(l){return s(this,l,!0)}}),n}},Mfe=lT,b$=Ie,Eu=oe,$$=hp,Bfe=Ql,Ffe=lp,jT=Nfe,iu=Xe,nu=on.enforce,jfe=ne,Lfe=QE,ps=Object,zfe=Array.isArray,au=ps.isExtensible,LT=ps.isFrozen,Hfe=ps.isSealed,zT=ps.freeze,Wfe=ps.seal,w$={},_$={},Vfe=!b$.ActiveXObject&&"ActiveXObject"in b$,Wa,HT=function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},WT=Ffe("WeakMap",HT,jT),xn=WT.prototype,Su=Eu(xn.set),Ufe=function(){return Mfe&&jfe(function(){var i=zT([]);return Su(new WT,i,1),!LT(i)})};if(Lfe)if(Vfe){Wa=jT.getConstructor(HT,"WeakMap",!0),Bfe.enable();var E$=Eu(xn.delete),ou=Eu(xn.has),S$=Eu(xn.get);$$(xn,{delete:function(i){if(iu(i)&&!au(i)){var r=nu(this);return r.frozen||(r.frozen=new Wa),E$(this,i)||r.frozen.delete(i)}return E$(this,i)},has:function(r){if(iu(r)&&!au(r)){var e=nu(this);return e.frozen||(e.frozen=new Wa),ou(this,r)||e.frozen.has(r)}return ou(this,r)},get:function(r){if(iu(r)&&!au(r)){var e=nu(this);return e.frozen||(e.frozen=new Wa),ou(this,r)?S$(this,r):e.frozen.get(r)}return S$(this,r)},set:function(r,e){if(iu(r)&&!au(r)){var t=nu(this);t.frozen||(t.frozen=new Wa),ou(this,r)?Su(this,r,e):t.frozen.set(r,e)}else Su(this,r,e);return this}})}else Ufe()&&$$(xn,{set:function(r,e){var t;return zfe(r)&&(LT(r)?t=w$:Hfe(r)&&(t=_$)),Su(this,r,e),t===w$&&zT(r),t===_$&&Wfe(r),this}});var Kfe=ae,Gfe=Kfe.WeakMap,qfe=Gfe,Yfe=qfe,Xfe=Yfe,no=W(Xfe);function fe(i,r,e,t){if(e==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?i!==r||!t:!r.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?t:e==="a"?t.call(i):t?t.value:r.get(i)}function Rf(i,r,e,t,n){if(typeof r=="function"?i!==r||!0:!r.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r.set(i,e),e}function Nf(i,r){var e=typeof mi<"u"&&un(i)||i["@@iterator"];if(!e){if(le(i)||(e=Jfe(i))||r){e&&(i=e);var t=0,n=function(){};return{s:n,n:function(){return t>=i.length?{done:!0}:{done:!1,value:i[t++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(i)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Jfe(i,r){var e;if(i){if(typeof i=="string")return O$(i,r);var t=rt(e=Object.prototype.toString.call(i)).call(e,8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return sn(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return O$(i,r)}}function O$(i,r){(r==null||r>i.length)&&(r=i.length);for(var e=0,t=new Array(r);e0&&arguments[0]!==void 0?arguments[0]:function(){};N(this,i),Kr.set(this,new I$),Gr.set(this,new I$),Ou.set(this,void 0),Rf(this,Ou,r)}return M(i,[{key:"sizeNodes",get:function(){return fe(this,Kr,"f").size}},{key:"sizeEdges",get:function(){return fe(this,Gr,"f").size}},{key:"getNodes",value:function(){return fe(this,Kr,"f").getSelection()}},{key:"getEdges",value:function(){return fe(this,Gr,"f").getSelection()}},{key:"addNodes",value:function(){var e;(e=fe(this,Kr,"f")).add.apply(e,arguments)}},{key:"addEdges",value:function(){var e;(e=fe(this,Gr,"f")).add.apply(e,arguments)}},{key:"deleteNodes",value:function(e){fe(this,Kr,"f").delete(e)}},{key:"deleteEdges",value:function(e){fe(this,Gr,"f").delete(e)}},{key:"clear",value:function(){fe(this,Kr,"f").clear(),fe(this,Gr,"f").clear()}},{key:"commit",value:function(){for(var e,t,n={nodes:fe(this,Kr,"f").commit(),edges:fe(this,Gr,"f").commit()},a=arguments.length,o=new Array(a),s=0;s=i.length?{done:!0}:{done:!1,value:i[t++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(i)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Qfe(i,r){var e;if(i){if(typeof i=="string")return P$(i,r);var t=rt(e=Object.prototype.toString.call(i)).call(e,8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return sn(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return P$(i,r)}}function P$(i,r){(r==null||r>i.length)&&(r=i.length);for(var e=0,t=new Array(r);e4&&arguments[4]!==void 0?arguments[4]:!1,s=this._initBaseEvent(t,n);if(o===!0)s.nodes=[],s.edges=[];else{var u=this.getSelection();s.nodes=u.nodes,s.edges=u.edges}a!==void 0&&(s.previousSelection=a),e=="click"&&(s.items=this.getClickedItems(n)),t.controlEdge!==void 0&&(s.controlEdge=t.controlEdge),this.body.emitter.emit(e,s)}},{key:"selectObject",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.selectConnectedEdges;if(e!==void 0){if(e instanceof Nt){if(t===!0){var n;(n=this._selectionAccumulator).addEdges.apply(n,dr(e.edges))}this._selectionAccumulator.addNodes(e)}else this._selectionAccumulator.addEdges(e);return!0}return!1}},{key:"deselectObject",value:function(e){e.isSelected()===!0&&(e.selected=!1,this._removeFromSelection(e))}},{key:"_getAllNodesOverlappingWith",value:function(e){for(var t=[],n=this.body.nodes,a=0;a1&&arguments[1]!==void 0?arguments[1]:!0,n=this._pointerToPositionObject(e),a=this._getAllNodesOverlappingWith(n);if(a.length>0)return t===!0?this.body.nodes[a[a.length-1]]:a[a.length-1]}},{key:"_getEdgesOverlappingWith",value:function(e,t){for(var n=this.body.edges,a=0;a1&&arguments[1]!==void 0?arguments[1]:!0,n=this.canvas.DOMtoCanvas(e),a=10,o=null,s=this.body.edges,u=0;u0&&(this.generateClickEvent("deselectEdge",t,e,o),n=!0),a.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",t,e,o),n=!0),a.nodes.added.length>0&&(this.generateClickEvent("selectNode",t,e),n=!0),a.edges.added.length>0&&(this.generateClickEvent("selectEdge",t,e),n=!0),n===!0&&this.generateClickEvent("select",t,e)}},{key:"getSelection",value:function(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}},{key:"getSelectedNodes",value:function(){return this._selectionAccumulator.getNodes()}},{key:"getSelectedEdges",value:function(){return this._selectionAccumulator.getEdges()}},{key:"getSelectedNodeIds",value:function(){var e;return ia(e=this._selectionAccumulator.getNodes()).call(e,function(t){return t.id})}},{key:"getSelectedEdgeIds",value:function(){var e;return ia(e=this._selectionAccumulator.getEdges()).call(e,function(t){return t.id})}},{key:"setSelection",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e||!e.nodes&&!e.edges)throw new TypeError("Selection must be an object with nodes and/or edges properties");if((t.unselectAll||t.unselectAll===void 0)&&this.unselectAll(),e.nodes){var n=k$(e.nodes),a;try{for(n.s();!(a=n.n()).done;){var o=a.value,s=this.body.nodes[o];if(!s)throw new RangeError('Node with id "'+o+'" not found');this.selectObject(s,t.highlightEdges)}}catch(c){n.e(c)}finally{n.f()}}if(e.edges){var u=k$(e.edges),l;try{for(u.s();!(l=u.n()).done;){var h=l.value,d=this.body.edges[h];if(!d)throw new RangeError('Edge with id "'+h+'" not found');this.selectObject(d)}}catch(c){u.e(c)}finally{u.f()}}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}},{key:"selectNodes",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({nodes:e},{highlightEdges:t})}},{key:"selectEdges",value:function(e){if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({edges:e})}},{key:"updateSelection",value:function(){for(var e in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,e.id)||this._selectionAccumulator.deleteNodes(e);for(var t in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,t.id)||this._selectionAccumulator.deleteEdges(t)}},{key:"getClickedItems",value:function(e){for(var t=this.canvas.DOMtoCanvas(e),n=[],a=this.body.nodeIndices,o=this.body.nodes,s=a.length-1;s>=0;s--){var u=o[a[s]],l=u.getItemsOnPoint(t);n.push.apply(n,l)}for(var h=this.body.edgeIndices,d=this.body.edges,c=h.length-1;c>=0;c--){var f=d[h[c]],v=f.getItemsOnPoint(t);n.push.apply(n,v)}return n}}]),i}(),x$=IS,tve=Math.floor,Mf=function(i,r){var e=i.length,t=tve(e/2);return e<8?rve(i,r):ive(i,Mf(x$(i,0,t),r),Mf(x$(i,t),r),r)},rve=function(i,r){for(var e=i.length,t=1,n,a;t0;)i[a]=i[--a];a!==t++&&(i[a]=n)}return i},ive=function(i,r,e,t){for(var n=r.length,a=e.length,o=0,s=0;o3)){if(yve)return!0;if(B$)return B$<603;var i="",r,e,t,n;for(r=65;r<76;r++){switch(e=String.fromCharCode(r),r){case 66:case 69:case 70:case 72:t=3;break;case 68:case 71:t=4;break;default:t=2}for(n=0;n<47;n++)ei.push({k:e+n,v:t})}for(ei.sort(function(a,o){return o.v-a.v}),n=0;nR$(e)?1:-1}};cve({target:"Array",proto:!0,forced:_ve},{sort:function(r){r!==void 0&&dve(r);var e=fve(this);if(UT)return r===void 0?F$(e):F$(e,r);var t=[],n=D$(e),a,o;for(o=0;o=0:s>u;u+=l)u in o&&(n=e(n,o[u],u,a));return n}},Bve={left:j$(!1),right:j$(!0)},Fve=Ie,jve=zr,Lve=jve(Fve.process)==="process",zve=q,Hve=Bve.left,Wve=Da,L$=Yo,Vve=Lve,Uve=!Vve&&L$>79&&L$<83,Kve=Uve||!Wve("reduce");zve({target:"Array",proto:!0,forced:Kve},{reduce:function(r){var e=arguments.length;return Hve(this,r,e,e>1?arguments[1]:void 0)}});var Gve=Ze,qve=Gve("Array").reduce,Yve=Re,Xve=qve,gd=Array.prototype,Jve=function(i){var r=i.reduce;return i===gd||Yve(gd,i)&&r===gd.reduce?Xve:r},Zve=Jve,Qve=Zve,epe=Qve,KT=W(epe);function GT(i){var r=tpe();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return he(this,n)}}function tpe(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var qT=function(){function i(){N(this,i)}return M(i,[{key:"abstract",value:function(){throw new Error("Can't instantiate abstract class!")}},{key:"fake_use",value:function(){}},{key:"curveType",value:function(){return this.abstract()}},{key:"getPosition",value:function(e){return this.fake_use(e),this.abstract()}},{key:"setPosition",value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;this.fake_use(e,t,n),this.abstract()}},{key:"getTreeSize",value:function(e){return this.fake_use(e),this.abstract()}},{key:"sort",value:function(e){this.fake_use(e),this.abstract()}},{key:"fix",value:function(e,t){this.fake_use(e,t),this.abstract()}},{key:"shift",value:function(e,t){this.fake_use(e,t),this.abstract()}}]),i}(),rpe=function(i){se(e,i);var r=GT(e);function e(t){var n;return N(this,e),n=r.call(this),n.layout=t,n}return M(e,[{key:"curveType",value:function(){return"horizontal"}},{key:"getPosition",value:function(n){return n.x}},{key:"setPosition",value:function(n,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;o!==void 0&&this.layout.hierarchical.addToOrdering(n,o),n.x=a}},{key:"getTreeSize",value:function(n){var a=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,n);return{min:a.min_x,max:a.max_x}}},{key:"sort",value:function(n){ao(n).call(n,function(a,o){return a.x-o.x})}},{key:"fix",value:function(n,a){n.y=this.layout.options.hierarchical.levelSeparation*a,n.options.fixed.y=!0}},{key:"shift",value:function(n,a){this.layout.body.nodes[n].x+=a}}]),e}(qT),ipe=function(i){se(e,i);var r=GT(e);function e(t){var n;return N(this,e),n=r.call(this),n.layout=t,n}return M(e,[{key:"curveType",value:function(){return"vertical"}},{key:"getPosition",value:function(n){return n.y}},{key:"setPosition",value:function(n,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;o!==void 0&&this.layout.hierarchical.addToOrdering(n,o),n.y=a}},{key:"getTreeSize",value:function(n){var a=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,n);return{min:a.min_y,max:a.max_y}}},{key:"sort",value:function(n){ao(n).call(n,function(a,o){return a.y-o.y})}},{key:"fix",value:function(n,a){n.x=this.layout.options.hierarchical.levelSeparation*a,n.options.fixed.x=!0}},{key:"shift",value:function(n,a){this.layout.body.nodes[n].y+=a}}]),e}(qT),npe=q,ape=yi.every,ope=Da,spe=ope("every");npe({target:"Array",proto:!0,forced:!spe},{every:function(r){return ape(this,r,arguments.length>1?arguments[1]:void 0)}});var upe=Ze,lpe=upe("Array").every,hpe=Re,cpe=lpe,yd=Array.prototype,dpe=function(i){var r=i.every;return i===yd||hpe(yd,i)&&r===yd.every?cpe:r},fpe=dpe,vpe=fpe,ppe=vpe,YT=W(ppe);function gpe(i,r){var e=typeof mi<"u"&&un(i)||i["@@iterator"];if(!e){if(le(i)||(e=ype(i))||r){e&&(i=e);var t=0,n=function(){};return{s:n,n:function(){return t>=i.length?{done:!0}:{done:!1,value:i[t++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(i)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function ype(i,r){var e;if(i){if(typeof i=="string")return z$(i,r);var t=rt(e=Object.prototype.toString.call(i)).call(e,8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return sn(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return z$(i,r)}}function z$(i,r){(r==null||r>i.length)&&(r=i.length);for(var e=0,t=new Array(r);e=r[a])&&(r[a]=r[n]+1)}),r}function bpe(i){return XT(function(r){var e,t;return YT(e=Ot(t=r.edges).call(t,function(n){return i.has(n.toId)})).call(e,function(n){return n.to===r})},function(r,e){return e>r},"from",i)}function $pe(i){return XT(function(r){var e,t;return YT(e=Ot(t=r.edges).call(t,function(n){return i.has(n.toId)})).call(e,function(n){return n.from===r})},function(r,e){return eo)return{v:{v:mpe(t,a)}};++m},S;b=y.pop();)if(S=$(),S!==0&&S)return S.v},c;for(l.s();!(h=l.n()).done;)if(c=d(),c!==0&&c)return c.v}catch(f){l.e(f)}finally{l.f()}return a}var wpe=function(){function i(){N(this,i),this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}return M(i,[{key:"addRelation",value:function(e,t){this.childrenReference[e]===void 0&&(this.childrenReference[e]=[]),this.childrenReference[e].push(t),this.parentReference[t]===void 0&&(this.parentReference[t]=[]),this.parentReference[t].push(e)}},{key:"checkIfTree",value:function(){for(var e in this.parentReference)if(this.parentReference[e].length>1){this.isTree=!1;return}this.isTree=!0}},{key:"numTrees",value:function(){return this.treeIndex+1}},{key:"setTreeIndex",value:function(e,t){t!==void 0&&this.trees[e.id]===void 0&&(this.trees[e.id]=t,this.treeIndex=Math.max(t,this.treeIndex))}},{key:"ensureLevel",value:function(e){this.levels[e]===void 0&&(this.levels[e]=0)}},{key:"getMaxLevel",value:function(e){var t=this,n={},a=function o(s){if(n[s]!==void 0)return n[s];var u=t.levels[s];if(t.childrenReference[s]){var l=t.childrenReference[s];if(l.length>0)for(var h=0;h0&&(n.levelSeparation*=-1):n.levelSeparation<0&&(n.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(a===!0)return this.body.emitter.emit("refresh"),ve(t,this.optionsBackup)}return t}},{key:"_resetRNG",value:function(e){this.initialRandomSeed=e,this._rng=Zl(this.initialRandomSeed)}},{key:"adaptAllOptionsForHierarchicalLayout",value:function(e){if(this.options.hierarchical.enabled===!0){var t=this.optionsBackup.physics;e.physics===void 0||e.physics===!0?(e.physics={enabled:t.enabled===void 0?!0:t.enabled,solver:"hierarchicalRepulsion"},t.enabled=t.enabled===void 0?!0:t.enabled,t.solver=t.solver||"barnesHut"):ce(e.physics)==="object"?(t.enabled=e.physics.enabled===void 0?!0:e.physics.enabled,t.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):e.physics!==!1&&(t.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});var n=this.direction.curveType();if(e.edges===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges={smooth:!1};else if(e.edges.smooth===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges.smooth=!1;else if(typeof e.edges.smooth=="boolean")this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:n};else{var a=e.edges.smooth;a.type!==void 0&&a.type!=="dynamic"&&(n=a.type),this.optionsBackup.edges={smooth:{enabled:a.enabled===void 0?!0:a.enabled,type:a.type===void 0?"dynamic":a.type,roundness:a.roundness===void 0?.5:a.roundness,forceDirection:a.forceDirection===void 0?!1:a.forceDirection}},e.edges.smooth={enabled:a.enabled===void 0?!0:a.enabled,type:n,roundness:a.roundness===void 0?.5:a.roundness,forceDirection:a.forceDirection===void 0?!1:a.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",n)}return e}},{key:"positionInitially",value:function(e){if(this.options.hierarchical.enabled!==!0){this._resetRNG(this.initialRandomSeed);for(var t=e.length+50,n=0;nu){for(var h=e.length;e.length>u&&s<=o;){s+=1;var d=e.length;s%3===0?this.body.modules.clustering.clusterBridges(l):this.body.modules.clustering.clusterOutliers(l);var c=e.length;if(d==c&&s%3!==0){this._declusterAll(),this.body.emitter.emit("_layoutFailed"),console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.");return}}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*h)})}s>o&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(e,this.body.edgeIndices,!0),this._shiftToCenter();for(var f=70,v=0;v0){var e,t,n=!1,a=!1;this.lastNodeOnLevel={},this.hierarchical=new wpe;for(t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&(e=this.body.nodes[t],e.options.level!==void 0?(n=!0,this.hierarchical.levels[t]=e.options.level):a=!0);if(a===!0&&n===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");if(a===!0){var o=this.options.hierarchical.sortMethod;o==="hubsize"?this._determineLevelsByHubsize():o==="directed"?this._determineLevelsDirected():o==="custom"&&this._determineLevelsCustomCallback()}for(var s in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,s)&&this.hierarchical.ensureLevel(s);var u=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(u),this._condenseHierarchy(),this._shiftToCenter()}}},{key:"_condenseHierarchy",value:function(){var e=this,t=!1,n={},a=function(){for(var b=s(),$=0,S=0;S0)for(var _=0;_1&&arguments[1]!==void 0?arguments[1]:1e9,S=1e9,_=1e9,R=1e9,B=-1e9;for(var I in b)if(Object.prototype.hasOwnProperty.call(b,I)){var C=e.body.nodes[I],j=e.hierarchical.levels[C.id],X=e.direction.getPosition(C),U=e._getSpaceAroundNode(C,b),$e=Se(U,2),Qe=$e[0],Ne=$e[1];S=Math.min(Qe,S),_=Math.min(Ne,_),j<=$&&(R=Math.min(X,R),B=Math.max(X,B))}return[R,B,S,_]},h=function(b,$){var S=e.hierarchical.getMaxLevel(b.id),_=e.hierarchical.getMaxLevel($.id);return Math.min(S,_)},d=function(b,$,S){for(var _=e.hierarchical,R=0;R<$.length;R++){var B=$[R],I=_.distributionOrdering[B];if(I.length>1)for(var C=0;C2&&arguments[2]!==void 0?arguments[2]:!1,_=e.direction.getPosition(b),R=e.direction.getPosition($),B=Math.abs(R-_),I=e.options.hierarchical.nodeSpacing;if(B>I){var C={},j={};u(b,C),u($,j);var X=h(b,$),U=l(C,X),$e=l(j,X),Qe=U[1],Ne=$e[0],At=$e[2],lt=Math.abs(Qe-Ne);if(lt>I){var nt=Qe-Ne+I;nt<-At+I&&(nt=-At+I),nt<0&&(e._shiftBlock($.id,nt),t=!0,S===!0&&e._centerParent($))}}},f=function(b,$){for(var S=$.id,_=$.edges,R=e.hierarchical.levels[$.id],B=e.options.hierarchical.levelSeparation*e.options.hierarchical.levelSeparation,I={},C=[],j=0;j<_.length;j++){var X=_[j];if(X.toId!=X.fromId){var U=X.toId==S?X.from:X.to;I[_[j].id]=U,e.hierarchical.levels[U.id]0?st=Math.min(Rt,Er-e.options.hierarchical.nodeSpacing):Rt<0&&(st=-Math.min(-Rt,ot-e.options.hierarchical.nodeSpacing)),st!=0&&(e._shiftBlock($.id,st),t=!0)},lt=function(at){var ge=e.direction.getPosition($),Me=e._getSpaceAroundNode($),xe=Se(Me,2),ot=xe[0],Er=xe[1],Rt=at-ge,st=ge;Rt>0?st=Math.min(ge+(Er-e.options.hierarchical.nodeSpacing),at):Rt<0&&(st=Math.max(ge-(ot-e.options.hierarchical.nodeSpacing),at)),st!==ge&&(e.direction.setPosition($,st),t=!0)},nt=Ne(b,C);At(nt),nt=Ne(b,_),lt(nt)},v=function(b){var $=e.hierarchical.getLevels();$=Mi($).call($);for(var S=0;S0&&Math.abs(v)0&&(h=this.direction.getPosition(a[s-1])+l),this.direction.setPosition(u,h,t),this._validatePositionAndContinue(u,t,h),o++}}}}},{key:"_placeBranchNodes",value:function(e,t){var n,a=this.hierarchical.childrenReference[e];if(a!==void 0){for(var o=[],s=0;st&&this.positionedNodes[l.id]===void 0){var d=this.options.hierarchical.nodeSpacing,c=void 0;u===0?c=this.direction.getPosition(this.body.nodes[e]):c=this.direction.getPosition(o[u-1])+d,this.direction.setPosition(l,c,h),this._validatePositionAndContinue(l,h,c)}else return}var f=this._getCenterPosition(o);this.direction.setPosition(this.body.nodes[e],f,t)}}},{key:"_validatePositionAndContinue",value:function(e,t,n){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[t]!==void 0){var a=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(n-ae.hierarchical.levels[a.id]&&e.hierarchical.addRelation(a.id,o.id)};this._crawlNetwork(t),this.hierarchical.checkIfTree()}},{key:"_crawlNetwork",value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},n=arguments.length>1?arguments[1]:void 0,a={},o=function c(f,v){if(a[f.id]===void 0){e.hierarchical.setTreeIndex(f,v),a[f.id]=!0;for(var p,g=e._getActiveEdges(f),y=0;y=i.length?{done:!0}:{done:!1,value:i[t++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(i)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Spe(i,r){var e;if(i){if(typeof i=="string")return H$(i,r);var t=rt(e=Object.prototype.toString.call(i)).call(e,8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return sn(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return H$(i,r)}}function H$(i,r){(r==null||r>i.length)&&(r=i.length);for(var e=0,t=new Array(r);e0&&this.options.deleteNode!==!1?(u===!0&&this._createSeperator(4),this._createDeleteButton(s)):n===0&&this.options.deleteEdge!==!1&&(u===!0&&this._createSeperator(4),this._createDeleteButton(s))),this._bindElementEvents(this.closeDiv,P(e=this.toggleEditMode).call(e,this)),this._temporaryBindEvent("select",P(t=this.showManipulatorToolbar).call(t,this))}this.body.emitter.emit("_redraw")}},{key:"addNodeMode",value:function(){var e;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var t,n=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(n),this._createSeperator(),this._createDescription(n.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,P(t=this.toggleEditMode).call(t,this))}this._temporaryBindEvent("click",P(e=this._performAddNode).call(e,this))}},{key:"editNode",value:function(){var e=this;this.editMode!==!0&&this.enableEditMode(),this._clean();var t=this.selectionHandler.getSelectedNodes()[0];if(t!==void 0)if(this.inMode="editNode",typeof this.options.editNode=="function")if(t.isCluster!==!0){var n=ve({},t.options,!1);if(n.x=t.x,n.y=t.y,this.options.editNode.length===2)this.options.editNode(n,function(a){a!=null&&e.inMode==="editNode"&&e.body.data.nodes.getDataSet().update(a),e.showManipulatorToolbar()});else throw new Error("The function for edit does not support two arguments (data, callback)")}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError);else throw new Error("No function has been configured to handle the editing of nodes.");else this.showManipulatorToolbar()}},{key:"addEdgeMode",value:function(){var e,t,n,a,o;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var s,u=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(u),this._createSeperator(),this._createDescription(u.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,P(s=this.toggleEditMode).call(s,this))}this._temporaryBindUI("onTouch",P(e=this._handleConnect).call(e,this)),this._temporaryBindUI("onDragEnd",P(t=this._finishConnect).call(t,this)),this._temporaryBindUI("onDrag",P(n=this._dragControlNode).call(n,this)),this._temporaryBindUI("onRelease",P(a=this._finishConnect).call(a,this)),this._temporaryBindUI("onDragStart",P(o=this._dragStartEdge).call(o,this)),this._temporaryBindUI("onHold",function(){})}},{key:"editEdgeMode",value:function(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",ce(this.options.editEdge)==="object"&&typeof this.options.editEdge.editWithoutDrag=="function"&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0)){var e=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(e.from.id,e.to.id);return}if(this.guiEnabled===!0){var t,n=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(n),this._createSeperator(),this._createDescription(n.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,P(t=this.toggleEditMode).call(t,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var a,o,s,u,l=this.body.edges[this.edgeBeingEditedId],h=this._getNewTargetNode(l.from.x,l.from.y),d=this._getNewTargetNode(l.to.x,l.to.y);this.temporaryIds.nodes.push(h.id),this.temporaryIds.nodes.push(d.id),this.body.nodes[h.id]=h,this.body.nodeIndices.push(h.id),this.body.nodes[d.id]=d,this.body.nodeIndices.push(d.id),this._temporaryBindUI("onTouch",P(a=this._controlNodeTouch).call(a,this)),this._temporaryBindUI("onTap",function(){}),this._temporaryBindUI("onHold",function(){}),this._temporaryBindUI("onDragStart",P(o=this._controlNodeDragStart).call(o,this)),this._temporaryBindUI("onDrag",P(s=this._controlNodeDrag).call(s,this)),this._temporaryBindUI("onDragEnd",P(u=this._controlNodeDragEnd).call(u,this)),this._temporaryBindUI("onMouseMove",function(){}),this._temporaryBindEvent("beforeDrawing",function(c){var f=l.edgeType.findBorderPositions(c);h.selected===!1&&(h.x=f.from.x,h.y=f.from.y),d.selected===!1&&(d.x=f.to.x,d.y=f.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}},{key:"deleteSelected",value:function(){var e=this;this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";var t=this.selectionHandler.getSelectedNodeIds(),n=this.selectionHandler.getSelectedEdgeIds(),a=void 0;if(t.length>0){for(var o=0;o0&&typeof this.options.deleteEdge=="function"&&(a=this.options.deleteEdge);if(typeof a=="function"){var s={nodes:t,edges:n};if(a.length===2)a(s,function(u){u!=null&&e.inMode==="delete"?(e.body.data.edges.getDataSet().remove(u.edges),e.body.data.nodes.getDataSet().remove(u.nodes),e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar()):(e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar())});else throw new Error("The function for delete does not support two arguments (data, callback)")}else this.body.data.edges.getDataSet().remove(n),this.body.data.nodes.getDataSet().remove(t),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}},{key:"_setup",value:function(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:"_createWrappers",value:function(){if(this.manipulationDiv===void 0&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),this.editModeDiv===void 0&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),this.closeDiv===void 0){var e,t;this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",(e=(t=this.options.locales[this.options.locale])===null||t===void 0?void 0:t.close)!==null&&e!==void 0?e:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv)}}},{key:"_getNewTargetNode",value:function(e,t){var n=ve({},this.options.controlNodeStyle);n.id="targetNode"+io(),n.hidden=!1,n.physics=!1,n.x=e,n.y=t;var a=this.body.functions.createNode(n);return a.shape.boundingBox={left:e,right:e,top:t,bottom:t},a}},{key:"_createEditButton",value:function(){var e;this._clean(),this.manipulationDOM={},Yr(this.editModeDiv);var t=this.options.locales[this.options.locale],n=this._createButton("editMode","vis-edit vis-edit-mode",t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(n),this._bindElementEvents(n,P(e=this.toggleEditMode).call(e,this))}},{key:"_clean",value:function(){this.inMode=!1,this.guiEnabled===!0&&(Yr(this.editModeDiv),Yr(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}},{key:"_cleanupDOMEventListeners",value:function(){var e,t=Epe(Cr(e=this._domEventListenerCleanupQueue).call(e,0)),n;try{for(t.s();!(n=t.n()).done;){var a=n.value;a()}}catch(o){t.e(o)}finally{t.f()}}},{key:"_removeManipulationDOM",value:function(){this._clean(),Yr(this.manipulationDiv),Yr(this.editModeDiv),Yr(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}},{key:"_createSeperator",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+e]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+e].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+e])}},{key:"_createAddNodeButton",value:function(e){var t,n=this._createButton("addNode","vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,P(t=this.addNodeMode).call(t,this))}},{key:"_createAddEdgeButton",value:function(e){var t,n=this._createButton("addEdge","vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,P(t=this.addEdgeMode).call(t,this))}},{key:"_createEditNodeButton",value:function(e){var t,n=this._createButton("editNode","vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,P(t=this.editNode).call(t,this))}},{key:"_createEditEdgeButton",value:function(e){var t,n=this._createButton("editEdge","vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,P(t=this.editEdgeMode).call(t,this))}},{key:"_createDeleteButton",value:function(e){var t,n;this.options.rtl?n="vis-delete-rtl":n="vis-delete";var a=this._createButton("delete",n,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(a),this._bindElementEvents(a,P(t=this.deleteSelected).call(t,this))}},{key:"_createBackButton",value:function(e){var t,n=this._createButton("back","vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,P(t=this.showManipulatorToolbar).call(t,this))}},{key:"_createButton",value:function(e,t,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"vis-label";return this.manipulationDOM[e+"Div"]=document.createElement("button"),this.manipulationDOM[e+"Div"].className="vis-button "+t,this.manipulationDOM[e+"Label"]=document.createElement("div"),this.manipulationDOM[e+"Label"].className=a,this.manipulationDOM[e+"Label"].innerText=n,this.manipulationDOM[e+"Div"].appendChild(this.manipulationDOM[e+"Label"]),this.manipulationDOM[e+"Div"]}},{key:"_createDescription",value:function(e){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=e,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}},{key:"_temporaryBindEvent",value:function(e,t){this.temporaryEventFunctions.push({event:e,boundFunction:t}),this.body.emitter.on(e,t)}},{key:"_temporaryBindUI",value:function(e,t){if(this.body.eventListeners[e]!==void 0)this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=t;else throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+us(Ee(this.body.eventListeners)))}},{key:"_unbindTemporaryUIs",value:function(){for(var e in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}},{key:"_unbindTemporaryEvents",value:function(){for(var e=0;e=0;u--)if(o[u]!==this.selectedControlNode.id){s=this.body.nodes[o[u]];break}if(s!==void 0&&this.selectedControlNode!==void 0)if(s.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var l=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===l.id?this._performEditEdge(s.id,a.to.id):this._performEditEdge(a.from.id,s.id)}else a.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}}},{key:"_handleConnect",value:function(e){if(new Date().valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=Fe({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;var t=this.lastTouch,n=this.selectionHandler.getNodeAt(t);if(n!==void 0)if(n.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var a=this._getNewTargetNode(n.x,n.y);this.body.nodes[a.id]=a,this.body.nodeIndices.push(a.id);var o=this.body.functions.createEdge({id:"connectionEdge"+io(),from:n.id,to:a.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[o.id]=o,this.body.edgeIndices.push(o.id),this.temporaryIds.nodes.push(a.id),this.temporaryIds.edges.push(o.id)}this.touchTime=new Date().valueOf()}}},{key:"_dragControlNode",value:function(e){var t=this.body.functions.getPointer(e.center),n=this.selectionHandler._pointerToPositionObject(t),a=void 0;this.temporaryIds.edges[0]!==void 0&&(a=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var o=this.selectionHandler._getAllNodesOverlappingWith(n),s=void 0,u=o.length-1;u>=0;u--){var l;if(ie(l=this.temporaryIds.nodes).call(l,o[u])===-1){s=this.body.nodes[o[u]];break}}if(e.controlEdge={from:a,to:s?s.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",e,t),this.temporaryIds.nodes[0]!==void 0){var h=this.body.nodes[this.temporaryIds.nodes[0]];h.x=this.canvas._XconvertDOMtoCanvas(t.x),h.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(e)}},{key:"_finishConnect",value:function(e){var t=this.body.functions.getPointer(e.center),n=this.selectionHandler._pointerToPositionObject(t),a=void 0;this.temporaryIds.edges[0]!==void 0&&(a=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var o=this.selectionHandler._getAllNodesOverlappingWith(n),s=void 0,u=o.length-1;u>=0;u--){var l;if(ie(l=this.temporaryIds.nodes).call(l,o[u])===-1){s=this.body.nodes[o[u]];break}}this._cleanupTemporaryNodesAndEdges(),s!==void 0&&(s.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[a]!==void 0&&this.body.nodes[s.id]!==void 0&&this._performAddEdge(a,s.id)),e.controlEdge={from:a,to:s?s.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",e,t),this.body.emitter.emit("_redraw")}},{key:"_dragStartEdge",value:function(e){var t=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",e,t,void 0,!0)}},{key:"_performAddNode",value:function(e){var t=this,n={id:io(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if(typeof this.options.addNode=="function")if(this.options.addNode.length===2)this.options.addNode(n,function(a){a!=null&&t.inMode==="addNode"&&t.body.data.nodes.getDataSet().add(a),t.showManipulatorToolbar()});else throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");else this.body.data.nodes.getDataSet().add(n),this.showManipulatorToolbar()}},{key:"_performAddEdge",value:function(e,t){var n=this,a={from:e,to:t};if(typeof this.options.addEdge=="function")if(this.options.addEdge.length===2)this.options.addEdge(a,function(o){o!=null&&n.inMode==="addEdge"&&(n.body.data.edges.getDataSet().add(o),n.selectionHandler.unselectAll(),n.showManipulatorToolbar())});else throw new Error("The function for connect does not support two arguments (data,callback)");else this.body.data.edges.getDataSet().add(a),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:"_performEditEdge",value:function(e,t){var n=this,a={id:this.edgeBeingEditedId,from:e,to:t,label:this.body.data.edges.get(this.edgeBeingEditedId).label},o=this.options.editEdge;if(ce(o)==="object"&&(o=o.editWithoutDrag),typeof o=="function")if(o.length===2)o(a,function(s){s==null||n.inMode!=="editEdge"?(n.body.edges[a.id].updateEdgeType(),n.body.emitter.emit("_redraw"),n.showManipulatorToolbar()):(n.body.data.edges.getDataSet().update(s),n.selectionHandler.unselectAll(),n.showManipulatorToolbar())});else throw new Error("The function for edit does not support two arguments (data, callback)");else this.body.data.edges.getDataSet().update(a),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),i}(),D="string",k="boolean",w="number",qa="array",H="object",JT="dom",Tpe="any",md=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],bd={borderWidth:{number:w},borderWidthSelected:{number:w,undefined:"undefined"},brokenImage:{string:D,undefined:"undefined"},chosen:{label:{boolean:k,function:"function"},node:{boolean:k,function:"function"},__type__:{object:H,boolean:k}},color:{border:{string:D},background:{string:D},highlight:{border:{string:D},background:{string:D},__type__:{object:H,string:D}},hover:{border:{string:D},background:{string:D},__type__:{object:H,string:D}},__type__:{object:H,string:D}},opacity:{number:w,undefined:"undefined"},fixed:{x:{boolean:k},y:{boolean:k},__type__:{object:H,boolean:k}},font:{align:{string:D},color:{string:D},size:{number:w},face:{string:D},background:{string:D},strokeWidth:{number:w},strokeColor:{string:D},vadjust:{number:w},multi:{boolean:k,string:D},bold:{color:{string:D},size:{number:w},face:{string:D},mod:{string:D},vadjust:{number:w},__type__:{object:H,string:D}},boldital:{color:{string:D},size:{number:w},face:{string:D},mod:{string:D},vadjust:{number:w},__type__:{object:H,string:D}},ital:{color:{string:D},size:{number:w},face:{string:D},mod:{string:D},vadjust:{number:w},__type__:{object:H,string:D}},mono:{color:{string:D},size:{number:w},face:{string:D},mod:{string:D},vadjust:{number:w},__type__:{object:H,string:D}},__type__:{object:H,string:D}},group:{string:D,number:w,undefined:"undefined"},heightConstraint:{minimum:{number:w},valign:{string:D},__type__:{object:H,boolean:k,number:w}},hidden:{boolean:k},icon:{face:{string:D},code:{string:D},size:{number:w},color:{string:D},weight:{string:D,number:w},__type__:{object:H}},id:{string:D,number:w},image:{selected:{string:D,undefined:"undefined"},unselected:{string:D,undefined:"undefined"},__type__:{object:H,string:D}},imagePadding:{top:{number:w},right:{number:w},bottom:{number:w},left:{number:w},__type__:{object:H,number:w}},label:{string:D,undefined:"undefined"},labelHighlightBold:{boolean:k},level:{number:w,undefined:"undefined"},margin:{top:{number:w},right:{number:w},bottom:{number:w},left:{number:w},__type__:{object:H,number:w}},mass:{number:w},physics:{boolean:k},scaling:{min:{number:w},max:{number:w},label:{enabled:{boolean:k},min:{number:w},max:{number:w},maxVisible:{number:w},drawThreshold:{number:w},__type__:{object:H,boolean:k}},customScalingFunction:{function:"function"},__type__:{object:H}},shadow:{enabled:{boolean:k},color:{string:D},size:{number:w},x:{number:w},y:{number:w},__type__:{object:H,boolean:k}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:k,array:qa},borderRadius:{number:w},interpolation:{boolean:k},useImageSize:{boolean:k},useBorderWithImage:{boolean:k},coordinateOrigin:{string:["center","top-left"]},__type__:{object:H}},size:{number:w},title:{string:D,dom:JT,undefined:"undefined"},value:{number:w,undefined:"undefined"},widthConstraint:{minimum:{number:w},maximum:{number:w},__type__:{object:H,boolean:k,number:w}},x:{number:w},y:{number:w},__type__:{object:H}},Ipe={configure:{enabled:{boolean:k},filter:{boolean:k,string:D,array:qa,function:"function"},container:{dom:JT},showButton:{boolean:k},__type__:{object:H,boolean:k,string:D,array:qa,function:"function"}},edges:{arrows:{to:{enabled:{boolean:k},scaleFactor:{number:w},type:{string:md},imageHeight:{number:w},imageWidth:{number:w},src:{string:D},__type__:{object:H,boolean:k}},middle:{enabled:{boolean:k},scaleFactor:{number:w},type:{string:md},imageWidth:{number:w},imageHeight:{number:w},src:{string:D},__type__:{object:H,boolean:k}},from:{enabled:{boolean:k},scaleFactor:{number:w},type:{string:md},imageWidth:{number:w},imageHeight:{number:w},src:{string:D},__type__:{object:H,boolean:k}},__type__:{string:["from","to","middle"],object:H}},endPointOffset:{from:{number:w},to:{number:w},__type__:{object:H,number:w}},arrowStrikethrough:{boolean:k},background:{enabled:{boolean:k},color:{string:D},size:{number:w},dashes:{boolean:k,array:qa},__type__:{object:H,boolean:k}},chosen:{label:{boolean:k,function:"function"},edge:{boolean:k,function:"function"},__type__:{object:H,boolean:k}},color:{color:{string:D},highlight:{string:D},hover:{string:D},inherit:{string:["from","to","both"],boolean:k},opacity:{number:w},__type__:{object:H,string:D}},dashes:{boolean:k,array:qa},font:{color:{string:D},size:{number:w},face:{string:D},background:{string:D},strokeWidth:{number:w},strokeColor:{string:D},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:w},multi:{boolean:k,string:D},bold:{color:{string:D},size:{number:w},face:{string:D},mod:{string:D},vadjust:{number:w},__type__:{object:H,string:D}},boldital:{color:{string:D},size:{number:w},face:{string:D},mod:{string:D},vadjust:{number:w},__type__:{object:H,string:D}},ital:{color:{string:D},size:{number:w},face:{string:D},mod:{string:D},vadjust:{number:w},__type__:{object:H,string:D}},mono:{color:{string:D},size:{number:w},face:{string:D},mod:{string:D},vadjust:{number:w},__type__:{object:H,string:D}},__type__:{object:H,string:D}},hidden:{boolean:k},hoverWidth:{function:"function",number:w},label:{string:D,undefined:"undefined"},labelHighlightBold:{boolean:k},length:{number:w,undefined:"undefined"},physics:{boolean:k},scaling:{min:{number:w},max:{number:w},label:{enabled:{boolean:k},min:{number:w},max:{number:w},maxVisible:{number:w},drawThreshold:{number:w},__type__:{object:H,boolean:k}},customScalingFunction:{function:"function"},__type__:{object:H}},selectionWidth:{function:"function",number:w},selfReferenceSize:{number:w},selfReference:{size:{number:w},angle:{number:w},renderBehindTheNode:{boolean:k},__type__:{object:H}},shadow:{enabled:{boolean:k},color:{string:D},size:{number:w},x:{number:w},y:{number:w},__type__:{object:H,boolean:k}},smooth:{enabled:{boolean:k},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:w},forceDirection:{string:["horizontal","vertical","none"],boolean:k},__type__:{object:H,boolean:k}},title:{string:D,undefined:"undefined"},width:{number:w},widthConstraint:{maximum:{number:w},__type__:{object:H,boolean:k,number:w}},value:{number:w,undefined:"undefined"},__type__:{object:H}},groups:{useDefaultGroups:{boolean:k},__any__:bd,__type__:{object:H}},interaction:{dragNodes:{boolean:k},dragView:{boolean:k},hideEdgesOnDrag:{boolean:k},hideEdgesOnZoom:{boolean:k},hideNodesOnDrag:{boolean:k},hover:{boolean:k},keyboard:{enabled:{boolean:k},speed:{x:{number:w},y:{number:w},zoom:{number:w},__type__:{object:H}},bindToWindow:{boolean:k},autoFocus:{boolean:k},__type__:{object:H,boolean:k}},multiselect:{boolean:k},navigationButtons:{boolean:k},selectable:{boolean:k},selectConnectedEdges:{boolean:k},hoverConnectedEdges:{boolean:k},tooltipDelay:{number:w},zoomView:{boolean:k},zoomSpeed:{number:w},__type__:{object:H}},layout:{randomSeed:{undefined:"undefined",number:w,string:D},improvedLayout:{boolean:k},clusterThreshold:{number:w},hierarchical:{enabled:{boolean:k},levelSeparation:{number:w},nodeSpacing:{number:w},treeSpacing:{number:w},blockShifting:{boolean:k},edgeMinimization:{boolean:k},parentCentralization:{boolean:k},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:H,boolean:k}},__type__:{object:H}},manipulation:{enabled:{boolean:k},initiallyActive:{boolean:k},addNode:{boolean:k,function:"function"},addEdge:{boolean:k,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:H,boolean:k,function:"function"}},deleteNode:{boolean:k,function:"function"},deleteEdge:{boolean:k,function:"function"},controlNodeStyle:bd,__type__:{object:H,boolean:k}},nodes:bd,physics:{enabled:{boolean:k},barnesHut:{theta:{number:w},gravitationalConstant:{number:w},centralGravity:{number:w},springLength:{number:w},springConstant:{number:w},damping:{number:w},avoidOverlap:{number:w},__type__:{object:H}},forceAtlas2Based:{theta:{number:w},gravitationalConstant:{number:w},centralGravity:{number:w},springLength:{number:w},springConstant:{number:w},damping:{number:w},avoidOverlap:{number:w},__type__:{object:H}},repulsion:{centralGravity:{number:w},springLength:{number:w},springConstant:{number:w},nodeDistance:{number:w},damping:{number:w},__type__:{object:H}},hierarchicalRepulsion:{centralGravity:{number:w},springLength:{number:w},springConstant:{number:w},nodeDistance:{number:w},damping:{number:w},avoidOverlap:{number:w},__type__:{object:H}},maxVelocity:{number:w},minVelocity:{number:w},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:k},iterations:{number:w},updateInterval:{number:w},onlyDynamicEdges:{boolean:k},fit:{boolean:k},__type__:{object:H,boolean:k}},timestep:{number:w},adaptiveTimestep:{boolean:k},wind:{x:{number:w},y:{number:w},__type__:{object:H}},__type__:{object:H,boolean:k}},autoResize:{boolean:k},clickToUse:{boolean:k},locale:{string:D},locales:{__any__:{any:Tpe},__type__:{object:H}},height:{string:D},width:{string:D},__type__:{object:H}},ZT={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},opacity:[0,0,1,.1],fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown","hexagon"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"}},endPointOffset:{from:[0,-10,10,1],to:[0,-10,10,1]},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],selfReference:{size:[20,0,200,1],angle:[Math.PI/2,-6*Math.PI,6*Math.PI,Math.PI/8],renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"],shakeTowards:["leaves","roots"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0,autoFocus:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0,zoomSpeed:[1,.1,2,.1]},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{theta:[.5,.1,1,.05],gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{theta:[.5,.1,1,.05],gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01],wind:{x:[0,-10,10,.1],y:[0,-10,10,.1]}}},kpe=function(r,e,t){var n;return!!(oi(r).call(r,"physics")&&oi(n=ZT.physics.solver).call(n,e)&&t.physics.solver!==e&&e!=="wind")},Ppe=function(){function i(){N(this,i)}return M(i,[{key:"getDistances",value:function(e,t,n){for(var a={},o=e.edges,s=0;s2&&arguments[2]!==void 0?arguments[2]:!1,a=this.distanceSolver.getDistances(this.body,e,t);this._createL_matrix(a),this._createK_matrix(a),this._createE_matrix();for(var o=.01,s=1,u=0,l=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),h=5,d=1e9,c=0,f=0,v=0,p=0,g=0;d>o&&us&&gy.type==="downstream_subgraph_search")?.data||[],f=y=>{const m=y.json.nodes.map($=>({id:$.id,label:$.type,color:{background:"#2B7CE9",border:"#1B5BB1"},font:{size:16,color:"#FFFFFF",face:"arial",bold:!0},margin:12,padding:10,shape:"box",widthConstraint:{minimum:100,maximum:200}})),b=y.json.links.map($=>({from:$.origin_id,to:$.target_id,arrows:{to:{enabled:!0,scaleFactor:1.2}},color:"#FFFFFF",width:2}));return{nodes:m,edges:b}};We.useEffect(()=>()=>{d.current&&(d.current.destroy(),d.current=null)},[]);const v=We.useCallback((y,m)=>{d.current&&d.current.destroy();const b=f(m),$=new z(y,b,{nodes:{shape:"box",margin:12,padding:10,font:{size:16,color:"#FFFFFF",face:"arial",bold:!0},borderWidth:2,shadow:{enabled:!0,color:"rgba(0,0,0,0.2)",size:5}},edges:{arrows:"to",color:"#FFFFFF",width:2,smooth:{enabled:!0,type:"straightCross"}},physics:{enabled:!0,solver:"hierarchicalRepulsion",hierarchicalRepulsion:{nodeDistance:200,springLength:200}},layout:{hierarchical:{enabled:!0,direction:"UD",sortMethod:"directed",nodeSpacing:200,levelSeparation:150}},interaction:{dragNodes:!1,zoomView:!1,dragView:!1}});d.current=$},[]),p=async y=>{console.log("[DownstreamSubgraphs] Starting checkAndLoadSubgraph with node:",y),Li.trackEvent({event_type:"subgraph_accept",message_type:"subgraph",message_id:u.message_id,data:{subgraph_name:y.name,subgraph_tags:y.tags}});const m=y.json.nodes,b=Object.values(Mt.canvas.selected_nodes)[0];if(!b){console.warn("[DownstreamSubgraphs] No node selected"),alert("Please select a upstream node first before adding a subgraph.");return}const $=m.map(R=>R.type),S=s;console.log("[DownstreamSubgraphs] Required node types:",$),console.log("[DownstreamSubgraphs] Installed node types:",S);const _=$.filter(R=>!S.includes(R));if(console.log("[DownstreamSubgraphs] Missing node types:",_),_.length>0)try{console.log("[DownstreamSubgraphs] Fetching info for missing nodes");const R=await Li.batchGetNodeInfo(_);console.log("[DownstreamSubgraphs] Received node infos:",R);const B={text:"",ext:[{type:"node_install_guide",data:R.map(C=>({name:C.name,repository_url:C.github_url}))}]};console.log("[DownstreamSubgraphs] Created message content:",B);const I={id:Ur(),role:"ai",content:JSON.stringify(B),format:"markdown",name:"Assistant",metadata:{pendingSubgraph:y}};console.log("[DownstreamSubgraphs] Created AI message:",I),t?.(I);return}catch(R){console.error("[DownstreamSubgraphs] Error fetching node info:",R),alert("Error checking required nodes. Please try again.");return}console.log("[DownstreamSubgraphs] All required nodes are installed, proceeding to load subgraph"),g(y,b)},g=(y,m)=>{const b=y.json.nodes,$=y.json.links,S=b.find(B=>B.id===0),_=S?.id;console.log("[DownstreamSubgraphs] Entry node ID:",_);const R={};_!==null&&(R[_]=m),Mt.canvas.emitBeforeChange();try{for(const B of b)if(B.id!==_){const I=S?.pos,C=[m._pos[0],m._pos[1]],j=[B.pos[0]+C[0]-I[0],B.pos[1]+C[1]-I[1]];R[B.id]=Y$(B.type,{pos:j})}for(const B of $){const I=R[B.origin_id],C=R[B.target_id];I&&C&&I.connect(B.origin_slot,C,B.target_slot)}}finally{Mt.canvas.emitAfterChange()}};return We.useEffect(()=>{const y=()=>{const m=Mt.canvas.selected_nodes;if(Object.keys(m??{}).length){const b=Object.values(m)[0];a({type:"SET_SELECTED_NODE",payload:b})}else a({type:"SET_SELECTED_NODE",payload:null})};return document.addEventListener("click",y),()=>{document.removeEventListener("click",y)}},[]),O.jsx("div",{className:"rounded-lg bg-green-50 p-3 text-gray-700 text-xs break-words overflow-visible",children:c.length>0&&O.jsx("div",{className:"space-y-3",children:O.jsx("div",{className:"flex flex-wrap gap-2",children:c.map(y=>O.jsxs("div",{className:"relative group",children:[O.jsx("button",{className:`px-3 py-1.5 bg-blue-500 text-white rounded-md +`),a=n.length;if(t.multi)for(var o=0;o0)for(var u=0;u0)for(var v=0;v")||t.parseStartTag("ital","")||t.parseStartTag("mono","")||t.parseEndTag("bold","")||t.parseEndTag("ital","")||t.parseEndTag("mono",""))||n(a);o||t.add(a),t.position++}return t.emitBlock(),t.blocks}},{key:"splitMarkdownBlocks",value:function(e){for(var t=this,n=new G1(e),a=!0,o=function(h){return/\\/.test(h)?(n.positionthis.parent.fontOptions.maxWdt}},{key:"getLongestFit",value:function(e){for(var t="",n=0;n1&&arguments[1]!==void 0?arguments[1]:"normal",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");for(var a=e.split("\r");a.length>0;){var o=this.getLongestFit(a);if(o===0){var s=a[0],u=this.getLongestFitWord(s);this.lines.newLine(rt(s).call(s,0,u),t),a[0]=rt(s).call(s,u)}else{var l=o;a[o-1]===" "?o--:a[l]===" "&&l++;var h=rt(a).call(a,0,o).join("");o==a.length&&n?this.lines.append(h,t):this.lines.newLine(h,t),a=rt(a).call(a,l)}}}}]),i}(),Ha=["bold","ital","boldital","mono"],TT=function(){function i(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;R(this,i),this.body=r,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(e),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=t}return N(i,[{key:"setOptions",value:function(e){if(this.elementOptions=e,this.initFontOptions(e.font),Ju(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font=="string")this.baseSize=this.fontOptions.size;else if(de(e.font)==="object"){var t=e.font.size;t!==void 0&&(this.baseSize=t)}}}},{key:"initFontOptions",value:function(e){var t=this;if(te(Ha,function(n){t.fontOptions[n]={}}),i.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}te(e,function(n,a){n!=null&&de(n)!=="object"&&(t.fontOptions[a]=n)})}},{key:"constrain",value:function(e){var t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},n=Xr(e,"widthConstraint");if(typeof n=="number")t.maxWdt=Number(n),t.minWdt=Number(n);else if(de(n)==="object"){var a=Xr(e,["widthConstraint","maximum"]);typeof a=="number"&&(t.maxWdt=Number(a));var o=Xr(e,["widthConstraint","minimum"]);typeof o=="number"&&(t.minWdt=Number(o))}var s=Xr(e,"heightConstraint");if(typeof s=="number")t.minHgt=Number(s);else if(de(s)==="object"){var u=Xr(e,["heightConstraint","minimum"]);typeof u=="number"&&(t.minHgt=Number(u));var l=Xr(e,["heightConstraint","valign"]);typeof l=="string"&&(l==="top"||l==="bottom")&&(t.valign=l)}return t}},{key:"update",value:function(e,t){this.setOptions(e,!0),this.propagateFonts(t),pe(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=cp("label",t)}},{key:"adjustSizes",value:function(e){var t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);var n=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=n)}},{key:"addFontOptionsToPile",value:function(e,t){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:"middle";if(this.elementOptions.label!==void 0){var u=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&u=this.elementOptions.scaling.label.maxVisible&&(u=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,a,o,t,n,s),this._drawBackground(e),this._drawText(e,t,this.size.yLine,s,u))}}},{key:"_drawBackground",value:function(e){if(this.fontOptions.background!==void 0&&this.fontOptions.background!=="none"){e.fillStyle=this.fontOptions.background;var t=this.getSize();e.fillRect(t.left,t.top,t.width,t.height)}}},{key:"_drawText",value:function(e,t,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"middle",o=arguments.length>4?arguments[4]:void 0,s=this._setAlignment(e,t,n,a),u=Se(s,2);t=u[0],n=u[1],e.textAlign="left",t=t-this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign==="top"&&(n-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign==="bottom"&&(n+=(this.size.height-this.size.labelHeight)/2));for(var l=0;l0&&(e.lineWidth=f.strokeWidth,e.strokeStyle=y,e.lineJoin="round"),e.fillStyle=g,f.strokeWidth>0&&e.strokeText(f.text,t+d,n+f.vadjust),e.fillText(f.text,t+d,n+f.vadjust),d+=f.width}n+=h.height}}}},{key:"_setAlignment",value:function(e,t,n,a){if(this.isEdgeLabel&&this.fontOptions.align!=="horizontal"&&this.pointToSelf===!1){t=0,n=0;var o=2;this.fontOptions.align==="top"?(e.textBaseline="alphabetic",n-=2*o):this.fontOptions.align==="bottom"?(e.textBaseline="hanging",n+=2*o):e.textBaseline="middle"}else e.textBaseline=a;return[t,n]}},{key:"_getColor",value:function(e,t,n){var a=e||"#000000",o=n||"#ffffff";if(t<=this.elementOptions.scaling.label.drawThreshold){var s=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-t)));a=Kt(a,s),o=Kt(o,s)}return[a,o]}},{key:"getTextSize",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this._processLabel(e,t,n),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}},{key:"getSize",value:function(){var e=2,t=this.size.left,n=this.size.top-.5*e;if(this.isEdgeLabel){var a=-this.size.width*.5;switch(this.fontOptions.align){case"middle":t=a,n=-this.size.height*.5;break;case"top":t=a,n=-(this.size.height+e);break;case"bottom":t=a,n=e;break}}var o={left:t,top:n,width:this.size.width,height:this.size.height};return o}},{key:"calculateLabelSize",value:function(e,t,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";this._processLabel(e,t,n),this.size.left=a-this.size.width*.5,this.size.top=o-this.size.height*.5,this.size.yLine=o+(1-this.lineCount)*.5*this.fontOptions.size,s==="hanging"&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}},{key:"getFormattingValues",value:function(e,t,n,a){var o=function(h,d,c){return d==="normal"?c==="mod"?"":h[c]:h[d][c]!==void 0?h[d][c]:h[c]},s={color:o(this.fontOptions,a,"color"),size:o(this.fontOptions,a,"size"),face:o(this.fontOptions,a,"face"),mod:o(this.fontOptions,a,"mod"),vadjust:o(this.fontOptions,a,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(t||n)&&(a==="normal"&&this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?s.mod="bold":typeof this.fontOptions.chooser=="function"&&this.fontOptions.chooser(s,this.elementOptions.id,t,n));var u="";return s.mod!==void 0&&s.mod!==""&&(u+=s.mod+" "),u+=s.size+"px "+s.face,e.font=u.replace(/"/g,""),s.font=e.font,s.height=s.size,s}},{key:"differentState",value:function(e,t){return e!==this.selectedState||t!==this.hoverState}},{key:"_processLabelText",value:function(e,t,n,a){var o=new zle(e,this,t,n);return o.process(a)}},{key:"_processLabel",value:function(e,t,n){if(!(this.labelDirty===!1&&!this.differentState(t,n))){var a=this._processLabelText(e,t,n,this.elementOptions.label);this.fontOptions.minWdt>0&&a.width0&&a.height0&&(this.enableBorderDashes(e,t),e.stroke(),this.disableBorderDashes(e,t)),e.restore()}},{key:"performFill",value:function(e,t){e.save(),e.fillStyle=t.color,this.enableShadow(e,t),ls(e).call(e),this.disableShadow(e,t),e.restore(),this.performStroke(e,t)}},{key:"_addBoundingBoxMargin",value:function(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}},{key:"_updateBoundingBox",value:function(e,t,n,a,o){n!==void 0&&this.resize(n,a,o),this.left=e-this.width/2,this.top=t-this.height/2,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}},{key:"updateBoundingBox",value:function(e,t,n,a,o){this._updateBoundingBox(e,t,n,a,o)}},{key:"getDimensionsFromLabel",value:function(e,t,n){this.textSize=this.labelModule.getTextSize(e,t,n);var a=this.textSize.width,o=this.textSize.height,s=14;return a===0&&(a=s,o=s),{width:a,height:o}}}]),i}();function Ahe(i){var r=Dhe();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function Dhe(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var Rhe=function(i){ue(e,i);var r=Ahe(e);function e(t,n,a){var o;return R(this,e),o=r.call(this,t,n,a),o._setMargins(a),o}return N(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(a,o)){var s=this.getDimensionsFromLabel(n,a,o);this.width=s.width+this.margin.right+this.margin.left,this.height=s.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}},{key:"draw",value:function(n,a,o,s,u,l){this.resize(n,s,u),this.left=a-this.width/2,this.top=o-this.height/2,this.initContextForDraw(n,l),GE(n,this.left,this.top,this.width,this.height,l.borderRadius),this.performFill(n,l),this.updateBoundingBox(a,o,n,s,u),this.labelModule.draw(n,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,s,u)}},{key:"updateBoundingBox",value:function(n,a,o,s,u){this._updateBoundingBox(n,a,o,s,u);var l=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(l)}},{key:"distanceToBorder",value:function(n,a){n&&this.resize(n);var o=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(a)),Math.abs(this.height/2/Math.sin(a)))+o}}]),e}(vn);function Nhe(i){var r=Mhe();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function Mhe(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var vp=function(i){ue(e,i);var r=Nhe(e);function e(t,n,a){var o;return R(this,e),o=r.call(this,t,n,a),o.labelOffset=0,o.selected=!1,o}return N(e,[{key:"setOptions",value:function(n,a,o){this.options=n,a===void 0&&o===void 0||this.setImages(a,o)}},{key:"setImages",value:function(n,a){a&&this.selected?(this.imageObj=a,this.imageObjAlt=n):(this.imageObj=n,this.imageObjAlt=a)}},{key:"switchImages",value:function(n){var a=n&&!this.selected||!n&&this.selected;if(this.selected=n,this.imageObjAlt!==void 0&&a){var o=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=o}}},{key:"_getImagePadding",value:function(){var n={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){var a=this.options.imagePadding;de(a)=="object"?(n.top=a.top,n.right=a.right,n.bottom=a.bottom,n.left=a.left):(n.top=a,n.right=a,n.bottom=a,n.left=a)}return n}},{key:"_resizeImage",value:function(){var n,a;if(this.options.shapeProperties.useImageSize===!1){var o=1,s=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?o=this.imageObj.width/this.imageObj.height:s=this.imageObj.height/this.imageObj.width),n=this.options.size*2*o,a=this.options.size*2*s}else{var u=this._getImagePadding();n=this.imageObj.width+u.left+u.right,a=this.imageObj.height+u.top+u.bottom}this.width=n,this.height=a,this.radius=.5*this.width}},{key:"_drawRawCircle",value:function(n,a,o,s){this.initContextForDraw(n,s),Cv(n,a,o,s.size),this.performFill(n,s)}},{key:"_drawImageAtPosition",value:function(n,a){if(this.imageObj.width!=0){n.globalAlpha=a.opacity!==void 0?a.opacity:1,this.enableShadow(n,a);var o=1;this.options.shapeProperties.interpolation===!0&&(o=this.imageObj.width/this.width/this.body.view.scale);var s=this._getImagePadding(),u=this.left+s.left,l=this.top+s.top,h=this.width-s.left-s.right,d=this.height-s.top-s.bottom;this.imageObj.drawImageAtPosition(n,o,u,l,h,d),this.disableShadow(n,a)}}},{key:"_drawImageLabel",value:function(n,a,o,s,u){var l=0;if(this.height!==void 0){l=this.height*.5;var h=this.labelModule.getTextSize(n,s,u);h.lineCount>=1&&(l+=h.height/2)}var d=o+l;this.options.label&&(this.labelOffset=l),this.labelModule.draw(n,a,d,s,u,"hanging")}}]),e}(vn);function Bhe(i){var r=Fhe();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function Fhe(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var jhe=function(i){ue(e,i);var r=Bhe(e);function e(t,n,a){var o;return R(this,e),o=r.call(this,t,n,a),o._setMargins(a),o}return N(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(a,o)){var s=this.getDimensionsFromLabel(n,a,o),u=Math.max(s.width+this.margin.right+this.margin.left,s.height+this.margin.top+this.margin.bottom);this.options.size=u/2,this.width=u,this.height=u,this.radius=this.width/2}}},{key:"draw",value:function(n,a,o,s,u,l){this.resize(n,s,u),this.left=a-this.width/2,this.top=o-this.height/2,this._drawRawCircle(n,a,o,l),this.updateBoundingBox(a,o),this.labelModule.draw(n,this.left+this.textSize.width/2+this.margin.left,o,s,u)}},{key:"updateBoundingBox",value:function(n,a){this.boundingBox.top=a-this.options.size,this.boundingBox.left=n-this.options.size,this.boundingBox.right=n+this.options.size,this.boundingBox.bottom=a+this.options.size}},{key:"distanceToBorder",value:function(n){return n&&this.resize(n),this.width*.5}}]),e}(vp);function Lhe(i){var r=zhe();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function zhe(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var Hhe=function(i){ue(e,i);var r=Lhe(e);function e(t,n,a,o,s){var u;return R(this,e),u=r.call(this,t,n,a),u.setImages(o,s),u}return N(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,s=this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0;if(s){var u=this.options.size*2;this.width=u,this.height=u,this.radius=.5*this.width;return}this.needsRefresh(a,o)&&this._resizeImage()}},{key:"draw",value:function(n,a,o,s,u,l){this.switchImages(s),this.resize();var h=a,d=o;this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=a,this.top=o,h+=this.width/2,d+=this.height/2):(this.left=a-this.width/2,this.top=o-this.height/2),this._drawRawCircle(n,h,d,l),n.save(),n.clip(),this._drawImageAtPosition(n,l),n.restore(),this._drawImageLabel(n,h,d,s,u),this.updateBoundingBox(a,o)}},{key:"updateBoundingBox",value:function(n,a){this.options.shapeProperties.coordinateOrigin==="top-left"?(this.boundingBox.top=a,this.boundingBox.left=n,this.boundingBox.right=n+this.options.size*2,this.boundingBox.bottom=a+this.options.size*2):(this.boundingBox.top=a-this.options.size,this.boundingBox.left=n-this.options.size,this.boundingBox.right=n+this.options.size,this.boundingBox.bottom=a+this.options.size),this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}},{key:"distanceToBorder",value:function(n){return n&&this.resize(n),this.width*.5}}]),e}(vp);function Vhe(i){var r=Whe();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function Whe(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var $i=function(i){ue(e,i);var r=Vhe(e);function e(t,n,a){return R(this,e),r.call(this,t,n,a)}return N(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(a,o)){var u,l;this.labelModule.getTextSize(n,a,o);var h=2*s.size;this.width=(u=this.customSizeWidth)!==null&&u!==void 0?u:h,this.height=(l=this.customSizeHeight)!==null&&l!==void 0?l:h,this.radius=.5*this.width}}},{key:"_drawShape",value:function(n,a,o,s,u,l,h,d){var c=this;return this.resize(n,l,h,d),this.left=s-this.width/2,this.top=u-this.height/2,this.initContextForDraw(n,d),OK(a)(n,s,u,d.size),this.performFill(n,d),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(n.font=(l?"bold ":"")+this.height/2+"px "+(this.options.icon.face||"FontAwesome"),n.fillStyle=this.options.icon.color||"black",n.textAlign="center",n.textBaseline="middle",n.fillText(this.options.icon.code,s,u)),{drawExternalLabel:function(){if(c.options.label!==void 0){c.labelModule.calculateLabelSize(n,l,h,s,u,"hanging");var v=u+.5*c.height+.5*c.labelModule.size.height;c.labelModule.draw(n,s,v,l,h,"hanging")}c.updateBoundingBox(s,u)}}}},{key:"updateBoundingBox",value:function(n,a){this.boundingBox.top=a-this.options.size,this.boundingBox.left=n-this.options.size,this.boundingBox.right=n+this.options.size,this.boundingBox.bottom=a+this.options.size,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}}]),e}(vn);function Z1(i,r){var e=Ee(i);if(ci){var t=ci(i);r&&(t=Ot(t).call(t,function(n){return bi(i,n).enumerable})),e.push.apply(e,t)}return e}function Uhe(i){for(var r=1;r"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var qhe=function(i){ue(e,i);var r=Khe(e);function e(t,n,a,o){var s;return R(this,e),s=r.call(this,t,n,a,o),s.ctxRenderer=o,s}return N(e,[{key:"draw",value:function(n,a,o,s,u,l){this.resize(n,s,u,l),this.left=a-this.width/2,this.top=o-this.height/2,n.save();var h=this.ctxRenderer({ctx:n,id:this.options.id,x:a,y:o,state:{selected:s,hover:u},style:Uhe({},l),label:this.options.label});if(h.drawNode!=null&&h.drawNode(),n.restore(),h.drawExternalLabel){var d=h.drawExternalLabel;h.drawExternalLabel=function(){n.save(),d(),n.restore()}}return h.nodeDimensions&&(this.customSizeWidth=h.nodeDimensions.width,this.customSizeHeight=h.nodeDimensions.height),h}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}($i);function Yhe(i){var r=Xhe();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function Xhe(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var Jhe=function(i){ue(e,i);var r=Yhe(e);function e(t,n,a){var o;return R(this,e),o=r.call(this,t,n,a),o._setMargins(a),o}return N(e,[{key:"resize",value:function(n,a,o){if(this.needsRefresh(a,o)){var s=this.getDimensionsFromLabel(n,a,o),u=s.width+this.margin.right+this.margin.left;this.width=u,this.height=u,this.radius=this.width/2}}},{key:"draw",value:function(n,a,o,s,u,l){this.resize(n,s,u),this.left=a-this.width/2,this.top=o-this.height/2,this.initContextForDraw(n,l),qE(n,a-this.width/2,o-this.height/2,this.width,this.height),this.performFill(n,l),this.updateBoundingBox(a,o,n,s,u),this.labelModule.draw(n,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,s,u)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(vn);function Zhe(i){var r=Qhe();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function Qhe(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var ece=function(i){ue(e,i);var r=Zhe(e);function e(t,n,a){return R(this,e),r.call(this,t,n,a)}return N(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"diamond",4,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}($i);function tce(i){var r=rce();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function rce(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var ice=function(i){ue(e,i);var r=tce(e);function e(t,n,a){return R(this,e),r.call(this,t,n,a)}return N(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"circle",2,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n){return n&&this.resize(n),this.options.size}}]),e}($i);function nce(i){var r=ace();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function ace(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var Q1=function(i){ue(e,i);var r=nce(e);function e(t,n,a){return R(this,e),r.call(this,t,n,a)}return N(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(a,o)){var s=this.getDimensionsFromLabel(n,a,o);this.height=s.height*2,this.width=s.width+s.height,this.radius=.5*this.width}}},{key:"draw",value:function(n,a,o,s,u,l){this.resize(n,s,u),this.left=a-this.width*.5,this.top=o-this.height*.5,this.initContextForDraw(n,l),of(n,this.left,this.top,this.width,this.height),this.performFill(n,l),this.updateBoundingBox(a,o,n,s,u),this.labelModule.draw(n,a,o,s,u)}},{key:"distanceToBorder",value:function(n,a){n&&this.resize(n);var o=this.width*.5,s=this.height*.5,u=Math.sin(a)*o,l=Math.cos(a)*s;return o*s/Math.sqrt(u*u+l*l)}}]),e}(vn);function oce(i){var r=sce();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function sce(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var uce=function(i){ue(e,i);var r=oce(e);function e(t,n,a){var o;return R(this,e),o=r.call(this,t,n,a),o._setMargins(a),o}return N(e,[{key:"resize",value:function(n,a,o){this.needsRefresh(a,o)&&(this.iconSize={width:Number(this.options.icon.size),height:Number(this.options.icon.size)},this.width=this.iconSize.width+this.margin.right+this.margin.left,this.height=this.iconSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}},{key:"draw",value:function(n,a,o,s,u,l){var h=this;return this.resize(n,s,u),this.options.icon.size=this.options.icon.size||50,this.left=a-this.width/2,this.top=o-this.height/2,this._icon(n,a,o,s,u,l),{drawExternalLabel:function(){if(h.options.label!==void 0){var c=5;h.labelModule.draw(n,h.left+h.iconSize.width/2+h.margin.left,o+h.height/2+c,s)}h.updateBoundingBox(a,o)}}}},{key:"updateBoundingBox",value:function(n,a){if(this.boundingBox.top=a-this.options.icon.size*.5,this.boundingBox.left=n-this.options.icon.size*.5,this.boundingBox.right=n+this.options.icon.size*.5,this.boundingBox.bottom=a+this.options.icon.size*.5,this.options.label!==void 0&&this.labelModule.size.width>0){var o=5;this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+o)}}},{key:"_icon",value:function(n,a,o,s,u,l){var h=Number(this.options.icon.size);this.options.icon.code!==void 0?(n.font=[this.options.icon.weight!=null?this.options.icon.weight:s?"bold":"",(this.options.icon.weight!=null&&s?5:0)+h+"px",this.options.icon.face].join(" "),n.fillStyle=this.options.icon.color||"black",n.textAlign="center",n.textBaseline="middle",this.enableShadow(n,l),n.fillText(this.options.icon.code,a,o),this.disableShadow(n,l)):console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.")}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(vn);function lce(i){var r=hce();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function hce(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var cce=function(i){ue(e,i);var r=lce(e);function e(t,n,a,o,s){var u;return R(this,e),u=r.call(this,t,n,a),u.setImages(o,s),u}return N(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,s=this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0;if(s){var u=this.options.size*2;this.width=u,this.height=u;return}this.needsRefresh(a,o)&&this._resizeImage()}},{key:"draw",value:function(n,a,o,s,u,l){n.save(),this.switchImages(s),this.resize();var h=a,d=o;if(this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=a,this.top=o,h+=this.width/2,d+=this.height/2):(this.left=a-this.width/2,this.top=o-this.height/2),this.options.shapeProperties.useBorderWithImage===!0){var c=this.options.borderWidth,f=this.options.borderWidthSelected||2*this.options.borderWidth,v=(s?f:c)/this.body.view.scale;n.lineWidth=Math.min(this.width,v),n.beginPath();var p=s?this.options.color.highlight.border:u?this.options.color.hover.border:this.options.color.border,g=s?this.options.color.highlight.background:u?this.options.color.hover.background:this.options.color.background;l.opacity!==void 0&&(p=Kt(p,l.opacity),g=Kt(g,l.opacity)),n.strokeStyle=p,n.fillStyle=g,n.rect(this.left-.5*n.lineWidth,this.top-.5*n.lineWidth,this.width+n.lineWidth,this.height+n.lineWidth),ls(n).call(n),this.performStroke(n,l),n.closePath()}this._drawImageAtPosition(n,l),this._drawImageLabel(n,h,d,s,u),this.updateBoundingBox(a,o),n.restore()}},{key:"updateBoundingBox",value:function(n,a){this.resize(),this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=n,this.top=a):(this.left=n-this.width/2,this.top=a-this.height/2),this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(vp);function dce(i){var r=fce();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function fce(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var vce=function(i){ue(e,i);var r=dce(e);function e(t,n,a){return R(this,e),r.call(this,t,n,a)}return N(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"square",2,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}($i);function pce(i){var r=gce();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function gce(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var yce=function(i){ue(e,i);var r=pce(e);function e(t,n,a){return R(this,e),r.call(this,t,n,a)}return N(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"hexagon",4,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}($i);function mce(i){var r=bce();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function bce(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var $ce=function(i){ue(e,i);var r=mce(e);function e(t,n,a){return R(this,e),r.call(this,t,n,a)}return N(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"star",4,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}($i);function wce(i){var r=_ce();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function _ce(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var Ece=function(i){ue(e,i);var r=wce(e);function e(t,n,a){var o;return R(this,e),o=r.call(this,t,n,a),o._setMargins(a),o}return N(e,[{key:"resize",value:function(n,a,o){this.needsRefresh(a,o)&&(this.textSize=this.labelModule.getTextSize(n,a,o),this.width=this.textSize.width+this.margin.right+this.margin.left,this.height=this.textSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}},{key:"draw",value:function(n,a,o,s,u,l){this.resize(n,s,u),this.left=a-this.width/2,this.top=o-this.height/2,this.enableShadow(n,l),this.labelModule.draw(n,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,s,u),this.disableShadow(n,l),this.updateBoundingBox(a,o,n,s,u)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(vn);function Sce(i){var r=Oce();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function Oce(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var Tce=function(i){ue(e,i);var r=Sce(e);function e(t,n,a){return R(this,e),r.call(this,t,n,a)}return N(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"triangle",3,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}($i);function Ice(i){var r=kce();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function kce(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var Pce=function(i){ue(e,i);var r=Ice(e);function e(t,n,a){return R(this,e),r.call(this,t,n,a)}return N(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"triangleDown",3,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}($i);function e$(i,r){var e=Ee(i);if(ci){var t=ci(i);r&&(t=Ot(t).call(t,function(n){return bi(i,n).enumerable})),e.push.apply(e,t)}return e}function t$(i){for(var r=1;re.left&&this.shape.tope.top}},{key:"isBoundingBoxOverlappingWith",value:function(e){return this.shape.boundingBox.lefte.left&&this.shape.boundingBox.tope.top}}],[{key:"checkOpacity",value:function(e){return 0<=e&&e<=1}},{key:"checkCoordinateOrigin",value:function(e){return e===void 0||e==="center"||e==="top-left"}},{key:"updateGroupOptions",value:function(e,t,n){var a;if(n!==void 0){var o=e.group;if(t!==void 0&&t.group!==void 0&&o!==t.group)throw new Error("updateGroupOptions: group values in options don't match.");var s=typeof o=="number"||typeof o=="string"&&o!="";if(s){var u=n.get(o);u.opacity!==void 0&&t.opacity===void 0&&(i.checkOpacity(u.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+u.opacity),u.opacity=void 0));var l=Ot(a=Ile(t)).call(a,function(h){return t[h]!=null});l.push("font"),qu(l,e,u),e.color=Tf(e.color)}}}},{key:"parseOptions",value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=arguments.length>4?arguments[4]:void 0,s=["color","fixed","shadow"];if(qu(s,e,t,n),i.checkMass(t),e.opacity!==void 0&&(i.checkOpacity(e.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity),e.opacity=void 0)),t.opacity!==void 0&&(i.checkOpacity(t.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+t.opacity),t.opacity=void 0)),t.shapeProperties&&!i.checkCoordinateOrigin(t.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+t.shapeProperties.coordinateOrigin),Ut(e,t,"shadow",a),t.color!==void 0&&t.color!==null){var u=Tf(t.color);XO(e.color,u)}else n===!0&&t.color===null&&(e.color=ui(a.color));t.fixed!==void 0&&t.fixed!==null&&(typeof t.fixed=="boolean"?(e.fixed.x=t.fixed,e.fixed.y=t.fixed):(t.fixed.x!==void 0&&typeof t.fixed.x=="boolean"&&(e.fixed.x=t.fixed.x),t.fixed.y!==void 0&&typeof t.fixed.y=="boolean"&&(e.fixed.y=t.fixed.y))),n===!0&&t.font===null&&(e.font=ui(a.font)),i.updateGroupOptions(e,t,o),t.scaling!==void 0&&Ut(e.scaling,t.scaling,"label",a.scaling)}},{key:"checkMass",value:function(e,t){if(e.mass!==void 0&&e.mass<=0){var n="";t!==void 0&&(n=" in node id: "+t),console.error("%cNegative or zero mass disallowed"+n+", setting mass to 1.",eT),e.mass=1}}}]),i}();function xce(i,r){var e=typeof mi<"u"&&cn(i)||i["@@iterator"];if(!e){if(he(i)||(e=Cce(i))||r){e&&(i=e);var t=0,n=function(){};return{s:n,n:function(){return t>=i.length?{done:!0}:{done:!1,value:i[t++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(i)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Cce(i,r){var e;if(i){if(typeof i=="string")return r$(i,r);var t=rt(e=Object.prototype.toString.call(i)).call(e,8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return hn(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return r$(i,r)}}function r$(i,r){(r==null||r>i.length)&&(r=i.length);for(var e=0,t=new Array(r);e1?console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity):this.options.opacity=e.opacity),e.shape!==void 0)for(var t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].updateShape();if(typeof e.font<"u"||typeof e.widthConstraint<"u"||typeof e.heightConstraint<"u")for(var n=0,a=Ee(this.body.nodes);n1&&arguments[1]!==void 0?arguments[1]:!1,n=this.body.data.nodes;if(TE("id",e))this.body.data.nodes=e;else if(he(e))this.body.data.nodes=new ju,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new ju;else throw new TypeError("Array or DataSet expected");if(n&&te(this.nodesListeners,function(s,u){n.off(u,s)}),this.body.nodes={},this.body.data.nodes){var a=this;te(this.nodesListeners,function(s,u){a.body.data.nodes.on(u,s)});var o=this.body.data.nodes.getIds();this.add(o,!0)}t===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n,a=[],o=0;o1&&arguments[1]!==void 0?arguments[1]:Nt;return new t(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}},{key:"refresh",value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;te(this.body.nodes,function(n,a){var o=e.body.data.nodes.get(a);o!==void 0&&(t===!0&&n.setOptions({x:null,y:null}),n.setOptions({fixed:!1}),n.setOptions(o))})}},{key:"getPositions",value:function(e){var t={};if(e!==void 0){if(he(e)===!0){for(var n=0;n0?(u=s/o,t+=u*u):t+=s;return o===1/0?1/0:o*ade(t)}});var sde=ae,ude=sde.Math.hypot,lde=ude,hde=lde,cde=hde,dde=V(cde);function CT(i){var r=fde();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function fde(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var Ae=function(){function i(){R(this,i)}return N(i,null,[{key:"transform",value:function(e,t){he(e)||(e=[e]);for(var n=t.point.x,a=t.point.y,o=t.angle,s=t.length,u=0;u4&&arguments[4]!==void 0?arguments[4]:this.getViaNode();e.strokeStyle=this.getColor(e,t),e.lineWidth=t.width,t.dashes!==!1?this._drawDashedLine(e,t,o):this._drawLine(e,t,o)}},{key:"_drawLine",value:function(e,t,n,a,o){if(this.from!=this.to)this._line(e,t,n,a,o);else{var s=this._getCircleData(e),u=Se(s,3),l=u[0],h=u[1],d=u[2];this._circle(e,t,l,h,d)}}},{key:"_drawDashedLine",value:function(e,t,n,a,o){e.lineCap="round";var s=he(t.dashes)?t.dashes:[5,5];if(e.setLineDash!==void 0){if(e.save(),e.setLineDash(s),e.lineDashOffset=0,this.from!=this.to)this._line(e,t,n);else{var u=this._getCircleData(e),l=Se(u,3),h=l[0],d=l[1],c=l[2];this._circle(e,t,h,d,c)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)YE(e,this.from.x,this.from.y,this.to.x,this.to.y,s);else{var f=this._getCircleData(e),v=Se(f,3),p=v[0],g=v[1],y=v[2];this._circle(e,t,p,g,y)}this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}}},{key:"findBorderPosition",value:function(e,t,n){return this.from!=this.to?this._findBorderPosition(e,t,n):this._findBorderPositionCircle(e,t,n)}},{key:"findBorderPositions",value:function(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};var t,n=rt(t=this._getCircleData(e)).call(t,0,2),a=Se(n,2),o=a[0],s=a[1];return{from:this._findBorderPositionCircle(this.from,e,{x:o,y:s,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:o,y:s,low:.6,high:.8,direction:1})}}},{key:"_getCircleData",value:function(e){var t=this.options.selfReference.size;e!==void 0&&this.from.shape.width===void 0&&this.from.shape.resize(e);var n=ST(e,this.options.selfReference.angle,t,this.from);return[n.x,n.y,t]}},{key:"_pointOnCircle",value:function(e,t,n,a){var o=a*2*Math.PI;return{x:e+n*Math.cos(o),y:t-n*Math.sin(o)}}},{key:"_findBorderPositionCircle",value:function(e,t,n){var a=n.x,o=n.y,s=n.low,u=n.high,l=n.direction,h=10,d=this.options.selfReference.size,c=.05,f,v=(s+u)*.5,p=0;this.options.arrowStrikethrough===!0&&(l===-1?p=this.options.endPointOffset.from:l===1&&(p=this.options.endPointOffset.to));var g=0;do{v=(s+u)*.5,f=this._pointOnCircle(a,o,d,v);var y=Math.atan2(e.y-f.y,e.x-f.x),m=e.distanceToBorder(t,y)+p,b=Math.sqrt(Math.pow(f.x-e.x,2)+Math.pow(f.y-e.y,2)),$=m-b;if(Math.abs($)0?l>0?s=v:u=v:l>0?u=v:s=v,++g}while(s<=u&&g1?d=1:d<0&&(d=0);var c=e+d*u,f=t+d*l,v=c-o,p=f-s;return Math.sqrt(v*v+p*p)}},{key:"getArrowData",value:function(e,t,n,a,o,s){var u,l,h,d,c,f,v,p=s.width;t==="from"?(h=this.from,d=this.to,c=s.fromArrowScale<0,f=Math.abs(s.fromArrowScale),v=s.fromArrowType):t==="to"?(h=this.to,d=this.from,c=s.toArrowScale<0,f=Math.abs(s.toArrowScale),v=s.toArrowType):(h=this.to,d=this.from,c=s.middleArrowScale<0,f=Math.abs(s.middleArrowScale),v=s.middleArrowType);var g=15*f+3*p;if(h!=d){var y=dde(h.x-d.x,h.y-d.y),m=g/y;if(t!=="middle")if(this.options.smooth.enabled===!0){var b=this._findBorderPosition(h,e,{via:n}),$=this.getPoint(b.t+m*(t==="from"?1:-1),n);u=Math.atan2(b.y-$.y,b.x-$.x),l=b}else u=Math.atan2(h.y-d.y,h.x-d.x),l=this._findBorderPosition(h,e);else{var S=(c?-m:m)/2,_=this.getPoint(.5+S,n),C=this.getPoint(.5-S,n);u=Math.atan2(_.y-C.y,_.x-C.x),l=this.getPoint(.5,n)}}else{var M=this._getCircleData(e),x=Se(M,3),B=x[0],F=x[1],X=x[2];if(t==="from"){var K=this.options.selfReference.angle,oe=this.options.selfReference.angle+Math.PI,Qe=this._findBorderPositionCircle(this.from,e,{x:B,y:F,low:K,high:oe,direction:-1});u=Qe.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI,l=Qe}else if(t==="to"){var Ne=this.options.selfReference.angle,At=this.options.selfReference.angle+Math.PI,lt=this._findBorderPositionCircle(this.from,e,{x:B,y:F,low:Ne,high:At,direction:1});u=lt.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI,l=lt}else{var nt=this.options.selfReference.angle/(2*Math.PI);l=this._pointOnCircle(B,F,X,nt),u=nt*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}var Dt=l.x-g*.9*Math.cos(u),at=l.y-g*.9*Math.sin(u),ye={x:Dt,y:at};return{point:l,core:ye,angle:u,length:g,type:v}}},{key:"drawArrowHead",value:function(e,t,n,a,o){e.strokeStyle=this.getColor(e,t),e.fillStyle=e.strokeStyle,e.lineWidth=t.width;var s=AT.draw(e,o);s&&(this.enableShadow(e,t),ls(e).call(e),this.disableShadow(e,t))}},{key:"enableShadow",value:function(e,t){t.shadow===!0&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}},{key:"disableShadow",value:function(e,t){t.shadow===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}},{key:"drawBackground",value:function(e,t){if(t.background!==!1){var n={strokeStyle:e.strokeStyle,lineWidth:e.lineWidth,dashes:e.dashes};e.strokeStyle=t.backgroundColor,e.lineWidth=t.backgroundSize,this.setStrokeDashed(e,t.backgroundDashes),e.stroke(),e.strokeStyle=n.strokeStyle,e.lineWidth=n.lineWidth,e.dashes=n.dashes,this.setStrokeDashed(e,t.dashes)}}},{key:"setStrokeDashed",value:function(e,t){if(t!==!1)if(e.setLineDash!==void 0){var n=he(t)?t:[5,5];e.setLineDash(n)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else e.setLineDash!==void 0?e.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}}]),i}();function u$(i,r){var e=Ee(i);if(ci){var t=ci(i);r&&(t=Ot(t).call(t,function(n){return bi(i,n).enumerable})),e.push.apply(e,t)}return e}function l$(i){for(var r=1;r"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var pp=function(i){ue(e,i);var r=Tde(e);function e(t,n,a){return R(this,e),r.call(this,t,n,a)}return N(e,[{key:"_findBorderPositionBezier",value:function(n,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates(),s=10,u=.2,l=!1,h=1,d=0,c=this.to,f,v,p=this.options.endPointOffset?this.options.endPointOffset.to:0;n.id===this.from.id&&(c=this.from,l=!0,p=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(p=0);var g=0;do{v=(d+h)*.5,f=this.getPoint(v,o);var y=Math.atan2(c.y-f.y,c.x-f.x),m=c.distanceToBorder(a,y)+p,b=Math.sqrt(Math.pow(f.x-c.x,2)+Math.pow(f.y-c.y,2)),$=m-b;if(Math.abs($)0&&(c=this._getDistanceToLine(y,m,p,g,u,l),d=c"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var h$=function(i){ue(e,i);var r=kde(e);function e(t,n,a){var o;return R(this,e),o=r.call(this,t,n,a),o.via=o.via,o._boundFunction=function(){o.positionBezierNode()},o._body.emitter.on("_repositionBezierNodes",o._boundFunction),o}return N(e,[{key:"setOptions",value:function(n){wu(L(e.prototype),"setOptions",this).call(this,n);var a=!1;this.options.physics!==n.physics&&(a=!0),this.options=n,this.id=this.options.id,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.setupSupportNode(),this.connect(),a===!0&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}},{key:"connect",value:function(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.from===void 0||this.to===void 0||this.options.physics===!1?this.via.setOptions({physics:!1}):this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}},{key:"cleanup",value:function(){return this._body.emitter.off("_repositionBezierNodes",this._boundFunction),this.via!==void 0?(delete this._body.nodes[this.via.id],this.via=void 0,!0):!1}},{key:"setupSupportNode",value:function(){if(this.via===void 0){var n="edgeId:"+this.id,a=this._body.functions.createNode({id:n,shape:"circle",physics:!0,hidden:!0});this._body.nodes[n]=a,this.via=a,this.via.parentEdgeId=this.id,this.positionBezierNode()}}},{key:"positionBezierNode",value:function(){this.via!==void 0&&this.from!==void 0&&this.to!==void 0?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):this.via!==void 0&&(this.via.x=0,this.via.y=0)}},{key:"_line",value:function(n,a,o){this._bezierCurve(n,a,o)}},{key:"_getViaCoordinates",value:function(){return this.via}},{key:"getViaNode",value:function(){return this.via}},{key:"getPoint",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.via;if(this.from===this.to){var o=this._getCircleData(),s=Se(o,3),u=s[0],l=s[1],h=s[2],d=2*Math.PI*(1-n);return{x:u+h*Math.sin(d),y:l+h-h*(1-Math.cos(d))}}else return{x:Math.pow(1-n,2)*this.fromPoint.x+2*n*(1-n)*a.x+Math.pow(n,2)*this.toPoint.x,y:Math.pow(1-n,2)*this.fromPoint.y+2*n*(1-n)*a.y+Math.pow(n,2)*this.toPoint.y}}},{key:"_findBorderPosition",value:function(n,a){return this._findBorderPositionBezier(n,a,this.via)}},{key:"_getDistanceToEdge",value:function(n,a,o,s,u,l){return this._getDistanceToBezierEdge(n,a,o,s,u,l,this.via)}}]),e}(pp);function xde(i){var r=Cde();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function Cde(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var c$=function(i){ue(e,i);var r=xde(e);function e(t,n,a){return R(this,e),r.call(this,t,n,a)}return N(e,[{key:"_line",value:function(n,a,o){this._bezierCurve(n,a,o)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_getViaCoordinates",value:function(){var n=this.options.smooth.roundness,a=this.options.smooth.type,o=Math.abs(this.from.x-this.to.x),s=Math.abs(this.from.y-this.to.y);if(a==="discrete"||a==="diagonalCross"){var u,l;o<=s?u=l=n*s:u=l=n*o,this.from.x>this.to.x&&(u=-u),this.from.y>=this.to.y&&(l=-l);var h=this.from.x+u,d=this.from.y+l;return a==="discrete"&&(o<=s?h=othis.to.x&&(M=-M),this.from.y>=this.to.y&&(x=-x);var B=this.from.x+M,F=this.from.y+x;return o<=s?this.from.x<=this.to.x?B=this.to.xB?this.to.x:B:this.from.y>=this.to.y?F=this.to.y>F?this.to.y:F:F=this.to.y2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(n,a,o.via)}},{key:"_getDistanceToEdge",value:function(n,a,o,s,u,l){var h=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(n,a,o,s,u,l,h)}},{key:"getPoint",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),o=n,s=Math.pow(1-o,2)*this.fromPoint.x+2*o*(1-o)*a.x+Math.pow(o,2)*this.toPoint.x,u=Math.pow(1-o,2)*this.fromPoint.y+2*o*(1-o)*a.y+Math.pow(o,2)*this.toPoint.y;return{x:s,y:u}}}]),e}(pp);function Ade(i){var r=Dde();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function Dde(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var Rde=function(i){ue(e,i);var r=Ade(e);function e(t,n,a){return R(this,e),r.call(this,t,n,a)}return N(e,[{key:"_getDistanceToBezierEdge2",value:function(n,a,o,s,u,l,h,d){for(var c=1e9,f=n,v=a,p=[0,0,0,0],g=1;g<10;g++){var y=.1*g;p[0]=Math.pow(1-y,3),p[1]=3*y*Math.pow(1-y,2),p[2]=3*Math.pow(y,2)*(1-y),p[3]=Math.pow(y,3);var m=p[0]*n+p[1]*h.x+p[2]*d.x+p[3]*o,b=p[0]*a+p[1]*h.y+p[2]*d.y+p[3]*s;if(g>0){var $=this._getDistanceToLine(f,v,m,b,u,l);c=$"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var d$=function(i){ue(e,i);var r=Nde(e);function e(t,n,a){return R(this,e),r.call(this,t,n,a)}return N(e,[{key:"_line",value:function(n,a,o){var s=o[0],u=o[1];this._bezierCurve(n,a,s,u)}},{key:"_getViaCoordinates",value:function(){var n=this.from.x-this.to.x,a=this.from.y-this.to.y,o,s,u,l,h=this.options.smooth.roundness;return(Math.abs(n)>Math.abs(a)||this.options.smooth.forceDirection===!0||this.options.smooth.forceDirection==="horizontal")&&this.options.smooth.forceDirection!=="vertical"?(s=this.from.y,l=this.to.y,o=this.from.x-h*n,u=this.to.x+h*n):(s=this.from.y-h*a,l=this.to.y+h*a,o=this.from.x,u=this.to.x),[{x:o,y:s},{x:u,y:l}]}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_findBorderPosition",value:function(n,a){return this._findBorderPositionBezier(n,a)}},{key:"_getDistanceToEdge",value:function(n,a,o,s,u,l){var h=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates(),d=Se(h,2),c=d[0],f=d[1];return this._getDistanceToBezierEdge2(n,a,o,s,u,l,c,f)}},{key:"getPoint",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),o=Se(a,2),s=o[0],u=o[1],l=n,h=[Math.pow(1-l,3),3*l*Math.pow(1-l,2),3*Math.pow(l,2)*(1-l),Math.pow(l,3)],d=h[0]*this.fromPoint.x+h[1]*s.x+h[2]*u.x+h[3]*this.toPoint.x,c=h[0]*this.fromPoint.y+h[1]*s.y+h[2]*u.y+h[3]*this.toPoint.y;return{x:d,y:c}}}]),e}(Rde);function Bde(i){var r=Fde();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function Fde(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var f$=function(i){ue(e,i);var r=Bde(e);function e(t,n,a){return R(this,e),r.call(this,t,n,a)}return N(e,[{key:"_line",value:function(n,a){n.beginPath(),n.moveTo(this.fromPoint.x,this.fromPoint.y),n.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(n,a),n.stroke(),this.disableShadow(n,a)}},{key:"getViaNode",value:function(){}},{key:"getPoint",value:function(n){return{x:(1-n)*this.fromPoint.x+n*this.toPoint.x,y:(1-n)*this.fromPoint.y+n*this.toPoint.y}}},{key:"_findBorderPosition",value:function(n,a){var o=this.to,s=this.from;n.id===this.from.id&&(o=this.from,s=this.to);var u=Math.atan2(o.y-s.y,o.x-s.x),l=o.x-s.x,h=o.y-s.y,d=Math.sqrt(l*l+h*h),c=n.distanceToBorder(a,u),f=(d-c)/d;return{x:(1-f)*s.x+f*o.x,y:(1-f)*s.y+f*o.y,t:0}}},{key:"_getDistanceToEdge",value:function(n,a,o,s,u,l){return this._getDistanceToLine(n,a,o,s,u,l)}}]),e}(DT),Gn=function(){function i(r,e,t,n,a){if(R(this,i),e===void 0)throw new Error("No body provided");this.options=ui(n),this.globalOptions=n,this.defaultOptions=a,this.body=e,this.imagelist=t,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new TT(this.body,this.options,!0),this.setOptions(r)}return N(i,[{key:"setOptions",value:function(e){if(e){var t=typeof e.physics<"u"&&this.options.physics!==e.physics||typeof e.hidden<"u"&&(this.options.hidden||!1)!==(e.hidden||!1)||typeof e.from<"u"&&this.options.from!==e.from||typeof e.to<"u"&&this.options.to!==e.to;i.parseOptions(this.options,e,!0,this.globalOptions),e.id!==void 0&&(this.id=e.id),e.from!==void 0&&(this.fromId=e.from),e.to!==void 0&&(this.toId=e.to),e.title!==void 0&&(this.title=e.title),e.value!==void 0&&(e.value=ET(e.value));var n=[e,this.options,this.defaultOptions];return this.chooser=cp("edge",n),this.updateLabelModule(e),t=this.updateEdgeType()||t,this._setInteractionWidths(),this.connect(),t}}},{key:"getFormattingValues",value:function(){var e=this.options.arrows.to===!0||this.options.arrows.to.enabled===!0,t=this.options.arrows.from===!0||this.options.arrows.from.enabled===!0,n=this.options.arrows.middle===!0||this.options.arrows.middle.enabled===!0,a=this.options.color.inherit,o={toArrow:e,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,toArrowSrc:this.options.arrows.to.src,toArrowImageWidth:this.options.arrows.to.imageWidth,toArrowImageHeight:this.options.arrows.to.imageHeight,middleArrow:n,middleArrowScale:this.options.arrows.middle.scaleFactor,middleArrowType:this.options.arrows.middle.type,middleArrowSrc:this.options.arrows.middle.src,middleArrowImageWidth:this.options.arrows.middle.imageWidth,middleArrowImageHeight:this.options.arrows.middle.imageHeight,fromArrow:t,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,fromArrowSrc:this.options.arrows.from.src,fromArrowImageWidth:this.options.arrows.from.imageWidth,fromArrowImageHeight:this.options.arrows.from.imageHeight,arrowStrikethrough:this.options.arrowStrikethrough,color:a?void 0:this.options.color.color,inheritsColor:a,opacity:this.options.color.opacity,hidden:this.options.hidden,length:this.options.length,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y,dashes:this.options.dashes,width:this.options.width,background:this.options.background.enabled,backgroundColor:this.options.background.color,backgroundSize:this.options.background.size,backgroundDashes:this.options.background.dashes};if(this.selected||this.hover)if(this.chooser===!0){if(this.selected){var s=this.options.selectionWidth;typeof s=="function"?o.width=s(o.width):typeof s=="number"&&(o.width+=s),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.highlight,o.shadow=this.options.shadow.enabled}else if(this.hover){var u=this.options.hoverWidth;typeof u=="function"?o.width=u(o.width):typeof u=="number"&&(o.width+=u),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.hover,o.shadow=this.options.shadow.enabled}}else typeof this.chooser=="function"&&(this.chooser(o,this.options.id,this.selected,this.hover),o.color!==void 0&&(o.inheritsColor=!1),o.shadow===!1&&(o.shadowColor!==this.options.shadow.color||o.shadowSize!==this.options.shadow.size||o.shadowX!==this.options.shadow.x||o.shadowY!==this.options.shadow.y)&&(o.shadow=!0));else o.shadow=this.options.shadow.enabled,o.width=Math.max(o.width,.3/this.body.view.scale);return o}},{key:"updateLabelModule",value:function(e){var t=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateEdgeType",value:function(){var e=this.options.smooth,t=!1,n=!0;return this.edgeType!==void 0&&((this.edgeType instanceof h$&&e.enabled===!0&&e.type==="dynamic"||this.edgeType instanceof d$&&e.enabled===!0&&e.type==="cubicBezier"||this.edgeType instanceof c$&&e.enabled===!0&&e.type!=="dynamic"&&e.type!=="cubicBezier"||this.edgeType instanceof f$&&e.type.enabled===!1)&&(n=!1),n===!0&&(t=this.cleanup())),n===!0?e.enabled===!0?e.type==="dynamic"?(t=!0,this.edgeType=new h$(this.options,this.body,this.labelModule)):e.type==="cubicBezier"?this.edgeType=new d$(this.options,this.body,this.labelModule):this.edgeType=new c$(this.options,this.body,this.labelModule):this.edgeType=new f$(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),t}},{key:"connect",value:function(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=this.from!==void 0&&this.to!==void 0,this.connected===!0?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}},{key:"disconnect",value:function(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}},{key:"getTitle",value:function(){return this.title}},{key:"isSelected",value:function(){return this.selected}},{key:"getValue",value:function(){return this.options.value}},{key:"setValueRange",value:function(e,t,n){if(this.options.value!==void 0){var a=this.options.scaling.customScalingFunction(e,t,n,this.options.value),o=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){var s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+a*s}this.options.width=this.options.scaling.min+a*o}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}},{key:"_setInteractionWidths",value:function(){typeof this.options.hoverWidth=="function"?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,typeof this.options.selectionWidth=="function"?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}},{key:"draw",value:function(e){var t=this.getFormattingValues();if(!t.hidden){var n=this.edgeType.getViaNode();this.edgeType.drawLine(e,t,this.selected,this.hover,n),this.drawLabel(e,n)}}},{key:"drawArrows",value:function(e){var t=this.getFormattingValues();if(!t.hidden){var n=this.edgeType.getViaNode(),a={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,t.fromArrow&&(a.from=this.edgeType.getArrowData(e,"from",n,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.fromPoint=a.from.core),t.fromArrowSrc&&(a.from.image=this.imagelist.load(t.fromArrowSrc)),t.fromArrowImageWidth&&(a.from.imageWidth=t.fromArrowImageWidth),t.fromArrowImageHeight&&(a.from.imageHeight=t.fromArrowImageHeight)),t.toArrow&&(a.to=this.edgeType.getArrowData(e,"to",n,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.toPoint=a.to.core),t.toArrowSrc&&(a.to.image=this.imagelist.load(t.toArrowSrc)),t.toArrowImageWidth&&(a.to.imageWidth=t.toArrowImageWidth),t.toArrowImageHeight&&(a.to.imageHeight=t.toArrowImageHeight)),t.middleArrow&&(a.middle=this.edgeType.getArrowData(e,"middle",n,this.selected,this.hover,t),t.middleArrowSrc&&(a.middle.image=this.imagelist.load(t.middleArrowSrc)),t.middleArrowImageWidth&&(a.middle.imageWidth=t.middleArrowImageWidth),t.middleArrowImageHeight&&(a.middle.imageHeight=t.middleArrowImageHeight)),t.fromArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,a.from),t.middleArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,a.middle),t.toArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,a.to)}}},{key:"drawLabel",value:function(e,t){if(this.options.label!==void 0){var n=this.from,a=this.to;this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover);var o;if(n.id!=a.id){this.labelModule.pointToSelf=!1,o=this.edgeType.getPoint(.5,t),e.save();var s=this._getRotation(e);s.angle!=0&&(e.translate(s.x,s.y),e.rotate(s.angle)),this.labelModule.draw(e,o.x,o.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;var u=ST(e,this.options.selfReference.angle,this.options.selfReference.size,n);o=this._pointOnCircle(u.x,u.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(e,o.x,o.y,this.selected,this.hover)}}}},{key:"getItemsOnPoint",value:function(e){var t=[];if(this.labelModule.visible()){var n=this._getRotation();Cf(this.labelModule.getSize(),e,n)&&t.push({edgeId:this.id,labelId:0})}var a={left:e.x,top:e.y};return this.isOverlappingWith(a)&&t.push({edgeId:this.id}),t}},{key:"isOverlappingWith",value:function(e){if(this.connected){var t=10,n=this.from.x,a=this.from.y,o=this.to.x,s=this.to.y,u=e.left,l=e.top,h=this.edgeType.getDistanceToEdge(n,a,o,s,u,l);return h0&&s<0)&&(u+=Math.PI),a.angle=u,a}},{key:"_pointOnCircle",value:function(e,t,n,a){return{x:e+n*Math.cos(a),y:t-n*Math.sin(a)}}},{key:"select",value:function(){this.selected=!0}},{key:"unselect",value:function(){this.selected=!1}},{key:"cleanup",value:function(){return this.edgeType.cleanup()}},{key:"remove",value:function(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}},{key:"endPointsValid",value:function(){return this.body.nodes[this.fromId]!==void 0&&this.body.nodes[this.toId]!==void 0}}],[{key:"parseOptions",value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,s=["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"];if(Na(s,e,t,n),t.endPointOffset!==void 0&&t.endPointOffset.from!==void 0&&(Ai(t.endPointOffset.from)?e.endPointOffset.from=t.endPointOffset.from:(e.endPointOffset.from=a.endPointOffset.from!==void 0?a.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),t.endPointOffset!==void 0&&t.endPointOffset.to!==void 0&&(Ai(t.endPointOffset.to)?e.endPointOffset.to=t.endPointOffset.to:(e.endPointOffset.to=a.endPointOffset.to!==void 0?a.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),Ju(t.label)?e.label=t.label:Ju(e.label)||(e.label=void 0),Ut(e,t,"smooth",a),Ut(e,t,"shadow",a),Ut(e,t,"background",a),t.dashes!==void 0&&t.dashes!==null?e.dashes=t.dashes:n===!0&&t.dashes===null&&(e.dashes=Li(a.dashes)),t.scaling!==void 0&&t.scaling!==null?(t.scaling.min!==void 0&&(e.scaling.min=t.scaling.min),t.scaling.max!==void 0&&(e.scaling.max=t.scaling.max),Ut(e.scaling,t.scaling,"label",a.scaling)):n===!0&&t.scaling===null&&(e.scaling=Li(a.scaling)),t.arrows!==void 0&&t.arrows!==null)if(typeof t.arrows=="string"){var u=t.arrows.toLowerCase();e.arrows.to.enabled=ie(u).call(u,"to")!=-1,e.arrows.middle.enabled=ie(u).call(u,"middle")!=-1,e.arrows.from.enabled=ie(u).call(u,"from")!=-1}else if(de(t.arrows)==="object")Ut(e.arrows,t.arrows,"to",a.arrows),Ut(e.arrows,t.arrows,"middle",a.arrows),Ut(e.arrows,t.arrows,"from",a.arrows);else throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+us(t.arrows));else n===!0&&t.arrows===null&&(e.arrows=Li(a.arrows));if(t.color!==void 0&&t.color!==null){var l=Un(t.color)?{color:t.color,highlight:t.color,hover:t.color,inherit:!1,opacity:1}:t.color,h=e.color;if(o)pe(h,a.color,!1,n);else for(var d in h)Object.prototype.hasOwnProperty.call(h,d)&&delete h[d];if(Un(h))h.color=h,h.highlight=h,h.hover=h,h.inherit=!1,l.opacity===void 0&&(h.opacity=1);else{var c=!1;l.color!==void 0&&(h.color=l.color,c=!0),l.highlight!==void 0&&(h.highlight=l.highlight,c=!0),l.hover!==void 0&&(h.hover=l.hover,c=!0),l.inherit!==void 0&&(h.inherit=l.inherit),l.opacity!==void 0&&(h.opacity=Math.min(1,Math.max(0,l.opacity))),c===!0?h.inherit=!1:h.inherit===void 0&&(h.inherit="from")}}else n===!0&&t.color===null&&(e.color=ui(a.color));n===!0&&t.font===null&&(e.font=ui(a.font)),Object.prototype.hasOwnProperty.call(t,"selfReferenceSize")&&(console.warn("The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}"),e.selfReference.size=t.selfReferenceSize)}}]),i}(),jde=function(){function i(r,e,t){var n,a=this;R(this,i),this.body=r,this.images=e,this.groups=t,this.body.functions.createEdge=k(n=this.create).call(n,this),this.edgesListeners={add:function(s,u){a.add(u.items)},update:function(s,u){a.update(u.items)},remove:function(s,u){a.remove(u.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1,type:"arrow"},middle:{enabled:!1,scaleFactor:1,type:"arrow"},from:{enabled:!1,scaleFactor:1,type:"arrow"}},endPointOffset:{from:0,to:0},arrowStrikethrough:!0,color:{color:"#848484",highlight:"#848484",hover:"#848484",inherit:"from",opacity:1},dashes:!1,font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:2,strokeColor:"#ffffff",align:"horizontal",multi:!1,vadjust:0,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"courier new",vadjust:2}},hidden:!1,hoverWidth:1.5,label:void 0,labelHighlightBold:!0,length:void 0,physics:!0,scaling:{min:1,max:15,label:{enabled:!0,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(s,u,l,h){if(u===s)return .5;var d=1/(u-s);return Math.max(0,(h-s)*d)}},selectionWidth:1.5,selfReference:{size:20,angle:Math.PI/4,renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},background:{enabled:!1,color:"rgba(111,111,111,1)",size:10,dashes:!1},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},pe(this.options,this.defaultOptions),this.bindEventListeners()}return N(i,[{key:"bindEventListeners",value:function(){var e=this,t,n;this.body.emitter.on("_forceDisableDynamicCurves",function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;a==="dynamic"&&(a="continuous");var s=!1;for(var u in e.body.edges)if(Object.prototype.hasOwnProperty.call(e.body.edges,u)){var l=e.body.edges[u],h=e.body.data.edges.get(u);if(h!=null){var d=h.smooth;d!==void 0&&d.enabled===!0&&d.type==="dynamic"&&(a===void 0?l.setOptions({smooth:!1}):l.setOptions({smooth:{type:a}}),s=!0)}}o===!0&&s===!0&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",function(){e.reconnectEdges()}),this.body.emitter.on("refreshEdges",k(t=this.refresh).call(t,this)),this.body.emitter.on("refresh",k(n=this.refresh).call(n,this)),this.body.emitter.on("destroy",function(){te(e.edgesListeners,function(a,o){e.body.data.edges&&e.body.data.edges.off(o,a)}),delete e.body.functions.createEdge,delete e.edgesListeners.add,delete e.edgesListeners.update,delete e.edgesListeners.remove,delete e.edgesListeners})}},{key:"setOptions",value:function(e){if(e!==void 0){Gn.parseOptions(this.options,e,!0,this.defaultOptions,!0);var t=!1;if(e.smooth!==void 0)for(var n in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,n)&&(t=this.body.edges[n].updateEdgeType()||t);if(e.font!==void 0)for(var a in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,a)&&this.body.edges[a].updateLabelModule();(e.hidden!==void 0||e.physics!==void 0||t===!0)&&this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.body.data.edges;if(TE("id",e))this.body.data.edges=e;else if(he(e))this.body.data.edges=new ju,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new ju;else throw new TypeError("Array or DataSet expected");if(a&&te(this.edgesListeners,function(s,u){a.off(u,s)}),this.body.edges={},this.body.data.edges){te(this.edgesListeners,function(s,u){t.body.data.edges.on(u,s)});var o=this.body.data.edges.getIds();this.add(o,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),n===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.body.edges,a=this.body.data.edges,o=0;o1&&arguments[1]!==void 0?arguments[1]:!0;if(e.length!==0){var n=this.body.edges;te(e,function(a){var o=n[a];o!==void 0&&o.remove()}),t&&this.body.emitter.emit("_dataChanged")}}},{key:"refresh",value:function(){var e=this;te(this.body.edges,function(t,n){var a=e.body.data.edges.get(n);a!==void 0&&t.setOptions(a)})}},{key:"create",value:function(e){return new Gn(e,this.body,this.images,this.options,this.defaultOptions)}},{key:"reconnectEdges",value:function(){var e,t=this.body.nodes,n=this.body.edges;for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(t[e].edges=[]);for(e in n)if(Object.prototype.hasOwnProperty.call(n,e)){var a=n[e];a.from=null,a.to=null,a.connect()}}},{key:"getConnectedNodes",value:function(e){var t=[];if(this.body.edges[e]!==void 0){var n=this.body.edges[e];n.fromId!==void 0&&t.push(n.fromId),n.toId!==void 0&&t.push(n.toId)}return t}},{key:"_updateState",value:function(){this._addMissingEdges(),this._removeInvalidEdges()}},{key:"_removeInvalidEdges",value:function(){var e=this,t=[];te(this.body.edges,function(n,a){var o=e.body.nodes[n.toId],s=e.body.nodes[n.fromId];o!==void 0&&o.isCluster===!0||s!==void 0&&s.isCluster===!0||(o===void 0||s===void 0)&&t.push(a)}),this.remove(t,!1)}},{key:"_addMissingEdges",value:function(){var e=this.body.data.edges;if(e!=null){var t=this.body.edges,n=[];fe(e).call(e,function(a,o){var s=t[o];s===void 0&&n.push(o)}),this.add(n,!0)}}}]),i}(),RT=function(){function i(r,e,t){R(this,i),this.body=r,this.physicsBody=e,this.barnesHutTree,this.setOptions(t),this._rng=Zl("BARNES HUT SOLVER")}return N(i,[{key:"setOptions",value:function(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}},{key:"solve",value:function(){if(this.options.gravitationalConstant!==0&&this.physicsBody.physicsNodeIndices.length>0){var e,t=this.body.nodes,n=this.physicsBody.physicsNodeIndices,a=n.length,o=this._formBarnesHutTree(t,n);this.barnesHutTree=o;for(var s=0;s0&&this._getForceContributions(o.root,e)}}},{key:"_getForceContributions",value:function(e,t){this._getForceContribution(e.children.NW,t),this._getForceContribution(e.children.NE,t),this._getForceContribution(e.children.SW,t),this._getForceContribution(e.children.SE,t)}},{key:"_getForceContribution",value:function(e,t){if(e.childrenCount>0){var n=e.centerOfMass.x-t.x,a=e.centerOfMass.y-t.y,o=Math.sqrt(n*n+a*a);o*e.calcSize>this.thetaInversed?this._calculateForces(o,n,a,t,e):e.childrenCount===4?this._getForceContributions(e,t):e.children.data.id!=t.id&&this._calculateForces(o,n,a,t,e)}}},{key:"_calculateForces",value:function(e,t,n,a,o){e===0&&(e=.1,t=e),this.overlapAvoidanceFactor<1&&a.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*a.shape.radius,e-a.shape.radius));var s=this.options.gravitationalConstant*o.mass*a.options.mass/Math.pow(e,3),u=t*s,l=n*s;this.physicsBody.forces[a.id].x+=u,this.physicsBody.forces[a.id].y+=l}},{key:"_formBarnesHutTree",value:function(e,t){for(var n,a=t.length,o=e[t[0]].x,s=e[t[0]].y,u=e[t[0]].x,l=e[t[0]].y,h=1;h0&&(cu&&(u=c),fl&&(l=f))}var v=Math.abs(u-o)-Math.abs(l-s);v>0?(s-=.5*v,l+=.5*v):(o+=.5*v,u-=.5*v);var p=1e-5,g=Math.max(p,Math.abs(u-o)),y=.5*g,m=.5*(o+u),b=.5*(s+l),$={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:m-y,maxX:m+y,minY:b-y,maxY:b+y},size:g,calcSize:1/g,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch($.root);for(var S=0;S0&&this._placeInTree($.root,n);return $}},{key:"_updateBranchMass",value:function(e,t){var n=e.centerOfMass,a=e.mass+t.options.mass,o=1/a;n.x=n.x*e.mass+t.x*t.options.mass,n.x*=o,n.y=n.y*e.mass+t.y*t.options.mass,n.y*=o,e.mass=a;var s=Math.max(Math.max(t.height,t.radius),t.width);e.maxWidth=e.maxWidtht.x?a.maxY>t.y?o="NW":o="SW":a.maxY>t.y?o="NE":o="SE",this._placeInRegion(e,t,o)}},{key:"_placeInRegion",value:function(e,t,n){var a=e.children[n];switch(a.childrenCount){case 0:a.children.data=t,a.childrenCount=1,this._updateBranchMass(a,t);break;case 1:a.children.data.x===t.x&&a.children.data.y===t.y?(t.x+=this._rng(),t.y+=this._rng()):(this._splitBranch(a),this._placeInTree(a,t));break;case 4:this._placeInTree(a,t);break}}},{key:"_splitBranch",value:function(e){var t=null;e.childrenCount===1&&(t=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,"NW"),this._insertRegion(e,"NE"),this._insertRegion(e,"SW"),this._insertRegion(e,"SE"),t!=null&&this._placeInTree(e,t)}},{key:"_insertRegion",value:function(e,t){var n,a,o,s,u=.5*e.size;switch(t){case"NW":n=e.range.minX,a=e.range.minX+u,o=e.range.minY,s=e.range.minY+u;break;case"NE":n=e.range.minX+u,a=e.range.maxX,o=e.range.minY,s=e.range.minY+u;break;case"SW":n=e.range.minX,a=e.range.minX+u,o=e.range.minY+u,s=e.range.maxY;break;case"SE":n=e.range.minX+u,a=e.range.maxX,o=e.range.minY+u,s=e.range.maxY;break}e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:n,maxX:a,minY:o,maxY:s},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}},{key:"_debug",value:function(e,t){this.barnesHutTree!==void 0&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}},{key:"_drawBranch",value:function(e,t,n){n===void 0&&(n="#FF0000"),e.childrenCount===4&&(this._drawBranch(e.children.NW,t),this._drawBranch(e.children.NE,t),this._drawBranch(e.children.SE,t),this._drawBranch(e.children.SW,t)),t.strokeStyle=n,t.beginPath(),t.moveTo(e.range.minX,e.range.minY),t.lineTo(e.range.maxX,e.range.minY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.minY),t.lineTo(e.range.maxX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.maxY),t.lineTo(e.range.minX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.minX,e.range.maxY),t.lineTo(e.range.minX,e.range.minY),t.stroke()}}]),i}(),Lde=function(){function i(r,e,t){R(this,i),this._rng=Zl("REPULSION SOLVER"),this.body=r,this.physicsBody=e,this.setOptions(t)}return N(i,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,t,n,a,o,s,u,l,h=this.body.nodes,d=this.physicsBody.physicsNodeIndices,c=this.physicsBody.forces,f=this.options.nodeDistance,v=-2/3/f,p=4/3,g=0;g"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var Ude=function(i){ue(e,i);var r=Vde(e);function e(t,n,a){var o;return R(this,e),o=r.call(this,t,n,a),o._rng=Zl("FORCE ATLAS 2 BASED REPULSION SOLVER"),o}return N(e,[{key:"_calculateForces",value:function(n,a,o,s,u){n===0&&(n=.1*this._rng(),a=n),this.overlapAvoidanceFactor<1&&s.shape.radius&&(n=Math.max(.1+this.overlapAvoidanceFactor*s.shape.radius,n-s.shape.radius));var l=s.edges.length+1,h=this.options.gravitationalConstant*u.mass*s.options.mass*l/Math.pow(n,2),d=a*h,c=o*h;this.physicsBody.forces[s.id].x+=d,this.physicsBody.forces[s.id].y+=c}}]),e}(RT);function Kde(i){var r=Gde();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function Gde(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var qde=function(i){ue(e,i);var r=Kde(e);function e(t,n,a){return R(this,e),r.call(this,t,n,a)}return N(e,[{key:"_calculateForces",value:function(n,a,o,s,u){if(n>0){var l=u.edges.length+1,h=this.options.centralGravity*l*u.options.mass;s[u.id].x=a*h,s[u.id].y=o*h}}}]),e}(_u),Yde=function(){function i(r){R(this,i),this.body=r,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:"barnesHut",stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0,wind:{x:0,y:0}},Fe(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}return N(i,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("initPhysics",function(){e.initPhysics()}),this.body.emitter.on("_layoutFailed",function(){e.layoutFailed=!0}),this.body.emitter.on("resetPhysics",function(){e.stopSimulation(),e.ready=!1}),this.body.emitter.on("disablePhysics",function(){e.physicsEnabled=!1,e.stopSimulation()}),this.body.emitter.on("restorePhysics",function(){e.setOptions(e.options),e.ready===!0&&e.startSimulation()}),this.body.emitter.on("startSimulation",function(){e.ready===!0&&e.startSimulation()}),this.body.emitter.on("stopSimulation",function(){e.stopSimulation()}),this.body.emitter.on("destroy",function(){e.stopSimulation(!1),e.body.emitter.off()}),this.body.emitter.on("_dataChanged",function(){e.updatePhysicsData()})}},{key:"setOptions",value:function(e){if(e!==void 0)if(e===!1)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(e===!0)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,qu(["stabilization"],this.options,e),Ut(this.options,e,"stabilization"),e.enabled===void 0&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation());var t=this.options.wind;t&&((typeof t.x!="number"||xf(t.x))&&(t.x=0),(typeof t.y!="number"||xf(t.y))&&(t.y=0)),this.timestep=this.options.timestep}this.init()}},{key:"init",value:function(){var e;this.options.solver==="forceAtlas2Based"?(e=this.options.forceAtlas2Based,this.nodesSolver=new Ude(this.body,this.physicsBody,e),this.edgesSolver=new dd(this.body,this.physicsBody,e),this.gravitySolver=new qde(this.body,this.physicsBody,e)):this.options.solver==="repulsion"?(e=this.options.repulsion,this.nodesSolver=new Lde(this.body,this.physicsBody,e),this.edgesSolver=new dd(this.body,this.physicsBody,e),this.gravitySolver=new _u(this.body,this.physicsBody,e)):this.options.solver==="hierarchicalRepulsion"?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new zde(this.body,this.physicsBody,e),this.edgesSolver=new Hde(this.body,this.physicsBody,e),this.gravitySolver=new _u(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new RT(this.body,this.physicsBody,e),this.edgesSolver=new dd(this.body,this.physicsBody,e),this.gravitySolver=new _u(this.body,this.physicsBody,e)),this.modelOptions=e}},{key:"initPhysics",value:function(){this.physicsEnabled===!0&&this.options.enabled===!0?this.options.stabilization.enabled===!0?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}},{key:"startSimulation",value:function(){if(this.physicsEnabled===!0&&this.options.enabled===!0){if(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),this.viewFunction===void 0){var e;this.viewFunction=k(e=this.simulationStep).call(e,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}else this.body.emitter.emit("_redraw")}},{key:"stopSimulation",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.stabilized=!0,e===!0&&this._emitStabilized(),this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,e===!0&&this.body.emitter.emit("_stopRendering"))}},{key:"simulationStep",value:function(){var e=Wu();this.physicsTick();var t=Wu()-e;(t<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}},{key:"_emitStabilized",value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&yr(function(){e.body.emitter.emit("stabilized",{iterations:t}),e.startedStabilization=!1,e.stabilizationIterations=0},0)}},{key:"physicsStep",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}},{key:"adjustTimeStep",value:function(){var e=1.2;this._evaluateStepQuality()===!0?this.timestep=e*this.timestep:this.timestep/es))return!1;return!0}},{key:"moveNodes",value:function(){for(var e=this.physicsBody.physicsNodeIndices,t=0,n=0,a=5,o=0;os&&(e=e>0?s:-s),e}},{key:"_performStep",value:function(e){var t=this.body.nodes[e],n=this.physicsBody.forces[e];this.options.wind&&(n.x+=this.options.wind.x,n.y+=this.options.wind.y);var a=this.physicsBody.velocities[e];this.previousStates[e]={x:t.x,y:t.y,vx:a.x,vy:a.y},t.options.fixed.x===!1?(a.x=this.calculateComponentVelocity(a.x,n.x,t.options.mass),t.x+=a.x*this.timestep):(n.x=0,a.x=0),t.options.fixed.y===!1?(a.y=this.calculateComponentVelocity(a.y,n.y,t.options.mass),t.y+=a.y*this.timestep):(n.y=0,a.y=0);var o=Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2));return o}},{key:"_freezeNodes",value:function(){var e=this.body.nodes;for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t].x&&e[t].y){var n=e[t].options.fixed;this.freezeCache[t]={x:n.x,y:n.y},n.x=!0,n.y=!0}}},{key:"_restoreFrozenNodes",value:function(){var e=this.body.nodes;for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.freezeCache[t]!==void 0&&(e[t].options.fixed.x=this.freezeCache[t].x,e[t].options.fixed.y=this.freezeCache[t].y);this.freezeCache={}}},{key:"stabilize",value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.stabilization.iterations;if(typeof t!="number"&&(t=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",t)),this.physicsBody.physicsNodeIndices.length===0){this.ready=!0;return}this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=t,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,yr(function(){return e._stabilizationBatch()},0)}},{key:"_startStabilizing",value:function(){return this.startedStabilization===!0?!1:(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}},{key:"_stabilizationBatch",value:function(){var e=this,t=function(){return e.stabilized===!1&&e.stabilizationIterations1&&arguments[1]!==void 0?arguments[1]:[],n=1e9,a=-1e9,o=1e9,s=-1e9,u;if(t.length>0)for(var l=0;lu.shape.boundingBox.left&&(o=u.shape.boundingBox.left),su.shape.boundingBox.top&&(n=u.shape.boundingBox.top),a1&&arguments[1]!==void 0?arguments[1]:[],n=1e9,a=-1e9,o=1e9,s=-1e9,u;if(t.length>0)for(var l=0;lu.x&&(o=u.x),su.y&&(n=u.y),a"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var rfe=function(i){ue(e,i);var r=efe(e);function e(t,n,a,o,s,u){var l;return R(this,e),l=r.call(this,t,n,a,o,s,u),l.isCluster=!0,l.containedNodes={},l.containedEdges={},l}return N(e,[{key:"_openChildCluster",value:function(n){var a=this,o=this.body.nodes[n];if(this.containedNodes[n]===void 0)throw new Error("node with id: "+n+" not in current cluster");if(!o.isCluster)throw new Error("node with id: "+n+" is not a cluster");delete this.containedNodes[n],te(o.edges,function(s){delete a.containedEdges[s.id]}),te(o.containedNodes,function(s,u){a.containedNodes[u]=s}),o.containedNodes={},te(o.containedEdges,function(s,u){a.containedEdges[u]=s}),o.containedEdges={},te(o.edges,function(s){te(a.edges,function(u){var l,h,d=ie(l=u.clusteringEdgeReplacingIds).call(l,s.id);d!==-1&&(te(s.clusteringEdgeReplacingIds,function(c){u.clusteringEdgeReplacingIds.push(c),a.body.edges[c].edgeReplacedById=u.id}),Ar(h=u.clusteringEdgeReplacingIds).call(h,d,1))})}),o.edges=[]}}]),e}(Nt),ife=function(){function i(r){var e=this;R(this,i),this.body=r,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},Fe(this.options,this.defaultOptions),this.body.emitter.on("_resetData",function(){e.clusteredNodes={},e.clusteredEdges={}})}return N(i,[{key:"clusterByHubsize",value:function(e,t){e===void 0?e=this._getHubSize():de(e)==="object"&&(t=this._checkOptions(e),e=this._getHubSize());for(var n=[],a=0;a=e&&n.push(o.id)}for(var s=0;s0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(t.joinCondition===void 0)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");t=this._checkOptions(t);var a={},o={};te(this.body.nodes,function(s,u){s.options&&t.joinCondition(s.options)===!0&&(a[u]=s,te(s.edges,function(l){e.clusteredEdges[l.id]===void 0&&(o[l.id]=l)}))}),this._cluster(a,o,t,n)}},{key:"clusterByEdgeCount",value:function(e,t){var n=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;t=this._checkOptions(t);for(var o=[],s={},u,l,h,d=function(){var p={},g={},y=n.body.nodeIndices[c],m=n.body.nodes[y];if(s[y]===void 0){h=0,l=[];for(var b=0;b0&&Ee(g).length>0&&S===!0){var M=function(){for(var K=0;K1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(1,e,t)}},{key:"clusterBridges",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(2,e,t)}},{key:"clusterByConnection",value:function(e,t){var n,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No nodeId supplied to clusterByConnection!");if(this.body.nodes[e]===void 0)throw new Error("The nodeId given to clusterByConnection does not exist!");var o=this.body.nodes[e];t=this._checkOptions(t,o),t.clusterNodeProperties.x===void 0&&(t.clusterNodeProperties.x=o.x),t.clusterNodeProperties.y===void 0&&(t.clusterNodeProperties.y=o.y),t.clusterNodeProperties.fixed===void 0&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=o.options.fixed.x,t.clusterNodeProperties.fixed.y=o.options.fixed.y);var s={},u={},l=o.id,h=vt.cloneOptions(o);s[l]=o;for(var d=0;d-1&&(u[b.id]=b)}this._cluster(s,u,t,a)}},{key:"_createClusterEdges",value:function(e,t,n,a){for(var o,s,u,l,h,d,c=Ee(e),f=[],v=0;v0&&arguments[0]!==void 0?arguments[0]:{};return e.clusterEdgeProperties===void 0&&(e.clusterEdgeProperties={}),e.clusterNodeProperties===void 0&&(e.clusterNodeProperties={}),e}},{key:"_cluster",value:function(e,t,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&this.clusteredNodes[s]!==void 0&&o.push(s);for(var u=0;ua?u.x:a,o=u.ys?u.y:s;return{x:.5*(n+a),y:.5*(o+s)}}},{key:"openCluster",value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No clusterNodeId supplied to openCluster.");var a=this.body.nodes[e];if(a===void 0)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(a.isCluster!==!0||a.containedNodes===void 0||a.containedEdges===void 0)throw new Error("The node:"+e+" is not a valid cluster.");var o=this.findNode(e),s=ie(o).call(o,e)-1;if(s>=0){var u=o[s],l=this.body.nodes[u];l._openChildCluster(e),delete this.body.nodes[e],n===!0&&this.body.emitter.emit("_dataChanged");return}var h=a.containedNodes,d=a.containedEdges;if(t!==void 0&&t.releaseFunction!==void 0&&typeof t.releaseFunction=="function"){var c={},f={x:a.x,y:a.y};for(var v in h)if(Object.prototype.hasOwnProperty.call(h,v)){var p=this.body.nodes[v];c[v]={x:p.x,y:p.y}}var g=t.releaseFunction(f,c);for(var y in h)if(Object.prototype.hasOwnProperty.call(h,y)){var m=this.body.nodes[y];g[y]!==void 0&&(m.x=g[y].x===void 0?a.x:g[y].x,m.y=g[y].y===void 0?a.y:g[y].y)}}else te(h,function(lt){lt.options.fixed.x===!1&&(lt.x=a.x),lt.options.fixed.y===!1&&(lt.y=a.y)});for(var b in h)if(Object.prototype.hasOwnProperty.call(h,b)){var $=this.body.nodes[b];$.vx=a.vx,$.vy=a.vy,$.setOptions({physics:!0}),delete this.clusteredNodes[b]}for(var S=[],_=0;_0&&sa&&(a=s.edges.length),e+=s.edges.length,t+=Math.pow(s.edges.length,2),n+=1}e=e/n,t=t/n;var u=t-Math.pow(e,2),l=Math.sqrt(u),h=Math.floor(e+2*l);return h>a&&(h=a),h}},{key:"_createClusteredEdge",value:function(e,t,n,a,o){var s=vt.cloneOptions(n,"edge");pe(s,a),s.from=e,s.to=t,s.id="clusterEdge:"+io(),o!==void 0&&pe(s,o);var u=this.body.functions.createEdge(s);return u.clusteringEdgeReplacingIds=[n.id],u.connect(),this.body.edges[u.id]=u,u}},{key:"_clusterEdges",value:function(e,t,n,a){if(t instanceof Gn){var o=t,s={};s[o.id]=o,t=s}if(e instanceof Nt){var u=e,l={};l[u.id]=u,e=l}if(n==null)throw new Error("_clusterEdges: parameter clusterNode required");a===void 0&&(a=n.clusterEdgeProperties),this._createClusterEdges(e,t,n,a);for(var h in t)if(Object.prototype.hasOwnProperty.call(t,h)&&this.body.edges[h]!==void 0){var d=this.body.edges[h];this._backupEdgeOptions(d),d.setOptions({physics:!1})}for(var c in e)Object.prototype.hasOwnProperty.call(e,c)&&(this.clusteredNodes[c]={clusterId:n.id,node:this.body.nodes[c]},this.body.nodes[c].setOptions({physics:!1}))}},{key:"_getClusterNodeForNode",value:function(e){if(e!==void 0){var t=this.clusteredNodes[e];if(t!==void 0){var n=t.clusterId;if(n!==void 0)return this.body.nodes[n]}}}},{key:"_filter",value:function(e,t){var n=[];return te(e,function(a){t(a)&&n.push(a)}),n}},{key:"_updateState",value:function(){var e=this,t,n=[],a={},o=function(v){te(e.body.nodes,function(p){p.isCluster===!0&&v(p)})};for(t in this.clusteredNodes)if(Object.prototype.hasOwnProperty.call(this.clusteredNodes,t)){var s=this.body.nodes[t];s===void 0&&n.push(t)}o(function(f){for(var v=0;v0}(!f.endPointsValid()||!p)&&(a[v]=v)}),o(function(f){te(a,function(v){delete f.containedEdges[v],te(f.edges,function(p,g){if(p.id===v){f.edges[g]=null;return}p.clusteringEdgeReplacingIds=e._filter(p.clusteringEdgeReplacingIds,function(y){return!a[y]})}),f.edges=e._filter(f.edges,function(p){return p!==null})})}),te(a,function(f){delete e.clusteredEdges[f]}),te(a,function(f){delete e.body.edges[f]});var l=Ee(this.body.edges);te(l,function(f){var v=e.body.edges[f],p=e._isClusteredNode(v.fromId)||e._isClusteredNode(v.toId);if(p!==e._isClusteredEdge(v.id))if(p){var g=e._getClusterNodeForNode(v.fromId);g!==void 0&&e._clusterEdges(e.body.nodes[v.fromId],v,g);var y=e._getClusterNodeForNode(v.toId);y!==void 0&&e._clusterEdges(e.body.nodes[v.toId],v,y)}else delete e._clusterEdges[f],e._restoreEdge(v)});for(var h=!1,d=!0,c=function(){var v=[];o(function(g){var y=Ee(g.containedNodes).length,m=g.options.allowSingleNodeCluster===!0;(m&&y<1||!m&&y<2)&&v.push(g.id)});for(var p=0;p0,h=h||d};d;)c();h&&this._updateState()}},{key:"_isClusteredNode",value:function(e){return this.clusteredNodes[e]!==void 0}},{key:"_isClusteredEdge",value:function(e){return this.clusteredEdges[e]!==void 0}}]),i}();function nfe(){var i;window!==void 0&&(i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),i===void 0?window.requestAnimationFrame=function(r){r()}:window.requestAnimationFrame=i}var afe=function(){function i(r,e){R(this,i),nfe(),this.body=r,this.canvas=e,this.redrawRequested=!1,this.renderTimer=void 0,this.requiresTimeout=!0,this.renderingActive=!1,this.renderRequests=0,this.allowRedraw=!0,this.dragging=!1,this.zooming=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1},Fe(this.options,this.defaultOptions),this._determineBrowserMethod(),this.bindEventListeners()}return N(i,[{key:"bindEventListeners",value:function(){var e=this,t;this.body.emitter.on("dragStart",function(){e.dragging=!0}),this.body.emitter.on("dragEnd",function(){e.dragging=!1}),this.body.emitter.on("zoom",function(){e.zooming=!0,window.clearTimeout(e.zoomTimeoutId),e.zoomTimeoutId=yr(function(){var n;e.zooming=!1,k(n=e._requestRedraw).call(n,e)()},250)}),this.body.emitter.on("_resizeNodes",function(){e._resizeNodes()}),this.body.emitter.on("_redraw",function(){e.renderingActive===!1&&e._redraw()}),this.body.emitter.on("_blockRedraw",function(){e.allowRedraw=!1}),this.body.emitter.on("_allowRedraw",function(){e.allowRedraw=!0,e.redrawRequested=!1}),this.body.emitter.on("_requestRedraw",k(t=this._requestRedraw).call(t,this)),this.body.emitter.on("_startRendering",function(){e.renderRequests+=1,e.renderingActive=!0,e._startRendering()}),this.body.emitter.on("_stopRendering",function(){e.renderRequests-=1,e.renderingActive=e.renderRequests>0,e.renderTimer=void 0}),this.body.emitter.on("destroy",function(){e.renderRequests=0,e.allowRedraw=!1,e.renderingActive=!1,e.requiresTimeout===!0?clearTimeout(e.renderTimer):window.cancelAnimationFrame(e.renderTimer),e.body.emitter.off()})}},{key:"setOptions",value:function(e){if(e!==void 0){var t=["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"];Na(t,this.options,e)}}},{key:"_requestNextFrame",value:function(e,t){if(!(typeof window>"u")){var n,a=window;return this.requiresTimeout===!0?n=yr(e,t):a.requestAnimationFrame&&(n=a.requestAnimationFrame(e)),n}}},{key:"_startRendering",value:function(){if(this.renderingActive===!0&&this.renderTimer===void 0){var e;this.renderTimer=this._requestNextFrame(k(e=this._renderStep).call(e,this),this.simulationInterval)}}},{key:"_renderStep",value:function(){this.renderingActive===!0&&(this.renderTimer=void 0,this.requiresTimeout===!0&&this._startRendering(),this._redraw(),this.requiresTimeout===!1&&this._startRendering())}},{key:"redraw",value:function(){this.body.emitter.emit("setSize"),this._redraw()}},{key:"_requestRedraw",value:function(){var e=this;this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,this._requestNextFrame(function(){e._redraw(!1)},0))}},{key:"_redraw",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;var t={drawExternalLabels:null};(this.canvas.frame.canvas.width===0||this.canvas.frame.canvas.height===0)&&this.canvas.setSize(),this.canvas.setTransform();var n=this.canvas.getContext(),a=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;if(n.clearRect(0,0,a,o),this.canvas.frame.clientWidth===0)return;if(n.save(),n.translate(this.body.view.translation.x,this.body.view.translation.y),n.scale(this.body.view.scale,this.body.view.scale),n.beginPath(),this.body.emitter.emit("beforeDrawing",n),n.closePath(),e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawEdges(n),this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1){var s=this._drawNodes(n,e),u=s.drawExternalLabels;t.drawExternalLabels=u}e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawArrows(n),t.drawExternalLabels!=null&&t.drawExternalLabels(),e===!1&&this._drawSelectionBox(n),n.beginPath(),this.body.emitter.emit("afterDrawing",n),n.closePath(),n.restore(),e===!0&&n.clearRect(0,0,a,o)}}},{key:"_resizeNodes",value:function(){this.canvas.setTransform();var e=this.canvas.getContext();e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);var t=this.body.nodes,n;for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(n=t[a],n.resize(e),n.updateBoundingBox(e,n.selected));e.restore()}},{key:"_drawNodes",value:function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.body.nodes,a=this.body.nodeIndices,o,s=[],u=[],l=20,h=this.canvas.DOMtoCanvas({x:-20,y:-20}),d=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+l,y:this.canvas.frame.canvas.clientHeight+l}),c={top:h.y,left:h.x,bottom:d.y,right:d.x},f=[],v=0;v0&&arguments[0]!==void 0?arguments[0]:this.pixelRatio;this.initialized===!0&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}},{key:"_setCameraState",value:function(){if(this.cameraState.scale!==void 0&&this.frame.canvas.clientWidth!==0&&this.frame.canvas.clientHeight!==0&&this.pixelRatio!==0&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){var e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,n=this.cameraState.scale;e!=1&&t!=1?n=this.cameraState.scale*.5*(e+t):e!=1?n=this.cameraState.scale*e:t!=1&&(n=this.cameraState.scale*t),this.body.view.scale=n;var a=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),o={x:a.x-this.cameraState.position.x,y:a.y-this.cameraState.position.y};this.body.view.translation.x+=o.x*this.body.view.scale,this.body.view.translation.y+=o.y*this.body.view.scale}}},{key:"_prepareValue",value:function(e){if(typeof e=="number")return e+"px";if(typeof e=="string"){if(ie(e).call(e,"%")!==-1||ie(e).call(e,"px")!==-1)return e;if(ie(e).call(e,"%")===-1)return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}},{key:"_create",value:function(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=0,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext)this._setPixelRatio(),this.setTransform();else{var e=document.createElement("DIV");e.style.color="red",e.style.fontWeight="bold",e.style.padding="10px",e.innerText="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(e)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}},{key:"_bindHammer",value:function(){var e=this;this.hammer!==void 0&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new Kn(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:Kn.DIRECTION_ALL}),Zu(this.hammer,function(t){e.body.eventListeners.onTouch(t)}),this.hammer.on("tap",function(t){e.body.eventListeners.onTap(t)}),this.hammer.on("doubletap",function(t){e.body.eventListeners.onDoubleTap(t)}),this.hammer.on("press",function(t){e.body.eventListeners.onHold(t)}),this.hammer.on("panstart",function(t){e.body.eventListeners.onDragStart(t)}),this.hammer.on("panmove",function(t){e.body.eventListeners.onDrag(t)}),this.hammer.on("panend",function(t){e.body.eventListeners.onDragEnd(t)}),this.hammer.on("pinch",function(t){e.body.eventListeners.onPinch(t)}),this.frame.canvas.addEventListener("wheel",function(t){e.body.eventListeners.onMouseWheel(t)}),this.frame.canvas.addEventListener("mousemove",function(t){e.body.eventListeners.onMouseMove(t)}),this.frame.canvas.addEventListener("contextmenu",function(t){e.body.eventListeners.onContext(t)}),this.hammerFrame=new Kn(this.frame),NT(this.hammerFrame,function(t){e.body.eventListeners.onRelease(t)})}},{key:"setSize",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.width,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.height;e=this._prepareValue(e),t=this._prepareValue(t);var n=!1,a=this.frame.canvas.width,o=this.frame.canvas.height,s=this.pixelRatio;if(this._setPixelRatio(),e!=this.options.width||t!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=t)this._getCameraState(s),this.frame.style.width=e,this.frame.style.height=t,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=e,this.options.height=t,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},n=!0;else{var u=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),l=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==u||this.frame.canvas.height!==l)&&this._getCameraState(s),this.frame.canvas.width!==u&&(this.frame.canvas.width=u,n=!0),this.frame.canvas.height!==l&&(this.frame.canvas.height=l,n=!0)}return n===!0&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(a/this.pixelRatio),oldHeight:Math.round(o/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,n}},{key:"getContext",value:function(){return this.frame.canvas.getContext("2d")}},{key:"_determinePixelRatio",value:function(){var e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");var t=1;typeof window<"u"&&(t=window.devicePixelRatio||1);var n=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/n}},{key:"_setPixelRatio",value:function(){this.pixelRatio=this._determinePixelRatio()}},{key:"setTransform",value:function(){var e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}},{key:"_XconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.x)/this.body.view.scale}},{key:"_XconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.x}},{key:"_YconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.y)/this.body.view.scale}},{key:"_YconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.y}},{key:"canvasToDOM",value:function(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}},{key:"DOMtoCanvas",value:function(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}}]),i}();function cfe(i,r){var e=Fe({nodes:r,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},i??{});if(!he(e.nodes))throw new TypeError("Nodes has to be an array of ids.");if(e.nodes.length===0&&(e.nodes=r),!(typeof e.minZoomLevel=="number"&&e.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!(typeof e.maxZoomLevel=="number"&&e.minZoomLevel<=e.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return e}var dfe=function(){function i(r,e){var t,n=this,a;R(this,i),this.body=r,this.canvas=e,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction="easeInOutQuint",this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on("fit",k(t=this.fit).call(t,this)),this.body.emitter.on("animationFinished",function(){n.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",k(a=this.releaseNode).call(a,this))}return N(i,[{key:"setOptions",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=e}},{key:"fit",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;e=cfe(e,this.body.nodeIndices);var n=this.canvas.frame.canvas.clientWidth,a=this.canvas.frame.canvas.clientHeight,o,s;if(n===0||a===0)s=1,o=vt.getRange(this.body.nodes,e.nodes);else if(t===!0){var u=0;for(var l in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,l)){var h=this.body.nodes[l];h.predefinedPosition===!0&&(u+=1)}if(u>.5*this.body.nodeIndices.length){this.fit(e,!1);return}o=vt.getRange(this.body.nodes,e.nodes);var d=this.body.nodeIndices.length;s=12.662/(d+7.4147)+.0964822;var c=Math.min(n/600,a/600);s*=c}else{this.body.emitter.emit("_resizeNodes"),o=vt.getRange(this.body.nodes,e.nodes);var f=Math.abs(o.maxX-o.minX)*1.1,v=Math.abs(o.maxY-o.minY)*1.1,p=n/f,g=a/v;s=p<=g?p:g}s>e.maxZoomLevel?s=e.maxZoomLevel:s1&&arguments[1]!==void 0?arguments[1]:{};if(this.body.nodes[e]!==void 0){var n={x:this.body.nodes[e].x,y:this.body.nodes[e].y};t.position=n,t.lockedOnNode=e,this.moveTo(t)}else console.error("Node: "+e+" cannot be found.")}},{key:"moveTo",value:function(e){if(e===void 0){e={};return}if(e.offset!=null){if(e.offset.x!=null){if(e.offset.x=+e.offset.x,!Ai(e.offset.x))throw new TypeError('The option "offset.x" has to be a finite number.')}else e.offset.x=0;if(e.offset.y!=null){if(e.offset.y=+e.offset.y,!Ai(e.offset.y))throw new TypeError('The option "offset.y" has to be a finite number.')}else e.offset.x=0}else e.offset={x:0,y:0};if(e.position!=null){if(e.position.x!=null){if(e.position.x=+e.position.x,!Ai(e.position.x))throw new TypeError('The option "position.x" has to be a finite number.')}else e.position.x=0;if(e.position.y!=null){if(e.position.y=+e.position.y,!Ai(e.position.y))throw new TypeError('The option "position.y" has to be a finite number.')}else e.position.x=0}else e.position=this.getViewPosition();if(e.scale!=null){if(e.scale=+e.scale,!(e.scale>0))throw new TypeError('The option "scale" has to be a number greater than zero.')}else e.scale=this.body.view.scale;e.animation===void 0&&(e.animation={duration:0}),e.animation===!1&&(e.animation={duration:0}),e.animation===!0&&(e.animation={}),e.animation.duration===void 0&&(e.animation.duration=1e3),e.animation.easingFunction===void 0&&(e.animation.easingFunction="easeInOutQuad"),this.animateView(e)}},{key:"animateView",value:function(e){if(e!==void 0){this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),e.locked===!0&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),this.easingTime!=0&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;var t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),n={x:t.x-e.position.x,y:t.y-e.position.y};if(this.targetTranslation={x:this.sourceTranslation.x+n.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+n.y*this.targetScale+e.offset.y},e.animation.duration===0)if(this.lockedOnNodeId!=null){var a;this.viewFunction=k(a=this._lockedRedraw).call(a,this),this.body.emitter.on("initRedraw",this.viewFunction)}else this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw");else{var o;this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=k(o=this._transitionRedraw).call(o,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}}},{key:"_lockedRedraw",value:function(){var e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),n={x:t.x-e.x,y:t.y-e.y},a=this.body.view.translation,o={x:a.x+n.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:a.y+n.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=o}},{key:"releaseNode",value:function(){this.lockedOnNodeId!==void 0&&this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}},{key:"_transitionRedraw",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;var t=Yae[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},this.easingTime>=1){if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,this.lockedOnNodeId!=null){var n;this.viewFunction=k(n=this._lockedRedraw).call(n,this),this.body.emitter.on("initRedraw",this.viewFunction)}this.body.emitter.emit("animationFinished")}}},{key:"getScale",value:function(){return this.body.view.scale}},{key:"getViewPosition",value:function(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}]),i}();function p$(i){var r=i&&i.preventDefault||!1,e=i&&i.container||window,t={},n={keydown:{},keyup:{}},a={},o;for(o=97;o<=122;o++)a[String.fromCharCode(o)]={code:65+(o-97),shift:!1};for(o=65;o<=90;o++)a[String.fromCharCode(o)]={code:o,shift:!0};for(o=0;o<=9;o++)a[""+o]={code:48+o,shift:!1};for(o=1;o<=12;o++)a["F"+o]={code:111+o,shift:!1};for(o=0;o<=9;o++)a["num"+o]={code:96+o,shift:!1};a["num*"]={code:106,shift:!1},a["num+"]={code:107,shift:!1},a["num-"]={code:109,shift:!1},a["num/"]={code:111,shift:!1},a["num."]={code:110,shift:!1},a.left={code:37,shift:!1},a.up={code:38,shift:!1},a.right={code:39,shift:!1},a.down={code:40,shift:!1},a.space={code:32,shift:!1},a.enter={code:13,shift:!1},a.shift={code:16,shift:void 0},a.esc={code:27,shift:!1},a.backspace={code:8,shift:!1},a.tab={code:9,shift:!1},a.ctrl={code:17,shift:!1},a.alt={code:18,shift:!1},a.delete={code:46,shift:!1},a.pageup={code:33,shift:!1},a.pagedown={code:34,shift:!1},a["="]={code:187,shift:!1},a["-"]={code:189,shift:!1},a["]"]={code:221,shift:!1},a["["]={code:219,shift:!1};var s=function(h){l(h,"keydown")},u=function(h){l(h,"keyup")},l=function(h,d){if(n[d][h.keyCode]!==void 0){for(var c=n[d][h.keyCode],f=0;f700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=new Date().valueOf())}},{key:"_stopMovement",value:function(){for(var e in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,e)&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}},{key:"_moveUp",value:function(){this.body.view.translation.y+=this.options.keyboard.speed.y}},{key:"_moveDown",value:function(){this.body.view.translation.y-=this.options.keyboard.speed.y}},{key:"_moveLeft",value:function(){this.body.view.translation.x+=this.options.keyboard.speed.x}},{key:"_moveRight",value:function(){this.body.view.translation.x-=this.options.keyboard.speed.x}},{key:"_zoomIn",value:function(){var e=this.body.view.scale,t=this.body.view.scale*(1+this.options.keyboard.speed.zoom),n=this.body.view.translation,a=t/e,o=(1-a)*this.canvas.canvasViewCenter.x+n.x*a,s=(1-a)*this.canvas.canvasViewCenter.y+n.y*a;this.body.view.scale=t,this.body.view.translation={x:o,y:s},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}},{key:"_zoomOut",value:function(){var e=this.body.view.scale,t=this.body.view.scale/(1+this.options.keyboard.speed.zoom),n=this.body.view.translation,a=t/e,o=(1-a)*this.canvas.canvasViewCenter.x+n.x*a,s=(1-a)*this.canvas.canvasViewCenter.y+n.y*a;this.body.view.scale=t,this.body.view.translation={x:o,y:s},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}},{key:"configureKeyboardBindings",value:function(){var e=this;if(this.keycharm!==void 0&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=p$({container:window,preventDefault:!0}):this.keycharm=p$({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0)){var t,n,a,o,s,u,l,h,d,c,f,v,p,g,y,m,b,$,S,_,C,M,x,B;k(t=this.keycharm).call(t,"up",function(){e.bindToRedraw("_moveUp")},"keydown"),k(n=this.keycharm).call(n,"down",function(){e.bindToRedraw("_moveDown")},"keydown"),k(a=this.keycharm).call(a,"left",function(){e.bindToRedraw("_moveLeft")},"keydown"),k(o=this.keycharm).call(o,"right",function(){e.bindToRedraw("_moveRight")},"keydown"),k(s=this.keycharm).call(s,"=",function(){e.bindToRedraw("_zoomIn")},"keydown"),k(u=this.keycharm).call(u,"num+",function(){e.bindToRedraw("_zoomIn")},"keydown"),k(l=this.keycharm).call(l,"num-",function(){e.bindToRedraw("_zoomOut")},"keydown"),k(h=this.keycharm).call(h,"-",function(){e.bindToRedraw("_zoomOut")},"keydown"),k(d=this.keycharm).call(d,"[",function(){e.bindToRedraw("_zoomOut")},"keydown"),k(c=this.keycharm).call(c,"]",function(){e.bindToRedraw("_zoomIn")},"keydown"),k(f=this.keycharm).call(f,"pageup",function(){e.bindToRedraw("_zoomIn")},"keydown"),k(v=this.keycharm).call(v,"pagedown",function(){e.bindToRedraw("_zoomOut")},"keydown"),k(p=this.keycharm).call(p,"up",function(){e.unbindFromRedraw("_moveUp")},"keyup"),k(g=this.keycharm).call(g,"down",function(){e.unbindFromRedraw("_moveDown")},"keyup"),k(y=this.keycharm).call(y,"left",function(){e.unbindFromRedraw("_moveLeft")},"keyup"),k(m=this.keycharm).call(m,"right",function(){e.unbindFromRedraw("_moveRight")},"keyup"),k(b=this.keycharm).call(b,"=",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),k($=this.keycharm).call($,"num+",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),k(S=this.keycharm).call(S,"num-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),k(_=this.keycharm).call(_,"-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),k(C=this.keycharm).call(C,"[",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),k(M=this.keycharm).call(M,"]",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),k(x=this.keycharm).call(x,"pageup",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),k(B=this.keycharm).call(B,"pagedown",function(){e.unbindFromRedraw("_zoomOut")},"keyup")}}}]),i}();function vfe(i,r){var e=typeof mi<"u"&&cn(i)||i["@@iterator"];if(!e){if(he(i)||(e=pfe(i))||r){e&&(i=e);var t=0,n=function(){};return{s:n,n:function(){return t>=i.length?{done:!0}:{done:!1,value:i[t++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(i)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function pfe(i,r){var e;if(i){if(typeof i=="string")return g$(i,r);var t=rt(e=Object.prototype.toString.call(i)).call(e,8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return hn(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return g$(i,r)}}function g$(i,r){(r==null||r>i.length)&&(r=i.length);for(var e=0,t=new Array(r);e50&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=new Date().valueOf())}},{key:"onTap",value:function(e){var t=this.getPointer(e.center),n=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,n),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t)}},{key:"onDoubleTap",value:function(e){var t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("doubleClick",e,t)}},{key:"onHold",value:function(e){var t=this.getPointer(e.center),n=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,n),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t),this.selectionHandler.generateClickEvent("hold",e,t)}},{key:"onRelease",value:function(e){if(new Date().valueOf()-this.touchTime>10){var t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("release",e,t),this.touchTime=new Date().valueOf()}}},{key:"onContext",value:function(e){var t=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler.generateClickEvent("oncontext",e,t)}},{key:"checkSelectionChanges",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;t===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e)}},{key:"_determineDifference",value:function(e,t){var n=function(o,s){for(var u=[],l=0;l=o.minX&&d.x<=o.maxX&&d.y>=o.minY&&d.y<=o.maxY});fe(s).call(s,function(h){return t.selectionHandler.selectObject(t.body.nodes[h])});var u=this.getPointer(e.center);this.selectionHandler.commitAndEmit(u,e),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{var l=this.drag.selection;l&&l.length?(fe(l).call(l,function(h){h.node.options.fixed.x=h.xFixed,h.node.options.fixed.y=h.yFixed}),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}}},{key:"onPinch",value:function(e){var t=this.getPointer(e.center);this.drag.pinched=!0,this.pinch.scale===void 0&&(this.pinch.scale=1);var n=this.pinch.scale*e.scale;this.zoom(n,t)}},{key:"zoom",value:function(e,t){if(this.options.zoomView===!0){var n=this.body.view.scale;e<1e-5&&(e=1e-5),e>10&&(e=10);var a=void 0;this.drag!==void 0&&this.drag.dragging===!0&&(a=this.canvas.DOMtoCanvas(this.drag.pointer));var o=this.body.view.translation,s=e/n,u=(1-s)*t.x+o.x*s,l=(1-s)*t.y+o.y*s;if(this.body.view.scale=e,this.body.view.translation={x:u,y:l},a!=null){var h=this.canvas.canvasToDOM(a);this.drag.pointer.x=h.x,this.drag.pointer.y=h.y}this.body.emitter.emit("_requestRedraw"),n0&&(this.popupObj=h[c[c.length-1]],s=!0)}if(this.popupObj===void 0&&s===!1){for(var v=this.body.edgeIndices,p=this.body.edges,g,y=[],m=0;m0&&(this.popupObj=p[y[y.length-1]],u="edge")}this.popupObj!==void 0?this.popupObj.id!==o&&(this.popup===void 0&&(this.popup=new ioe(this.canvas.frame)),this.popup.popupTargetType=u,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):this.popup!==void 0&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}},{key:"_checkHidePopup",value:function(e){var t=this.selectionHandler._pointerToPositionObject(e),n=!1;if(this.popup.popupTargetType==="node"){if(this.body.nodes[this.popup.popupTargetId]!==void 0&&(n=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t),n===!0)){var a=this.selectionHandler.getNodeAt(e);n=a===void 0?!1:a.id===this.popup.popupTargetId}}else this.selectionHandler.getNodeAt(e)===void 0&&this.body.edges[this.popup.popupTargetId]!==void 0&&(n=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));n===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}]),i}(),yfe=lp,mfe=fT;yfe("Set",function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},mfe);var bfe=ae,$fe=bfe.Set,wfe=$fe,_fe=wfe,Efe=_fe,Pi=V(Efe),Sfe=se,y$=hp,tu=Ql.getWeakData,Ofe=up,Tfe=Vt,Ife=Sa,fd=Xe,kfe=sp,MT=yi,m$=Je,BT=ln,Pfe=BT.set,xfe=BT.getterFor,Cfe=MT.find,Afe=MT.findIndex,Dfe=Sfe([].splice),Rfe=0,ru=function(i){return i.frozen||(i.frozen=new FT)},FT=function(){this.entries=[]},vd=function(i,r){return Cfe(i.entries,function(e){return e[0]===r})};FT.prototype={get:function(i){var r=vd(this,i);if(r)return r[1]},has:function(i){return!!vd(this,i)},set:function(i,r){var e=vd(this,i);e?e[1]=r:this.entries.push([i,r])},delete:function(i){var r=Afe(this.entries,function(e){return e[0]===i});return~r&&Dfe(this.entries,r,1),!!~r}};var Nfe={getConstructor:function(i,r,e,t){var n=i(function(u,l){Ofe(u,a),Pfe(u,{type:r,id:Rfe++,frozen:void 0}),Ife(l)||kfe(l,u[t],{that:u,AS_ENTRIES:e})}),a=n.prototype,o=xfe(r),s=function(u,l,h){var d=o(u),c=tu(Tfe(l),!0);return c===!0?ru(d).set(l,h):c[d.id]=h,u};return y$(a,{delete:function(u){var l=o(this);if(!fd(u))return!1;var h=tu(u);return h===!0?ru(l).delete(u):h&&m$(h,l.id)&&delete h[l.id]},has:function(l){var h=o(this);if(!fd(l))return!1;var d=tu(l);return d===!0?ru(h).has(l):d&&m$(d,h.id)}}),y$(a,e?{get:function(l){var h=o(this);if(fd(l)){var d=tu(l);return d===!0?ru(h).get(l):d?d[h.id]:void 0}},set:function(l,h){return s(this,l,h)}}:{add:function(l){return s(this,l,!0)}}),n}},Mfe=lT,b$=Ie,Eu=se,$$=hp,Bfe=Ql,Ffe=lp,jT=Nfe,iu=Xe,nu=ln.enforce,jfe=ne,Lfe=QE,ps=Object,zfe=Array.isArray,au=ps.isExtensible,LT=ps.isFrozen,Hfe=ps.isSealed,zT=ps.freeze,Vfe=ps.seal,w$={},_$={},Wfe=!b$.ActiveXObject&&"ActiveXObject"in b$,Va,HT=function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},VT=Ffe("WeakMap",HT,jT),xn=VT.prototype,Su=Eu(xn.set),Ufe=function(){return Mfe&&jfe(function(){var i=zT([]);return Su(new VT,i,1),!LT(i)})};if(Lfe)if(Wfe){Va=jT.getConstructor(HT,"WeakMap",!0),Bfe.enable();var E$=Eu(xn.delete),ou=Eu(xn.has),S$=Eu(xn.get);$$(xn,{delete:function(i){if(iu(i)&&!au(i)){var r=nu(this);return r.frozen||(r.frozen=new Va),E$(this,i)||r.frozen.delete(i)}return E$(this,i)},has:function(r){if(iu(r)&&!au(r)){var e=nu(this);return e.frozen||(e.frozen=new Va),ou(this,r)||e.frozen.has(r)}return ou(this,r)},get:function(r){if(iu(r)&&!au(r)){var e=nu(this);return e.frozen||(e.frozen=new Va),ou(this,r)?S$(this,r):e.frozen.get(r)}return S$(this,r)},set:function(r,e){if(iu(r)&&!au(r)){var t=nu(this);t.frozen||(t.frozen=new Va),ou(this,r)?Su(this,r,e):t.frozen.set(r,e)}else Su(this,r,e);return this}})}else Ufe()&&$$(xn,{set:function(r,e){var t;return zfe(r)&&(LT(r)?t=w$:Hfe(r)&&(t=_$)),Su(this,r,e),t===w$&&zT(r),t===_$&&Vfe(r),this}});var Kfe=ae,Gfe=Kfe.WeakMap,qfe=Gfe,Yfe=qfe,Xfe=Yfe,no=V(Xfe);function ve(i,r,e,t){if(e==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?i!==r||!t:!r.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?t:e==="a"?t.call(i):t?t.value:r.get(i)}function Rf(i,r,e,t,n){if(typeof r=="function"?i!==r||!0:!r.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r.set(i,e),e}function Nf(i,r){var e=typeof mi<"u"&&cn(i)||i["@@iterator"];if(!e){if(he(i)||(e=Jfe(i))||r){e&&(i=e);var t=0,n=function(){};return{s:n,n:function(){return t>=i.length?{done:!0}:{done:!1,value:i[t++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(i)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Jfe(i,r){var e;if(i){if(typeof i=="string")return O$(i,r);var t=rt(e=Object.prototype.toString.call(i)).call(e,8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return hn(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return O$(i,r)}}function O$(i,r){(r==null||r>i.length)&&(r=i.length);for(var e=0,t=new Array(r);e0&&arguments[0]!==void 0?arguments[0]:function(){};R(this,i),Kr.set(this,new I$),Gr.set(this,new I$),Ou.set(this,void 0),Rf(this,Ou,r)}return N(i,[{key:"sizeNodes",get:function(){return ve(this,Kr,"f").size}},{key:"sizeEdges",get:function(){return ve(this,Gr,"f").size}},{key:"getNodes",value:function(){return ve(this,Kr,"f").getSelection()}},{key:"getEdges",value:function(){return ve(this,Gr,"f").getSelection()}},{key:"addNodes",value:function(){var e;(e=ve(this,Kr,"f")).add.apply(e,arguments)}},{key:"addEdges",value:function(){var e;(e=ve(this,Gr,"f")).add.apply(e,arguments)}},{key:"deleteNodes",value:function(e){ve(this,Kr,"f").delete(e)}},{key:"deleteEdges",value:function(e){ve(this,Gr,"f").delete(e)}},{key:"clear",value:function(){ve(this,Kr,"f").clear(),ve(this,Gr,"f").clear()}},{key:"commit",value:function(){for(var e,t,n={nodes:ve(this,Kr,"f").commit(),edges:ve(this,Gr,"f").commit()},a=arguments.length,o=new Array(a),s=0;s=i.length?{done:!0}:{done:!1,value:i[t++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(i)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Qfe(i,r){var e;if(i){if(typeof i=="string")return P$(i,r);var t=rt(e=Object.prototype.toString.call(i)).call(e,8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return hn(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return P$(i,r)}}function P$(i,r){(r==null||r>i.length)&&(r=i.length);for(var e=0,t=new Array(r);e4&&arguments[4]!==void 0?arguments[4]:!1,s=this._initBaseEvent(t,n);if(o===!0)s.nodes=[],s.edges=[];else{var u=this.getSelection();s.nodes=u.nodes,s.edges=u.edges}a!==void 0&&(s.previousSelection=a),e=="click"&&(s.items=this.getClickedItems(n)),t.controlEdge!==void 0&&(s.controlEdge=t.controlEdge),this.body.emitter.emit(e,s)}},{key:"selectObject",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.selectConnectedEdges;if(e!==void 0){if(e instanceof Nt){if(t===!0){var n;(n=this._selectionAccumulator).addEdges.apply(n,dr(e.edges))}this._selectionAccumulator.addNodes(e)}else this._selectionAccumulator.addEdges(e);return!0}return!1}},{key:"deselectObject",value:function(e){e.isSelected()===!0&&(e.selected=!1,this._removeFromSelection(e))}},{key:"_getAllNodesOverlappingWith",value:function(e){for(var t=[],n=this.body.nodes,a=0;a1&&arguments[1]!==void 0?arguments[1]:!0,n=this._pointerToPositionObject(e),a=this._getAllNodesOverlappingWith(n);if(a.length>0)return t===!0?this.body.nodes[a[a.length-1]]:a[a.length-1]}},{key:"_getEdgesOverlappingWith",value:function(e,t){for(var n=this.body.edges,a=0;a1&&arguments[1]!==void 0?arguments[1]:!0,n=this.canvas.DOMtoCanvas(e),a=10,o=null,s=this.body.edges,u=0;u0&&(this.generateClickEvent("deselectEdge",t,e,o),n=!0),a.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",t,e,o),n=!0),a.nodes.added.length>0&&(this.generateClickEvent("selectNode",t,e),n=!0),a.edges.added.length>0&&(this.generateClickEvent("selectEdge",t,e),n=!0),n===!0&&this.generateClickEvent("select",t,e)}},{key:"getSelection",value:function(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}},{key:"getSelectedNodes",value:function(){return this._selectionAccumulator.getNodes()}},{key:"getSelectedEdges",value:function(){return this._selectionAccumulator.getEdges()}},{key:"getSelectedNodeIds",value:function(){var e;return ia(e=this._selectionAccumulator.getNodes()).call(e,function(t){return t.id})}},{key:"getSelectedEdgeIds",value:function(){var e;return ia(e=this._selectionAccumulator.getEdges()).call(e,function(t){return t.id})}},{key:"setSelection",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e||!e.nodes&&!e.edges)throw new TypeError("Selection must be an object with nodes and/or edges properties");if((t.unselectAll||t.unselectAll===void 0)&&this.unselectAll(),e.nodes){var n=k$(e.nodes),a;try{for(n.s();!(a=n.n()).done;){var o=a.value,s=this.body.nodes[o];if(!s)throw new RangeError('Node with id "'+o+'" not found');this.selectObject(s,t.highlightEdges)}}catch(c){n.e(c)}finally{n.f()}}if(e.edges){var u=k$(e.edges),l;try{for(u.s();!(l=u.n()).done;){var h=l.value,d=this.body.edges[h];if(!d)throw new RangeError('Edge with id "'+h+'" not found');this.selectObject(d)}}catch(c){u.e(c)}finally{u.f()}}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}},{key:"selectNodes",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({nodes:e},{highlightEdges:t})}},{key:"selectEdges",value:function(e){if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({edges:e})}},{key:"updateSelection",value:function(){for(var e in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,e.id)||this._selectionAccumulator.deleteNodes(e);for(var t in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,t.id)||this._selectionAccumulator.deleteEdges(t)}},{key:"getClickedItems",value:function(e){for(var t=this.canvas.DOMtoCanvas(e),n=[],a=this.body.nodeIndices,o=this.body.nodes,s=a.length-1;s>=0;s--){var u=o[a[s]],l=u.getItemsOnPoint(t);n.push.apply(n,l)}for(var h=this.body.edgeIndices,d=this.body.edges,c=h.length-1;c>=0;c--){var f=d[h[c]],v=f.getItemsOnPoint(t);n.push.apply(n,v)}return n}}]),i}(),x$=IS,tve=Math.floor,Mf=function(i,r){var e=i.length,t=tve(e/2);return e<8?rve(i,r):ive(i,Mf(x$(i,0,t),r),Mf(x$(i,t),r),r)},rve=function(i,r){for(var e=i.length,t=1,n,a;t0;)i[a]=i[--a];a!==t++&&(i[a]=n)}return i},ive=function(i,r,e,t){for(var n=r.length,a=e.length,o=0,s=0;o3)){if(yve)return!0;if(B$)return B$<603;var i="",r,e,t,n;for(r=65;r<76;r++){switch(e=String.fromCharCode(r),r){case 66:case 69:case 70:case 72:t=3;break;case 68:case 71:t=4;break;default:t=2}for(n=0;n<47;n++)ei.push({k:e+n,v:t})}for(ei.sort(function(a,o){return o.v-a.v}),n=0;nR$(e)?1:-1}};cve({target:"Array",proto:!0,forced:_ve},{sort:function(r){r!==void 0&&dve(r);var e=fve(this);if(UT)return r===void 0?F$(e):F$(e,r);var t=[],n=D$(e),a,o;for(o=0;o=0:s>u;u+=l)u in o&&(n=e(n,o[u],u,a));return n}},Bve={left:j$(!1),right:j$(!0)},Fve=Ie,jve=Hr,Lve=jve(Fve.process)==="process",zve=q,Hve=Bve.left,Vve=Da,L$=Yo,Wve=Lve,Uve=!Wve&&L$>79&&L$<83,Kve=Uve||!Vve("reduce");zve({target:"Array",proto:!0,forced:Kve},{reduce:function(r){var e=arguments.length;return Hve(this,r,e,e>1?arguments[1]:void 0)}});var Gve=Ze,qve=Gve("Array").reduce,Yve=Re,Xve=qve,gd=Array.prototype,Jve=function(i){var r=i.reduce;return i===gd||Yve(gd,i)&&r===gd.reduce?Xve:r},Zve=Jve,Qve=Zve,epe=Qve,KT=V(epe);function GT(i){var r=tpe();return function(){var t=L(i),n;if(r){var a=L(this).constructor;n=E(t,arguments,a)}else n=t.apply(this,arguments);return ce(this,n)}}function tpe(){if(typeof Reflect>"u"||!E||E.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(E(Boolean,[],function(){})),!0}catch{return!1}}var qT=function(){function i(){R(this,i)}return N(i,[{key:"abstract",value:function(){throw new Error("Can't instantiate abstract class!")}},{key:"fake_use",value:function(){}},{key:"curveType",value:function(){return this.abstract()}},{key:"getPosition",value:function(e){return this.fake_use(e),this.abstract()}},{key:"setPosition",value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;this.fake_use(e,t,n),this.abstract()}},{key:"getTreeSize",value:function(e){return this.fake_use(e),this.abstract()}},{key:"sort",value:function(e){this.fake_use(e),this.abstract()}},{key:"fix",value:function(e,t){this.fake_use(e,t),this.abstract()}},{key:"shift",value:function(e,t){this.fake_use(e,t),this.abstract()}}]),i}(),rpe=function(i){ue(e,i);var r=GT(e);function e(t){var n;return R(this,e),n=r.call(this),n.layout=t,n}return N(e,[{key:"curveType",value:function(){return"horizontal"}},{key:"getPosition",value:function(n){return n.x}},{key:"setPosition",value:function(n,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;o!==void 0&&this.layout.hierarchical.addToOrdering(n,o),n.x=a}},{key:"getTreeSize",value:function(n){var a=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,n);return{min:a.min_x,max:a.max_x}}},{key:"sort",value:function(n){ao(n).call(n,function(a,o){return a.x-o.x})}},{key:"fix",value:function(n,a){n.y=this.layout.options.hierarchical.levelSeparation*a,n.options.fixed.y=!0}},{key:"shift",value:function(n,a){this.layout.body.nodes[n].x+=a}}]),e}(qT),ipe=function(i){ue(e,i);var r=GT(e);function e(t){var n;return R(this,e),n=r.call(this),n.layout=t,n}return N(e,[{key:"curveType",value:function(){return"vertical"}},{key:"getPosition",value:function(n){return n.y}},{key:"setPosition",value:function(n,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;o!==void 0&&this.layout.hierarchical.addToOrdering(n,o),n.y=a}},{key:"getTreeSize",value:function(n){var a=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,n);return{min:a.min_y,max:a.max_y}}},{key:"sort",value:function(n){ao(n).call(n,function(a,o){return a.y-o.y})}},{key:"fix",value:function(n,a){n.x=this.layout.options.hierarchical.levelSeparation*a,n.options.fixed.x=!0}},{key:"shift",value:function(n,a){this.layout.body.nodes[n].y+=a}}]),e}(qT),npe=q,ape=yi.every,ope=Da,spe=ope("every");npe({target:"Array",proto:!0,forced:!spe},{every:function(r){return ape(this,r,arguments.length>1?arguments[1]:void 0)}});var upe=Ze,lpe=upe("Array").every,hpe=Re,cpe=lpe,yd=Array.prototype,dpe=function(i){var r=i.every;return i===yd||hpe(yd,i)&&r===yd.every?cpe:r},fpe=dpe,vpe=fpe,ppe=vpe,YT=V(ppe);function gpe(i,r){var e=typeof mi<"u"&&cn(i)||i["@@iterator"];if(!e){if(he(i)||(e=ype(i))||r){e&&(i=e);var t=0,n=function(){};return{s:n,n:function(){return t>=i.length?{done:!0}:{done:!1,value:i[t++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(i)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function ype(i,r){var e;if(i){if(typeof i=="string")return z$(i,r);var t=rt(e=Object.prototype.toString.call(i)).call(e,8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return hn(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return z$(i,r)}}function z$(i,r){(r==null||r>i.length)&&(r=i.length);for(var e=0,t=new Array(r);e=r[a])&&(r[a]=r[n]+1)}),r}function bpe(i){return XT(function(r){var e,t;return YT(e=Ot(t=r.edges).call(t,function(n){return i.has(n.toId)})).call(e,function(n){return n.to===r})},function(r,e){return e>r},"from",i)}function $pe(i){return XT(function(r){var e,t;return YT(e=Ot(t=r.edges).call(t,function(n){return i.has(n.toId)})).call(e,function(n){return n.from===r})},function(r,e){return eo)return{v:{v:mpe(t,a)}};++m},S;b=y.pop();)if(S=$(),S!==0&&S)return S.v},c;for(l.s();!(h=l.n()).done;)if(c=d(),c!==0&&c)return c.v}catch(f){l.e(f)}finally{l.f()}return a}var wpe=function(){function i(){R(this,i),this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}return N(i,[{key:"addRelation",value:function(e,t){this.childrenReference[e]===void 0&&(this.childrenReference[e]=[]),this.childrenReference[e].push(t),this.parentReference[t]===void 0&&(this.parentReference[t]=[]),this.parentReference[t].push(e)}},{key:"checkIfTree",value:function(){for(var e in this.parentReference)if(this.parentReference[e].length>1){this.isTree=!1;return}this.isTree=!0}},{key:"numTrees",value:function(){return this.treeIndex+1}},{key:"setTreeIndex",value:function(e,t){t!==void 0&&this.trees[e.id]===void 0&&(this.trees[e.id]=t,this.treeIndex=Math.max(t,this.treeIndex))}},{key:"ensureLevel",value:function(e){this.levels[e]===void 0&&(this.levels[e]=0)}},{key:"getMaxLevel",value:function(e){var t=this,n={},a=function o(s){if(n[s]!==void 0)return n[s];var u=t.levels[s];if(t.childrenReference[s]){var l=t.childrenReference[s];if(l.length>0)for(var h=0;h0&&(n.levelSeparation*=-1):n.levelSeparation<0&&(n.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(a===!0)return this.body.emitter.emit("refresh"),pe(t,this.optionsBackup)}return t}},{key:"_resetRNG",value:function(e){this.initialRandomSeed=e,this._rng=Zl(this.initialRandomSeed)}},{key:"adaptAllOptionsForHierarchicalLayout",value:function(e){if(this.options.hierarchical.enabled===!0){var t=this.optionsBackup.physics;e.physics===void 0||e.physics===!0?(e.physics={enabled:t.enabled===void 0?!0:t.enabled,solver:"hierarchicalRepulsion"},t.enabled=t.enabled===void 0?!0:t.enabled,t.solver=t.solver||"barnesHut"):de(e.physics)==="object"?(t.enabled=e.physics.enabled===void 0?!0:e.physics.enabled,t.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):e.physics!==!1&&(t.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});var n=this.direction.curveType();if(e.edges===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges={smooth:!1};else if(e.edges.smooth===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges.smooth=!1;else if(typeof e.edges.smooth=="boolean")this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:n};else{var a=e.edges.smooth;a.type!==void 0&&a.type!=="dynamic"&&(n=a.type),this.optionsBackup.edges={smooth:{enabled:a.enabled===void 0?!0:a.enabled,type:a.type===void 0?"dynamic":a.type,roundness:a.roundness===void 0?.5:a.roundness,forceDirection:a.forceDirection===void 0?!1:a.forceDirection}},e.edges.smooth={enabled:a.enabled===void 0?!0:a.enabled,type:n,roundness:a.roundness===void 0?.5:a.roundness,forceDirection:a.forceDirection===void 0?!1:a.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",n)}return e}},{key:"positionInitially",value:function(e){if(this.options.hierarchical.enabled!==!0){this._resetRNG(this.initialRandomSeed);for(var t=e.length+50,n=0;nu){for(var h=e.length;e.length>u&&s<=o;){s+=1;var d=e.length;s%3===0?this.body.modules.clustering.clusterBridges(l):this.body.modules.clustering.clusterOutliers(l);var c=e.length;if(d==c&&s%3!==0){this._declusterAll(),this.body.emitter.emit("_layoutFailed"),console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.");return}}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*h)})}s>o&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(e,this.body.edgeIndices,!0),this._shiftToCenter();for(var f=70,v=0;v0){var e,t,n=!1,a=!1;this.lastNodeOnLevel={},this.hierarchical=new wpe;for(t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&(e=this.body.nodes[t],e.options.level!==void 0?(n=!0,this.hierarchical.levels[t]=e.options.level):a=!0);if(a===!0&&n===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");if(a===!0){var o=this.options.hierarchical.sortMethod;o==="hubsize"?this._determineLevelsByHubsize():o==="directed"?this._determineLevelsDirected():o==="custom"&&this._determineLevelsCustomCallback()}for(var s in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,s)&&this.hierarchical.ensureLevel(s);var u=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(u),this._condenseHierarchy(),this._shiftToCenter()}}},{key:"_condenseHierarchy",value:function(){var e=this,t=!1,n={},a=function(){for(var b=s(),$=0,S=0;S0)for(var _=0;_1&&arguments[1]!==void 0?arguments[1]:1e9,S=1e9,_=1e9,C=1e9,M=-1e9;for(var x in b)if(Object.prototype.hasOwnProperty.call(b,x)){var B=e.body.nodes[x],F=e.hierarchical.levels[B.id],X=e.direction.getPosition(B),K=e._getSpaceAroundNode(B,b),oe=Se(K,2),Qe=oe[0],Ne=oe[1];S=Math.min(Qe,S),_=Math.min(Ne,_),F<=$&&(C=Math.min(X,C),M=Math.max(X,M))}return[C,M,S,_]},h=function(b,$){var S=e.hierarchical.getMaxLevel(b.id),_=e.hierarchical.getMaxLevel($.id);return Math.min(S,_)},d=function(b,$,S){for(var _=e.hierarchical,C=0;C<$.length;C++){var M=$[C],x=_.distributionOrdering[M];if(x.length>1)for(var B=0;B2&&arguments[2]!==void 0?arguments[2]:!1,_=e.direction.getPosition(b),C=e.direction.getPosition($),M=Math.abs(C-_),x=e.options.hierarchical.nodeSpacing;if(M>x){var B={},F={};u(b,B),u($,F);var X=h(b,$),K=l(B,X),oe=l(F,X),Qe=K[1],Ne=oe[0],At=oe[2],lt=Math.abs(Qe-Ne);if(lt>x){var nt=Qe-Ne+x;nt<-At+x&&(nt=-At+x),nt<0&&(e._shiftBlock($.id,nt),t=!0,S===!0&&e._centerParent($))}}},f=function(b,$){for(var S=$.id,_=$.edges,C=e.hierarchical.levels[$.id],M=e.options.hierarchical.levelSeparation*e.options.hierarchical.levelSeparation,x={},B=[],F=0;F<_.length;F++){var X=_[F];if(X.toId!=X.fromId){var K=X.toId==S?X.from:X.to;x[_[F].id]=K,e.hierarchical.levels[K.id]0?st=Math.min(Rt,Er-e.options.hierarchical.nodeSpacing):Rt<0&&(st=-Math.min(-Rt,ot-e.options.hierarchical.nodeSpacing)),st!=0&&(e._shiftBlock($.id,st),t=!0)},lt=function(at){var ye=e.direction.getPosition($),Me=e._getSpaceAroundNode($),xe=Se(Me,2),ot=xe[0],Er=xe[1],Rt=at-ye,st=ye;Rt>0?st=Math.min(ye+(Er-e.options.hierarchical.nodeSpacing),at):Rt<0&&(st=Math.max(ye-(ot-e.options.hierarchical.nodeSpacing),at)),st!==ye&&(e.direction.setPosition($,st),t=!0)},nt=Ne(b,B);At(nt),nt=Ne(b,_),lt(nt)},v=function(b){var $=e.hierarchical.getLevels();$=ji($).call($);for(var S=0;S0&&Math.abs(v)0&&(h=this.direction.getPosition(a[s-1])+l),this.direction.setPosition(u,h,t),this._validatePositionAndContinue(u,t,h),o++}}}}},{key:"_placeBranchNodes",value:function(e,t){var n,a=this.hierarchical.childrenReference[e];if(a!==void 0){for(var o=[],s=0;st&&this.positionedNodes[l.id]===void 0){var d=this.options.hierarchical.nodeSpacing,c=void 0;u===0?c=this.direction.getPosition(this.body.nodes[e]):c=this.direction.getPosition(o[u-1])+d,this.direction.setPosition(l,c,h),this._validatePositionAndContinue(l,h,c)}else return}var f=this._getCenterPosition(o);this.direction.setPosition(this.body.nodes[e],f,t)}}},{key:"_validatePositionAndContinue",value:function(e,t,n){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[t]!==void 0){var a=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(n-ae.hierarchical.levels[a.id]&&e.hierarchical.addRelation(a.id,o.id)};this._crawlNetwork(t),this.hierarchical.checkIfTree()}},{key:"_crawlNetwork",value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},n=arguments.length>1?arguments[1]:void 0,a={},o=function c(f,v){if(a[f.id]===void 0){e.hierarchical.setTreeIndex(f,v),a[f.id]=!0;for(var p,g=e._getActiveEdges(f),y=0;y=i.length?{done:!0}:{done:!1,value:i[t++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(i)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Spe(i,r){var e;if(i){if(typeof i=="string")return H$(i,r);var t=rt(e=Object.prototype.toString.call(i)).call(e,8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return hn(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return H$(i,r)}}function H$(i,r){(r==null||r>i.length)&&(r=i.length);for(var e=0,t=new Array(r);e0&&this.options.deleteNode!==!1?(u===!0&&this._createSeperator(4),this._createDeleteButton(s)):n===0&&this.options.deleteEdge!==!1&&(u===!0&&this._createSeperator(4),this._createDeleteButton(s))),this._bindElementEvents(this.closeDiv,k(e=this.toggleEditMode).call(e,this)),this._temporaryBindEvent("select",k(t=this.showManipulatorToolbar).call(t,this))}this.body.emitter.emit("_redraw")}},{key:"addNodeMode",value:function(){var e;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var t,n=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(n),this._createSeperator(),this._createDescription(n.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,k(t=this.toggleEditMode).call(t,this))}this._temporaryBindEvent("click",k(e=this._performAddNode).call(e,this))}},{key:"editNode",value:function(){var e=this;this.editMode!==!0&&this.enableEditMode(),this._clean();var t=this.selectionHandler.getSelectedNodes()[0];if(t!==void 0)if(this.inMode="editNode",typeof this.options.editNode=="function")if(t.isCluster!==!0){var n=pe({},t.options,!1);if(n.x=t.x,n.y=t.y,this.options.editNode.length===2)this.options.editNode(n,function(a){a!=null&&e.inMode==="editNode"&&e.body.data.nodes.getDataSet().update(a),e.showManipulatorToolbar()});else throw new Error("The function for edit does not support two arguments (data, callback)")}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError);else throw new Error("No function has been configured to handle the editing of nodes.");else this.showManipulatorToolbar()}},{key:"addEdgeMode",value:function(){var e,t,n,a,o;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var s,u=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(u),this._createSeperator(),this._createDescription(u.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,k(s=this.toggleEditMode).call(s,this))}this._temporaryBindUI("onTouch",k(e=this._handleConnect).call(e,this)),this._temporaryBindUI("onDragEnd",k(t=this._finishConnect).call(t,this)),this._temporaryBindUI("onDrag",k(n=this._dragControlNode).call(n,this)),this._temporaryBindUI("onRelease",k(a=this._finishConnect).call(a,this)),this._temporaryBindUI("onDragStart",k(o=this._dragStartEdge).call(o,this)),this._temporaryBindUI("onHold",function(){})}},{key:"editEdgeMode",value:function(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",de(this.options.editEdge)==="object"&&typeof this.options.editEdge.editWithoutDrag=="function"&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0)){var e=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(e.from.id,e.to.id);return}if(this.guiEnabled===!0){var t,n=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(n),this._createSeperator(),this._createDescription(n.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,k(t=this.toggleEditMode).call(t,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var a,o,s,u,l=this.body.edges[this.edgeBeingEditedId],h=this._getNewTargetNode(l.from.x,l.from.y),d=this._getNewTargetNode(l.to.x,l.to.y);this.temporaryIds.nodes.push(h.id),this.temporaryIds.nodes.push(d.id),this.body.nodes[h.id]=h,this.body.nodeIndices.push(h.id),this.body.nodes[d.id]=d,this.body.nodeIndices.push(d.id),this._temporaryBindUI("onTouch",k(a=this._controlNodeTouch).call(a,this)),this._temporaryBindUI("onTap",function(){}),this._temporaryBindUI("onHold",function(){}),this._temporaryBindUI("onDragStart",k(o=this._controlNodeDragStart).call(o,this)),this._temporaryBindUI("onDrag",k(s=this._controlNodeDrag).call(s,this)),this._temporaryBindUI("onDragEnd",k(u=this._controlNodeDragEnd).call(u,this)),this._temporaryBindUI("onMouseMove",function(){}),this._temporaryBindEvent("beforeDrawing",function(c){var f=l.edgeType.findBorderPositions(c);h.selected===!1&&(h.x=f.from.x,h.y=f.from.y),d.selected===!1&&(d.x=f.to.x,d.y=f.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}},{key:"deleteSelected",value:function(){var e=this;this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";var t=this.selectionHandler.getSelectedNodeIds(),n=this.selectionHandler.getSelectedEdgeIds(),a=void 0;if(t.length>0){for(var o=0;o0&&typeof this.options.deleteEdge=="function"&&(a=this.options.deleteEdge);if(typeof a=="function"){var s={nodes:t,edges:n};if(a.length===2)a(s,function(u){u!=null&&e.inMode==="delete"?(e.body.data.edges.getDataSet().remove(u.edges),e.body.data.nodes.getDataSet().remove(u.nodes),e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar()):(e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar())});else throw new Error("The function for delete does not support two arguments (data, callback)")}else this.body.data.edges.getDataSet().remove(n),this.body.data.nodes.getDataSet().remove(t),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}},{key:"_setup",value:function(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:"_createWrappers",value:function(){if(this.manipulationDiv===void 0&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),this.editModeDiv===void 0&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),this.closeDiv===void 0){var e,t;this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",(e=(t=this.options.locales[this.options.locale])===null||t===void 0?void 0:t.close)!==null&&e!==void 0?e:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv)}}},{key:"_getNewTargetNode",value:function(e,t){var n=pe({},this.options.controlNodeStyle);n.id="targetNode"+io(),n.hidden=!1,n.physics=!1,n.x=e,n.y=t;var a=this.body.functions.createNode(n);return a.shape.boundingBox={left:e,right:e,top:t,bottom:t},a}},{key:"_createEditButton",value:function(){var e;this._clean(),this.manipulationDOM={},Yr(this.editModeDiv);var t=this.options.locales[this.options.locale],n=this._createButton("editMode","vis-edit vis-edit-mode",t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(n),this._bindElementEvents(n,k(e=this.toggleEditMode).call(e,this))}},{key:"_clean",value:function(){this.inMode=!1,this.guiEnabled===!0&&(Yr(this.editModeDiv),Yr(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}},{key:"_cleanupDOMEventListeners",value:function(){var e,t=Epe(Ar(e=this._domEventListenerCleanupQueue).call(e,0)),n;try{for(t.s();!(n=t.n()).done;){var a=n.value;a()}}catch(o){t.e(o)}finally{t.f()}}},{key:"_removeManipulationDOM",value:function(){this._clean(),Yr(this.manipulationDiv),Yr(this.editModeDiv),Yr(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}},{key:"_createSeperator",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+e]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+e].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+e])}},{key:"_createAddNodeButton",value:function(e){var t,n=this._createButton("addNode","vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,k(t=this.addNodeMode).call(t,this))}},{key:"_createAddEdgeButton",value:function(e){var t,n=this._createButton("addEdge","vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,k(t=this.addEdgeMode).call(t,this))}},{key:"_createEditNodeButton",value:function(e){var t,n=this._createButton("editNode","vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,k(t=this.editNode).call(t,this))}},{key:"_createEditEdgeButton",value:function(e){var t,n=this._createButton("editEdge","vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,k(t=this.editEdgeMode).call(t,this))}},{key:"_createDeleteButton",value:function(e){var t,n;this.options.rtl?n="vis-delete-rtl":n="vis-delete";var a=this._createButton("delete",n,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(a),this._bindElementEvents(a,k(t=this.deleteSelected).call(t,this))}},{key:"_createBackButton",value:function(e){var t,n=this._createButton("back","vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,k(t=this.showManipulatorToolbar).call(t,this))}},{key:"_createButton",value:function(e,t,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"vis-label";return this.manipulationDOM[e+"Div"]=document.createElement("button"),this.manipulationDOM[e+"Div"].className="vis-button "+t,this.manipulationDOM[e+"Label"]=document.createElement("div"),this.manipulationDOM[e+"Label"].className=a,this.manipulationDOM[e+"Label"].innerText=n,this.manipulationDOM[e+"Div"].appendChild(this.manipulationDOM[e+"Label"]),this.manipulationDOM[e+"Div"]}},{key:"_createDescription",value:function(e){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=e,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}},{key:"_temporaryBindEvent",value:function(e,t){this.temporaryEventFunctions.push({event:e,boundFunction:t}),this.body.emitter.on(e,t)}},{key:"_temporaryBindUI",value:function(e,t){if(this.body.eventListeners[e]!==void 0)this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=t;else throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+us(Ee(this.body.eventListeners)))}},{key:"_unbindTemporaryUIs",value:function(){for(var e in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}},{key:"_unbindTemporaryEvents",value:function(){for(var e=0;e=0;u--)if(o[u]!==this.selectedControlNode.id){s=this.body.nodes[o[u]];break}if(s!==void 0&&this.selectedControlNode!==void 0)if(s.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var l=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===l.id?this._performEditEdge(s.id,a.to.id):this._performEditEdge(a.from.id,s.id)}else a.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}}},{key:"_handleConnect",value:function(e){if(new Date().valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=Fe({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;var t=this.lastTouch,n=this.selectionHandler.getNodeAt(t);if(n!==void 0)if(n.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var a=this._getNewTargetNode(n.x,n.y);this.body.nodes[a.id]=a,this.body.nodeIndices.push(a.id);var o=this.body.functions.createEdge({id:"connectionEdge"+io(),from:n.id,to:a.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[o.id]=o,this.body.edgeIndices.push(o.id),this.temporaryIds.nodes.push(a.id),this.temporaryIds.edges.push(o.id)}this.touchTime=new Date().valueOf()}}},{key:"_dragControlNode",value:function(e){var t=this.body.functions.getPointer(e.center),n=this.selectionHandler._pointerToPositionObject(t),a=void 0;this.temporaryIds.edges[0]!==void 0&&(a=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var o=this.selectionHandler._getAllNodesOverlappingWith(n),s=void 0,u=o.length-1;u>=0;u--){var l;if(ie(l=this.temporaryIds.nodes).call(l,o[u])===-1){s=this.body.nodes[o[u]];break}}if(e.controlEdge={from:a,to:s?s.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",e,t),this.temporaryIds.nodes[0]!==void 0){var h=this.body.nodes[this.temporaryIds.nodes[0]];h.x=this.canvas._XconvertDOMtoCanvas(t.x),h.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(e)}},{key:"_finishConnect",value:function(e){var t=this.body.functions.getPointer(e.center),n=this.selectionHandler._pointerToPositionObject(t),a=void 0;this.temporaryIds.edges[0]!==void 0&&(a=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var o=this.selectionHandler._getAllNodesOverlappingWith(n),s=void 0,u=o.length-1;u>=0;u--){var l;if(ie(l=this.temporaryIds.nodes).call(l,o[u])===-1){s=this.body.nodes[o[u]];break}}this._cleanupTemporaryNodesAndEdges(),s!==void 0&&(s.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[a]!==void 0&&this.body.nodes[s.id]!==void 0&&this._performAddEdge(a,s.id)),e.controlEdge={from:a,to:s?s.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",e,t),this.body.emitter.emit("_redraw")}},{key:"_dragStartEdge",value:function(e){var t=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",e,t,void 0,!0)}},{key:"_performAddNode",value:function(e){var t=this,n={id:io(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if(typeof this.options.addNode=="function")if(this.options.addNode.length===2)this.options.addNode(n,function(a){a!=null&&t.inMode==="addNode"&&t.body.data.nodes.getDataSet().add(a),t.showManipulatorToolbar()});else throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");else this.body.data.nodes.getDataSet().add(n),this.showManipulatorToolbar()}},{key:"_performAddEdge",value:function(e,t){var n=this,a={from:e,to:t};if(typeof this.options.addEdge=="function")if(this.options.addEdge.length===2)this.options.addEdge(a,function(o){o!=null&&n.inMode==="addEdge"&&(n.body.data.edges.getDataSet().add(o),n.selectionHandler.unselectAll(),n.showManipulatorToolbar())});else throw new Error("The function for connect does not support two arguments (data,callback)");else this.body.data.edges.getDataSet().add(a),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:"_performEditEdge",value:function(e,t){var n=this,a={id:this.edgeBeingEditedId,from:e,to:t,label:this.body.data.edges.get(this.edgeBeingEditedId).label},o=this.options.editEdge;if(de(o)==="object"&&(o=o.editWithoutDrag),typeof o=="function")if(o.length===2)o(a,function(s){s==null||n.inMode!=="editEdge"?(n.body.edges[a.id].updateEdgeType(),n.body.emitter.emit("_redraw"),n.showManipulatorToolbar()):(n.body.data.edges.getDataSet().update(s),n.selectionHandler.unselectAll(),n.showManipulatorToolbar())});else throw new Error("The function for edit does not support two arguments (data, callback)");else this.body.data.edges.getDataSet().update(a),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),i}(),D="string",I="boolean",w="number",qa="array",H="object",JT="dom",Tpe="any",md=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],bd={borderWidth:{number:w},borderWidthSelected:{number:w,undefined:"undefined"},brokenImage:{string:D,undefined:"undefined"},chosen:{label:{boolean:I,function:"function"},node:{boolean:I,function:"function"},__type__:{object:H,boolean:I}},color:{border:{string:D},background:{string:D},highlight:{border:{string:D},background:{string:D},__type__:{object:H,string:D}},hover:{border:{string:D},background:{string:D},__type__:{object:H,string:D}},__type__:{object:H,string:D}},opacity:{number:w,undefined:"undefined"},fixed:{x:{boolean:I},y:{boolean:I},__type__:{object:H,boolean:I}},font:{align:{string:D},color:{string:D},size:{number:w},face:{string:D},background:{string:D},strokeWidth:{number:w},strokeColor:{string:D},vadjust:{number:w},multi:{boolean:I,string:D},bold:{color:{string:D},size:{number:w},face:{string:D},mod:{string:D},vadjust:{number:w},__type__:{object:H,string:D}},boldital:{color:{string:D},size:{number:w},face:{string:D},mod:{string:D},vadjust:{number:w},__type__:{object:H,string:D}},ital:{color:{string:D},size:{number:w},face:{string:D},mod:{string:D},vadjust:{number:w},__type__:{object:H,string:D}},mono:{color:{string:D},size:{number:w},face:{string:D},mod:{string:D},vadjust:{number:w},__type__:{object:H,string:D}},__type__:{object:H,string:D}},group:{string:D,number:w,undefined:"undefined"},heightConstraint:{minimum:{number:w},valign:{string:D},__type__:{object:H,boolean:I,number:w}},hidden:{boolean:I},icon:{face:{string:D},code:{string:D},size:{number:w},color:{string:D},weight:{string:D,number:w},__type__:{object:H}},id:{string:D,number:w},image:{selected:{string:D,undefined:"undefined"},unselected:{string:D,undefined:"undefined"},__type__:{object:H,string:D}},imagePadding:{top:{number:w},right:{number:w},bottom:{number:w},left:{number:w},__type__:{object:H,number:w}},label:{string:D,undefined:"undefined"},labelHighlightBold:{boolean:I},level:{number:w,undefined:"undefined"},margin:{top:{number:w},right:{number:w},bottom:{number:w},left:{number:w},__type__:{object:H,number:w}},mass:{number:w},physics:{boolean:I},scaling:{min:{number:w},max:{number:w},label:{enabled:{boolean:I},min:{number:w},max:{number:w},maxVisible:{number:w},drawThreshold:{number:w},__type__:{object:H,boolean:I}},customScalingFunction:{function:"function"},__type__:{object:H}},shadow:{enabled:{boolean:I},color:{string:D},size:{number:w},x:{number:w},y:{number:w},__type__:{object:H,boolean:I}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:I,array:qa},borderRadius:{number:w},interpolation:{boolean:I},useImageSize:{boolean:I},useBorderWithImage:{boolean:I},coordinateOrigin:{string:["center","top-left"]},__type__:{object:H}},size:{number:w},title:{string:D,dom:JT,undefined:"undefined"},value:{number:w,undefined:"undefined"},widthConstraint:{minimum:{number:w},maximum:{number:w},__type__:{object:H,boolean:I,number:w}},x:{number:w},y:{number:w},__type__:{object:H}},Ipe={configure:{enabled:{boolean:I},filter:{boolean:I,string:D,array:qa,function:"function"},container:{dom:JT},showButton:{boolean:I},__type__:{object:H,boolean:I,string:D,array:qa,function:"function"}},edges:{arrows:{to:{enabled:{boolean:I},scaleFactor:{number:w},type:{string:md},imageHeight:{number:w},imageWidth:{number:w},src:{string:D},__type__:{object:H,boolean:I}},middle:{enabled:{boolean:I},scaleFactor:{number:w},type:{string:md},imageWidth:{number:w},imageHeight:{number:w},src:{string:D},__type__:{object:H,boolean:I}},from:{enabled:{boolean:I},scaleFactor:{number:w},type:{string:md},imageWidth:{number:w},imageHeight:{number:w},src:{string:D},__type__:{object:H,boolean:I}},__type__:{string:["from","to","middle"],object:H}},endPointOffset:{from:{number:w},to:{number:w},__type__:{object:H,number:w}},arrowStrikethrough:{boolean:I},background:{enabled:{boolean:I},color:{string:D},size:{number:w},dashes:{boolean:I,array:qa},__type__:{object:H,boolean:I}},chosen:{label:{boolean:I,function:"function"},edge:{boolean:I,function:"function"},__type__:{object:H,boolean:I}},color:{color:{string:D},highlight:{string:D},hover:{string:D},inherit:{string:["from","to","both"],boolean:I},opacity:{number:w},__type__:{object:H,string:D}},dashes:{boolean:I,array:qa},font:{color:{string:D},size:{number:w},face:{string:D},background:{string:D},strokeWidth:{number:w},strokeColor:{string:D},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:w},multi:{boolean:I,string:D},bold:{color:{string:D},size:{number:w},face:{string:D},mod:{string:D},vadjust:{number:w},__type__:{object:H,string:D}},boldital:{color:{string:D},size:{number:w},face:{string:D},mod:{string:D},vadjust:{number:w},__type__:{object:H,string:D}},ital:{color:{string:D},size:{number:w},face:{string:D},mod:{string:D},vadjust:{number:w},__type__:{object:H,string:D}},mono:{color:{string:D},size:{number:w},face:{string:D},mod:{string:D},vadjust:{number:w},__type__:{object:H,string:D}},__type__:{object:H,string:D}},hidden:{boolean:I},hoverWidth:{function:"function",number:w},label:{string:D,undefined:"undefined"},labelHighlightBold:{boolean:I},length:{number:w,undefined:"undefined"},physics:{boolean:I},scaling:{min:{number:w},max:{number:w},label:{enabled:{boolean:I},min:{number:w},max:{number:w},maxVisible:{number:w},drawThreshold:{number:w},__type__:{object:H,boolean:I}},customScalingFunction:{function:"function"},__type__:{object:H}},selectionWidth:{function:"function",number:w},selfReferenceSize:{number:w},selfReference:{size:{number:w},angle:{number:w},renderBehindTheNode:{boolean:I},__type__:{object:H}},shadow:{enabled:{boolean:I},color:{string:D},size:{number:w},x:{number:w},y:{number:w},__type__:{object:H,boolean:I}},smooth:{enabled:{boolean:I},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:w},forceDirection:{string:["horizontal","vertical","none"],boolean:I},__type__:{object:H,boolean:I}},title:{string:D,undefined:"undefined"},width:{number:w},widthConstraint:{maximum:{number:w},__type__:{object:H,boolean:I,number:w}},value:{number:w,undefined:"undefined"},__type__:{object:H}},groups:{useDefaultGroups:{boolean:I},__any__:bd,__type__:{object:H}},interaction:{dragNodes:{boolean:I},dragView:{boolean:I},hideEdgesOnDrag:{boolean:I},hideEdgesOnZoom:{boolean:I},hideNodesOnDrag:{boolean:I},hover:{boolean:I},keyboard:{enabled:{boolean:I},speed:{x:{number:w},y:{number:w},zoom:{number:w},__type__:{object:H}},bindToWindow:{boolean:I},autoFocus:{boolean:I},__type__:{object:H,boolean:I}},multiselect:{boolean:I},navigationButtons:{boolean:I},selectable:{boolean:I},selectConnectedEdges:{boolean:I},hoverConnectedEdges:{boolean:I},tooltipDelay:{number:w},zoomView:{boolean:I},zoomSpeed:{number:w},__type__:{object:H}},layout:{randomSeed:{undefined:"undefined",number:w,string:D},improvedLayout:{boolean:I},clusterThreshold:{number:w},hierarchical:{enabled:{boolean:I},levelSeparation:{number:w},nodeSpacing:{number:w},treeSpacing:{number:w},blockShifting:{boolean:I},edgeMinimization:{boolean:I},parentCentralization:{boolean:I},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:H,boolean:I}},__type__:{object:H}},manipulation:{enabled:{boolean:I},initiallyActive:{boolean:I},addNode:{boolean:I,function:"function"},addEdge:{boolean:I,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:H,boolean:I,function:"function"}},deleteNode:{boolean:I,function:"function"},deleteEdge:{boolean:I,function:"function"},controlNodeStyle:bd,__type__:{object:H,boolean:I}},nodes:bd,physics:{enabled:{boolean:I},barnesHut:{theta:{number:w},gravitationalConstant:{number:w},centralGravity:{number:w},springLength:{number:w},springConstant:{number:w},damping:{number:w},avoidOverlap:{number:w},__type__:{object:H}},forceAtlas2Based:{theta:{number:w},gravitationalConstant:{number:w},centralGravity:{number:w},springLength:{number:w},springConstant:{number:w},damping:{number:w},avoidOverlap:{number:w},__type__:{object:H}},repulsion:{centralGravity:{number:w},springLength:{number:w},springConstant:{number:w},nodeDistance:{number:w},damping:{number:w},__type__:{object:H}},hierarchicalRepulsion:{centralGravity:{number:w},springLength:{number:w},springConstant:{number:w},nodeDistance:{number:w},damping:{number:w},avoidOverlap:{number:w},__type__:{object:H}},maxVelocity:{number:w},minVelocity:{number:w},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:I},iterations:{number:w},updateInterval:{number:w},onlyDynamicEdges:{boolean:I},fit:{boolean:I},__type__:{object:H,boolean:I}},timestep:{number:w},adaptiveTimestep:{boolean:I},wind:{x:{number:w},y:{number:w},__type__:{object:H}},__type__:{object:H,boolean:I}},autoResize:{boolean:I},clickToUse:{boolean:I},locale:{string:D},locales:{__any__:{any:Tpe},__type__:{object:H}},height:{string:D},width:{string:D},__type__:{object:H}},ZT={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},opacity:[0,0,1,.1],fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown","hexagon"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"}},endPointOffset:{from:[0,-10,10,1],to:[0,-10,10,1]},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],selfReference:{size:[20,0,200,1],angle:[Math.PI/2,-6*Math.PI,6*Math.PI,Math.PI/8],renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"],shakeTowards:["leaves","roots"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0,autoFocus:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0,zoomSpeed:[1,.1,2,.1]},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{theta:[.5,.1,1,.05],gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{theta:[.5,.1,1,.05],gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01],wind:{x:[0,-10,10,.1],y:[0,-10,10,.1]}}},kpe=function(r,e,t){var n;return!!(oi(r).call(r,"physics")&&oi(n=ZT.physics.solver).call(n,e)&&t.physics.solver!==e&&e!=="wind")},Ppe=function(){function i(){R(this,i)}return N(i,[{key:"getDistances",value:function(e,t,n){for(var a={},o=e.edges,s=0;s2&&arguments[2]!==void 0?arguments[2]:!1,a=this.distanceSolver.getDistances(this.body,e,t);this._createL_matrix(a),this._createK_matrix(a),this._createE_matrix();for(var o=.01,s=1,u=0,l=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),h=5,d=1e9,c=0,f=0,v=0,p=0,g=0;d>o&&us&&gy.type==="downstream_subgraph_search")?.data||[],f=y=>{const m=y.json.nodes.map($=>({id:$.id,label:$.type,color:{background:"#2B7CE9",border:"#1B5BB1"},font:{size:16,color:"#FFFFFF",face:"arial",bold:!0},margin:12,padding:10,shape:"box",widthConstraint:{minimum:100,maximum:200}})),b=y.json.links.map($=>({from:$.origin_id,to:$.target_id,arrows:{to:{enabled:!0,scaleFactor:1.2}},color:"#FFFFFF",width:2}));return{nodes:m,edges:b}};Ve.useEffect(()=>()=>{d.current&&(d.current.destroy(),d.current=null)},[]);const v=Ve.useCallback((y,m)=>{d.current&&d.current.destroy();const b=f(m),$=new z(y,b,{nodes:{shape:"box",margin:12,padding:10,font:{size:16,color:"#FFFFFF",face:"arial",bold:!0},borderWidth:2,shadow:{enabled:!0,color:"rgba(0,0,0,0.2)",size:5}},edges:{arrows:"to",color:"#FFFFFF",width:2,smooth:{enabled:!0,type:"straightCross"}},physics:{enabled:!0,solver:"hierarchicalRepulsion",hierarchicalRepulsion:{nodeDistance:200,springLength:200}},layout:{hierarchical:{enabled:!0,direction:"UD",sortMethod:"directed",nodeSpacing:200,levelSeparation:150}},interaction:{dragNodes:!1,zoomView:!1,dragView:!1}});d.current=$},[]),p=async y=>{console.log("[DownstreamSubgraphs] Starting checkAndLoadSubgraph with node:",y),Vi.trackEvent({event_type:"subgraph_accept",message_type:"subgraph",message_id:u.message_id,data:{subgraph_name:y.name,subgraph_tags:y.tags}});const m=y.json.nodes,b=Object.values(Mt.canvas.selected_nodes)[0];if(!b){console.warn("[DownstreamSubgraphs] No node selected"),alert("Please select a upstream node first before adding a subgraph.");return}const $=m.map(C=>C.type),S=s;console.log("[DownstreamSubgraphs] Required node types:",$),console.log("[DownstreamSubgraphs] Installed node types:",S);const _=$.filter(C=>!S.includes(C));if(console.log("[DownstreamSubgraphs] Missing node types:",_),_.length>0)try{console.log("[DownstreamSubgraphs] Fetching info for missing nodes");const C=await Vi.batchGetNodeInfo(_);console.log("[DownstreamSubgraphs] Received node infos:",C);const M={text:"",ext:[{type:"node_install_guide",data:C.map(B=>({name:B.name,repository_url:B.github_url}))}]};console.log("[DownstreamSubgraphs] Created message content:",M);const x={id:Sr(),role:"ai",content:JSON.stringify(M),format:"markdown",name:"Assistant",metadata:{pendingSubgraph:y}};console.log("[DownstreamSubgraphs] Created AI message:",x),t?.(x);return}catch(C){console.error("[DownstreamSubgraphs] Error fetching node info:",C),alert("Error checking required nodes. Please try again.");return}console.log("[DownstreamSubgraphs] All required nodes are installed, proceeding to load subgraph"),g(y,b)},g=(y,m)=>{const b=y.json.nodes,$=y.json.links,S=b.find(M=>M.id===0),_=S?.id;console.log("[DownstreamSubgraphs] Entry node ID:",_);const C={};_!==null&&(C[_]=m),Mt.canvas.emitBeforeChange();try{for(const M of b)if(M.id!==_){const x=S?.pos,B=[m._pos[0],m._pos[1]],F=[M.pos[0]+B[0]-x[0],M.pos[1]+B[1]-x[1]];C[M.id]=Y$(M.type,{pos:F})}for(const M of $){const x=C[M.origin_id],B=C[M.target_id];x&&B&&x.connect(M.origin_slot,B,M.target_slot)}}finally{Mt.canvas.emitAfterChange()}};return Ve.useEffect(()=>{const y=()=>{const m=Mt.canvas.selected_nodes;if(Object.keys(m??{}).length){const b=Object.values(m)[0];a({type:"SET_SELECTED_NODE",payload:b})}else a({type:"SET_SELECTED_NODE",payload:null})};return document.addEventListener("click",y),()=>{document.removeEventListener("click",y)}},[]),O.jsx("div",{className:"rounded-lg bg-green-50 p-3 text-gray-700 text-xs break-words overflow-visible",children:c.length>0&&O.jsx("div",{className:"space-y-3",children:O.jsx("div",{className:"flex flex-wrap gap-2",children:c.map(y=>O.jsxs("div",{className:"relative group",children:[O.jsx("button",{className:`px-3 py-1.5 bg-blue-500 text-white rounded-md hover:bg-blue-600 transition-colors text-xs`,onClick:()=>p(y),onMouseEnter:()=>h(y.name),onMouseLeave:()=>h(null),children:y.name}),O.jsxs("p",{className:"text-xs ml-3 text-gray-500",children:["[",y.tags.join(", "),"]"]}),l===y.name&&O.jsx("div",{className:`fixed -translate-y-full z-[9999] w-[500px] p-4 bg-gray-800 text-white text-xs rounded-md shadow-lg mb-2 border border-gray-700`,style:{left:"calc(var(--mouse-x, 0) + 16px)",top:"calc(var(--mouse-y, 0) - 8px)"},children:O.jsx("div",{style:{width:"100%",height:"300px"},ref:m=>{m&&v(m,y)}})})]},y.name))})})})}const Hpe=Object.freeze(Object.defineProperty({__proto__:null,DownstreamSubgraphs:Cpe},Symbol.toStringTag,{value:"Module"}));function Ape({content:i,onLoadSubgraph:r}){const t=JSON.parse(i).ext?.find(n=>n.type==="node_install_guide")?.data||[];return O.jsxs("div",{children:[O.jsx("p",{children:"在加载graph到画布前,以下节点有待安装,请跳转到对应的github安装节点:"}),O.jsx("div",{className:"grid grid-cols-2 gap-3",children:t.map((n,a)=>O.jsx("div",{className:`w-full p-3 bg-white rounded-lg border border-gray-200 @@ -150,4 +150,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho border border-gray-900 hover:bg-gray-100 transition-colors text-[10px] flex items-center gap-1`,children:[O.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:O.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Download"]}):O.jsxs("a",{href:`https://www.google.com/search?q=${encodeURIComponent(n.name+" comfyui custom node")}`,target:"_blank",rel:"noopener noreferrer",className:`px-2 py-1 bg-gray-100 text-gray-500 rounded-md border border-gray-300 text-[10px] flex items-center gap-1`,children:[O.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:O.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 21h7a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v11m0 5l4.879-4.879m0 0a3 3 0 104.243-4.242 3 3 0 00-4.243 4.242z"})}),"Search on Google"]})})]})},a))}),O.jsx("p",{className:"mt-4"}),O.jsx("p",{children:"安装完成后,请点击继续加载graph按钮,将graph加载到画布中:"}),O.jsx("div",{className:"mt-4",children:O.jsx("button",{className:`px-3 py-2 bg-blue-500 text-white rounded-md - hover:bg-blue-600 transition-colors text-xs block mx-auto`,onClick:r,children:"继续加载graph"})})]})}const Wpe=Object.freeze(Object.defineProperty({__proto__:null,NodeInstallGuide:Ape},Symbol.toStringTag,{value:"Module"}));export{Lpe as A,q$ as B,Mpe as C,Hpe as D,MI as M,zpe as N,jpe as U,Li as W,Mt as a,Y$ as b,aI as c,Wpe as d,Bpe as f,Ur as g,sI as u,Fpe as v,Npe as w}; + hover:bg-blue-600 transition-colors text-xs block mx-auto`,onClick:r,children:"继续加载graph"})})]})}const Vpe=Object.freeze(Object.defineProperty({__proto__:null,NodeInstallGuide:Ape},Symbol.toStringTag,{value:"Module"}));export{Lpe as A,q$ as B,Mpe as C,Hpe as D,MI as M,zpe as N,jpe as U,Vi as W,Mt as a,Y$ as b,aI as c,Vpe as d,Bpe as f,Sr as g,sI as u,Fpe as v,Npe as w}; diff --git a/dist/copilot_web/workflowChat-C0sNrgv8.js b/dist/copilot_web/workflowChat-C0sNrgv8.js new file mode 100644 index 0000000..aa66211 --- /dev/null +++ b/dist/copilot_web/workflowChat-C0sNrgv8.js @@ -0,0 +1,131 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["copilot_web/WorkflowOption-DWEyFLfP.js","copilot_web/vendor-markdown-Dek94WS0.js","copilot_web/vendor-react-V04_Axys.js","copilot_web/message-components-D3rPBq8S.js","copilot_web/ParameterDebugInterfaceNew-D6FB8RLq.js","copilot_web/input.js","copilot_web/assets/input-CbVoR7-h.css","copilot_web/App-CzPQ6Sqn.js"])))=>i.map(i=>d[i]); +import{_ as Dt}from"./input.js";import{j as h,r as yg,b as wg}from"./vendor-markdown-Dek94WS0.js";import{r as I,R as wn,c as Mt}from"./vendor-react-V04_Axys.js";import{f as bg,v as Sg,a as sn,B as Ag,U as Eg,A as Ir,b as Ig,g as Ve,c as Pt,u as is,M as Cg,W as Ot}from"./message-components-D3rPBq8S.js";import{l as Ng}from"./App-CzPQ6Sqn.js";/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Lg=m=>m.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Uo=(...m)=>m.filter((w,o,D)=>!!w&&w.trim()!==""&&D.indexOf(w)===o).join(" ").trim();/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var Rg={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Tg=I.forwardRef(({color:m="currentColor",size:w=24,strokeWidth:o=2,absoluteStrokeWidth:D,className:B="",children:E,iconNode:M,...q},x)=>I.createElement("svg",{ref:x,...Rg,width:w,height:w,stroke:m,strokeWidth:D?Number(o)*24/Number(w):o,className:Uo("lucide",B),...q},[...M.map(([$,k])=>I.createElement($,k)),...Array.isArray(E)?E:[E]]));/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ht=(m,w)=>{const o=I.forwardRef(({className:D,...B},E)=>I.createElement(Tg,{ref:E,iconNode:w,className:Uo(`lucide-${Lg(m)}`,D),...B}));return o.displayName=`${m}`,o};/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mg=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Og=ht("Image",Mg);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Dg=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Pg=ht("Plus",Dg);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kg=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Wg=ht("Send",kg);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ug=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Bg=ht("Settings",Ug);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fg=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]],jg=ht("Trash",Fg);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zg=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Cr=ht("X",zg);function Gg({isOpen:m,onClose:w,onSave:o,initialApiKey:D=""}){const[B,E]=I.useState(D),[M,q]=I.useState(!1),[x,$]=I.useState(""),[k,F]=I.useState("https://api.openai.com/v1"),[re,ie]=I.useState(!1),[pe,R]=I.useState(!1),[W,le]=I.useState(null),[he,oe]=I.useState(null);I.useEffect(()=>{E(D);const H=localStorage.getItem("openaiApiKey"),Z=localStorage.getItem("openaiBaseUrl");H&&$(H),Z&&F(Z),(async()=>{try{const _e=localStorage.getItem("rsaPublicKey");if(_e)oe(_e);else{const bn=await bg();oe(bn),localStorage.setItem("rsaPublicKey",bn)}}catch(_e){console.error("Failed to fetch RSA public key:",_e)}})()},[D]);const Pe=async()=>{if(!x.trim()){le({success:!1,message:"Please enter an OpenAI API key"});return}if(!he){le({success:!1,message:"RSA public key not available. Please try again later."});return}R(!0),le(null);try{const H=await Sg(x,k,he);le({success:H,message:H?"API key is valid!":"Invalid API key. Please check and try again."})}catch(H){le({success:!1,message:H instanceof Error?H.message:"Failed to verify API key"})}finally{R(!1)}},fe=()=>{o(B),x.trim()?(localStorage.setItem("openaiApiKey",x),localStorage.setItem("openaiBaseUrl",k)):(localStorage.removeItem("openaiApiKey"),localStorage.removeItem("openaiBaseUrl")),w()};return m?h.jsx("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-sm flex items-center justify-center z-50",children:h.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl p-8 w-[480px] shadow-2xl",children:[h.jsx("h2",{className:"text-xl text-gray-900 dark:text-white font-semibold mb-6",children:"Set API Key"}),h.jsxs("div",{className:"mb-6",children:[h.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"ComfyUI Copilot API Key"}),h.jsxs("div",{className:"relative",children:[h.jsx("input",{type:M?"text":"password",value:B,onChange:H=>E(H.target.value),placeholder:"Enter your API key",className:`w-full px-4 py-3 border border-gray-200 dark:border-gray-600 rounded-lg mb-4 pr-12 + bg-gray-50 dark:bg-gray-700 + text-gray-900 dark:text-white + placeholder-gray-500 dark:placeholder-gray-400 + focus:border-blue-500 dark:focus:border-blue-400 + focus:ring-2 focus:ring-blue-500/20 dark:focus:ring-blue-400/20 + focus:outline-none`}),h.jsx("button",{type:"button",className:`absolute inset-y-0 right-0 pr-4 flex items-center text-gray-500 dark:text-gray-400 + hover:text-gray-700 dark:hover:text-gray-200 transition-colors bg-transparent border-none`,onClick:()=>q(!M),children:M?h.jsxs("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]}):h.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"})})})]}),h.jsxs("div",{className:"text-sm text-gray-600 dark:text-gray-300",children:[h.jsx("span",{children:"Don't have an API key? "}),h.jsx("a",{href:"https://form.typeform.com/to/tkg91K8D",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium",children:"Click here to request one"})]})]}),h.jsxs("div",{className:"mb-6 border-t border-gray-200 dark:border-gray-700 pt-6",children:[h.jsx("h3",{className:"text-sm text-gray-900 dark:text-white font-medium mb-4",children:"OpenAI API Configuration (Optional)"}),h.jsxs("div",{className:"mb-4",children:[h.jsx("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-2",children:"OpenAI API Key"}),h.jsxs("div",{className:"relative",children:[h.jsx("input",{type:re?"text":"password",value:x,onChange:H=>$(H.target.value),placeholder:"Enter your OpenAI API key",className:`w-full px-4 py-3 border border-gray-200 dark:border-gray-600 rounded-lg pr-12 text-xs + bg-gray-50 dark:bg-gray-700 + text-gray-900 dark:text-white + placeholder-gray-500 dark:placeholder-gray-400 + focus:border-blue-500 dark:focus:border-blue-400 + focus:ring-2 focus:ring-blue-500/20 dark:focus:ring-blue-400/20 + focus:outline-none`}),h.jsx("button",{type:"button",className:`absolute inset-y-0 right-0 pr-4 flex items-center text-gray-500 dark:text-gray-400 + hover:text-gray-700 dark:hover:text-gray-200 transition-colors bg-transparent border-none`,onClick:()=>ie(!re),children:re?h.jsxs("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]}):h.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"})})})]})]}),h.jsxs("div",{className:"mb-4",children:[h.jsx("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-2",children:"OpenAI Base URL"}),h.jsx("input",{type:"text",value:k,onChange:H=>F(H.target.value),placeholder:"https://api.openai.com/v1",className:`w-full px-4 py-3 border border-gray-200 dark:border-gray-600 rounded-lg text-xs + bg-gray-50 dark:bg-gray-700 + text-gray-900 dark:text-white + placeholder-gray-500 dark:placeholder-gray-400 + focus:border-blue-500 dark:focus:border-blue-400 + focus:ring-2 focus:ring-blue-500/20 dark:focus:ring-blue-400/20 + focus:outline-none`})]}),h.jsx("div",{className:"flex items-center mb-2",children:h.jsx("button",{onClick:Pe,disabled:pe||!x.trim(),className:`px-4 py-2 rounded-lg font-medium text-xs transition-colors ${pe||!x.trim()?"bg-gray-300 dark:bg-gray-600 text-gray-500 dark:text-gray-400 cursor-not-allowed":"bg-blue-600 hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600 text-white"}`,children:pe?h.jsxs("span",{className:"flex items-center",children:[h.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Verifying..."]}):"Verify"})}),W&&h.jsx("div",{className:`text-xs p-2 rounded-md ${W.success?"bg-green-50 dark:bg-green-900/20 text-green-700 dark:text-green-400":"bg-red-50 dark:bg-red-900/20 text-red-700 dark:text-red-400"}`,children:W.message})]}),h.jsxs("div",{className:"flex justify-end gap-3",children:[h.jsx("button",{onClick:w,className:`px-5 py-2.5 text-gray-700 bg-white dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 + rounded-lg font-medium transition-colors`,children:"Cancel"}),h.jsx("button",{onClick:fe,className:`px-5 py-2.5 bg-blue-600 hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600 + text-white rounded-lg font-medium transition-colors`,children:"Save"})]})]})}):null}function Kg({onClose:m,onClear:w,hasMessages:o,onHeightResize:D,title:B="ComfyUI-Copilot"}){const[E,M]=I.useState(!1),[q,x]=I.useState(!1),$=()=>{M(!0)},k=re=>{localStorage.setItem("chatApiKey",re)},F=re=>{x(!0),re.preventDefault()};return I.useEffect(()=>{const re=pe=>{if(!q)return;const R=pe.movementY;D?.(R)},ie=()=>{x(!1)};return q&&(document.addEventListener("mousemove",re),document.addEventListener("mouseup",ie)),()=>{document.removeEventListener("mousemove",re),document.removeEventListener("mouseup",ie)}},[q,D]),h.jsxs(h.Fragment,{children:[h.jsx("div",{className:`absolute top-0 left-0 right-0 h-2 bg-gray-100 hover:bg-gray-300 + transition-colors duration-200 cursor-ns-resize z-20`,onMouseDown:F,style:{borderBottom:"1px solid #e5e7eb"}}),h.jsxs("div",{className:`flex items-center justify-between border-b px-4 py-3 + bg-white border-gray-200 sticky top-2 z-10`,children:[h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("img",{src:Ng,alt:"ComfyUI-Copilot Logo",className:"h-10 w-10 -ml-1"}),h.jsx("h3",{className:"text-[16px] font-medium text-gray-800",children:B}),h.jsx("button",{onClick:$,className:"p-1 bg-white border-none hover:bg-gray-100 rounded text-gray-500",children:h.jsx(Bg,{className:"h-5 w-5"})})]}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("button",{className:`inline-flex bg-white border-none items-center justify-center rounded-md p-2 + ${o?"text-gray-500 hover:bg-gray-100":"text-gray-300 cursor-not-allowed"}`,disabled:!o,onClick:w,children:h.jsx(jg,{className:"h-5 w-5"})}),h.jsx("button",{className:`inline-flex bg-white border-none items-center justify-center rounded-md p-2 + text-gray-500 hover:bg-gray-100`,onClick:m,children:h.jsx(Cr,{className:"h-5 w-5"})})]})]}),h.jsx(Gg,{isOpen:E,onClose:()=>M(!1),onSave:k,initialApiKey:localStorage.getItem("chatApiKey")||""})]})}const $g=5*1024*1024,ko=["image/jpeg","image/png","image/gif","image/webp"],rs=[{name:"gpt-4o",image_enable:!0},{name:"gpt-4o-mini",image_enable:!0},{name:"qwen-plus",image_enable:!1},{name:"DeepSeek-V3",image_enable:!1}];function Hg({input:m,loading:w,onChange:o,onSend:D,onKeyPress:B,onUploadImages:E,uploadedImages:M,onRemoveImage:q,selectedModel:x,onModelChange:$}){const[k,F]=I.useState(!1),re=wn.useRef(null),ie=I.useRef(null);I.useEffect(()=>{ie.current&&(ie.current.style.height="auto",ie.current.style.height=`${Math.min(ie.current.scrollHeight,400)}px`)},[m]);const pe=R=>{if(R.target.files){const W=[],le=[];if(Array.from(R.target.files).forEach(he=>{ko.includes(he.type)?he.size>$g?W.push(`${he.name} (exceeds 5MB)`):le.push(he):W.push(`${he.name} (unsupported format)`)}),W.length>0&&alert(`The following files couldn't be uploaded: +${W.join(` +`)}`),le.length>0){const he=new DataTransfer;le.forEach(oe=>he.items.add(oe)),E(he.files)}}};return h.jsxs("div",{className:`relative ${M.length>0?"mt-12":""}`,children:[M.length>0&&h.jsx("div",{className:"absolute -top-10 left-0 flex gap-2",children:M.map(R=>h.jsxs("div",{className:"relative group",children:[h.jsx("img",{src:R.preview,alt:"uploaded",className:"w-8 h-8 rounded object-cover"}),h.jsx("button",{onClick:()=>q(R.id),className:`absolute -top-1 -right-1 bg-white border-none text-gray-500 rounded-full p-0.5 + opacity-0 group-hover:opacity-100 transition-opacity`,children:h.jsx(Cr,{className:"w-3 h-3"})})]},R.id))}),h.jsx("textarea",{ref:ie,onChange:o,onKeyDown:R=>{if(R.key==="Enter"&&!R.shiftKey){if(R.nativeEvent.isComposing)return;R.preventDefault(),D()}B(R)},value:m,placeholder:"Type your message...",className:`w-full min-h-[80px] max-h-[400px] resize-none rounded-md border + border-gray-200 px-3 py-2 pr-12 pb-10 text-[14px] shadow-sm + focus:outline-none focus:ring-2 focus:ring-blue-500 + focus:border-transparent bg-white transition-all + duration-200 text-gray-700 overflow-y-auto`,style:{height:"80px"}}),h.jsxs("div",{className:`absolute bottom-2 left-3 right-12 flex items-center gap-2 + bg-white border-t border-gray-100 pt-1`,children:[h.jsx("select",{value:x,onChange:R=>$(R.target.value),className:`px-1.5 py-0.5 text-xs rounded-md + border border-gray-200 bg-white text-gray-700 + focus:outline-none focus:ring-2 focus:ring-blue-500 + focus:border-transparent hover:bg-gray-50 + transition-colors border-0`,children:rs.map(R=>h.jsx("option",{value:R.name,children:R.name},R.name))}),h.jsx("button",{type:"button",onClick:()=>F(!0),disabled:!rs.find(R=>R.name===x)?.image_enable,className:`p-1.5 text-gray-500 bg-white border-none + hover:bg-gray-100 hover:text-gray-600 + transition-all duration-200 outline-none + ${rs.find(R=>R.name===x)?.image_enable?"":"opacity-50 cursor-not-allowed"}`,children:h.jsx(Og,{className:"h-4 w-4"})})]}),h.jsx("button",{type:"submit",onClick:D,disabled:w,className:`absolute bottom-3 right-3 p-2 rounded-md text-gray-500 bg-white border-none + hover:bg-gray-100 hover:text-gray-600 disabled:opacity-50 + transition-all duration-200 active:scale-95`,children:w?h.jsx("div",{className:`h-5 w-5 animate-spin rounded-full + border-2 border-gray-300 border-t-blue-500`}):h.jsx(Wg,{className:"h-5 w-5 group-hover:translate-x-1"})}),k&&h.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:h.jsxs("div",{className:"bg-white rounded-lg p-6 w-96 relative",children:[h.jsx("button",{onClick:()=>F(!1),className:"absolute top-2 right-2 bg-white border-none text-gray-500 hover:text-gray-700",children:h.jsx(Cr,{className:"w-5 h-5"})}),h.jsx("h3",{className:"text-lg text-gray-800 font-medium mb-4",children:"Upload Images"}),h.jsxs("div",{className:`border-2 border-dashed border-gray-300 rounded-lg p-8 + flex flex-col items-center justify-center gap-4 + hover:border-blue-500 transition-colors cursor-pointer`,onClick:()=>re.current?.click(),children:[h.jsx(Pg,{className:"w-8 h-8 text-gray-400"}),h.jsxs("div",{className:"text-center",children:[h.jsx("p",{className:"text-sm text-gray-500 mb-2",children:"Click to upload images or drag and drop"}),h.jsx("p",{className:"text-xs text-gray-400",children:"Supported formats: JPG, PNG, GIF, WebP"}),h.jsx("p",{className:"text-xs text-gray-400",children:"Max file size: 5MB"})]})]}),h.jsx("input",{ref:re,type:"file",multiple:!0,accept:ko.join(","),onChange:pe,className:"hidden"}),M.length>0&&h.jsx("div",{className:"mt-4 grid grid-cols-3 gap-2",children:M.map(R=>h.jsxs("div",{className:"relative group",children:[h.jsx("img",{src:R.preview,alt:"preview",className:"w-full h-20 object-cover rounded"}),h.jsx("button",{onClick:()=>q(R.id),className:`absolute -top-1 -right-1 bg-white border-none text-gray-500 + rounded-full p-0.5 opacity-0 group-hover:opacity-100 + transition-opacity`,children:h.jsx(Cr,{className:"w-3 h-3"})})]},R.id))}),h.jsx("div",{className:"mt-4 flex justify-end gap-2",children:h.jsx("button",{onClick:()=>F(!1),className:`px-4 py-2 text-sm font-medium text-gray-700 + bg-white border border-gray-300 rounded-md + hover:bg-gray-50`,children:"Close"})})]})})]})}function qg(){const m=Object.values(sn.canvas.selected_nodes)[0],w=new Set;function o(D,B){if(!(!D||B>=1)&&D.inputs)for(const E of Object.values(D.inputs)){const M=E.link;if(M&&sn.graph.links[M]){const q=sn.graph.links[M].origin_id,x=sn.graph._nodes_by_id[q];x&&(w.add(x.type),o(x,B+1))}}}return m?(o(m,0),[{type:"upstream_node_types",data:Array.from(w)}]):null}function Zg({nodeInfo:m,onSendWithIntent:w,loading:o,onSendWithContent:D}){return h.jsx("div",{className:"mb-3 p-3 rounded-md bg-gray-50 border border-gray-200",children:h.jsxs("div",{className:"text-sm text-gray-700",children:[h.jsxs("p",{children:["Selected node: ",m[0].type]}),h.jsxs("div",{className:"flex gap-2 mt-2",children:[h.jsx("button",{className:`px-3 py-1 text-xs rounded-md bg-blue-50 + text-blue-700 hover:bg-blue-100`,onClick:()=>D(`Reply in ${navigator.language} language: How does the ${m[0].type} node work? I need its official usage guide.`),disabled:o,children:"Usage"}),h.jsx("button",{className:`px-3 py-1 text-xs rounded-md bg-green-100 + text-green-700 hover:bg-green-200`,onClick:()=>D(`Reply in ${navigator.language} language: Show me the technical specifications for the ${m[0].type} node's inputs and outputs.`),disabled:o,children:"Parameters"}),h.jsx("button",{className:`px-3 py-1 text-xs rounded-md bg-purple-100 + text-purple-700 hover:bg-purple-200`,onClick:()=>w("downstream_subgraph_search",qg()),disabled:o,children:"Downstream Nodes"})]})]})})}function Yg(){return h.jsx(Ag,{name:"Assistant",children:h.jsxs("div",{className:"flex items-center space-x-2 p-4 bg-gray-50 rounded-lg",children:[h.jsxs("div",{className:"flex space-x-1",children:[h.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),h.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),h.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]}),h.jsx("span",{className:"text-sm text-gray-500",children:"AI is thinking..."})]})})}const Xg=m=>`https://ui-avatars.com/api/?name=${m||"User"}&background=random`,Jg=I.lazy(()=>Dt(()=>import("./WorkflowOption-DWEyFLfP.js"),__vite__mapDeps([0,1,2,3])).then(m=>({default:m.WorkflowOption}))),Qg=I.lazy(()=>Dt(()=>import("./message-components-D3rPBq8S.js").then(m=>m.N),__vite__mapDeps([3,2,1])).then(m=>({default:m.NodeSearch}))),Vg=I.lazy(()=>Dt(()=>import("./message-components-D3rPBq8S.js").then(m=>m.D),__vite__mapDeps([3,2,1])).then(m=>({default:m.DownstreamSubgraphs}))),ep=I.lazy(()=>Dt(()=>import("./message-components-D3rPBq8S.js").then(m=>m.d),__vite__mapDeps([3,2,1])).then(m=>({default:m.NodeInstallGuide})));function np({messages:m,latestInput:w,onOptionClick:o,installedNodes:D,onAddMessage:B,loading:E}){const M=wn.useMemo(()=>x=>{if(x.role==="user")return h.jsx(Eg,{content:x.content,trace_id:x.trace_id},x.id);if(x.role==="ai"||x.role==="tool"){const $=Xg(x.role);try{const k=JSON.parse(x.content),F=k.ext?.find(W=>W.type==="workflow"),re=k.ext?.find(W=>W.type==="node"),ie=k.ext?.find(W=>W.type==="downstream_subgraph_search"),pe=k.ext?.find(W=>W.type==="node_install_guide");let R=null;if(F)R=h.jsx(I.Suspense,{fallback:h.jsx("div",{children:"Loading..."}),children:h.jsx(Jg,{content:x.content,name:x.name,avatar:$,latestInput:w,installedNodes:D,onAddMessage:B})});else if(re)R=h.jsx(I.Suspense,{fallback:h.jsx("div",{children:"Loading..."}),children:h.jsx(Qg,{content:x.content,name:x.name,avatar:$,installedNodes:D})});else if(ie){const W=h.jsx(I.Suspense,{fallback:h.jsx("div",{children:"Loading..."}),children:h.jsx(Vg,{content:x.content,name:x.name,avatar:$,onAddMessage:B})});if(x.metadata?.intent==="downstream_subgraph_search")return h.jsx(Ir,{content:x.content,name:x.name,avatar:$,format:x.format,onOptionClick:o,extComponent:W,metadata:x.metadata},x.id);R=W}else pe&&(R=h.jsx(I.Suspense,{fallback:h.jsx("div",{children:"Loading..."}),children:h.jsx(ep,{content:x.content,onLoadSubgraph:()=>{if(x.metadata?.pendingSubgraph){const W=Object.values(sn.canvas.selected_nodes)[0];if(W){const le=x.metadata.pendingSubgraph,he=le.json.nodes,oe=le.json.links,Pe=he.find(Z=>Z.id===0),fe=Pe?.id,H={};fe&&(H[fe]=W),sn.canvas.emitBeforeChange();try{for(const Z of he)if(Z.id!==fe){const Se=Pe?.pos||[0,0],_e=W._pos||[0,0],bn=[Z.pos[0]+_e[0]-Se[0],Z.pos[1]+_e[1]-Se[1]];H[Z.id]=Ig(Z.type,{pos:bn})}}finally{sn.canvas.emitAfterChange()}for(const Z of oe){const Se=H[Z.origin_id],_e=H[Z.target_id];Se&&_e&&Se.connect(Z.origin_slot,_e,Z.target_slot)}}else alert("Please select a upstream node first before adding a subgraph.")}else if(x.metadata?.pendingWorkflow){const W=x.metadata.pendingWorkflow,le=x.metadata.optimizedParams;sn.loadGraphData(W);for(const[oe,Pe,fe,H,Z]of le){const Se=sn.graph._nodes_by_id[oe].widgets;for(const _e of Se)_e.name===H&&(_e.value=Z)}sn.graph.setDirtyCanvas(!1,!0);const he={id:Ve(),role:"tool",content:JSON.stringify({text:"The workflow has been successfully loaded to the canvas",ext:[]}),format:"markdown",name:"Assistant"};B?.(he)}}})}));return k.text||R?h.jsx(Ir,{content:x.content,name:x.name,avatar:$,format:x.format,onOptionClick:o,extComponent:R,metadata:x.metadata},x.id):R||h.jsx(Ir,{content:x.content,name:x.name,avatar:$,format:x.format,onOptionClick:o,metadata:x.metadata},x.id)}catch(k){return console.error("[MessageList] Error parsing message content:",k),console.error("解析JSON失败",x.content),h.jsx(Ir,{content:x.content,name:x.name,avatar:$,format:x.format,onOptionClick:o,metadata:x.metadata},x.id)}}return null},[D,o,B,w]),q=wn.useMemo(()=>m?.map(M),[m,M]);return h.jsxs("div",{className:"flex flex-col gap-4 w-full",children:[q,E&&h.jsx(Yg,{})]})}async function tp(){try{return await(await Pt.fetchApi("/object_info",{method:"GET"})).json()}catch(m){throw console.error("Error fetching object info:",m),m}}async function rp(){const m=await tp();return Object.keys(m)}async function pp(m){return await(await Pt.fetchApi("/prompt",{method:"POST",body:JSON.stringify(m)})).json()}async function _p(m){try{const w=await Pt.fetchApi("/queue",{method:"POST",body:JSON.stringify(m)});if(!w.ok)throw new Error(`Failed to manage queue: ${w.status} ${w.statusText}`);return w}catch(w){throw console.error("Error managing queue:",w),w}}async function vp(){try{const m=await Pt.fetchApi("/interrupt",{method:"POST"});if(!m.ok)throw new Error(`Failed to interrupt processing: ${m.status} ${m.statusText}`);return m}catch(m){throw console.error("Error interrupting processing:",m),m}}async function mp(m){try{const w=await Pt.fetchApi(`/history/${m}`,{method:"GET"});if(!w.ok)throw new Error(`Failed to fetch history: ${w.status} ${w.statusText}`);return await w.json()}catch(w){throw console.error("Error fetching history:",w),w}}var Nr={exports:{}};/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */Nr.exports;(function(m,w){(function(){var o,D="4.17.21",B=200,E="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",M="Expected a function",q="Invalid `variable` option passed into `_.template`",x="__lodash_hash_undefined__",$=500,k="__lodash_placeholder__",F=1,re=2,ie=4,pe=1,R=2,W=1,le=2,he=4,oe=8,Pe=16,fe=32,H=64,Z=128,Se=256,_e=512,bn=30,Rr="...",kt=800,ss=16,Wt=1,dt=2,Tr=3,$n=1/0,fn=9007199254740991,Hn=17976931348623157e292,qn=NaN,ke=4294967295,Mr=ke-1,Or=ke>>>1,Dr=[["ary",Z],["bind",W],["bindKey",le],["curry",oe],["curryRight",Pe],["flip",_e],["partial",fe],["partialRight",H],["rearg",Se]],Sn="[object Arguments]",Dn="[object Array]",Zn="[object AsyncFunction]",Pn="[object Boolean]",An="[object Date]",Pr="[object DOMException]",Yn="[object Error]",Xn="[object Function]",gt="[object GeneratorFunction]",We="[object Map]",A="[object Number]",Y="[object Null]",ee="[object Object]",Ae="[object Promise]",un="[object Proxy]",Ee="[object RegExp]",V="[object Set]",ve="[object String]",Ke="[object Symbol]",cn="[object Undefined]",pt="[object WeakMap]",Bo="[object WeakSet]",_t="[object ArrayBuffer]",Jn="[object DataView]",kr="[object Float32Array]",Wr="[object Float64Array]",Ur="[object Int8Array]",Br="[object Int16Array]",Fr="[object Int32Array]",jr="[object Uint8Array]",zr="[object Uint8ClampedArray]",Gr="[object Uint16Array]",Kr="[object Uint32Array]",Fo=/\b__p \+= '';/g,jo=/\b(__p \+=) '' \+/g,zo=/(__e\(.*?\)|\b__t\)) \+\n'';/g,us=/&(?:amp|lt|gt|quot|#39);/g,os=/[&<>"']/g,Go=RegExp(us.source),Ko=RegExp(os.source),$o=/<%-([\s\S]+?)%>/g,Ho=/<%([\s\S]+?)%>/g,as=/<%=([\s\S]+?)%>/g,qo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Zo=/^\w*$/,Yo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$r=/[\\^$.*+?()[\]{}|]/g,Xo=RegExp($r.source),Hr=/^\s+/,Jo=/\s/,Qo=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Vo=/\{\n\/\* \[wrapped with (.+)\] \*/,ea=/,? & /,na=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ta=/[()=,{}\[\]\/\s]/,ra=/\\(\\)?/g,ia=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ls=/\w*$/,sa=/^[-+]0x[0-9a-f]+$/i,ua=/^0b[01]+$/i,oa=/^\[object .+?Constructor\]$/,aa=/^0o[0-7]+$/i,la=/^(?:0|[1-9]\d*)$/,fa=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ut=/($^)/,ca=/['\n\r\u2028\u2029\\]/g,Bt="\\ud800-\\udfff",ha="\\u0300-\\u036f",da="\\ufe20-\\ufe2f",ga="\\u20d0-\\u20ff",fs=ha+da+ga,cs="\\u2700-\\u27bf",hs="a-z\\xdf-\\xf6\\xf8-\\xff",pa="\\xac\\xb1\\xd7\\xf7",_a="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",va="\\u2000-\\u206f",ma=" \\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",ds="A-Z\\xc0-\\xd6\\xd8-\\xde",gs="\\ufe0e\\ufe0f",ps=pa+_a+va+ma,qr="['’]",xa="["+Bt+"]",_s="["+ps+"]",Ft="["+fs+"]",vs="\\d+",ya="["+cs+"]",ms="["+hs+"]",xs="[^"+Bt+ps+vs+cs+hs+ds+"]",Zr="\\ud83c[\\udffb-\\udfff]",wa="(?:"+Ft+"|"+Zr+")",ys="[^"+Bt+"]",Yr="(?:\\ud83c[\\udde6-\\uddff]){2}",Xr="[\\ud800-\\udbff][\\udc00-\\udfff]",Qn="["+ds+"]",ws="\\u200d",bs="(?:"+ms+"|"+xs+")",ba="(?:"+Qn+"|"+xs+")",Ss="(?:"+qr+"(?:d|ll|m|re|s|t|ve))?",As="(?:"+qr+"(?:D|LL|M|RE|S|T|VE))?",Es=wa+"?",Is="["+gs+"]?",Sa="(?:"+ws+"(?:"+[ys,Yr,Xr].join("|")+")"+Is+Es+")*",Aa="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ea="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Cs=Is+Es+Sa,Ia="(?:"+[ya,Yr,Xr].join("|")+")"+Cs,Ca="(?:"+[ys+Ft+"?",Ft,Yr,Xr,xa].join("|")+")",Na=RegExp(qr,"g"),La=RegExp(Ft,"g"),Jr=RegExp(Zr+"(?="+Zr+")|"+Ca+Cs,"g"),Ra=RegExp([Qn+"?"+ms+"+"+Ss+"(?="+[_s,Qn,"$"].join("|")+")",ba+"+"+As+"(?="+[_s,Qn+bs,"$"].join("|")+")",Qn+"?"+bs+"+"+Ss,Qn+"+"+As,Ea,Aa,vs,Ia].join("|"),"g"),Ta=RegExp("["+ws+Bt+fs+gs+"]"),Ma=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Oa=["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"],Da=-1,se={};se[kr]=se[Wr]=se[Ur]=se[Br]=se[Fr]=se[jr]=se[zr]=se[Gr]=se[Kr]=!0,se[Sn]=se[Dn]=se[_t]=se[Pn]=se[Jn]=se[An]=se[Yn]=se[Xn]=se[We]=se[A]=se[ee]=se[Ee]=se[V]=se[ve]=se[pt]=!1;var te={};te[Sn]=te[Dn]=te[_t]=te[Jn]=te[Pn]=te[An]=te[kr]=te[Wr]=te[Ur]=te[Br]=te[Fr]=te[We]=te[A]=te[ee]=te[Ee]=te[V]=te[ve]=te[Ke]=te[jr]=te[zr]=te[Gr]=te[Kr]=!0,te[Yn]=te[Xn]=te[pt]=!1;var Pa={À:"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"},ka={"&":"&","<":"<",">":">",'"':""","'":"'"},Wa={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ua={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ba=parseFloat,Fa=parseInt,Ns=typeof Mt=="object"&&Mt&&Mt.Object===Object&&Mt,ja=typeof self=="object"&&self&&self.Object===Object&&self,we=Ns||ja||Function("return this")(),Qr=w&&!w.nodeType&&w,kn=Qr&&!0&&m&&!m.nodeType&&m,Ls=kn&&kn.exports===Qr,Vr=Ls&&Ns.process,$e=function(){try{var f=kn&&kn.require&&kn.require("util").types;return f||Vr&&Vr.binding&&Vr.binding("util")}catch{}}(),Rs=$e&&$e.isArrayBuffer,Ts=$e&&$e.isDate,Ms=$e&&$e.isMap,Os=$e&&$e.isRegExp,Ds=$e&&$e.isSet,Ps=$e&&$e.isTypedArray;function Ue(f,g,d){switch(d.length){case 0:return f.call(g);case 1:return f.call(g,d[0]);case 2:return f.call(g,d[0],d[1]);case 3:return f.call(g,d[0],d[1],d[2])}return f.apply(g,d)}function za(f,g,d,b){for(var T=-1,X=f==null?0:f.length;++T-1}function ei(f,g,d){for(var b=-1,T=f==null?0:f.length;++b-1;);return d}function Gs(f,g){for(var d=f.length;d--&&Vn(g,f[d],0)>-1;);return d}function Ja(f,g){for(var d=f.length,b=0;d--;)f[d]===g&&++b;return b}var Qa=ii(Pa),Va=ii(ka);function el(f){return"\\"+Ua[f]}function nl(f,g){return f==null?o:f[g]}function et(f){return Ta.test(f)}function tl(f){return Ma.test(f)}function rl(f){for(var g,d=[];!(g=f.next()).done;)d.push(g.value);return d}function ai(f){var g=-1,d=Array(f.size);return f.forEach(function(b,T){d[++g]=[T,b]}),d}function Ks(f,g){return function(d){return f(g(d))}}function Cn(f,g){for(var d=-1,b=f.length,T=0,X=[];++d-1}function Kl(e,n){var t=this.__data__,r=ir(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this}hn.prototype.clear=Fl,hn.prototype.delete=jl,hn.prototype.get=zl,hn.prototype.has=Gl,hn.prototype.set=Kl;function dn(e){var n=-1,t=e==null?0:e.length;for(this.clear();++n=n?e:n)),e}function Ye(e,n,t,r,i,u){var a,l=n&F,c=n&re,p=n&ie;if(t&&(a=i?t(e,r,i,u):t(e)),a!==o)return a;if(!ae(e))return e;var _=O(e);if(_){if(a=Yf(e),!l)return Te(e,a)}else{var v=Ce(e),y=v==Xn||v==gt;if(On(e))return Iu(e,l);if(v==ee||v==Sn||y&&!i){if(a=c||y?{}:$u(e),!l)return c?Uf(e,of(a,e)):Wf(e,tu(a,e))}else{if(!te[v])return i?e:{};a=Xf(e,v,l)}}u||(u=new nn);var S=u.get(e);if(S)return S;u.set(e,a),wo(e)?e.forEach(function(L){a.add(Ye(L,n,t,L,e,u))}):xo(e)&&e.forEach(function(L,z){a.set(z,Ye(L,n,t,z,e,u))});var N=p?c?Di:Oi:c?Oe:ye,U=_?o:N(e);return He(U||e,function(L,z){U&&(z=L,L=e[z]),St(a,z,Ye(L,n,t,z,e,u))}),a}function af(e){var n=ye(e);return function(t){return ru(t,e,n)}}function ru(e,n,t){var r=t.length;if(e==null)return!r;for(e=ne(e);r--;){var i=t[r],u=n[i],a=e[i];if(a===o&&!(i in e)||!u(a))return!1}return!0}function iu(e,n,t){if(typeof e!="function")throw new qe(M);return Rt(function(){e.apply(o,t)},n)}function At(e,n,t,r){var i=-1,u=jt,a=!0,l=e.length,c=[],p=n.length;if(!l)return c;t&&(n=ue(n,Be(t))),r?(u=ei,a=!1):n.length>=B&&(u=vt,a=!1,n=new Bn(n));e:for(;++ii?0:i+t),r=r===o||r>i?i:P(r),r<0&&(r+=i),r=t>r?0:So(r);t0&&t(l)?n>1?be(l,n-1,t,r,i):In(i,l):r||(i[i.length]=l)}return i}var pi=Mu(),ou=Mu(!0);function on(e,n){return e&&pi(e,n,ye)}function _i(e,n){return e&&ou(e,n,ye)}function ur(e,n){return En(n,function(t){return mn(e[t])})}function jn(e,n){n=Tn(n,e);for(var t=0,r=n.length;e!=null&&tn}function cf(e,n){return e!=null&&Q.call(e,n)}function hf(e,n){return e!=null&&n in ne(e)}function df(e,n,t){return e>=Ie(n,t)&&e=120&&_.length>=120)?new Bn(a&&_):o}_=e[0];var v=-1,y=l[0];e:for(;++v-1;)l!==e&&Jt.call(l,c,1),Jt.call(e,c,1);return e}function mu(e,n){for(var t=e?n.length:0,r=t-1;t--;){var i=n[t];if(t==r||i!==u){var u=i;vn(i)?Jt.call(e,i,1):Ii(e,i)}}return e}function Si(e,n){return e+er(Qs()*(n-e+1))}function If(e,n,t,r){for(var i=-1,u=xe(Vt((n-e)/(t||1)),0),a=d(u);u--;)a[r?u:++i]=e,e+=t;return a}function Ai(e,n){var t="";if(!e||n<1||n>fn)return t;do n%2&&(t+=e),n=er(n/2),n&&(e+=e);while(n);return t}function j(e,n){return ji(Zu(e,n,De),e+"")}function Cf(e){return nu(ct(e))}function Nf(e,n){var t=ct(e);return vr(t,Fn(n,0,t.length))}function Ct(e,n,t,r){if(!ae(e))return e;n=Tn(n,e);for(var i=-1,u=n.length,a=u-1,l=e;l!=null&&++ii?0:i+n),t=t>i?i:t,t<0&&(t+=i),i=n>t?0:t-n>>>0,n>>>=0;for(var u=d(i);++r>>1,a=e[u];a!==null&&!je(a)&&(t?a<=n:a=B){var p=n?null:zf(e);if(p)return Gt(p);a=!1,i=vt,c=new Bn}else c=n?[]:l;e:for(;++r=r?e:Xe(e,n,t)}var Eu=ml||function(e){return we.clearTimeout(e)};function Iu(e,n){if(n)return e.slice();var t=e.length,r=qs?qs(t):new e.constructor(t);return e.copy(r),r}function Ri(e){var n=new e.constructor(e.byteLength);return new Yt(n).set(new Yt(e)),n}function Of(e,n){var t=n?Ri(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}function Df(e){var n=new e.constructor(e.source,ls.exec(e));return n.lastIndex=e.lastIndex,n}function Pf(e){return bt?ne(bt.call(e)):{}}function Cu(e,n){var t=n?Ri(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}function Nu(e,n){if(e!==n){var t=e!==o,r=e===null,i=e===e,u=je(e),a=n!==o,l=n===null,c=n===n,p=je(n);if(!l&&!p&&!u&&e>n||u&&a&&c&&!l&&!p||r&&a&&c||!t&&c||!i)return 1;if(!r&&!u&&!p&&e=l)return c;var p=t[r];return c*(p=="desc"?-1:1)}}return e.index-n.index}function Lu(e,n,t,r){for(var i=-1,u=e.length,a=t.length,l=-1,c=n.length,p=xe(u-a,0),_=d(c+p),v=!r;++l1?t[i-1]:o,a=i>2?t[2]:o;for(u=e.length>3&&typeof u=="function"?(i--,u):o,a&&Le(t[0],t[1],a)&&(u=i<3?o:u,i=1),n=ne(n);++r-1?i[u?n[a]:a]:o}}function Pu(e){return _n(function(n){var t=n.length,r=t,i=Ze.prototype.thru;for(e&&n.reverse();r--;){var u=n[r];if(typeof u!="function")throw new qe(M);if(i&&!a&&pr(u)=="wrapper")var a=new Ze([],!0)}for(r=a?r:t;++r1&&K.reverse(),_&&cl))return!1;var p=u.get(e),_=u.get(n);if(p&&_)return p==n&&_==e;var v=-1,y=!0,S=t&R?new Bn:o;for(u.set(e,n),u.set(n,e);++v1?"& ":"")+n[r],n=n.join(t>2?", ":" "),e.replace(Qo,`{ +/* [wrapped with `+n+`] */ +`)}function Qf(e){return O(e)||Kn(e)||!!(Xs&&e&&e[Xs])}function vn(e,n){var t=typeof e;return n=n??fn,!!n&&(t=="number"||t!="symbol"&&la.test(e))&&e>-1&&e%1==0&&e0){if(++n>=kt)return arguments[0]}else n=0;return e.apply(o,arguments)}}function vr(e,n){var t=-1,r=e.length,i=r-1;for(n=n===o?r:n;++t1?e[n-1]:o;return t=typeof t=="function"?(e.pop(),t):o,uo(e,t)});function oo(e){var n=s(e);return n.__chain__=!0,n}function lh(e,n){return n(e),e}function mr(e,n){return n(e)}var fh=_n(function(e){var n=e.length,t=n?e[0]:0,r=this.__wrapped__,i=function(u){return gi(u,e)};return n>1||this.__actions__.length||!(r instanceof G)||!vn(t)?this.thru(i):(r=r.slice(t,+t+(n?1:0)),r.__actions__.push({func:mr,args:[i],thisArg:o}),new Ze(r,this.__chain__).thru(function(u){return n&&!u.length&&u.push(o),u}))});function ch(){return oo(this)}function hh(){return new Ze(this.value(),this.__chain__)}function dh(){this.__values__===o&&(this.__values__=bo(this.value()));var e=this.__index__>=this.__values__.length,n=e?o:this.__values__[this.__index__++];return{done:e,value:n}}function gh(){return this}function ph(e){for(var n,t=this;t instanceof rr;){var r=eo(t);r.__index__=0,r.__values__=o,n?i.__wrapped__=r:n=r;var i=r;t=t.__wrapped__}return i.__wrapped__=e,n}function _h(){var e=this.__wrapped__;if(e instanceof G){var n=e;return this.__actions__.length&&(n=new G(this)),n=n.reverse(),n.__actions__.push({func:mr,args:[zi],thisArg:o}),new Ze(n,this.__chain__)}return this.thru(zi)}function vh(){return Su(this.__wrapped__,this.__actions__)}var mh=fr(function(e,n,t){Q.call(e,t)?++e[t]:gn(e,t,1)});function xh(e,n,t){var r=O(e)?ks:lf;return t&&Le(e,n,t)&&(n=o),r(e,C(n,3))}function yh(e,n){var t=O(e)?En:uu;return t(e,C(n,3))}var wh=Du(no),bh=Du(to);function Sh(e,n){return be(xr(e,n),1)}function Ah(e,n){return be(xr(e,n),$n)}function Eh(e,n,t){return t=t===o?1:P(t),be(xr(e,n),t)}function ao(e,n){var t=O(e)?He:Ln;return t(e,C(n,3))}function lo(e,n){var t=O(e)?Ga:su;return t(e,C(n,3))}var Ih=fr(function(e,n,t){Q.call(e,t)?e[t].push(n):gn(e,t,[n])});function Ch(e,n,t,r){e=Me(e)?e:ct(e),t=t&&!r?P(t):0;var i=e.length;return t<0&&(t=xe(i+t,0)),Ar(e)?t<=i&&e.indexOf(n,t)>-1:!!i&&Vn(e,n,t)>-1}var Nh=j(function(e,n,t){var r=-1,i=typeof n=="function",u=Me(e)?d(e.length):[];return Ln(e,function(a){u[++r]=i?Ue(n,a,t):Et(a,n,t)}),u}),Lh=fr(function(e,n,t){gn(e,t,n)});function xr(e,n){var t=O(e)?ue:hu;return t(e,C(n,3))}function Rh(e,n,t,r){return e==null?[]:(O(n)||(n=n==null?[]:[n]),t=r?o:t,O(t)||(t=t==null?[]:[t]),_u(e,n,t))}var Th=fr(function(e,n,t){e[t?0:1].push(n)},function(){return[[],[]]});function Mh(e,n,t){var r=O(e)?ni:Fs,i=arguments.length<3;return r(e,C(n,4),t,i,Ln)}function Oh(e,n,t){var r=O(e)?Ka:Fs,i=arguments.length<3;return r(e,C(n,4),t,i,su)}function Dh(e,n){var t=O(e)?En:uu;return t(e,br(C(n,3)))}function Ph(e){var n=O(e)?nu:Cf;return n(e)}function kh(e,n,t){(t?Le(e,n,t):n===o)?n=1:n=P(n);var r=O(e)?rf:Nf;return r(e,n)}function Wh(e){var n=O(e)?sf:Rf;return n(e)}function Uh(e){if(e==null)return 0;if(Me(e))return Ar(e)?nt(e):e.length;var n=Ce(e);return n==We||n==V?e.size:yi(e).length}function Bh(e,n,t){var r=O(e)?ti:Tf;return t&&Le(e,n,t)&&(n=o),r(e,C(n,3))}var Fh=j(function(e,n){if(e==null)return[];var t=n.length;return t>1&&Le(e,n[0],n[1])?n=[]:t>2&&Le(n[0],n[1],n[2])&&(n=[n[0]]),_u(e,be(n,1),[])}),yr=xl||function(){return we.Date.now()};function jh(e,n){if(typeof n!="function")throw new qe(M);return e=P(e),function(){if(--e<1)return n.apply(this,arguments)}}function fo(e,n,t){return n=t?o:n,n=e&&n==null?e.length:n,pn(e,Z,o,o,o,o,n)}function co(e,n){var t;if(typeof n!="function")throw new qe(M);return e=P(e),function(){return--e>0&&(t=n.apply(this,arguments)),e<=1&&(n=o),t}}var Ki=j(function(e,n,t){var r=W;if(t.length){var i=Cn(t,lt(Ki));r|=fe}return pn(e,r,n,t,i)}),ho=j(function(e,n,t){var r=W|le;if(t.length){var i=Cn(t,lt(ho));r|=fe}return pn(n,r,e,t,i)});function go(e,n,t){n=t?o:n;var r=pn(e,oe,o,o,o,o,o,n);return r.placeholder=go.placeholder,r}function po(e,n,t){n=t?o:n;var r=pn(e,Pe,o,o,o,o,o,n);return r.placeholder=po.placeholder,r}function _o(e,n,t){var r,i,u,a,l,c,p=0,_=!1,v=!1,y=!0;if(typeof e!="function")throw new qe(M);n=Qe(n)||0,ae(t)&&(_=!!t.leading,v="maxWait"in t,u=v?xe(Qe(t.maxWait)||0,n):u,y="trailing"in t?!!t.trailing:y);function S(ge){var rn=r,yn=i;return r=i=o,p=ge,a=e.apply(yn,rn),a}function N(ge){return p=ge,l=Rt(z,n),_?S(ge):a}function U(ge){var rn=ge-c,yn=ge-p,Po=n-rn;return v?Ie(Po,u-yn):Po}function L(ge){var rn=ge-c,yn=ge-p;return c===o||rn>=n||rn<0||v&&yn>=u}function z(){var ge=yr();if(L(ge))return K(ge);l=Rt(z,U(ge))}function K(ge){return l=o,y&&r?S(ge):(r=i=o,a)}function ze(){l!==o&&Eu(l),p=0,r=c=i=l=o}function Re(){return l===o?a:K(yr())}function Ge(){var ge=yr(),rn=L(ge);if(r=arguments,i=this,c=ge,rn){if(l===o)return N(c);if(v)return Eu(l),l=Rt(z,n),S(c)}return l===o&&(l=Rt(z,n)),a}return Ge.cancel=ze,Ge.flush=Re,Ge}var zh=j(function(e,n){return iu(e,1,n)}),Gh=j(function(e,n,t){return iu(e,Qe(n)||0,t)});function Kh(e){return pn(e,_e)}function wr(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new qe(M);var t=function(){var r=arguments,i=n?n.apply(this,r):r[0],u=t.cache;if(u.has(i))return u.get(i);var a=e.apply(this,r);return t.cache=u.set(i,a)||u,a};return t.cache=new(wr.Cache||dn),t}wr.Cache=dn;function br(e){if(typeof e!="function")throw new qe(M);return function(){var n=arguments;switch(n.length){case 0:return!e.call(this);case 1:return!e.call(this,n[0]);case 2:return!e.call(this,n[0],n[1]);case 3:return!e.call(this,n[0],n[1],n[2])}return!e.apply(this,n)}}function $h(e){return co(2,e)}var Hh=Mf(function(e,n){n=n.length==1&&O(n[0])?ue(n[0],Be(C())):ue(be(n,1),Be(C()));var t=n.length;return j(function(r){for(var i=-1,u=Ie(r.length,t);++i=n}),Kn=lu(function(){return arguments}())?lu:function(e){return ce(e)&&Q.call(e,"callee")&&!Ys.call(e,"callee")},O=d.isArray,od=Rs?Be(Rs):pf;function Me(e){return e!=null&&Sr(e.length)&&!mn(e)}function de(e){return ce(e)&&Me(e)}function ad(e){return e===!0||e===!1||ce(e)&&Ne(e)==Pn}var On=wl||ts,ld=Ts?Be(Ts):_f;function fd(e){return ce(e)&&e.nodeType===1&&!Tt(e)}function cd(e){if(e==null)return!0;if(Me(e)&&(O(e)||typeof e=="string"||typeof e.splice=="function"||On(e)||ft(e)||Kn(e)))return!e.length;var n=Ce(e);if(n==We||n==V)return!e.size;if(Lt(e))return!yi(e).length;for(var t in e)if(Q.call(e,t))return!1;return!0}function hd(e,n){return It(e,n)}function dd(e,n,t){t=typeof t=="function"?t:o;var r=t?t(e,n):o;return r===o?It(e,n,o,t):!!r}function Hi(e){if(!ce(e))return!1;var n=Ne(e);return n==Yn||n==Pr||typeof e.message=="string"&&typeof e.name=="string"&&!Tt(e)}function gd(e){return typeof e=="number"&&Js(e)}function mn(e){if(!ae(e))return!1;var n=Ne(e);return n==Xn||n==gt||n==Zn||n==un}function mo(e){return typeof e=="number"&&e==P(e)}function Sr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=fn}function ae(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}function ce(e){return e!=null&&typeof e=="object"}var xo=Ms?Be(Ms):mf;function pd(e,n){return e===n||xi(e,n,ki(n))}function _d(e,n,t){return t=typeof t=="function"?t:o,xi(e,n,ki(n),t)}function vd(e){return yo(e)&&e!=+e}function md(e){if(nc(e))throw new T(E);return fu(e)}function xd(e){return e===null}function yd(e){return e==null}function yo(e){return typeof e=="number"||ce(e)&&Ne(e)==A}function Tt(e){if(!ce(e)||Ne(e)!=ee)return!1;var n=Xt(e);if(n===null)return!0;var t=Q.call(n,"constructor")&&n.constructor;return typeof t=="function"&&t instanceof t&&Ht.call(t)==pl}var qi=Os?Be(Os):xf;function wd(e){return mo(e)&&e>=-9007199254740991&&e<=fn}var wo=Ds?Be(Ds):yf;function Ar(e){return typeof e=="string"||!O(e)&&ce(e)&&Ne(e)==ve}function je(e){return typeof e=="symbol"||ce(e)&&Ne(e)==Ke}var ft=Ps?Be(Ps):wf;function bd(e){return e===o}function Sd(e){return ce(e)&&Ce(e)==pt}function Ad(e){return ce(e)&&Ne(e)==Bo}var Ed=gr(wi),Id=gr(function(e,n){return e<=n});function bo(e){if(!e)return[];if(Me(e))return Ar(e)?en(e):Te(e);if(mt&&e[mt])return rl(e[mt]());var n=Ce(e),t=n==We?ai:n==V?Gt:ct;return t(e)}function xn(e){if(!e)return e===0?e:0;if(e=Qe(e),e===$n||e===-1/0){var n=e<0?-1:1;return n*Hn}return e===e?e:0}function P(e){var n=xn(e),t=n%1;return n===n?t?n-t:n:0}function So(e){return e?Fn(P(e),0,ke):0}function Qe(e){if(typeof e=="number")return e;if(je(e))return qn;if(ae(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=ae(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=js(e);var t=ua.test(e);return t||aa.test(e)?Fa(e.slice(2),t?2:8):sa.test(e)?qn:+e}function Ao(e){return an(e,Oe(e))}function Cd(e){return e?Fn(P(e),-9007199254740991,fn):e===0?e:0}function J(e){return e==null?"":Fe(e)}var Nd=ot(function(e,n){if(Lt(n)||Me(n)){an(n,ye(n),e);return}for(var t in n)Q.call(n,t)&&St(e,t,n[t])}),Eo=ot(function(e,n){an(n,Oe(n),e)}),Er=ot(function(e,n,t,r){an(n,Oe(n),e,r)}),Ld=ot(function(e,n,t,r){an(n,ye(n),e,r)}),Rd=_n(gi);function Td(e,n){var t=ut(e);return n==null?t:tu(t,n)}var Md=j(function(e,n){e=ne(e);var t=-1,r=n.length,i=r>2?n[2]:o;for(i&&Le(n[0],n[1],i)&&(r=1);++t1),u}),an(e,Di(e),t),r&&(t=Ye(t,F|re|ie,Gf));for(var i=n.length;i--;)Ii(t,n[i]);return t});function Xd(e,n){return Co(e,br(C(n)))}var Jd=_n(function(e,n){return e==null?{}:Af(e,n)});function Co(e,n){if(e==null)return{};var t=ue(Di(e),function(r){return[r]});return n=C(n),vu(e,t,function(r,i){return n(r,i[0])})}function Qd(e,n,t){n=Tn(n,e);var r=-1,i=n.length;for(i||(i=1,e=o);++rn){var r=e;e=n,n=r}if(t||e%1||n%1){var i=Qs();return Ie(e+i*(n-e+Ba("1e-"+((i+"").length-1))),n)}return Si(e,n)}var l0=at(function(e,n,t){return n=n.toLowerCase(),e+(t?Ro(n):n)});function Ro(e){return Xi(J(e).toLowerCase())}function To(e){return e=J(e),e&&e.replace(fa,Qa).replace(La,"")}function f0(e,n,t){e=J(e),n=Fe(n);var r=e.length;t=t===o?r:Fn(P(t),0,r);var i=t;return t-=n.length,t>=0&&e.slice(t,i)==n}function c0(e){return e=J(e),e&&Ko.test(e)?e.replace(os,Va):e}function h0(e){return e=J(e),e&&Xo.test(e)?e.replace($r,"\\$&"):e}var d0=at(function(e,n,t){return e+(t?"-":"")+n.toLowerCase()}),g0=at(function(e,n,t){return e+(t?" ":"")+n.toLowerCase()}),p0=Ou("toLowerCase");function _0(e,n,t){e=J(e),n=P(n);var r=n?nt(e):0;if(!n||r>=n)return e;var i=(n-r)/2;return dr(er(i),t)+e+dr(Vt(i),t)}function v0(e,n,t){e=J(e),n=P(n);var r=n?nt(e):0;return n&&r>>0,t?(e=J(e),e&&(typeof n=="string"||n!=null&&!qi(n))&&(n=Fe(n),!n&&et(e))?Mn(en(e),0,t):e.split(n,t)):[]}var A0=at(function(e,n,t){return e+(t?" ":"")+Xi(n)});function E0(e,n,t){return e=J(e),t=t==null?0:Fn(P(t),0,e.length),n=Fe(n),e.slice(t,t+n.length)==n}function I0(e,n,t){var r=s.templateSettings;t&&Le(e,n,t)&&(n=o),e=J(e),n=Er({},n,r,Fu);var i=Er({},n.imports,r.imports,Fu),u=ye(i),a=oi(i,u),l,c,p=0,_=n.interpolate||Ut,v="__p += '",y=li((n.escape||Ut).source+"|"+_.source+"|"+(_===as?ia:Ut).source+"|"+(n.evaluate||Ut).source+"|$","g"),S="//# sourceURL="+(Q.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Da+"]")+` +`;e.replace(y,function(L,z,K,ze,Re,Ge){return K||(K=ze),v+=e.slice(p,Ge).replace(ca,el),z&&(l=!0,v+=`' + +__e(`+z+`) + +'`),Re&&(c=!0,v+=`'; +`+Re+`; +__p += '`),K&&(v+=`' + +((__t = (`+K+`)) == null ? '' : __t) + +'`),p=Ge+L.length,L}),v+=`'; +`;var N=Q.call(n,"variable")&&n.variable;if(!N)v=`with (obj) { +`+v+` +} +`;else if(ta.test(N))throw new T(q);v=(c?v.replace(Fo,""):v).replace(jo,"$1").replace(zo,"$1;"),v="function("+(N||"obj")+`) { +`+(N?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(l?", __e = _.escape":"")+(c?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+v+`return __p +}`;var U=Oo(function(){return X(u,S+"return "+v).apply(o,a)});if(U.source=v,Hi(U))throw U;return U}function C0(e){return J(e).toLowerCase()}function N0(e){return J(e).toUpperCase()}function L0(e,n,t){if(e=J(e),e&&(t||n===o))return js(e);if(!e||!(n=Fe(n)))return e;var r=en(e),i=en(n),u=zs(r,i),a=Gs(r,i)+1;return Mn(r,u,a).join("")}function R0(e,n,t){if(e=J(e),e&&(t||n===o))return e.slice(0,$s(e)+1);if(!e||!(n=Fe(n)))return e;var r=en(e),i=Gs(r,en(n))+1;return Mn(r,0,i).join("")}function T0(e,n,t){if(e=J(e),e&&(t||n===o))return e.replace(Hr,"");if(!e||!(n=Fe(n)))return e;var r=en(e),i=zs(r,en(n));return Mn(r,i).join("")}function M0(e,n){var t=bn,r=Rr;if(ae(n)){var i="separator"in n?n.separator:i;t="length"in n?P(n.length):t,r="omission"in n?Fe(n.omission):r}e=J(e);var u=e.length;if(et(e)){var a=en(e);u=a.length}if(t>=u)return e;var l=t-nt(r);if(l<1)return r;var c=a?Mn(a,0,l).join(""):e.slice(0,l);if(i===o)return c+r;if(a&&(l+=c.length-l),qi(i)){if(e.slice(l).search(i)){var p,_=c;for(i.global||(i=li(i.source,J(ls.exec(i))+"g")),i.lastIndex=0;p=i.exec(_);)var v=p.index;c=c.slice(0,v===o?l:v)}}else if(e.indexOf(Fe(i),l)!=l){var y=c.lastIndexOf(i);y>-1&&(c=c.slice(0,y))}return c+r}function O0(e){return e=J(e),e&&Go.test(e)?e.replace(us,ol):e}var D0=at(function(e,n,t){return e+(t?" ":"")+n.toUpperCase()}),Xi=Ou("toUpperCase");function Mo(e,n,t){return e=J(e),n=t?o:n,n===o?tl(e)?fl(e):qa(e):e.match(n)||[]}var Oo=j(function(e,n){try{return Ue(e,o,n)}catch(t){return Hi(t)?t:new T(t)}}),P0=_n(function(e,n){return He(n,function(t){t=ln(t),gn(e,t,Ki(e[t],e))}),e});function k0(e){var n=e==null?0:e.length,t=C();return e=n?ue(e,function(r){if(typeof r[1]!="function")throw new qe(M);return[t(r[0]),r[1]]}):[],j(function(r){for(var i=-1;++ifn)return[];var t=ke,r=Ie(e,ke);n=C(n),e-=ke;for(var i=ui(r,n);++t0||n<0)?new G(t):(e<0?t=t.takeRight(-e):e&&(t=t.drop(e)),n!==o&&(n=P(n),t=n<0?t.dropRight(-n):t.take(n-e)),t)},G.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},G.prototype.toArray=function(){return this.take(ke)},on(G.prototype,function(e,n){var t=/^(?:filter|find|map|reject)|While$/.test(n),r=/^(?:head|last)$/.test(n),i=s[r?"take"+(n=="last"?"Right":""):n],u=r||/^find/.test(n);i&&(s.prototype[n]=function(){var a=this.__wrapped__,l=r?[1]:arguments,c=a instanceof G,p=l[0],_=c||O(a),v=function(z){var K=i.apply(s,In([z],l));return r&&y?K[0]:K};_&&t&&typeof p=="function"&&p.length!=1&&(c=_=!1);var y=this.__chain__,S=!!this.__actions__.length,N=u&&!y,U=c&&!S;if(!u&&_){a=U?a:new G(this);var L=e.apply(a,l);return L.__actions__.push({func:mr,args:[v],thisArg:o}),new Ze(L,y)}return N&&U?e.apply(this,l):(L=this.thru(v),N?r?L.value()[0]:L.value():L)})}),He(["pop","push","shift","sort","splice","unshift"],function(e){var n=Kt[e],t=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);s.prototype[e]=function(){var i=arguments;if(r&&!this.__chain__){var u=this.value();return n.apply(O(u)?u:[],i)}return this[t](function(a){return n.apply(O(a)?a:[],i)})}}),on(G.prototype,function(e,n){var t=s[n];if(t){var r=t.name+"";Q.call(st,r)||(st[r]=[]),st[r].push({name:n,func:t})}}),st[cr(o,le).name]=[{name:"wrapper",func:o}],G.prototype.clone=Ml,G.prototype.reverse=Ol,G.prototype.value=Dl,s.prototype.at=fh,s.prototype.chain=ch,s.prototype.commit=hh,s.prototype.next=dh,s.prototype.plant=ph,s.prototype.reverse=_h,s.prototype.toJSON=s.prototype.valueOf=s.prototype.value=vh,s.prototype.first=s.prototype.head,mt&&(s.prototype[mt]=gh),s},tt=cl();kn?((kn.exports=tt)._=tt,Qr._=tt):we._=tt}).call(Mt)})(Nr,Nr.exports);var Lr=Nr.exports;function ip(m=!0){I.useEffect(()=>{if(!m)return;const w=Lr.debounce(o=>{document.documentElement.style.setProperty("--mouse-x",`${o.clientX}px`),document.documentElement.style.setProperty("--mouse-y",`${o.clientY}px`)},16);return document.addEventListener("mousemove",w),()=>{w.cancel(),document.removeEventListener("mousemove",w)}},[m])}function sp(m={},w=!0){const[o,D]=I.useState(!1),[B,E]=I.useState({width:window.innerWidth/3,height:window.innerHeight,top:0});I.useCallback(Lr.debounce(q=>{o&&E(x=>{const $=window.innerWidth-q.clientX,k=Math.min(Math.max(m.minWidth||300,$),m.maxWidth||window.innerWidth*.8);return{...x,width:k}})},16),[o,m]);const M=I.useCallback(q=>{E(x=>{const $=x.height-q,k=x.top+q;return{...x,height:Math.min(Math.max(m.minHeight||300,$),m.maxHeight||window.innerHeight),top:Math.max(0,k)}})},[m]);return I.useEffect(()=>{if(!w||!o)return;const q=Lr.debounce($=>{E(k=>{const F=window.innerWidth-$.clientX,re=Math.min(Math.max(m.minWidth||300,F),m.maxWidth||window.innerWidth*.8);return{...k,width:re}})},16),x=()=>D(!1);return document.addEventListener("mousemove",q),document.addEventListener("mouseup",x),()=>{q.cancel(),document.removeEventListener("mousemove",q),document.removeEventListener("mouseup",x)}},[o,m,w]),{isResizing:o,setIsResizing:D,dimensions:B,handleHeightResize:M}}function up(m=!0){const{state:w,dispatch:o}=is(),{activeTab:D,screenState:B}=w;I.useEffect(()=>{if(!m)return;const E=M=>{const q=D==="parameter-debug",x=D==="chat",$=!B||B.currentScreen===0;if(x||$&&q){const k=sn.canvas.selected_nodes;if(Object.keys(k??{}).length){const F=Object.values(k);o({type:"SET_SELECTED_NODE",payload:F})}else o({type:"SET_SELECTED_NODE",payload:null})}};return document.addEventListener("click",E),()=>{document.removeEventListener("click",E)}},[o,m,D,B])}const op=({message:m,onClose:w})=>m?h.jsxs("div",{className:"bg-gradient-to-r from-amber-50 to-amber-100 border-b border-amber-200 px-5 py-2 mt-2 relative shadow-sm",children:[h.jsxs("div",{className:"flex items-center",children:[h.jsx("div",{className:"flex-shrink-0 mr-2",children:h.jsx("svg",{className:"w-3.5 h-3.5 text-amber-600",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})})}),h.jsx("div",{className:"text-amber-800 font-medium leading-relaxed pr-6 markdown-content",style:{fontSize:"11px"},children:h.jsx(Cg,{rehypePlugins:[[yg,{target:"_blank",rel:["noopener","noreferrer"]}]],remarkPlugins:[wg],className:"prose !text-[11px] prose-a:text-amber-700 prose-a:underline prose-a:font-medium hover:prose-a:text-amber-800",components:{a:({node:o,...D})=>h.jsx("a",{...D,className:"text-amber-700 underline hover:text-amber-800 transition-colors",style:{fontSize:"11px"}}),p:({children:o})=>h.jsx("span",{className:"inline",style:{fontSize:"11px"},children:o}),span:({children:o})=>h.jsx("span",{style:{fontSize:"11px"},children:o}),li:({children:o})=>h.jsx("li",{style:{fontSize:"11px"},children:o}),ul:({children:o})=>h.jsx("ul",{style:{fontSize:"11px"},children:o}),ol:({children:o})=>h.jsx("ol",{style:{fontSize:"11px"},children:o})},children:m})})]}),h.jsx("button",{onClick:w,className:"absolute right-2 top-1/2 -translate-y-1/2 text-amber-500 hover:text-amber-700 transition-colors p-1 rounded-full hover:bg-amber-200/50","aria-label":"Close announcement",children:h.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}):null,ap=()=>{const{state:m,dispatch:w}=is(),{selectedNode:o,screenState:D}=m,B=o||[],E=wn.lazy(()=>Dt(()=>import("./ParameterDebugInterfaceNew-D6FB8RLq.js"),__vite__mapDeps([4,1,2,3,5,6,7])).then(q=>({default:q.ParameterDebugInterface}))),M=()=>{w({type:"SET_SELECTED_NODE",payload:null}),w({type:"SET_SCREEN_STATE",payload:null})};return h.jsx("div",{className:"flex-1 flex flex-col overflow-y-auto",children:h.jsx(wn.Suspense,{fallback:h.jsx("div",{children:"Loading..."}),children:h.jsx(E,{selectedNodes:B,visible:!0,onClose:M})})})},Wo=({active:m,onClick:w,children:o})=>h.jsx("button",{onClick:w,className:`px-4 py-2 font-medium text-sm transition-colors duration-200 ${m?"text-blue-600 border-b-2 border-blue-600":"text-gray-600 hover:text-blue-500 hover:border-b-2 hover:border-blue-300"}`,children:o});function lp({onClose:m,visible:w=!0,triggerUsage:o=!1,onUsageTriggered:D}){const{state:B,dispatch:E}=is(),{messages:M,installedNodes:q,loading:x,sessionId:$,selectedNode:k,activeTab:F}=B,re=I.useRef(null),[ie,pe]=I.useState(""),[R,W]=I.useState(""),[le,he]=I.useState(window.innerWidth/3),[oe,Pe]=I.useState(!1),[fe,H]=I.useState([]),[Z,Se]=I.useState("gpt-4o-mini");I.useState(window.innerHeight),I.useState(0);const[_e,bn]=I.useState(""),[Rr,kt]=I.useState(!1);ip(w&&F==="chat"),up(w);const{isResizing:ss,setIsResizing:Wt,dimensions:dt,handleHeightResize:Tr}=sp({minWidth:300,maxWidth:window.innerWidth*.8,minHeight:300,maxHeight:window.innerHeight},w);I.useEffect(()=>{re.current&&(re.current.scrollTop=re.current.scrollHeight)},[M]),I.useEffect(()=>{if(F!=="chat")return;(async()=>{const Y=await rp();console.log("[WorkflowChat] Received installed nodes:",Y.length),E({type:"SET_INSTALLED_NODES",payload:Y})})()},[F]);const $n=async A=>{try{const Y=await Ot.fetchMessages(A);E({type:"SET_MESSAGES",payload:Y})}catch(Y){console.error("Error fetching messages:",Y)}};I.useEffect(()=>{if(F!=="chat")return;let A=localStorage.getItem("sessionId");A?(E({type:"SET_SESSION_ID",payload:A}),$n(A)):(A=Ve(),E({type:"SET_SESSION_ID",payload:A}),localStorage.setItem("sessionId",A))},[F]);const fn=wn.useCallback(A=>{if(!oe)return;const Y=window.innerWidth-A.clientX,ee=Math.min(Math.max(300,Y),window.innerWidth*.8);he(ee)},[oe]),Hn=wn.useMemo(()=>Lr.debounce(fn,16),[fn]);I.useEffect(()=>(oe&&(document.addEventListener("mousemove",Hn),document.addEventListener("mouseup",An)),()=>{document.removeEventListener("mousemove",Hn),document.removeEventListener("mouseup",An),Hn.cancel()}),[oe,Hn]);const qn=A=>{pe(A.target.value)},ke=async()=>{if(E({type:"SET_LOADING",payload:!0}),ie.trim()===""&&!k||!$)return;W(ie);const A=Ve(),Y={id:Ve(),role:"user",content:ie,trace_id:A};E({type:"ADD_MESSAGE",payload:Y}),pe("");try{const ee={type:"model_select",data:[Z]};let Ae=Ve(),un=!0;for await(const Ee of Ot.streamInvokeServer($,ie,fe.map(V=>V.file),null,ee,A)){const V={id:Ae,role:"ai",content:JSON.stringify(Ee),format:Ee.format,finished:Ee.finished,name:"Assistant"};if(un)E({type:"ADD_MESSAGE",payload:V}),un=!1;else{E({type:"UPDATE_MESSAGE",payload:V});const ve=B.messages.map(Ke=>Ke.id===V.id&&!Ke.finished?V:Ke);Zn(ve)}Ee.finished&&E({type:"SET_LOADING",payload:!1})}}catch(ee){console.error("Error sending message:",ee),E({type:"SET_LOADING",payload:!1})}finally{H([])}},Mr=async A=>{if(!$)return;E({type:"SET_LOADING",payload:!0}),W(A);const Y=Ve(),ee={id:Ve(),role:"user",content:A,trace_id:Y};E({type:"ADD_MESSAGE",payload:ee});try{const Ae={type:"model_select",data:[Z]};let un=Ve(),Ee=!0;for await(const V of Ot.streamInvokeServer($,A,fe.map(ve=>ve.file),null,Ae,Y)){const ve={id:un,role:"ai",content:JSON.stringify(V),format:V.format,finished:V.finished,name:"Assistant"};if(Ee)E({type:"ADD_MESSAGE",payload:ve}),Ee=!1;else{E({type:"UPDATE_MESSAGE",payload:ve});const Ke=B.messages.map(cn=>cn.id===ve.id&&!cn.finished?ve:cn);Zn(Ke)}V.finished&&E({type:"SET_LOADING",payload:!1})}}catch(Ae){console.error("Error sending message:",Ae),E({type:"SET_LOADING",payload:!1})}finally{H([])}},Or=A=>{A.metaKey&&A.key==="Enter"&&ke()},Dr=()=>{E({type:"CLEAR_MESSAGES"});const A=B.sessionId;A&&localStorage.removeItem(`messages_${A}`),localStorage.removeItem("sessionId");const Y=Ve();E({type:"SET_SESSION_ID",payload:Y}),localStorage.setItem("sessionId",Y)},Sn=A=>{pe(A)},Dn=async(A,Y)=>{if(!$||!k)return;E({type:"SET_LOADING",payload:!0});const ee=Ve(),Ae={id:Ve(),role:"user",content:k.comfyClass||k.type,trace_id:ee};E({type:"ADD_MESSAGE",payload:Ae});try{let un=Ve(),Ee=!0;for await(const V of Ot.streamInvokeServer($,k.comfyClass||k.type,[],A,Y,ee)){const ve={id:un,role:"ai",content:JSON.stringify(V),format:V.format,finished:V.finished,name:"Assistant"};if(A&&A!==""&&(ve.metadata={intent:A}),Ee)E({type:"ADD_MESSAGE",payload:ve}),Ee=!1;else{E({type:"UPDATE_MESSAGE",payload:ve});const Ke=B.messages.map(cn=>cn.id===ve.id&&!cn.finished?ve:cn);Zn(Ke)}V.finished&&E({type:"SET_LOADING",payload:!1})}}catch(un){console.error("Error sending message:",un),E({type:"SET_LOADING",payload:!1})}},Zn=A=>{B.sessionId&&localStorage.setItem(`messages_${B.sessionId}`,JSON.stringify(A))},Pn=A=>{console.log("[WorkflowChat] Adding new message:",A);const Y=[...B.messages,A];E({type:"ADD_MESSAGE",payload:A}),Zn(Y)},An=()=>{Pe(!1)},Pr=A=>{const Y=Array.from(A).map(ee=>({id:Math.random().toString(36).substr(2,9),file:ee,preview:URL.createObjectURL(ee)}));H(ee=>[...ee,...Y])},Yn=A=>{H(Y=>Y.filter(Ae=>Ae.id!==A))};wn.useEffect(()=>()=>{fe.forEach(A=>URL.revokeObjectURL(A.preview))},[fe]),I.useEffect(()=>{o&&D&&F==="chat"&&(Dn("node_explain"),D())},[o,F]),I.useEffect(()=>{if(!w||F!=="chat")return;(async()=>{try{const Y=new Date().toDateString();if(localStorage.getItem("announcementLastShownDate")!==Y){const Ae=await Ot.fetchAnnouncement();Ae&&Ae.trim()!==""&&(bn(Ae),kt(!0),localStorage.setItem("announcementLastShownDate",Y))}}catch(Y){console.error("Error fetching announcement:",Y)}})()},[w,F]);const Xn=()=>{kt(!1)},gt=A=>{E({type:"SET_ACTIVE_TAB",payload:A})},We=wn.useMemo(()=>h.jsx(ap,{}),[]);return h.jsxs("div",{className:"fixed right-0 shadow-lg bg-white duration-200 ease-out",style:{display:w?"block":"none",width:`${dt.width}px`,height:`${dt.height}px`,top:`${dt.top}px`},children:[h.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 cursor-ew-resize hover:bg-gray-300",onMouseDown:A=>{Wt(!0),A.preventDefault()}}),h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsx(Kg,{onClose:m,onClear:Dr,hasMessages:M.length>0,onHeightResize:Tr,title:"ComfyUI-Copilot"}),h.jsxs("div",{className:"flex border-b border-gray-200 mt-2",children:[h.jsx(Wo,{active:F==="chat",onClick:()=>gt("chat"),children:"Chat"}),h.jsx(Wo,{active:F==="parameter-debug",onClick:()=>gt("parameter-debug"),children:"GenLab"})]}),Rr&&_e&&F==="chat"&&h.jsx(op,{message:_e,onClose:Xn}),h.jsx("div",{className:"flex-1 overflow-y-auto p-4 scroll-smooth",style:{display:F==="chat"?"block":"none"},ref:re,children:h.jsx(np,{messages:M,latestInput:R,onOptionClick:Sn,installedNodes:q,onAddMessage:Pn,loading:x})}),h.jsxs("div",{className:"border-t px-4 py-3 border-gray-200 bg-white sticky bottom-0",style:{display:F==="chat"?"block":"none"},children:[k&&h.jsx(Zg,{nodeInfo:k,onSendWithIntent:Dn,loading:x,onSendWithContent:Mr}),h.jsx(Hg,{input:ie,loading:x,onChange:qn,onSend:ke,onKeyPress:Or,onUploadImages:Pr,uploadedImages:fe,onRemoveImage:Yn,selectedModel:Z,onModelChange:Se})]}),h.jsx("div",{className:"flex-1 flex flex-col",style:{display:F==="parameter-debug"?"flex":"none"},children:We})]})]})}const xp=Object.freeze(Object.defineProperty({__proto__:null,default:lp},Symbol.toStringTag,{value:"Module"}));export{mp as g,vp as i,_p as m,pp as r,xp as w}; diff --git a/dist/copilot_web/workflowChat-CnVi6gIQ.js b/dist/copilot_web/workflowChat-CnVi6gIQ.js deleted file mode 100644 index 0852bdd..0000000 --- a/dist/copilot_web/workflowChat-CnVi6gIQ.js +++ /dev/null @@ -1,130 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["copilot_web/WorkflowOption-BSTBilSm.js","copilot_web/vendor-markdown-Dek94WS0.js","copilot_web/vendor-react-V04_Axys.js","copilot_web/message-components-B6pkQvDp.js"])))=>i.map(i=>d[i]); -import{j as h,r as vg,b as mg}from"./vendor-markdown-Dek94WS0.js";import{r as S,R as at,c as Lt}from"./vendor-react-V04_Axys.js";import{f as xg,v as yg,a as sn,B as wg,U as bg,A as yr,b as Ag,g as Ve,c as Sg,u as To,M as Ig,W as Nt}from"./message-components-B6pkQvDp.js";import{l as Eg}from"./App-BjVABi7E.js";import{_ as Sr}from"./input.js";/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Cg=y=>y.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Do=(...y)=>y.filter((L,o,W)=>!!L&&L.trim()!==""&&W.indexOf(L)===o).join(" ").trim();/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var Lg={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ng=S.forwardRef(({color:y="currentColor",size:L=24,strokeWidth:o=2,absoluteStrokeWidth:W,className:z="",children:N,iconNode:O,...V},m)=>S.createElement("svg",{ref:m,...Lg,width:L,height:L,stroke:y,strokeWidth:W?Number(o)*24/Number(L):o,className:Do("lucide",z),...V},[...O.map(([H,B])=>S.createElement(H,B)),...Array.isArray(N)?N:[N]]));/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const lt=(y,L)=>{const o=S.forwardRef(({className:W,...z},N)=>S.createElement(Ng,{ref:N,iconNode:L,className:Do(`lucide-${Cg(y)}`,W),...z}));return o.displayName=`${y}`,o};/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Rg=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Mg=lt("Image",Rg);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Og=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Tg=lt("Plus",Og);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Dg=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Wg=lt("Send",Dg);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Pg=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],kg=lt("Settings",Pg);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ug=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]],Bg=lt("Trash",Ug);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Fg=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],wr=lt("X",Fg);function jg({isOpen:y,onClose:L,onSave:o,initialApiKey:W=""}){const[z,N]=S.useState(W),[O,V]=S.useState(!1),[m,H]=S.useState(""),[B,$]=S.useState("https://api.openai.com/v1"),[oe,ae]=S.useState(!1),[we,k]=S.useState(!1),[U,ue]=S.useState(null),[re,de]=S.useState(null);S.useEffect(()=>{N(W);const q=localStorage.getItem("openaiApiKey"),X=localStorage.getItem("openaiBaseUrl");q&&H(q),X&&$(X),(async()=>{try{const pe=localStorage.getItem("rsaPublicKey");if(pe)de(pe);else{const bn=await xg();de(bn),localStorage.setItem("rsaPublicKey",bn)}}catch(pe){console.error("Failed to fetch RSA public key:",pe)}})()},[W]);const Ae=async()=>{if(!m.trim()){ue({success:!1,message:"Please enter an OpenAI API key"});return}if(!re){ue({success:!1,message:"RSA public key not available. Please try again later."});return}k(!0),ue(null);try{const q=await yg(m,B,re);ue({success:q,message:q?"API key is valid!":"Invalid API key. Please check and try again."})}catch(q){ue({success:!1,message:q instanceof Error?q.message:"Failed to verify API key"})}finally{k(!1)}},fe=()=>{o(z),m.trim()?(localStorage.setItem("openaiApiKey",m),localStorage.setItem("openaiBaseUrl",B)):(localStorage.removeItem("openaiApiKey"),localStorage.removeItem("openaiBaseUrl")),L()};return y?h.jsx("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-sm flex items-center justify-center z-50",children:h.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl p-8 w-[480px] shadow-2xl",children:[h.jsx("h2",{className:"text-xl text-gray-900 dark:text-white font-semibold mb-6",children:"Set API Key"}),h.jsxs("div",{className:"mb-6",children:[h.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"ComfyUI Copilot API Key"}),h.jsxs("div",{className:"relative",children:[h.jsx("input",{type:O?"text":"password",value:z,onChange:q=>N(q.target.value),placeholder:"Enter your API key",className:`w-full px-4 py-3 border border-gray-200 dark:border-gray-600 rounded-lg mb-4 pr-12 - bg-gray-50 dark:bg-gray-700 - text-gray-900 dark:text-white - placeholder-gray-500 dark:placeholder-gray-400 - focus:border-blue-500 dark:focus:border-blue-400 - focus:ring-2 focus:ring-blue-500/20 dark:focus:ring-blue-400/20 - focus:outline-none`}),h.jsx("button",{type:"button",className:`absolute inset-y-0 right-0 pr-4 flex items-center text-gray-500 dark:text-gray-400 - hover:text-gray-700 dark:hover:text-gray-200 transition-colors bg-transparent border-none`,onClick:()=>V(!O),children:O?h.jsxs("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]}):h.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"})})})]}),h.jsxs("div",{className:"text-sm text-gray-600 dark:text-gray-300",children:[h.jsx("span",{children:"Don't have an API key? "}),h.jsx("a",{href:"https://form.typeform.com/to/tkg91K8D",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium",children:"Click here to request one"})]})]}),h.jsxs("div",{className:"mb-6 border-t border-gray-200 dark:border-gray-700 pt-6",children:[h.jsx("h3",{className:"text-sm text-gray-900 dark:text-white font-medium mb-4",children:"OpenAI API Configuration (Optional)"}),h.jsxs("div",{className:"mb-4",children:[h.jsx("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-2",children:"OpenAI API Key"}),h.jsxs("div",{className:"relative",children:[h.jsx("input",{type:oe?"text":"password",value:m,onChange:q=>H(q.target.value),placeholder:"Enter your OpenAI API key",className:`w-full px-4 py-3 border border-gray-200 dark:border-gray-600 rounded-lg pr-12 text-xs - bg-gray-50 dark:bg-gray-700 - text-gray-900 dark:text-white - placeholder-gray-500 dark:placeholder-gray-400 - focus:border-blue-500 dark:focus:border-blue-400 - focus:ring-2 focus:ring-blue-500/20 dark:focus:ring-blue-400/20 - focus:outline-none`}),h.jsx("button",{type:"button",className:`absolute inset-y-0 right-0 pr-4 flex items-center text-gray-500 dark:text-gray-400 - hover:text-gray-700 dark:hover:text-gray-200 transition-colors bg-transparent border-none`,onClick:()=>ae(!oe),children:oe?h.jsxs("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]}):h.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"})})})]})]}),h.jsxs("div",{className:"mb-4",children:[h.jsx("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-2",children:"OpenAI Base URL"}),h.jsx("input",{type:"text",value:B,onChange:q=>$(q.target.value),placeholder:"https://api.openai.com/v1",className:`w-full px-4 py-3 border border-gray-200 dark:border-gray-600 rounded-lg text-xs - bg-gray-50 dark:bg-gray-700 - text-gray-900 dark:text-white - placeholder-gray-500 dark:placeholder-gray-400 - focus:border-blue-500 dark:focus:border-blue-400 - focus:ring-2 focus:ring-blue-500/20 dark:focus:ring-blue-400/20 - focus:outline-none`})]}),h.jsx("div",{className:"flex items-center mb-2",children:h.jsx("button",{onClick:Ae,disabled:we||!m.trim(),className:`px-4 py-2 rounded-lg font-medium text-xs transition-colors ${we||!m.trim()?"bg-gray-300 dark:bg-gray-600 text-gray-500 dark:text-gray-400 cursor-not-allowed":"bg-blue-600 hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600 text-white"}`,children:we?h.jsxs("span",{className:"flex items-center",children:[h.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Verifying..."]}):"Verify"})}),U&&h.jsx("div",{className:`text-xs p-2 rounded-md ${U.success?"bg-green-50 dark:bg-green-900/20 text-green-700 dark:text-green-400":"bg-red-50 dark:bg-red-900/20 text-red-700 dark:text-red-400"}`,children:U.message})]}),h.jsxs("div",{className:"flex justify-end gap-3",children:[h.jsx("button",{onClick:L,className:`px-5 py-2.5 text-gray-700 bg-white dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 - rounded-lg font-medium transition-colors`,children:"Cancel"}),h.jsx("button",{onClick:fe,className:`px-5 py-2.5 bg-blue-600 hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600 - text-white rounded-lg font-medium transition-colors`,children:"Save"})]})]})}):null}function zg({onClose:y,onClear:L,hasMessages:o,onHeightResize:W}){const[z,N]=S.useState(!1),[O,V]=S.useState(!1),m=()=>{N(!0)},H=$=>{localStorage.setItem("chatApiKey",$)},B=$=>{V(!0),$.preventDefault()};return S.useEffect(()=>{const $=ae=>{if(!O)return;const we=ae.movementY;W?.(we)},oe=()=>{V(!1)};return O&&(document.addEventListener("mousemove",$),document.addEventListener("mouseup",oe)),()=>{document.removeEventListener("mousemove",$),document.removeEventListener("mouseup",oe)}},[O,W]),h.jsxs(h.Fragment,{children:[h.jsx("div",{className:`absolute top-0 left-0 right-0 h-2 bg-gray-100 hover:bg-gray-300 - transition-colors duration-200 cursor-ns-resize z-20`,onMouseDown:B,style:{borderBottom:"1px solid #e5e7eb"}}),h.jsxs("div",{className:`flex items-center justify-between border-b px-4 py-3 - bg-white border-gray-200 sticky top-2 z-10`,children:[h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("img",{src:Eg,alt:"ComfyUI-Copilot Logo",className:"h-12 w-12 -ml-2"}),h.jsx("h3",{className:"text-[16px] font-medium text-gray-800",children:"ComfyUI-Copilot"}),h.jsx("button",{onClick:m,className:"p-1 bg-white border-none hover:bg-gray-100 rounded text-gray-500",children:h.jsx(kg,{className:"h-5 w-5"})})]}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("button",{className:`inline-flex bg-white border-none items-center justify-center rounded-md p-2 - text-gray-500 hover:bg-gray-100`,disabled:!o,onClick:L,children:h.jsx(Bg,{className:"h-5 w-5"})}),h.jsx("button",{className:`inline-flex bg-white border-none items-center justify-center rounded-md p-2 - text-gray-500 hover:bg-gray-100`,onClick:y,children:h.jsx(wr,{className:"h-5 w-5"})})]})]}),h.jsx(jg,{isOpen:z,onClose:()=>N(!1),onSave:H,initialApiKey:localStorage.getItem("chatApiKey")||""})]})}const Gg=5*1024*1024,Oo=["image/jpeg","image/png","image/gif","image/webp"];function Kg({input:y,loading:L,onChange:o,onSend:W,onKeyPress:z,onUploadImages:N,uploadedImages:O,onRemoveImage:V,selectedModel:m,onModelChange:H}){const[B,$]=S.useState(!1),oe=at.useRef(null),ae=S.useRef(null);S.useEffect(()=>{ae.current&&(ae.current.style.height="auto",ae.current.style.height=`${Math.min(ae.current.scrollHeight,400)}px`)},[y]);const we=k=>{if(k.target.files){const U=[],ue=[];if(Array.from(k.target.files).forEach(re=>{Oo.includes(re.type)?re.size>Gg?U.push(`${re.name} (exceeds 5MB)`):ue.push(re):U.push(`${re.name} (unsupported format)`)}),U.length>0&&alert(`The following files couldn't be uploaded: -${U.join(` -`)}`),ue.length>0){const re=new DataTransfer;ue.forEach(de=>re.items.add(de)),N(re.files)}}};return h.jsxs("div",{className:`relative ${O.length>0?"mt-12":""}`,children:[O.length>0&&h.jsx("div",{className:"absolute -top-10 left-0 flex gap-2",children:O.map(k=>h.jsxs("div",{className:"relative group",children:[h.jsx("img",{src:k.preview,alt:"uploaded",className:"w-8 h-8 rounded object-cover"}),h.jsx("button",{onClick:()=>V(k.id),className:`absolute -top-1 -right-1 bg-white border-none text-gray-500 rounded-full p-0.5 - opacity-0 group-hover:opacity-100 transition-opacity`,children:h.jsx(wr,{className:"w-3 h-3"})})]},k.id))}),h.jsx("textarea",{ref:ae,onChange:o,onKeyDown:k=>{if(k.key==="Enter"&&!k.shiftKey){if(k.nativeEvent.isComposing)return;k.preventDefault(),W()}z(k)},value:y,placeholder:"Type your message...",className:`w-full min-h-[80px] max-h-[400px] resize-none rounded-md border - border-gray-200 px-3 py-2 pr-12 pb-10 text-[14px] shadow-sm - focus:outline-none focus:ring-2 focus:ring-blue-500 - focus:border-transparent bg-white transition-all - duration-200 text-gray-700 overflow-y-auto`,style:{height:"80px"}}),h.jsxs("div",{className:`absolute bottom-2 left-3 right-12 flex items-center gap-2 - bg-white border-t border-gray-100 pt-1`,children:[h.jsxs("select",{value:m,onChange:k=>H(k.target.value),className:`px-1.5 py-0.5 text-xs rounded-md - border border-gray-200 bg-white text-gray-700 - focus:outline-none focus:ring-2 focus:ring-blue-500 - focus:border-transparent hover:bg-gray-50 - transition-colors border-0`,children:[h.jsx("option",{value:"gpt-4o-mini",children:"gpt-4o-mini"}),h.jsx("option",{value:"gpt-4o",children:"gpt-4o"}),h.jsx("option",{value:"qwen-plus",children:"qwen-plus"}),h.jsx("option",{value:"DeepSeek-V3",children:"DeepSeek-V3"})]}),h.jsx("button",{type:"button",onClick:()=>$(!0),className:`p-1.5 text-gray-500 bg-white border-none - hover:bg-gray-100 hover:text-gray-600 - transition-all duration-200 outline-none`,children:h.jsx(Mg,{className:"h-4 w-4"})})]}),h.jsx("button",{type:"submit",onClick:W,disabled:L,className:`absolute bottom-3 right-3 p-2 rounded-md text-gray-500 bg-white border-none - hover:bg-gray-100 hover:text-gray-600 disabled:opacity-50 - transition-all duration-200 active:scale-95`,children:L?h.jsx("div",{className:`h-5 w-5 animate-spin rounded-full - border-2 border-gray-300 border-t-blue-500`}):h.jsx(Wg,{className:"h-5 w-5 group-hover:translate-x-1"})}),B&&h.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:h.jsxs("div",{className:"bg-white rounded-lg p-6 w-96 relative",children:[h.jsx("button",{onClick:()=>$(!1),className:"absolute top-2 right-2 bg-white border-none text-gray-500 hover:text-gray-700",children:h.jsx(wr,{className:"w-5 h-5"})}),h.jsx("h3",{className:"text-lg text-gray-800 font-medium mb-4",children:"Upload Images"}),h.jsxs("div",{className:`border-2 border-dashed border-gray-300 rounded-lg p-8 - flex flex-col items-center justify-center gap-4 - hover:border-blue-500 transition-colors cursor-pointer`,onClick:()=>oe.current?.click(),children:[h.jsx(Tg,{className:"w-8 h-8 text-gray-400"}),h.jsxs("div",{className:"text-center",children:[h.jsx("p",{className:"text-sm text-gray-500 mb-2",children:"Click to upload images or drag and drop"}),h.jsx("p",{className:"text-xs text-gray-400",children:"Supported formats: JPG, PNG, GIF, WebP"}),h.jsx("p",{className:"text-xs text-gray-400",children:"Max file size: 5MB"})]})]}),h.jsx("input",{ref:oe,type:"file",multiple:!0,accept:Oo.join(","),onChange:we,className:"hidden"}),O.length>0&&h.jsx("div",{className:"mt-4 grid grid-cols-3 gap-2",children:O.map(k=>h.jsxs("div",{className:"relative group",children:[h.jsx("img",{src:k.preview,alt:"preview",className:"w-full h-20 object-cover rounded"}),h.jsx("button",{onClick:()=>V(k.id),className:`absolute -top-1 -right-1 bg-white border-none text-gray-500 - rounded-full p-0.5 opacity-0 group-hover:opacity-100 - transition-opacity`,children:h.jsx(wr,{className:"w-3 h-3"})})]},k.id))}),h.jsx("div",{className:"mt-4 flex justify-end gap-2",children:h.jsx("button",{onClick:()=>$(!1),className:`px-4 py-2 text-sm font-medium text-gray-700 - bg-white border border-gray-300 rounded-md - hover:bg-gray-50`,children:"Close"})})]})})]})}function Hg(){const y=Object.values(sn.canvas.selected_nodes)[0],L=new Set;function o(W,z){if(!(!W||z>=1)&&W.inputs)for(const N of Object.values(W.inputs)){const O=N.link;if(O&&sn.graph.links[O]){const V=sn.graph.links[O].origin_id,m=sn.graph._nodes_by_id[V];m&&(L.add(m.type),o(m,z+1))}}}return y?(o(y,0),[{type:"upstream_node_types",data:Array.from(L)}]):null}function $g({nodeInfo:y,onSendWithIntent:L,loading:o,onSendWithContent:W}){return h.jsx("div",{className:"mb-3 p-3 rounded-md bg-gray-50 border border-gray-200",children:h.jsxs("div",{className:"text-sm text-gray-700",children:[h.jsxs("p",{children:["Selected node: ",y.type]}),h.jsxs("div",{className:"flex gap-2 mt-2",children:[h.jsx("button",{className:`px-3 py-1 text-xs rounded-md bg-blue-50 - text-blue-700 hover:bg-blue-100`,onClick:()=>W(`Reply in ${navigator.language} language: How does the ${y.type} node work? I need its official usage guide.`),disabled:o,children:"Usage"}),h.jsx("button",{className:`px-3 py-1 text-xs rounded-md bg-green-100 - text-green-700 hover:bg-green-200`,onClick:()=>W(`Reply in ${navigator.language} language: Show me the technical specifications for the ${y.type} node's inputs and outputs.`),disabled:o,children:"Parameters"}),h.jsx("button",{className:`px-3 py-1 text-xs rounded-md bg-purple-100 - text-purple-700 hover:bg-purple-200`,onClick:()=>L("downstream_subgraph_search",Hg()),disabled:o,children:"Downstream Nodes"})]})]})})}function qg(){return h.jsx(wg,{name:"Assistant",children:h.jsxs("div",{className:"flex items-center space-x-2 p-4 bg-gray-50 rounded-lg",children:[h.jsxs("div",{className:"flex space-x-1",children:[h.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),h.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),h.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]}),h.jsx("span",{className:"text-sm text-gray-500",children:"AI is thinking..."})]})})}const Zg=y=>`https://ui-avatars.com/api/?name=${y||"User"}&background=random`,Yg=S.lazy(()=>Sr(()=>import("./WorkflowOption-BSTBilSm.js"),__vite__mapDeps([0,1,2,3])).then(y=>({default:y.WorkflowOption}))),Xg=S.lazy(()=>Sr(()=>import("./message-components-B6pkQvDp.js").then(y=>y.N),__vite__mapDeps([3,2,1])).then(y=>({default:y.NodeSearch}))),Jg=S.lazy(()=>Sr(()=>import("./message-components-B6pkQvDp.js").then(y=>y.D),__vite__mapDeps([3,2,1])).then(y=>({default:y.DownstreamSubgraphs}))),Qg=S.lazy(()=>Sr(()=>import("./message-components-B6pkQvDp.js").then(y=>y.d),__vite__mapDeps([3,2,1])).then(y=>({default:y.NodeInstallGuide})));function Vg({messages:y,latestInput:L,onOptionClick:o,installedNodes:W,onAddMessage:z,loading:N}){const O=at.useMemo(()=>m=>{if(m.role==="user")return h.jsx(bg,{content:m.content,trace_id:m.trace_id},m.id);if(m.role==="ai"||m.role==="tool"){const H=Zg(m.role);try{const B=JSON.parse(m.content),$=B.ext?.find(U=>U.type==="workflow"),oe=B.ext?.find(U=>U.type==="node"),ae=B.ext?.find(U=>U.type==="downstream_subgraph_search"),we=B.ext?.find(U=>U.type==="node_install_guide");let k=null;if($)k=h.jsx(S.Suspense,{fallback:h.jsx("div",{children:"Loading..."}),children:h.jsx(Yg,{content:m.content,name:m.name,avatar:H,latestInput:L,installedNodes:W,onAddMessage:z})});else if(oe)k=h.jsx(S.Suspense,{fallback:h.jsx("div",{children:"Loading..."}),children:h.jsx(Xg,{content:m.content,name:m.name,avatar:H,installedNodes:W})});else if(ae){const U=h.jsx(S.Suspense,{fallback:h.jsx("div",{children:"Loading..."}),children:h.jsx(Jg,{content:m.content,name:m.name,avatar:H,onAddMessage:z})});if(m.metadata?.intent==="downstream_subgraph_search")return h.jsx(yr,{content:m.content,name:m.name,avatar:H,format:m.format,onOptionClick:o,extComponent:U,metadata:m.metadata},m.id);k=U}else we&&(k=h.jsx(S.Suspense,{fallback:h.jsx("div",{children:"Loading..."}),children:h.jsx(Qg,{content:m.content,onLoadSubgraph:()=>{if(m.metadata?.pendingSubgraph){const U=Object.values(sn.canvas.selected_nodes)[0];if(U){const ue=m.metadata.pendingSubgraph,re=ue.json.nodes,de=ue.json.links,Ae=re.find(X=>X.id===0),fe=Ae?.id,q={};fe&&(q[fe]=U),sn.canvas.emitBeforeChange();try{for(const X of re)if(X.id!==fe){const Se=Ae?.pos||[0,0],pe=U._pos||[0,0],bn=[X.pos[0]+pe[0]-Se[0],X.pos[1]+pe[1]-Se[1]];q[X.id]=Ag(X.type,{pos:bn})}}finally{sn.canvas.emitAfterChange()}for(const X of de){const Se=q[X.origin_id],pe=q[X.target_id];Se&&pe&&Se.connect(X.origin_slot,pe,X.target_slot)}}else alert("Please select a upstream node first before adding a subgraph.")}else if(m.metadata?.pendingWorkflow){const U=m.metadata.pendingWorkflow,ue=m.metadata.optimizedParams;sn.loadGraphData(U);for(const[de,Ae,fe,q,X]of ue){const Se=sn.graph._nodes_by_id[de].widgets;for(const pe of Se)pe.name===q&&(pe.value=X)}sn.graph.setDirtyCanvas(!1,!0);const re={id:Ve(),role:"tool",content:JSON.stringify({text:"The workflow has been successfully loaded to the canvas",ext:[]}),format:"markdown",name:"Assistant"};z?.(re)}}})}));return B.text||k?h.jsx(yr,{content:m.content,name:m.name,avatar:H,format:m.format,onOptionClick:o,extComponent:k,metadata:m.metadata},m.id):k||h.jsx(yr,{content:m.content,name:m.name,avatar:H,format:m.format,onOptionClick:o,metadata:m.metadata},m.id)}catch(B){return console.error("[MessageList] Error parsing message content:",B),console.error("解析JSON失败",m.content),h.jsx(yr,{content:m.content,name:m.name,avatar:H,format:m.format,onOptionClick:o,metadata:m.metadata},m.id)}}return null},[W,o,z,L]),V=at.useMemo(()=>y?.map(O),[y,O]);return h.jsxs("div",{className:"flex flex-col gap-4 w-full",children:[V,N&&h.jsx(qg,{})]})}async function ep(){try{return await(await Sg.fetchApi("/object_info",{method:"GET"})).json()}catch(y){throw console.error("Error fetching object info:",y),y}}async function np(){const y=await ep();return Object.keys(y)}var br={exports:{}};/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */br.exports;(function(y,L){(function(){var o,W="4.17.21",z=200,N="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",O="Expected a function",V="Invalid `variable` option passed into `_.template`",m="__lodash_hash_undefined__",H=500,B="__lodash_placeholder__",$=1,oe=2,ae=4,we=1,k=2,U=1,ue=2,re=4,de=8,Ae=16,fe=32,q=64,X=128,Se=256,pe=512,bn=30,Rt="...",nu=800,Ir=16,Hn=1,Er=2,Cr=3,Tn=1/0,en=9007199254740991,Lr=17976931348623157e292,Dn=NaN,Ke=4294967295,Nr=Ke-1,Rr=Ke>>>1,Mr=[["ary",X],["bind",U],["bindKey",ue],["curry",de],["curryRight",Ae],["flip",pe],["partial",fe],["partialRight",q],["rearg",Se]],cn="[object Arguments]",hn="[object Array]",Or="[object AsyncFunction]",An="[object Boolean]",Wn="[object Date]",Tr="[object DOMException]",$n="[object Error]",A="[object Function]",K="[object GeneratorFunction]",J="[object Map]",_e="[object Number]",on="[object Null]",ge="[object Object]",ve="[object Promise]",Ce="[object Proxy]",ke="[object RegExp]",me="[object Set]",ft="[object String]",Mt="[object Symbol]",Wo="[object Undefined]",ct="[object WeakMap]",Po="[object WeakSet]",ht="[object ArrayBuffer]",qn="[object DataView]",Dr="[object Float32Array]",Wr="[object Float64Array]",Pr="[object Int8Array]",kr="[object Int16Array]",Ur="[object Int32Array]",Br="[object Uint8Array]",Fr="[object Uint8ClampedArray]",jr="[object Uint16Array]",zr="[object Uint32Array]",ko=/\b__p \+= '';/g,Uo=/\b(__p \+=) '' \+/g,Bo=/(__e\(.*?\)|\b__t\)) \+\n'';/g,tu=/&(?:amp|lt|gt|quot|#39);/g,ru=/[&<>"']/g,Fo=RegExp(tu.source),jo=RegExp(ru.source),zo=/<%-([\s\S]+?)%>/g,Go=/<%([\s\S]+?)%>/g,iu=/<%=([\s\S]+?)%>/g,Ko=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ho=/^\w*$/,$o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Gr=/[\\^$.*+?()[\]{}|]/g,qo=RegExp(Gr.source),Kr=/^\s+/,Zo=/\s/,Yo=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Xo=/\{\n\/\* \[wrapped with (.+)\] \*/,Jo=/,? & /,Qo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Vo=/[()=,{}\[\]\/\s]/,ea=/\\(\\)?/g,na=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,uu=/\w*$/,ta=/^[-+]0x[0-9a-f]+$/i,ra=/^0b[01]+$/i,ia=/^\[object .+?Constructor\]$/,ua=/^0o[0-7]+$/i,sa=/^(?:0|[1-9]\d*)$/,oa=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ot=/($^)/,aa=/['\n\r\u2028\u2029\\]/g,Tt="\\ud800-\\udfff",la="\\u0300-\\u036f",fa="\\ufe20-\\ufe2f",ca="\\u20d0-\\u20ff",su=la+fa+ca,ou="\\u2700-\\u27bf",au="a-z\\xdf-\\xf6\\xf8-\\xff",ha="\\xac\\xb1\\xd7\\xf7",da="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ga="\\u2000-\\u206f",pa=" \\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",lu="A-Z\\xc0-\\xd6\\xd8-\\xde",fu="\\ufe0e\\ufe0f",cu=ha+da+ga+pa,Hr="['’]",_a="["+Tt+"]",hu="["+cu+"]",Dt="["+su+"]",du="\\d+",va="["+ou+"]",gu="["+au+"]",pu="[^"+Tt+cu+du+ou+au+lu+"]",$r="\\ud83c[\\udffb-\\udfff]",ma="(?:"+Dt+"|"+$r+")",_u="[^"+Tt+"]",qr="(?:\\ud83c[\\udde6-\\uddff]){2}",Zr="[\\ud800-\\udbff][\\udc00-\\udfff]",Zn="["+lu+"]",vu="\\u200d",mu="(?:"+gu+"|"+pu+")",xa="(?:"+Zn+"|"+pu+")",xu="(?:"+Hr+"(?:d|ll|m|re|s|t|ve))?",yu="(?:"+Hr+"(?:D|LL|M|RE|S|T|VE))?",wu=ma+"?",bu="["+fu+"]?",ya="(?:"+vu+"(?:"+[_u,qr,Zr].join("|")+")"+bu+wu+")*",wa="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ba="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Au=bu+wu+ya,Aa="(?:"+[va,qr,Zr].join("|")+")"+Au,Sa="(?:"+[_u+Dt+"?",Dt,qr,Zr,_a].join("|")+")",Ia=RegExp(Hr,"g"),Ea=RegExp(Dt,"g"),Yr=RegExp($r+"(?="+$r+")|"+Sa+Au,"g"),Ca=RegExp([Zn+"?"+gu+"+"+xu+"(?="+[hu,Zn,"$"].join("|")+")",xa+"+"+yu+"(?="+[hu,Zn+mu,"$"].join("|")+")",Zn+"?"+mu+"+"+xu,Zn+"+"+yu,ba,wa,du,Aa].join("|"),"g"),La=RegExp("["+vu+Tt+su+fu+"]"),Na=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ra=["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"],Ma=-1,te={};te[Dr]=te[Wr]=te[Pr]=te[kr]=te[Ur]=te[Br]=te[Fr]=te[jr]=te[zr]=!0,te[cn]=te[hn]=te[ht]=te[An]=te[qn]=te[Wn]=te[$n]=te[A]=te[J]=te[_e]=te[ge]=te[ke]=te[me]=te[ft]=te[ct]=!1;var ne={};ne[cn]=ne[hn]=ne[ht]=ne[qn]=ne[An]=ne[Wn]=ne[Dr]=ne[Wr]=ne[Pr]=ne[kr]=ne[Ur]=ne[J]=ne[_e]=ne[ge]=ne[ke]=ne[me]=ne[ft]=ne[Mt]=ne[Br]=ne[Fr]=ne[jr]=ne[zr]=!0,ne[$n]=ne[A]=ne[ct]=!1;var Oa={À:"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"},Ta={"&":"&","<":"<",">":">",'"':""","'":"'"},Da={"&":"&","<":"<",">":">",""":'"',"'":"'"},Wa={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Pa=parseFloat,ka=parseInt,Su=typeof Lt=="object"&&Lt&&Lt.Object===Object&&Lt,Ua=typeof self=="object"&&self&&self.Object===Object&&self,Ie=Su||Ua||Function("return this")(),Xr=L&&!L.nodeType&&L,Pn=Xr&&!0&&y&&!y.nodeType&&y,Iu=Pn&&Pn.exports===Xr,Jr=Iu&&Su.process,He=function(){try{var f=Pn&&Pn.require&&Pn.require("util").types;return f||Jr&&Jr.binding&&Jr.binding("util")}catch{}}(),Eu=He&&He.isArrayBuffer,Cu=He&&He.isDate,Lu=He&&He.isMap,Nu=He&&He.isRegExp,Ru=He&&He.isSet,Mu=He&&He.isTypedArray;function Ue(f,g,d){switch(d.length){case 0:return f.call(g);case 1:return f.call(g,d[0]);case 2:return f.call(g,d[0],d[1]);case 3:return f.call(g,d[0],d[1],d[2])}return f.apply(g,d)}function Ba(f,g,d,w){for(var R=-1,Z=f==null?0:f.length;++R-1}function Qr(f,g,d){for(var w=-1,R=f==null?0:f.length;++w-1;);return d}function Bu(f,g){for(var d=f.length;d--&&Yn(g,f[d],0)>-1;);return d}function Za(f,g){for(var d=f.length,w=0;d--;)f[d]===g&&++w;return w}var Ya=ti(Oa),Xa=ti(Ta);function Ja(f){return"\\"+Wa[f]}function Qa(f,g){return f==null?o:f[g]}function Xn(f){return La.test(f)}function Va(f){return Na.test(f)}function el(f){for(var g,d=[];!(g=f.next()).done;)d.push(g.value);return d}function si(f){var g=-1,d=Array(f.size);return f.forEach(function(w,R){d[++g]=[R,w]}),d}function Fu(f,g){return function(d){return f(g(d))}}function En(f,g){for(var d=-1,w=f.length,R=0,Z=[];++d-1}function jl(e,n){var t=this.__data__,r=Qt(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this}dn.prototype.clear=kl,dn.prototype.delete=Ul,dn.prototype.get=Bl,dn.prototype.has=Fl,dn.prototype.set=jl;function gn(e){var n=-1,t=e==null?0:e.length;for(this.clear();++n=n?e:n)),e}function Ye(e,n,t,r,i,s){var a,l=n&$,c=n&oe,p=n&ae;if(t&&(a=i?t(e,r,i,s):t(e)),a!==o)return a;if(!se(e))return e;var _=M(e);if(_){if(a=$f(e),!l)return Te(e,a)}else{var v=Ne(e),x=v==A||v==K;if(On(e))return bs(e,l);if(v==ge||v==cn||x&&!i){if(a=c||x?{}:js(e),!l)return c?Wf(e,rf(a,e)):Df(e,Qu(a,e))}else{if(!ne[v])return i?e:{};a=qf(e,v,l)}}s||(s=new tn);var b=s.get(e);if(b)return b;s.set(e,a),vo(e)?e.forEach(function(C){a.add(Ye(C,n,t,C,e,s))}):po(e)&&e.forEach(function(C,F){a.set(F,Ye(C,n,t,F,e,s))});var E=p?c?Oi:Mi:c?We:be,D=_?o:E(e);return $e(D||e,function(C,F){D&&(F=C,C=e[F]),xt(a,F,Ye(C,n,t,F,e,s))}),a}function uf(e){var n=be(e);return function(t){return Vu(t,e,n)}}function Vu(e,n,t){var r=t.length;if(e==null)return!r;for(e=ee(e);r--;){var i=t[r],s=n[i],a=e[i];if(a===o&&!(i in e)||!s(a))return!1}return!0}function es(e,n,t){if(typeof e!="function")throw new qe(O);return Et(function(){e.apply(o,t)},n)}function yt(e,n,t,r){var i=-1,s=Wt,a=!0,l=e.length,c=[],p=n.length;if(!l)return c;t&&(n=ie(n,Be(t))),r?(s=Qr,a=!1):n.length>=z&&(s=dt,a=!1,n=new Bn(n));e:for(;++ii?0:i+t),r=r===o||r>i?i:T(r),r<0&&(r+=i),r=t>r?0:xo(r);t0&&t(l)?n>1?Ee(l,n-1,t,r,i):In(i,l):r||(i[i.length]=l)}return i}var di=Ls(),rs=Ls(!0);function an(e,n){return e&&di(e,n,be)}function gi(e,n){return e&&rs(e,n,be)}function er(e,n){return Sn(n,function(t){return xn(e[t])})}function jn(e,n){n=Rn(n,e);for(var t=0,r=n.length;e!=null&&tn}function af(e,n){return e!=null&&Q.call(e,n)}function lf(e,n){return e!=null&&n in ee(e)}function ff(e,n,t){return e>=Le(n,t)&&e=120&&_.length>=120)?new Bn(a&&_):o}_=e[0];var v=-1,x=l[0];e:for(;++v-1;)l!==e&&Ht.call(l,c,1),Ht.call(e,c,1);return e}function gs(e,n){for(var t=e?n.length:0,r=t-1;t--;){var i=n[t];if(t==r||i!==s){var s=i;mn(i)?Ht.call(e,i,1):Si(e,i)}}return e}function wi(e,n){return e+Zt(Zu()*(n-e+1))}function Af(e,n,t,r){for(var i=-1,s=ye(qt((n-e)/(t||1)),0),a=d(s);s--;)a[r?s:++i]=e,e+=t;return a}function bi(e,n){var t="";if(!e||n<1||n>en)return t;do n%2&&(t+=e),n=Zt(n/2),n&&(e+=e);while(n);return t}function P(e,n){return Bi(Ks(e,n,Pe),e+"")}function Sf(e){return Ju(ot(e))}function If(e,n){var t=ot(e);return cr(t,Fn(n,0,t.length))}function At(e,n,t,r){if(!se(e))return e;n=Rn(n,e);for(var i=-1,s=n.length,a=s-1,l=e;l!=null&&++ii?0:i+n),t=t>i?i:t,t<0&&(t+=i),i=n>t?0:t-n>>>0,n>>>=0;for(var s=d(i);++r>>1,a=e[s];a!==null&&!je(a)&&(t?a<=n:a=z){var p=n?null:Bf(e);if(p)return kt(p);a=!1,i=dt,c=new Bn}else c=n?[]:l;e:for(;++r=r?e:Xe(e,n,t)}var ws=pl||function(e){return Ie.clearTimeout(e)};function bs(e,n){if(n)return e.slice();var t=e.length,r=Gu?Gu(t):new e.constructor(t);return e.copy(r),r}function Li(e){var n=new e.constructor(e.byteLength);return new Gt(n).set(new Gt(e)),n}function Rf(e,n){var t=n?Li(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}function Mf(e){var n=new e.constructor(e.source,uu.exec(e));return n.lastIndex=e.lastIndex,n}function Of(e){return mt?ee(mt.call(e)):{}}function As(e,n){var t=n?Li(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}function Ss(e,n){if(e!==n){var t=e!==o,r=e===null,i=e===e,s=je(e),a=n!==o,l=n===null,c=n===n,p=je(n);if(!l&&!p&&!s&&e>n||s&&a&&c&&!l&&!p||r&&a&&c||!t&&c||!i)return 1;if(!r&&!s&&!p&&e=l)return c;var p=t[r];return c*(p=="desc"?-1:1)}}return e.index-n.index}function Is(e,n,t,r){for(var i=-1,s=e.length,a=t.length,l=-1,c=n.length,p=ye(s-a,0),_=d(c+p),v=!r;++l1?t[i-1]:o,a=i>2?t[2]:o;for(s=e.length>3&&typeof s=="function"?(i--,s):o,a&&Me(t[0],t[1],a)&&(s=i<3?o:s,i=1),n=ee(n);++r-1?i[s?n[a]:a]:o}}function Ms(e){return vn(function(n){var t=n.length,r=t,i=Ze.prototype.thru;for(e&&n.reverse();r--;){var s=n[r];if(typeof s!="function")throw new qe(O);if(i&&!a&&lr(s)=="wrapper")var a=new Ze([],!0)}for(r=a?r:t;++r1&&G.reverse(),_&&cl))return!1;var p=s.get(e),_=s.get(n);if(p&&_)return p==n&&_==e;var v=-1,x=!0,b=t&k?new Bn:o;for(s.set(e,n),s.set(n,e);++v1?"& ":"")+n[r],n=n.join(t>2?", ":" "),e.replace(Yo,`{ -/* [wrapped with `+n+`] */ -`)}function Yf(e){return M(e)||Kn(e)||!!($u&&e&&e[$u])}function mn(e,n){var t=typeof e;return n=n??en,!!n&&(t=="number"||t!="symbol"&&sa.test(e))&&e>-1&&e%1==0&&e0){if(++n>=nu)return arguments[0]}else n=0;return e.apply(o,arguments)}}function cr(e,n){var t=-1,r=e.length,i=r-1;for(n=n===o?r:n;++t1?e[n-1]:o;return t=typeof t=="function"?(e.pop(),t):o,to(e,t)});function ro(e){var n=u(e);return n.__chain__=!0,n}function sh(e,n){return n(e),e}function hr(e,n){return n(e)}var oh=vn(function(e){var n=e.length,t=n?e[0]:0,r=this.__wrapped__,i=function(s){return hi(s,e)};return n>1||this.__actions__.length||!(r instanceof j)||!mn(t)?this.thru(i):(r=r.slice(t,+t+(n?1:0)),r.__actions__.push({func:hr,args:[i],thisArg:o}),new Ze(r,this.__chain__).thru(function(s){return n&&!s.length&&s.push(o),s}))});function ah(){return ro(this)}function lh(){return new Ze(this.value(),this.__chain__)}function fh(){this.__values__===o&&(this.__values__=mo(this.value()));var e=this.__index__>=this.__values__.length,n=e?o:this.__values__[this.__index__++];return{done:e,value:n}}function ch(){return this}function hh(e){for(var n,t=this;t instanceof Jt;){var r=Xs(t);r.__index__=0,r.__values__=o,n?i.__wrapped__=r:n=r;var i=r;t=t.__wrapped__}return i.__wrapped__=e,n}function dh(){var e=this.__wrapped__;if(e instanceof j){var n=e;return this.__actions__.length&&(n=new j(this)),n=n.reverse(),n.__actions__.push({func:hr,args:[Fi],thisArg:o}),new Ze(n,this.__chain__)}return this.thru(Fi)}function gh(){return xs(this.__wrapped__,this.__actions__)}var ph=ir(function(e,n,t){Q.call(e,t)?++e[t]:pn(e,t,1)});function _h(e,n,t){var r=M(e)?Ou:sf;return t&&Me(e,n,t)&&(n=o),r(e,I(n,3))}function vh(e,n){var t=M(e)?Sn:ts;return t(e,I(n,3))}var mh=Rs(Js),xh=Rs(Qs);function yh(e,n){return Ee(dr(e,n),1)}function wh(e,n){return Ee(dr(e,n),Tn)}function bh(e,n,t){return t=t===o?1:T(t),Ee(dr(e,n),t)}function io(e,n){var t=M(e)?$e:Ln;return t(e,I(n,3))}function uo(e,n){var t=M(e)?Fa:ns;return t(e,I(n,3))}var Ah=ir(function(e,n,t){Q.call(e,t)?e[t].push(n):pn(e,t,[n])});function Sh(e,n,t,r){e=De(e)?e:ot(e),t=t&&!r?T(t):0;var i=e.length;return t<0&&(t=ye(i+t,0)),mr(e)?t<=i&&e.indexOf(n,t)>-1:!!i&&Yn(e,n,t)>-1}var Ih=P(function(e,n,t){var r=-1,i=typeof n=="function",s=De(e)?d(e.length):[];return Ln(e,function(a){s[++r]=i?Ue(n,a,t):wt(a,n,t)}),s}),Eh=ir(function(e,n,t){pn(e,t,n)});function dr(e,n){var t=M(e)?ie:as;return t(e,I(n,3))}function Ch(e,n,t,r){return e==null?[]:(M(n)||(n=n==null?[]:[n]),t=r?o:t,M(t)||(t=t==null?[]:[t]),hs(e,n,t))}var Lh=ir(function(e,n,t){e[t?0:1].push(n)},function(){return[[],[]]});function Nh(e,n,t){var r=M(e)?Vr:Pu,i=arguments.length<3;return r(e,I(n,4),t,i,Ln)}function Rh(e,n,t){var r=M(e)?ja:Pu,i=arguments.length<3;return r(e,I(n,4),t,i,ns)}function Mh(e,n){var t=M(e)?Sn:ts;return t(e,_r(I(n,3)))}function Oh(e){var n=M(e)?Ju:Sf;return n(e)}function Th(e,n,t){(t?Me(e,n,t):n===o)?n=1:n=T(n);var r=M(e)?ef:If;return r(e,n)}function Dh(e){var n=M(e)?nf:Cf;return n(e)}function Wh(e){if(e==null)return 0;if(De(e))return mr(e)?Jn(e):e.length;var n=Ne(e);return n==J||n==me?e.size:mi(e).length}function Ph(e,n,t){var r=M(e)?ei:Lf;return t&&Me(e,n,t)&&(n=o),r(e,I(n,3))}var kh=P(function(e,n){if(e==null)return[];var t=n.length;return t>1&&Me(e,n[0],n[1])?n=[]:t>2&&Me(n[0],n[1],n[2])&&(n=[n[0]]),hs(e,Ee(n,1),[])}),gr=_l||function(){return Ie.Date.now()};function Uh(e,n){if(typeof n!="function")throw new qe(O);return e=T(e),function(){if(--e<1)return n.apply(this,arguments)}}function so(e,n,t){return n=t?o:n,n=e&&n==null?e.length:n,_n(e,X,o,o,o,o,n)}function oo(e,n){var t;if(typeof n!="function")throw new qe(O);return e=T(e),function(){return--e>0&&(t=n.apply(this,arguments)),e<=1&&(n=o),t}}var zi=P(function(e,n,t){var r=U;if(t.length){var i=En(t,ut(zi));r|=fe}return _n(e,r,n,t,i)}),ao=P(function(e,n,t){var r=U|ue;if(t.length){var i=En(t,ut(ao));r|=fe}return _n(n,r,e,t,i)});function lo(e,n,t){n=t?o:n;var r=_n(e,de,o,o,o,o,o,n);return r.placeholder=lo.placeholder,r}function fo(e,n,t){n=t?o:n;var r=_n(e,Ae,o,o,o,o,o,n);return r.placeholder=fo.placeholder,r}function co(e,n,t){var r,i,s,a,l,c,p=0,_=!1,v=!1,x=!0;if(typeof e!="function")throw new qe(O);n=Qe(n)||0,se(t)&&(_=!!t.leading,v="maxWait"in t,s=v?ye(Qe(t.maxWait)||0,n):s,x="trailing"in t?!!t.trailing:x);function b(he){var un=r,wn=i;return r=i=o,p=he,a=e.apply(wn,un),a}function E(he){return p=he,l=Et(F,n),_?b(he):a}function D(he){var un=he-c,wn=he-p,Mo=n-un;return v?Le(Mo,s-wn):Mo}function C(he){var un=he-c,wn=he-p;return c===o||un>=n||un<0||v&&wn>=s}function F(){var he=gr();if(C(he))return G(he);l=Et(F,D(he))}function G(he){return l=o,x&&r?b(he):(r=i=o,a)}function ze(){l!==o&&ws(l),p=0,r=c=i=l=o}function Oe(){return l===o?a:G(gr())}function Ge(){var he=gr(),un=C(he);if(r=arguments,i=this,c=he,un){if(l===o)return E(c);if(v)return ws(l),l=Et(F,n),b(c)}return l===o&&(l=Et(F,n)),a}return Ge.cancel=ze,Ge.flush=Oe,Ge}var Bh=P(function(e,n){return es(e,1,n)}),Fh=P(function(e,n,t){return es(e,Qe(n)||0,t)});function jh(e){return _n(e,pe)}function pr(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new qe(O);var t=function(){var r=arguments,i=n?n.apply(this,r):r[0],s=t.cache;if(s.has(i))return s.get(i);var a=e.apply(this,r);return t.cache=s.set(i,a)||s,a};return t.cache=new(pr.Cache||gn),t}pr.Cache=gn;function _r(e){if(typeof e!="function")throw new qe(O);return function(){var n=arguments;switch(n.length){case 0:return!e.call(this);case 1:return!e.call(this,n[0]);case 2:return!e.call(this,n[0],n[1]);case 3:return!e.call(this,n[0],n[1],n[2])}return!e.apply(this,n)}}function zh(e){return oo(2,e)}var Gh=Nf(function(e,n){n=n.length==1&&M(n[0])?ie(n[0],Be(I())):ie(Ee(n,1),Be(I()));var t=n.length;return P(function(r){for(var i=-1,s=Le(r.length,t);++i=n}),Kn=us(function(){return arguments}())?us:function(e){return le(e)&&Q.call(e,"callee")&&!Hu.call(e,"callee")},M=d.isArray,id=Eu?Be(Eu):hf;function De(e){return e!=null&&vr(e.length)&&!xn(e)}function ce(e){return le(e)&&De(e)}function ud(e){return e===!0||e===!1||le(e)&&Re(e)==An}var On=ml||eu,sd=Cu?Be(Cu):df;function od(e){return le(e)&&e.nodeType===1&&!Ct(e)}function ad(e){if(e==null)return!0;if(De(e)&&(M(e)||typeof e=="string"||typeof e.splice=="function"||On(e)||st(e)||Kn(e)))return!e.length;var n=Ne(e);if(n==J||n==me)return!e.size;if(It(e))return!mi(e).length;for(var t in e)if(Q.call(e,t))return!1;return!0}function ld(e,n){return bt(e,n)}function fd(e,n,t){t=typeof t=="function"?t:o;var r=t?t(e,n):o;return r===o?bt(e,n,o,t):!!r}function Ki(e){if(!le(e))return!1;var n=Re(e);return n==$n||n==Tr||typeof e.message=="string"&&typeof e.name=="string"&&!Ct(e)}function cd(e){return typeof e=="number"&&qu(e)}function xn(e){if(!se(e))return!1;var n=Re(e);return n==A||n==K||n==Or||n==Ce}function go(e){return typeof e=="number"&&e==T(e)}function vr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=en}function se(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}function le(e){return e!=null&&typeof e=="object"}var po=Lu?Be(Lu):pf;function hd(e,n){return e===n||vi(e,n,Di(n))}function dd(e,n,t){return t=typeof t=="function"?t:o,vi(e,n,Di(n),t)}function gd(e){return _o(e)&&e!=+e}function pd(e){if(Qf(e))throw new R(N);return ss(e)}function _d(e){return e===null}function vd(e){return e==null}function _o(e){return typeof e=="number"||le(e)&&Re(e)==_e}function Ct(e){if(!le(e)||Re(e)!=ge)return!1;var n=Kt(e);if(n===null)return!0;var t=Q.call(n,"constructor")&&n.constructor;return typeof t=="function"&&t instanceof t&&Ft.call(t)==hl}var Hi=Nu?Be(Nu):_f;function md(e){return go(e)&&e>=-9007199254740991&&e<=en}var vo=Ru?Be(Ru):vf;function mr(e){return typeof e=="string"||!M(e)&&le(e)&&Re(e)==ft}function je(e){return typeof e=="symbol"||le(e)&&Re(e)==Mt}var st=Mu?Be(Mu):mf;function xd(e){return e===o}function yd(e){return le(e)&&Ne(e)==ct}function wd(e){return le(e)&&Re(e)==Po}var bd=ar(xi),Ad=ar(function(e,n){return e<=n});function mo(e){if(!e)return[];if(De(e))return mr(e)?nn(e):Te(e);if(gt&&e[gt])return el(e[gt]());var n=Ne(e),t=n==J?si:n==me?kt:ot;return t(e)}function yn(e){if(!e)return e===0?e:0;if(e=Qe(e),e===Tn||e===-1/0){var n=e<0?-1:1;return n*Lr}return e===e?e:0}function T(e){var n=yn(e),t=n%1;return n===n?t?n-t:n:0}function xo(e){return e?Fn(T(e),0,Ke):0}function Qe(e){if(typeof e=="number")return e;if(je(e))return Dn;if(se(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=se(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=ku(e);var t=ra.test(e);return t||ua.test(e)?ka(e.slice(2),t?2:8):ta.test(e)?Dn:+e}function yo(e){return ln(e,We(e))}function Sd(e){return e?Fn(T(e),-9007199254740991,en):e===0?e:0}function Y(e){return e==null?"":Fe(e)}var Id=rt(function(e,n){if(It(n)||De(n)){ln(n,be(n),e);return}for(var t in n)Q.call(n,t)&&xt(e,t,n[t])}),wo=rt(function(e,n){ln(n,We(n),e)}),xr=rt(function(e,n,t,r){ln(n,We(n),e,r)}),Ed=rt(function(e,n,t,r){ln(n,be(n),e,r)}),Cd=vn(hi);function Ld(e,n){var t=tt(e);return n==null?t:Qu(t,n)}var Nd=P(function(e,n){e=ee(e);var t=-1,r=n.length,i=r>2?n[2]:o;for(i&&Me(n[0],n[1],i)&&(r=1);++t1),s}),ln(e,Oi(e),t),r&&(t=Ye(t,$|oe|ae,Ff));for(var i=n.length;i--;)Si(t,n[i]);return t});function qd(e,n){return Ao(e,_r(I(n)))}var Zd=vn(function(e,n){return e==null?{}:wf(e,n)});function Ao(e,n){if(e==null)return{};var t=ie(Oi(e),function(r){return[r]});return n=I(n),ds(e,t,function(r,i){return n(r,i[0])})}function Yd(e,n,t){n=Rn(n,e);var r=-1,i=n.length;for(i||(i=1,e=o);++rn){var r=e;e=n,n=r}if(t||e%1||n%1){var i=Zu();return Le(e+i*(n-e+Pa("1e-"+((i+"").length-1))),n)}return wi(e,n)}var s0=it(function(e,n,t){return n=n.toLowerCase(),e+(t?Eo(n):n)});function Eo(e){return Zi(Y(e).toLowerCase())}function Co(e){return e=Y(e),e&&e.replace(oa,Ya).replace(Ea,"")}function o0(e,n,t){e=Y(e),n=Fe(n);var r=e.length;t=t===o?r:Fn(T(t),0,r);var i=t;return t-=n.length,t>=0&&e.slice(t,i)==n}function a0(e){return e=Y(e),e&&jo.test(e)?e.replace(ru,Xa):e}function l0(e){return e=Y(e),e&&qo.test(e)?e.replace(Gr,"\\$&"):e}var f0=it(function(e,n,t){return e+(t?"-":"")+n.toLowerCase()}),c0=it(function(e,n,t){return e+(t?" ":"")+n.toLowerCase()}),h0=Ns("toLowerCase");function d0(e,n,t){e=Y(e),n=T(n);var r=n?Jn(e):0;if(!n||r>=n)return e;var i=(n-r)/2;return or(Zt(i),t)+e+or(qt(i),t)}function g0(e,n,t){e=Y(e),n=T(n);var r=n?Jn(e):0;return n&&r>>0,t?(e=Y(e),e&&(typeof n=="string"||n!=null&&!Hi(n))&&(n=Fe(n),!n&&Xn(e))?Mn(nn(e),0,t):e.split(n,t)):[]}var w0=it(function(e,n,t){return e+(t?" ":"")+Zi(n)});function b0(e,n,t){return e=Y(e),t=t==null?0:Fn(T(t),0,e.length),n=Fe(n),e.slice(t,t+n.length)==n}function A0(e,n,t){var r=u.templateSettings;t&&Me(e,n,t)&&(n=o),e=Y(e),n=xr({},n,r,Ps);var i=xr({},n.imports,r.imports,Ps),s=be(i),a=ui(i,s),l,c,p=0,_=n.interpolate||Ot,v="__p += '",x=oi((n.escape||Ot).source+"|"+_.source+"|"+(_===iu?na:Ot).source+"|"+(n.evaluate||Ot).source+"|$","g"),b="//# sourceURL="+(Q.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ma+"]")+` -`;e.replace(x,function(C,F,G,ze,Oe,Ge){return G||(G=ze),v+=e.slice(p,Ge).replace(aa,Ja),F&&(l=!0,v+=`' + -__e(`+F+`) + -'`),Oe&&(c=!0,v+=`'; -`+Oe+`; -__p += '`),G&&(v+=`' + -((__t = (`+G+`)) == null ? '' : __t) + -'`),p=Ge+C.length,C}),v+=`'; -`;var E=Q.call(n,"variable")&&n.variable;if(!E)v=`with (obj) { -`+v+` -} -`;else if(Vo.test(E))throw new R(V);v=(c?v.replace(ko,""):v).replace(Uo,"$1").replace(Bo,"$1;"),v="function("+(E||"obj")+`) { -`+(E?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(l?", __e = _.escape":"")+(c?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+v+`return __p -}`;var D=No(function(){return Z(s,b+"return "+v).apply(o,a)});if(D.source=v,Ki(D))throw D;return D}function S0(e){return Y(e).toLowerCase()}function I0(e){return Y(e).toUpperCase()}function E0(e,n,t){if(e=Y(e),e&&(t||n===o))return ku(e);if(!e||!(n=Fe(n)))return e;var r=nn(e),i=nn(n),s=Uu(r,i),a=Bu(r,i)+1;return Mn(r,s,a).join("")}function C0(e,n,t){if(e=Y(e),e&&(t||n===o))return e.slice(0,ju(e)+1);if(!e||!(n=Fe(n)))return e;var r=nn(e),i=Bu(r,nn(n))+1;return Mn(r,0,i).join("")}function L0(e,n,t){if(e=Y(e),e&&(t||n===o))return e.replace(Kr,"");if(!e||!(n=Fe(n)))return e;var r=nn(e),i=Uu(r,nn(n));return Mn(r,i).join("")}function N0(e,n){var t=bn,r=Rt;if(se(n)){var i="separator"in n?n.separator:i;t="length"in n?T(n.length):t,r="omission"in n?Fe(n.omission):r}e=Y(e);var s=e.length;if(Xn(e)){var a=nn(e);s=a.length}if(t>=s)return e;var l=t-Jn(r);if(l<1)return r;var c=a?Mn(a,0,l).join(""):e.slice(0,l);if(i===o)return c+r;if(a&&(l+=c.length-l),Hi(i)){if(e.slice(l).search(i)){var p,_=c;for(i.global||(i=oi(i.source,Y(uu.exec(i))+"g")),i.lastIndex=0;p=i.exec(_);)var v=p.index;c=c.slice(0,v===o?l:v)}}else if(e.indexOf(Fe(i),l)!=l){var x=c.lastIndexOf(i);x>-1&&(c=c.slice(0,x))}return c+r}function R0(e){return e=Y(e),e&&Fo.test(e)?e.replace(tu,il):e}var M0=it(function(e,n,t){return e+(t?" ":"")+n.toUpperCase()}),Zi=Ns("toUpperCase");function Lo(e,n,t){return e=Y(e),n=t?o:n,n===o?Va(e)?ol(e):Ka(e):e.match(n)||[]}var No=P(function(e,n){try{return Ue(e,o,n)}catch(t){return Ki(t)?t:new R(t)}}),O0=vn(function(e,n){return $e(n,function(t){t=fn(t),pn(e,t,zi(e[t],e))}),e});function T0(e){var n=e==null?0:e.length,t=I();return e=n?ie(e,function(r){if(typeof r[1]!="function")throw new qe(O);return[t(r[0]),r[1]]}):[],P(function(r){for(var i=-1;++ien)return[];var t=Ke,r=Le(e,Ke);n=I(n),e-=Ke;for(var i=ii(r,n);++t0||n<0)?new j(t):(e<0?t=t.takeRight(-e):e&&(t=t.drop(e)),n!==o&&(n=T(n),t=n<0?t.dropRight(-n):t.take(n-e)),t)},j.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},j.prototype.toArray=function(){return this.take(Ke)},an(j.prototype,function(e,n){var t=/^(?:filter|find|map|reject)|While$/.test(n),r=/^(?:head|last)$/.test(n),i=u[r?"take"+(n=="last"?"Right":""):n],s=r||/^find/.test(n);i&&(u.prototype[n]=function(){var a=this.__wrapped__,l=r?[1]:arguments,c=a instanceof j,p=l[0],_=c||M(a),v=function(F){var G=i.apply(u,In([F],l));return r&&x?G[0]:G};_&&t&&typeof p=="function"&&p.length!=1&&(c=_=!1);var x=this.__chain__,b=!!this.__actions__.length,E=s&&!x,D=c&&!b;if(!s&&_){a=D?a:new j(this);var C=e.apply(a,l);return C.__actions__.push({func:hr,args:[v],thisArg:o}),new Ze(C,x)}return E&&D?e.apply(this,l):(C=this.thru(v),E?r?C.value()[0]:C.value():C)})}),$e(["pop","push","shift","sort","splice","unshift"],function(e){var n=Ut[e],t=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);u.prototype[e]=function(){var i=arguments;if(r&&!this.__chain__){var s=this.value();return n.apply(M(s)?s:[],i)}return this[t](function(a){return n.apply(M(a)?a:[],i)})}}),an(j.prototype,function(e,n){var t=u[n];if(t){var r=t.name+"";Q.call(nt,r)||(nt[r]=[]),nt[r].push({name:n,func:t})}}),nt[ur(o,ue).name]=[{name:"wrapper",func:o}],j.prototype.clone=Nl,j.prototype.reverse=Rl,j.prototype.value=Ml,u.prototype.at=oh,u.prototype.chain=ah,u.prototype.commit=lh,u.prototype.next=fh,u.prototype.plant=hh,u.prototype.reverse=dh,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=gh,u.prototype.first=u.prototype.head,gt&&(u.prototype[gt]=ch),u},Qn=al();Pn?((Pn.exports=Qn)._=Qn,Xr._=Qn):Ie._=Qn}).call(Lt)})(br,br.exports);var Ar=br.exports;function tp(y=!0){S.useEffect(()=>{if(!y)return;const L=Ar.debounce(o=>{document.documentElement.style.setProperty("--mouse-x",`${o.clientX}px`),document.documentElement.style.setProperty("--mouse-y",`${o.clientY}px`)},16);return document.addEventListener("mousemove",L),()=>{L.cancel(),document.removeEventListener("mousemove",L)}},[y])}function rp(y={},L=!0){const[o,W]=S.useState(!1),[z,N]=S.useState({width:window.innerWidth/3,height:window.innerHeight,top:0});S.useCallback(Ar.debounce(V=>{o&&N(m=>{const H=window.innerWidth-V.clientX,B=Math.min(Math.max(y.minWidth||300,H),y.maxWidth||window.innerWidth*.8);return{...m,width:B}})},16),[o,y]);const O=S.useCallback(V=>{N(m=>{const H=m.height-V,B=m.top+V;return{...m,height:Math.min(Math.max(y.minHeight||300,H),y.maxHeight||window.innerHeight),top:Math.max(0,B)}})},[y]);return S.useEffect(()=>{if(!L||!o)return;const V=Ar.debounce(H=>{N(B=>{const $=window.innerWidth-H.clientX,oe=Math.min(Math.max(y.minWidth||300,$),y.maxWidth||window.innerWidth*.8);return{...B,width:oe}})},16),m=()=>W(!1);return document.addEventListener("mousemove",V),document.addEventListener("mouseup",m),()=>{V.cancel(),document.removeEventListener("mousemove",V),document.removeEventListener("mouseup",m)}},[o,y,L]),{isResizing:o,setIsResizing:W,dimensions:z,handleHeightResize:O}}function ip(y=!0){const{dispatch:L}=To();S.useEffect(()=>{if(!y)return;const o=()=>{const W=sn.canvas.selected_nodes;if(Object.keys(W??{}).length){const z=Object.values(W)[0];L({type:"SET_SELECTED_NODE",payload:z})}else L({type:"SET_SELECTED_NODE",payload:null})};return document.addEventListener("click",o),()=>{document.removeEventListener("click",o)}},[L,y])}const up=({message:y,onClose:L})=>y?h.jsxs("div",{className:"bg-gradient-to-r from-amber-50 to-amber-100 border-b border-amber-200 px-5 py-2 mt-2 relative shadow-sm",children:[h.jsxs("div",{className:"flex items-center",children:[h.jsx("div",{className:"flex-shrink-0 mr-2",children:h.jsx("svg",{className:"w-3.5 h-3.5 text-amber-600",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})})}),h.jsx("div",{className:"text-amber-800 font-medium leading-relaxed pr-6 markdown-content",style:{fontSize:"11px"},children:h.jsx(Ig,{rehypePlugins:[[vg,{target:"_blank",rel:["noopener","noreferrer"]}]],remarkPlugins:[mg],className:"prose !text-[11px] prose-a:text-amber-700 prose-a:underline prose-a:font-medium hover:prose-a:text-amber-800",components:{a:({node:o,...W})=>h.jsx("a",{...W,className:"text-amber-700 underline hover:text-amber-800 transition-colors",style:{fontSize:"11px"}}),p:({children:o})=>h.jsx("span",{className:"inline",style:{fontSize:"11px"},children:o}),span:({children:o})=>h.jsx("span",{style:{fontSize:"11px"},children:o}),li:({children:o})=>h.jsx("li",{style:{fontSize:"11px"},children:o}),ul:({children:o})=>h.jsx("ul",{style:{fontSize:"11px"},children:o}),ol:({children:o})=>h.jsx("ol",{style:{fontSize:"11px"},children:o})},children:y})})]}),h.jsx("button",{onClick:L,className:"absolute right-2 top-1/2 -translate-y-1/2 text-amber-500 hover:text-amber-700 transition-colors p-1 rounded-full hover:bg-amber-200/50","aria-label":"Close announcement",children:h.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}):null;function cp({onClose:y,visible:L=!0,triggerUsage:o=!1,onUsageTriggered:W}){const{state:z,dispatch:N}=To(),{messages:O,installedNodes:V,loading:m,sessionId:H,selectedNode:B}=z,$=S.useRef(null),[oe,ae]=S.useState(""),[we,k]=S.useState(""),[U,ue]=S.useState(window.innerWidth/3),[re,de]=S.useState(!1),[Ae,fe]=S.useState([]),[q,X]=S.useState("gpt-4o-mini");S.useState(window.innerHeight),S.useState(0);const[Se,pe]=S.useState(""),[bn,Rt]=S.useState(!1);tp(L),ip(L);const{isResizing:nu,setIsResizing:Ir,dimensions:Hn,handleHeightResize:Er}=rp({minWidth:300,maxWidth:window.innerWidth*.8,minHeight:300,maxHeight:window.innerHeight},L);S.useEffect(()=>{$.current&&($.current.scrollTop=$.current.scrollHeight)},[O]),S.useEffect(()=>{(async()=>{const K=await np();console.log("[WorkflowChat] Received installed nodes:",K.length),N({type:"SET_INSTALLED_NODES",payload:K})})()},[]);const Cr=async A=>{try{const K=await Nt.fetchMessages(A);N({type:"SET_MESSAGES",payload:K})}catch(K){console.error("Error fetching messages:",K)}};S.useEffect(()=>{let A=localStorage.getItem("sessionId");A?(N({type:"SET_SESSION_ID",payload:A}),Cr(A)):(A=Ve(),N({type:"SET_SESSION_ID",payload:A}),localStorage.setItem("sessionId",A))},[]);const Tn=at.useCallback(A=>{if(!re)return;const K=window.innerWidth-A.clientX,J=Math.min(Math.max(300,K),window.innerWidth*.8);ue(J)},[re]),en=at.useMemo(()=>Ar.debounce(Tn,16),[Tn]);S.useEffect(()=>(re&&(document.addEventListener("mousemove",en),document.addEventListener("mouseup",An)),()=>{document.removeEventListener("mousemove",en),document.removeEventListener("mouseup",An),en.cancel()}),[re,en]);const Lr=A=>{ae(A.target.value)},Dn=async()=>{if(N({type:"SET_LOADING",payload:!0}),oe.trim()===""&&!B||!H)return;k(oe);const A=Ve(),K={id:Ve(),role:"user",content:oe,trace_id:A};N({type:"ADD_MESSAGE",payload:K}),ae("");try{const J={type:"model_select",data:[q]};let _e=Ve(),on=!0;for await(const ge of Nt.streamInvokeServer(H,oe,Ae.map(ve=>ve.file),null,J,A)){const ve={id:_e,role:"ai",content:JSON.stringify(ge),format:ge.format,finished:ge.finished,name:"Assistant"};if(on)N({type:"ADD_MESSAGE",payload:ve}),on=!1;else{N({type:"UPDATE_MESSAGE",payload:ve});const Ce=z.messages.map(ke=>ke.id===ve.id&&!ke.finished?ve:ke);hn(Ce)}ge.finished&&N({type:"SET_LOADING",payload:!1})}}catch(J){console.error("Error sending message:",J),N({type:"SET_LOADING",payload:!1})}finally{fe([])}},Ke=async A=>{if(!H)return;N({type:"SET_LOADING",payload:!0}),k(A);const K=Ve(),J={id:Ve(),role:"user",content:A,trace_id:K};N({type:"ADD_MESSAGE",payload:J});try{const _e={type:"model_select",data:[q]};let on=Ve(),ge=!0;for await(const ve of Nt.streamInvokeServer(H,A,Ae.map(Ce=>Ce.file),null,_e,K)){const Ce={id:on,role:"ai",content:JSON.stringify(ve),format:ve.format,finished:ve.finished,name:"Assistant"};if(ge)N({type:"ADD_MESSAGE",payload:Ce}),ge=!1;else{N({type:"UPDATE_MESSAGE",payload:Ce});const ke=z.messages.map(me=>me.id===Ce.id&&!me.finished?Ce:me);hn(ke)}ve.finished&&N({type:"SET_LOADING",payload:!1})}}catch(_e){console.error("Error sending message:",_e),N({type:"SET_LOADING",payload:!1})}finally{fe([])}},Nr=A=>{A.metaKey&&A.key==="Enter"&&Dn()},Rr=()=>{N({type:"CLEAR_MESSAGES"});const A=z.sessionId;A&&localStorage.removeItem(`messages_${A}`),localStorage.removeItem("sessionId");const K=Ve();N({type:"SET_SESSION_ID",payload:K}),localStorage.setItem("sessionId",K)},Mr=A=>{ae(A)},cn=async(A,K)=>{if(!H||!B)return;N({type:"SET_LOADING",payload:!0});const J=Ve(),_e={id:Ve(),role:"user",content:B.comfyClass||B.type,trace_id:J};N({type:"ADD_MESSAGE",payload:_e});try{let on=Ve(),ge=!0;for await(const ve of Nt.streamInvokeServer(H,B.comfyClass||B.type,[],A,K,J)){const Ce={id:on,role:"ai",content:JSON.stringify(ve),format:ve.format,finished:ve.finished,name:"Assistant"};if(A&&A!==""&&(Ce.metadata={intent:A}),ge)N({type:"ADD_MESSAGE",payload:Ce}),ge=!1;else{N({type:"UPDATE_MESSAGE",payload:Ce});const ke=z.messages.map(me=>me.id===Ce.id&&!me.finished?Ce:me);hn(ke)}ve.finished&&N({type:"SET_LOADING",payload:!1})}}catch(on){console.error("Error sending message:",on),N({type:"SET_LOADING",payload:!1})}},hn=A=>{z.sessionId&&localStorage.setItem(`messages_${z.sessionId}`,JSON.stringify(A))},Or=A=>{console.log("[WorkflowChat] Adding new message:",A);const K=[...z.messages,A];N({type:"ADD_MESSAGE",payload:A}),hn(K)},An=()=>{de(!1)},Wn=A=>{const K=Array.from(A).map(J=>({id:Math.random().toString(36).substr(2,9),file:J,preview:URL.createObjectURL(J)}));fe(J=>[...J,...K])},Tr=A=>{fe(K=>K.filter(_e=>_e.id!==A))};at.useEffect(()=>()=>{Ae.forEach(A=>URL.revokeObjectURL(A.preview))},[Ae]),S.useEffect(()=>{o&&W&&(cn("node_explain"),W())},[o]),S.useEffect(()=>{L&&(async()=>{try{const K=new Date().toDateString();if(localStorage.getItem("announcementLastShownDate")!==K){const _e=await Nt.fetchAnnouncement();_e&&_e.trim()!==""&&(pe(_e),Rt(!0),localStorage.setItem("announcementLastShownDate",K))}}catch(K){console.error("Error fetching announcement:",K)}})()},[L]);const $n=()=>{Rt(!1)};return h.jsxs("div",{className:"fixed right-0 shadow-lg bg-white duration-200 ease-out",style:{display:L?"block":"none",width:`${Hn.width}px`,height:`${Hn.height}px`,top:`${Hn.top}px`},children:[h.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 cursor-ew-resize hover:bg-gray-300",onMouseDown:A=>{Ir(!0),A.preventDefault()}}),h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsx(zg,{onClose:y,onClear:Rr,hasMessages:O.length>0,onHeightResize:Er}),bn&&Se&&h.jsx(up,{message:Se,onClose:$n}),h.jsx("div",{children:V.map(A=>h.jsx("div",{children:A.name},A.name))}),h.jsx("div",{className:"flex-1 overflow-y-auto p-4 scroll-smooth",ref:$,children:h.jsx(Vg,{messages:O,latestInput:we,onOptionClick:Mr,installedNodes:V,onAddMessage:Or,loading:m})}),h.jsxs("div",{className:"border-t px-4 py-3 border-gray-200 bg-white sticky bottom-0",children:[B&&h.jsx($g,{nodeInfo:B,onSendWithIntent:cn,loading:m,onSendWithContent:Ke}),h.jsx(Kg,{input:oe,loading:m,onChange:Lr,onSend:Dn,onKeyPress:Nr,onUploadImages:Wn,uploadedImages:Ae,onRemoveImage:Tr,selectedModel:q,onModelChange:X})]})]})]})}export{cp as default}; diff --git a/pyproject.toml b/pyproject.toml index ba978a2..0512186 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "ComfyUI-Copilot" description = "Your Intelligent Assistant for Comfy-UI." -version = "1.0.6" +version = "1.1.0" license = {file = "LICENSE"} [project.urls] diff --git a/ui/package.json b/ui/package.json index 31ce74a..3ca234c 100644 --- a/ui/package.json +++ b/ui/package.json @@ -10,6 +10,7 @@ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview", "setupGithooks": "node ../scripts/setupGitHooks", + "build:pre": "npx tailwindcss -i ./src/scoped-tailwind.css -o ./src/output.css && VITE_API_BASE_URL=https://comfyui-copilot-server-pre.onrender.com vite build && node scripts/post-build.js", "build:prod": "npx tailwindcss -i ./src/scoped-tailwind.css -o ./src/output.css && VITE_API_BASE_URL=https://comfyui-copilot-server.onrender.com vite build && node scripts/post-build.js" }, "dependencies": { diff --git a/ui/src/apis/comfyApiCustom.ts b/ui/src/apis/comfyApiCustom.ts index 8cfa0b0..3f5a496 100644 --- a/ui/src/apis/comfyApiCustom.ts +++ b/ui/src/apis/comfyApiCustom.ts @@ -1,3 +1,11 @@ +/* + * @Author: ai-business-hql ai.bussiness.hql@gmail.com + * @Date: 2025-02-17 20:53:45 + * @LastEditors: ai-business-hql ai.bussiness.hql@gmail.com + * @LastEditTime: 2025-04-02 11:06:22 + * @FilePath: /comfyui_copilot/ui/src/apis/comfyApiCustom.ts + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ // Copyright (C) 2025 AIDC-AI // Licensed under the MIT License. @@ -17,3 +25,99 @@ export async function getInstalledNodes(): Promise { const objectInfos = await getObjectInfo(); return Object.keys(objectInfos); } + +export async function runPrompt(json_data: any): Promise { + const response = await api.fetchApi("/prompt", { + method: "POST", + body: JSON.stringify(json_data), + }); + return await response.json(); +} + +/** + * Clear the prompt queue or delete specific queue items + * + * @param options Configuration options + * @param options.clear If true, clears the entire queue + * @param options.delete Array of prompt IDs to delete from the queue + * @returns Promise with the response + * + * @example + * // Clear the entire queue + * await manageQueue({ clear: true }); + * + * // Delete specific prompts from the queue + * await manageQueue({ delete: ["prompt-123", "prompt-456"] }); + * + * // Both clear the queue and delete specific prompts + * await manageQueue({ clear: true, delete: ["prompt-789"] }); + */ +export async function manageQueue(options: { + clear?: boolean; + delete?: string[]; +}): Promise { + try { + const response = await api.fetchApi("/queue", { + method: "POST", + body: JSON.stringify(options), + }); + + if (!response.ok) { + throw new Error(`Failed to manage queue: ${response.status} ${response.statusText}`); + } + + return response; + } catch (error) { + console.error("Error managing queue:", error); + throw error; + } +} + + +/** + * Interrupts the current processing/generation + * + * This function sends a request to the server to stop the current + * processing operation. It's useful for canceling ongoing image generations. + * + * @returns Promise with the response + * + * @example + * // Interrupt the current generation process + * await interruptProcessing(); + */ +export async function interruptProcessing(): Promise { + try { + const response = await api.fetchApi("/interrupt", { + method: "POST", + }); + + if (!response.ok) { + throw new Error(`Failed to interrupt processing: ${response.status} ${response.statusText}`); + } + + return response; + } catch (error) { + console.error("Error interrupting processing:", error); + throw error; + } +} + + +export async function getHistory(promptId: string): Promise { + try { + const response = await api.fetchApi(`/history/${promptId}`, { + method: "GET" + }); + + if (!response.ok) { + throw new Error(`Failed to fetch history: ${response.status} ${response.statusText}`); + } + + return await response.json(); + } catch (error) { + console.error("Error fetching history:", error); + throw error; + } +} + diff --git a/ui/src/apis/workflowChatApi.ts b/ui/src/apis/workflowChatApi.ts index e4e1d3f..b5e8fe4 100644 --- a/ui/src/apis/workflowChatApi.ts +++ b/ui/src/apis/workflowChatApi.ts @@ -389,6 +389,60 @@ export namespace WorkflowChatAPI { return ''; } } + + export async function generateSDPrompts(text: string): Promise { + const maxRetries = 3; + let retryCount = 0; + let lastError: any; + + while (retryCount < maxRetries) { + try { + const apiKey = getApiKey(); + const browserLanguage = getBrowserLanguage(); + + // Prepare headers + const headers: Record = { + 'Content-Type': 'application/json', + 'accept': 'application/json', + 'Authorization': `Bearer ${apiKey}`, + 'trace-id': generateUUID(), + 'Accept-Language': browserLanguage, + }; + + const response = await fetch(`${BASE_URL}/api/param_debug/generate_sd_prompts`, { + method: 'POST', + headers, + body: JSON.stringify({ + text: text + }), + }); + + const result = await response.json(); + if (!result.success) { + const message = result.message || 'Failed to generate SD prompts'; + throw new Error(message); + } + + return result.data as string[]; + } catch (error) { + lastError = error; + retryCount++; + + if (retryCount >= maxRetries) { + console.error(`Error generating SD prompts after ${maxRetries} attempts:`, error); + throw error; + } + + console.warn(`Attempt ${retryCount} failed, retrying... Error: ${error instanceof Error ? error.message : 'Unknown error'}`); + + // Wait with exponential backoff before retrying (500ms, 1000ms, 2000ms) + await new Promise(resolve => setTimeout(resolve, 500 * Math.pow(2, retryCount - 1))); + } + } + + // This should never be reached due to the throw in the loop, but TypeScript needs it + throw lastError; + } } diff --git a/ui/src/components/chat/ChatHeader.tsx b/ui/src/components/chat/ChatHeader.tsx index d34bce9..326a6dc 100644 --- a/ui/src/components/chat/ChatHeader.tsx +++ b/ui/src/components/chat/ChatHeader.tsx @@ -19,9 +19,16 @@ interface ChatHeaderProps { onClear?: () => void; hasMessages: boolean; onHeightResize?: (deltaY: number) => void; + title?: string; } -export function ChatHeader({ onClose, onClear, hasMessages, onHeightResize }: ChatHeaderProps) { +export function ChatHeader({ + onClose, + onClear, + hasMessages, + onHeightResize, + title = "ComfyUI-Copilot" +}: ChatHeaderProps) { const [isApiKeyModalOpen, setIsApiKeyModalOpen] = useState(false); const [isResizing, setIsResizing] = useState(false); @@ -76,9 +83,9 @@ export function ChatHeader({ onClose, onClear, hasMessages, onHeightResize }: Ch ComfyUI-Copilot Logo -

ComfyUI-Copilot

+

{title}

diff --git a/ui/src/components/chat/SelectedNodeInfo.tsx b/ui/src/components/chat/SelectedNodeInfo.tsx index cac84f3..02220e5 100644 --- a/ui/src/components/chat/SelectedNodeInfo.tsx +++ b/ui/src/components/chat/SelectedNodeInfo.tsx @@ -2,7 +2,7 @@ * @Author: 晴知 qingli.hql@alibaba-inc.com * @Date: 2025-02-17 20:53:45 * @LastEditors: ai-business-hql ai.bussiness.hql@gmail.com - * @LastEditTime: 2025-02-27 19:22:25 + * @LastEditTime: 2025-03-20 18:55:32 * @FilePath: /comfyui_copilot/ui/src/components/chat/SelectedNodeInfo.tsx * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ @@ -12,7 +12,7 @@ import { app } from "../../utils/comfyapp"; interface SelectedNodeInfoProps { - nodeInfo: any; + nodeInfo: any[]; onSendWithIntent: (intent: string, ext?: any) => void; loading: boolean; onSendWithContent: (text: string) => void; @@ -53,19 +53,19 @@ export function SelectedNodeInfo({ nodeInfo, onSendWithIntent, loading, onSendWi return (
-

Selected node: {nodeInfo.type}

+

Selected node: {nodeInfo[0].type}

diff --git a/ui/src/components/debug/ParameterDebugInterface.tsx b/ui/src/components/debug/ParameterDebugInterface.tsx new file mode 100644 index 0000000..f595307 --- /dev/null +++ b/ui/src/components/debug/ParameterDebugInterface.tsx @@ -0,0 +1,2168 @@ +import React, { useState, useEffect } from 'react'; +import { getOnlyOneImageNode, getOutputImageByPromptId, queuePrompt, WidgetParamConf } from '../../utils/queuePrompt'; +import { app } from '../../utils/comfyapp'; +import { interruptProcessing, manageQueue } from '../../apis/comfyApiCustom'; +import { useChatContext } from '../../context/ChatContext'; +import { WorkflowChatAPI } from '../../apis/workflowChatApi'; + +// Add CSS for the highlight pulse effect +const highlightPulseStyle = ` + @keyframes highlight-pulse { + 0% { + box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5); + } + 70% { + box-shadow: 0 0 0 15px rgba(59, 130, 246, 0); + } + 100% { + box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); + } + } + + .highlight-pulse { + animation: highlight-pulse 1.5s infinite; + border: 2px solid #3b82f6; + } + + @keyframes fade-in-out { + 0% { opacity: 0; transform: translateY(-20px); } + 10% { opacity: 1; transform: translateY(0); } + 90% { opacity: 1; transform: translateY(0); } + 100% { opacity: 0; transform: translateY(-20px); } + } + + .animate-fade-in-out { + animation: fade-in-out 3s forwards; + } +`; + +// 添加一个新的接口来定义图像类型 +interface GeneratedImage { + url: string; + params: { [key: string]: any }; +} + +interface ParameterDebugInterfaceProps { + selectedNodes: any[]; + visible: boolean; + onClose?: () => void; +} + +// Define WidgetPair interface here since it's not exported from queuePrompt +interface WidgetPair { + paramName: string; + paramValue: string; +} + +export const ParameterDebugInterface: React.FC = ({ + selectedNodes, + visible, + onClose +}) => { + const [currentScreen, setCurrentScreen] = useState(0); + const [selectedParams, setSelectedParams] = useState<{[key: string]: boolean}>({ + Steps: true, + CFG: true, + sampler_name: true, + threshold: false, + prompt: false + }); + const [isProcessing, setIsProcessing] = useState(false); + const [isCompleted, setIsCompleted] = useState(false); + const [completedCount, setCompletedCount] = useState(0); + const [totalCount, setTotalCount] = useState(12); + const [selectedImageIndex, setSelectedImageIndex] = useState(null); + const [generatedImages, setGeneratedImages] = useState(() => { + // Create an array of placeholder image URLs + return Array(12).fill(null).map((_, i) => ({ + url: `https://source.unsplash.com/random/300x300?sig=${Math.random()}`, + params: { + step: i % 3 === 0 ? 5 : i % 3 === 1 ? 10 : 15, + sampler_name: 'euler', + cfg: 1 + } + })); + }); + + // 修改参数测试值结构,使用嵌套对象,按节点ID进行分组 + const [paramTestValues, setParamTestValues] = useState<{[nodeId: string]: {[paramName: string]: any[]}}>({}); + // Add a state to store dropdown open status + const [openDropdowns, setOpenDropdowns] = useState<{[key: string]: boolean | {isOpen: boolean, x: number, y: number}}>({}); + + // Add new state to store search terms + const [searchTerms, setSearchTerms] = useState<{[key: string]: string}>({}); + + // Add state to track input values - 更新为使用nodeId_paramName作为键 + const [inputValues, setInputValues] = useState<{[nodeId_paramName: string]: {min?: string, max?: string, step?: string}}>({}); + + // Add a state to store current page + const [currentPage, setCurrentPage] = useState(1); + const imagesPerPage = 6; + const [errorMessage, setErrorMessage] = useState(null); + + // Add state to store notification visibility + const [notificationVisible, setNotificationVisible] = useState(false); + + // Add new state for modal + const [modalVisible, setModalVisible] = useState(false); + const [modalImageUrl, setModalImageUrl] = useState(''); + + // Add state for text inputs and AI writing modal + const [textInputs, setTextInputs] = useState<{[nodeId_paramName: string]: string[]}>({}); + const [aiWritingModalVisible, setAiWritingModalVisible] = useState(false); + const [aiWritingModalText, setAiWritingModalText] = useState(''); + const [aiGeneratedTexts, setAiGeneratedTexts] = useState([]); + const [aiWritingLoading, setAiWritingLoading] = useState(false); + const [aiWritingNodeId, setAiWritingNodeId] = useState(''); + const [aiWritingParamName, setAiWritingParamName] = useState(''); + const [aiWritingError, setAiWritingError] = useState(null); + const [aiSelectedTexts, setAiSelectedTexts] = useState<{[key: string]: boolean}>({}); + + // Get dispatch from context to update screen state + const { dispatch } = useChatContext(); + + // Add function to handle AI text generation + const handleAiWriting = async () => { + if (!aiWritingModalText.trim()) { + setAiWritingError("Please enter some text to generate variations"); + return; + } + + setAiWritingLoading(true); + setAiWritingError(null); + setAiGeneratedTexts([]); + setAiSelectedTexts({}); + + try { + const generatedTexts = await WorkflowChatAPI.generateSDPrompts(aiWritingModalText); + setAiGeneratedTexts(generatedTexts); + + // Pre-select all generated texts + const newSelectedTexts: {[key: string]: boolean} = {}; + generatedTexts.forEach((text, index) => { + newSelectedTexts[`text${index+1}`] = false; + }); + setAiSelectedTexts(newSelectedTexts); + } catch (error) { + console.error("Error generating text:", error); + setAiWritingError("Failed to generate text variations. Please try again."); + } finally { + setAiWritingLoading(false); + } + }; + + // Add function to handle text input changes + const handleTextInputChange = (nodeId: string, paramName: string, index: number, value: string) => { + const textKey = `${nodeId}_${paramName}`; + + setTextInputs(prev => { + const currentTexts = [...(prev[textKey] || [])]; + currentTexts[index] = value; + return { + ...prev, + [textKey]: currentTexts + }; + }); + + // Also update paramTestValues with the new value directly instead of using textInputs state + // (which hasn't been updated yet) + const currentTexts = [...(textInputs[textKey] || [])]; + currentTexts[index] = value; + updateParamTestValues(nodeId, paramName, currentTexts); + }; + + // Add function to add a new text input + const handleAddTextInput = (nodeId: string, paramName: string) => { + const textKey = `${nodeId}_${paramName}`; + + setTextInputs(prev => { + const currentTexts = [...(prev[textKey] || [])]; + currentTexts.push(''); + return { + ...prev, + [textKey]: currentTexts + }; + }); + + // Also update paramTestValues + const updatedTexts = [...(textInputs[textKey] || []), '']; + updateParamTestValues(nodeId, paramName, updatedTexts); + }; + + // Add function to remove a text input + const handleRemoveTextInput = (nodeId: string, paramName: string, index: number) => { + const textKey = `${nodeId}_${paramName}`; + + setTextInputs(prev => { + const currentTexts = [...(prev[textKey] || [])]; + currentTexts.splice(index, 1); + return { + ...prev, + [textKey]: currentTexts + }; + }); + + // Also update paramTestValues + const updatedTexts = [...(textInputs[textKey] || [])]; + updatedTexts.splice(index, 1); + updateParamTestValues(nodeId, paramName, updatedTexts); + }; + + // Add function to toggle text selection in AI writing modal + const toggleTextSelection = (textKey: string) => { + setAiSelectedTexts(prev => ({ + ...prev, + [textKey]: !prev[textKey] + })); + }; + + // Add function to add selected texts from AI modal + const addSelectedTexts = () => { + const textKey = `${aiWritingNodeId}_${aiWritingParamName}`; + const selectedTexts = Object.entries(aiSelectedTexts) + .filter(([_, isSelected]) => isSelected) + .map(([key]) => { + const index = parseInt(key.replace('text', '')) - 1; + return aiGeneratedTexts[index]; + }); + + if (selectedTexts.length === 0) { + return; + } + + setTextInputs(prev => { + const currentTexts = [...(prev[textKey] || [])]; + return { + ...prev, + [textKey]: [...currentTexts, ...selectedTexts] + }; + }); + + // Also update paramTestValues + const updatedTexts = [...(textInputs[textKey] || []), ...selectedTexts]; + updateParamTestValues(aiWritingNodeId, aiWritingParamName, updatedTexts); + + // Close the modal + setAiWritingModalVisible(false); + }; + + // Add function to open AI writing modal + const openAiWritingModal = (nodeId: string, paramName: string) => { + setAiWritingModalVisible(true); + setAiWritingNodeId(nodeId); + setAiWritingParamName(paramName); + setAiWritingModalText(''); + setAiGeneratedTexts([]); + setAiSelectedTexts({}); + setAiWritingLoading(false); + setAiWritingError(null); + }; + + // Add useEffect to initialize parameter test values when selectedNodes change + useEffect(() => { + if (!selectedNodes || selectedNodes.length === 0) return; + + // Initialize empty parameter test values for any newly selected nodes + const updatedParamTestValues = { ...paramTestValues }; + + // Clean up any nodes that are no longer selected + const selectedNodeIds = selectedNodes.map((node: any) => node.id.toString()); + const currentNodeIds = Object.keys(updatedParamTestValues); + + // Remove test values for nodes that are no longer selected + currentNodeIds.forEach(nodeId => { + if (!selectedNodeIds.includes(nodeId)) { + delete updatedParamTestValues[nodeId]; + } + }); + + // Add empty entries for newly selected nodes + selectedNodes.forEach((node: any) => { + const nodeId = node.id.toString(); + if (!updatedParamTestValues[nodeId]) { + updatedParamTestValues[nodeId] = {}; + } + }); + + // Update state if changes were made + if (JSON.stringify(updatedParamTestValues) !== JSON.stringify(paramTestValues)) { + setParamTestValues(updatedParamTestValues); + } + }, [selectedNodes, paramTestValues]); + + // Add useEffect to update screen state in context when screen changes + useEffect(() => { + dispatch({ + type: 'SET_SCREEN_STATE', + payload: { + currentScreen, + isProcessing, + isCompleted + } + }); + }, [currentScreen, isProcessing, isCompleted, dispatch]); + + // Add style to document head + useEffect(() => { + const styleElement = document.createElement('style'); + styleElement.textContent = highlightPulseStyle; + document.head.appendChild(styleElement); + + return () => { + document.head.removeChild(styleElement); + }; + }, []); + + // Add a useEffect to handle click outside + useEffect(() => { + const handleClickOutside = (event: MouseEvent) => { + // Only process if there are open dropdowns + if (Object.values(openDropdowns).some(isOpen => isOpen)) { + // Check if clicked element is inside dropdown-menu or its trigger + const target = event.target as Element; + + // Check if the click was inside any dropdown menu + const isInsideDropdown = !!target.closest('.dropdown-menu'); + + // Check if the click was on a dropdown trigger button + const isOnTrigger = !!target.closest('[data-dropdown]'); + + // If click was outside both dropdown and trigger, close all dropdowns + if (!isInsideDropdown && !isOnTrigger) { + setOpenDropdowns({}); + } + } + }; + + // Add listener to document once + document.addEventListener('mousedown', handleClickOutside); + + return () => { + document.removeEventListener('mousedown', handleClickOutside); + }; + }, [openDropdowns]); + + // Calculate total pages + const totalPages = Math.ceil(totalCount / imagesPerPage); + + // Handle page change + const handlePageChange = (newPage: number, event?: React.MouseEvent) => { + if (event) { + event.preventDefault(); + event.stopPropagation(); + } + setCurrentPage(Math.max(1, Math.min(newPage, totalPages))); + }; + + // Navigate to next screen + const handleNext = (event?: React.MouseEvent) => { + if (event) { + event.preventDefault(); + event.stopPropagation(); + } + // 如果要从屏幕 1 进入屏幕 2,更新 totalCount + if (currentScreen === 1) { + const combinations = generateParameterCombinations(); + setTotalCount(combinations.length); + } + // 清除错误消息 + setErrorMessage(null); + setCurrentScreen(prev => Math.min(prev + 1, 2)); + }; + + // Navigate to previous screen + const handlePrevious = (event?: React.MouseEvent) => { + if (event) { + event.preventDefault(); + event.stopPropagation(); + } + // 清除错误消息 + setErrorMessage(null); + // Reset completed state when going back + if (isCompleted) { + setIsCompleted(false); + } + + // If going back from screen 1 to 0, clean up any paramTestValues for nodes that are no longer selected + if (currentScreen === 1) { + const selectedNodeIds = selectedNodes.map(node => node.id.toString()); + const currentNodeIds = Object.keys(paramTestValues); + + // Remove test values for any nodes that are no longer selected + const updatedParamTestValues = { ...paramTestValues }; + currentNodeIds.forEach(nodeId => { + if (!selectedNodeIds.includes(nodeId)) { + delete updatedParamTestValues[nodeId]; + } + }); + + setParamTestValues(updatedParamTestValues); + } + + setCurrentScreen(prev => Math.max(prev - 1, 0)); + }; + + // Handle parameter selection + const handleParamSelect = (param: string, event?: React.MouseEvent) => { + if (event) { + event.preventDefault(); + event.stopPropagation(); + } + setSelectedParams(prev => ({ + ...prev, + [param]: !prev[param] + })); + }; + + // Generate numeric test values + const generateNumericTestValues = (min: number, max: number, step: number, precision: number = 0) => { + // Ensure all parameters have valid values + min = isNaN(min) ? 0 : min; + max = isNaN(max) ? 100 : max; + step = isNaN(step) || step <= 0 ? 1 : step; + + // Ensure max >= min + if (max < min) { + max = min; + } + + // Calculate count based on the actual step + const count = Math.floor((max - min) / step) + 1; + if (count <= 1) return [min]; + + // Generate values based on the actual step + const values = []; + let current = min; + if (count <= 10){ + while (current <= max && values.length <= 10) { + // Apply precision based on the parameter + const factor = Math.pow(10, precision); + const roundedValue = Math.round(current * factor) / factor; + + values.push(roundedValue); + current += step; + } + } + else{ + // For large ranges, generate evenly distributed values + const range = max - min; + const step = range / 9; // 9 steps to get 10 values + + for (let i = 0; i <= 9; i++) { + // Calculate the value at this position + const value = min + (step * i); + + // Apply precision + const factor = Math.pow(10, precision); + const roundedValue = Math.round(value * factor) / factor; + + values.push(roundedValue); + } + } + + return values; + }; + +// Generate all parameter combinations for the selected parameters +const generateParameterCombinations = () => { + // First, we need to get all the different parameter combinations + const result: WidgetParamConf[][] = []; + + // Create a list of all parameter combinations for each node + const nodeParamCombinations: {[nodeId: string]: Array} = {}; + + // For each node, generate all combinations of its parameters + Object.keys(paramTestValues).forEach(nodeIdStr => { + const nodeId = parseInt(nodeIdStr); + const nodeParams = paramTestValues[nodeIdStr] || {}; + + // Get all parameter names that have values + const paramNames = Object.keys(nodeParams).filter( + paramName => nodeParams[paramName] && nodeParams[paramName].length > 0 + ); + + if (paramNames.length === 0) return; + + // Create all possible combinations of parameter values for this node + const combinations: WidgetParamConf[][] = [[]]; + + // For each parameter, create combinations with all its values + paramNames.forEach(paramName => { + const values = nodeParams[paramName]; + const newCombinations: WidgetParamConf[][] = []; + + // For each existing combination + combinations.forEach(combo => { + // For each value of the current parameter + values.forEach(value => { + // Create a new combination by adding this parameter value + const newCombo = [...combo, { + nodeId, + paramName, + paramValue: String(value) + }]; + newCombinations.push(newCombo); + }); + }); + + // Replace combinations with the new ones + combinations.length = 0; + combinations.push(...newCombinations); + }); + + // Store all combinations for this node + nodeParamCombinations[nodeIdStr] = combinations; + }); + + // If no nodes have parameters, return empty result + if (Object.keys(nodeParamCombinations).length === 0) { + return result; + } + + // If there's only one node, return its combinations directly + if (Object.keys(nodeParamCombinations).length === 1) { + const nodeId = Object.keys(nodeParamCombinations)[0]; + return nodeParamCombinations[nodeId]; + } + + // For multiple nodes, we need to create combinations across nodes + const nodeIds = Object.keys(nodeParamCombinations); + + // Start with combinations from the first node + let allCombinations = nodeParamCombinations[nodeIds[0]]; + + // For each additional node, create combinations with all previous nodes + for (let i = 1; i < nodeIds.length; i++) { + const nodeCombinations = nodeParamCombinations[nodeIds[i]]; + const newCombinations: WidgetParamConf[][] = []; + + // For each existing combination across previous nodes + allCombinations.forEach(existingCombo => { + // For each combination from the current node + nodeCombinations.forEach(nodeCombo => { + // Combine them + newCombinations.push([...existingCombo, ...nodeCombo]); + }); + }); + + // Update all combinations + allCombinations = newCombinations; + } + + return allCombinations; +}; + + // Toggle dropdown open status - 使用nodeId_paramName作为键 + const toggleDropdown = (nodeId: string, paramName: string, event: React.MouseEvent) => { + event.preventDefault(); + event.stopPropagation(); + + const dropdownKey = `${nodeId}_${paramName}`; + + setOpenDropdowns(prev => { + const isCurrentlyOpen = prev[dropdownKey] && + typeof prev[dropdownKey] === 'object' ? + (prev[dropdownKey] as {isOpen: boolean}).isOpen : + Boolean(prev[dropdownKey]); + + if (isCurrentlyOpen) { + return { + ...prev, + [dropdownKey]: false + }; + } else { + // 确定下拉框的位置 + let x = 0; + let y = 0; + + // 尝试从事件目标获取位置 + if (event.currentTarget) { + const rect = event.currentTarget.getBoundingClientRect(); + x = rect.left; + y = rect.bottom; + } else { + // 如果无法获取元素位置,使用鼠标点击位置 + x = event.clientX; + y = event.clientY + 20; // 在鼠标位置下方20px显示 + } + + // 确保下拉框不会超出窗口边界 + const windowWidth = window.innerWidth; + const dropdownWidth = 250; // 估计的下拉框宽度 + + if (x + dropdownWidth > windowWidth) { + x = windowWidth - dropdownWidth - 10; // 确保距离右边界至少10px + } + + if (x < 0) x = 10; // 确保距离左边界至少10px + + return { + ...prev, + [dropdownKey]: { + isOpen: true, + x: x, + y: y + } + }; + } + }); + }; + + // Update parameter test values - 修改为支持新的参数结构 + const updateParamTestValues = (nodeId: string, paramName: string, values: any[]) => { + setParamTestValues(prev => { + const updatedValues = { ...prev }; + + // 确保节点ID存在 + if (!updatedValues[nodeId]) { + updatedValues[nodeId] = {}; + } + + // 更新特定节点和参数的值 + updatedValues[nodeId][paramName] = values; + + return updatedValues; + }); + }; + + // Handle selecting specific test values - 修改为支持新的参数结构 + const handleTestValueSelect = (nodeId: string, paramName: string, value: any, event?: React.MouseEvent) => { + if (event) { + event.preventDefault(); + event.stopPropagation(); + } + + setParamTestValues(prev => { + const updatedValues = { ...prev }; + + // 确保节点ID存在 + if (!updatedValues[nodeId]) { + updatedValues[nodeId] = {}; + } + + // 确保参数名存在 + if (!updatedValues[nodeId][paramName]) { + updatedValues[nodeId][paramName] = []; + } + + const currentValues = updatedValues[nodeId][paramName]; + + if (currentValues.includes(value)) { + updatedValues[nodeId][paramName] = currentValues.filter(v => v !== value); + } else { + updatedValues[nodeId][paramName] = [...currentValues, value]; + } + + return updatedValues; + }); + }; + + // Add processing search - 使用nodeId_paramName作为键 + const handleSearch = (nodeId: string, paramName: string, term: string) => { + const searchKey = `${nodeId}_${paramName}`; + setSearchTerms(prev => ({ + ...prev, + [searchKey]: term + })); + }; + + // Add select all - 修改为支持新的参数结构 + const handleSelectAll = (nodeId: string, paramName: string, values: any[]) => { + // 确保节点ID存在 + if (!paramTestValues[nodeId]) { + updateParamTestValues(nodeId, paramName, values); + return; + } + + // 获取当前值 + const currentValues = paramTestValues[nodeId][paramName] || []; + + // 如果所有值都已选择,则取消选择所有,否则选择所有 + if (values.length === currentValues.length) { + updateParamTestValues(nodeId, paramName, []); + } else { + updateParamTestValues(nodeId, paramName, [...values]); + } + }; + + // Add function to generate dynamic parameters - modified to work with the new structure + const generateDynamicParams = (paramTestValues: {[nodeId: string]: {[paramName: string]: any[]}}, index: number) => { + // Create object to store dynamic parameters + const dynamicParams: { + [key: string]: any, + nodeParams?: {[nodeId: string]: {[paramName: string]: any}} + } = {}; + + // Initialize nodeParams structure + dynamicParams.nodeParams = {}; + + // Get all parameter combinations + const allCombinations = generateParameterCombinations(); + + // Use the index to select a specific combination + if (index < allCombinations.length) { + const selectedCombination = allCombinations[index]; + + // Process each parameter in the combination + selectedCombination.forEach(param => { + const nodeId = param.nodeId.toString(); + const paramName = param.paramName; + const paramValue = param.paramValue; + + // Initialize node if needed + if (!dynamicParams.nodeParams![nodeId]) { + dynamicParams.nodeParams![nodeId] = {}; + } + + // Add to nodeParams structure + dynamicParams.nodeParams![nodeId][paramName] = paramValue; + + // Also add to flat structure for backwards compatibility and display + dynamicParams[paramName] = paramValue; + }); + } + + return dynamicParams; + }; + + // Handle start generation + const handleStartGeneration = async (event?: React.MouseEvent) => { + if (event) { + event.preventDefault(); + event.stopPropagation(); + } + + // Get parameter combinations + const paramCombinations = generateParameterCombinations(); + const totalCombinations = paramCombinations.length; + const showNodeId = getOnlyOneImageNode(); + + // Check if total runs exceed 100 + if (totalCombinations > 100) { + setErrorMessage(`Cannot generate more than 100 images at once (currently: ${totalCombinations} images)`); + return; + } + + setErrorMessage(null); + setIsProcessing(true); + setCompletedCount(0); + + console.log("Generated parameter combinations:", paramCombinations); + + // If we have no combinations, show error and return + if (paramCombinations.length === 0) { + setErrorMessage("No valid parameter combinations found. Please check your parameter selections."); + setIsProcessing(false); + return; + } + + const prompt_ids: string[] = []; + try { + // Each combination represents all parameters for a single image generation + for (const combination of paramCombinations) { + const response = await queuePrompt(combination); + if(response.prompt_id) { + prompt_ids.push(response.prompt_id); + } else { + console.error("Failed to get prompt_id from response:", response); + prompt_ids.push(""); + } + } + + // Create an array to track images and their parameters + const newImages: GeneratedImage[] = Array(paramCombinations.length).fill(null).map((_, i) => ({ + url: `https://source.unsplash.com/random/300x300?sig=${Math.random()}`, // Default placeholder + params: generateDynamicParams(paramTestValues, i) + })); + + // Set initial images + setGeneratedImages(newImages); + + // Track timeout + const startTime = Date.now(); + const timeoutDuration = 5 * 60 * 1000; // 5 minutes + + // Function to poll for images + const pollForImages = async () => { + // Check if timeout has been reached + if (Date.now() - startTime > timeoutDuration) { + console.log("Timeout reached while waiting for images"); + setIsProcessing(false); + setIsCompleted(true); + setCurrentPage(1); + return; + } + + let completedImagesCount = 0; + + // Check each prompt id to see if images are ready + + for (let i = 0; i < prompt_ids.length; i++) { + const promptId = prompt_ids[i]; + if (!promptId) continue; + + try { + const imageUrl = await getOutputImageByPromptId(promptId, showNodeId); + + if (imageUrl) { + // If we have an image URL, update in our array + newImages[i] = { + ...newImages[i], + url: imageUrl + }; + completedImagesCount++; + } + } catch (error) { + console.error(`Error fetching image for prompt ID ${promptId}:`, error); + } + } + + // Update the images in state + setGeneratedImages([...newImages]); + + // Update the completed count + setCompletedCount(completedImagesCount); + + // If all images are ready or timeout occurred, we're done + if (completedImagesCount === prompt_ids.length || Date.now() - startTime > timeoutDuration) { + setIsProcessing(false); + setIsCompleted(true); + setCurrentPage(1); + } else { + // Otherwise, poll again in 3 seconds + setTimeout(pollForImages, 3000); + } + }; + + // Start polling + pollForImages(); + } catch (error) { + console.error("Error generating images:", error); + setIsProcessing(false); + } + }; + + // Handle selecting an image + const handleSelectImage = (index: number, event?: React.MouseEvent) => { + if (event) { + event.preventDefault(); + event.stopPropagation(); + } + setSelectedImageIndex(index); + }; + + // Add new function to open image modal + const openImageModal = (imageUrl: string, event: React.MouseEvent) => { + event.preventDefault(); + event.stopPropagation(); + setModalImageUrl(imageUrl); + setModalVisible(true); + }; + + // Add new function to close image modal + const closeImageModal = (event?: React.MouseEvent) => { + if (event) { + event.preventDefault(); + event.stopPropagation(); + } + setModalVisible(false); + }; + + // Handle applying selected image + const handleApplySelected = (event?: React.MouseEvent) => { + if (event) { + event.preventDefault(); + event.stopPropagation(); + } + if (selectedImageIndex !== null) { + console.log(`Applied image ${selectedImageIndex + 1} with parameters:`, generatedImages[selectedImageIndex].params); + // 把选中图片的参数应用到画布上 + const selectedParams = generatedImages[selectedImageIndex].params; + + // 使用结构化的参数格式 + if (selectedParams.nodeParams) { + // 遍历所有节点参数 + Object.entries(selectedParams.nodeParams).forEach(([nodeId, nodeParams]) => { + // 获取节点 + const node = app.graph._nodes_by_id[nodeId]; + if (!node || !node.widgets) return; + + // 遍历节点的参数 + Object.entries(nodeParams as Record).forEach(([paramName, value]) => { + // 在节点的widgets中查找对应名称的widget + for (const widget of node.widgets) { + if (widget.name === paramName) { + // 设置widget的值 + widget.value = value; + break; + } + } + }); + }); + + // 标记画布为脏,触发重新渲染 + app.graph.setDirtyCanvas(false, true); + + // 显示通知消息 + setNotificationVisible(true); + + // 3秒后隐藏通知 + setTimeout(() => { + setNotificationVisible(false); + }, 3000); + } + } + }; + + // Modified handle close to implement different behaviors based on current screen + const handleClose = (event?: React.MouseEvent, nodeIndex?: number) => { + if (event) { + event.preventDefault(); + event.stopPropagation(); + } + + // Screen 2: Close individual node card + if (currentScreen === 1 && nodeIndex !== undefined) { + // Remove the node at specified index + const newSelectedNodes = [...selectedNodes]; + newSelectedNodes.splice(nodeIndex, 1); + + // If no nodes left, return to original screen + if (newSelectedNodes.length === 0) { + if (onClose) { + // Clear screen state from context when closing + dispatch({ type: 'SET_SCREEN_STATE', payload: null }); + // Call provided onClose to reset the interface + onClose(); + } + } else { + // Update the context with the new selected nodes + dispatch({ type: 'SET_SELECTED_NODE', payload: newSelectedNodes }); + } + return; + } + + // Screen 3, 4, 5 or original: Close the entire interface + if (onClose) { + // Clear screen state from context when closing + dispatch({ type: 'SET_SCREEN_STATE', payload: null }); + // Use the provided onClose callback + onClose(); + } else { + // For users of this component without a callback + // Reset internal states + setCurrentScreen(0); + setIsCompleted(false); + setIsProcessing(false); + setErrorMessage(null); + } + }; + + // Conditionally render based on whether nodes are selected + // Screen original - Only stop propagation, don't prevent default + if (!visible || selectedNodes.length === 0) { + return ( +
e.stopPropagation()} + > +
+
+

GenLab

+
+
+ +
+
+
+ + + +
+
+

Batch Test Parameter Pairs

+

Select a node to batch test parameter pairs

+
+
+ +
+
+ + + +
+
+

How To Use

+

Click on any node in your workflow to start the parameter testing process

+
+
+ +
+

No node is currently selected

+
+
+
+
+ ); + } + + // Screen 5: If we're in completed state, show the results gallery + if (isCompleted) { + // Calculate current page's image index range using generatedImages.length instead of totalCount + const startIndex = (currentPage - 1) * imagesPerPage; + const endIndex = Math.min(startIndex + imagesPerPage, generatedImages.length); + const currentImages = generatedImages.slice(startIndex, endIndex); + + // Update total pages calculation based on actual image count + const actualTotalPages = Math.ceil(generatedImages.length / imagesPerPage); + + return ( +
e.stopPropagation()} + > +
+
+
+

Generation Complete

+

All {generatedImages.length} images have been generated.

+
+ +
+ + {/* Notification toast */} + {notificationVisible && ( +
+
+
+ + + +
+

Parameters has been applied.

+
+
+ )} + + {/* Image Modal */} + {modalVisible && ( +
+
e.stopPropagation()}> + +
+ Enlarged image +
+
+
+ )} + +
+ {currentImages.map((image, indexOnPage) => { + const actualIndex = startIndex + indexOnPage; + return ( +
handleSelectImage(actualIndex, e)} + > + {/* Zoom icon */} + +
+ {`Generated +
+
+ {Object.entries(image.params) + // Filter out nodeParams and other complex objects from display + .filter(([paramName, value]) => + paramName !== 'nodeParams' && + typeof value !== 'object' + ) + .map(([paramName, value]) => ( +
{paramName}: {String(value)}
+ )) + } +
+
+ ); + })} +
+ + {/* Pagination controls */} + {actualTotalPages > 1 && ( +
+ + + +
+ Page {currentPage} of {actualTotalPages} +
+ + + +
+ )} + +
+ + +
+
+
+ ); + } + + // Screen 4: If processing, show the loading overlay + if (isProcessing) { + return ( +
e.stopPropagation()} + > +
+ {/* Semi-transparent overlay */} +
+
+
Processing...
+
Completed {completedCount} of {totalCount} runs
+
+
+
+
+ Already generated {completedCount} images +
+ +
+
+ + {/* Background content (same as screen 3 content) */} +
+
+

Confirm Test Configuration

+

+ In the selected parameter combinations, there are {totalCount} total runs. Each run will generate a separate image. +

+
+ +
+ + {/* Display error message */} + {errorMessage && ( +
+
+
+ + + +
+
{errorMessage}
+
+
+ )} + + {selectedNodes.length > 0 ? ( + selectedNodes.map((node, nodeIndex) => { + const nodeType = node.type || "Unknown Node"; + const widgets = node.widgets || []; + const nodeId = node.id; + + return ( +
+
+ {nodeType} (ID: {nodeId}) +
+
+ {widgets.map((widget: any, widgetIndex: number) => { + const paramName = widget.name; + + if (!selectedParams[paramName]) { + return null; + } + + const testValues = paramTestValues[nodeId]?.[paramName] || []; + const displayValues = Array.isArray(testValues) + ? `[${testValues.join(', ')}]` + : JSON.stringify(testValues); + + return ( +
+ +
+ e.preventDefault()} + /> +
+
+ ); + })} +
+
+ ); + }) + ) : ( +
+ No nodes selected. Please select a node in the workflow to configure parameters. +
+ )} + +
+ + +
+
+
+ ); + } + + // Screen 1: Select parameters + if (currentScreen === 0) { + return ( +
e.stopPropagation()} + > +
+
+
+

Select Parameters for Testing

+

Choose the parameters you want to include in your batch test

+
+ +
+ + {/* Dynamically render nodes and their parameters */} + {selectedNodes.map((node, nodeIndex) => { + // Get node title + const nodeTitle = node.title || "Unknown Node"; + + // Get node widgets/parameters + const nodeWidgets = node.widgets || []; + + return ( +
+
+ {nodeTitle} +
+
+
+ {nodeWidgets.map((widget: any, widgetIndex: number) => { + const paramName = widget.name; + return ( +
+
handleParamSelect(paramName, e)} + > + {selectedParams[paramName] &&
} +
+ {paramName} +
+ ); + })} +
+
+
+ ); + })} + +
+ +
+
+
+ ); + } + + // Screen 2: Configure parameter options + if (currentScreen === 1) { + return ( +
e.stopPropagation()} + > +
+
+
+

Parameter Options

+

Configure the test values for each parameter

+
+ +
+ + {/* AI Writing Modal */} + {aiWritingModalVisible && ( +
+
+
+

AI Writing Assistant

+ +
+ +
+
+

Enter text and AI will generate variations

+