mirror of
https://github.com/OpenMaxIO/openmaxio-object-browser
synced 2026-07-01 07:41:18 -07:00
2 lines
24 KiB
JavaScript
2 lines
24 KiB
JavaScript
(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[5962],{47986:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});r(72791);var n=r(29945),o=r(80184);const i=e=>{let{iconComponent:t,entity:r}=e;return(0,o.jsx)(n.rjZ,{container:!0,children:(0,o.jsx)(n.rjZ,{item:!0,xs:12,children:(0,o.jsx)(n.KfX,{title:"".concat(r," not available"),iconComponent:t,help:(0,o.jsxs)(n.xuv,{sx:{fontSize:"14px",["@media (max-width: ".concat(n.Egj.sm,"px)")]:{display:"flex",flexFlow:"column"}},children:[(0,o.jsx)("span",{children:"This feature is not available for a single-disk setup.\xa0"}),(0,o.jsxs)("span",{children:["Please deploy a server in"," ",(0,o.jsx)("a",{href:"https://min.io/docs/minio/linux/operations/install-deploy-manage/deploy-minio-multi-node-multi-drive.html?ref=con",target:"_blank",rel:"noopener",children:"Distributed Mode"})," ","to use this feature."]})]})})})})}},92217:(e,t,r)=>{"use strict";r.d(t,{Z:()=>c});var n=r(72791),o=r(29945),i=r(78029),s=r.n(i),l=r(27454),a=r(80184);const c=e=>{let{value:t,label:r="",tooltip:i="",mode:c="json",onChange:d,editorHeight:u=250,helptip:p}=e;return(0,a.jsx)(o.pq4,{value:t,onChange:e=>d(e),mode:c,tooltip:i,editorHeight:u,label:r,helpTools:(0,a.jsx)(n.Fragment,{children:(0,a.jsx)(l.Z,{tooltip:"Copy to Clipboard",children:(0,a.jsx)(s(),{text:t,children:(0,a.jsx)(o.zxk,{type:"button",id:"copy-code-mirror",icon:(0,a.jsx)(o.TIy,{}),color:"primary",variant:"regular"})})})}),helpTip:p,helpTipPlacement:"right"})}},84741:(e,t,r)=>{"use strict";r.d(t,{Z:()=>d});var n=r(72791),o=r(29945),i=r(16444),s=r(26181),l=r.n(s),a=r(80184);const c=i.ZP.button((e=>{let{theme:t}=e;return{border:"1px solid ".concat(l()(t,"borderColor","#E2E2E2")),borderRadius:3,color:l()(t,"secondaryText","#5B5C5C"),backgroundColor:l()(t,"boxBackground","#FBFAFA"),fontSize:12}})),d=e=>{let{id:t,unitSelected:r,unitsList:i,disabled:s=!1,onUnitChange:l}=e;const[d,u]=n.useState(null),p=Boolean(d),x=e=>{u(null),""!==e&&l&&l(e)};return(0,a.jsxs)(n.Fragment,{children:[(0,a.jsx)(c,{id:"".concat(t,"-button"),"aria-controls":"".concat(t,"-menu"),"aria-haspopup":"true","aria-expanded":p?"true":void 0,onClick:e=>{u(e.currentTarget)},disabled:s,type:"button",children:r}),(0,a.jsx)(o.udT,{id:"upload-main-menu",options:i,selectedOption:"",onSelect:e=>x(e),hideTriggerAction:()=>{x("")},open:p,anchorEl:d,anchorOrigin:"end"})]})}},15962:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>R});var n=r(72791),o=r(78687),i=r(95087),s=r(57689),l=r(29945),a=r(99779),c=r(26181),d=r.n(c),u=r(45248),p=r(19913),x=r(28265),h=r(82839),f=r(18602);var m=r(92217),j=r(16444),g=r(80184);const b=j.ZP.table((e=>{let{theme:t}=e;return{"& .objectGeneralTitle":{lineHeight:1,fontSize:50,color:d()(t,"mutedText","#87888d")},"& .generalUnit":{color:d()(t,"fontColor","#000"),fontSize:12,fontWeight:"bold"},"& .testUnitRes":{fontSize:60,color:d()(t,"signalColors.main","#07193E"),fontWeight:"bold",textAlign:"right"},"& .metricValContainer":{lineHeight:1,verticalAlign:"bottom"},"& .objectsUnitRes":{fontSize:22,marginTop:6,color:d()(t,"mutedText","#87888d"),fontWeight:"bold",textAlign:"right"},"& .objectsUnit":{color:d()(t,"mutedText","#87888d"),fontSize:16,fontWeight:"bold"},"& .iconTd":{verticalAlign:"bottom"}}})),y=e=>{let{title:t,icon:r,throughput:n,objects:o}=e;const i=(0,u.Am)(n);let s="0",l="";return 0!==i.total&&(s=i.total.toString(),l="".concat(i.unit,"/s")),(0,g.jsxs)(b,{children:[(0,g.jsxs)("tr",{children:[(0,g.jsx)("td",{className:"objectGeneralTitle",children:t}),(0,g.jsx)("td",{className:"iconTd",children:r})]}),(0,g.jsxs)("tr",{children:[(0,g.jsx)("td",{className:"metricValContainer testUnitRes",children:s}),(0,g.jsx)("td",{className:"metricValContainer generalUnit",children:l})]}),(0,g.jsxs)("tr",{children:[(0,g.jsx)("td",{className:"metricValContainer objectsUnitRes",children:o}),(0,g.jsx)("td",{className:"metricValContainer objectsUnit",children:0!==o&&"Objs/S"})]})]})},v=j.ZP.div((e=>{let{theme:t}=e;return{"& .actionButtons":{textAlign:"right"},"& .descriptorLabel":{fontWeight:"bold",fontSize:14},"& .resultsContainer":{backgroundColor:d()(t,"boxBackground","#FBFAFA"),borderTop:"".concat(d()(t,"borderColor","#E2E2E2")," 1px solid"),marginTop:30,padding:25},"& .resultsIcon":{display:"flex",alignItems:"center","& svg":{fill:d()(t,"screenTitle.iconColor","#07193E")}},"& .detailedItem":{display:"flex",alignItems:"center",justifyContent:"flex-start"},"& .detailedVersion":{display:"flex",alignItems:"center",justifyContent:"flex-end"},"& .serversTable":{width:"100%",marginTop:15,"& thead > tr > th":{textAlign:"left",padding:15,fontSize:14,fontWeight:"bold"},"& tbody > tr":{"&:last-of-type":{"& > td":{borderBottom:"".concat(d()(t,"borderColor","#E2E2E2")," 1px solid")}},"& > td":{borderTop:"".concat(d()(t,"borderColor","#E2E2E2")," 1px solid"),padding:15,fontSize:14,"&:first-of-type":{borderLeft:"".concat(d()(t,"borderColor","#E2E2E2")," 1px solid")},"&:last-of-type":{borderRight:"".concat(d()(t,"borderColor","#E2E2E2")," 1px solid")}}}},"& .serverIcon":{width:55},"& .serverValue":{width:140},"& .serverHost":{maxWidth:540,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"& .tableOverflow":{overflowX:"auto",paddingBottom:15},"& .objectGeneral":{marginTop:15},"& .download":{"& .min-icon":{width:35,height:35,color:d()(t,"signalColors.good","#4CCB92")}},"& .upload":{"& .min-icon":{width:35,height:35,color:d()(t,"signalColors.info","#2781B0")}},"& .versionIcon":{color:d()(t,"screenTitle.iconColor","#07193E"),marginRight:20}}})),w=e=>{let{results:t,start:r}=e;const[o,i]=(0,n.useState)(!1),s=t[t.length-1]||[],a=d()(s,"GETStats.servers",[])||[],c=d()(s,"PUTStats.servers",[])||[],j=d()(s,"GETStats.throughputPerSec",0),b=d()(s,"GETStats.objectsPerSec",0),w=d()(s,"PUTStats.throughputPerSec",0),C=d()(s,"PUTStats.objectsPerSec",0);let S=[];a.forEach((e=>{const t=e.endpoint,r=c.find((e=>e.endpoint===t));let n={getUnit:"-",getValue:"N/A",host:e.endpoint,putUnit:"-",putValue:"N/A"};if(e.err&&""!==e.err)n.getError=e.err,n.getUnit="-",n.getValue="N/A";else{const t=(0,u.Am)(e.throughputPerSec.toString());n.getUnit=t.unit,n.getValue=t.total.toString()}if(r)if(r.err&&""!==r.err)n.putError=r.err,n.putUnit="-",n.putValue="N/A";else{const e=(0,u.Am)(r.throughputPerSec.toString());n.putUnit=e.unit,n.putValue=e.total.toString()}S.push(n)}));const O=s?JSON.stringify(s,null,4):"",E=(e=>[{get:0,put:0},...e.filter((e=>"0"!==e.version&&0!==e.disks)).map((e=>{var t,r;return{get:(null===(t=e.GETStats)||void 0===t?void 0:t.throughputPerSec)||0,put:(null===(r=e.PUTStats)||void 0===r?void 0:r.throughputPerSec)||0}}))])(t);return(0,g.jsxs)(v,{children:[(0,g.jsxs)(l.rjZ,{container:!0,className:"objectGeneral",children:[(0,g.jsx)(l.rjZ,{item:!0,xs:12,md:6,lg:6,children:(0,g.jsxs)(l.rjZ,{container:!0,className:"objectGeneral",children:[(0,g.jsx)(l.rjZ,{item:!0,xs:12,md:6,lg:6,children:(0,g.jsx)(y,{icon:(0,g.jsx)("div",{className:"download",children:(0,g.jsx)(l.Q_z,{})}),title:"GET",throughput:"".concat(j),objects:b})}),(0,g.jsx)(l.rjZ,{item:!0,xs:12,md:6,lg:6,children:(0,g.jsx)(y,{icon:(0,g.jsx)("div",{className:"upload",children:(0,g.jsx)(l.jhp,{})}),title:"PUT",throughput:"".concat(w),objects:C})})]})}),(0,g.jsx)(l.rjZ,{item:!0,xs:12,md:6,lg:6,children:(0,g.jsx)(p.h,{width:"99%",children:(0,g.jsxs)(x.T,{data:E,children:[(0,g.jsxs)("defs",{children:[(0,g.jsxs)("linearGradient",{id:"colorPut",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,g.jsx)("stop",{offset:"0%",stopColor:"#2781B0",stopOpacity:.9}),(0,g.jsx)("stop",{offset:"95%",stopColor:"#fff",stopOpacity:0})]}),(0,g.jsxs)("linearGradient",{id:"colorGet",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,g.jsx)("stop",{offset:"0%",stopColor:"#4CCB92",stopOpacity:.9}),(0,g.jsx)("stop",{offset:"95%",stopColor:"#fff",stopOpacity:0})]})]}),(0,g.jsx)(h.q,{strokeDasharray:"0 0",strokeWidth:1,strokeOpacity:.5,stroke:"#F1F1F1",vertical:!1}),(0,g.jsx)(f.u,{type:"monotone",dataKey:"get",stroke:"#4CCB92",fill:"url(#colorGet)",fillOpacity:.3,strokeWidth:2,dot:!1}),(0,g.jsx)(f.u,{type:"monotone",dataKey:"put",stroke:"#2781B0",fill:"url(#colorPut)",fillOpacity:.3,strokeWidth:2,dot:!1})]})})})]}),(0,g.jsx)("br",{}),E.length>1&&(0,g.jsxs)(n.Fragment,{children:[(0,g.jsxs)(l.rjZ,{container:!0,children:[(0,g.jsx)(l.rjZ,{item:!0,xs:12,md:6,className:"descriptorLabel",children:r?(0,g.jsx)(n.Fragment,{children:"Preliminar Results:"}):(0,g.jsx)(n.Fragment,{children:o?"JSON Results:":"Detailed Results:"})}),(0,g.jsx)(l.rjZ,{item:!0,xs:12,md:6,sx:{display:"flex",justifyContent:"right",gap:8},children:!r&&(0,g.jsxs)(n.Fragment,{children:[(0,g.jsx)(l.zxk,{id:"download-results","aria-label":"Download Results",onClick:()=>{const e=new Date;let t=document.createElement("a");t.setAttribute("href","data:text/plain;charset=utf-8,"+JSON.stringify(s)),t.setAttribute("download","speedtest_results-".concat(e.toISOString(),".log")),t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t)},icon:(0,g.jsx)(l._8t,{})}),"\xa0",(0,g.jsx)(l.zxk,{id:"toggle-json","aria-label":"Toogle JSON",onClick:()=>{i(!o)},icon:(0,g.jsx)(l.iH5,{})})]})})]}),(0,g.jsx)(l.xuv,{withBorders:!0,useBackground:!0,sx:{marginTop:15},children:(0,g.jsx)(l.rjZ,{container:!0,children:o?(0,g.jsx)(n.Fragment,{children:(0,g.jsx)(m.Z,{value:O,onChange:()=>{}})}):(0,g.jsxs)(n.Fragment,{children:[(0,g.jsx)(l.rjZ,{item:!0,xs:12,sm:12,md:1,lg:1,className:"resultsIcon",children:(0,g.jsx)(l.UMk,{width:45})}),(0,g.jsxs)(l.rjZ,{item:!0,xs:12,sm:6,md:3,lg:2,className:"detailedItem",children:["Nodes:\xa0",(0,g.jsx)("strong",{children:s.servers})]}),(0,g.jsxs)(l.rjZ,{item:!0,xs:12,sm:6,md:3,lg:2,className:"detailedItem",children:["Drives:\xa0",(0,g.jsx)("strong",{children:s.disks})]}),(0,g.jsxs)(l.rjZ,{item:!0,xs:12,sm:6,md:3,lg:2,className:"detailedItem",children:["Concurrent:\xa0",(0,g.jsx)("strong",{children:s.concurrent})]}),(0,g.jsxs)(l.rjZ,{item:!0,xs:12,sm:12,md:12,lg:5,className:"detailedVersion",children:[(0,g.jsx)("span",{className:"versionIcon",children:(0,g.jsx)(l.Dbk,{})})," ","MinIO VERSION\xa0",(0,g.jsx)("strong",{children:s.version})]}),(0,g.jsx)(l.rjZ,{item:!0,xs:12,className:"tableOverflow",children:(0,g.jsxs)("table",{className:"serversTable",cellSpacing:0,cellPadding:0,children:[(0,g.jsx)("thead",{children:(0,g.jsxs)("tr",{children:[(0,g.jsx)("th",{colSpan:2,children:"Servers"}),(0,g.jsx)("th",{children:"GET"}),(0,g.jsx)("th",{children:"PUT"})]})}),(0,g.jsx)("tbody",{children:S.map(((e,t)=>(0,g.jsxs)("tr",{children:[(0,g.jsx)("td",{className:"serverIcon",children:(0,g.jsx)(l.idV,{})}),(0,g.jsx)("td",{className:"serverHost",children:e.host}),e.getError&&""!==e.getError?(0,g.jsx)("td",{children:e.getError}):(0,g.jsx)(n.Fragment,{children:(0,g.jsxs)("td",{className:"serverValue",children:[(0,u.CE)(parseFloat(e.getValue)),"\xa0",e.getUnit,"/s."]})}),e.putError&&""!==e.putError?(0,g.jsx)("td",{children:e.putError}):(0,g.jsx)(n.Fragment,{children:(0,g.jsxs)("td",{className:"serverValue",children:[(0,u.CE)(parseFloat(e.putValue)),"\xa0",e.putUnit,"/s."]})})]},"storage-".concat(t.toString()))))})]})})]})})})]})]})};var C=r(87998),S=r(84741),O=r(47986),E=r(31460),T=r(79844),k=r(99670),P=r(38442),N=r(87995),Z=r(9478),U=r(44690),I=r(26824),F=r(56087);const R=()=>{const e=(0,o.v9)(N.N5),t=(0,s.s0)(),[r,c]=(0,n.useState)(!1),[d,u]=(0,n.useState)(null),[p,x]=(0,n.useState)("64"),[h,f]=(0,n.useState)("MB"),[m,j]=(0,n.useState)("10"),[b,y]=(0,n.useState)(0),[v,R]=(0,n.useState)(0),[A,B]=(0,n.useState)(0),[D,_]=(0,n.useState)(0),z=(0,Z.Yc)();(0,n.useEffect)((()=>{if(r){const e=new URL(window.location.toString()),t=!1?"9090":e.port,r=new URL(document.baseURI).pathname,n=(0,I.x2)(e.protocol),o=new i.w3cwebsocket("".concat(n,"://").concat(e.hostname,":").concat(t).concat(r,"ws/speedtest?&size=").concat(p).concat(h,"&duration=").concat(m,"s")),s=a.ou.now(),l=s.toUnixInteger()/1e3,d=s.plus({seconds:2*parseInt("10")}).toUnixInteger()/1e3,x=(d-l)/1e3;y(d),R(l),B(x);let f=null;if(null!==o)return o.onopen=()=>{console.log("WebSocket Client Connected"),o.send("ok"),f=setInterval((()=>{o.send("ok")}),1e4)},o.onmessage=e=>{const t=JSON.parse(e.data.toString());u((e=>{let r=[];e&&(r=[...e]);const n=0!==t.servers?[t]:[];return[...r,...n]}));const r=a.ou.now().toUnixInteger()/1e3;R(r)},o.onclose=()=>{clearInterval(f),console.log("connection closed by server"),c(!1)},()=>{o.close(1e3),clearInterval(f),console.log("closing websockets")}}else c(!1)}),[p,h,r,m]),(0,n.useEffect)((()=>{let e=100-100*((b-v)/1e3)/A;e>100&&(e=100),_(e)}),[r,v,b,A]);const G=r?"Start":null!==d?"Retest":"Start",V=(0,U.TL)();return(0,n.useEffect)((()=>{V((0,N.Sc)("performance"))}),[]),(0,g.jsxs)(n.Fragment,{children:[(0,g.jsx)(T.Z,{label:"Performance",actions:(0,g.jsx)(k.Z,{})}),(0,g.jsxs)(l.Xgh,{children:[!z&&(0,g.jsx)(E.Z,{compactMode:!0}),e?(0,g.jsxs)(P.s,{scopes:[F.Ft.ADMIN_HEAL],resource:F.C3,children:[(0,g.jsxs)(l.xuv,{withBorders:!0,children:[(0,g.jsxs)(l.rjZ,{container:!0,children:[(0,g.jsxs)(l.rjZ,{item:!0,md:3,sm:12,children:[(0,g.jsx)(l.xuv,{sx:{fontSize:13,marginBottom:8},children:r?(0,g.jsxs)(n.Fragment,{children:["Speedtest in progress...",(0,g.jsx)(l.aNw,{style:{width:15,height:15}})]}):(0,g.jsx)(n.Fragment,{children:d&&!r?(0,g.jsx)("b",{children:"Speed Test results:"}):(0,g.jsx)("b",{children:"Performance test"})})}),(0,g.jsx)(l.xuv,{children:(0,g.jsx)(C.Z,{value:D,ready:null!==d&&!r,indeterminate:r,size:"small"})})]}),(0,g.jsx)(l.rjZ,{item:!0,md:4,sm:12,children:(0,g.jsx)("div",{style:{marginLeft:10,width:300},children:(0,g.jsx)(l.Wzg,{id:"size",name:"size",label:"Object Size",onChange:e=>{x(e.target.value)},noLabelMinWidth:!0,value:p,disabled:r||!z,overlayObject:(0,g.jsx)(S.Z,{id:"size-unit",onUnitChange:f,unitSelected:h,unitsList:[{label:"KiB",value:"KiB"},{label:"MiB",value:"MiB"},{label:"GiB",value:"GiB"}],disabled:r||!z})})})}),(0,g.jsx)(l.rjZ,{item:!0,md:4,sm:12,children:(0,g.jsx)("div",{style:{marginLeft:10,width:300},children:(0,g.jsx)(l.Wzg,{id:"duration",name:"duration",label:"Duration",onChange:e=>{e.target.validity.valid&&j(e.target.value)},noLabelMinWidth:!0,value:m,disabled:r||!z,overlayObject:(0,g.jsx)(S.Z,{id:"size-unit",onUnitChange:()=>{},unitSelected:"s",unitsList:[{label:"s",value:"s"}],disabled:r||!z}),pattern:"[0-9]*"})})}),(0,g.jsx)(l.rjZ,{item:!0,md:1,sm:12,sx:{textAlign:"center"},children:(0,g.jsx)(l.zxk,{onClick:()=>{z?(u(null),c(!0)):t("/support/register")},color:"primary",type:"button",id:"start-speed-test",variant:z&&null!==d&&!r?"callAction":"regular",disabled:""===m.trim()||""===p.trim()||r||!z,label:G})})]}),(0,g.jsx)(l.rjZ,{container:!0,children:(0,g.jsx)(l.rjZ,{item:!0,xs:12,children:(0,g.jsx)(n.Fragment,{children:(0,g.jsx)(l.rjZ,{item:!0,xs:12,children:null!==d&&(0,g.jsx)(n.Fragment,{children:(0,g.jsx)(w,{results:d,start:r})})})})})})]}),!r&&!d&&z&&(0,g.jsxs)(n.Fragment,{children:[(0,g.jsx)("br",{}),(0,g.jsx)(l.KfX,{title:"During the speed test all your production traffic will be temporarily suspended.",iconComponent:(0,g.jsx)(l.e6P,{}),help:(0,g.jsx)(n.Fragment,{})})]})]}):(0,g.jsx)(O.Z,{iconComponent:(0,g.jsx)(l.QBB,{}),entity:"Speedtest"})]})]})}},31460:(e,t,r)=>{"use strict";r.d(t,{Z:()=>l});var n=r(72791),o=r(57689),i=r(29945),s=r(80184);const l=e=>{let{compactMode:t=!1}=e;const r=(0,o.s0)(),l=(0,s.jsx)(i.zxk,{id:"go-to-register",type:"submit",variant:"callAction",color:"primary",onClick:()=>r("/support/register"),children:"Register your Cluster"}),a="Please use your MinIO Subscription Network login credentials to register this cluster and enable this feature.";return t?(0,s.jsxs)(n.Fragment,{children:[(0,s.jsx)(i.rjZ,{sx:{"& div.leftItems":{marginBottom:0}},children:(0,s.jsx)(i.KfX,{title:(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexGrow:1},children:[(0,s.jsx)("span",{children:a})," ",l]}),iconComponent:(0,s.jsx)(i.e6P,{}),help:null})}),(0,s.jsx)("br",{})]}):(0,s.jsx)(i.xuv,{sx:{padding:"25px",border:"1px solid #eaeaea",display:"flex",alignItems:"center",justifyContent:"center",flexFlow:"row",marginBottom:"15px",["@media (max-width: ".concat(i.Egj.sm,"px)")]:{flexFlow:"column"}},children:(0,s.jsxs)(i.rjZ,{container:!0,children:[(0,s.jsx)(i.rjZ,{item:!0,xs:12,children:(0,s.jsx)(i.xuv,{sx:{marginRight:"8px",fontSize:"16px",fontWeight:600,display:"flex",alignItems:"center","& .min-icon":{width:"83px",height:"14px",marginLeft:"5px",marginRight:"5px"}},children:"Register your cluster"})}),(0,s.jsx)(i.rjZ,{item:!0,xs:12,children:(0,s.jsx)(i.xuv,{sx:{display:"flex",flexFlow:"row",["@media (max-width: ".concat(i.Egj.sm,"px)")]:{flexFlow:"column"}},children:(0,s.jsxs)(i.xuv,{sx:{display:"flex",flexFlow:"column",flex:"2"},children:[(0,s.jsx)(i.xuv,{sx:{fontSize:"16px",display:"flex",flexFlow:"column",marginTop:"15px",marginBottom:"15px"},children:a}),(0,s.jsx)(i.xuv,{sx:{flex:"1"},children:(0,s.jsx)(i.xuv,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"},children:l})})]})})})]})})}},76998:(e,t,r)=>{"use strict";var n=r(42458),o={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var r,i,s,l,a,c,d=!1;t||(t={}),r=t.debug||!1;try{if(s=n(),l=document.createRange(),a=document.getSelection(),(c=document.createElement("span")).textContent=e,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",(function(n){if(n.stopPropagation(),t.format)if(n.preventDefault(),"undefined"===typeof n.clipboardData){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var i=o[t.format]||o.default;window.clipboardData.setData(i,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e);t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))})),document.body.appendChild(c),l.selectNodeContents(c),a.addRange(l),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");d=!0}catch(u){r&&console.error("unable to copy using execCommand: ",u),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),d=!0}catch(u){r&&console.error("unable to copy using clipboardData: ",u),r&&console.error("falling back to prompt"),i=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(i,e)}}finally{a&&("function"==typeof a.removeRange?a.removeRange(l):a.removeAllRanges()),c&&document.body.removeChild(c),s()}return d}},94210:e=>{var t=function(){if("object"===typeof self&&self)return self;if("object"===typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;if("object"===typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return t()}try{return __global__||t()}finally{delete Object.prototype.__global__}}()},568:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var o=l(r(72791)),i=l(r(76998)),s=["text","onCopy","options","children"];function l(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){m(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function p(e,t){return p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},p(e,t)}function x(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=f(e);if(t){var i=f(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return h(e)}(this,r)}}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var j=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(a,e);var t,r,n,l=x(a);function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return m(h(e=l.call.apply(l,[this].concat(r))),"onClick",(function(t){var r=e.props,n=r.text,s=r.onCopy,l=r.children,a=r.options,c=o.default.Children.only(l),d=(0,i.default)(n,a);s&&s(n,d),c&&c.props&&"function"===typeof c.props.onClick&&c.props.onClick(t)})),e}return t=a,(r=[{key:"render",value:function(){var e=this.props,t=(e.text,e.onCopy,e.options,e.children),r=d(e,s),n=o.default.Children.only(t);return o.default.cloneElement(n,c(c({},r),{},{onClick:this.onClick}))}}])&&u(t.prototype,r),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(o.default.PureComponent);t.CopyToClipboard=j,m(j,"defaultProps",{onCopy:void 0,options:void 0})},78029:(e,t,r)=>{"use strict";var n=r(568).CopyToClipboard;n.CopyToClipboard=n,e.exports=n},42458:e=>{e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||r.forEach((function(t){e.addRange(t)})),t&&t.focus()}}},95087:(e,t,r)=>{var n;if("object"===typeof globalThis)n=globalThis;else try{n=r(94210)}catch(l){}finally{if(n||"undefined"===typeof window||(n=window),!n)throw new Error("Could not determine global this")}var o=n.WebSocket||n.MozWebSocket,i=r(51496);function s(e,t){return t?new o(e,t):new o(e)}o&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(e){Object.defineProperty(s,e,{get:function(){return o[e]}})})),e.exports={w3cwebsocket:o?s:null,version:i}},51496:(e,t,r)=>{e.exports=r(19794).version},19794:e=>{"use strict";e.exports={version:"1.0.34"}}}]);
|
|
//# sourceMappingURL=5962.2740ada4.chunk.js.map
|