@deephaven/embed-widget 1.27.0 → 1.27.2-aug-wrap-widget-plugins.5279f7f.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/{App-DSLaFds0.js → App-DNWJ4W-i.js} +2 -2
- package/build/assets/{App-DSLaFds0.js.map → App-DNWJ4W-i.js.map} +1 -1
- package/build/assets/{Chart-BIZSO5tm.js → Chart-DM-Tszm9.js} +2 -2
- package/build/assets/{Chart-BIZSO5tm.js.map → Chart-DM-Tszm9.js.map} +1 -1
- package/build/assets/{IrisGrid-Cwy1Vd_-.js → IrisGrid-Bsml4M6H.js} +2 -2
- package/build/assets/{IrisGrid-Cwy1Vd_-.js.map → IrisGrid-Bsml4M6H.js.map} +1 -1
- package/build/assets/{IrisGridContextProvider-C4ZH3_z7.js → IrisGridContextProvider-BqnbH2oX.js} +2 -2
- package/build/assets/{IrisGridContextProvider-C4ZH3_z7.js.map → IrisGridContextProvider-BqnbH2oX.js.map} +1 -1
- package/build/assets/{LocalWorkspaceStorage-BFJMla1i.js → LocalWorkspaceStorage-BihvyOuh.js} +2 -2
- package/build/assets/{LocalWorkspaceStorage-BFJMla1i.js.map → LocalWorkspaceStorage-BihvyOuh.js.map} +1 -1
- package/build/assets/{LogPanel-CUZCCiyF.js → LogPanel-BwioMIh3.js} +2 -2
- package/build/assets/{LogPanel-CUZCCiyF.js.map → LogPanel-BwioMIh3.js.map} +1 -1
- package/build/assets/{MarkdownEditor-CCo2rTD1.js → MarkdownEditor-CDjOeGzs.js} +2 -2
- package/build/assets/{MarkdownEditor-CCo2rTD1.js.map → MarkdownEditor-CDjOeGzs.js.map} +1 -1
- package/build/assets/{MarkdownNotebook-CNLlpcH_.js → MarkdownNotebook-DqJmLezi.js} +2 -2
- package/build/assets/{MarkdownNotebook-CNLlpcH_.js.map → MarkdownNotebook-DqJmLezi.js.map} +1 -1
- package/build/assets/{index-B0bvaSM0.js → index-BdMysPSQ.js} +3 -3
- package/build/assets/{index-B0bvaSM0.js.map → index-BdMysPSQ.js.map} +1 -1
- package/build/assets/{index-BAB2qN3d.js → index-CE0yiDFa.js} +37 -37
- package/build/assets/index-CE0yiDFa.js.map +1 -0
- package/build/assets/{index-UbUxOGRU.js → index-CPHSUC7F.js} +2 -2
- package/build/assets/{index-UbUxOGRU.js.map → index-CPHSUC7F.js.map} +1 -1
- package/build/index.html +2 -2
- package/package.json +17 -17
- package/build/assets/index-BAB2qN3d.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Plot-C8Kve-C1.js","./Plotly-BhI4bqBP.js","./plotly-Datjy74r.js","./helpers-BosuxZz1.js","./vendor-BilN2oal.js","./vendor-BSYTbjlr.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{ao as Mu,a as U,aO as js,T as Au,X as ju,Y as ku,V as Nu,a4 as Lu,O as Ru,z as $u,a8 as Fu,d as ks,G as Ns,e as Ls,q as Hu,aP as Uu,aH as Bu,aQ as Rs,aR as Wu,aS as Ku,L as Kn,ac as zu,_ as Vu,aT as $s,u as W,t as Fs,Z as Gu,aU as Xu,aN as qu,aJ as Hs,aK as Zu,f as Us,n as Yu,aL as ai,aV as Ju,aW as Qu,aX as to,aY as ed,aZ as td,a_ as nd,a$ as rd,v as id,k as Bs,aF as od,h as Gr,aA as ad,b0 as sd,b1 as no,aD as ld,b2 as ro,b3 as Ws,b4 as ud,au as dd,b5 as cd,b6 as hd,b7 as md,b8 as pd,b9 as fd,ba as vd}from"./index-
|
|
2
|
+
import{ao as Mu,a as U,aO as js,T as Au,X as ju,Y as ku,V as Nu,a4 as Lu,O as Ru,z as $u,a8 as Fu,d as ks,G as Ns,e as Ls,q as Hu,aP as Uu,aH as Bu,aQ as Rs,aR as Wu,aS as Ku,L as Kn,ac as zu,_ as Vu,aT as $s,u as W,t as Fs,Z as Gu,aU as Xu,aN as qu,aJ as Hs,aK as Zu,f as Us,n as Yu,aL as ai,aV as Ju,aW as Qu,aX as to,aY as ed,aZ as td,a_ as nd,a$ as rd,v as id,k as Bs,aF as od,h as Gr,aA as ad,b0 as sd,b1 as no,aD as ld,b2 as ro,b3 as Ws,b4 as ud,au as dd,b5 as cd,b6 as hd,b7 as md,b8 as pd,b9 as fd,ba as vd}from"./index-BdMysPSQ.js";import{r as m,ag as zn,bt as Mr,D as d,bJ as gd,J as k,G as B,bK as Ks,bL as si,H as bd,R as xi,bM as yd,bv as Sd,I as me,C as Pt,bN as Cd,a7 as _d,a8 as wd,E as zs,af as vn,bO as Ed,bP as Pd,bQ as Td,bR as Od,bG as li,bS as O,bT as io,bI as pe,L as Vs,N as Gs,bU as Id,bH as Vn,bD as _n,_ as xd,be as Re,bV as Dd,ab as Md,av as Ad,bh as oo,bW as jd,bX as ao,bg as rt,bY as Xs,bZ as kd,bE as nt,bF as tn,b_ as so,bf as Nd,bC as Ld,b$ as Fn}from"./vendor-BilN2oal.js";var Rd=Object.freeze([]),wS=new Map,qs=()=>{};function ES(n){return Array.isArray(n)?n:[n]}function PS(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.filter(r=>r!=null)}function $d(n,e,t){return(e=Fd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fd(n){var e=Hd(n,"string");return typeof e=="symbol"?e:e+""}function Hd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class lo extends Error{constructor(){super(...arguments),$d(this,"isCanceled",!0)}}function Ud(n,e,t){return(e=Bd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bd(n){var e=Wd(n,"string");return typeof e=="symbol"?e:e+""}function Wd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Kd extends Error{constructor(){super(...arguments),Ud(this,"isClipboardPermissionsDeniedError",!0)}}function zd(n,e,t){return(e=Vd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vd(n){var e=Gd(n,"string");return typeof e=="symbol"?e:e+""}function Gd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Xr extends Error{constructor(){super(...arguments),zd(this,"isClipboardUnavailableError",!0)}}function Xd(n,e,t){return(e=qd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qd(n){var e=Zd(n,"string");return typeof e=="symbol"?e:e+""}function Zd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Zs extends Error{constructor(){super(...arguments),Xd(this,"isPermissionUnsupported",!0)}}function uo(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Yd(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){uo(o,r,i,a,s,"next",l)}function s(l){uo(o,r,i,a,s,"throw",l)}a(void 0)})}}function co(n){return ui.apply(this,arguments)}function ui(){return ui=Yd(function*(n){try{var e=n;return(yield navigator.permissions.query({name:e})).state}catch(t){throw t instanceof TypeError?new Zs:t}}),ui.apply(this,arguments)}function ho(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Ys(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){ho(o,r,i,a,s,"next",l)}function s(l){ho(o,r,i,a,s,"throw",l)}a(void 0)})}}function Js(n){return di.apply(this,arguments)}function di(){return di=Ys(function*(n){var e=navigator,t=e.clipboard;if(t!==void 0)try{return yield navigator.clipboard.writeText(n)}catch{}Jd(n)}),di.apply(this,arguments)}function Jd(n){var e=document.activeElement,t=document.createElement("textarea");t.value=n,document.body.appendChild(t),t.focus(),t.select();var r=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!r)throw new Error("Unable to execute copy command")}function TS(){return ci.apply(this,arguments)}function ci(){return ci=Ys(function*(){try{var n=navigator,e=n.clipboard;if(e===void 0)throw new Xr;var t=yield co("clipboard-read");if(t==="granted"){var r=yield e.readText();return r}if(t==="prompt"){try{yield e.readText()}catch{}if(t=yield co("clipboard-read"),t==="granted"){var i=yield e.readText();return i}}if(t==="prompt"||t==="denied")throw new Kd}catch(o){throw o instanceof Zs?new Xr:o}throw new Xr}),ci.apply(this,arguments)}var Mn;function on(n,e,t){return(e=Qd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Qd(n){var e=ec(n,"string");return typeof e=="symbol"?e:e+""}function ec(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var tc="table_",Qs="column_",nc=new Set(["in","not","i","ii","k"]),rc=new Set(["abstract","continue","for","new","switch","assert","default","if","package","synchronized","boolean","do","goto","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","null","true","false"]),ic=/[^a-zA-Z0-9_$\-+@]/g,oc=/[^A-Za-z0-9_$]/g,ac=/^[a-zA-Z_$][a-zA-Z0-9_$\-+@]*$/,sc=/[^a-zA-Z0-9_]/g;function lc(n){return n.replace(/[ -]/g,"_")}function uc(n){return n.replace(/\s/g,"_")}class gt{}Mn=gt;on(gt,"legalize",(n,e,t,r,i,o)=>{var a=e(n.trim());return i&&(nc.has(a)||rc.has(a))&&(a=t+a),a=a.replace(r,""),a?(/^[0-9-]/.test(a)&&(a=t+a),a):t+o});on(gt,"legalizeTableName",n=>Mn.legalize(n,uc,tc,ic,!1,0));on(gt,"makeVariableName",n=>Mn.legalizeTableName(n).replace(sc,"_"));on(gt,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,r)=>{var i=Mn.legalizeColumnName(t,r);e.includes(i)&&(i=Qs+r),e.push(i)}),e});on(gt,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Mn.legalize(n,lc,Qs,oc,!0,e)});on(gt,"isValidTableName",n=>ac.test(n));on(gt,"isValidColumnName",n=>Mn.legalizeColumnName(n)===n);class el extends CustomEvent{constructor(e,t){super(e,t)}}class Je{static makeCancelable(e,t){var r=!1,i,o,a=new Promise((s,l)=>{o=l,Promise.resolve(e).then(u=>{r?t&&t(u):(i=u,s(u))}).catch(u=>l(u))});return a.cancel=()=>{r=!0,o(new lo),i!=null&&t&&t(i)},a}static isCanceled(e){return e instanceof lo}static isTimedOut(e){return e instanceof Mu}static withTimeout(e,t){return new Promise((r,i)=>{setTimeout(()=>{try{r(t())}catch(o){i(o)}},e)})}}function mo(n,e,t){return(e=dc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dc(n){var e=cc(n,"string");return typeof e=="symbol"?e:e+""}function cc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ar{constructor(){mo(this,"pending",[]),mo(this,"resolved",[])}add(e,t){var r=Je.makeCancelable(e,t);return this.pending.push(r),r.then(()=>{this.resolve(r)},()=>{this.resolve(r)}),r}remove(e){for(var t=0;t<this.pending.length;t+=1)if(this.pending[t]===e){this.pending.splice(t,1);return}}resolve(e){this.remove(e),this.resolved.push(e)}cancel(){for(var e=[...this.pending,...this.resolved],t=0;t<e.length;t+=1)e[t].cancel();this.pending=[],this.resolved=[]}}function OS(n){var e=n;n instanceof CustomEvent&&(e=n.detail);var t="";if(e instanceof Error?t=e.message:e!=null&&(t="".concat(e)),t=t.trim(),t.length>0)return t}function po(n,e){return fc(n)||pc(n,e)||mc(n,e)||hc()}function hc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mc(n,e){if(n){if(typeof n=="string")return fo(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?fo(n,e):void 0}}function fo(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function pc(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function fc(n){if(Array.isArray(n))return n}class lt{static isValidRange(e){return e!=null&&e.length===2&&Number.isInteger(e[0])&&Number.isInteger(e[1])&&e[0]<=e[1]}static validateRange(e){if(!lt.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var r=0;r<e.length;r+=1){var i=e[r],o=i[0],a=i[1];if(o<=t&&t<=a)return!0}return!1}static selectRange(e,t){for(var r=po(t,2),i=r[0],o=r[1],a=[...e],s=a.length-1;s>=0;s-=1){var l=a[s],u=l[0],c=l[1];if(u<=i&&o<=c)return a;i<=c&&u<=o&&(i=Math.min(i,u),o=Math.max(o,c),a.splice(s,1))}return a.push([i,o]),a}static deselectRange(e,t){for(var r=po(t,2),i=r[0],o=r[1],a=[...e],s=a.length-1;s>=0;s-=1){var l=a[s],u=l[0],c=l[1];if(!(o<u||c<i))if(u<i&&o<c){a[s]=[u,i-1],a.splice(s+1,0,[o+1,c]);break}else i<=u&&c<=o?a.splice(s,1):u<i?a[s]=[u,i-1]:a[s]=[o+1,c]}return a}static count(e){return e.reduce((t,r)=>t+(r[1]-r[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((r,i)=>{for(var o=[...r],a=i[0];a<=i[1];a+=1)o.push(e[a]);return o},[])}}function*IS(n,e){for(var t=n;t<=e;++t)yield t}var xS=" ";class vc{static join(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"and";if(e==null||e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return"".concat(e[0]," ").concat(t," ").concat(e[1]);var r=e.slice(0,e.length-1).join(", "),i=e[e.length-1];return"".concat(r,", ").concat(t," ").concat(i)}static toLower(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==null){if(t)return"";throw new Error("Null string passed in to TextUtils.toLower")}return e.toLowerCase()}static sort(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e<t?r?-1:1:e>t?r?1:-1:0}static pluralize(e,t,r){return e===1?t:r??"".concat(t,"s")}}var Gn;function Wt(n,e,t){return(e=gc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gc(n){var e=bc(n,"string");return typeof e=="symbol"?e:e+""}function bc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class He{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(r>0||t>0?"".concat(r,"m "):"")+"".concat(e>=60?"".concat(i,"s").padStart(3,"0"):"".concat(i,"s"))}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=String(Math.floor(e/(60*60))).padStart(2,"0"),r=e%(60*60),i=String(Math.floor(r/60)).padStart(2,"0"),o=r%60,a=String(Math.ceil(o)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(a)}static isTimeString(e){return new RegExp(He.TIME_PATTERN).test(e)}static parseTime(e){if(e==null||typeof e!="string")throw new Error("".concat(e," is not a valid string"));var t=e.split(":");if(t.length!==3)throw new Error("".concat(e," is not a time string that can be parsed"));return Number(t[0])*60*60+Number(t[1])*60+Number(t[2])}static formatDuration(e){var t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return t>0?"".concat(t,"h ").concat(r,"m ").concat(i,"s"):r>0?"".concat(r,"m ").concat(i.toFixed(1),"s"):"".concat(i.toFixed(2),"s")}static formatConvertedDuration(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"ms";if(e==null||t===""||t===0||t==null)return null;var i=1,o=null,a=null;if(r==="ms")i=1e3,o=new Date(e).valueOf(),a=new Date(t).valueOf();else if(r==="ns")i=1e9,o=Number(e),a=Number(t);else return null;var s=(a-o)/i;return this.formatDuration(s)}}Gn=He;Wt(He,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");Wt(He,"MILLIS_PER_SECOND",1e3);Wt(He,"NANOS_PER_SECOND",1e9);Wt(He,"NANOS_PER_MIN",60*Gn.NANOS_PER_SECOND);Wt(He,"NANOS_PER_HOUR",60*Gn.NANOS_PER_MIN);Wt(He,"MILLIS_PER_MIN",60*Gn.MILLIS_PER_SECOND);Wt(He,"MILLIS_PER_HOUR",60*Gn.MILLIS_PER_MIN);Wt(He,"TIME_ZONES",Object.freeze([{label:"Tokyo UTC+9 No DST",value:"Asia/Tokyo"},{label:"Seoul UTC+9 No DST",value:"Asia/Seoul"},{label:"Hong Kong UTC+8 No DST",value:"Asia/Hong_Kong"},{label:"Singapore UTC+8 No DST",value:"Asia/Singapore"},{label:"Kolkata UTC+5:30 No DST",value:"Asia/Kolkata"},{label:"Berlin UTC+1",value:"Europe/Berlin"},{label:"UTC UTC±0 No DST",value:"UTC"},{label:"London UTC±0",value:"Europe/London"},{label:"Sao Paulo UTC-2",value:"America/Sao_Paulo"},{label:"Newfoundland UTC-3:30",value:"America/St_Johns"},{label:"Halifax UTC-4",value:"America/Halifax"},{label:"New York UTC−5",value:"America/New_York"},{label:"Chicago UTC-6",value:"America/Chicago"},{label:"Denver UTC-7",value:"America/Denver"},{label:"Los Angeles UTC-8",value:"America/Los_Angeles"},{label:"Anchorage UTC-9",value:"America/Anchorage"},{label:"Honolulu UTC-10 No DST",value:"Pacific/Honolulu"},{label:"Zurich UTC+1",value:"Europe/Zurich"},{label:"Amsterdam UTC+1",value:"Europe/Amsterdam"},{label:"Taipei UTC+8 No DST",value:"Asia/Taipei"},{label:"Sydney UTC+10",value:"Australia/Sydney"}]));function yc(n,e,t){return(e=Sc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Sc(n){var e=Cc(n,"string");return typeof e=="symbol"?e:e+""}function Cc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Hn extends Error{constructor(){super(...arguments),yc(this,"isInvalid",!0)}}function tl(){var n=m.useRef(!1);return m.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function vo(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function _c(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){vo(o,r,i,a,s,"next",l)}function s(l){vo(o,r,i,a,s,"throw",l)}a(void 0)})}}var wc=U.module("useAsyncInterval");function Ec(n,e){var t=tl(),r=m.useRef(0),i=m.useRef(0),o=m.useRef(null),a=m.useCallback(_c(function*(){var s=Date.now();i.current+=1;var l=o.current==null?e:s-o.current;o.current=s;try{yield n()}catch(h){wc.error("A tick error occurred:",h)}if(t.current){l+=Date.now()-o.current;var u=Math.max(0,l-e),c=Math.max(0,e-u);r.current=window.setTimeout(a,c)}}),[n,t,e]);m.useEffect(()=>(o.current=null,a(),()=>{window.clearTimeout(r.current)}),[e,a])}function Xn(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"No value available in context. Was code wrapped in a provider?",t=m.useContext(n);if(t==null)throw new Error(e);return t}function Pc(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=t.leading,i=r===void 0?!1:r,o=t.trailing,a=o===void 0?!0:o,s=t.maxWait,l=m.useMemo(()=>zn(n,e,s!=null?{leading:i,trailing:a,maxWait:s}:{leading:i,trailing:a}),[n,e,i,a,s]);return m.useEffect(()=>()=>l.cancel(),[l]),l}function Tc(n){var e=m.useRef();return m.useEffect(function(){e.current=n}),e.current}function Oc(n,e,t){var r=m.useRef(t),i=m.useRef(n);i.current=n;var o=m.useMemo(()=>Mr(function(){return i.current(...arguments)},e,r.current),[e]);return m.useEffect(()=>()=>{var a,s;(a=(s=r.current)===null||s===void 0?void 0:s.flushOnUnmount)!==null&&a!==void 0&&a?o.flush():o.cancel()},[o]),o}function nl(n){var e=m.useRef(null);return m.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}function Ic(n,e){return Ac(n)||Mc(n,e)||Dc(n,e)||xc()}function xc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dc(n,e){if(n){if(typeof n=="string")return go(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?go(n,e):void 0}}function go(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Mc(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Ac(n){if(Array.isArray(n))return n}var jc=3500,kc=U.module("useCopyToClipboard");function Nc(){var n=m.useState(!1),e=Ic(n,2),t=e[0],r=e[1],i=m.useRef(null),o=m.useCallback(a=>{Js(a).then(()=>{r(!0)}).catch(s=>kc.error("Unable to copy ".concat(a),`
|
|
5
5
|
`,s))},[]);return m.useEffect(()=>(i.current&&clearTimeout(i.current),t&&(i.current=setTimeout(()=>{r(!1)},jc)),()=>{i.current&&clearTimeout(i.current)}),[t]),[t,o]}var Lc=["gray-50","gray-75","gray-100","gray-200","gray-300","gray-400","gray-500","gray-600","gray-700","gray-800","gray-900","red-100","red-200","red-300","red-400","red-500","red-600","red-700","red-800","red-900","red-1000","red-1100","red-1200","red-1300","red-1400","orange-100","orange-200","orange-300","orange-400","orange-500","orange-600","orange-700","orange-800","orange-900","orange-1000","orange-1100","orange-1200","orange-1300","orange-1400","yellow-100","yellow-200","yellow-300","yellow-400","yellow-500","yellow-600","yellow-700","yellow-800","yellow-900","yellow-1000","yellow-1100","yellow-1200","yellow-1300","yellow-1400","chartreuse-100","chartreuse-200","chartreuse-300","chartreuse-400","chartreuse-500","chartreuse-600","chartreuse-700","chartreuse-800","chartreuse-900","chartreuse-1000","chartreuse-1100","chartreuse-1200","chartreuse-1300","chartreuse-1400","celery-100","celery-200","celery-300","celery-400","celery-500","celery-600","celery-700","celery-800","celery-900","celery-1000","celery-1100","celery-1200","celery-1300","celery-1400","green-100","green-200","green-300","green-400","green-500","green-600","green-700","green-800","green-900","green-1000","green-1100","green-1200","green-1300","green-1400","seafoam-100","seafoam-200","seafoam-300","seafoam-400","seafoam-500","seafoam-600","seafoam-700","seafoam-800","seafoam-900","seafoam-1000","seafoam-1100","seafoam-1200","seafoam-1300","seafoam-1400","cyan-100","cyan-200","cyan-300","cyan-400","cyan-500","cyan-600","cyan-700","cyan-800","cyan-900","cyan-1000","cyan-1100","cyan-1200","cyan-1300","cyan-1400","blue-100","blue-200","blue-300","blue-400","blue-500","blue-600","blue-700","blue-800","blue-900","blue-1000","blue-1100","blue-1200","blue-1300","blue-1400","indigo-100","indigo-200","indigo-300","indigo-400","indigo-500","indigo-600","indigo-700","indigo-800","indigo-900","indigo-1000","indigo-1100","indigo-1200","indigo-1300","indigo-1400","purple-100","purple-200","purple-300","purple-400","purple-500","purple-600","purple-700","purple-800","purple-900","purple-1000","purple-1100","purple-1200","purple-1300","purple-1400","fuchsia-100","fuchsia-200","fuchsia-300","fuchsia-400","fuchsia-500","fuchsia-600","fuchsia-700","fuchsia-800","fuchsia-900","fuchsia-1000","fuchsia-1100","fuchsia-1200","fuchsia-1300","fuchsia-1400","magenta-100","magenta-200","magenta-300","magenta-400","magenta-500","magenta-600","magenta-700","magenta-800","magenta-900","magenta-1000","magenta-1100","magenta-1200","magenta-1300","magenta-1400","negative","notice","positive","info","accent","accent-100","accent-200","accent-300","accent-400","accent-500","accent-600","accent-700","accent-800","accent-900","accent-1000","accent-1100","accent-1200","accent-1300","accent-1400","bg","content-bg","subdued-content-bg","surface-bg","fg"];function Rc(n){return typeof n=="string"&&Lc.includes(n)}function rl(n){return n!=null&&Rc(n)?"var(--dh-color-".concat(n,")"):n}var $c=["color","UNSAFE_style"];function bo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ar(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?bo(Object(t),!0).forEach(function(r){Fc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):bo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Fc(n,e,t){return(e=Hc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Hc(n){var e=Uc(n,"string");return typeof e=="symbol"?e:e+""}function Uc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Bc(n,e){if(n==null)return{};var t,r,i=Wc(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function Wc(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var il=m.forwardRef((n,e)=>{var t=n.color,r=n.UNSAFE_style,i=Bc(n,$c),o=m.useMemo(()=>ar(ar({},r),{},{color:rl(t)}),[t,r]);return d.jsx(gd,ar(ar({},i),{},{ref:e,UNSAFE_style:o}))});il.displayName="Text";function yo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function At(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?yo(Object(t),!0).forEach(function(r){gn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):yo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function gn(n,e,t){return(e=Kc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Kc(n){var e=zc(n,"string");return typeof e=="symbol"?e:e+""}function zc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var So="popper",Vc="popper-container",Gc={placement:"bottom-end",modifiers:{preventOverflow:{boundariesElement:"scrollParent",fn:(n,e)=>{var t,r,i=(t=Ks.Defaults.modifiers)===null||t===void 0||(t=t.preventOverflow)===null||t===void 0||(r=t.fn)===null||r===void 0?void 0:r.call(t,n,e);return i==null?n:(i.styles.maxHeight="".concat(document.documentElement.clientHeight-n.offsets.popper.top-2*e.padding,"px"),i??n)}},flip:{enabled:!1}}};class jr extends m.Component{constructor(e){super(e),gn(this,"element",void 0),gn(this,"container",void 0),gn(this,"nodeRef",k.createRef()),gn(this,"rAF",void 0),this.handleEnter=this.handleEnter.bind(this),this.handleExit=this.handleExit.bind(this),this.handleBlur=this.handleBlur.bind(this),this.element=document.createElement("div"),this.updateContainerClassName(e.containerClassName,e.isMaximized),this.container=k.createRef(),this.rAF=0;var t=this.props.isShown;this.state={show:t,popper:null}}componentDidUpdate(e){var t=this.props,r=t.isShown,i=t.containerClassName,o=t.isMaximized,a=this.state.popper;(e.containerClassName!==i||e.isMaximized!==o)&&this.updateContainerClassName(i,o),e.isShown!==r&&(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{r?this.show():this.hide()})),a&&a.scheduleUpdate()}componentWillUnmount(){this.destroyPopper(!1)}updateContainerClassName(e,t){this.element.className=B(Vc,e,{maximized:t})}getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){var e,t,r=this.state.popper,i=this.props,o=i.closeOnBlur,a=i.referenceObject;if(!r&&this.container.current!==null){var s=this.props,l=s.options,u=s.keepInParent,c=u?Gc:{placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},h=At(At(At({},c),l),{},{modifiers:At(At(At({},c.modifiers),l.modifiers),{},{preventOverflow:At(At({},(e=c.modifiers)===null||e===void 0?void 0:e.preventOverflow),(t=l.modifiers)===null||t===void 0?void 0:t.preventOverflow)})});document.body.appendChild(this.element);var p=this.getVisibleElement(this.container.current);p==null&&(p=this.container.current);var f=new Ks(a||p,this.element,h);f.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(o){var v=this.element.querySelector(".".concat(So));v instanceof HTMLElement&&!v.contains(document.activeElement)&&v.focus()}}),si.flushSync(()=>{this.setState({popper:f})})}}destroyPopper(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;cancelAnimationFrame(this.rAF);var t=this.state.popper;t&&(t.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),e&&this.setState({popper:null}))}show(){this.initPopper(),si.flushSync(()=>{this.setState({show:!0})})}hide(){this.setState({show:!1})}scheduleUpdate(){var e=this.state.popper;e&&e.scheduleUpdate()}handleBlur(e){var t=this.props,r=t.closeOnBlur,i=t.onBlur;e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||(i==null||i(e),r&&this.hide()))}handleEnter(){var e=this.props.onEntered;e()}handleExit(){var e=this.props.onExited,t=this.state.show;t||this.destroyPopper(),e()}renderContent(){var e=this.props,t=e.className,r=e.children,i=e.timeout,o=e.interactive,a=e.closeOnBlur,s=this.state.show;return d.jsx(js,{isPortal:!0,children:d.jsx(bd,{in:s,timeout:i,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,nodeRef:this.nodeRef,children:d.jsx("div",{ref:this.nodeRef,onClick:l=>{l.stopPropagation()},onKeyDown:l=>{l.key==="Escape"&&this.hide()},className:B(So,{interactive:o},t),onBlur:this.handleBlur,tabIndex:a?-1:void 0,role:"presentation",children:d.jsxs("div",{className:"popper-content",children:[r,d.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})})}render(){var e=this.state.popper,t=this.props["data-testid"];return d.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&xi.createPortal(this.renderContent(),this.element)})}}gn(jr,"defaultProps",{options:{},className:"",containerClassName:"",isMaximized:!1,timeout:Au.transitionMs,onEntered(){},onExited(){},onBlur(){},isShown:!1,interactive:!1,closeOnBlur:!1,keepInParent:!1,referenceObject:null,"data-testid":void 0});var hi;function Co(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Xc(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Co(Object(t),!0).forEach(function(r){ut(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Co(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ut(n,e,t){return(e=qc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qc(n){var e=Zc(n,"string");return typeof e=="symbol"?e:e+""}function Zc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Yc=U.module("Tooltip");class ue extends m.Component{static handleHidden(){ue.shownTooltipCount-=1,ue.shownTooltipCount===0&&(ue.lastHiddenTime=Date.now())}static handleShown(){ue.shownTooltipCount+=1}constructor(e){super(e),ut(this,"container",void 0),ut(this,"popper",void 0),ut(this,"parent",void 0),ut(this,"timer",void 0),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowMouseMove=this.handleWindowMouseMove.bind(this),this.handleWheel=this.handleWheel.bind(this),this.handleTimeout=this.handleTimeout.bind(this),this.handleExited=this.handleExited.bind(this),this.stopShowingTooltip=this.stopShowingTooltip.bind(this),this.container=k.createRef(),this.popper=k.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}componentDidMount(){this.startListening();var e=this.props.timeout;e===0&&this.show()}componentDidUpdate(e,t){var r=t.isShown,i=this.state.isShown;i!==r&&(i?ue.handleShown():ue.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var e=this.state.isShown;e&&ue.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){Yc.error("Tooltip doesn't have a container or a parent set!");return}this.parent=this.container.current.parentElement,this.parent.addEventListener("mousemove",this.handleMouseMove),this.parent.addEventListener("mouseleave",this.handleMouseLeave),this.parent.addEventListener("mousedown",this.stopShowingTooltip)}stopListening(){this.parent&&(this.parent.removeEventListener("mousemove",this.handleMouseMove),this.parent.removeEventListener("mouseleave",this.handleMouseLeave),this.parent.removeEventListener("mousedown",this.stopShowingTooltip))}startListeningWindow(){window.addEventListener("mousemove",this.handleWindowMouseMove,!0),window.addEventListener("contextmenu",this.stopShowingTooltip,!0),window.addEventListener("wheel",this.handleWheel)}stopListeningWindow(){window.removeEventListener("mousemove",this.handleWindowMouseMove,!0),window.removeEventListener("contextmenu",this.stopShowingTooltip,!0),window.removeEventListener("wheel",this.handleWheel)}handleMouseMove(){this.startTimer()}handleWheel(){var e=this.state.isShown;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){var e=this.state.isShown;this.stopTimer();var t=this.props.interactive;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){var t=e.clientX,r=e.clientY,i=this.state.isShown;if(!(!this.popper.current||!this.parent)){var o=this.popper.current.element.getBoundingClientRect(),a=this.parent.getBoundingClientRect();t>=o.left&&t<=o.left+o.width&&r>=o.top&&r<=o.top+o.height?this.handleMouseMove():t>=a.left&&t<=a.left+a.width&&r>=a.top&&r<=a.top+a.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var e=this.props,t=e.timeout,r=e.reshowTimeout,i=t;(ue.shownTooltipCount>0||Date.now()-ue.lastHiddenTime<ue.triggerReshowThreshold)&&(i=r),this.timer=window.setTimeout(this.handleTimeout,i)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){var e=this.state.isShown;if(this.stopTimer(),!e){var t;(t=this.popper.current)===null||t===void 0||t.show(),si.flushSync(()=>{this.setState({isShown:!0})});var r=this.props.interactive;r&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)===null||e===void 0||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});var e=this.props.onExited;e()}stopShowingTooltip(){var e=this.state.isShown;this.stopTimer(),e&&this.hide()}render(){var e=this.props,t=e.interactive,r=e.children,i=e.referenceObject,o=e.popperClassName,a=e["data-testid"],s=e.onEntered,l=this.state.isShown,u=this.props.options;return u=Xc({placement:"bottom"},u),d.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":a,children:d.jsx(jr,{className:B(o,"popper-tooltip"),options:u,ref:this.popper,onEntered:s,onExited:this.handleExited,interactive:t,referenceObject:i,children:d.jsxs("div",{className:"tooltip-content",children:[" ",l&&r]})})})}}hi=ue;ut(ue,"defaultTimeout",500);ut(ue,"defaultReshowTimeout",100);ut(ue,"triggerReshowThreshold",300);ut(ue,"shownTooltipCount",0);ut(ue,"lastHiddenTime",Date.now());ut(ue,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:hi.defaultReshowTimeout,timeout:hi.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});function _o(n,e){return th(n)||eh(n,e)||Qc(n,e)||Jc()}function Jc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
@@ -43,4 +43,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
43
43
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function K0(n,e){if(n){if(typeof n=="string")return Cs(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Cs(n,e):void 0}}function Cs(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function z0(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function V0(n){if(Array.isArray(n))return n}var _s=U.module("FileListItemEditor"),G0=()=>Promise.resolve();function X0(n){var e=n.item,t=n.onCancel,r=n.onSubmit,i=n.validate,o=i===void 0?G0:i,a=m.useRef(null),s=m.useState(e.basename),l=ri(s,2),u=l[0],c=l[1],h=m.useState(),p=ri(h,2),f=p[0],v=p[1],g=m.useState(Promise.resolve()),b=ri(g,2),y=b[0],S=b[1],C=m.useCallback(()=>{var x;(x=a.current)===null||x===void 0||x.focus()},[a]),_=m.useCallback(x=>x.stopPropagation(),[]),w=m.useCallback(()=>{y.then(()=>{r(u)}).catch(x=>_s.info("Unable to validate name",x))},[r,u,y]);m.useEffect(function(){var A=Je.makeCancelable(o(u));return A.then(()=>v(void 0)).catch(L=>{Je.isCanceled(L)||v(L)}),S(A),()=>A.cancel()},[o,u]),m.useEffect(function(){C()},[C]);var D=m.useCallback(()=>{_s.debug2("handleBlur"),w()},[w]),F=m.useCallback(x=>{var A=x.target.value;c(A)},[]),N=m.useCallback(x=>{x.stopPropagation();var A=x.key;switch(A){case"Enter":{w();break}case"Escape":{t();break}}},[t,w]);return d.jsxs("div",{className:"file-list-item-editor",children:[d.jsx("input",{type:"text",className:B("form-control file-list-item-editor-input",{"is-invalid":f}),value:u,ref:a,onBlur:D,onKeyDown:N,onChange:F,onClick:_,onDoubleClick:_,onMouseDown:_}),f&&d.jsx("div",{className:"invalid-feedback",children:"".concat(f)})]})}function ws(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ii(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ws(Object(t),!0).forEach(function(r){q0(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ws(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function q0(n,e,t){return(e=Z0(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Z0(n){var e=Y0(n,"string");return typeof e=="symbol"?e:e+""}function Y0(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function oi(n,e){return tS(n)||eS(n,e)||Q0(n,e)||J0()}function J0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
44
44
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Q0(n,e){if(n){if(typeof n=="string")return Es(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Es(n,e):void 0}}function Es(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function eS(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function tS(n){if(Array.isArray(n))return n}function xu(n){var e=n.isMultiSelect,t=e===void 0?!1:e,r=n.focusedPath,i=n.showContextMenu,o=i===void 0?!1:i,a=n.onCreateFile,s=n.onCreateFolder,l=n.onCopy,u=n.onDelete,c=n.onMove,h=n.onRename,p=n.onSelect,f=n.onSelectionChange,v=n.table,g=n.rowHeight,b=g===void 0?Qi:g,y=n.validateRename,S=y===void 0?()=>Promise.resolve():y,C=m.useState(),_=oi(C,2),w=_[0],D=_[1],F=m.useState([]),N=oi(F,2),x=N[0],A=N[1],L=m.useState(),re=oi(L,2),j=re[0],X=re[1],ie=m.useCallback(M=>{A(M),f==null||f(M)},[f]),oe=m.useCallback(M=>{X(M)},[]),be=m.useCallback(()=>{j&&(l==null||l(j))},[j,l]),ye=m.useCallback(()=>{x.length>0&&(u==null||u(x))},[u,x]),Oe=m.useCallback(()=>{a==null||a()},[a]),we=m.useCallback(()=>{j&&(s==null||s($.getPath(j.filename)))},[j,s]),ce=m.useCallback(()=>{j&&D(j)},[j]),Z=m.useCallback(()=>{D(void 0)},[]),V=m.useCallback(M=>{w&&(h==null||h(w,M),D(void 0))},[h,w]),te=m.useMemo(()=>{if(w)return[];var M=[];return a&&M.push({title:"New File",description:"Create new file",action:Oe,group:de.groups.medium}),s&&M.push({title:"New Folder",description:"Create new folder",action:we,group:de.groups.medium}),l&&M.push({title:"Copy File",description:"Copy the selected file",action:be,group:de.groups.low,disabled:j==null||dt(j)}),u&&x.length>0&&M.push({title:"Delete",description:"Delete",shortcut:Ss.FILE_EXPLORER.DELETE,action:ye,group:de.groups.low}),h&&M.push({title:"Rename",description:"Rename",shortcut:Ss.FILE_EXPLORER.RENAME,action:ce,group:de.groups.low,disabled:j==null}),M},[be,ye,Oe,we,ce,j,l,a,s,u,h,x,w]),G=m.useCallback(M=>(W(w),S(w,M)),[w,S]),J=m.useCallback(M=>{var Ge=M.item;return w&&w.filename===Ge.filename?d.jsx(Ii,ii(ii({},M),{},{children:d.jsx(X0,{item:Ge,validate:G,onSubmit:V,onCancel:Z})})):d.jsx(Ii,ii({},M))},[Z,V,w,G]);return d.jsxs("div",{className:"file-list-container",children:[v!=null&&d.jsx(U0,{onMove:c,onSelect:p,onSelectionChange:ie,onFocusChange:oe,renderItem:J,rowHeight:b,table:v,isMultiSelect:t,focusedPath:r}),o&&d.jsx(de,{actions:te})]})}xu.displayName="FileListContainer";function Ps(n,e,t){return(e=nS(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nS(n){var e=rS(n,"string");return typeof e=="symbol"?e:e+""}function rS(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class _r extends Hn{constructor(e){super("Name already exists"),Ps(this,"isExistingFile",!0),Ps(this,"info",void 0),this.info=e}}function Ts(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Os(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Ts(o,r,i,a,s,"next",l)}function s(l){Ts(o,r,i,a,s,"throw",l)}a(void 0)})}}function Is(n,e){return sS(n)||aS(n,e)||oS(n,e)||iS()}function iS(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
45
45
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oS(n,e){if(n){if(typeof n=="string")return xs(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?xs(n,e):void 0}}function xs(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function aS(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function sS(n){if(Array.isArray(n))return n}var pt=U.module("FileExplorer");function eo(n){var e=n.storage,t=n.isMultiSelect,r=t===void 0?!1:t,i=n.focusedPath,o=n.onCopy,a=o===void 0?()=>{}:o,s=n.onDelete,l=s===void 0?()=>{}:s,u=n.onRename,c=u===void 0?()=>{}:u,h=n.onCreateFile,p=h===void 0?()=>{}:h,f=n.onCreateFolder,v=f===void 0?()=>{}:f,g=n.onSelect,b=n.onSelectionChange,y=n.rowHeight,S=y===void 0?Qi:y,C=m.useState([]),_=Is(C,2),w=_[0],D=_[1],F=m.useState(),N=Is(F,2),x=N[0],A=N[1];m.useEffect(function(){var te;function G(){return J.apply(this,arguments)}function J(){return J=Os(function*(){pt.debug("initTable"),te=Je.makeCancelable(e.getTable(),M=>M.close());try{A(yield te)}catch(M){Je.isCanceled(M)||pt.error("Unable to initialize table",M)}}),J.apply(this,arguments)}return G(),()=>{te.cancel()}},[e]);var L=m.useCallback(V=>{Je.isCanceled(V)||pt.error(V)},[]),re=m.useCallback(()=>{pt.debug("handleCreateFile"),p()},[p]),j=m.useCallback(()=>{pt.debug("handleCreateFolder"),v()},[v]),X=m.useCallback(V=>{pt.debug("handleCopyFile",V.filename),a(V)},[a]),ie=m.useCallback(V=>{pt.debug("handleDelete, pending confirmation",V),D(V)},[]),oe=m.useCallback(()=>{pt.debug("handleDeleteConfirm",w),w.forEach(V=>e.deleteFile(dt(V)?$.makePath(V.filename):V.filename)),l(w),D([])},[w,l,e]),be=m.useCallback(()=>{pt.debug("handleDeleteCancel"),D([])},[]),ye=m.useCallback((V,te)=>{var G=$.reducePaths(V.map(J=>dt(J)?$.makePath(J.filename):J.filename));G.forEach(J=>{var M=$.isPath(J)?"".concat(te).concat($.getBaseName(J.substring(0,J.length-1)),"/"):"".concat(te).concat($.getBaseName(J));e.moveFile(J,M).then(()=>{c(J,M)}).catch(L)})},[L,c,e]),Oe=m.useCallback((V,te)=>{var G=V.filename,J=dt(V);J&&!G.endsWith("/")&&(G="".concat(G,"/"));var M="".concat($.getParent(G)).concat(te);J&&!M.endsWith("/")&&(M="".concat(M,"/")),pt.debug2("handleRename",G,M),e.moveFile(G,M).catch(L),c(G,M)},[L,c,e]),we=m.useCallback(function(){var V=Os(function*(te,G){if(G!==te.basename){$.validateName(G);var J="".concat($.getPath(te.filename)).concat(G);try{var M=yield e.info(J);throw new _r(M)}catch(Ge){if(!(Ge instanceof Ji))throw Ge}}});return function(te,G){return V.apply(this,arguments)}}(),[e]),ce=w.length>0,Z=m.useMemo(()=>w.length===1?'Are you sure you want to delete "'.concat(w[0].filename,'"?'):"Are you sure you want to delete the selected files?",[w]);return d.jsxs("div",{className:"file-explorer",children:[x&&d.jsx(xu,{isMultiSelect:r,focusedPath:i,showContextMenu:!0,onCopy:X,onCreateFolder:j,onCreateFile:re,onMove:ye,onDelete:ie,onRename:Oe,onSelect:g,onSelectionChange:b,rowHeight:S,table:x,validateRename:we}),d.jsx(mi,{isOpen:ce,headerText:Z,bodyText:"You cannot undo this action.",onCancel:be,onConfirm:oe,confirmButtonText:"Delete"})]})}eo.displayName="FileExplorer";function Ds(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function lS(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Ds(o,r,i,a,s,"next",l)}function s(l){Ds(o,r,i,a,s,"throw",l)}a(void 0)})}}function Qt(n,e,t){return(e=uS(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uS(n){var e=dS(n,"string");return typeof e=="symbol"?e:e+""}function dS(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var qt=U.module("NewItemModal");class Pn extends m.PureComponent{static getValidationMessage(e){return e instanceof _r&&e.info.type==="directory"?"Error: Cannot overwrite existing directory":"".concat(e)}static handleError(e){Je.isCanceled(e)||qt.error(e)}constructor(e){super(e),Qt(this,"inputRef",k.createRef()),Qt(this,"cancelableValidatePromise",void 0),Qt(this,"cancelableExistingItemPromise",void 0),Qt(this,"pending",new Ar),Qt(this,"pathMap",new Map),Qt(this,"isInitialLoad",!0),this.handleModalSubmit=this.handleModalSubmit.bind(this),this.handleModalOpened=this.handleModalOpened.bind(this),this.handleSelect=this.handleSelect.bind(this),this.handleChange=this.handleChange.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleValidationError=this.handleValidationError.bind(this),this.handleOverwriteCancel=this.handleOverwriteCancel.bind(this),this.handleOverwriteConfirm=this.handleOverwriteConfirm.bind(this),this.handleExtensionChangeCancel=this.handleExtensionChangeCancel.bind(this),this.handleExtensionChangeConfirm=this.handleExtensionChangeConfirm.bind(this),this.handleBreadcrumbSelect=this.handleBreadcrumbSelect.bind(this);var t=e.defaultValue,r=$.hasPath(t)?$.getPath(t):"/";this.state={isSubmitting:!1,path:r,prevExtension:$.getExtension(t),showExtensionChangeModal:!1,showOverwriteModal:!1,value:$.getBaseName(t)}}componentDidUpdate(e,t){var r=this.props.isOpen,i=e.isOpen,o=this.state,a=o.value,s=o.path;!i&&r&&(this.resetValue(),this.isInitialLoad=!0),i&&r&&(!this.isInitialLoad&&(s!==t.path||a!==t.value)&&this.updateValidationStatus(s,a),this.isInitialLoad=!1)}componentWillUnmount(){this.pending.cancel(),this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableExistingItemPromise&&this.cancelableExistingItemPromise.cancel()}resetValue(){var e=this.props,t=e.defaultValue,r=$.hasPath(t)?$.getPath(t):"/";this.setState({path:r,value:$.getBaseName(t),validationError:void 0,prevExtension:$.getExtension(t),isSubmitting:!1})}getValidationPromise(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableValidatePromise=Je.makeCancelable(this.validateName(e,t,r)),this.cancelableValidatePromise}validateName(e,t,r){var i=this;return lS(function*(){$.validateName(t);var o=i.props,a=o.defaultValue,s=o.storage;if(r){var l="".concat(e).concat(t);if(l!==a)try{var u=yield s.info(l);throw new _r(u)}catch(c){if(!(c instanceof Ji))throw c}}return t})()}updateValidationStatus(e,t){this.getValidationPromise(e,t).then(()=>{this.setState({validationError:void 0})}).catch(this.handleValidationError).catch(Pn.handleError)}handleModalOpened(){this.focusRenameInput()}handleModalSubmit(){this.submitModal()}handleChange(e){var t=e.target.value;this.setState({value:t})}handleSelect(e){if(qt.debug("handleSelect",e),e.type==="directory")this.setState({path:$.makePath(e.filename)});else{var t=e.basename,r=$.getPath(e.filename);this.setState({value:t,path:r},()=>{this.focusRenameInput()})}}handleKeyDown(e){var t=e.key;switch(e.stopPropagation(),t){case"Enter":{e.preventDefault(),this.submitModal();break}case"Escape":{e.preventDefault();var r=this.props.onCancel;r();break}}}handleValidationError(e){if(!(e instanceof Hn))throw e;qt.debug("Validation error",e),this.setState({validationError:e})}handleOverwriteCancel(){this.setState({showOverwriteModal:!1,isSubmitting:!1})}handleOverwriteConfirm(){this.setState({showOverwriteModal:!1});var e=this.props.onSubmit,t=this.state,r=t.path,i=t.value;qt.debug("handleOverwriteConfirm",r,i),e("".concat(r).concat(i),!0)}handleExtensionChangeCancel(){qt.debug("handleExtensionChangeCancel"),this.setState(e=>{var t=e.value,r=e.prevExtension,i=$.replaceExtension(t,r);return{showExtensionChangeModal:!1,value:i}}),this.submitModal(!0)}handleExtensionChangeConfirm(){qt.debug("handleExtensionChangeConfirm"),this.setState({showExtensionChangeModal:!1}),this.submitModal(!0)}focusRenameInput(){var e=this.inputRef.current;if(e){var t=this.props.type,r=e.value,i=t==="directory"?r.length:r.lastIndexOf(".");e.focus(),e.setSelectionRange(0,i>0?i:r.length)}}submitModal(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.setState(t=>{var r=t.prevExtension,i=t.value,o=t.path,a=this.props,s=a.notifyOnExtensionChange,l=a.type;qt.debug("submitModal",r,i);var u=$.getExtension(i);return s&&!e&&r!==null&&r!==u?{isSubmitting:!1,showExtensionChangeModal:!0,newExtension:u}:(this.getValidationPromise(o,i,!0).then(c=>{var h=this.props.onSubmit;h("".concat(o).concat(i))}).catch(c=>{if(c instanceof _r&&l!=="directory"&&c.info.type!=="directory"){this.setState({showOverwriteModal:!0});return}throw c}).catch(c=>{throw Je.isCanceled(c)&&this.setState({isSubmitting:!1}),c}).catch(this.handleValidationError).catch(Pn.handleError),{isSubmitting:!0,showExtensionChangeModal:!1,newExtension:void 0})})}handleBreadcrumbSelect(e){this.setState({path:e})}renderPathButtons(e){var t=e.split("/");return t.pop(),t.map((r,i)=>{for(var o="",a=0;a<i;a+=1)o+="".concat(t[a],"/");return o+="".concat(r,"/"),d.jsxs(k.Fragment,{children:[d.jsx(ne,{kind:"ghost",className:"directory-breadcrumbs",onClick:()=>this.handleBreadcrumbSelect(o),"aria-label":i===0?"Home":void 0,icon:i===0?d.jsx(me,{icon:fd,transform:"right-1.6"}):void 0,tooltip:i===0?"Home":void 0,children:r}),"/"]},o)})}render(){var e=this.props,t=e.storage,r=e.isOpen,i=e.onCancel,o=e.placeholder,a=e.title,s=e.type,l=this.state,u=l.isSubmitting,c=l.path,h=l.showExtensionChangeModal,p=l.showOverwriteModal,f=l.validationError,v=l.value,g=l.prevExtension,b=l.newExtension,y=s==="directory",S=$.fileExtensionToString(g),C=$.fileExtensionToString(b),_=y?"Create":"Save",w=y?"New folder name":"Save file as";return d.jsxs(d.Fragment,{children:[d.jsxs(ks,{isOpen:r,toggle:i,onOpened:this.handleModalOpened,className:"modal-dialog-centered new-file-modal",children:[d.jsx(Ns,{toggle:i,children:a}),d.jsx(Ls,{children:d.jsx("form",{children:d.jsxs("div",{className:"d-flex flex-column new-file-modal-content",children:[d.jsxs("div",{className:"flex-grow-0 mb-4",children:[d.jsx("label",{htmlFor:"file-name-input",children:w}),d.jsx("input",{id:"file-name-input",type:"text",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",className:B("form-control",{"is-invalid":f}),value:v,placeholder:o,ref:this.inputRef,onKeyDown:this.handleKeyDown,onChange:this.handleChange}),f&&d.jsx("div",{className:"invalid-feedback",children:Pn.getValidationMessage(f)})]}),d.jsxs("div",{className:"flex-grow-0",children:[d.jsx("label",{children:"Directory: /"}),this.renderPathButtons(c)]}),d.jsx("div",{className:"flex-grow-1 file-explorer-container",children:d.jsx(eo,{onSelect:this.handleSelect,storage:t,focusedPath:c})})]})})}),d.jsxs(sl,{children:[d.jsx(ne,{kind:"secondary",onClick:i,children:"Cancel"}),d.jsx(ne,{kind:"primary",disabled:u,onClick:this.handleModalSubmit,children:_})]})]}),d.jsx(mi,{isOpen:p,headerText:"Confirm overwrite",bodyText:"File with this name already exists, are you sure you want to overwrite it?",onCancel:this.handleOverwriteCancel,onConfirm:this.handleOverwriteConfirm,cancelButtonText:"Cancel",confirmButtonText:"Overwrite"}),d.jsx(mi,{isOpen:h,headerText:"Confirm extension change",bodyText:'Are you sure you want to change extension from "'.concat(S,'" to "').concat(C,'"?'),onCancel:this.handleExtensionChangeCancel,onConfirm:this.handleExtensionChangeConfirm,cancelButtonText:'Keep "'.concat(S,'"'),confirmButtonText:'Use "'.concat(C,'"')})]})}}Qt(Pn,"defaultProps",{isOpen:!1,defaultValue:"/",notifyOnExtensionChange:!1,placeholder:"",onSubmit:(n,e)=>{},onCancel:()=>{}});function cS(n){var e=n.createFile,t=n.createFolder,r=n.onSearchChange,i=n.defaultSearchText,o=i===void 0?"":i;return d.jsxs("div",{className:"file-explorer-toolbar",children:[d.jsxs("div",{className:"file-explorer-toolbar-buttons",children:[d.jsx(ne,{kind:"ghost",icon:Ws,tooltip:"New notebook",onClick:e,"aria-label":"New notebook"}),d.jsx(ne,{kind:"ghost",icon:vd,tooltip:"New folder",onClick:t,"aria-label":"New folder"})]}),r&&d.jsx("div",{className:"file-explorer-toolbar-search",children:d.jsx(vl,{value:o,onChange:r,placeholder:"Search by name"})})]})}function Ms(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function hS(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Ms(o,r,i,a,s,"next",l)}function s(l){Ms(o,r,i,a,s,"throw",l)}a(void 0)})}}function Du(n,e,t){return(e=mS(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mS(n){var e=pS(n,"string");return typeof e=="symbol"?e:e+""}function pS(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Zt=U.module("FileExplorerPanel"),fS=(n,e)=>{var t=Rm(n),r=Br(n,e.localDashboardId),i=r??{},o=i.session,a=i.config,s=a==null?void 0:a.type;return{fileStorage:t,language:s,session:o}},vS=Vn(fS,null,null,{forwardRef:!0});function gS(n){var e=n;return e!=null&&typeof e.button=="number"}class Dn extends k.Component{static handleError(e){Zt.error(e)}static isFocusEvent(e){return gS(e)?e.detail>=2:!0}constructor(e){super(e),this.handleFileSelect=this.handleFileSelect.bind(this),this.handleCopyFile=this.handleCopyFile.bind(this),this.handleCreateFile=this.handleCreateFile.bind(this),this.handleCreateDirectory=this.handleCreateDirectory.bind(this),this.handleCreateDirectoryCancel=this.handleCreateDirectoryCancel.bind(this),this.handleCreateDirectorySubmit=this.handleCreateDirectorySubmit.bind(this),this.handleDelete=this.handleDelete.bind(this),this.handleRename=this.handleRename.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleShow=this.handleShow.bind(this),this.handleSelectionChange=this.handleSelectionChange.bind(this);var t=e.session,r=e.language;this.state={isShown:!1,language:r,session:t,showCreateFolder:!1,focusedFilePath:"/"}}componentDidMount(){this.isHidden()||this.setState({isShown:!0})}handleCreateFile(){var e=this.props.glEventHub,t=this.state,r=t.session,i=t.language,o={language:i,value:""};Zt.debug("handleCreateFile",r,i,o),e.emit(Fe.CREATE_NOTEBOOK,r,i,o)}handleCreateDirectory(){this.setState({showCreateFolder:!0})}handleCreateDirectoryCancel(){Zt.debug("handleCreateDirectoryCancel"),this.setState({showCreateFolder:!1})}handleCreateDirectorySubmit(e){Zt.debug("handleCreateDirectorySubmit",e),this.setState({showCreateFolder:!1});var t=this.props.fileStorage;t.createDirectory(e).catch(Dn.handleError)}handleCopyFile(e){var t=this;return hS(function*(){var r=t.props.fileStorage;if(dt(e)){Zt.error("Invalid item in handleCopyItem",e);return}var i=yield $.getUniqueCopyFileName(r,e.filename);yield r.copyFile(e.filename,i)})()}handleDelete(e){var t=this.props.glEventHub;e.forEach(r=>{t.emit(Fe.CLOSE_FILE,{id:r.filename,itemName:r.filename})})}handleSelectionChange(e){var t="/";e.length===1&&(e[0].type==="directory"?t=$.makePath(e[0].filename):t=$.getPath(e[0].filename)),this.setState({focusedFilePath:t})}handleFileSelect(e,t){if(Zt.debug("fileSelect",e),e.type!=="directory"){var r=Dn.isFocusEvent(t),i={id:e.filename,itemName:e.filename},o=this.props.glEventHub,a=this.state,s=a.session,l=a.language,u={value:null,language:l};o.emit(Fe.SELECT_NOTEBOOK,s,l,u,i,r)}}handleRename(e,t){var r=this.props.glEventHub;Zt.debug("handleRename",e,t),r.emit(Fe.RENAME_FILE,e,t)}handleSessionOpened(e){var t=e.session,r=e.language;this.setState({session:t,language:r})}handleSessionClosed(){this.setState({session:void 0,language:void 0})}handleShow(){this.setState({isShown:!0})}isHidden(){var e=this.props.glContainer,t=e.isHidden;return t}render(){var e=this.props,t=e.fileStorage,r=e.glContainer,i=e.glEventHub,o=this.state,a=o.isShown,s=o.showCreateFolder,l=o.focusedFilePath;return d.jsxs(Hr,{className:"file-explorer-panel",componentPanel:this,glContainer:r,glEventHub:i,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[d.jsx(cS,{createFile:this.handleCreateFile,createFolder:this.handleCreateDirectory}),a&&d.jsx(eo,{isMultiSelect:!0,storage:t,onCopy:this.handleCopyFile,onCreateFile:this.handleCreateFile,onCreateFolder:this.handleCreateDirectory,onDelete:this.handleDelete,onRename:this.handleRename,onSelect:this.handleFileSelect,onSelectionChange:this.handleSelectionChange}),d.jsx(Pn,{isOpen:s,type:"directory",title:"Create New Folder",storage:t,onSubmit:this.handleCreateDirectorySubmit,onCancel:this.handleCreateDirectoryCancel,defaultValue:l})]})}}Du(Dn,"COMPONENT","FileExplorerPanel");Du(Dn,"TITLE","File Explorer");var JC=vS(Dn);function Wn(n,e,t){return(e=bS(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bS(n){var e=yS(n,"string");return typeof e=="symbol"?e:e+""}function yS(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var As=U.module("LogPanel");class Kr extends m.PureComponent{constructor(e){super(e),Wn(this,"isBottomVisible",void 0),Wn(this,"logView",void 0),this.handleResize=this.handleResize.bind(this),this.handleShow=this.handleShow.bind(this),this.handleHide=this.handleHide.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.isBottomVisible=!0,this.logView=null;var t=this.props.session;this.state={session:t}}handleResize(){this.updateDimensions()}handleShow(){this.updateDimensions(),this.logView&&(this.logView.triggerFindWidget(),this.isBottomVisible&&this.logView.scrollToBottom())}handleHide(){this.logView&&(this.isBottomVisible=this.logView.isBottomVisible())}handleSessionOpened(e){var t=e.session;As.debug("Session opened",[t]),this.setState({session:t})}handleSessionClosed(e){As.debug("Session closed",e)}updateDimensions(){this.logView&&this.logView.updateDimensions()}render(){var e=this.props,t=e.glContainer,r=e.glEventHub,i=this.state.session;return d.jsxs(Hr,{componentPanel:this,glContainer:t,glEventHub:r,onResize:this.handleResize,onHide:this.handleHide,onShow:this.handleShow,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,children:[i==null&&d.jsx("div",{className:"log-panel-disconnected-message",children:"Waiting for session connection"}),i!=null&&d.jsx(ve,{session:i,ref:o=>{this.logView=o}})]})}}Wn(Kr,"defaultProps",{session:null});Wn(Kr,"COMPONENT","LogPanel");Wn(Kr,"TITLE","Log");var SS=(n,e)=>{var t;return{session:(t=Br(n,e.localDashboardId))===null||t===void 0?void 0:t.session}},QC=Vn(SS,null,null,{forwardRef:!0})(Kr);export{uh as $,ue as A,Je as B,ge as C,ul as D,Rd as E,He as F,kr as G,al as H,ct as I,ne as J,E as K,ml as L,P as M,dl as N,de as O,jr as P,Nr as Q,lt as R,fe as S,il as T,yn as U,mi as V,Lc as W,vl as X,Lr as Y,sl as Z,bl as _,MC as a,sv as a$,Di as a0,DS as a1,dm as a2,Mi as a3,MS as a4,hl as a5,yl as a6,cl as a7,Rc as a8,Dh as a9,ru as aA,cv as aB,ee as aC,Ki as aD,eu as aE,uu as aF,Lv as aG,ou as aH,fr as aI,tu as aJ,pg as aK,mg as aL,uC as aM,mC as aN,cC as aO,fC as aP,fa as aQ,_C as aR,De as aS,wC as aT,su as aU,nu as aV,AC as aW,DC as aX,iv as aY,av as aZ,ov as a_,wr as aa,gm as ab,Et as ac,Ve as ad,Tt as ae,K as af,Ye as ag,_l as ah,Cl as ai,Sl as aj,AS as ak,jS as al,kS as am,ZS as an,T as ao,aC as ap,EC as aq,Tg as ar,hg as as,cg as at,xC as au,Qr as av,du as aw,TC as ax,gC as ay,bC as az,Cv as b,Ky as b$,sC as b0,oC as b1,bv as b2,lu as b3,Pv as b4,yC as b5,SC as b6,CC as b7,jC as b8,dC as b9,dp as bA,up as bB,Ml as bC,gi as bD,hp as bE,xl as bF,Il as bG,vi as bH,qn as bI,ea as bJ,qS as bK,tC as bL,ta as bM,OS as bN,lo as bO,Rg as bP,Xi as bQ,NC as bR,Wg as bS,Kg as bT,Te as bU,Bb as bV,R as bW,Ut as bX,vu as bY,Le as bZ,xr as b_,pC as ba,hC as bb,vC as bc,OC as bd,kC as be,mn as bf,lC as bg,Kv as bh,Mp as bi,YS as bj,Kt as bk,Ol as bl,rC as bm,Op as bn,JS as bo,QS as bp,eC as bq,Tp as br,xp as bs,Dp as bt,nC as bu,mp as bv,cp as bw,Dl as bx,lp as by,sp as bz,um as c,ot as c$,Iu as c0,gu as c1,sb as c2,Cu as c3,Yg as c4,On as c5,bu as c6,In as c7,Oy as c8,Or as c9,Km as cA,zm as cB,Vm as cC,ap as cD,el as cE,wS as cF,Js as cG,Hr as cH,zC as cI,mt as cJ,vt as cK,GS as cL,WC as cM,$S as cN,KC as cO,BC as cP,VC as cQ,Ar as cR,NS as cS,HC as cT,LS as cU,UC as cV,VS as cW,Rm as cX,RS as cY,Br as cZ,Fe as c_,i0 as ca,ve as cb,Pi as cc,fu as cd,En as ce,ji as cf,$ as cg,Ji as ch,YC as ci,Ri as cj,nv as ck,IC as cl,Ym as cm,ZC as cn,QC as co,qC as cp,JC as cq,vc as cr,PS as cs,Bm as ct,Um as cu,US as cv,FS as cw,HS as cx,BS as cy,Wm as cz,KS as d,Pn as d0,dt as d1,Fm as d2,Ne as d3,$C as d4,LC as d5,XC as d6,GC as d7,h0 as d8,c0 as d9,FC as da,RC as db,xS as dc,gt as dd,TS as de,Xr as df,Kd as dg,Hn as dh,rv as e,XS as f,_m as g,WS as h,Tl as i,zS as j,IS as k,Ec as l,Xn as m,Nc as n,Pc as o,nl as p,tl as q,le as r,PC as s,Tc as t,Cm as u,Oc as v,ol as w,qs as x,rl as y,ES as z};
|
|
46
|
-
//# sourceMappingURL=LogPanel-
|
|
46
|
+
//# sourceMappingURL=LogPanel-BwioMIh3.js.map
|