@dao42/d42paas-front 0.9.96 → 0.9.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DaoPaaS.cjs +4 -4
- package/dist/sdk/docs/enums/Messages.html +1 -1
- package/dist/sdk/docs/enums/ThemeType.html +2 -2
- package/dist/sdk/docs/interfaces/Component.html +2 -2
- package/dist/sdk/docs/interfaces/IDaoPaaS.html +27 -27
- package/dist/sdk/docs/interfaces/IExtralAction.html +1 -1
- package/dist/sdk/docs/interfaces/PaaSOptions.html +15 -15
- package/dist/sdk/docs/interfaces/XtermStyleType.html +1 -1
- package/dist/sdk/docs/modules.html +5 -5
- package/package.json +1 -1
package/dist/DaoPaaS.cjs
CHANGED
|
@@ -46,7 +46,7 @@ Error generating stack: `+o.message+`
|
|
|
46
46
|
* This source code is licensed under the MIT license found in the
|
|
47
47
|
* LICENSE file in the root directory of this source tree.
|
|
48
48
|
*/var Gw=M.exports,lye=YH.exports;function cye(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var uye=typeof Object.is=="function"?Object.is:cye,fye=lye.useSyncExternalStore,dye=Gw.useRef,hye=Gw.useEffect,pye=Gw.useMemo,Oye=Gw.useDebugValue;BH.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var o=dye(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=pye(function(){function l(d){if(!c){if(c=!0,u=d,d=r(d),i!==void 0&&s.hasValue){var O=s.value;if(i(O,d))return f=O}return f=d}if(O=f,uye(u,d))return O;var b=r(d);return i!==void 0&&i(O,b)?O:(u=d,f=b)}var c=!1,u,f,h=n===void 0?null:n;return[function(){return l(e())},h===null?void 0:function(){return l(h())}]},[e,n,r,i]);var a=fye(t,o[0],o[1]);return hye(function(){s.hasValue=!0,s.value=a},[a]),Oye(a),a};qH.exports=BH;var mye=qH.exports;const{useSyncExternalStoreWithSelector:gye}=mye;function vye(t,e=t.getState,n){const r=gye(t.subscribe,t.getState,t.getServerState||t.getState,e,n);return M.exports.useDebugValue(r),r}const DM=t=>{const e=typeof t=="function"?UH(t):t,n=(r,i)=>vye(e,r,i);return Object.assign(n,e),n},yye=t=>t?DM(t):DM;var bye=yye;const xye=(t,e={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:s,...a}=e;let l;try{l=(o!=null?o:({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!l)return({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),t(n,r,i);const c=l.connect(a);let u=!0;i.setState=(d,O,b)=>{const v=n(d,O);return u&&c.send(b===void 0?{type:s||"anonymous"}:typeof b=="string"?{type:b}:b,r()),v};const f=(...d)=>{const O=u;u=!1,n(...d),u=O},h=t(i.setState,r,i);if(c.init(h),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let d=!1;const O=i.dispatch;i.dispatch=(...b)=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&b[0].type==="__setState"&&!d&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),d=!0),O(...b)}}return c.subscribe(d=>{var O;switch(d.type){case"ACTION":if(typeof d.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Dk(d.payload,b=>{if(b.type==="__setState"){f(b.state);return}!i.dispatchFromDevtools||typeof i.dispatch=="function"&&i.dispatch(b)});case"DISPATCH":switch(d.payload.type){case"RESET":return f(h),c.init(i.getState());case"COMMIT":return c.init(i.getState());case"ROLLBACK":return Dk(d.state,b=>{f(b),c.init(i.getState())});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Dk(d.state,b=>{f(b)});case"IMPORT_STATE":{const{nextLiftedState:b}=d.payload,v=(O=b.computedStates.slice(-1)[0])==null?void 0:O.state;if(!v)return;f(v),c.send(null,b);return}case"PAUSE_RECORDING":return u=!u}return}}),h},Sye=xye,Dk=(t,e)=>{let n;try{n=JSON.parse(t)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&e(n)},US=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(r){return US(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return US(r)(n)}}}},wye=(t,e)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:v=>v,version:0,merge:(v,p)=>({...p,...v}),...e},s=!1;const a=new Set,l=new Set;let c;try{c=o.getStorage()}catch{}if(!c)return t((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...v)},r,i);const u=US(o.serialize),f=()=>{const v=o.partialize({...r()});let p;const g=u({state:v,version:o.version}).then(y=>c.setItem(o.name,y)).catch(y=>{p=y});if(p)throw p;return g},h=i.setState;i.setState=(v,p)=>{h(v,p),f()};const d=t((...v)=>{n(...v),f()},r,i);let O;const b=()=>{var v;if(!c)return;s=!1,a.forEach(g=>g(r()));const p=((v=o.onRehydrateStorage)==null?void 0:v.call(o,r()))||void 0;return US(c.getItem.bind(c))(o.name).then(g=>{if(g)return o.deserialize(g)}).then(g=>{if(g)if(typeof g.version=="number"&&g.version!==o.version){if(o.migrate)return o.migrate(g.state,g.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return g.state}).then(g=>{var y;return O=o.merge(g,(y=r())!=null?y:d),n(O,!0),f()}).then(()=>{p==null||p(O,void 0),s=!0,l.forEach(g=>g(O))}).catch(g=>{p==null||p(void 0,g)})};return i.persist={setOptions:v=>{o={...o,...v},v.getStorage&&(c=v.getStorage())},clearStorage:()=>{c==null||c.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>b(),hasHydrated:()=>s,onHydrate:v=>(a.add(v),()=>{a.delete(v)}),onFinishHydration:v=>(l.add(v),()=>{l.delete(v)})},b(),O||d},_ye=wye,Tye=(t,e)=>{const n={};return Object.keys(t.getState()).forEach(r=>{n[r]=i=>{if(t.getState()[r]===i)return;const s=r.replace(/^\S/,a=>a.toUpperCase());t.setState(a=>{a[r]=i},`@@${e}/set${s}`)}}),n},kye=(t,e)=>{const n=t(e.set,e.get,e);return{...e,set:{...e.set,...n}}},Pye=(t,e)=>{const n={...e.use},r={...e.useTracked},i={...e.get};return Object.keys(t(e.store.getState(),e.get,e)).forEach(o=>{n[o]=(...s)=>e.useStore(a=>{const c=t(a,e.get,e)[o];return c(...s)}),r[o]=(...s)=>{const a=e.useTrackedStore(),c=t(a,e.get,e)[o];return c(...s)},i[o]=(...s)=>{const l=t(e.store.getState(),e.get,e)[o];return l(...s)}}),{...e,get:i,use:n,useTracked:r}},_Q=t=>({...t,extendSelectors:e=>_Q(Pye(e,t)),extendActions:e=>_Q(kye(e,t))}),Qye=t=>{const e={};return Object.keys(t.getState()).forEach(n=>{e[n]=()=>t.getState()[n]}),e},$ye=t=>{const e={};return Object.keys(t.getState()).forEach(n=>{e[n]=r=>t(i=>i[n],r)}),e},Eye=(t,e)=>{const n={};return Object.keys(t.getState()).forEach(r=>{n[r]=()=>e()[r]}),n},Cye=t=>(e,n,r)=>{const i=(o,s)=>e(Fve(o),!0,s);return r.setState=i,t(i,n,r)};function Rye(t,...e){return e.reduce((n,r)=>r(n),t)}const Hw=t=>(e,n={})=>{var r;const{middlewares:i=[],devtools:o,persist:s,immer:a}=n;jve((r=a==null?void 0:a.enabledAutoFreeze)!==null&&r!==void 0?r:!1),a!=null&&a.enableMapSet&&Xve();const l=[Cye,...i];s!=null&&s.enabled&&l.push(S=>_ye(S,{...s,name:t})),o!=null&&o.enabled&&l.push(S=>Sye(S,{...o,name:t})),l.push(UH);const u=(S=>Rye(S,...l))(()=>e),f=bye(u),h=Tye(f,t),d=(S,w)=>{u.setState(T=>{Object.assign(T,S)},w||`@@${t}/mergeState`)},O=(S,w)=>{u.setState(S,w||`@@${t}/setState`)},b=$ye(f),v=Qye(f),p=Kve(f),g=Eye(f,p),y={get:{state:u.getState,...v},name:t,set:{state:O,mergeState:d,...h},store:u,use:b,useTracked:g,useStore:f,useTrackedStore:p,extendSelectors:()=>y,extendActions:()=>y};return _Q(y)};var z5=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function jH(t,e){return e={exports:{}},t(e,e.exports),e.exports}var Aye=typeof z5=="object"&&z5&&z5.Object===Object&&z5,ZH=Aye,Iye=typeof self=="object"&&self&&self.Object===Object&&self,zye=ZH||Iye||Function("return this")(),Yf=zye,Lye=Yf.Symbol,fh=Lye,VH=Object.prototype,Nye=VH.hasOwnProperty,Mye=VH.toString,Rm=fh?fh.toStringTag:void 0;function Dye(t){var e=Nye.call(t,Rm),n=t[Rm];try{t[Rm]=void 0;var r=!0}catch{}var i=Mye.call(t);return r&&(e?t[Rm]=n:delete t[Rm]),i}var Xye=Dye,Wye=Object.prototype,Uye=Wye.toString;function qye(t){return Uye.call(t)}var Bye=qye,Yye="[object Null]",Fye="[object Undefined]",XM=fh?fh.toStringTag:void 0;function jye(t){return t==null?t===void 0?Fye:Yye:XM&&XM in Object(t)?Xye(t):Bye(t)}var z0=jye;function Zye(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var _C=Zye,Vye="[object AsyncFunction]",Gye="[object Function]",Hye="[object GeneratorFunction]",Kye="[object Proxy]";function Jye(t){if(!_C(t))return!1;var e=z0(t);return e==Gye||e==Hye||e==Vye||e==Kye}var GH=Jye,ebe=Yf["__core-js_shared__"],Xk=ebe,WM=function(){var t=/[^.]+$/.exec(Xk&&Xk.keys&&Xk.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function tbe(t){return!!WM&&WM in t}var nbe=tbe,rbe=Function.prototype,ibe=rbe.toString;function obe(t){if(t!=null){try{return ibe.call(t)}catch{}try{return t+""}catch{}}return""}var Gp=obe,sbe=/[\\^$.*+?()[\]{}|]/g,abe=/^\[object .+?Constructor\]$/,lbe=Function.prototype,cbe=Object.prototype,ube=lbe.toString,fbe=cbe.hasOwnProperty,dbe=RegExp("^"+ube.call(fbe).replace(sbe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function hbe(t){if(!_C(t)||nbe(t))return!1;var e=GH(t)?dbe:abe;return e.test(Gp(t))}var pbe=hbe;function Obe(t,e){return t==null?void 0:t[e]}var mbe=Obe;function gbe(t,e){var n=mbe(t,e);return pbe(n)?n:void 0}var Hp=gbe,vbe=function(){try{var t=Hp(Object,"defineProperty");return t({},"",{}),t}catch{}}(),UM=vbe;function ybe(t,e,n){e=="__proto__"&&UM?UM(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var bbe=ybe;function xbe(t){return function(e,n,r){for(var i=-1,o=Object(e),s=r(e),a=s.length;a--;){var l=s[t?a:++i];if(n(o[l],l,o)===!1)break}return e}}var Sbe=xbe,wbe=Sbe(),_be=wbe;function Tbe(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var kbe=Tbe;function Pbe(t){return t!=null&&typeof t=="object"}var e0=Pbe,Qbe="[object Arguments]";function $be(t){return e0(t)&&z0(t)==Qbe}var qM=$be,HH=Object.prototype,Ebe=HH.hasOwnProperty,Cbe=HH.propertyIsEnumerable,Rbe=qM(function(){return arguments}())?qM:function(t){return e0(t)&&Ebe.call(t,"callee")&&!Cbe.call(t,"callee")},KH=Rbe,Abe=Array.isArray,Df=Abe;function Ibe(){return!1}var zbe=Ibe,TQ=jH(function(t,e){var n=e&&!e.nodeType&&e,r=n&&!0&&t&&!t.nodeType&&t,i=r&&r.exports===n,o=i?Yf.Buffer:void 0,s=o?o.isBuffer:void 0,a=s||zbe;t.exports=a}),Lbe=9007199254740991,Nbe=/^(?:0|[1-9]\d*)$/;function Mbe(t,e){var n=typeof t;return e=e==null?Lbe:e,!!e&&(n=="number"||n!="symbol"&&Nbe.test(t))&&t>-1&&t%1==0&&t<e}var JH=Mbe,Dbe=9007199254740991;function Xbe(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Dbe}var TC=Xbe,Wbe="[object Arguments]",Ube="[object Array]",qbe="[object Boolean]",Bbe="[object Date]",Ybe="[object Error]",Fbe="[object Function]",jbe="[object Map]",Zbe="[object Number]",Vbe="[object Object]",Gbe="[object RegExp]",Hbe="[object Set]",Kbe="[object String]",Jbe="[object WeakMap]",e5e="[object ArrayBuffer]",t5e="[object DataView]",n5e="[object Float32Array]",r5e="[object Float64Array]",i5e="[object Int8Array]",o5e="[object Int16Array]",s5e="[object Int32Array]",a5e="[object Uint8Array]",l5e="[object Uint8ClampedArray]",c5e="[object Uint16Array]",u5e="[object Uint32Array]",Pi={};Pi[n5e]=Pi[r5e]=Pi[i5e]=Pi[o5e]=Pi[s5e]=Pi[a5e]=Pi[l5e]=Pi[c5e]=Pi[u5e]=!0;Pi[Wbe]=Pi[Ube]=Pi[e5e]=Pi[qbe]=Pi[t5e]=Pi[Bbe]=Pi[Ybe]=Pi[Fbe]=Pi[jbe]=Pi[Zbe]=Pi[Vbe]=Pi[Gbe]=Pi[Hbe]=Pi[Kbe]=Pi[Jbe]=!1;function f5e(t){return e0(t)&&TC(t.length)&&!!Pi[z0(t)]}var d5e=f5e;function h5e(t){return function(e){return t(e)}}var p5e=h5e,BM=jH(function(t,e){var n=e&&!e.nodeType&&e,r=n&&!0&&t&&!t.nodeType&&t,i=r&&r.exports===n,o=i&&ZH.process,s=function(){try{var a=r&&r.require&&r.require("util").types;return a||o&&o.binding&&o.binding("util")}catch{}}();t.exports=s}),YM=BM&&BM.isTypedArray,O5e=YM?p5e(YM):d5e,eK=O5e,m5e=Object.prototype,g5e=m5e.hasOwnProperty;function v5e(t,e){var n=Df(t),r=!n&&KH(t),i=!n&&!r&&TQ(t),o=!n&&!r&&!i&&eK(t),s=n||r||i||o,a=s?kbe(t.length,String):[],l=a.length;for(var c in t)(e||g5e.call(t,c))&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||JH(c,l)))&&a.push(c);return a}var y5e=v5e,b5e=Object.prototype;function x5e(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||b5e;return t===n}var S5e=x5e;function w5e(t,e){return function(n){return t(e(n))}}var _5e=w5e,T5e=_5e(Object.keys,Object),k5e=T5e,P5e=Object.prototype,Q5e=P5e.hasOwnProperty;function $5e(t){if(!S5e(t))return k5e(t);var e=[];for(var n in Object(t))Q5e.call(t,n)&&n!="constructor"&&e.push(n);return e}var E5e=$5e;function C5e(t){return t!=null&&TC(t.length)&&!GH(t)}var R5e=C5e;function A5e(t){return R5e(t)?y5e(t):E5e(t)}var kC=A5e;function I5e(t,e){return t&&_be(t,e,kC)}var z5e=I5e;function L5e(){this.__data__=[],this.size=0}var N5e=L5e;function M5e(t,e){return t===e||t!==t&&e!==e}var tK=M5e;function D5e(t,e){for(var n=t.length;n--;)if(tK(t[n][0],e))return n;return-1}var Kw=D5e,X5e=Array.prototype,W5e=X5e.splice;function U5e(t){var e=this.__data__,n=Kw(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():W5e.call(e,n,1),--this.size,!0}var q5e=U5e;function B5e(t){var e=this.__data__,n=Kw(e,t);return n<0?void 0:e[n][1]}var Y5e=B5e;function F5e(t){return Kw(this.__data__,t)>-1}var j5e=F5e;function Z5e(t,e){var n=this.__data__,r=Kw(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var V5e=Z5e;function L0(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}L0.prototype.clear=N5e;L0.prototype.delete=q5e;L0.prototype.get=Y5e;L0.prototype.has=j5e;L0.prototype.set=V5e;var Jw=L0;function G5e(){this.__data__=new Jw,this.size=0}var H5e=G5e;function K5e(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var J5e=K5e;function e2e(t){return this.__data__.get(t)}var t2e=e2e;function n2e(t){return this.__data__.has(t)}var r2e=n2e,i2e=Hp(Yf,"Map"),Lv=i2e,o2e=Hp(Object,"create"),Nv=o2e;function s2e(){this.__data__=Nv?Nv(null):{},this.size=0}var a2e=s2e;function l2e(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var c2e=l2e,u2e="__lodash_hash_undefined__",f2e=Object.prototype,d2e=f2e.hasOwnProperty;function h2e(t){var e=this.__data__;if(Nv){var n=e[t];return n===u2e?void 0:n}return d2e.call(e,t)?e[t]:void 0}var p2e=h2e,O2e=Object.prototype,m2e=O2e.hasOwnProperty;function g2e(t){var e=this.__data__;return Nv?e[t]!==void 0:m2e.call(e,t)}var v2e=g2e,y2e="__lodash_hash_undefined__";function b2e(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Nv&&e===void 0?y2e:e,this}var x2e=b2e;function N0(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}N0.prototype.clear=a2e;N0.prototype.delete=c2e;N0.prototype.get=p2e;N0.prototype.has=v2e;N0.prototype.set=x2e;var FM=N0;function S2e(){this.size=0,this.__data__={hash:new FM,map:new(Lv||Jw),string:new FM}}var w2e=S2e;function _2e(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var T2e=_2e;function k2e(t,e){var n=t.__data__;return T2e(e)?n[typeof e=="string"?"string":"hash"]:n.map}var e_=k2e;function P2e(t){var e=e_(this,t).delete(t);return this.size-=e?1:0,e}var Q2e=P2e;function $2e(t){return e_(this,t).get(t)}var E2e=$2e;function C2e(t){return e_(this,t).has(t)}var R2e=C2e;function A2e(t,e){var n=e_(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var I2e=A2e;function M0(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}M0.prototype.clear=w2e;M0.prototype.delete=Q2e;M0.prototype.get=E2e;M0.prototype.has=R2e;M0.prototype.set=I2e;var t_=M0,z2e=200;function L2e(t,e){var n=this.__data__;if(n instanceof Jw){var r=n.__data__;if(!Lv||r.length<z2e-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new t_(r)}return n.set(t,e),this.size=n.size,this}var N2e=L2e;function D0(t){var e=this.__data__=new Jw(t);this.size=e.size}D0.prototype.clear=H5e;D0.prototype.delete=J5e;D0.prototype.get=t2e;D0.prototype.has=r2e;D0.prototype.set=N2e;var Ex=D0,M2e="__lodash_hash_undefined__";function D2e(t){return this.__data__.set(t,M2e),this}var X2e=D2e;function W2e(t){return this.__data__.has(t)}var U2e=W2e;function qS(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new t_;++e<n;)this.add(t[e])}qS.prototype.add=qS.prototype.push=X2e;qS.prototype.has=U2e;var q2e=qS;function B2e(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Y2e=B2e;function F2e(t,e){return t.has(e)}var j2e=F2e,Z2e=1,V2e=2;function G2e(t,e,n,r,i,o){var s=n&Z2e,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var f=-1,h=!0,d=n&V2e?new q2e:void 0;for(o.set(t,e),o.set(e,t);++f<a;){var O=t[f],b=e[f];if(r)var v=s?r(b,O,f,e,t,o):r(O,b,f,t,e,o);if(v!==void 0){if(v)continue;h=!1;break}if(d){if(!Y2e(e,function(p,g){if(!j2e(d,g)&&(O===p||i(O,p,n,r,o)))return d.push(g)})){h=!1;break}}else if(!(O===b||i(O,b,n,r,o))){h=!1;break}}return o.delete(t),o.delete(e),h}var nK=G2e,H2e=Yf.Uint8Array,jM=H2e;function K2e(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var J2e=K2e;function exe(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var txe=exe,nxe=1,rxe=2,ixe="[object Boolean]",oxe="[object Date]",sxe="[object Error]",axe="[object Map]",lxe="[object Number]",cxe="[object RegExp]",uxe="[object Set]",fxe="[object String]",dxe="[object Symbol]",hxe="[object ArrayBuffer]",pxe="[object DataView]",ZM=fh?fh.prototype:void 0,Wk=ZM?ZM.valueOf:void 0;function Oxe(t,e,n,r,i,o,s){switch(n){case pxe:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case hxe:return!(t.byteLength!=e.byteLength||!o(new jM(t),new jM(e)));case ixe:case oxe:case lxe:return tK(+t,+e);case sxe:return t.name==e.name&&t.message==e.message;case cxe:case fxe:return t==e+"";case axe:var a=J2e;case uxe:var l=r&nxe;if(a||(a=txe),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;r|=rxe,s.set(t,e);var u=nK(a(t),a(e),r,i,o,s);return s.delete(t),u;case dxe:if(Wk)return Wk.call(t)==Wk.call(e)}return!1}var mxe=Oxe;function gxe(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var vxe=gxe;function yxe(t,e,n){var r=e(t);return Df(t)?r:vxe(r,n(t))}var bxe=yxe;function xxe(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}var Sxe=xxe;function wxe(){return[]}var _xe=wxe,Txe=Object.prototype,kxe=Txe.propertyIsEnumerable,VM=Object.getOwnPropertySymbols,Pxe=VM?function(t){return t==null?[]:(t=Object(t),Sxe(VM(t),function(e){return kxe.call(t,e)}))}:_xe,Qxe=Pxe;function $xe(t){return bxe(t,kC,Qxe)}var GM=$xe,Exe=1,Cxe=Object.prototype,Rxe=Cxe.hasOwnProperty;function Axe(t,e,n,r,i,o){var s=n&Exe,a=GM(t),l=a.length,c=GM(e),u=c.length;if(l!=u&&!s)return!1;for(var f=l;f--;){var h=a[f];if(!(s?h in e:Rxe.call(e,h)))return!1}var d=o.get(t),O=o.get(e);if(d&&O)return d==e&&O==t;var b=!0;o.set(t,e),o.set(e,t);for(var v=s;++f<l;){h=a[f];var p=t[h],g=e[h];if(r)var y=s?r(g,p,h,e,t,o):r(p,g,h,t,e,o);if(!(y===void 0?p===g||i(p,g,n,r,o):y)){b=!1;break}v||(v=h=="constructor")}if(b&&!v){var S=t.constructor,w=e.constructor;S!=w&&"constructor"in t&&"constructor"in e&&!(typeof S=="function"&&S instanceof S&&typeof w=="function"&&w instanceof w)&&(b=!1)}return o.delete(t),o.delete(e),b}var Ixe=Axe,zxe=Hp(Yf,"DataView"),kQ=zxe,Lxe=Hp(Yf,"Promise"),PQ=Lxe,Nxe=Hp(Yf,"Set"),QQ=Nxe,Mxe=Hp(Yf,"WeakMap"),$Q=Mxe,HM="[object Map]",Dxe="[object Object]",KM="[object Promise]",JM="[object Set]",eD="[object WeakMap]",tD="[object DataView]",Xxe=Gp(kQ),Wxe=Gp(Lv),Uxe=Gp(PQ),qxe=Gp(QQ),Bxe=Gp($Q),op=z0;(kQ&&op(new kQ(new ArrayBuffer(1)))!=tD||Lv&&op(new Lv)!=HM||PQ&&op(PQ.resolve())!=KM||QQ&&op(new QQ)!=JM||$Q&&op(new $Q)!=eD)&&(op=function(t){var e=z0(t),n=e==Dxe?t.constructor:void 0,r=n?Gp(n):"";if(r)switch(r){case Xxe:return tD;case Wxe:return HM;case Uxe:return KM;case qxe:return JM;case Bxe:return eD}return e});var nD=op,Yxe=1,rD="[object Arguments]",iD="[object Array]",L5="[object Object]",Fxe=Object.prototype,oD=Fxe.hasOwnProperty;function jxe(t,e,n,r,i,o){var s=Df(t),a=Df(e),l=s?iD:nD(t),c=a?iD:nD(e);l=l==rD?L5:l,c=c==rD?L5:c;var u=l==L5,f=c==L5,h=l==c;if(h&&TQ(t)){if(!TQ(e))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new Ex),s||eK(t)?nK(t,e,n,r,i,o):mxe(t,e,l,n,r,i,o);if(!(n&Yxe)){var d=u&&oD.call(t,"__wrapped__"),O=f&&oD.call(e,"__wrapped__");if(d||O){var b=d?t.value():t,v=O?e.value():e;return o||(o=new Ex),i(b,v,n,r,o)}}return h?(o||(o=new Ex),Ixe(t,e,n,r,i,o)):!1}var Zxe=jxe;function rK(t,e,n,r,i){return t===e?!0:t==null||e==null||!e0(t)&&!e0(e)?t!==t&&e!==e:Zxe(t,e,n,r,rK,i)}var iK=rK,Vxe=1,Gxe=2;function Hxe(t,e,n,r){var i=n.length,o=i,s=!r;if(t==null)return!o;for(t=Object(t);i--;){var a=n[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=n[i];var l=a[0],c=t[l],u=a[1];if(s&&a[2]){if(c===void 0&&!(l in t))return!1}else{var f=new Ex;if(r)var h=r(c,u,l,t,e,f);if(!(h===void 0?iK(u,c,Vxe|Gxe,r,f):h))return!1}}return!0}var Kxe=Hxe;function Jxe(t){return t===t&&!_C(t)}var oK=Jxe;function eSe(t){for(var e=kC(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,oK(i)]}return e}var tSe=eSe;function nSe(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}var sK=nSe;function rSe(t){var e=tSe(t);return e.length==1&&e[0][2]?sK(e[0][0],e[0][1]):function(n){return n===t||Kxe(n,t,e)}}var iSe=rSe,oSe="[object Symbol]";function sSe(t){return typeof t=="symbol"||e0(t)&&z0(t)==oSe}var PC=sSe,aSe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,lSe=/^\w*$/;function cSe(t,e){if(Df(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||PC(t)?!0:lSe.test(t)||!aSe.test(t)||e!=null&&t in Object(e)}var QC=cSe,uSe="Expected a function";function $C(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(uSe);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new($C.Cache||t_),n}$C.Cache=t_;var fSe=$C,dSe=500;function hSe(t){var e=fSe(t,function(r){return n.size===dSe&&n.clear(),r}),n=e.cache;return e}var pSe=hSe,OSe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,mSe=/\\(\\)?/g,gSe=pSe(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(OSe,function(n,r,i,o){e.push(i?o.replace(mSe,"$1"):r||n)}),e}),vSe=gSe;function ySe(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var bSe=ySe,xSe=1/0,sD=fh?fh.prototype:void 0,aD=sD?sD.toString:void 0;function aK(t){if(typeof t=="string")return t;if(Df(t))return bSe(t,aK)+"";if(PC(t))return aD?aD.call(t):"";var e=t+"";return e=="0"&&1/t==-xSe?"-0":e}var SSe=aK;function wSe(t){return t==null?"":SSe(t)}var _Se=wSe;function TSe(t,e){return Df(t)?t:QC(t,e)?[t]:vSe(_Se(t))}var lK=TSe,kSe=1/0;function PSe(t){if(typeof t=="string"||PC(t))return t;var e=t+"";return e=="0"&&1/t==-kSe?"-0":e}var n_=PSe;function QSe(t,e){e=lK(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[n_(e[n++])];return n&&n==r?t:void 0}var cK=QSe;function $Se(t,e,n){var r=t==null?void 0:cK(t,e);return r===void 0?n:r}var ESe=$Se;function CSe(t,e){return t!=null&&e in Object(t)}var RSe=CSe;function ASe(t,e,n){e=lK(e,t);for(var r=-1,i=e.length,o=!1;++r<i;){var s=n_(e[r]);if(!(o=t!=null&&n(t,s)))break;t=t[s]}return o||++r!=i?o:(i=t==null?0:t.length,!!i&&TC(i)&&JH(s,i)&&(Df(t)||KH(t)))}var ISe=ASe;function zSe(t,e){return t!=null&&ISe(t,e,RSe)}var LSe=zSe,NSe=1,MSe=2;function DSe(t,e){return QC(t)&&oK(e)?sK(n_(t),e):function(n){var r=ESe(n,t);return r===void 0&&r===e?LSe(n,t):iK(e,r,NSe|MSe)}}var XSe=DSe;function WSe(t){return t}var USe=WSe;function qSe(t){return function(e){return e==null?void 0:e[t]}}var BSe=qSe;function YSe(t){return function(e){return cK(e,t)}}var FSe=YSe;function jSe(t){return QC(t)?BSe(n_(t)):FSe(t)}var ZSe=jSe;function VSe(t){return typeof t=="function"?t:t==null?USe:typeof t=="object"?Df(t)?XSe(t[0],t[1]):iSe(t):ZSe(t)}var GSe=VSe;function HSe(t,e){var n={};return e=GSe(e),z5e(t,function(r,i,o){bbe(n,i,e(r,i,o))}),n}var KSe=HSe;const r_=(t,e)=>KSe(e,n=>n[t]),Qu=Object.create(null);Qu.open="0";Qu.close="1";Qu.ping="2";Qu.pong="3";Qu.message="4";Qu.upgrade="5";Qu.noop="6";const Cx=Object.create(null);Object.keys(Qu).forEach(t=>{Cx[Qu[t]]=t});const JSe={type:"error",data:"parser error"},e4e=typeof Blob=="function"||typeof Blob!="undefined"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",t4e=typeof ArrayBuffer=="function",n4e=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,uK=({type:t,data:e},n,r)=>e4e&&e instanceof Blob?n?r(e):lD(e,r):t4e&&(e instanceof ArrayBuffer||n4e(e))?n?r(e):lD(new Blob([e]),r):r(Qu[t]+(e||"")),lD=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+r)},n.readAsDataURL(t)},cD="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Og=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(let t=0;t<cD.length;t++)Og[cD.charCodeAt(t)]=t;const r4e=t=>{let e=t.length*.75,n=t.length,r,i=0,o,s,a,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const c=new ArrayBuffer(e),u=new Uint8Array(c);for(r=0;r<n;r+=4)o=Og[t.charCodeAt(r)],s=Og[t.charCodeAt(r+1)],a=Og[t.charCodeAt(r+2)],l=Og[t.charCodeAt(r+3)],u[i++]=o<<2|s>>4,u[i++]=(s&15)<<4|a>>2,u[i++]=(a&3)<<6|l&63;return c},i4e=typeof ArrayBuffer=="function",fK=(t,e)=>{if(typeof t!="string")return{type:"message",data:dK(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:o4e(t.substring(1),e)}:Cx[n]?t.length>1?{type:Cx[n],data:t.substring(1)}:{type:Cx[n]}:JSe},o4e=(t,e)=>{if(i4e){const n=r4e(t);return dK(n,e)}else return{base64:!0,data:t}},dK=(t,e)=>{switch(e){case"blob":return t instanceof ArrayBuffer?new Blob([t]):t;case"arraybuffer":default:return t}},hK=String.fromCharCode(30),s4e=(t,e)=>{const n=t.length,r=new Array(n);let i=0;t.forEach((o,s)=>{uK(o,!1,a=>{r[s]=a,++i===n&&e(r.join(hK))})})},a4e=(t,e)=>{const n=t.split(hK),r=[];for(let i=0;i<n.length;i++){const o=fK(n[i],e);if(r.push(o),o.type==="error")break}return r},pK=4;function Po(t){if(t)return l4e(t)}function l4e(t){for(var e in Po.prototype)t[e]=Po.prototype[e];return t}Po.prototype.on=Po.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};Po.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this};Po.prototype.off=Po.prototype.removeListener=Po.prototype.removeAllListeners=Po.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===e||r.fn===e){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+t],this};Po.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,e)}return this};Po.prototype.emitReserved=Po.prototype.emit;Po.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};Po.prototype.hasListeners=function(t){return!!this.listeners(t).length};const Nd=(()=>typeof self!="undefined"?self:typeof window!="undefined"?window:Function("return this")())();function OK(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const c4e=setTimeout,u4e=clearTimeout;function i_(t,e){e.useNativeTimers?(t.setTimeoutFn=c4e.bind(Nd),t.clearTimeoutFn=u4e.bind(Nd)):(t.setTimeoutFn=setTimeout.bind(Nd),t.clearTimeoutFn=clearTimeout.bind(Nd))}const f4e=1.33;function d4e(t){return typeof t=="string"?h4e(t):Math.ceil((t.byteLength||t.size)*f4e)}function h4e(t){let e=0,n=0;for(let r=0,i=t.length;r<i;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}class p4e extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class mK extends Po{constructor(e){super(),this.writable=!1,i_(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,n,r){return super.emitReserved("error",new p4e(e,n,r)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const n=fK(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}}const gK="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),EQ=64,O4e={};let uD=0,N5=0,fD;function dD(t){let e="";do e=gK[t%EQ]+e,t=Math.floor(t/EQ);while(t>0);return e}function vK(){const t=dD(+new Date);return t!==fD?(uD=0,fD=t):t+"."+dD(uD++)}for(;N5<EQ;N5++)O4e[gK[N5]]=N5;function yK(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function m4e(t){let e={},n=t.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");e[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e}let bK=!1;try{bK=typeof XMLHttpRequest!="undefined"&&"withCredentials"in new XMLHttpRequest}catch{}const g4e=bK;function xK(t){const e=t.xdomain;try{if(typeof XMLHttpRequest!="undefined"&&(!e||g4e))return new XMLHttpRequest}catch{}if(!e)try{return new Nd[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function v4e(){}const y4e=function(){return new xK({xdomain:!1}).responseType!=null}();class b4e extends mK{constructor(e){if(super(e),this.polling=!1,typeof location!="undefined"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location!="undefined"&&e.hostname!==location.hostname||i!==e.port,this.xs=e.secure!==r}const n=e&&e.forceBase64;this.supportsBinary=y4e&&!n}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const n=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};a4e(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,s4e(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=vK()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const i=yK(e),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new Su(this.uri(),e)}doWrite(e,n){const r=this.request({method:"POST",data:e});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=e}}class Su extends Po{constructor(e,n){super(),i_(this,n),this.opts=n,this.method=n.method||"GET",this.uri=e,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const e=OK(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const n=this.xhr=new xK(e);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document!="undefined"&&(this.index=Su.requestsCount++,Su.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr=="undefined"||this.xhr===null)){if(this.xhr.onreadystatechange=v4e,e)try{this.xhr.abort()}catch{}typeof document!="undefined"&&delete Su.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}Su.requestsCount=0;Su.requests={};if(typeof document!="undefined"){if(typeof attachEvent=="function")attachEvent("onunload",hD);else if(typeof addEventListener=="function"){const t="onpagehide"in Nd?"pagehide":"unload";addEventListener(t,hD,!1)}}function hD(){for(let t in Su.requests)Su.requests.hasOwnProperty(t)&&Su.requests[t].abort()}const x4e=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0))(),M5=Nd.WebSocket||Nd.MozWebSocket,pD=!0,S4e="arraybuffer",OD=typeof navigator!="undefined"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class w4e extends mK{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),n=this.opts.protocols,r=OD?{}:OK(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=pD&&!OD?n?new M5(e,n):new M5(e):new M5(e,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||S4e,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;uK(r,this.supportsBinary,o=>{const s={};try{pD&&this.ws.send(o)}catch{}i&&x4e(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws!="undefined"&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=vK()),this.supportsBinary||(e.b64=1);const i=yK(e),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}check(){return!!M5}}const _4e={websocket:w4e,polling:b4e},T4e=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,k4e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function CQ(t){const e=t,n=t.indexOf("["),r=t.indexOf("]");n!=-1&&r!=-1&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let i=T4e.exec(t||""),o={},s=14;for(;s--;)o[k4e[s]]=i[s]||"";return n!=-1&&r!=-1&&(o.source=e,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=P4e(o,o.path),o.queryKey=Q4e(o,o.query),o}function P4e(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return(e.substr(0,1)=="/"||e.length===0)&&r.splice(0,1),e.substr(e.length-1,1)=="/"&&r.splice(r.length-1,1),r}function Q4e(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}class $d extends Po{constructor(e,n={}){super(),e&&typeof e=="object"&&(n=e,e=null),e?(e=CQ(e),n.hostname=e.host,n.secure=e.protocol==="https"||e.protocol==="wss",n.port=e.port,e.query&&(n.query=e.query)):n.host&&(n.hostname=CQ(n.host).host),i_(this,n),this.secure=n.secure!=null?n.secure:typeof location!="undefined"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location!="undefined"?location.hostname:"localhost"),this.port=n.port||(typeof location!="undefined"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=m4e(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&addEventListener("beforeunload",()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},!1),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=pK,n.transport=e,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[e],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new _4e[e](r)}open(){let e;if(this.opts.rememberUpgrade&&$d.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(e){let n=this.createTransport(e),r=!1;$d.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;$d.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function o(){r||(r=!0,u(),n.close(),n=null)}const s=f=>{const h=new Error("probe error: "+f);h.transport=n.name,o(),this.emitReserved("upgradeError",h)};function a(){s("transport closed")}function l(){s("socket closed")}function c(f){n&&f.name!==n.name&&o()}const u=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",c),n.open()}onOpen(){if(this.readyState="open",$d.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let e=0;const n=this.upgrades.length;for(;e<n;e++)this.probe(this.upgrades[e])}}onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=e.data,this.onError(n);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=d4e(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(e,n,r){return this.sendPacket("message",e,n,r),this}send(e,n,r){return this.sendPacket("message",e,n,r),this}sendPacket(e,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:e,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}onError(e){$d.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const n=[];let r=0;const i=e.length;for(;r<i;r++)~this.transports.indexOf(e[r])&&n.push(e[r]);return n}}$d.protocol=pK;function $4e(t,e="",n){let r=t;n=n||typeof location!="undefined"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n!="undefined"?t=n.protocol+"//"+t:t="https://"+t),r=CQ(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+e,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const E4e=typeof ArrayBuffer=="function",C4e=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,SK=Object.prototype.toString,R4e=typeof Blob=="function"||typeof Blob!="undefined"&&SK.call(Blob)==="[object BlobConstructor]",A4e=typeof File=="function"||typeof File!="undefined"&&SK.call(File)==="[object FileConstructor]";function EC(t){return E4e&&(t instanceof ArrayBuffer||C4e(t))||R4e&&t instanceof Blob||A4e&&t instanceof File}function Rx(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(Rx(t[n]))return!0;return!1}if(EC(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return Rx(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&Rx(t[n]))return!0;return!1}function I4e(t){const e=[],n=t.data,r=t;return r.data=RQ(n,e),r.attachments=e.length,{packet:r,buffers:e}}function RQ(t,e){if(!t)return t;if(EC(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}else if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=RQ(t[r],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=RQ(t[r],e));return n}return t}function z4e(t,e){return t.data=AQ(t.data,e),t.attachments=void 0,t}function AQ(t,e){if(!t)return t;if(t&&t._placeholder)return e[t.num];if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=AQ(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=AQ(t[n],e));return t}const L4e=5;var br;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(br||(br={}));class N4e{constructor(e){this.replacer=e}encode(e){return(e.type===br.EVENT||e.type===br.ACK)&&Rx(e)?(e.type=e.type===br.EVENT?br.BINARY_EVENT:br.BINARY_ACK,this.encodeAsBinary(e)):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===br.BINARY_EVENT||e.type===br.BINARY_ACK)&&(n+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(n+=e.nsp+","),e.id!=null&&(n+=e.id),e.data!=null&&(n+=JSON.stringify(e.data,this.replacer)),n}encodeAsBinary(e){const n=I4e(e),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}class CC extends Po{constructor(e){super(),this.reviver=e}add(e){let n;if(typeof e=="string")n=this.decodeString(e),n.type===br.BINARY_EVENT||n.type===br.BINARY_ACK?(this.reconstructor=new M4e(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n);else if(EC(e)||e.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(e),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let n=0;const r={type:Number(e.charAt(0))};if(br[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===br.BINARY_EVENT||r.type===br.BINARY_ACK){const o=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const s=e.substring(o,n);if(s!=Number(s)||e.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(e.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););r.nsp=e.substring(o,n)}else r.nsp="/";const i=e.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const s=e.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===e.length)break}r.id=Number(e.substring(o,n+1))}if(e.charAt(++n)){const o=this.tryParse(e.substr(n));if(CC.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,n){switch(e){case br.CONNECT:return typeof n=="object";case br.DISCONNECT:return n===void 0;case br.CONNECT_ERROR:return typeof n=="string"||typeof n=="object";case br.EVENT:case br.BINARY_EVENT:return Array.isArray(n)&&n.length>0;case br.ACK:case br.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class M4e{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const n=z4e(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}var D4e=Object.freeze(Object.defineProperty({__proto__:null,protocol:L4e,get PacketType(){return br},Encoder:N4e,Decoder:CC},Symbol.toStringTag,{value:"Module"}));function Pc(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const X4e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class wK extends Po{constructor(e,n,r){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Pc(e,"open",this.onopen.bind(this)),Pc(e,"packet",this.onpacket.bind(this)),Pc(e,"error",this.onerror.bind(this)),Pc(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...n){if(X4e.hasOwnProperty(e))throw new Error('"'+e+'" is a reserved event name');n.unshift(e);const r={type:br.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const s=this.ids++,a=n.pop();this._registerAckCallback(s,a),r.id=s}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(e,n){const r=this.flags.timeout;if(r===void 0){this.acks[e]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===e&&this.sendBuffer.splice(o,1);n.call(this,new Error("operation has timed out"))},r);this.acks[e]=(...o)=>{this.io.clearTimeoutFn(i),n.apply(this,[null,...o])}}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this.packet({type:br.CONNECT,data:e})}):this.packet({type:br.CONNECT,data:this.auth})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case br.CONNECT:if(e.data&&e.data.sid){const i=e.data.sid;this.onconnect(i)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case br.EVENT:case br.BINARY_EVENT:this.onevent(e);break;case br.ACK:case br.BINARY_ACK:this.onack(e);break;case br.DISCONNECT:this.ondisconnect();break;case br.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,e)}super.emit.apply(this,e)}ack(e){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:br.ACK,id:e,data:i}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(n.apply(this,e.data),delete this.acks[e.id])}onconnect(e){this.id=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:br.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,e.data)}}}function X0(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}X0.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-n:t+n}return Math.min(t,this.max)|0};X0.prototype.reset=function(){this.attempts=0};X0.prototype.setMin=function(t){this.ms=t};X0.prototype.setMax=function(t){this.max=t};X0.prototype.setJitter=function(t){this.jitter=t};class IQ extends Po{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,i_(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new X0({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const i=n.parser||D4e;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new $d(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Pc(n,"open",function(){r.onopen(),e&&e()}),o=Pc(n,"error",s=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",s),e?e(s):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const s=this._timeout;s===0&&i();const a=this.setTimeoutFn(()=>{i(),n.close(),n.emit("error",new Error("timeout"))},s);this.opts.autoUnref&&a.unref(),this.subs.push(function(){clearTimeout(a)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Pc(e,"ping",this.onping.bind(this)),Pc(e,"data",this.ondata.bind(this)),Pc(e,"error",this.onerror.bind(this)),Pc(e,"close",this.onclose.bind(this)),Pc(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){this.decoder.add(e)}ondecoded(e){this.emitReserved("packet",e)}onerror(e){this.emitReserved("error",e)}socket(e,n){let r=this.nsps[e];return r||(r=new wK(this,e,n),this.nsps[e]=r),r}_destroy(e){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let r=0;r<n.length;r++)this.engine.write(n[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Am={};function Ax(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=$4e(t,e.path||"/socket.io"),r=n.source,i=n.id,o=n.path,s=Am[i]&&o in Am[i].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||s;let l;return a?l=new IQ(r,e):(Am[i]||(Am[i]=new IQ(r,e)),l=Am[i]),n.query&&!e.query&&(e.query=n.queryKey),l.socket(n.path,e)}Object.assign(Ax,{Manager:IQ,Socket:wK,io:Ax,connect:Ax});var _n=(t=>(t.Loading="loading",t.Ready="ready",t.Offline="offline",t.Online="online",t.StatusChanged="statusChanged",t.LspStatusChanged="lspStatusChanged",t.PlaygroundChanged="playgroundChanged",t.Following="following",t.UnFollowing="unFollowing",t.RunStatusChanged="runStatusChanged",t.FileStructureChanged="fileStructureChanged",t.FileContentChanged="fileContentChanged",t.AppendToConsole="appendToConsole",t.AppendToTerminal="appendToTerminal",t.ApplicationAvailable="ApplicationAvailable",t.PlaybackInfo="playbackInfo",t.ReplayStart="ReplayStart",t.ReplayEnd="ReplayEnd",t.Customize="customize",t.UserEnter="userEnter",t.UserLeave="userLeave",t.UsersUpdated="usersUpdated",t.EditorScroll="editorScroll",t.ConnectionBroken="connectionBroken",t.ConnectionFailed="connectionFailed",t.AuthorizationFailed="authorizationFailed",t.FileStructureDamaged="fileStructureDamaged",t.ErrorFromServer="errorFromServer",t.AppendCustomizeFrameData="appendCustomizeFrameData",t.LineAction="lineAction",t.FileInfo="fileInfo",t.InsertTextById="insertTextById",t.ReplaceCodeById="replaceCodeById",t.Debug="debug",t.JumpToAreaById="jumpToAreaById",t.Xterm="xterm",t))(_n||{}),Oo=(t=>(t.RetainingAllFiles="retainingAllFiles",t.Authorize="auth",t.Active="active",t.Run="run",t.Stop="stop",t.Heartbeat="heartbeat",t.SetFileLockStatus="",t.SetFileVisiable="",t.AddFileToUnitTest="",t.RemoveFileFromUnitTest="",t.KeyEvent="keyEvent",t.File="file",t.CloseFile="closeFile",t.EditFile="editFile",t.FileTree="fileTree",t.Terminal="terminal",t.XtermStatus="XtermStatus",t.Cursor="cursor",t.GetPlaybackInfo="getPlaybackInfo",t.LoadPlaybackData="loadPlaybackData",t.FollowingAgentUser="followingAgentUser",t.UnFollowingAgentUser="unFollowingAgentUser",t.FollowingFocusComponent="followingFocusComponent",t.EditorScroll="editorScroll",t.CustomizeFrameData="appendCustomizeFrameData",t.AddCDNSource="addCDNSource",t.RestartServer="restartServer",t.RestartLSPServer="restartLSPServer",t.SwitchLanguage="switchLanguage",t.StatisticsPlaybackData="statisticsPlaybackData",t))(Oo||{}),Ct=(t=>(t.Connect="connect",t.Disconnect="disconnect",t.AuthAck="authAck",t.Active="active",t.SyncPlaygroundInfo="syncPlaygroundInfo",t.ChangePlaygroundInfo="changePlaygroundInfo",t.RunStatus="runStatus",t.LspStatus="lspStatus",t.Following="following",t.UnFollowing="unFollowing",t.UserEnter="userEnter",t.UserLeave="userLeave",t.UsersUpdated="usersUpdated",t.Simulator="simulator",t.PlaybackInfo="playbackInfo",t.PlaybackData="playbackData",t.File="file",t.FileTree="fileTree",t.Run="run",t.Console="console",t.Terminal="terminal",t.XtermStatus="XtermStatus",t.Editor="editor",t.Debug="debug",t.KeyEvent="keyEvent",t.CloseFile="closeFile",t.FocusComponent="FocusComponent",t.InvisibleComponentActive="InvisibleComponentActive",t.AppendCustomizeFrameData="appendCustomizeFrameData",t.TerminalStatus="terminalStatus",t.LspServerClientStateChange="lspServerClientStateChange",t.I18nLanguage="i18nLanguage",t.PushFormatCode="pushFormatCode",t.SetBreakPoint="setBreakPoint",t.DebugRun="debugRun",t.StoppedData="stoppedData",t.DebugNext="next",t.DebugContinue="continue",t.DebugStatus="debugStatus",t.DebugStepIn="stepIn",t.DebugStepOut="stepOut",t.Variables="variables",t.UpdateArea="updateArea",t.UpdateDebugSupport="updateDebugSupport",t.SyncDebugData="syncDebugData",t))(Ct||{}),RC=(t=>(t.NotSupport="notSupport",t.Loading="loading",t.Running="running",t.Shutdown="shutdown",t.LspReady="lspReady",t))(RC||{});class W4e{constructor(e,n=2e3){St(this,"name");St(this,"channel");St(this,"_timeout");St(this,"_messageId");St(this,"_messages");St(this,"_filter");this.name=e,this._messageId=0,this.channel=new BroadcastChannel(e),this.channel.onmessage=r=>this.receive(r),this._messages=[],this._timeout=n}setFilter(e){this._filter=e}send(e,n){const r=new U4e(n||this._timeout),i=new Promise((o,s)=>{r._reject=s,r._resolve=o});return this._messages.push(r),this.channel.postMessage({id:this._messageId++,type:"request",payload:e}),i}answer(e,n){this.channel.postMessage({id:e,type:"response",payload:n})}receive(e){const n=e.data;n.type==="request"?(!this._filter||this._filter(n.payload))&&this.answer(n.id,{active:!0}):n.type==="response"&&this._messages[n.id].reject(n.payload)}}class U4e{constructor(e){St(this,"_resolve");St(this,"_reject");St(this,"_interval");this._interval=setTimeout(()=>this.resolve({active:!1,reason:"timeout, no one uses it"}),e)}resolve(e){clearTimeout(this._interval),this._resolve(e)}reject(e){this._reject(e)}}let _K,D5;async function q4e(t){D5||(D5=new W4e("dao-paas",500));let e="";D5.setFilter(i=>i.id===e);const n=JSON.parse(localStorage.getItem(`agentUsers_${t}`)||"[]")||[],r=[];for(const i of n){const o=D5.send(i).then(()=>{if(e==="")return i.time=new Date().getTime(),e=i.id,localStorage.setItem(`agentUsers_${t}`,JSON.stringify(n)),Promise.resolve(e)});r.push(o)}return Promise.any(r)}function B4e(t,e){const n=JSON.parse(localStorage.getItem(`agentUsers_${e}`)||"[]")||[],r=n.find(i=>i.id==t);r?r.time=new Date().getTime():n.push({id:t,time:new Date().getTime()}),localStorage.setItem(`agentUsers_${e}`,JSON.stringify(n)),_K=t}function Y4e(t){return t===_K}const TK="daoLogger",F4e=typeof module=="object"&&typeof module.exports=="object",Uk=F4e?global:window,kK=Uk&&Uk.localStorage?Uk.localStorage:{store:{},getItem(t){return this.store[t]},setItem(t,e){this.store[t]=e}},Mt=new Proxy(console,{get(t,e){return kK.getItem(TK)?t[e]:()=>{}}}),j4e=()=>{kK.setItem(TK,"*")};function Ra(t){return Ra=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ra(t)}function la(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mD(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ca(t,e,n){return e&&mD(t.prototype,e),n&&mD(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Mc(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function BS(t,e){return BS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},BS(t,e)}function kh(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&BS(t,e)}function W0(t,e){if(e&&(Ra(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mc(t)}function nc(t){return nc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},nc(t)}function Ln(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function PK(t){if(Array.isArray(t))return t}function QK(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function zQ(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function AC(t,e){if(!!t){if(typeof t=="string")return zQ(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zQ(t,e)}}function $K(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
49
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Z4e(t){return PK(t)||QK(t)||AC(t)||$K()}function gD(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function vD(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?gD(Object(n),!0).forEach(function(r){Ln(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):gD(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var V4e={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,n){console&&console[e]&&console[e].apply(console,n)}},G4e=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};la(this,t),this.init(e,n)}return ca(t,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||V4e,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"log","",!0)}},{key:"warn",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"warn","",!0)}},{key:"error",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"error","")}},{key:"deprecate",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(n,r,i,o){return o&&!this.debug?null:(typeof n[0]=="string"&&(n[0]="".concat(i).concat(this.prefix," ").concat(n[0])),this.logger[r](n))}},{key:"create",value:function(n){return new t(this.logger,vD(vD({},{prefix:"".concat(this.prefix,":").concat(n,":")}),this.options))}}]),t}(),hu=new G4e,dh=function(){function t(){la(this,t),this.observers={}}return ca(t,[{key:"on",value:function(n,r){var i=this;return n.split(" ").forEach(function(o){i.observers[o]=i.observers[o]||[],i.observers[o].push(r)}),this}},{key:"off",value:function(n,r){if(!!this.observers[n]){if(!r){delete this.observers[n];return}this.observers[n]=this.observers[n].filter(function(i){return i!==r})}}},{key:"emit",value:function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];if(this.observers[n]){var s=[].concat(this.observers[n]);s.forEach(function(l){l.apply(void 0,i)})}if(this.observers["*"]){var a=[].concat(this.observers["*"]);a.forEach(function(l){l.apply(l,[n].concat(i))})}}}]),t}();function Im(){var t,e,n=new Promise(function(r,i){t=r,e=i});return n.resolve=t,n.reject=e,n}function yD(t){return t==null?"":""+t}function H4e(t,e,n){t.forEach(function(r){e[r]&&(n[r]=e[r])})}function IC(t,e,n){function r(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function i(){return!t||typeof t=="string"}for(var o=typeof e!="string"?[].concat(e):e.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!t[s]&&n&&(t[s]=new n),Object.prototype.hasOwnProperty.call(t,s)?t=t[s]:t={}}return i()?{}:{obj:t,k:r(o.shift())}}function bD(t,e,n){var r=IC(t,e,Object),i=r.obj,o=r.k;i[o]=n}function K4e(t,e,n,r){var i=IC(t,e,Object),o=i.obj,s=i.k;o[s]=o[s]||[],r&&(o[s]=o[s].concat(n)),r||o[s].push(n)}function YS(t,e){var n=IC(t,e),r=n.obj,i=n.k;if(!!r)return r[i]}function xD(t,e,n){var r=YS(t,n);return r!==void 0?r:YS(e,n)}function EK(t,e,n){for(var r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?typeof t[r]=="string"||t[r]instanceof String||typeof e[r]=="string"||e[r]instanceof String?n&&(t[r]=e[r]):EK(t[r],e[r],n):t[r]=e[r]);return t}function wO(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var J4e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function ewe(t){return typeof t=="string"?t.replace(/[&<>"'\/]/g,function(e){return J4e[e]}):t}var o_=typeof window!="undefined"&&window.navigator&&typeof window.navigator.userAgentData=="undefined"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,twe=[" ",",","?","!",";"];function nwe(t,e,n){e=e||"",n=n||"";var r=twe.filter(function(a){return e.indexOf(a)<0&&n.indexOf(a)<0});if(r.length===0)return!0;var i=new RegExp("(".concat(r.map(function(a){return a==="?"?"\\?":a}).join("|"),")")),o=!i.test(t);if(!o){var s=t.indexOf(n);s>0&&!i.test(t.substring(0,s))&&(o=!0)}return o}function SD(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function X5(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?SD(Object(n),!0).forEach(function(r){Ln(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):SD(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function rwe(t){var e=iwe();return function(){var r=nc(t),i;if(e){var o=nc(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return W0(this,i)}}function iwe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function CK(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!!t){if(t[e])return t[e];for(var r=e.split(n),i=t,o=0;o<r.length;++o){if(!i||typeof i[r[o]]=="string"&&o+1<r.length)return;if(i[r[o]]===void 0){for(var s=2,a=r.slice(o,o+s).join(n),l=i[a];l===void 0&&r.length>o+s;)s++,a=r.slice(o,o+s).join(n),l=i[a];if(l===void 0)return;if(l===null)return null;if(e.endsWith(a)){if(typeof l=="string")return l;if(a&&typeof l[a]=="string")return l[a]}var c=r.slice(o+s).join(n);return c?CK(l,c,n):void 0}i=i[r[o]]}return i}}var owe=function(t){kh(n,t);var e=rwe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return la(this,n),i=e.call(this),o_&&dh.call(Mc(i)),i.data=r||{},i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return ca(n,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var o=this.options.ns.indexOf(i);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,c=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure,u=[i,o];s&&typeof s!="string"&&(u=u.concat(s)),s&&typeof s=="string"&&(u=u.concat(l?s.split(l):s)),i.indexOf(".")>-1&&(u=i.split("."));var f=YS(this.data,u);return f||!c||typeof s!="string"?f:CK(this.data&&this.data[i]&&this.data[i][o],s,l)}},{key:"addResource",value:function(i,o,s,a){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},c=this.options.keySeparator;c===void 0&&(c=".");var u=[i,o];s&&(u=u.concat(c?s.split(c):s)),i.indexOf(".")>-1&&(u=i.split("."),a=o,o=u[1]),this.addNamespaces(o),bD(this.data,u,a),l.silent||this.emit("added",i,o,s,a)}},{key:"addResources",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in s)(typeof s[l]=="string"||Object.prototype.toString.apply(s[l])==="[object Array]")&&this.addResource(i,o,l,s[l],{silent:!0});a.silent||this.emit("added",i,o,s)}},{key:"addResourceBundle",value:function(i,o,s,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},u=[i,o];i.indexOf(".")>-1&&(u=i.split("."),a=s,s=o,o=u[1]),this.addNamespaces(o);var f=YS(this.data,u)||{};a?EK(f,s,l):f=X5(X5({},f),s),bD(this.data,u,f),c.silent||this.emit("added",i,o,s)}},{key:"removeResourceBundle",value:function(i,o){this.hasResourceBundle(i,o)&&delete this.data[i][o],this.removeNamespaces(o),this.emit("removed",i,o)}},{key:"hasResourceBundle",value:function(i,o){return this.getResource(i,o)!==void 0}},{key:"getResourceBundle",value:function(i,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?X5(X5({},{}),this.getResource(i,o)):this.getResource(i,o)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var o=this.getDataByLanguage(i),s=o&&Object.keys(o)||[];return!!s.find(function(a){return o[a]&&Object.keys(o[a]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(dh),RK={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,n,r,i,o){var s=this;return e.forEach(function(a){s.processors[a]&&(n=s.processors[a].process(n,r,i,o))}),n}};function wD(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Hs(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?wD(Object(n),!0).forEach(function(r){Ln(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wD(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function swe(t){var e=awe();return function(){var r=nc(t),i;if(e){var o=nc(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return W0(this,i)}}function awe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var _D={},TD=function(t){kh(n,t);var e=swe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return la(this,n),i=e.call(this),o_&&dh.call(Mc(i)),H4e(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Mc(i)),i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=hu.create("translator"),i}return ca(n,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var s=this.resolve(i,o);return s&&s.res!==void 0}},{key:"extractFromKey",value:function(i,o){var s=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");var a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],c=s&&i.indexOf(s)>-1,u=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!nwe(i,s,a);if(c&&!u){var f=i.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:i,namespaces:l};var h=i.split(s);(s!==a||s===a&&this.options.ns.indexOf(h[0])>-1)&&(l=h.shift()),i=h.join(a)}return typeof l=="string"&&(l=[l]),{key:i,namespaces:l}}},{key:"translate",value:function(i,o,s){var a=this;if(Ra(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,c=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=this.extractFromKey(i[i.length-1],o),f=u.key,h=u.namespaces,d=h[h.length-1],O=o.lng||this.language,b=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(O&&O.toLowerCase()==="cimode"){if(b){var v=o.nsSeparator||this.options.nsSeparator;return l?(p.res="".concat(d).concat(v).concat(f),p):"".concat(d).concat(v).concat(f)}return l?(p.res=f,p):f}var p=this.resolve(i,o),g=p&&p.res,y=p&&p.usedKey||f,S=p&&p.exactUsedKey||f,w=Object.prototype.toString.apply(g),T=["[object Number]","[object Function]","[object RegExp]"],k=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,A=!this.i18nFormat||this.i18nFormat.handleAsObject,L=typeof g!="string"&&typeof g!="boolean"&&typeof g!="number";if(A&&g&&L&&T.indexOf(w)<0&&!(typeof k=="string"&&w==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var $=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,g,Hs(Hs({},o),{},{ns:h})):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");return l?(p.res=$,p):$}if(c){var E=w==="[object Array]",C=E?[]:{},I=E?S:y;for(var H in g)if(Object.prototype.hasOwnProperty.call(g,H)){var Y="".concat(I).concat(c).concat(H);C[H]=this.translate(Y,Hs(Hs({},o),{joinArrays:!1,ns:h})),C[H]===Y&&(C[H]=g[H])}g=C}}else if(A&&typeof k=="string"&&w==="[object Array]")g=g.join(k),g&&(g=this.extendTranslation(g,i,o,s));else{var z=!1,U=!1,j=o.count!==void 0&&typeof o.count!="string",K=n.hasDefaultValue(o),se=j?this.pluralResolver.getSuffix(O,o.count,o):"",G=o["defaultValue".concat(se)]||o.defaultValue;!this.isValidLookup(g)&&K&&(z=!0,g=G),this.isValidLookup(g)||(U=!0,g=f);var re=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,Te=re&&U?void 0:g,Re=K&&G!==g&&this.options.updateMissing;if(U||z||Re){if(this.logger.log(Re?"updateKey":"missingKey",O,d,f,Re?G:g),c){var V=this.resolve(f,Hs(Hs({},o),{},{keySeparator:!1}));V&&V.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var pe=[],J=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&J&&J[0])for(var ae=0;ae<J.length;ae++)pe.push(J[ae]);else this.options.saveMissingTo==="all"?pe=this.languageUtils.toResolveHierarchy(o.lng||this.language):pe.push(o.lng||this.language);var ie=function(Xe,je,at){var it=K&&at!==g?at:Te;a.options.missingKeyHandler?a.options.missingKeyHandler(Xe,d,je,it,Re,o):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(Xe,d,je,it,Re,o),a.emit("missingKey",Xe,d,je,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&j?pe.forEach(function(Ee){a.pluralResolver.getSuffixes(Ee,o).forEach(function(Xe){ie([Ee],f+Xe,o["defaultValue".concat(Xe)]||G)})}):ie(pe,f,G))}g=this.extendTranslation(g,i,o,p,s),U&&g===f&&this.options.appendNamespaceToMissingKey&&(g="".concat(d,":").concat(f)),(U||z)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(d,":").concat(f):f,z?g:void 0):g=this.options.parseMissingKeyHandler(g))}return l?(p.res=g,p):g}},{key:"extendTranslation",value:function(i,o,s,a,l){var c=this;if(this.i18nFormat&&this.i18nFormat.parse)i=this.i18nFormat.parse(i,Hs(Hs({},this.options.interpolation.defaultVariables),s),a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init(Hs(Hs({},s),{interpolation:Hs(Hs({},this.options.interpolation),s.interpolation)}));var u=typeof i=="string"&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),f;if(u){var h=i.match(this.interpolator.nestingRegexp);f=h&&h.length}var d=s.replace&&typeof s.replace!="string"?s.replace:s;if(this.options.interpolation.defaultVariables&&(d=Hs(Hs({},this.options.interpolation.defaultVariables),d)),i=this.interpolator.interpolate(i,d,s.lng||this.language,s),u){var O=i.match(this.interpolator.nestingRegexp),b=O&&O.length;f<b&&(s.nest=!1)}s.nest!==!1&&(i=this.interpolator.nest(i,function(){for(var g=arguments.length,y=new Array(g),S=0;S<g;S++)y[S]=arguments[S];return l&&l[0]===y[0]&&!s.context?(c.logger.warn("It seems you are nesting recursively key: ".concat(y[0]," in key: ").concat(o[0])),null):c.translate.apply(c,y.concat([o]))},s)),s.interpolation&&this.interpolator.reset()}var v=s.postProcess||this.options.postProcess,p=typeof v=="string"?[v]:v;return i!=null&&p&&p.length&&s.applyPostProcessor!==!1&&(i=RK.handle(p,i,o,this.options&&this.options.postProcessPassResolved?Hs({i18nResolved:a},s):s,this)),i}},{key:"resolve",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,l,c,u,f;return typeof i=="string"&&(i=[i]),i.forEach(function(h){if(!o.isValidLookup(a)){var d=o.extractFromKey(h,s),O=d.key;l=O;var b=d.namespaces;o.options.fallbackNS&&(b=b.concat(o.options.fallbackNS));var v=s.count!==void 0&&typeof s.count!="string",p=v&&!s.ordinal&&s.count===0&&o.pluralResolver.shouldUseIntlApi(),g=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",y=s.lngs?s.lngs:o.languageUtils.toResolveHierarchy(s.lng||o.language,s.fallbackLng);b.forEach(function(S){o.isValidLookup(a)||(f=S,!_D["".concat(y[0],"-").concat(S)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(f)&&(_D["".concat(y[0],"-").concat(S)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(y.join(", "),`" won't get resolved as namespace "`).concat(f,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(function(w){if(!o.isValidLookup(a)){u=w;var T=[O];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(T,O,w,S,s);else{var k;v&&(k=o.pluralResolver.getSuffix(w,s.count,s));var A="".concat(o.options.pluralSeparator,"zero");if(v&&(T.push(O+k),p&&T.push(O+A)),g){var L="".concat(O).concat(o.options.contextSeparator).concat(s.context);T.push(L),v&&(T.push(L+k),p&&T.push(L+A))}}for(var $;$=T.pop();)o.isValidLookup(a)||(c=$,a=o.getResource(w,S,$,s))}}))})}}),{res:a,usedKey:l,exactUsedKey:c,usedLng:u,usedNS:f}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,o,s,a):this.resourceStore.getResource(i,o,s,a)}}],[{key:"hasDefaultValue",value:function(i){var o="defaultValue";for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)&&o===s.substring(0,o.length)&&i[s]!==void 0)return!0;return!1}}]),n}(dh);function qk(t){return t.charAt(0).toUpperCase()+t.slice(1)}var lwe=function(){function t(e){la(this,t),this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=hu.create("languageUtils")}return ca(t,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],i=n.split("-");return this.options.lowerCaseLng?i=i.map(function(o){return o.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=qk(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=qk(i[1].toLowerCase())),r.indexOf(i[2].toLowerCase())>-1&&(i[2]=qk(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var i;return n.forEach(function(o){if(!i){var s=r.formatLanguageCode(o);(!r.options.supportedLngs||r.isSupportedCode(s))&&(i=s)}}),!i&&this.options.supportedLngs&&n.forEach(function(o){if(!i){var s=r.getLanguagePartFromCode(o);if(r.isSupportedCode(s))return i=s;i=r.options.supportedLngs.find(function(a){if(a.indexOf(s)===0)return a})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var i=n[r];return i||(i=n[this.getScriptPartFromCode(r)]),i||(i=n[this.formatLanguageCode(r)]),i||(i=n[this.getLanguagePartFromCode(r)]),i||(i=n.default),i||[]}},{key:"toResolveHierarchy",value:function(n,r){var i=this,o=this.getFallbackCodes(r||this.options.fallbackLng||[],n),s=[],a=function(c){!c||(i.isSupportedCode(c)?s.push(c):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(c)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(n))):typeof n=="string"&&a(this.formatLanguageCode(n)),o.forEach(function(l){s.indexOf(l)<0&&a(i.formatLanguageCode(l))}),s}}]),t}(),cwe=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],uwe={1:function(e){return Number(e>1)},2:function(e){return Number(e!=1)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(e==1?0:e>=2&&e<=4?1:2)},7:function(e){return Number(e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(e==1?0:e==2?1:e!=8&&e!=11?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(e==1?0:e==2?1:e<7?2:e<11?3:4)},11:function(e){return Number(e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(e!==0)},14:function(e){return Number(e==1?0:e==2?1:e==3?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:e!==0?1:2)},17:function(e){return Number(e==1||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(e==0?0:e==1?1:2)},19:function(e){return Number(e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(e==1?0:e==0||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3)}},fwe=["v1","v2","v3"],kD={zero:0,one:1,two:2,few:3,many:4,other:5};function dwe(){var t={};return cwe.forEach(function(e){e.lngs.forEach(function(n){t[n]={numbers:e.nr,plurals:uwe[e.fc]}})}),t}var hwe=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};la(this,t),this.languageUtils=e,this.options=n,this.logger=hu.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl=="undefined"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=dwe()}return ca(t,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,r);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,i).map(function(o){return"".concat(r).concat(o)})}},{key:"getSuffixes",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(s,a){return kD[s]-kD[a]}).map(function(s){return"".concat(r.options.prepend).concat(s)}):o.numbers.map(function(s){return r.getSuffix(n,s,i)}):[]}},{key:"getSuffix",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(r)):this.getSuffixRetroCompatible(o,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var i=this,o=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),s=n.numbers[o];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var a=function(){return i.options.prepend&&s.toString()?i.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!fwe.includes(this.options.compatibilityJSON)}}]),t}();function PD(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Oc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?PD(Object(n),!0).forEach(function(r){Ln(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):PD(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var pwe=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};la(this,t),this.logger=hu.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(n){return n},this.init(e)}return ca(t,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:ewe,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?wO(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?wO(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?wO(r.nestingPrefix):r.nestingPrefixEscaped||wO("$t("),this.nestingSuffix=r.nestingSuffix?wO(r.nestingSuffix):r.nestingSuffixEscaped||wO(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(n,r,i,o){var s=this,a,l,c,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function f(v){return v.replace(/\$/g,"$$$$")}var h=function(p){if(p.indexOf(s.formatSeparator)<0){var g=xD(r,u,p);return s.alwaysFormat?s.format(g,void 0,i,Oc(Oc(Oc({},o),r),{},{interpolationkey:p})):g}var y=p.split(s.formatSeparator),S=y.shift().trim(),w=y.join(s.formatSeparator).trim();return s.format(xD(r,u,S),w,i,Oc(Oc(Oc({},o),r),{},{interpolationkey:S}))};this.resetRegExp();var d=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,O=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,b=[{regex:this.regexpUnescape,safeValue:function(p){return f(p)}},{regex:this.regexp,safeValue:function(p){return s.escapeValue?f(s.escape(p)):f(p)}}];return b.forEach(function(v){for(c=0;a=v.regex.exec(n);){var p=a[1].trim();if(l=h(p),l===void 0)if(typeof d=="function"){var g=d(n,a,o);l=typeof g=="string"?g:""}else if(o&&o.hasOwnProperty(p))l="";else if(O){l=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(p," for interpolating ").concat(n)),l="";else typeof l!="string"&&!s.useRawValueToEscape&&(l=yD(l));var y=v.safeValue(l);if(n=n.replace(a[0],y),O?(v.regex.lastIndex+=l.length,v.regex.lastIndex-=a[0].length):v.regex.lastIndex=0,c++,c>=s.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,a,l=Oc({},o);l.applyPostProcessor=!1,delete l.defaultValue;function c(d,O){var b=this.nestingOptionsSeparator;if(d.indexOf(b)<0)return d;var v=d.split(new RegExp("".concat(b,"[ ]*{"))),p="{".concat(v[1]);d=v[0],p=this.interpolate(p,l),p=p.replace(/'/g,'"');try{l=JSON.parse(p),O&&(l=Oc(Oc({},O),l))}catch(g){return this.logger.warn("failed parsing options string in nesting for key ".concat(d),g),"".concat(d).concat(b).concat(p)}return delete l.defaultValue,d}for(;s=this.nestingRegexp.exec(n);){var u=[],f=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){var h=s[1].split(this.formatSeparator).map(function(d){return d.trim()});s[1]=h.shift(),u=h,f=!0}if(a=r(c.call(this,s[1].trim(),l),l),a&&s[0]===n&&typeof a!="string")return a;typeof a!="string"&&(a=yD(a)),a||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(n)),a=""),f&&(a=u.reduce(function(d,O){return i.format(d,O,o.lng,Oc(Oc({},o),{},{interpolationkey:s[1].trim()}))},a.trim())),n=n.replace(s[0],a),this.regexp.lastIndex=0}return n}}]),t}();function QD(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ld(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?QD(Object(n),!0).forEach(function(r){Ln(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):QD(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Owe(t){var e=t.toLowerCase().trim(),n={};if(t.indexOf("(")>-1){var r=t.split("(");e=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);if(e==="currency"&&i.indexOf(":")<0)n.currency||(n.currency=i.trim());else if(e==="relativetime"&&i.indexOf(":")<0)n.range||(n.range=i.trim());else{var o=i.split(";");o.forEach(function(s){if(!!s){var a=s.split(":"),l=Z4e(a),c=l[0],u=l.slice(1),f=u.join(":").trim().replace(/^'+|'+$/g,"");n[c.trim()]||(n[c.trim()]=f),f==="false"&&(n[c.trim()]=!1),f==="true"&&(n[c.trim()]=!0),isNaN(f)||(n[c.trim()]=parseInt(f,10))}})}}return{formatName:e,formatOptions:n}}var mwe=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};la(this,t),this.logger=hu.create("formatter"),this.options=e,this.formats={number:function(r,i,o){return new Intl.NumberFormat(i,o).format(r)},currency:function(r,i,o){return new Intl.NumberFormat(i,ld(ld({},o),{},{style:"currency"})).format(r)},datetime:function(r,i,o){return new Intl.DateTimeFormat(i,ld({},o)).format(r)},relativetime:function(r,i,o){return new Intl.RelativeTimeFormat(i,ld({},o)).format(r,o.range||"day")},list:function(r,i,o){return new Intl.ListFormat(i,ld({},o)).format(r)}},this.init(e)}return ca(t,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=r.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"format",value:function(n,r,i,o){var s=this,a=r.split(this.formatSeparator),l=a.reduce(function(c,u){var f=Owe(u),h=f.formatName,d=f.formatOptions;if(s.formats[h]){var O=c;try{var b=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},v=b.locale||b.lng||o.locale||o.lng||i;O=s.formats[h](c,v,ld(ld(ld({},d),o),b))}catch(p){s.logger.warn(p)}return O}else s.logger.warn("there was no format function for ".concat(h));return c},n);return l}}]),t}();function $D(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ED(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?$D(Object(n),!0).forEach(function(r){Ln(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$D(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function gwe(t){var e=vwe();return function(){var r=nc(t),i;if(e){var o=nc(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return W0(this,i)}}function vwe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ywe(t,e){t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)}var bwe=function(t){kh(n,t);var e=gwe(n);function n(r,i,o){var s,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return la(this,n),s=e.call(this),o_&&dh.call(Mc(s)),s.backend=r,s.store=i,s.services=o,s.languageUtils=o.languageUtils,s.options=a,s.logger=hu.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=a.maxParallelReads||10,s.readingCalls=0,s.maxRetries=a.maxRetries>=0?a.maxRetries:5,s.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(o,a.backend,a),s}return ca(n,[{key:"queueLoad",value:function(i,o,s,a){var l=this,c={},u={},f={},h={};return i.forEach(function(d){var O=!0;o.forEach(function(b){var v="".concat(d,"|").concat(b);!s.reload&&l.store.hasResourceBundle(d,b)?l.state[v]=2:l.state[v]<0||(l.state[v]===1?u[v]===void 0&&(u[v]=!0):(l.state[v]=1,O=!1,u[v]===void 0&&(u[v]=!0),c[v]===void 0&&(c[v]=!0),h[b]===void 0&&(h[b]=!0)))}),O||(f[d]=!0)}),(Object.keys(c).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(c),pending:Object.keys(u),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(h)}}},{key:"loaded",value:function(i,o,s){var a=i.split("|"),l=a[0],c=a[1];o&&this.emit("failedLoading",l,c,o),s&&this.store.addResourceBundle(l,c,s),this.state[i]=o?-1:2;var u={};this.queue.forEach(function(f){K4e(f.loaded,[l],c),ywe(f,i),o&&f.errors.push(o),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(function(h){u[h]||(u[h]={});var d=f.loaded[h];d.length&&d.forEach(function(O){u[h][O]===void 0&&(u[h][O]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(function(f){return!f.done})}},{key:"read",value:function(i,o,s){var a=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,u=arguments.length>5?arguments[5]:void 0;if(!i.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:o,fcName:s,tried:l,wait:c,callback:u});return}return this.readingCalls++,this.backend[s](i,o,function(f,h){if(a.readingCalls--,a.waitingReads.length>0){var d=a.waitingReads.shift();a.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(f&&h&&l<a.maxRetries){setTimeout(function(){a.read.call(a,i,o,s,l+1,c*2,u)},c);return}u(f,h)})}},{key:"prepareLoading",value:function(i,o){var s=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof o=="string"&&(o=[o]);var c=this.queueLoad(i,o,a,l);if(!c.toLoad.length)return c.pending.length||l(),null;c.toLoad.forEach(function(u){s.loadOne(u)})}},{key:"load",value:function(i,o,s){this.prepareLoading(i,o,{},s)}},{key:"reload",value:function(i,o,s){this.prepareLoading(i,o,{reload:!0},s)}},{key:"loadOne",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=i.split("|"),l=a[0],c=a[1];this.read(l,c,"read",void 0,void 0,function(u,f){u&&o.logger.warn("".concat(s,"loading namespace ").concat(c," for language ").concat(l," failed"),u),!u&&f&&o.logger.log("".concat(s,"loaded namespace ").concat(c," for language ").concat(l),f),o.loaded(i,u,f)})}},{key:"saveMissing",value:function(i,o,s,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(s,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}s==null||s===""||(this.backend&&this.backend.create&&this.backend.create(i,o,s,a,null,ED(ED({},c),{},{isUpdate:l})),!(!i||!i[0])&&this.store.addResource(i[0],o,s,a))}}]),n}(dh);function xwe(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var n={};if(Ra(e[1])==="object"&&(n=e[1]),typeof e[1]=="string"&&(n.defaultValue=e[1]),typeof e[2]=="string"&&(n.tDescription=e[2]),Ra(e[2])==="object"||Ra(e[3])==="object"){var r=e[3]||e[2];Object.keys(r).forEach(function(i){n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:function(e,n,r,i){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function CD(t){return typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function RD(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Hc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?RD(Object(n),!0).forEach(function(r){Ln(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):RD(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Swe(t){var e=wwe();return function(){var r=nc(t),i;if(e){var o=nc(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return W0(this,i)}}function wwe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function W5(){}function _we(t){var e=Object.getOwnPropertyNames(Object.getPrototypeOf(t));e.forEach(function(n){typeof t[n]=="function"&&(t[n]=t[n].bind(t))})}var FS=function(t){kh(n,t);var e=Swe(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(la(this,n),r=e.call(this),o_&&dh.call(Mc(r)),r.options=CD(i),r.services={},r.logger=hu,r.modules={external:[]},_we(Mc(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),W0(r,Mc(r));setTimeout(function(){r.init(i,o)},0)}return r}return ca(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(s=o,o={}),!o.defaultNS&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var a=xwe();this.options=Hc(Hc(Hc({},a),this.options),CD(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Hc(Hc({},a.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(p){return p?typeof p=="function"?new p:p:null}if(!this.options.isClone){this.modules.logger?hu.init(l(this.modules.logger),this.options):hu.init(null,this.options);var c;this.modules.formatter?c=this.modules.formatter:typeof Intl!="undefined"&&(c=mwe);var u=new lwe(this.options);this.store=new owe(this.options.resources,this.options);var f=this.services;f.logger=hu,f.resourceStore=this.store,f.languageUtils=u,f.pluralResolver=new hwe(u,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(f.formatter=l(c),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new pwe(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new bwe(l(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(p){for(var g=arguments.length,y=new Array(g>1?g-1:0),S=1;S<g;S++)y[S-1]=arguments[S];i.emit.apply(i,[p].concat(y))}),this.modules.languageDetector&&(f.languageDetector=l(this.modules.languageDetector),f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=l(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new TD(this.services,this.options),this.translator.on("*",function(p){for(var g=arguments.length,y=new Array(g>1?g-1:0),S=1;S<g;S++)y[S-1]=arguments[S];i.emit.apply(i,[p].concat(y))}),this.modules.external.forEach(function(p){p.init&&p.init(i)})}if(this.format=this.options.interpolation.format,s||(s=W5),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var d=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];d.forEach(function(p){i[p]=function(){var g;return(g=i.store)[p].apply(g,arguments)}});var O=["addResource","addResources","addResourceBundle","removeResourceBundle"];O.forEach(function(p){i[p]=function(){var g;return(g=i.store)[p].apply(g,arguments),i}});var b=Im(),v=function(){var g=function(S,w){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),b.resolve(w),s(S,w)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return g(null,i.t.bind(i));i.changeLanguage(i.options.lng,g)};return this.options.resources||!this.options.initImmediate?v():setTimeout(v,0),b}},{key:"loadResources",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:W5,a=s,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(a=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return a();var c=[],u=function(d){if(!!d){var O=o.services.languageUtils.toResolveHierarchy(d);O.forEach(function(b){c.indexOf(b)<0&&c.push(b)})}};if(l)u(l);else{var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.forEach(function(h){return u(h)})}this.options.preload&&this.options.preload.forEach(function(h){return u(h)}),this.services.backendConnector.load(c,this.options.ns,function(h){!h&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),a(h)})}else a(null)}},{key:"reloadResources",value:function(i,o,s){var a=Im();return i||(i=this.languages),o||(o=this.options.ns),s||(s=W5),this.services.backendConnector.reload(i,o,function(l){a.resolve(),s(l)}),a}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&RK.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o<this.languages.length;o++){var s=this.languages[o];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(i,o){var s=this;this.isLanguageChangingTo=i;var a=Im();this.emit("languageChanging",i);var l=function(h){s.language=h,s.languages=s.services.languageUtils.toResolveHierarchy(h),s.resolvedLanguage=void 0,s.setResolvedLanguage(h)},c=function(h,d){d?(l(d),s.translator.changeLanguage(d),s.isLanguageChangingTo=void 0,s.emit("languageChanged",d),s.logger.log("languageChanged",d)):s.isLanguageChangingTo=void 0,a.resolve(function(){return s.t.apply(s,arguments)}),o&&o(h,function(){return s.t.apply(s,arguments)})},u=function(h){!i&&!h&&s.services.languageDetector&&(h=[]);var d=typeof h=="string"?h:s.services.languageUtils.getBestMatchFromCodes(h);d&&(s.language||l(d),s.translator.language||s.translator.changeLanguage(d),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage(d)),s.loadResources(d,function(O){c(O,d)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(u):u(i),a}},{key:"getFixedT",value:function(i,o,s){var a=this,l=function c(u,f){var h;if(Ra(f)!=="object"){for(var d=arguments.length,O=new Array(d>2?d-2:0),b=2;b<d;b++)O[b-2]=arguments[b];h=a.options.overloadTranslationOptionHandler([u,f].concat(O))}else h=Hc({},f);h.lng=h.lng||c.lng,h.lngs=h.lngs||c.lngs,h.ns=h.ns||c.ns,h.keyPrefix=h.keyPrefix||s||c.keyPrefix;var v=a.options.keySeparator||".",p=h.keyPrefix?"".concat(h.keyPrefix).concat(v).concat(u):u;return a.t(p,h)};return typeof i=="string"?l.lng=i:l.lngs=i,l.ns=o,l.keyPrefix=s,l}},{key:"t",value:function(){var i;return this.translator&&(i=this.translator).translate.apply(i,arguments)}},{key:"exists",value:function(){var i;return this.translator&&(i=this.translator).exists.apply(i,arguments)}},{key:"setDefaultNamespace",value:function(i){this.options.defaultNS=i}},{key:"hasLoadedNamespace",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var a=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var u=function(d,O){var b=o.services.backendConnector.state["".concat(d,"|").concat(O)];return b===-1||b===2};if(s.precheck){var f=s.precheck(this,u);if(f!==void 0)return f}return!!(this.hasResourceBundle(a,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||u(a,i)&&(!l||u(c,i)))}},{key:"loadNamespaces",value:function(i,o){var s=this,a=Im();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){s.options.ns.indexOf(l)<0&&s.options.ns.push(l)}),this.loadResources(function(l){a.resolve(),o&&o(l)}),a):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var s=Im();typeof i=="string"&&(i=[i]);var a=this.options.preload||[],l=i.filter(function(c){return a.indexOf(c)<0});return l.length?(this.options.preload=a.concat(l),this.loadResources(function(c){s.resolve(),o&&o(c)}),s):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return o.indexOf(this.services.languageUtils.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:W5,a=Hc(Hc(Hc({},this.options),o),{isClone:!0}),l=new n(a),c=["store","services","language"];return c.forEach(function(u){l[u]=i[u]}),l.services=Hc({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new TD(l.services,l.options),l.translator.on("*",function(u){for(var f=arguments.length,h=new Array(f>1?f-1:0),d=1;d<f;d++)h[d-1]=arguments[d];l.emit.apply(l,[u].concat(h))}),l.init(a,s),l.translator.options=l.options,l.translator.backendConnector.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(dh);Ln(FS,"createInstance",function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return new FS(t,e)});var Qo=FS.createInstance();Qo.createInstance=FS.createInstance;Qo.createInstance;Qo.init;Qo.loadResources;Qo.reloadResources;Qo.use;Qo.changeLanguage;Qo.getFixedT;var Twe=Qo.t;Qo.exists;Qo.setDefaultNamespace;Qo.hasLoadedNamespace;Qo.loadNamespaces;Qo.loadLanguages;function Mv(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function Bo(t,e){if(t==null)return{};var n=Mv(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,r)||(n[r]=t[r]))}return n}var kwe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230);/g,Pwe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xA9","©":"\xA9","®":"\xAE","®":"\xAE","…":"\u2026","…":"\u2026"},Qwe=function(e){return Pwe[e]},$we=function(e){return e.replace(kwe,Qwe)};function AD(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ID(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?AD(Object(n),!0).forEach(function(r){Ln(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):AD(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var LQ={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:$we},AK,Ewe=M.exports.createContext();function Cwe(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};LQ=ID(ID({},LQ),t)}function Rwe(){return LQ}var Awe=function(){function t(){la(this,t),this.usedNamespaces={}}return ca(t,[{key:"addUsedNamespaces",value:function(n){var r=this;n.forEach(function(i){r.usedNamespaces[i]||(r.usedNamespaces[i]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),t}();function Iwe(t){AK=t}function zwe(){return AK}var Lwe={type:"3rdParty",init:function(e){Cwe(e.options.react),Iwe(e)}};function Nwe(){if(console&&console.warn){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];typeof n[0]=="string"&&(n[0]="react-i18next:: ".concat(n[0])),(t=console).warn.apply(t,n)}}var zD={};function NQ(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];typeof e[0]=="string"&&zD[e[0]]||(typeof e[0]=="string"&&(zD[e[0]]=new Date),Nwe.apply(void 0,e))}function LD(t,e,n){t.loadNamespaces(e,function(){if(t.isInitialized)n();else{var r=function i(){setTimeout(function(){t.off("initialized",i)},0),n()};t.on("initialized",r)}})}function Mwe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=e.languages[0],i=e.options?e.options.fallbackLng:!1,o=e.languages[e.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var s=function(l,c){var u=e.services.backendConnector.state["".concat(l,"|").concat(c)];return u===-1||u===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!s(e.isLanguageChangingTo,t)?!1:!!(e.hasResourceBundle(r,t)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||s(r,t)&&(!i||s(o,t)))}function Dwe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e.languages||!e.languages.length)return NQ("i18n.languages were undefined or empty",e.languages),!0;var r=e.options.ignoreJSONStructure!==void 0;return r?e.hasLoadedNamespace(t,{precheck:function(o,s){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!s(o.isLanguageChangingTo,t))return!1}}):Mwe(t,e,n)}function Xwe(t,e){var n=t==null?null:typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(t);!(i=(s=n.next()).done)&&(r.push(s.value),!(e&&r.length===e));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function Rn(t,e){return PK(t)||Xwe(t,e)||AC(t,e)||$K()}function ND(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Bk(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ND(Object(n),!0).forEach(function(r){Ln(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ND(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Wwe=function(e,n){var r=M.exports.useRef();return M.exports.useEffect(function(){r.current=n?r.current:e},[e,n]),r.current};function pl(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.i18n,r=M.exports.useContext(Ewe)||{},i=r.i18n,o=r.defaultNS,s=n||i||zwe();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new Awe),!s){NQ("You will need to pass in an i18next instance by using initReactI18next");var a=function(L){return Array.isArray(L)?L[L.length-1]:L},l=[a,{},!1];return l.t=a,l.i18n={},l.ready=!1,l}s.options.react&&s.options.react.wait!==void 0&&NQ("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var c=Bk(Bk(Bk({},Rwe()),s.options.react),e),u=c.useSuspense,f=c.keyPrefix,h=t||o||s.options&&s.options.defaultNS;h=typeof h=="string"?[h]:h||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(h);var d=(s.isInitialized||s.initializedStoreOnce)&&h.every(function(A){return Dwe(A,s,c)});function O(){return s.getFixedT(null,c.nsMode==="fallback"?h:h[0],f)}var b=M.exports.useState(O),v=Rn(b,2),p=v[0],g=v[1],y=h.join(),S=Wwe(y),w=M.exports.useRef(!0);M.exports.useEffect(function(){var A=c.bindI18n,L=c.bindI18nStore;w.current=!0,!d&&!u&&LD(s,h,function(){w.current&&g(O)}),d&&S&&S!==y&&w.current&&g(O);function $(){w.current&&g(O)}return A&&s&&s.on(A,$),L&&s&&s.store.on(L,$),function(){w.current=!1,A&&s&&A.split(" ").forEach(function(E){return s.off(E,$)}),L&&s&&L.split(" ").forEach(function(E){return s.store.off(E,$)})}},[s,y]);var T=M.exports.useRef(!0);M.exports.useEffect(function(){w.current&&!T.current&&g(O),T.current=!1},[s]);var k=[p,s,d];if(k.t=p,k.i18n=s,k.ready=d,d||!d&&!u)return k;throw new Promise(function(A){LD(s,h,function(){A()})})}var Uwe={common_success:"Success",common_confirm:"Confirm",common_cancel:"Cancel",common_delete:"Delete",common_hidden:"Hidden",common_locked:"Locked",common_offline:"Offline",common_directory:"Directory",common_file:"File",editor_no_open_file:"None file opened",editor_large_file_tip:"The file size is over 16 MB, preview is not supported",editor_unsupported_format_file_cannot_display:"The file cannot be displayed for unsupported format",editor_picture_not_support_preview:"Picture's preview is not yet supported",editor_search_files_by_name:"Search files by name",editor_pending_update:"{{pendingUpdate}} updates to be written",editor_ot_success:"Success",editor_file_is_not_editable:"The file is not editable",file_tree_click_to_show:"Click to show",file_tree_click_to_hidden:"Click to hide",file_tree_click_to_cancel:"Click to cancel",file_tree_click_to_locked:"Click to lock",file_tree_joined_the_test:"Joined the test",file_tree_click_to_remove:"Click to remove",file_tree_add_test:"Add test",file_tree_num_of_files_cannot_exceed_500:"The number of files cannot exceed 500",file_tree_x_existed:"{{x}} existed",file_tree_x_filtered:"{{x}} filtered",file_tree_x_upload_not_allowed:"Upload of {{x}} not allowed",file_tree_renamed:"Renamed",file_tree_upload_files:"Upload files",file_tree_upload_folder:"Upload folder",show_hidden_files:"Show Hidden files",do_no_show_hidden_files:"Do not show hidden files",file_tree_rename:"Rename",file_tree_create_new_file:"New file",file_tree_create_new_folder:"New folder",file_tree_make_sure_delete_x_unrecoverable:"Are you sure to delete this {{x}}? The file cannot be recovered after deletion",file_tree_kind_tips:"Notice",file_tree_understood:"Know",file_tree_space_char_exist_in_file_or_folder:"There is a space character",output_browser_click_run_start_application:"Click \u3010Run\u3011 to start the application",debug_variables:"Variables",debug_call_stack:"Call stack",helpers_invalid_parameter_rate_x:"Invalid parameter: rate={{x}}",lib_the_area_already_set_answer_area_cannot_repeatedly:"The area has already set the answering area and cannot be set repeatedly",lib_x_file_cannot_set_the_answer_area:"The {{x}} file cannot set the answer area",lib_locked:"locked",lib_hidden:"hidden",store_user_not_found:"User not found",store_appStatus_transition_error_x:"AppStatus transition error: {{x}}",dao_channel_agentUserId_x_inconsistent:"The agentUserId {{x}} is inconsistent",dao_channel_event_x_is_not_supported:"Event {{x}} is not supported",dao_channel_connection_not_established:"The connection has not been established yet",dao_channel_playground_not_exist:"Playground does not exist",dao_channel_playground_unbound_container:"Playground unbound container",dao_channel_container_startup_failed:"Container startup failed",dao_channel_insufficient_server_resources:"Insufficient server resources",dao_channel_server_is_busy:"Server is busy",dao_channel_activation_timeout:"Docker activation timeout",dao_channel_docker_failed_to_activate:"Docker failed to start",dao_channel_socket_is_not_ready:"Socket is not ready",dao_channel_socket_is_not_ready_for_x:"Socket is not ready for {{x}}",dao_channel_socket_connect_broken:"Socket connection broken",dao_paas_cannot_follow_each_other:"Cannot follow each other",\u4E0D\u80FD\u76F4\u63A5\u590D\u5236\u7B54\u9898\u533A\u57DF\u5185\u5BB9:"Cannt copy the content",\u8BE5\u533A\u57DF\u4E0D\u53EF\u7F16\u8F91:"Cannt edit the content",dao_paas_not_find_mount_dom_object_for_x:"Could not find mounted DOM object for {{x}}",dao_paas_x_component_is_not_supported:"{{x}} component is not supported",dao_paas_no_ready:"No ready",\u8BF7\u5728\u6587\u4EF6\u6811\u4E2D\u6253\u5F00\u6587\u4EF6\u8FDB\u884C\u7F16\u8F91:"Pleas go to file tree to select one file and open it",dao_paas_file_does_not_exist:"File does not exist",dao_pass_set_answer_wrong:"Get wrong when insert answer for question","Unable to create file or directory with system reserved name":"Unable to create file or directory with system reserved name","The file or folder {{path}} already exists in this location, please choose another name":"The file or folder {{path}} already exists in this location, please choose another name","No results":"No results","Collapse the file tree":"Collapse the file tree","Create or rename to hidden files, will not be visible":"Create or rename to hidden files, will not be visible"},qwe={common_success:"\u6210\u529F",common_confirm:"\u786E\u5B9A",common_cancel:"\u53D6\u6D88",common_delete:"\u5220\u9664",common_hidden:"\u5DF2\u9690\u85CF",common_locked:"\u5DF2\u52A0\u9501",common_offline:"\u79BB\u7EBF",common_directory:"\u76EE\u5F55",common_file:"\u6587\u4EF6",editor_no_open_file:"\u672A\u6253\u5F00\u6587\u4EF6",editor_large_file_tip:"\u6587\u4EF6\u8D85\u8FC716\u5146\u5927\u5C0F\uFF0C\u6682\u4E0D\u652F\u6301\u9884\u89C8",editor_unsupported_format_file_cannot_display:"\u6B64\u6587\u4EF6\u662F\u4E8C\u8FDB\u5236\u6587\u4EF6\u6216\u4F7F\u7528\u4E86\u4E0D\u652F\u6301\u7684\u6587\u4EF6\u7F16\u7801\uFF0C\u65E0\u6CD5\u5728\u7F16\u8F91\u5668\u4E2D\u663E\u793A",editor_picture_not_support_preview:"\u56FE\u7247\u6682\u65F6\u4E0D\u652F\u6301\u9884\u89C8",editor_search_files_by_name:"\u6309\u540D\u79F0\u641C\u7D22\u6587\u4EF6",editor_pending_update:"{{pendingUpdate}}\u4E2A\u66F4\u65B0\u5F85\u5199\u5165",editor_ot_success:"\u6210\u529F",editor_file_is_not_editable:"\u8BE5\u6587\u4EF6\u4E0D\u53EF\u7F16\u8F91",file_tree_click_to_show:"\u70B9\u51FB\u663E\u793A",file_tree_click_to_hidden:"\u70B9\u51FB\u9690\u85CF",file_tree_click_to_cancel:"\u70B9\u51FB\u53D6\u6D88",file_tree_click_to_locked:"\u70B9\u51FB\u9501\u5B9A",file_tree_joined_the_test:"\u5DF2\u52A0\u5165\u6D4B\u8BD5",file_tree_click_to_remove:"\u70B9\u51FB\u79FB\u9664",file_tree_add_test:"\u6DFB\u52A0\u6D4B\u8BD5",file_tree_num_of_files_cannot_exceed_500:"\u6587\u4EF6\u6570\u91CF\u4E0D\u80FD\u8D85\u8FC7500",file_tree_x_existed:"{{x}}\u5DF2\u5B58\u5728",file_tree_x_filtered:"{{x}}\u88AB\u8FC7\u6EE4",file_tree_x_upload_not_allowed:"{{x}}\u4E0D\u5141\u8BB8\u4E0A\u4F20",file_tree_renamed:"\u91CD\u540D\u4E86",file_tree_upload_files:"\u4E0A\u4F20\u6587\u4EF6",file_tree_upload_folder:"\u4E0A\u4F20\u6587\u4EF6\u5939",show_hidden_files:"\u663E\u793A\u9690\u85CF\u6587\u4EF6",do_no_show_hidden_files:"\u4E0D\u663E\u793A\u9690\u85CF\u6587\u4EF6",file_tree_rename:"\u91CD\u547D\u540D",file_tree_create_new_file:"\u65B0\u5EFA\u6587\u4EF6",file_tree_create_new_folder:"\u65B0\u5EFA\u6587\u4EF6\u5939",file_tree_make_sure_delete_x_unrecoverable:"\u786E\u5B9A\u5220\u9664\u8FD9\u4E2A{{x}}\u5417\uFF1F\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D",file_tree_kind_tips:"\u6E29\u99A8\u63D0\u793A",file_tree_understood:"\u77E5\u9053\u4E86",file_tree_space_char_exist_in_file_or_folder:"\u5B58\u5728\u7A7A\u683C\u5B57\u7B26",output_browser_click_run_start_application:"\u70B9\u51FB\u3010\u8FD0\u884C\u3011\u542F\u52A8\u5E94\u7528",debug_variables:"\u53D8\u91CF",debug_call_stack:"\u8C03\u7528\u5806\u6808",helpers_invalid_parameter_rate_x:"\u65E0\u6548\u7684\u53C2\u6570: rate={{x}}",lib_the_area_already_set_answer_area_cannot_repeatedly:"\u8BE5\u533A\u57DF\u5DF2\u8BBE\u7F6E\u7B54\u9898\u533A\uFF0C\u4E0D\u53EF\u91CD\u590D\u8BBE\u7F6E",lib_x_file_cannot_set_the_answer_area:"{{x}}\u6587\u4EF6\u4E0D\u53EF\u4EE5\u8BBE\u7F6E\u7B54\u9898\u533A",lib_locked:"\u52A0\u9501",lib_hidden:"\u9690\u85CF",store_user_not_found:"\u627E\u4E0D\u5230\u7528\u6237",store_appStatus_transition_error_x:"appStatus \u8F6C\u6362\u9519\u8BEF: {{x}}",dao_channel_agentUserId_x_inconsistent:"agentUserId {{x}} \u4E0D\u4E00\u81F4",dao_channel_event_x_is_not_supported:"\u4E8B\u4EF6 {{x}} \u4E0D\u652F\u6301",dao_channel_connection_not_established:"\u8FDE\u63A5\u5C1A\u672A\u5EFA\u7ACB",dao_channel_playground_not_exist:"playground\u4E0D\u5B58\u5728",dao_channel_playground_unbound_container:"playground\u672A\u7ED1\u5B9A\u5BB9\u5668",dao_channel_container_startup_failed:"\u5BB9\u5668\u542F\u52A8\u5931\u8D25",dao_channel_insufficient_server_resources:"\u670D\u52A1\u5668\u8D44\u6E90\u4E0D\u8DB3",dao_channel_server_is_busy:"\u670D\u52A1\u5668\u7E41\u5FD9",dao_channel_activation_timeout:"docker\u6FC0\u6D3B\u8D85\u65F6",dao_channel_docker_failed_to_activate:"docker\u542F\u52A8\u5931\u8D25",dao_channel_socket_is_not_ready:"socket\u672A\u51C6\u5907\u597D",dao_channel_socket_is_not_ready_for_x:"socket \u8FD8\u6CA1\u6709\u4E3A{{x}}\u51C6\u5907\u597D",dao_channel_socket_connect_broken:"socket\u8FDE\u63A5\u4E2D\u65AD",dao_paas_cannot_follow_each_other:"\u4E0D\u80FD\u4E92\u76F8\u8DDF\u968F",\u4E0D\u80FD\u76F4\u63A5\u590D\u5236\u7B54\u9898\u533A\u57DF\u5185\u5BB9:"\u4E0D\u80FD\u76F4\u63A5\u590D\u5236\u7B54\u9898\u533A\u57DF\u5185\u5BB9",\u8BE5\u533A\u57DF\u4E0D\u53EF\u7F16\u8F91:"\u8BE5\u533A\u57DF\u4E0D\u53EF\u7F16\u8F91",dao_paas_not_find_mount_dom_object_for_x:"\u627E\u4E0D\u5230\u4E3A{{x}}\u7684\u6302\u8F7DDOM\u5BF9\u8C61",dao_paas_x_component_is_not_supported:"\u7EC4\u4EF6{{x}}\u4E0D\u652F\u6301",dao_paas_no_ready:"\u672A\u51C6\u5907",\u8BF7\u5728\u6587\u4EF6\u6811\u4E2D\u6253\u5F00\u6587\u4EF6\u8FDB\u884C\u7F16\u8F91:"\u8BF7\u5728\u6587\u4EF6\u6811\u4E2D\u6253\u5F00\u6587\u4EF6\u8FDB\u884C\u7F16\u8F91",dao_paas_file_does_not_exist:"\u6587\u4EF6\u4E0D\u5B58\u5728",dao_pass_set_answer_wrong:"\u8BBE\u7F6E\u9898\u76EE\u7B54\u6848\u9519\u8BEF","Unable to create file or directory with system reserved name":"\u65E0\u6CD5\u4F7F\u7528\u7CFB\u7EDF\u4FDD\u7559\u540D\u79F0\u521B\u5EFA\u6587\u4EF6\u6216\u76EE\u5F55","The file or folder {{path}} already exists in this location, please choose another name":"\u6B64\u4F4D\u7F6E\u5DF2\u5B58\u5728\u6587\u4EF6\u6216\u8005\u6587\u4EF6\u5939 {{path}}\uFF0C\u8BF7\u9009\u62E9\u5176\u5B83\u540D\u79F0","No results":"\u6CA1\u6709\u7ED3\u679C","Collapse the file tree":"\u6536\u8D77\u6587\u4EF6\u6811","Create or rename to hidden files, will not be visible":"\u521B\u5EFA\u6216\u8005\u91CD\u547D\u540D\u4E3A\u9690\u85CF\u6587\u4EF6\uFF0C\u5C06\u4E0D\u53EF\u89C1"},jS=(t=>(t.ZH="ZH",t.EN="EN",t))(jS||{});const Bwe={EN:{translation:Uwe},ZH:{translation:qwe}},Ywe="ZH";Qo.use(Lwe).init({resources:Bwe,lng:Ywe,keySeparator:!1,interpolation:{escapeValue:!1}});const or=Qo.t,Fwe=[1,2,3,5,8,16];class jwe{constructor(e,n,r,i,o,s,a,l){St(this,"start");St(this,"end");St(this,"totalTime");St(this,"rate");St(this,"preFrameTime",0);St(this,"resumeTime",0);St(this,"dataBuffer",[]);St(this,"playing",!1);St(this,"isReplay",!1);St(this,"index",0);St(this,"firstFrameTime",0);St(this,"isMovePosition",!1);St(this,"preTerminalIndex",{});St(this,"preDebugIndex",{});St(this,"preFireTreeIndex",{});St(this,"preTerminalDockerId","");St(this,"preConsoleDockerId","");St(this,"isStopMovePosition",!1);St(this,"triggerEventForMaxTimespanRecord","");St(this,"triggerEventForMaxTimespan",-1);St(this,"eventCustomize");St(this,"eventDispatcher");St(this,"getPlaybackSnapshot");St(this,"progressDispatcher");St(this,"currentDockerId");this.start=e,this.end=n,this.rate=1,this.totalTime=n-e,this.triggerEventForMaxTimespan=i,this.eventDispatcher=o,this.progressDispatcher=s,this.getPlaybackSnapshot=a,this.eventCustomize=l,this.step=this.step.bind(this),this.currentDockerId=""}logger(...e){Mt.info(`${new Date(Date.now()).toLocaleString()} [Playback]${e.join(",")}`)}convertToAbsoluteTime(e){return this.start+e}setRate(e){e&&!Fwe.includes(e)&&this.progressDispatcher&&this.progressDispatcher("error",`${or("helpers_invalid_parameter_rate_x",{x:e})}`),this.rate=e||this.rate}buffer(e){this.dataBuffer=this.dataBuffer.concat(e),this.firstFrameTime=this.dataBuffer[0].timestamp}pause(){if(this.logger("Click Pause!"),!this.playing){Mt.warn("Do not pause more than one time");return}this.playing=!1}resume(){this.resumeTime=this.resumeTime||0,this.resumeTime>0?this.isReplay=!0:this.preFrameTime=Date.now(),this.playing=!0,this.isStopMovePosition=!1,window.requestAnimationFrame(this.step)}restart(){this.preFrameTime=Date.now(),this.playing=!0,this.preFireTreeIndex={},this.preTerminalIndex={},this.preDebugIndex={},this.preTerminalDockerId="",this.preConsoleDockerId="",Ce.file.reset(),this.index=0,window.requestAnimationFrame(this.step)}movePosition(e){var n;if(!((n=this.dataBuffer)!=null&&n.length)){this.resumeTime=e;return}this.isStopMovePosition=!this.playing,this.resumeTime=e,this.isReplay=!0,this.index=this.findFrameByTimeStamp(),this.isMovePosition=!0,this.preTerminalIndex={},this.preDebugIndex={},Ce.dao.resetTerminal(),Ce.dao.resetConsole(),oe.dao.channel().xtermStatus({resetConsole:!0}),window.requestAnimationFrame(this.step)}findFrameByTimeStamp(){const e=this.resumeTime+this.firstFrameTime,n=this.dataBuffer,r=n.length,i=(a,l)=>{var c,u,f,h;if(a<=l){const d=Math.floor((l-a)/2+a),O=n[d].timestamp;return O===e?d:e===((c=n[d-1])==null?void 0:c.timestamp)?d-1:e===((u=n[d+1])==null?void 0:u.timestamp)||e>((f=n[d-1])==null?void 0:f.timestamp)&&e<((h=n[d+1])==null?void 0:h.timestamp)?d+1:(e<O?l=d-1:e>O&&(a=d+1),i(a,l))}else return Mt.warn("Do not find the next frame"),this.index=0,this.resumeTime=0,this.resume(),this.index},o=0,s=r-1;return i(o,s)}gotoNextFrame(){var e;!this.isStopMovePosition&&((e=this.progressDispatcher)==null||e.call(this,"progress",this.resumeTime)),this.isStopMovePosition?(this.playing=!1,this.isStopMovePosition=!1):(this.preFrameTime=Date.now(),window.requestAnimationFrame(this.step))}triggerCustomizeEvent(e){var n;(n=this.eventCustomize)==null||n.call(this,e)}step(){var n,r,i;if(!this.playing&&!this.isStopMovePosition)return;if(this.isReplay&&(this.isReplay=!1,this.preFrameTime=Date.now()),this.resumeTime=this.resumeTime+(Date.now()-this.preFrameTime)*this.rate,this.index>this.dataBuffer.length-1){this.playing=!1,this.resumeTime=0,!this.isStopMovePosition&&((n=this.progressDispatcher)==null||n.call(this,"progress",this.totalTime)),(r=this.progressDispatcher)==null||r.call(this,"complete",this.resumeTime);return}let e=this.dataBuffer[this.index];if(!e){this.gotoNextFrame();return}if(e.eventName==="customize"&&(this.firstFrameTime+this.resumeTime>(e==null?void 0:e.timestamp)&&(this.logger(this.index,e.index,e.eventName,e._id),this.index++,this.triggerCustomizeEvent(e)),!this.isStopMovePosition)){this.gotoNextFrame();return}if(this.firstFrameTime+this.resumeTime>(e==null?void 0:e.timestamp)){if(this.isTerminalOrConsole(e.eventName)){this.trigger(e.eventName,e),this.gotoNextFrame();return}let s=0;const a=this.firstFrameTime+this.resumeTime;for(let l=this.index+1;l<this.dataBuffer.length&&this.dataBuffer[l].timestamp<=a;l++)s++,this.index=l;s>0&&(e=this.dataBuffer[this.index],this.isMovePosition=!0),this.isMovePosition?(this.triggerPreFrames(),this.isMovePosition=!1):(e=((i=this.getPlaybackSnapshot)==null?void 0:i.call(this,e.eventName,e,this.getPreFrameByFrame(e,this.index)||e))||e,this.setPreFrameData(e,this.index)),this.trigger(e.eventName,e)}else this.isMovePosition&&(this.triggerPreFrames(),this.isMovePosition=!1);this.gotoNextFrame()}getPreFrameByFrame(e,n){const{eventName:r,dockerId:i}=e,o=this.isEditor(r),s=this.isFileTree(r);let a;if(o){const{data:{openedPath:l}}=e;for(let c=n-1;c>=0;c--){const u=this.dataBuffer[c];if(u.dockerId===i&&u.eventName===r&&u.data.openedPath===l){a=this.dataBuffer[c],!a.snapshot&&c>=0&&this.setSnapshotByIndex(c);break}}}return s&&(a=this.dataBuffer[this.preFireTreeIndex[i]]),a}setPreFrameData(e,n){const{eventName:r,dockerId:i}=e;this.isFileTree(r)&&(this.preFireTreeIndex[i]=n)}isEditor(e){return e===Ct.Editor}isFileTree(e){return e===Ct.FileTree}isTerminal(e){return e===Ct.Terminal}isConsole(e){return e===Ct.Console}isDebug(e){return e===Ct.Debug}isTerminalOrConsole(e){return[Ct.Terminal.toString(),Ct.Console.toString()].includes(e)}setSnapshotByIndex(e){var o;const n=this.dataBuffer[e],{eventName:r}=n,i=this.isEditor(r);for(let s=0;s<=e;s++){let a=this.dataBuffer[s];if(a.eventName===n.eventName&&a.dockerId===n.dockerId&&(i?a.data.openedPath===n.data.openedPath:!0)){if(a.snapshot){this.setPreFrameData(a,s);continue}a=((o=this.getPlaybackSnapshot)==null?void 0:o.call(this,a.eventName,a,this.getPreFrameByFrame(a,s)))||a,this.setPreFrameData(a,s)}}}triggerPreFrames(){const e=[Ct.FileTree.toString(),Ct.Editor.toString(),Ct.Terminal.toString(),Ct.Console.toString(),Ct.Debug.toString()],n=this.index,r=this.dataBuffer[n].dockerId;this.currentDockerId=r;for(let i=n;i>=0;i--){if(!e.length)return;if(e.includes(this.dataBuffer[i].eventName)&&this.dataBuffer[i].dockerId===this.currentDockerId){const o=this.dataBuffer[i],s=e.findIndex(a=>a===o.eventName);e.splice(s,1),o.snapshot||this.setSnapshotByIndex(i),this.trigger(o.eventName,o,!1)}}e.forEach(i=>{this.logger("trigger reset eventName:",i),this.trigger(i,null,!1)})}trigger(e,n,r=!0){if(e==="customize"){this.logger(this.index,e,n==null?void 0:n._id),this.triggerCustomizeEvent(n),r&&this.index++;return}const i=this.isTerminalOrConsole(e),o=this.isDebug(e);if(!i&&!o){this.logger(this.index,e,n==null?void 0:n._id),this.eventDispatcher(e,n),r&&this.index++;return}const s=n==null?void 0:n.dockerId;this.logger("[TR]",s);const a=this.preTerminalIndex[s]||0,l=this.preDebugIndex[s]||0,c=o?l:a;for(let u=c+1;u<=this.index;u++){const f=this.dataBuffer[u];f&&(this.isTerminalOrConsole(f.eventName)||o)&&f.dockerId===s&&(this.logger("[TR]",u,this.index,f.eventName,this.dataBuffer[u].dockerId,this.dataBuffer[u]._id),this.isTerminal(e)&&(this.preTerminalDockerId&&this.preTerminalDockerId!==s&&Ce.dao.resetTerminal(),this.preTerminalDockerId=s),this.isConsole(e)&&(this.preConsoleDockerId&&this.preConsoleDockerId!==s&&(Ce.dao.resetConsole(),oe.dao.channel().xtermStatus({resetConsole:!0})),this.preConsoleDockerId=s),this.eventDispatcher(f.eventName,f))}o?this.preDebugIndex[s]=this.index:this.preTerminalIndex[s]=this.index,r&&this.index++}}const Zwe="@dao42/d42paas-front",Vwe="0.9.96",Gwe="d42paas front",Hwe="dao42 paas team",Kwe="https://github.com/dao42/d42paas_frontend#readme",Jwe="UNLICENSED",e_e="./dist/DaoPaaS.cjs",t_e="./dist/DaoPaaS.cjs",n_e="./dist/DaoPaaS.d.ts",r_e={prebuild:"rimraf dist",build:"cross-env VITE_BUILD_EVENT=true pnpm tsc && pnpm vite && pnpm typedoc",copydist:"cp -r dist/sdk ../demo/public/",vite:"vite build --config ./config/vite.config.ts && shx cp ./src/types/DaoPaaS.d.ts ./dist",typedoc:"npx typedoc --tsconfig ./doc.tsconfig.json",workNameSpaceToFix:"node ./config/workNameSpaceToFix.js",tsc:"tsc -p ./tsconfig.json --isolatedModules false",test:"jest --coverage",prepublish:"pnpm build",publish:"npm publish --access public"},i_e={"@codemirror/autocomplete":"^6.0.2","@codemirror/collab":"^6.0.0","@codemirror/commands":"^6.0.0","@codemirror/lang-cpp":"^6.0.0","@codemirror/lang-css":"^6.0.0","@codemirror/lang-html":"^6.0.0","@codemirror/lang-java":"^6.0.0","@codemirror/lang-javascript":"^6.0.0","@codemirror/lang-json":"^6.0.0","@codemirror/lang-lezer":"^6.0.0","@codemirror/lang-markdown":"^6.0.0","@codemirror/lang-php":"^6.0.0","@codemirror/lang-python":"^6.0.0","@codemirror/lang-rust":"^6.0.0","@codemirror/lang-sql":"^6.0.0","@codemirror/lang-xml":"^6.0.0","@codemirror/language":"6.2.1","@codemirror/legacy-modes":"^6.0.0","@codemirror/lint":"^6.0.0","@codemirror/search":"^6.0.0","@codemirror/state":"^6.0.0","@codemirror/theme-one-dark":"^6.0.0","@codemirror/view":"^6.0.0","@emotion/babel-plugin":"^11.3.0","@emotion/babel-preset-css-prop":"^11.2.0","@emotion/core":"^11.0.0","@emotion/css":"^11.1.3","@emotion/eslint-plugin":"^11.2.0","@emotion/react":"^11.4.1","@emotion/styled":"^11.3.0","@headlessui/react":"^1.4.3","@loadable/component":"^5.15.2","@open-rpc/client-js":"^1.7.1","@testing-library/jest-dom":"^5.16.4","@testing-library/react":"^13.3.0","@types/fs-extra":"^9.0.13","@types/jest":"^27.0.2","@types/loadable__component":"^5.13.4","@types/lodash":"^4.14.175","@types/lodash.clonedeep":"^4.5.7","@types/lodash.isequal":"^4.5.6","@types/node":"^16.11.1","@types/ot":"^0.0.5","@types/prop-types":"^15.7.5","@types/react":"^18.0.14","@types/react-dom":"^18.0.5","@types/react-transition-group":"^4.4.5","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.28.2","@typescript-eslint/parser":"^4.28.2","@udecode/zustood":"^1.1.1","@vitejs/plugin-react":"^1.0.7",ahooks:"^3.3.10","babel-loader":"^8.2.2",bufferutil:"^4.0.6",classnames:"^2.3.1",codemirror:"^6.0.0",concurrently:"^6.3.0","cross-env":"^7.0.3",devicon:"^2.14.0",dexie:"^3.2.0","file-icons-js":"^1.1.0","file-loader":"^6.2.0","fs-extra":"^10.0.0","glob-all":"^3.2.1","highlight.js":"^11.6.0","hotkeys-js":"^3.9.4",immer:"^9.0.14",jest:"27.0.6",lodash:"^4.17.21",msw:"^0.39.2","ninja-keys":"^1.1.12",ot:"^0.0.15","prop-types":"^15.8.1",react:"^18.2.0","react-complex-tree":"^1.1.6","react-content-loader":"^6.2.0","react-dom":"18.2.0","react-icons":"^4.3.1","react-transition-group":"^4.4.2","rehype-document":"^6.1.0","rehype-highlight":"^5.0.2","rehype-katex":"^6.0.2","rehype-stringify":"^9.0.3","remark-gfm":"^3.0.1","remark-math":"^5.1.1","remark-parse":"^10.0.1","remark-rehype":"^10.1.0",rimraf:"^3.0.2","rollup-plugin-visualizer":"^5.6.0",sass:"^1.43.2","sass-loader":"^12.2.0",shx:"^0.3.3","socket.io-client":"^4.5.1","source-map-loader":"^3.0.0","style-loader":"^3.3.1",stylis:"^4.0.10","ts-jest":"^27.1.3","ts-loader":"^9.2.5","ts-node":"^10.0.0",typedoc:"^0.22.12",unified:"^10.1.2","use-immer":"^0.7.0","utf-8-validate":"^5.0.9",uuid:"^8.3.2",vite:"^2.7.2","vite-plugin-html":"^3.0.6","whatwg-fetch":"^3.6.2",xterm:"^4.13.0","xterm-addon-attach":"^0.6.0","xterm-addon-fit":"^0.5.0",zustand:"^4.0.0-rc.1"},o_e=["dist"],s_e={type:"git",url:"git+https://github.com/dao42/d42paas_frontend.git"},a_e={url:"https://github.com/dao42/d42paas_frontend/issues"},l_e={workerDirectory:"src"},c_e={"@sentry/browser":"^7.16.0","@sentry/tracing":"^7.16.0","@types/lodash.throttle":"^4.1.7","codemirror-lang-elixir":"^3.0.0",i18next:"^21.8.16","lodash.clonedeep":"^4.5.0","lodash.isequal":"^4.5.0","lodash.throttle":"^4.1.1",minimatch:"^5.1.0","range-analyzer":"0.1.1-alpha.2","rc-dropdown":"^4.0.1","rc-menu":"^9.6.3","react-i18next":"11.18.3","socket.io-msgpack-parser":"^3.0.1","xterm-addon-web-links":"^0.6.0"};var u_e={name:Zwe,version:Vwe,description:Gwe,author:Hwe,homepage:Kwe,license:Jwe,main:e_e,module:t_e,types:n_e,scripts:r_e,devDependencies:i_e,files:o_e,repository:s_e,bugs:a_e,msw:l_e,dependencies:c_e};const f_e=()=>u_e.version,d_e=async(t,e,n)=>{const r=window.localStorage.getItem("__paas__testServerCode__"),i=r?{serverCode:r}:{},s=await(await fetch(t+"/api/v1/jssdk/ticket",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ticket:e,packageVersion:n,...i})})).json();if(s.status==="failure")throw Mt.error(s),new Error(s.errors[0].erromsg);return s.data},Yi=(t,e=1)=>{t=t||"#ffffff";let n=t.replace("#","");n.length===3&&(n=`${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`);const r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),o=parseInt(n.substring(4,6),16);return e>1&&e<=100&&(e=e/100),`rgba(${r},${i},${o},${e})`},h_e=()=>{const t=`
|
|
49
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Z4e(t){return PK(t)||QK(t)||AC(t)||$K()}function gD(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function vD(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?gD(Object(n),!0).forEach(function(r){Ln(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):gD(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var V4e={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,n){console&&console[e]&&console[e].apply(console,n)}},G4e=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};la(this,t),this.init(e,n)}return ca(t,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||V4e,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"log","",!0)}},{key:"warn",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"warn","",!0)}},{key:"error",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"error","")}},{key:"deprecate",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(n,r,i,o){return o&&!this.debug?null:(typeof n[0]=="string"&&(n[0]="".concat(i).concat(this.prefix," ").concat(n[0])),this.logger[r](n))}},{key:"create",value:function(n){return new t(this.logger,vD(vD({},{prefix:"".concat(this.prefix,":").concat(n,":")}),this.options))}}]),t}(),hu=new G4e,dh=function(){function t(){la(this,t),this.observers={}}return ca(t,[{key:"on",value:function(n,r){var i=this;return n.split(" ").forEach(function(o){i.observers[o]=i.observers[o]||[],i.observers[o].push(r)}),this}},{key:"off",value:function(n,r){if(!!this.observers[n]){if(!r){delete this.observers[n];return}this.observers[n]=this.observers[n].filter(function(i){return i!==r})}}},{key:"emit",value:function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];if(this.observers[n]){var s=[].concat(this.observers[n]);s.forEach(function(l){l.apply(void 0,i)})}if(this.observers["*"]){var a=[].concat(this.observers["*"]);a.forEach(function(l){l.apply(l,[n].concat(i))})}}}]),t}();function Im(){var t,e,n=new Promise(function(r,i){t=r,e=i});return n.resolve=t,n.reject=e,n}function yD(t){return t==null?"":""+t}function H4e(t,e,n){t.forEach(function(r){e[r]&&(n[r]=e[r])})}function IC(t,e,n){function r(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function i(){return!t||typeof t=="string"}for(var o=typeof e!="string"?[].concat(e):e.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!t[s]&&n&&(t[s]=new n),Object.prototype.hasOwnProperty.call(t,s)?t=t[s]:t={}}return i()?{}:{obj:t,k:r(o.shift())}}function bD(t,e,n){var r=IC(t,e,Object),i=r.obj,o=r.k;i[o]=n}function K4e(t,e,n,r){var i=IC(t,e,Object),o=i.obj,s=i.k;o[s]=o[s]||[],r&&(o[s]=o[s].concat(n)),r||o[s].push(n)}function YS(t,e){var n=IC(t,e),r=n.obj,i=n.k;if(!!r)return r[i]}function xD(t,e,n){var r=YS(t,n);return r!==void 0?r:YS(e,n)}function EK(t,e,n){for(var r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?typeof t[r]=="string"||t[r]instanceof String||typeof e[r]=="string"||e[r]instanceof String?n&&(t[r]=e[r]):EK(t[r],e[r],n):t[r]=e[r]);return t}function wO(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var J4e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function ewe(t){return typeof t=="string"?t.replace(/[&<>"'\/]/g,function(e){return J4e[e]}):t}var o_=typeof window!="undefined"&&window.navigator&&typeof window.navigator.userAgentData=="undefined"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,twe=[" ",",","?","!",";"];function nwe(t,e,n){e=e||"",n=n||"";var r=twe.filter(function(a){return e.indexOf(a)<0&&n.indexOf(a)<0});if(r.length===0)return!0;var i=new RegExp("(".concat(r.map(function(a){return a==="?"?"\\?":a}).join("|"),")")),o=!i.test(t);if(!o){var s=t.indexOf(n);s>0&&!i.test(t.substring(0,s))&&(o=!0)}return o}function SD(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function X5(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?SD(Object(n),!0).forEach(function(r){Ln(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):SD(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function rwe(t){var e=iwe();return function(){var r=nc(t),i;if(e){var o=nc(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return W0(this,i)}}function iwe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function CK(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!!t){if(t[e])return t[e];for(var r=e.split(n),i=t,o=0;o<r.length;++o){if(!i||typeof i[r[o]]=="string"&&o+1<r.length)return;if(i[r[o]]===void 0){for(var s=2,a=r.slice(o,o+s).join(n),l=i[a];l===void 0&&r.length>o+s;)s++,a=r.slice(o,o+s).join(n),l=i[a];if(l===void 0)return;if(l===null)return null;if(e.endsWith(a)){if(typeof l=="string")return l;if(a&&typeof l[a]=="string")return l[a]}var c=r.slice(o+s).join(n);return c?CK(l,c,n):void 0}i=i[r[o]]}return i}}var owe=function(t){kh(n,t);var e=rwe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return la(this,n),i=e.call(this),o_&&dh.call(Mc(i)),i.data=r||{},i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return ca(n,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var o=this.options.ns.indexOf(i);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,c=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure,u=[i,o];s&&typeof s!="string"&&(u=u.concat(s)),s&&typeof s=="string"&&(u=u.concat(l?s.split(l):s)),i.indexOf(".")>-1&&(u=i.split("."));var f=YS(this.data,u);return f||!c||typeof s!="string"?f:CK(this.data&&this.data[i]&&this.data[i][o],s,l)}},{key:"addResource",value:function(i,o,s,a){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},c=this.options.keySeparator;c===void 0&&(c=".");var u=[i,o];s&&(u=u.concat(c?s.split(c):s)),i.indexOf(".")>-1&&(u=i.split("."),a=o,o=u[1]),this.addNamespaces(o),bD(this.data,u,a),l.silent||this.emit("added",i,o,s,a)}},{key:"addResources",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in s)(typeof s[l]=="string"||Object.prototype.toString.apply(s[l])==="[object Array]")&&this.addResource(i,o,l,s[l],{silent:!0});a.silent||this.emit("added",i,o,s)}},{key:"addResourceBundle",value:function(i,o,s,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},u=[i,o];i.indexOf(".")>-1&&(u=i.split("."),a=s,s=o,o=u[1]),this.addNamespaces(o);var f=YS(this.data,u)||{};a?EK(f,s,l):f=X5(X5({},f),s),bD(this.data,u,f),c.silent||this.emit("added",i,o,s)}},{key:"removeResourceBundle",value:function(i,o){this.hasResourceBundle(i,o)&&delete this.data[i][o],this.removeNamespaces(o),this.emit("removed",i,o)}},{key:"hasResourceBundle",value:function(i,o){return this.getResource(i,o)!==void 0}},{key:"getResourceBundle",value:function(i,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?X5(X5({},{}),this.getResource(i,o)):this.getResource(i,o)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var o=this.getDataByLanguage(i),s=o&&Object.keys(o)||[];return!!s.find(function(a){return o[a]&&Object.keys(o[a]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(dh),RK={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,n,r,i,o){var s=this;return e.forEach(function(a){s.processors[a]&&(n=s.processors[a].process(n,r,i,o))}),n}};function wD(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Hs(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?wD(Object(n),!0).forEach(function(r){Ln(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wD(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function swe(t){var e=awe();return function(){var r=nc(t),i;if(e){var o=nc(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return W0(this,i)}}function awe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var _D={},TD=function(t){kh(n,t);var e=swe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return la(this,n),i=e.call(this),o_&&dh.call(Mc(i)),H4e(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Mc(i)),i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=hu.create("translator"),i}return ca(n,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var s=this.resolve(i,o);return s&&s.res!==void 0}},{key:"extractFromKey",value:function(i,o){var s=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");var a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],c=s&&i.indexOf(s)>-1,u=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!nwe(i,s,a);if(c&&!u){var f=i.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:i,namespaces:l};var h=i.split(s);(s!==a||s===a&&this.options.ns.indexOf(h[0])>-1)&&(l=h.shift()),i=h.join(a)}return typeof l=="string"&&(l=[l]),{key:i,namespaces:l}}},{key:"translate",value:function(i,o,s){var a=this;if(Ra(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,c=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=this.extractFromKey(i[i.length-1],o),f=u.key,h=u.namespaces,d=h[h.length-1],O=o.lng||this.language,b=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(O&&O.toLowerCase()==="cimode"){if(b){var v=o.nsSeparator||this.options.nsSeparator;return l?(p.res="".concat(d).concat(v).concat(f),p):"".concat(d).concat(v).concat(f)}return l?(p.res=f,p):f}var p=this.resolve(i,o),g=p&&p.res,y=p&&p.usedKey||f,S=p&&p.exactUsedKey||f,w=Object.prototype.toString.apply(g),T=["[object Number]","[object Function]","[object RegExp]"],k=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,A=!this.i18nFormat||this.i18nFormat.handleAsObject,L=typeof g!="string"&&typeof g!="boolean"&&typeof g!="number";if(A&&g&&L&&T.indexOf(w)<0&&!(typeof k=="string"&&w==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var $=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,g,Hs(Hs({},o),{},{ns:h})):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");return l?(p.res=$,p):$}if(c){var E=w==="[object Array]",C=E?[]:{},I=E?S:y;for(var H in g)if(Object.prototype.hasOwnProperty.call(g,H)){var Y="".concat(I).concat(c).concat(H);C[H]=this.translate(Y,Hs(Hs({},o),{joinArrays:!1,ns:h})),C[H]===Y&&(C[H]=g[H])}g=C}}else if(A&&typeof k=="string"&&w==="[object Array]")g=g.join(k),g&&(g=this.extendTranslation(g,i,o,s));else{var z=!1,U=!1,j=o.count!==void 0&&typeof o.count!="string",K=n.hasDefaultValue(o),se=j?this.pluralResolver.getSuffix(O,o.count,o):"",G=o["defaultValue".concat(se)]||o.defaultValue;!this.isValidLookup(g)&&K&&(z=!0,g=G),this.isValidLookup(g)||(U=!0,g=f);var re=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,Te=re&&U?void 0:g,Re=K&&G!==g&&this.options.updateMissing;if(U||z||Re){if(this.logger.log(Re?"updateKey":"missingKey",O,d,f,Re?G:g),c){var V=this.resolve(f,Hs(Hs({},o),{},{keySeparator:!1}));V&&V.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var pe=[],J=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&J&&J[0])for(var ae=0;ae<J.length;ae++)pe.push(J[ae]);else this.options.saveMissingTo==="all"?pe=this.languageUtils.toResolveHierarchy(o.lng||this.language):pe.push(o.lng||this.language);var ie=function(Xe,je,at){var it=K&&at!==g?at:Te;a.options.missingKeyHandler?a.options.missingKeyHandler(Xe,d,je,it,Re,o):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(Xe,d,je,it,Re,o),a.emit("missingKey",Xe,d,je,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&j?pe.forEach(function(Ee){a.pluralResolver.getSuffixes(Ee,o).forEach(function(Xe){ie([Ee],f+Xe,o["defaultValue".concat(Xe)]||G)})}):ie(pe,f,G))}g=this.extendTranslation(g,i,o,p,s),U&&g===f&&this.options.appendNamespaceToMissingKey&&(g="".concat(d,":").concat(f)),(U||z)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(d,":").concat(f):f,z?g:void 0):g=this.options.parseMissingKeyHandler(g))}return l?(p.res=g,p):g}},{key:"extendTranslation",value:function(i,o,s,a,l){var c=this;if(this.i18nFormat&&this.i18nFormat.parse)i=this.i18nFormat.parse(i,Hs(Hs({},this.options.interpolation.defaultVariables),s),a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init(Hs(Hs({},s),{interpolation:Hs(Hs({},this.options.interpolation),s.interpolation)}));var u=typeof i=="string"&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),f;if(u){var h=i.match(this.interpolator.nestingRegexp);f=h&&h.length}var d=s.replace&&typeof s.replace!="string"?s.replace:s;if(this.options.interpolation.defaultVariables&&(d=Hs(Hs({},this.options.interpolation.defaultVariables),d)),i=this.interpolator.interpolate(i,d,s.lng||this.language,s),u){var O=i.match(this.interpolator.nestingRegexp),b=O&&O.length;f<b&&(s.nest=!1)}s.nest!==!1&&(i=this.interpolator.nest(i,function(){for(var g=arguments.length,y=new Array(g),S=0;S<g;S++)y[S]=arguments[S];return l&&l[0]===y[0]&&!s.context?(c.logger.warn("It seems you are nesting recursively key: ".concat(y[0]," in key: ").concat(o[0])),null):c.translate.apply(c,y.concat([o]))},s)),s.interpolation&&this.interpolator.reset()}var v=s.postProcess||this.options.postProcess,p=typeof v=="string"?[v]:v;return i!=null&&p&&p.length&&s.applyPostProcessor!==!1&&(i=RK.handle(p,i,o,this.options&&this.options.postProcessPassResolved?Hs({i18nResolved:a},s):s,this)),i}},{key:"resolve",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,l,c,u,f;return typeof i=="string"&&(i=[i]),i.forEach(function(h){if(!o.isValidLookup(a)){var d=o.extractFromKey(h,s),O=d.key;l=O;var b=d.namespaces;o.options.fallbackNS&&(b=b.concat(o.options.fallbackNS));var v=s.count!==void 0&&typeof s.count!="string",p=v&&!s.ordinal&&s.count===0&&o.pluralResolver.shouldUseIntlApi(),g=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",y=s.lngs?s.lngs:o.languageUtils.toResolveHierarchy(s.lng||o.language,s.fallbackLng);b.forEach(function(S){o.isValidLookup(a)||(f=S,!_D["".concat(y[0],"-").concat(S)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(f)&&(_D["".concat(y[0],"-").concat(S)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(y.join(", "),`" won't get resolved as namespace "`).concat(f,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(function(w){if(!o.isValidLookup(a)){u=w;var T=[O];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(T,O,w,S,s);else{var k;v&&(k=o.pluralResolver.getSuffix(w,s.count,s));var A="".concat(o.options.pluralSeparator,"zero");if(v&&(T.push(O+k),p&&T.push(O+A)),g){var L="".concat(O).concat(o.options.contextSeparator).concat(s.context);T.push(L),v&&(T.push(L+k),p&&T.push(L+A))}}for(var $;$=T.pop();)o.isValidLookup(a)||(c=$,a=o.getResource(w,S,$,s))}}))})}}),{res:a,usedKey:l,exactUsedKey:c,usedLng:u,usedNS:f}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,o,s,a):this.resourceStore.getResource(i,o,s,a)}}],[{key:"hasDefaultValue",value:function(i){var o="defaultValue";for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)&&o===s.substring(0,o.length)&&i[s]!==void 0)return!0;return!1}}]),n}(dh);function qk(t){return t.charAt(0).toUpperCase()+t.slice(1)}var lwe=function(){function t(e){la(this,t),this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=hu.create("languageUtils")}return ca(t,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],i=n.split("-");return this.options.lowerCaseLng?i=i.map(function(o){return o.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=qk(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=qk(i[1].toLowerCase())),r.indexOf(i[2].toLowerCase())>-1&&(i[2]=qk(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var i;return n.forEach(function(o){if(!i){var s=r.formatLanguageCode(o);(!r.options.supportedLngs||r.isSupportedCode(s))&&(i=s)}}),!i&&this.options.supportedLngs&&n.forEach(function(o){if(!i){var s=r.getLanguagePartFromCode(o);if(r.isSupportedCode(s))return i=s;i=r.options.supportedLngs.find(function(a){if(a.indexOf(s)===0)return a})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var i=n[r];return i||(i=n[this.getScriptPartFromCode(r)]),i||(i=n[this.formatLanguageCode(r)]),i||(i=n[this.getLanguagePartFromCode(r)]),i||(i=n.default),i||[]}},{key:"toResolveHierarchy",value:function(n,r){var i=this,o=this.getFallbackCodes(r||this.options.fallbackLng||[],n),s=[],a=function(c){!c||(i.isSupportedCode(c)?s.push(c):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(c)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(n))):typeof n=="string"&&a(this.formatLanguageCode(n)),o.forEach(function(l){s.indexOf(l)<0&&a(i.formatLanguageCode(l))}),s}}]),t}(),cwe=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],uwe={1:function(e){return Number(e>1)},2:function(e){return Number(e!=1)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(e==1?0:e>=2&&e<=4?1:2)},7:function(e){return Number(e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(e==1?0:e==2?1:e!=8&&e!=11?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(e==1?0:e==2?1:e<7?2:e<11?3:4)},11:function(e){return Number(e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(e!==0)},14:function(e){return Number(e==1?0:e==2?1:e==3?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:e!==0?1:2)},17:function(e){return Number(e==1||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(e==0?0:e==1?1:2)},19:function(e){return Number(e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(e==1?0:e==0||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3)}},fwe=["v1","v2","v3"],kD={zero:0,one:1,two:2,few:3,many:4,other:5};function dwe(){var t={};return cwe.forEach(function(e){e.lngs.forEach(function(n){t[n]={numbers:e.nr,plurals:uwe[e.fc]}})}),t}var hwe=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};la(this,t),this.languageUtils=e,this.options=n,this.logger=hu.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl=="undefined"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=dwe()}return ca(t,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,r);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,i).map(function(o){return"".concat(r).concat(o)})}},{key:"getSuffixes",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(s,a){return kD[s]-kD[a]}).map(function(s){return"".concat(r.options.prepend).concat(s)}):o.numbers.map(function(s){return r.getSuffix(n,s,i)}):[]}},{key:"getSuffix",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(r)):this.getSuffixRetroCompatible(o,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var i=this,o=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),s=n.numbers[o];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var a=function(){return i.options.prepend&&s.toString()?i.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!fwe.includes(this.options.compatibilityJSON)}}]),t}();function PD(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Oc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?PD(Object(n),!0).forEach(function(r){Ln(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):PD(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var pwe=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};la(this,t),this.logger=hu.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(n){return n},this.init(e)}return ca(t,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:ewe,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?wO(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?wO(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?wO(r.nestingPrefix):r.nestingPrefixEscaped||wO("$t("),this.nestingSuffix=r.nestingSuffix?wO(r.nestingSuffix):r.nestingSuffixEscaped||wO(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(n,r,i,o){var s=this,a,l,c,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function f(v){return v.replace(/\$/g,"$$$$")}var h=function(p){if(p.indexOf(s.formatSeparator)<0){var g=xD(r,u,p);return s.alwaysFormat?s.format(g,void 0,i,Oc(Oc(Oc({},o),r),{},{interpolationkey:p})):g}var y=p.split(s.formatSeparator),S=y.shift().trim(),w=y.join(s.formatSeparator).trim();return s.format(xD(r,u,S),w,i,Oc(Oc(Oc({},o),r),{},{interpolationkey:S}))};this.resetRegExp();var d=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,O=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,b=[{regex:this.regexpUnescape,safeValue:function(p){return f(p)}},{regex:this.regexp,safeValue:function(p){return s.escapeValue?f(s.escape(p)):f(p)}}];return b.forEach(function(v){for(c=0;a=v.regex.exec(n);){var p=a[1].trim();if(l=h(p),l===void 0)if(typeof d=="function"){var g=d(n,a,o);l=typeof g=="string"?g:""}else if(o&&o.hasOwnProperty(p))l="";else if(O){l=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(p," for interpolating ").concat(n)),l="";else typeof l!="string"&&!s.useRawValueToEscape&&(l=yD(l));var y=v.safeValue(l);if(n=n.replace(a[0],y),O?(v.regex.lastIndex+=l.length,v.regex.lastIndex-=a[0].length):v.regex.lastIndex=0,c++,c>=s.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,a,l=Oc({},o);l.applyPostProcessor=!1,delete l.defaultValue;function c(d,O){var b=this.nestingOptionsSeparator;if(d.indexOf(b)<0)return d;var v=d.split(new RegExp("".concat(b,"[ ]*{"))),p="{".concat(v[1]);d=v[0],p=this.interpolate(p,l),p=p.replace(/'/g,'"');try{l=JSON.parse(p),O&&(l=Oc(Oc({},O),l))}catch(g){return this.logger.warn("failed parsing options string in nesting for key ".concat(d),g),"".concat(d).concat(b).concat(p)}return delete l.defaultValue,d}for(;s=this.nestingRegexp.exec(n);){var u=[],f=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){var h=s[1].split(this.formatSeparator).map(function(d){return d.trim()});s[1]=h.shift(),u=h,f=!0}if(a=r(c.call(this,s[1].trim(),l),l),a&&s[0]===n&&typeof a!="string")return a;typeof a!="string"&&(a=yD(a)),a||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(n)),a=""),f&&(a=u.reduce(function(d,O){return i.format(d,O,o.lng,Oc(Oc({},o),{},{interpolationkey:s[1].trim()}))},a.trim())),n=n.replace(s[0],a),this.regexp.lastIndex=0}return n}}]),t}();function QD(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ld(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?QD(Object(n),!0).forEach(function(r){Ln(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):QD(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Owe(t){var e=t.toLowerCase().trim(),n={};if(t.indexOf("(")>-1){var r=t.split("(");e=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);if(e==="currency"&&i.indexOf(":")<0)n.currency||(n.currency=i.trim());else if(e==="relativetime"&&i.indexOf(":")<0)n.range||(n.range=i.trim());else{var o=i.split(";");o.forEach(function(s){if(!!s){var a=s.split(":"),l=Z4e(a),c=l[0],u=l.slice(1),f=u.join(":").trim().replace(/^'+|'+$/g,"");n[c.trim()]||(n[c.trim()]=f),f==="false"&&(n[c.trim()]=!1),f==="true"&&(n[c.trim()]=!0),isNaN(f)||(n[c.trim()]=parseInt(f,10))}})}}return{formatName:e,formatOptions:n}}var mwe=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};la(this,t),this.logger=hu.create("formatter"),this.options=e,this.formats={number:function(r,i,o){return new Intl.NumberFormat(i,o).format(r)},currency:function(r,i,o){return new Intl.NumberFormat(i,ld(ld({},o),{},{style:"currency"})).format(r)},datetime:function(r,i,o){return new Intl.DateTimeFormat(i,ld({},o)).format(r)},relativetime:function(r,i,o){return new Intl.RelativeTimeFormat(i,ld({},o)).format(r,o.range||"day")},list:function(r,i,o){return new Intl.ListFormat(i,ld({},o)).format(r)}},this.init(e)}return ca(t,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=r.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"format",value:function(n,r,i,o){var s=this,a=r.split(this.formatSeparator),l=a.reduce(function(c,u){var f=Owe(u),h=f.formatName,d=f.formatOptions;if(s.formats[h]){var O=c;try{var b=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},v=b.locale||b.lng||o.locale||o.lng||i;O=s.formats[h](c,v,ld(ld(ld({},d),o),b))}catch(p){s.logger.warn(p)}return O}else s.logger.warn("there was no format function for ".concat(h));return c},n);return l}}]),t}();function $D(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ED(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?$D(Object(n),!0).forEach(function(r){Ln(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$D(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function gwe(t){var e=vwe();return function(){var r=nc(t),i;if(e){var o=nc(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return W0(this,i)}}function vwe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ywe(t,e){t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)}var bwe=function(t){kh(n,t);var e=gwe(n);function n(r,i,o){var s,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return la(this,n),s=e.call(this),o_&&dh.call(Mc(s)),s.backend=r,s.store=i,s.services=o,s.languageUtils=o.languageUtils,s.options=a,s.logger=hu.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=a.maxParallelReads||10,s.readingCalls=0,s.maxRetries=a.maxRetries>=0?a.maxRetries:5,s.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(o,a.backend,a),s}return ca(n,[{key:"queueLoad",value:function(i,o,s,a){var l=this,c={},u={},f={},h={};return i.forEach(function(d){var O=!0;o.forEach(function(b){var v="".concat(d,"|").concat(b);!s.reload&&l.store.hasResourceBundle(d,b)?l.state[v]=2:l.state[v]<0||(l.state[v]===1?u[v]===void 0&&(u[v]=!0):(l.state[v]=1,O=!1,u[v]===void 0&&(u[v]=!0),c[v]===void 0&&(c[v]=!0),h[b]===void 0&&(h[b]=!0)))}),O||(f[d]=!0)}),(Object.keys(c).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(c),pending:Object.keys(u),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(h)}}},{key:"loaded",value:function(i,o,s){var a=i.split("|"),l=a[0],c=a[1];o&&this.emit("failedLoading",l,c,o),s&&this.store.addResourceBundle(l,c,s),this.state[i]=o?-1:2;var u={};this.queue.forEach(function(f){K4e(f.loaded,[l],c),ywe(f,i),o&&f.errors.push(o),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(function(h){u[h]||(u[h]={});var d=f.loaded[h];d.length&&d.forEach(function(O){u[h][O]===void 0&&(u[h][O]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(function(f){return!f.done})}},{key:"read",value:function(i,o,s){var a=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,u=arguments.length>5?arguments[5]:void 0;if(!i.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:o,fcName:s,tried:l,wait:c,callback:u});return}return this.readingCalls++,this.backend[s](i,o,function(f,h){if(a.readingCalls--,a.waitingReads.length>0){var d=a.waitingReads.shift();a.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(f&&h&&l<a.maxRetries){setTimeout(function(){a.read.call(a,i,o,s,l+1,c*2,u)},c);return}u(f,h)})}},{key:"prepareLoading",value:function(i,o){var s=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof o=="string"&&(o=[o]);var c=this.queueLoad(i,o,a,l);if(!c.toLoad.length)return c.pending.length||l(),null;c.toLoad.forEach(function(u){s.loadOne(u)})}},{key:"load",value:function(i,o,s){this.prepareLoading(i,o,{},s)}},{key:"reload",value:function(i,o,s){this.prepareLoading(i,o,{reload:!0},s)}},{key:"loadOne",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=i.split("|"),l=a[0],c=a[1];this.read(l,c,"read",void 0,void 0,function(u,f){u&&o.logger.warn("".concat(s,"loading namespace ").concat(c," for language ").concat(l," failed"),u),!u&&f&&o.logger.log("".concat(s,"loaded namespace ").concat(c," for language ").concat(l),f),o.loaded(i,u,f)})}},{key:"saveMissing",value:function(i,o,s,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(s,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}s==null||s===""||(this.backend&&this.backend.create&&this.backend.create(i,o,s,a,null,ED(ED({},c),{},{isUpdate:l})),!(!i||!i[0])&&this.store.addResource(i[0],o,s,a))}}]),n}(dh);function xwe(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var n={};if(Ra(e[1])==="object"&&(n=e[1]),typeof e[1]=="string"&&(n.defaultValue=e[1]),typeof e[2]=="string"&&(n.tDescription=e[2]),Ra(e[2])==="object"||Ra(e[3])==="object"){var r=e[3]||e[2];Object.keys(r).forEach(function(i){n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:function(e,n,r,i){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function CD(t){return typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function RD(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Hc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?RD(Object(n),!0).forEach(function(r){Ln(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):RD(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Swe(t){var e=wwe();return function(){var r=nc(t),i;if(e){var o=nc(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return W0(this,i)}}function wwe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function W5(){}function _we(t){var e=Object.getOwnPropertyNames(Object.getPrototypeOf(t));e.forEach(function(n){typeof t[n]=="function"&&(t[n]=t[n].bind(t))})}var FS=function(t){kh(n,t);var e=Swe(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(la(this,n),r=e.call(this),o_&&dh.call(Mc(r)),r.options=CD(i),r.services={},r.logger=hu,r.modules={external:[]},_we(Mc(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),W0(r,Mc(r));setTimeout(function(){r.init(i,o)},0)}return r}return ca(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(s=o,o={}),!o.defaultNS&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var a=xwe();this.options=Hc(Hc(Hc({},a),this.options),CD(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Hc(Hc({},a.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(p){return p?typeof p=="function"?new p:p:null}if(!this.options.isClone){this.modules.logger?hu.init(l(this.modules.logger),this.options):hu.init(null,this.options);var c;this.modules.formatter?c=this.modules.formatter:typeof Intl!="undefined"&&(c=mwe);var u=new lwe(this.options);this.store=new owe(this.options.resources,this.options);var f=this.services;f.logger=hu,f.resourceStore=this.store,f.languageUtils=u,f.pluralResolver=new hwe(u,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(f.formatter=l(c),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new pwe(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new bwe(l(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(p){for(var g=arguments.length,y=new Array(g>1?g-1:0),S=1;S<g;S++)y[S-1]=arguments[S];i.emit.apply(i,[p].concat(y))}),this.modules.languageDetector&&(f.languageDetector=l(this.modules.languageDetector),f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=l(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new TD(this.services,this.options),this.translator.on("*",function(p){for(var g=arguments.length,y=new Array(g>1?g-1:0),S=1;S<g;S++)y[S-1]=arguments[S];i.emit.apply(i,[p].concat(y))}),this.modules.external.forEach(function(p){p.init&&p.init(i)})}if(this.format=this.options.interpolation.format,s||(s=W5),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var d=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];d.forEach(function(p){i[p]=function(){var g;return(g=i.store)[p].apply(g,arguments)}});var O=["addResource","addResources","addResourceBundle","removeResourceBundle"];O.forEach(function(p){i[p]=function(){var g;return(g=i.store)[p].apply(g,arguments),i}});var b=Im(),v=function(){var g=function(S,w){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),b.resolve(w),s(S,w)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return g(null,i.t.bind(i));i.changeLanguage(i.options.lng,g)};return this.options.resources||!this.options.initImmediate?v():setTimeout(v,0),b}},{key:"loadResources",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:W5,a=s,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(a=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return a();var c=[],u=function(d){if(!!d){var O=o.services.languageUtils.toResolveHierarchy(d);O.forEach(function(b){c.indexOf(b)<0&&c.push(b)})}};if(l)u(l);else{var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.forEach(function(h){return u(h)})}this.options.preload&&this.options.preload.forEach(function(h){return u(h)}),this.services.backendConnector.load(c,this.options.ns,function(h){!h&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),a(h)})}else a(null)}},{key:"reloadResources",value:function(i,o,s){var a=Im();return i||(i=this.languages),o||(o=this.options.ns),s||(s=W5),this.services.backendConnector.reload(i,o,function(l){a.resolve(),s(l)}),a}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&RK.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o<this.languages.length;o++){var s=this.languages[o];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(i,o){var s=this;this.isLanguageChangingTo=i;var a=Im();this.emit("languageChanging",i);var l=function(h){s.language=h,s.languages=s.services.languageUtils.toResolveHierarchy(h),s.resolvedLanguage=void 0,s.setResolvedLanguage(h)},c=function(h,d){d?(l(d),s.translator.changeLanguage(d),s.isLanguageChangingTo=void 0,s.emit("languageChanged",d),s.logger.log("languageChanged",d)):s.isLanguageChangingTo=void 0,a.resolve(function(){return s.t.apply(s,arguments)}),o&&o(h,function(){return s.t.apply(s,arguments)})},u=function(h){!i&&!h&&s.services.languageDetector&&(h=[]);var d=typeof h=="string"?h:s.services.languageUtils.getBestMatchFromCodes(h);d&&(s.language||l(d),s.translator.language||s.translator.changeLanguage(d),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage(d)),s.loadResources(d,function(O){c(O,d)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(u):u(i),a}},{key:"getFixedT",value:function(i,o,s){var a=this,l=function c(u,f){var h;if(Ra(f)!=="object"){for(var d=arguments.length,O=new Array(d>2?d-2:0),b=2;b<d;b++)O[b-2]=arguments[b];h=a.options.overloadTranslationOptionHandler([u,f].concat(O))}else h=Hc({},f);h.lng=h.lng||c.lng,h.lngs=h.lngs||c.lngs,h.ns=h.ns||c.ns,h.keyPrefix=h.keyPrefix||s||c.keyPrefix;var v=a.options.keySeparator||".",p=h.keyPrefix?"".concat(h.keyPrefix).concat(v).concat(u):u;return a.t(p,h)};return typeof i=="string"?l.lng=i:l.lngs=i,l.ns=o,l.keyPrefix=s,l}},{key:"t",value:function(){var i;return this.translator&&(i=this.translator).translate.apply(i,arguments)}},{key:"exists",value:function(){var i;return this.translator&&(i=this.translator).exists.apply(i,arguments)}},{key:"setDefaultNamespace",value:function(i){this.options.defaultNS=i}},{key:"hasLoadedNamespace",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var a=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var u=function(d,O){var b=o.services.backendConnector.state["".concat(d,"|").concat(O)];return b===-1||b===2};if(s.precheck){var f=s.precheck(this,u);if(f!==void 0)return f}return!!(this.hasResourceBundle(a,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||u(a,i)&&(!l||u(c,i)))}},{key:"loadNamespaces",value:function(i,o){var s=this,a=Im();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){s.options.ns.indexOf(l)<0&&s.options.ns.push(l)}),this.loadResources(function(l){a.resolve(),o&&o(l)}),a):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var s=Im();typeof i=="string"&&(i=[i]);var a=this.options.preload||[],l=i.filter(function(c){return a.indexOf(c)<0});return l.length?(this.options.preload=a.concat(l),this.loadResources(function(c){s.resolve(),o&&o(c)}),s):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return o.indexOf(this.services.languageUtils.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:W5,a=Hc(Hc(Hc({},this.options),o),{isClone:!0}),l=new n(a),c=["store","services","language"];return c.forEach(function(u){l[u]=i[u]}),l.services=Hc({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new TD(l.services,l.options),l.translator.on("*",function(u){for(var f=arguments.length,h=new Array(f>1?f-1:0),d=1;d<f;d++)h[d-1]=arguments[d];l.emit.apply(l,[u].concat(h))}),l.init(a,s),l.translator.options=l.options,l.translator.backendConnector.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(dh);Ln(FS,"createInstance",function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return new FS(t,e)});var Qo=FS.createInstance();Qo.createInstance=FS.createInstance;Qo.createInstance;Qo.init;Qo.loadResources;Qo.reloadResources;Qo.use;Qo.changeLanguage;Qo.getFixedT;var Twe=Qo.t;Qo.exists;Qo.setDefaultNamespace;Qo.hasLoadedNamespace;Qo.loadNamespaces;Qo.loadLanguages;function Mv(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function Bo(t,e){if(t==null)return{};var n=Mv(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,r)||(n[r]=t[r]))}return n}var kwe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230);/g,Pwe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xA9","©":"\xA9","®":"\xAE","®":"\xAE","…":"\u2026","…":"\u2026"},Qwe=function(e){return Pwe[e]},$we=function(e){return e.replace(kwe,Qwe)};function AD(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ID(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?AD(Object(n),!0).forEach(function(r){Ln(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):AD(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var LQ={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:$we},AK,Ewe=M.exports.createContext();function Cwe(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};LQ=ID(ID({},LQ),t)}function Rwe(){return LQ}var Awe=function(){function t(){la(this,t),this.usedNamespaces={}}return ca(t,[{key:"addUsedNamespaces",value:function(n){var r=this;n.forEach(function(i){r.usedNamespaces[i]||(r.usedNamespaces[i]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),t}();function Iwe(t){AK=t}function zwe(){return AK}var Lwe={type:"3rdParty",init:function(e){Cwe(e.options.react),Iwe(e)}};function Nwe(){if(console&&console.warn){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];typeof n[0]=="string"&&(n[0]="react-i18next:: ".concat(n[0])),(t=console).warn.apply(t,n)}}var zD={};function NQ(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];typeof e[0]=="string"&&zD[e[0]]||(typeof e[0]=="string"&&(zD[e[0]]=new Date),Nwe.apply(void 0,e))}function LD(t,e,n){t.loadNamespaces(e,function(){if(t.isInitialized)n();else{var r=function i(){setTimeout(function(){t.off("initialized",i)},0),n()};t.on("initialized",r)}})}function Mwe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=e.languages[0],i=e.options?e.options.fallbackLng:!1,o=e.languages[e.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var s=function(l,c){var u=e.services.backendConnector.state["".concat(l,"|").concat(c)];return u===-1||u===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!s(e.isLanguageChangingTo,t)?!1:!!(e.hasResourceBundle(r,t)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||s(r,t)&&(!i||s(o,t)))}function Dwe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e.languages||!e.languages.length)return NQ("i18n.languages were undefined or empty",e.languages),!0;var r=e.options.ignoreJSONStructure!==void 0;return r?e.hasLoadedNamespace(t,{precheck:function(o,s){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!s(o.isLanguageChangingTo,t))return!1}}):Mwe(t,e,n)}function Xwe(t,e){var n=t==null?null:typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(t);!(i=(s=n.next()).done)&&(r.push(s.value),!(e&&r.length===e));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function Rn(t,e){return PK(t)||Xwe(t,e)||AC(t,e)||$K()}function ND(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Bk(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ND(Object(n),!0).forEach(function(r){Ln(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ND(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Wwe=function(e,n){var r=M.exports.useRef();return M.exports.useEffect(function(){r.current=n?r.current:e},[e,n]),r.current};function pl(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.i18n,r=M.exports.useContext(Ewe)||{},i=r.i18n,o=r.defaultNS,s=n||i||zwe();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new Awe),!s){NQ("You will need to pass in an i18next instance by using initReactI18next");var a=function(L){return Array.isArray(L)?L[L.length-1]:L},l=[a,{},!1];return l.t=a,l.i18n={},l.ready=!1,l}s.options.react&&s.options.react.wait!==void 0&&NQ("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var c=Bk(Bk(Bk({},Rwe()),s.options.react),e),u=c.useSuspense,f=c.keyPrefix,h=t||o||s.options&&s.options.defaultNS;h=typeof h=="string"?[h]:h||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(h);var d=(s.isInitialized||s.initializedStoreOnce)&&h.every(function(A){return Dwe(A,s,c)});function O(){return s.getFixedT(null,c.nsMode==="fallback"?h:h[0],f)}var b=M.exports.useState(O),v=Rn(b,2),p=v[0],g=v[1],y=h.join(),S=Wwe(y),w=M.exports.useRef(!0);M.exports.useEffect(function(){var A=c.bindI18n,L=c.bindI18nStore;w.current=!0,!d&&!u&&LD(s,h,function(){w.current&&g(O)}),d&&S&&S!==y&&w.current&&g(O);function $(){w.current&&g(O)}return A&&s&&s.on(A,$),L&&s&&s.store.on(L,$),function(){w.current=!1,A&&s&&A.split(" ").forEach(function(E){return s.off(E,$)}),L&&s&&L.split(" ").forEach(function(E){return s.store.off(E,$)})}},[s,y]);var T=M.exports.useRef(!0);M.exports.useEffect(function(){w.current&&!T.current&&g(O),T.current=!1},[s]);var k=[p,s,d];if(k.t=p,k.i18n=s,k.ready=d,d||!d&&!u)return k;throw new Promise(function(A){LD(s,h,function(){A()})})}var Uwe={common_success:"Success",common_confirm:"Confirm",common_cancel:"Cancel",common_delete:"Delete",common_hidden:"Hidden",common_locked:"Locked",common_offline:"Offline",common_directory:"Directory",common_file:"File",editor_no_open_file:"None file opened",editor_large_file_tip:"The file size is over 16 MB, preview is not supported",editor_unsupported_format_file_cannot_display:"The file cannot be displayed for unsupported format",editor_picture_not_support_preview:"Picture's preview is not yet supported",editor_search_files_by_name:"Search files by name",editor_pending_update:"{{pendingUpdate}} updates to be written",editor_ot_success:"Success",editor_file_is_not_editable:"The file is not editable",file_tree_click_to_show:"Click to show",file_tree_click_to_hidden:"Click to hide",file_tree_click_to_cancel:"Click to cancel",file_tree_click_to_locked:"Click to lock",file_tree_joined_the_test:"Joined the test",file_tree_click_to_remove:"Click to remove",file_tree_add_test:"Add test",file_tree_num_of_files_cannot_exceed_500:"The number of files cannot exceed 500",file_tree_x_existed:"{{x}} existed",file_tree_x_filtered:"{{x}} filtered",file_tree_x_upload_not_allowed:"Upload of {{x}} not allowed",file_tree_renamed:"Renamed",file_tree_upload_files:"Upload files",file_tree_upload_folder:"Upload folder",show_hidden_files:"Show Hidden files",do_no_show_hidden_files:"Do not show hidden files",file_tree_rename:"Rename",file_tree_create_new_file:"New file",file_tree_create_new_folder:"New folder",file_tree_make_sure_delete_x_unrecoverable:"Are you sure to delete this {{x}}? The file cannot be recovered after deletion",file_tree_kind_tips:"Notice",file_tree_understood:"Know",file_tree_space_char_exist_in_file_or_folder:"There is a space character",output_browser_click_run_start_application:"Click \u3010Run\u3011 to start the application",debug_variables:"Variables",debug_call_stack:"Call stack",helpers_invalid_parameter_rate_x:"Invalid parameter: rate={{x}}",lib_the_area_already_set_answer_area_cannot_repeatedly:"The area has already set the answering area and cannot be set repeatedly",lib_x_file_cannot_set_the_answer_area:"The {{x}} file cannot set the answer area",lib_locked:"locked",lib_hidden:"hidden",store_user_not_found:"User not found",store_appStatus_transition_error_x:"AppStatus transition error: {{x}}",dao_channel_agentUserId_x_inconsistent:"The agentUserId {{x}} is inconsistent",dao_channel_event_x_is_not_supported:"Event {{x}} is not supported",dao_channel_connection_not_established:"The connection has not been established yet",dao_channel_playground_not_exist:"Playground does not exist",dao_channel_playground_unbound_container:"Playground unbound container",dao_channel_container_startup_failed:"Container startup failed",dao_channel_insufficient_server_resources:"Insufficient server resources",dao_channel_server_is_busy:"Server is busy",dao_channel_activation_timeout:"Docker activation timeout",dao_channel_docker_failed_to_activate:"Docker failed to start",dao_channel_socket_is_not_ready:"Socket is not ready",dao_channel_socket_is_not_ready_for_x:"Socket is not ready for {{x}}",dao_channel_socket_connect_broken:"Socket connection broken",dao_paas_cannot_follow_each_other:"Cannot follow each other",\u4E0D\u80FD\u76F4\u63A5\u590D\u5236\u7B54\u9898\u533A\u57DF\u5185\u5BB9:"Cannt copy the content",\u8BE5\u533A\u57DF\u4E0D\u53EF\u7F16\u8F91:"Cannt edit the content",dao_paas_not_find_mount_dom_object_for_x:"Could not find mounted DOM object for {{x}}",dao_paas_x_component_is_not_supported:"{{x}} component is not supported",dao_paas_no_ready:"No ready",\u8BF7\u5728\u6587\u4EF6\u6811\u4E2D\u6253\u5F00\u6587\u4EF6\u8FDB\u884C\u7F16\u8F91:"Pleas go to file tree to select one file and open it",dao_paas_file_does_not_exist:"File does not exist",dao_pass_set_answer_wrong:"Get wrong when insert answer for question","Unable to create file or directory with system reserved name":"Unable to create file or directory with system reserved name","The file or folder {{path}} already exists in this location, please choose another name":"The file or folder {{path}} already exists in this location, please choose another name","No results":"No results","Collapse the file tree":"Collapse the file tree","Create or rename to hidden files, will not be visible":"Create or rename to hidden files, will not be visible"},qwe={common_success:"\u6210\u529F",common_confirm:"\u786E\u5B9A",common_cancel:"\u53D6\u6D88",common_delete:"\u5220\u9664",common_hidden:"\u5DF2\u9690\u85CF",common_locked:"\u5DF2\u52A0\u9501",common_offline:"\u79BB\u7EBF",common_directory:"\u76EE\u5F55",common_file:"\u6587\u4EF6",editor_no_open_file:"\u672A\u6253\u5F00\u6587\u4EF6",editor_large_file_tip:"\u6587\u4EF6\u8D85\u8FC716\u5146\u5927\u5C0F\uFF0C\u6682\u4E0D\u652F\u6301\u9884\u89C8",editor_unsupported_format_file_cannot_display:"\u6B64\u6587\u4EF6\u662F\u4E8C\u8FDB\u5236\u6587\u4EF6\u6216\u4F7F\u7528\u4E86\u4E0D\u652F\u6301\u7684\u6587\u4EF6\u7F16\u7801\uFF0C\u65E0\u6CD5\u5728\u7F16\u8F91\u5668\u4E2D\u663E\u793A",editor_picture_not_support_preview:"\u56FE\u7247\u6682\u65F6\u4E0D\u652F\u6301\u9884\u89C8",editor_search_files_by_name:"\u6309\u540D\u79F0\u641C\u7D22\u6587\u4EF6",editor_pending_update:"{{pendingUpdate}}\u4E2A\u66F4\u65B0\u5F85\u5199\u5165",editor_ot_success:"\u6210\u529F",editor_file_is_not_editable:"\u8BE5\u6587\u4EF6\u4E0D\u53EF\u7F16\u8F91",file_tree_click_to_show:"\u70B9\u51FB\u663E\u793A",file_tree_click_to_hidden:"\u70B9\u51FB\u9690\u85CF",file_tree_click_to_cancel:"\u70B9\u51FB\u53D6\u6D88",file_tree_click_to_locked:"\u70B9\u51FB\u9501\u5B9A",file_tree_joined_the_test:"\u5DF2\u52A0\u5165\u6D4B\u8BD5",file_tree_click_to_remove:"\u70B9\u51FB\u79FB\u9664",file_tree_add_test:"\u6DFB\u52A0\u6D4B\u8BD5",file_tree_num_of_files_cannot_exceed_500:"\u6587\u4EF6\u6570\u91CF\u4E0D\u80FD\u8D85\u8FC7500",file_tree_x_existed:"{{x}}\u5DF2\u5B58\u5728",file_tree_x_filtered:"{{x}}\u88AB\u8FC7\u6EE4",file_tree_x_upload_not_allowed:"{{x}}\u4E0D\u5141\u8BB8\u4E0A\u4F20",file_tree_renamed:"\u91CD\u540D\u4E86",file_tree_upload_files:"\u4E0A\u4F20\u6587\u4EF6",file_tree_upload_folder:"\u4E0A\u4F20\u6587\u4EF6\u5939",show_hidden_files:"\u663E\u793A\u9690\u85CF\u6587\u4EF6",do_no_show_hidden_files:"\u4E0D\u663E\u793A\u9690\u85CF\u6587\u4EF6",file_tree_rename:"\u91CD\u547D\u540D",file_tree_create_new_file:"\u65B0\u5EFA\u6587\u4EF6",file_tree_create_new_folder:"\u65B0\u5EFA\u6587\u4EF6\u5939",file_tree_make_sure_delete_x_unrecoverable:"\u786E\u5B9A\u5220\u9664\u8FD9\u4E2A{{x}}\u5417\uFF1F\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D",file_tree_kind_tips:"\u6E29\u99A8\u63D0\u793A",file_tree_understood:"\u77E5\u9053\u4E86",file_tree_space_char_exist_in_file_or_folder:"\u5B58\u5728\u7A7A\u683C\u5B57\u7B26",output_browser_click_run_start_application:"\u70B9\u51FB\u3010\u8FD0\u884C\u3011\u542F\u52A8\u5E94\u7528",debug_variables:"\u53D8\u91CF",debug_call_stack:"\u8C03\u7528\u5806\u6808",helpers_invalid_parameter_rate_x:"\u65E0\u6548\u7684\u53C2\u6570: rate={{x}}",lib_the_area_already_set_answer_area_cannot_repeatedly:"\u8BE5\u533A\u57DF\u5DF2\u8BBE\u7F6E\u7B54\u9898\u533A\uFF0C\u4E0D\u53EF\u91CD\u590D\u8BBE\u7F6E",lib_x_file_cannot_set_the_answer_area:"{{x}}\u6587\u4EF6\u4E0D\u53EF\u4EE5\u8BBE\u7F6E\u7B54\u9898\u533A",lib_locked:"\u52A0\u9501",lib_hidden:"\u9690\u85CF",store_user_not_found:"\u627E\u4E0D\u5230\u7528\u6237",store_appStatus_transition_error_x:"appStatus \u8F6C\u6362\u9519\u8BEF: {{x}}",dao_channel_agentUserId_x_inconsistent:"agentUserId {{x}} \u4E0D\u4E00\u81F4",dao_channel_event_x_is_not_supported:"\u4E8B\u4EF6 {{x}} \u4E0D\u652F\u6301",dao_channel_connection_not_established:"\u8FDE\u63A5\u5C1A\u672A\u5EFA\u7ACB",dao_channel_playground_not_exist:"playground\u4E0D\u5B58\u5728",dao_channel_playground_unbound_container:"playground\u672A\u7ED1\u5B9A\u5BB9\u5668",dao_channel_container_startup_failed:"\u5BB9\u5668\u542F\u52A8\u5931\u8D25",dao_channel_insufficient_server_resources:"\u670D\u52A1\u5668\u8D44\u6E90\u4E0D\u8DB3",dao_channel_server_is_busy:"\u670D\u52A1\u5668\u7E41\u5FD9",dao_channel_activation_timeout:"docker\u6FC0\u6D3B\u8D85\u65F6",dao_channel_docker_failed_to_activate:"docker\u542F\u52A8\u5931\u8D25",dao_channel_socket_is_not_ready:"socket\u672A\u51C6\u5907\u597D",dao_channel_socket_is_not_ready_for_x:"socket \u8FD8\u6CA1\u6709\u4E3A{{x}}\u51C6\u5907\u597D",dao_channel_socket_connect_broken:"socket\u8FDE\u63A5\u4E2D\u65AD",dao_paas_cannot_follow_each_other:"\u4E0D\u80FD\u4E92\u76F8\u8DDF\u968F",\u4E0D\u80FD\u76F4\u63A5\u590D\u5236\u7B54\u9898\u533A\u57DF\u5185\u5BB9:"\u4E0D\u80FD\u76F4\u63A5\u590D\u5236\u7B54\u9898\u533A\u57DF\u5185\u5BB9",\u8BE5\u533A\u57DF\u4E0D\u53EF\u7F16\u8F91:"\u8BE5\u533A\u57DF\u4E0D\u53EF\u7F16\u8F91",dao_paas_not_find_mount_dom_object_for_x:"\u627E\u4E0D\u5230\u4E3A{{x}}\u7684\u6302\u8F7DDOM\u5BF9\u8C61",dao_paas_x_component_is_not_supported:"\u7EC4\u4EF6{{x}}\u4E0D\u652F\u6301",dao_paas_no_ready:"\u672A\u51C6\u5907",\u8BF7\u5728\u6587\u4EF6\u6811\u4E2D\u6253\u5F00\u6587\u4EF6\u8FDB\u884C\u7F16\u8F91:"\u8BF7\u5728\u6587\u4EF6\u6811\u4E2D\u6253\u5F00\u6587\u4EF6\u8FDB\u884C\u7F16\u8F91",dao_paas_file_does_not_exist:"\u6587\u4EF6\u4E0D\u5B58\u5728",dao_pass_set_answer_wrong:"\u8BBE\u7F6E\u9898\u76EE\u7B54\u6848\u9519\u8BEF","Unable to create file or directory with system reserved name":"\u65E0\u6CD5\u4F7F\u7528\u7CFB\u7EDF\u4FDD\u7559\u540D\u79F0\u521B\u5EFA\u6587\u4EF6\u6216\u76EE\u5F55","The file or folder {{path}} already exists in this location, please choose another name":"\u6B64\u4F4D\u7F6E\u5DF2\u5B58\u5728\u6587\u4EF6\u6216\u8005\u6587\u4EF6\u5939 {{path}}\uFF0C\u8BF7\u9009\u62E9\u5176\u5B83\u540D\u79F0","No results":"\u6CA1\u6709\u7ED3\u679C","Collapse the file tree":"\u6536\u8D77\u6587\u4EF6\u6811","Create or rename to hidden files, will not be visible":"\u521B\u5EFA\u6216\u8005\u91CD\u547D\u540D\u4E3A\u9690\u85CF\u6587\u4EF6\uFF0C\u5C06\u4E0D\u53EF\u89C1"},jS=(t=>(t.ZH="ZH",t.EN="EN",t))(jS||{});const Bwe={EN:{translation:Uwe},ZH:{translation:qwe}},Ywe="ZH";Qo.use(Lwe).init({resources:Bwe,lng:Ywe,keySeparator:!1,interpolation:{escapeValue:!1}});const or=Qo.t,Fwe=[1,2,3,5,8,16];class jwe{constructor(e,n,r,i,o,s,a,l){St(this,"start");St(this,"end");St(this,"totalTime");St(this,"rate");St(this,"preFrameTime",0);St(this,"resumeTime",0);St(this,"dataBuffer",[]);St(this,"playing",!1);St(this,"isReplay",!1);St(this,"index",0);St(this,"firstFrameTime",0);St(this,"isMovePosition",!1);St(this,"preTerminalIndex",{});St(this,"preDebugIndex",{});St(this,"preFireTreeIndex",{});St(this,"preTerminalDockerId","");St(this,"preConsoleDockerId","");St(this,"isStopMovePosition",!1);St(this,"triggerEventForMaxTimespanRecord","");St(this,"triggerEventForMaxTimespan",-1);St(this,"eventCustomize");St(this,"eventDispatcher");St(this,"getPlaybackSnapshot");St(this,"progressDispatcher");St(this,"currentDockerId");this.start=e,this.end=n,this.rate=1,this.totalTime=n-e,this.triggerEventForMaxTimespan=i,this.eventDispatcher=o,this.progressDispatcher=s,this.getPlaybackSnapshot=a,this.eventCustomize=l,this.step=this.step.bind(this),this.currentDockerId=""}logger(...e){Mt.info(`${new Date(Date.now()).toLocaleString()} [Playback]${e.join(",")}`)}convertToAbsoluteTime(e){return this.start+e}setRate(e){e&&!Fwe.includes(e)&&this.progressDispatcher&&this.progressDispatcher("error",`${or("helpers_invalid_parameter_rate_x",{x:e})}`),this.rate=e||this.rate}buffer(e){this.dataBuffer=this.dataBuffer.concat(e),this.firstFrameTime=this.dataBuffer[0].timestamp}pause(){if(this.logger("Click Pause!"),!this.playing){Mt.warn("Do not pause more than one time");return}this.playing=!1}resume(){this.resumeTime=this.resumeTime||0,this.resumeTime>0?this.isReplay=!0:this.preFrameTime=Date.now(),this.playing=!0,this.isStopMovePosition=!1,window.requestAnimationFrame(this.step)}restart(){this.preFrameTime=Date.now(),this.playing=!0,this.preFireTreeIndex={},this.preTerminalIndex={},this.preDebugIndex={},this.preTerminalDockerId="",this.preConsoleDockerId="",Ce.file.reset(),this.index=0,window.requestAnimationFrame(this.step)}movePosition(e){var n;if(!((n=this.dataBuffer)!=null&&n.length)){this.resumeTime=e;return}this.isStopMovePosition=!this.playing,this.resumeTime=e,this.isReplay=!0,this.index=this.findFrameByTimeStamp(),this.isMovePosition=!0,this.preTerminalIndex={},this.preDebugIndex={},Ce.dao.resetTerminal(),Ce.dao.resetConsole(),oe.dao.channel().xtermStatus({resetConsole:!0}),window.requestAnimationFrame(this.step)}findFrameByTimeStamp(){const e=this.resumeTime+this.firstFrameTime,n=this.dataBuffer,r=n.length,i=(a,l)=>{var c,u,f,h;if(a<=l){const d=Math.floor((l-a)/2+a),O=n[d].timestamp;return O===e?d:e===((c=n[d-1])==null?void 0:c.timestamp)?d-1:e===((u=n[d+1])==null?void 0:u.timestamp)||e>((f=n[d-1])==null?void 0:f.timestamp)&&e<((h=n[d+1])==null?void 0:h.timestamp)?d+1:(e<O?l=d-1:e>O&&(a=d+1),i(a,l))}else return Mt.warn("Do not find the next frame"),this.index=0,this.resumeTime=0,this.resume(),this.index},o=0,s=r-1;return i(o,s)}gotoNextFrame(){var e;!this.isStopMovePosition&&((e=this.progressDispatcher)==null||e.call(this,"progress",this.resumeTime)),this.isStopMovePosition?(this.playing=!1,this.isStopMovePosition=!1):(this.preFrameTime=Date.now(),window.requestAnimationFrame(this.step))}triggerCustomizeEvent(e){var n;(n=this.eventCustomize)==null||n.call(this,e)}step(){var n,r,i;if(!this.playing&&!this.isStopMovePosition)return;if(this.isReplay&&(this.isReplay=!1,this.preFrameTime=Date.now()),this.resumeTime=this.resumeTime+(Date.now()-this.preFrameTime)*this.rate,this.index>this.dataBuffer.length-1){this.playing=!1,this.resumeTime=0,!this.isStopMovePosition&&((n=this.progressDispatcher)==null||n.call(this,"progress",this.totalTime)),(r=this.progressDispatcher)==null||r.call(this,"complete",this.resumeTime);return}let e=this.dataBuffer[this.index];if(!e){this.gotoNextFrame();return}if(e.eventName==="customize"&&(this.firstFrameTime+this.resumeTime>(e==null?void 0:e.timestamp)&&(this.logger(this.index,e.index,e.eventName,e._id),this.index++,this.triggerCustomizeEvent(e)),!this.isStopMovePosition)){this.gotoNextFrame();return}if(this.firstFrameTime+this.resumeTime>(e==null?void 0:e.timestamp)){if(this.isTerminalOrConsole(e.eventName)){this.trigger(e.eventName,e),this.gotoNextFrame();return}let s=0;const a=this.firstFrameTime+this.resumeTime;for(let l=this.index+1;l<this.dataBuffer.length&&this.dataBuffer[l].timestamp<=a;l++)s++,this.index=l;s>0&&(e=this.dataBuffer[this.index],this.isMovePosition=!0),this.isMovePosition?(this.triggerPreFrames(),this.isMovePosition=!1):(e=((i=this.getPlaybackSnapshot)==null?void 0:i.call(this,e.eventName,e,this.getPreFrameByFrame(e,this.index)||e))||e,this.setPreFrameData(e,this.index)),this.trigger(e.eventName,e)}else this.isMovePosition&&(this.triggerPreFrames(),this.isMovePosition=!1);this.gotoNextFrame()}getPreFrameByFrame(e,n){const{eventName:r,dockerId:i}=e,o=this.isEditor(r),s=this.isFileTree(r);let a;if(o){const{data:{openedPath:l}}=e;for(let c=n-1;c>=0;c--){const u=this.dataBuffer[c];if(u.dockerId===i&&u.eventName===r&&u.data.openedPath===l){a=this.dataBuffer[c],!a.snapshot&&c>=0&&this.setSnapshotByIndex(c);break}}}return s&&(a=this.dataBuffer[this.preFireTreeIndex[i]]),a}setPreFrameData(e,n){const{eventName:r,dockerId:i}=e;this.isFileTree(r)&&(this.preFireTreeIndex[i]=n)}isEditor(e){return e===Ct.Editor}isFileTree(e){return e===Ct.FileTree}isTerminal(e){return e===Ct.Terminal}isConsole(e){return e===Ct.Console}isDebug(e){return e===Ct.Debug}isTerminalOrConsole(e){return[Ct.Terminal.toString(),Ct.Console.toString()].includes(e)}setSnapshotByIndex(e){var o;const n=this.dataBuffer[e],{eventName:r}=n,i=this.isEditor(r);for(let s=0;s<=e;s++){let a=this.dataBuffer[s];if(a.eventName===n.eventName&&a.dockerId===n.dockerId&&(i?a.data.openedPath===n.data.openedPath:!0)){if(a.snapshot){this.setPreFrameData(a,s);continue}a=((o=this.getPlaybackSnapshot)==null?void 0:o.call(this,a.eventName,a,this.getPreFrameByFrame(a,s)))||a,this.setPreFrameData(a,s)}}}triggerPreFrames(){const e=[Ct.FileTree.toString(),Ct.Editor.toString(),Ct.Terminal.toString(),Ct.Console.toString(),Ct.Debug.toString()],n=this.index,r=this.dataBuffer[n].dockerId;this.currentDockerId=r;for(let i=n;i>=0;i--){if(!e.length)return;if(e.includes(this.dataBuffer[i].eventName)&&this.dataBuffer[i].dockerId===this.currentDockerId){const o=this.dataBuffer[i],s=e.findIndex(a=>a===o.eventName);e.splice(s,1),o.snapshot||this.setSnapshotByIndex(i),this.trigger(o.eventName,o,!1)}}e.forEach(i=>{this.logger("trigger reset eventName:",i),this.trigger(i,null,!1)})}trigger(e,n,r=!0){if(e==="customize"){this.logger(this.index,e,n==null?void 0:n._id),this.triggerCustomizeEvent(n),r&&this.index++;return}const i=this.isTerminalOrConsole(e),o=this.isDebug(e);if(!i&&!o){this.logger(this.index,e,n==null?void 0:n._id),this.eventDispatcher(e,n),r&&this.index++;return}const s=n==null?void 0:n.dockerId;this.logger("[TR]",s);const a=this.preTerminalIndex[s]||0,l=this.preDebugIndex[s]||0,c=o?l:a;for(let u=c+1;u<=this.index;u++){const f=this.dataBuffer[u];f&&(this.isTerminalOrConsole(f.eventName)||o)&&f.dockerId===s&&(this.logger("[TR]",u,this.index,f.eventName,this.dataBuffer[u].dockerId,this.dataBuffer[u]._id),this.isTerminal(e)&&(this.preTerminalDockerId&&this.preTerminalDockerId!==s&&Ce.dao.resetTerminal(),this.preTerminalDockerId=s),this.isConsole(e)&&(this.preConsoleDockerId&&this.preConsoleDockerId!==s&&(Ce.dao.resetConsole(),oe.dao.channel().xtermStatus({resetConsole:!0})),this.preConsoleDockerId=s),this.eventDispatcher(f.eventName,f))}o?this.preDebugIndex[s]=this.index:this.preTerminalIndex[s]=this.index,r&&this.index++}}const Zwe="@dao42/d42paas-front",Vwe="0.9.97",Gwe="d42paas front",Hwe="dao42 paas team",Kwe="https://github.com/dao42/d42paas_frontend#readme",Jwe="UNLICENSED",e_e="./dist/DaoPaaS.cjs",t_e="./dist/DaoPaaS.cjs",n_e="./dist/DaoPaaS.d.ts",r_e={prebuild:"rimraf dist",build:"cross-env VITE_BUILD_EVENT=true pnpm tsc && pnpm vite && pnpm typedoc",copydist:"cp -r dist/sdk ../demo/public/",vite:"vite build --config ./config/vite.config.ts && shx cp ./src/types/DaoPaaS.d.ts ./dist",typedoc:"npx typedoc --tsconfig ./doc.tsconfig.json",workNameSpaceToFix:"node ./config/workNameSpaceToFix.js",tsc:"tsc -p ./tsconfig.json --isolatedModules false",test:"jest --coverage",prepublish:"pnpm build",publish:"npm publish --access public"},i_e={"@codemirror/autocomplete":"^6.0.2","@codemirror/collab":"^6.0.0","@codemirror/commands":"^6.0.0","@codemirror/lang-cpp":"^6.0.0","@codemirror/lang-css":"^6.0.0","@codemirror/lang-html":"^6.0.0","@codemirror/lang-java":"^6.0.0","@codemirror/lang-javascript":"^6.0.0","@codemirror/lang-json":"^6.0.0","@codemirror/lang-lezer":"^6.0.0","@codemirror/lang-markdown":"^6.0.0","@codemirror/lang-php":"^6.0.0","@codemirror/lang-python":"^6.0.0","@codemirror/lang-rust":"^6.0.0","@codemirror/lang-sql":"^6.0.0","@codemirror/lang-xml":"^6.0.0","@codemirror/language":"6.2.1","@codemirror/legacy-modes":"^6.0.0","@codemirror/lint":"^6.0.0","@codemirror/search":"^6.0.0","@codemirror/state":"^6.0.0","@codemirror/theme-one-dark":"^6.0.0","@codemirror/view":"^6.0.0","@emotion/babel-plugin":"^11.3.0","@emotion/babel-preset-css-prop":"^11.2.0","@emotion/core":"^11.0.0","@emotion/css":"^11.1.3","@emotion/eslint-plugin":"^11.2.0","@emotion/react":"^11.4.1","@emotion/styled":"^11.3.0","@headlessui/react":"^1.4.3","@loadable/component":"^5.15.2","@open-rpc/client-js":"^1.7.1","@testing-library/jest-dom":"^5.16.4","@testing-library/react":"^13.3.0","@types/fs-extra":"^9.0.13","@types/jest":"^27.0.2","@types/loadable__component":"^5.13.4","@types/lodash":"^4.14.175","@types/lodash.clonedeep":"^4.5.7","@types/lodash.isequal":"^4.5.6","@types/node":"^16.11.1","@types/ot":"^0.0.5","@types/prop-types":"^15.7.5","@types/react":"^18.0.14","@types/react-dom":"^18.0.5","@types/react-transition-group":"^4.4.5","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.28.2","@typescript-eslint/parser":"^4.28.2","@udecode/zustood":"^1.1.1","@vitejs/plugin-react":"^1.0.7",ahooks:"^3.3.10","babel-loader":"^8.2.2",bufferutil:"^4.0.6",classnames:"^2.3.1",codemirror:"^6.0.0",concurrently:"^6.3.0","cross-env":"^7.0.3",devicon:"^2.14.0",dexie:"^3.2.0","file-icons-js":"^1.1.0","file-loader":"^6.2.0","fs-extra":"^10.0.0","glob-all":"^3.2.1","highlight.js":"^11.6.0","hotkeys-js":"^3.9.4",immer:"^9.0.14",jest:"27.0.6",lodash:"^4.17.21",msw:"^0.39.2","ninja-keys":"^1.1.12",ot:"^0.0.15","prop-types":"^15.8.1",react:"^18.2.0","react-complex-tree":"^1.1.6","react-content-loader":"^6.2.0","react-dom":"18.2.0","react-icons":"^4.3.1","react-transition-group":"^4.4.2","rehype-document":"^6.1.0","rehype-highlight":"^5.0.2","rehype-katex":"^6.0.2","rehype-stringify":"^9.0.3","remark-gfm":"^3.0.1","remark-math":"^5.1.1","remark-parse":"^10.0.1","remark-rehype":"^10.1.0",rimraf:"^3.0.2","rollup-plugin-visualizer":"^5.6.0",sass:"^1.43.2","sass-loader":"^12.2.0",shx:"^0.3.3","socket.io-client":"^4.5.1","source-map-loader":"^3.0.0","style-loader":"^3.3.1",stylis:"^4.0.10","ts-jest":"^27.1.3","ts-loader":"^9.2.5","ts-node":"^10.0.0",typedoc:"^0.22.12",unified:"^10.1.2","use-immer":"^0.7.0","utf-8-validate":"^5.0.9",uuid:"^8.3.2",vite:"^2.7.2","vite-plugin-html":"^3.0.6","whatwg-fetch":"^3.6.2",xterm:"^4.13.0","xterm-addon-attach":"^0.6.0","xterm-addon-fit":"^0.5.0",zustand:"^4.0.0-rc.1"},o_e=["dist"],s_e={type:"git",url:"git+https://github.com/dao42/d42paas_frontend.git"},a_e={url:"https://github.com/dao42/d42paas_frontend/issues"},l_e={workerDirectory:"src"},c_e={"@sentry/browser":"^7.16.0","@sentry/tracing":"^7.16.0","@types/lodash.throttle":"^4.1.7","codemirror-lang-elixir":"^3.0.0",i18next:"^21.8.16","lodash.clonedeep":"^4.5.0","lodash.isequal":"^4.5.0","lodash.throttle":"^4.1.1",minimatch:"^5.1.0","range-analyzer":"0.1.1-alpha.2","rc-dropdown":"^4.0.1","rc-menu":"^9.6.3","react-i18next":"11.18.3","socket.io-msgpack-parser":"^3.0.1","xterm-addon-web-links":"^0.6.0"};var u_e={name:Zwe,version:Vwe,description:Gwe,author:Hwe,homepage:Kwe,license:Jwe,main:e_e,module:t_e,types:n_e,scripts:r_e,devDependencies:i_e,files:o_e,repository:s_e,bugs:a_e,msw:l_e,dependencies:c_e};const f_e=()=>u_e.version,d_e=async(t,e,n)=>{const r=window.localStorage.getItem("__paas__testServerCode__"),i=r?{serverCode:r}:{},s=await(await fetch(t+"/api/v1/jssdk/ticket",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ticket:e,packageVersion:n,...i})})).json();if(s.status==="failure")throw Mt.error(s),new Error(s.errors[0].erromsg);return s.data},Yi=(t,e=1)=>{t=t||"#ffffff";let n=t.replace("#","");n.length===3&&(n=`${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`);const r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),o=parseInt(n.substring(4,6),16);return e>1&&e<=100&&(e=e/100),`rgba(${r},${i},${o},${e})`},h_e=()=>{const t=`
|
|
50
50
|
@keyframes fadeOut {
|
|
51
51
|
0% {opacity: 1;}
|
|
52
52
|
100% {opacity: 0;}
|
|
@@ -224,7 +224,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
224
224
|
${Object.keys(r).map(a=>a+":"+r[a]+";").join("")}
|
|
225
225
|
}
|
|
226
226
|
${Q_e}
|
|
227
|
-
`.replace(/\r+/g,"").replace(/\n+/g,"").replace(/\s{2}/g,"");o.textContent=s,i||document.body.appendChild(o)}else{Mt.log("document.documentElement.style \u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u52A0\u8F7D\u4E3B\u9898");return}})},qK={playgroundId:"",status:"EMPTY",dockerId:null,agentUsers:new Array,fileTreeIgnore:"",fileTreePackage:"",fileRootPath:"",framework:"",frameworkVersion:"",lspLanguageId:"",languageVersion:"",url:"",lspRootPath:"",lspUrl:"",lspStatus:"",runStatus:"",lspSupported:!1,consoleHistory:"",terminalHistory:"",playgroundIDEServerStatus:"NOT_SYNC",playgroundIDEServerStatusReason:"",gui:!1,terminalStatus:"loading",debugSupport:!1,openPort:!1};var PV,QV;const BD={playgroundMode:$u.edit,channel:new k_e,channelAvailable:!1,appStatus:"drafted",resetTerminal:!1,resetConsole:!1,defaultOpenFiles:["README.md"],specialOpenFile:"",currentAgentUserId:"",playgroundInfo:qK,xtermStyle:void 0,latestDocContent:"",isLegacyMarkdownMath:!1,globalConfig:(PV=global==null?void 0:global.localStorage)!=null&&PV.getItem("paasGlobalConfig")?global==null?void 0:global.JSON.parse(((QV=global==null?void 0:global.localStorage)==null?void 0:QV.getItem("paasGlobalConfig"))||""):{editorMode:"default",editorTabSize:2,editorWordWrap:!0,fontSize:"14px",editorIndentMode:"space"},reconnectMaxTimes:10,isOpenDebugMode:!1,currentFocusComponent:"",config:{disableEditable:!1,disableFileTreeAction:!1},waitingAreaInfo:{},openSocketBuffer:!1},L_e=Hw("dao")(BD).extendSelectors((t,e,n)=>({channel:()=>e.channel(),currentAgentUser:()=>{const r=e.currentAgentUserId();return r?e.playgroundInfo().agentUsers.find(i=>i.agentUserId===r):null},getAgentUserById:r=>e.playgroundInfo().agentUsers.find(i=>i.agentUserId===r),getXtermStyle:r=>{const i=e.xtermStyle()||{};return r===Fl.console?i.console||{}:i.terminal||{}}})).extendSelectors((t,e,n)=>({getFollowingAgentUser:()=>{var i;const r=(i=e.currentAgentUser())==null?void 0:i.followingAgentUserId;return r?e.getAgentUserById(r):null}})).extendSelectors((t,e,n)=>({isReady:()=>e.appStatus()==="ready",isReadyOffline:()=>e.appStatus()==="ready_offline",isError:()=>e.appStatus()==="error",isPlayBack:()=>e.playgroundMode()===$u.playback})).extendActions((t,e,n)=>({resetTerminal:(r=!0)=>{t.resetTerminal(r)},resetConsole:(r=!0)=>{t.resetConsole(r)},reset:()=>{t.state(r=>BD)},setPlaygroundMode:r=>{t.playgroundMode(r)},setChannel:r=>{t.channel(r)},setPlaygroundInfo:r=>{t.playgroundInfo(r),Ce.file.setFileTree(r.fileTree)}})).extendActions((t,e,n)=>({updateAgentUser:(r,i)=>{const{agentUsers:o}=e.playgroundInfo(),s=o.findIndex(a=>a.agentUserId===r);if(s===-1)throw new Error(or("store_user_not_found"));o[s]={...o[s],...i},t.setPlaygroundInfo({...e.playgroundInfo(),agentUsers:o})},addAgentUser:r=>{const i=e.playgroundInfo().agentUsers;if(e.getAgentUserById(r.agentUserId))throw new Error("agentUserId is exist");const o=[...i,r];t.setPlaygroundInfo({...e.playgroundInfo(),agentUsers:o})},updateAgentUsers:r=>{t.playgroundInfo({...e.playgroundInfo(),agentUsers:r})}})).extendActions((t,e,n)=>({transitionLoading:()=>{const r=e.appStatus();if(r!="drafted")throw new Error(or("store_appStatus_transition_error_x",{x:r}));t.appStatus("loading")},transitionReady:()=>{const r=e.appStatus();if(r!="loading")throw new Error(or("store_appStatus_transition_error_x",{x:r}));t.appStatus("ready")},transitionOffline:()=>{const r=e.appStatus();if(r!="ready")throw new Error(or("store_appStatus_transition_error_x",{x:r}));t.appStatus("ready_offline")},transitionOnline:()=>{const r=e.appStatus();if(r!="ready_offline")throw new Error(or("store_appStatus_transition_error_x",{x:r}));t.appStatus("ready")},transitionError:()=>{t.appStatus("error")},setBrowserUrl:r=>{t.playgroundInfo({...e.playgroundInfo(),url:r})}})).extendActions((t,e,n)=>({setLatestDocContent:r=>{t.latestDocContent(r)},setXtermStyle:r=>{t.xtermStyle(r)},setIsLegacyMarkdownMath:r=>{t.isLegacyMarkdownMath(r)}}));function N_e(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ff=N_e;function YD(t,e){var n,r;for(let i=0;i<t.length;i++){const o=e.index==="."?"":`${e.index}/`;t[i].type==="DIRECTORY"?(n=e==null?void 0:e.children)==null||n.push(`${o}${t[i].name}`):(r=e==null?void 0:e.children)==null||r.push(`${o}${t[i].name}`)}}const BK=(t,e)=>(t.children=t.children.filter(n=>{const r=e.split(";"),i=n.path.split("/"),o=i[i.length-1];return!r.some(s=>s.startsWith("*")?(s=s.substring(s.indexOf("*")+1),o.endsWith(s)):s.endsWith("*")?(s=s.substring(0,s.lastIndexOf("*")),o.startsWith(s)):s.endsWith("/")?s===o+"/":s===o)}),t.children&&t.children.length>0&&t.children.forEach(n=>{BK(n,e)}),t);function HS(t){const e=oe.dao.playgroundInfo().fileTreeIgnore;if(!t)return{};t=BK(So(t),e||"");const n={},r=t.name;n[r]={index:r,children:[],hasChildren:!0,data:r,canMove:!0},YD(t.children,n[r]);let i=[...t.children],o=[...n[r].children];for(;i.length;){const s=i.length;for(let a=0;a<s;a++){const l=i.shift(),c=o.shift();i=i.concat(l.children);const u={lock:l.lock,hide:l.hide,unittest:l.unittest,isRetainedFile:l.isRetainedFile};switch(l.type){case"DIRECTORY":{const f=c;n[f]={index:f,hasChildren:!0,children:[],data:l.name,type:"DIRECTORY",canMove:!0,canNotExpaned:l.canNotExpaned,...u},l.children.length>0&&YD(l.children,n[f]),o=o.concat(n[f].children)}break;case"FILE":{const f=c;n[f]={index:f,hasChildren:!1,data:l.name,type:"FILE",canMove:!0,canNotExpaned:l.canNotExpaned,...u}}break}}}return Object.values(n).map(s=>{YK(s,n)}),n}function FD(t){return t.sort((e,n)=>e.localeCompare(n,"EN",{sensitivity:"case"}))}function M_e(t,e){if(t.length<=1)return t;const n=[],r=[];for(let i=0;i<t.length;i+=1){const o=t[i];e[o].hasChildren?n.push(o):r.push(o)}return FD(n),FD(r),n.concat(r)}const YK=(t,e)=>{t.children&&t.children.length&&(t.children=M_e(t.children,e),t.children.forEach(n=>{YK(e[n]||{},e)}))},D_e=t=>new Promise(e=>{t==null||t.file(n=>{t.fullPath&&(n.fullPath=t.fullPath.indexOf("/")===0?t.fullPath.substring(1):t.fullPath),e(n)})}),FK=async(t,e=[])=>{for(let n of t)if(n&&n.isFile){const r=await D_e(n);e.push(r)}else{n=n;const r=n.createReader();await X_e(r,e)}return e},X_e=(t,e)=>new Promise(n=>{t.readEntries(r=>{const i=FK(r,e);n(i)})}),W_e=t=>{var e,n,r;return{type:t.type,path:t.name,name:((e=t.name)==null?void 0:e.lastIndexOf("/"))>-1?(r=t.name)==null?void 0:r.substring(((n=t.name)==null?void 0:n.lastIndexOf("/"))+1):t.name,children:[]}},jK=(t,e)=>{Object.assign(t,e),t.children.length&&t.children.forEach(n=>{jK(n,e)})},jD=(t,e,n)=>{var o;let r=t.children,i="";for(const s of e){const a=r.find(l=>l.name===s);if(i+=`${i?"/":""}${s}`,!a&&n==="DELETE")return;!a&&n!=="MOVE"&&r.push({type:"DIRECTORY",name:s,path:i,children:[]}),r=((o=r.find(l=>l.name===s))==null?void 0:o.children)||[]}return r},ZK=(t,e)=>(t.children.forEach(n=>{var r;if(n.path=`${e}/${n.name}`,(r=n==null?void 0:n.children)!=null&&r.length)return ZK(n,n.path)}),t),WO=t=>t.lastIndexOf("/")>-1?t.substring(t.lastIndexOf("/")+1):t,U_e=t=>{const e=t.lastIndexOf("/");return e===-1?"":t.substring(0,e)},ef=(t,e,n)=>{var c;const{data:r}=t;if(!r.files&&(t==null?void 0:t.snapshot)){Ce.file.setTreeData(HS(t.snapshot));return}if(!e||((c=r.files)==null?void 0:c.length)<1)return;const i=r.action,o=n||r.files[0],a=(o.name||"").split("/").slice(0,-1),l=jD(e,a,i)||[];switch(i){case"CREATE":case"UPLOAD":{const u=W_e(o);l.find(f=>f.path===u.path)||l.push(u);break}case"MOVE":{const u=r.destination||"",f=u.split("/").slice(0,-1),h=jD(e,f,i)||[],d=l.findIndex(b=>b.path===o.name),O=l[d];if(d===-1)return;l.splice(d,1),O.path=u,O.name=WO(u),o.type==="DIRECTORY"&&ZK(O,u),h.push(O);break}case"DELETE":{const u=l.findIndex(f=>f.path===o.name);u>-1&&l.splice(u,1);break}case"FEATURE":{const u=l.find(d=>d.path===o.name),h=["lock","hide","unittest","isRetainedFile"].reduce((d,O)=>(o[O]!==void 0&&(d[O]=o[O]),d),{});u&&jK(u,h);break}}t.snapshot=So(e),Ce.file.setFileTree(e)},q_e=(t,e)=>{const n=t.substring(0,t.lastIndexOf("/")),r=e.substring(0,e.lastIndexOf("/"));return n===r},B_e=(...t)=>t.filter(e=>!!e).join("/"),Y_e=t=>t==="."||t&&t.indexOf("/")===-1,Fk=t=>oe.dao.playgroundInfo().fileTreeIgnore.split(";").map(n=>(n=n.replace(/\./,function(){return"\\."}),n=n.replace(/\*/,function(){return".*"}),n.endsWith("/")&&(n=n.substring(0,n.length-1)),new RegExp(n))).some(n=>n.test(t)),LC=t=>{const e=window.localStorage.getItem("showHiddenFiles");let n=e?JSON.parse(e):{};return n=Ff(n)?n:{},n[t]===void 0?!1:n[t]},F_e=Object.prototype.toString;function q0(t){return F_e.call(t).slice(8,-1).toLowerCase()}function VK(t){return isNaN(t)}function j_e(t){return q0(t)==="number"&&!VK(t)}function Z_e(t){return q0(t)==="string"}function V_e(t){return q0(t)==="object"}function ZD(t){return Array.isArray(t)}function G_e(t){return q0(t)==="null"}function H_e(t){return q0(t)==="boolean"}function K_e(t){return q0(t)==="symbol"}function nu(t){if(VK(t)||G_e(t)||j_e(t)||Z_e(t)||H_e(t)||K_e(t))return t;if(ZD(t)||V_e(t)){const e=ZD(t)?[]:{};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const r=t[n];e[n]=nu(r)}return e}return t}const J_e={symbol:"",path:"",lineNumber:0,searchLoading:!1},_O={fileTree:null,tempFileOrFolder:{root:"",path:"",type:""},historyBaseData:new Map,doc:{openedPath:"",content:"",revision:void 0,ext:"",isExternalPath:!1,latestRevsion:void 0,selection:void 0,agentUserId:""},autoFocus:!1,docLoading:!1,docEditable:!0,selectedFilePath:"",change:!0,deletedPath:"",fileTreeLoading:!0,resetFileTreeAndEditor:!1,latestRequestTimestamp:0,fileRootId:"",lspTransport:null,lspClient:null,expandedFolders:[],showHiddenCode:!1,freezeCode:!0,pendingUpdateCount:0,editorView:void 0,scrollTrigger:"",preview:{scrollRef:void 0,contentRef:void 0,treeData:[]},syncDoc:!1,treeData:{},openSearch:!1,searchFileParams:{},searchList:[],fileStyle:{},breakPoint:{},debugInfo:{},debugStatus:"stop",debugUserId:"",hideEditFeature:void 0,hideFeature:void 0},eTe=Hw("file")(nu(_O)).extendSelectors((t,e,n)=>({getOpenedPath:()=>e.doc().openedPath,getFileBaseHistoryByPath:(r,i)=>{const s=(e.historyBaseData().get(r)||new Map).get(i);return s===void 0&&Mt.log("getFileBaseHistoryByPath is null:",r,i),s||""},getSearchList:()=>{const r=oe.dao.playgroundInfo().dockerId,i=window.localStorage.getItem(`d42SearchFileHistoryList_${r}`),o=i?JSON.parse(i):[],s=Object.keys(Object.fromEntries(Object.entries(nu(e.treeData())).filter(([,h])=>h.type==="FILE"&&!o.includes(h.index)))).filter(h=>h!=="."),a=o.length>250?300-o.length:50,l=s.slice(0,a),c=e.treeData(),u=e.hideFeature(),f=e.hideEditFeature();return o.concat(l).filter(h=>!(c[h].hide&&u==="preview"&&!f||c[h].canNotExpaned)).filter(h=>{const d=h.split("/");return LC(r)?!0:!d.some(O=>O.startsWith("."))})},getBreakPoints:r=>{var o;return(o=e.breakPoint()[r])!=null?o:[]},getDebugScopes:()=>{var i;const r=e.debugInfo();return((i=r==null?void 0:r.scopes_body)==null?void 0:i.scopes)||[]},getDebugVariablesBodyMap:()=>{const r=e.debugInfo();return(r==null?void 0:r.variables_body_map)||{}},getDebugStackFrame:()=>{var i;const r=e.debugInfo();return((i=r==null?void 0:r.stack_trace_body)==null?void 0:i.stackFrames)||[]},getDebugBody:()=>{const r=e.debugInfo();return(r==null?void 0:r.body)||{}}})).extendActions((t,e,n)=>({reset:()=>{t.state(r=>({...nu(_O),historyBaseData:e.historyBaseData()||new Map,lspTransport:e.lspTransport(),lspClient:e.lspClient()}))},resetDoc:()=>{t.doc(nu(_O.doc))},setFileBaseHistoryData:r=>{t.historyBaseData(r)},setFileTree:r=>{t.change(!0),t.fileTree(r),Ce.file.setTreeData(HS(r)),t.fileTreeLoading(!1)},resetFile:()=>{t.doc(nu(_O.doc)),t.selectedFilePath("")},switchFile:r=>{const{openedPath:i,content:o,revision:s,ext:a,selection:l,agentUserId:c}=r;t.doc({openedPath:i,content:o,revision:s,ext:a,isExternalPath:!1,latestRevsion:s,selection:l,agentUserId:c||""})},setDocEditable:r=>{t.docEditable(r)},switchExternalFile:(r,i)=>{t.doc({openedPath:"",content:r,revision:0,latestRevsion:0,ext:"",isExternalPath:!0,selection:void 0,agentUserId:""})},setDocLoading:r=>{t.docLoading(r)},setSelectedFilePath:r=>{const i=e.doc().openedPath;t.selectedFilePath(r),i!==r&&oe.dao.isPlayBack()&&t.doc({..._O.doc,openedPath:r})},setFileTreeChange:r=>{t.change(r)},closeLspServer:()=>{var r,i;Mt.info("closeLspServer:",e.lspClient(),e.lspTransport()),(r=e.lspClient())==null||r.close(),(i=e.lspTransport())==null||i.close(),t.lspClient(null),t.lspTransport(null)},setEditorView:r=>{t.editorView(r)},setPreview:r=>{const i=e.preview();t.preview({...i,...r})},setTreeData:r=>{var a;const i=e.tempFileOrFolder().root,o=e.tempFileOrFolder().path,s=e.tempFileOrFolder().type;if(i&&o&&s){let l={};if(typeof r=="function"?l=nu(r(e.treeData())):l=nu(r),l[i]&&!l[o]){(a=l[i].children)==null||a.push(o);const c={index:o,hasChildren:s==="DIRECTORY",data:""};s==="DIRECTORY"&&Object.assign(c,{children:[]}),l[o]=c}t.treeData(l)}else typeof r=="function"?t.treeData(r(e.treeData())):t.treeData(r)},openSearch:()=>{t.openSearch(!0)},closeSearch:()=>{t.openSearch(!1)},setSearchFileParamsByPath:(r,i)=>{const o={...e.searchFileParams(),[r]:{...nu(J_e),...e.searchFileParams()[r]||{},...i}};t.searchFileParams(o)},clearSearch:()=>{t.openSearch(!1),t.searchFileParams(nu(_O.searchFileParams))},setFileStyle:r=>{t.fileStyle(r)},refresh:()=>{t.docLoading(!0),t.autoFocus(!0),oe.dao.channel().loadFile(e.getOpenedPath())},setBreakPoints:(r,i)=>{if(i){const o=e.breakPoint();o[i]=r[i],t.breakPoint(o)}else t.breakPoint(r)},resetBreakPoints:()=>{t.breakPoint({})},resetDebugInfo:()=>{t.debugInfo({})},setDebugInfo:r=>{t.debugInfo(r)}})),tTe=Hw("i18n")({language:jS.ZH}).extendActions(t=>({reset:()=>{},setLanguage:e=>{t.language(e)}})).extendSelectors((t,e,n)=>({getLanguage:()=>e.language()})),nTe=Hw("theme")({terminalTheme:VS,consoleTheme:GS}).extendSelectors((t,e,n)=>({getTheme:r=>r===Fl.terminal?e.terminalTheme():r===Fl.console?e.consoleTheme():{xterm:{},style:{}}})).extendActions((t,e,n)=>({reset:()=>{},setTheme:(r,i)=>{const o=A_e(r,i);i===Fl.terminal?t.terminalTheme(o||{xterm:{},style:{}}):i===Fl.console&&t.consoleTheme(o||{xterm:{},style:{}})}})),Gy={dao:L_e,file:eTe,theme:nTe,i18n:tTe},Qt=()=>r_("use",Gy),Dc=()=>r_("useTracked",Gy),oe=r_("get",Gy),Ce=r_("set",Gy),rTe=()=>{for(const[t,e]of Object.entries(Gy))e.set.reset()};function Tr(){return Tr=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Tr.apply(this,arguments)}function NC(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,BS(t,e)}var Hy={exports:{}},Jr={};/** @license React v16.13.1
|
|
227
|
+
`.replace(/\r+/g,"").replace(/\n+/g,"").replace(/\s{2}/g,"");o.textContent=s,i||document.body.appendChild(o)}else{Mt.log("document.documentElement.style \u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u52A0\u8F7D\u4E3B\u9898");return}})},qK={playgroundId:"",status:"EMPTY",dockerId:null,agentUsers:new Array,fileTreeIgnore:"",fileTreePackage:"",fileRootPath:"",framework:"",frameworkVersion:"",lspLanguageId:"",languageVersion:"",url:"",lspRootPath:"",lspUrl:"",lspStatus:"",runStatus:"",lspSupported:!1,consoleHistory:"",terminalHistory:"",playgroundIDEServerStatus:"NOT_SYNC",playgroundIDEServerStatusReason:"",gui:!1,terminalStatus:"loading",debugSupport:!1,openPort:!1};var PV,QV;const BD={playgroundMode:$u.edit,channel:new k_e,channelAvailable:!1,appStatus:"drafted",resetTerminal:!1,resetConsole:!1,defaultOpenFiles:["README.md"],specialOpenFile:"",currentAgentUserId:"",playgroundInfo:qK,xtermStyle:void 0,latestDocContent:"",isLegacyMarkdownMath:!1,globalConfig:(PV=global==null?void 0:global.localStorage)!=null&&PV.getItem("paasGlobalConfig")?global==null?void 0:global.JSON.parse(((QV=global==null?void 0:global.localStorage)==null?void 0:QV.getItem("paasGlobalConfig"))||""):{editorMode:"default",editorTabSize:2,editorWordWrap:!0,fontSize:"14px",editorIndentMode:"space"},reconnectMaxTimes:10,isOpenDebugMode:!1,currentFocusComponent:"",config:{disableEditable:!1,disableFileTreeAction:!1},waitingAreaInfo:{},openSocketBuffer:!1},L_e=Hw("dao")(BD).extendSelectors((t,e,n)=>({channel:()=>e.channel(),currentAgentUser:()=>{const r=e.currentAgentUserId();return r?e.playgroundInfo().agentUsers.find(i=>i.agentUserId===r):null},getAgentUserById:r=>e.playgroundInfo().agentUsers.find(i=>i.agentUserId===r),getXtermStyle:r=>{const i=e.xtermStyle()||{};return r===Fl.console?i.console||{}:i.terminal||{}}})).extendSelectors((t,e,n)=>({getFollowingAgentUser:()=>{var i;const r=(i=e.currentAgentUser())==null?void 0:i.followingAgentUserId;return r?e.getAgentUserById(r):null}})).extendSelectors((t,e,n)=>({isReady:()=>e.appStatus()==="ready",isReadyOffline:()=>e.appStatus()==="ready_offline",isError:()=>e.appStatus()==="error",isPlayBack:()=>e.playgroundMode()===$u.playback})).extendActions((t,e,n)=>({resetTerminal:(r=!0)=>{t.resetTerminal(r)},resetConsole:(r=!0)=>{t.resetConsole(r)},reset:()=>{t.state(r=>BD)},setPlaygroundMode:r=>{t.playgroundMode(r)},setChannel:r=>{t.channel(r)},setPlaygroundInfo:r=>{t.playgroundInfo(r),Ce.file.setFileTree(r.fileTree)}})).extendActions((t,e,n)=>({updateAgentUser:(r,i)=>{const{agentUsers:o}=e.playgroundInfo(),s=o.findIndex(a=>a.agentUserId===r);if(s===-1)throw new Error(or("store_user_not_found"));o[s]={...o[s],...i},t.setPlaygroundInfo({...e.playgroundInfo(),agentUsers:o})},addAgentUser:r=>{const i=e.playgroundInfo().agentUsers;if(e.getAgentUserById(r.agentUserId))throw new Error("agentUserId is exist");const o=[...i,r];t.setPlaygroundInfo({...e.playgroundInfo(),agentUsers:o})},updateAgentUsers:r=>{t.playgroundInfo({...e.playgroundInfo(),agentUsers:r})}})).extendActions((t,e,n)=>({transitionLoading:()=>{const r=e.appStatus();if(r!="drafted")throw new Error(or("store_appStatus_transition_error_x",{x:r}));t.appStatus("loading")},transitionReady:()=>{const r=e.appStatus();if(r!="loading")throw new Error(or("store_appStatus_transition_error_x",{x:r}));t.appStatus("ready")},transitionOffline:()=>{const r=e.appStatus();if(r!="ready")throw new Error(or("store_appStatus_transition_error_x",{x:r}));t.appStatus("ready_offline")},transitionOnline:()=>{const r=e.appStatus();if(r!="ready_offline")throw new Error(or("store_appStatus_transition_error_x",{x:r}));t.appStatus("ready")},transitionError:()=>{t.appStatus("error")},setBrowserUrl:r=>{t.playgroundInfo({...e.playgroundInfo(),url:r})}})).extendActions((t,e,n)=>({setLatestDocContent:r=>{t.latestDocContent(r)},setXtermStyle:r=>{t.xtermStyle(r)},setIsLegacyMarkdownMath:r=>{t.isLegacyMarkdownMath(r)}}));function N_e(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ff=N_e;function YD(t,e){var n,r;for(let i=0;i<t.length;i++){const o=e.index==="."?"":`${e.index}/`;t[i].type==="DIRECTORY"?(n=e==null?void 0:e.children)==null||n.push(`${o}${t[i].name}`):(r=e==null?void 0:e.children)==null||r.push(`${o}${t[i].name}`)}}const BK=(t,e)=>(t.children=t.children.filter(n=>{const r=e.split(";"),i=n.path.split("/"),o=i[i.length-1];return!r.some(s=>s.startsWith("*")?(s=s.substring(s.indexOf("*")+1),o.endsWith(s)):s.endsWith("*")?(s=s.substring(0,s.lastIndexOf("*")),o.startsWith(s)):s.endsWith("/")?s===o+"/":s===o)}),t.children&&t.children.length>0&&t.children.forEach(n=>{BK(n,e)}),t);function HS(t){const e=oe.dao.playgroundInfo().fileTreeIgnore;if(!t)return{};t=BK(So(t),e||"");const n={},r=t.name;n[r]={index:r,children:[],hasChildren:!0,data:r,canMove:!0},YD(t.children,n[r]);let i=[...t.children],o=[...n[r].children];for(;i.length;){const s=i.length;for(let a=0;a<s;a++){const l=i.shift(),c=o.shift();i=i.concat(l.children);const u={lock:l.lock,hide:l.hide,unittest:l.unittest,isRetainedFile:l.isRetainedFile};switch(l.type){case"DIRECTORY":{const f=c;n[f]={index:f,hasChildren:!0,children:[],data:l.name,type:"DIRECTORY",canMove:!0,canNotExpaned:l.canNotExpaned,...u},l.children.length>0&&YD(l.children,n[f]),o=o.concat(n[f].children)}break;case"FILE":{const f=c;n[f]={index:f,hasChildren:!1,data:l.name,type:"FILE",canMove:!0,canNotExpaned:l.canNotExpaned,...u}}break}}}return Object.values(n).map(s=>{YK(s,n)}),n}function FD(t){return t.sort((e,n)=>e.localeCompare(n,"EN",{sensitivity:"case"}))}function M_e(t,e){if(t.length<=1)return t;const n=[],r=[];for(let i=0;i<t.length;i+=1){const o=t[i];e[o].hasChildren?n.push(o):r.push(o)}return FD(n),FD(r),n.concat(r)}const YK=(t,e)=>{t.children&&t.children.length&&(t.children=M_e(t.children,e),t.children.forEach(n=>{YK(e[n]||{},e)}))},D_e=t=>new Promise(e=>{t==null||t.file(n=>{t.fullPath&&(n.fullPath=t.fullPath.indexOf("/")===0?t.fullPath.substring(1):t.fullPath),e(n)})}),FK=async(t,e=[])=>{for(let n of t)if(n&&n.isFile){const r=await D_e(n);e.push(r)}else{n=n;const r=n.createReader();await X_e(r,e)}return e},X_e=(t,e)=>new Promise(n=>{t.readEntries(r=>{const i=FK(r,e);n(i)})}),W_e=t=>{var e,n,r;return{type:t.type,path:t.name,name:((e=t.name)==null?void 0:e.lastIndexOf("/"))>-1?(r=t.name)==null?void 0:r.substring(((n=t.name)==null?void 0:n.lastIndexOf("/"))+1):t.name,children:[]}},jK=(t,e)=>{Object.assign(t,e),t.children.length&&t.children.forEach(n=>{jK(n,e)})},jD=(t,e,n)=>{var o;let r=t.children,i="";for(const s of e){const a=r.find(l=>l.name===s);if(i+=`${i?"/":""}${s}`,!a&&n==="DELETE")return;!a&&n!=="MOVE"&&r.push({type:"DIRECTORY",name:s,path:i,children:[]}),r=((o=r.find(l=>l.name===s))==null?void 0:o.children)||[]}return r},ZK=(t,e)=>(t.children.forEach(n=>{var r;if(n.path=`${e}/${n.name}`,(r=n==null?void 0:n.children)!=null&&r.length)return ZK(n,n.path)}),t),WO=t=>t.lastIndexOf("/")>-1?t.substring(t.lastIndexOf("/")+1):t,U_e=t=>{const e=t.lastIndexOf("/");return e===-1?"":t.substring(0,e)},ef=(t,e,n)=>{var c;const{data:r}=t;if(!r.files&&(t==null?void 0:t.snapshot)){Ce.file.setTreeData(HS(t.snapshot));return}if(!e||((c=r.files)==null?void 0:c.length)<1)return;const i=r.action,o=n||r.files[0],a=(o.name||"").split("/").slice(0,-1),l=jD(e,a,i)||[];switch(i){case"CREATE":case"UPLOAD":{const u=W_e(o);l.find(f=>f.path===u.path)||l.push(u);break}case"MOVE":{const u=r.destination||"",f=u.split("/").slice(0,-1),h=jD(e,f,i)||[],d=l.findIndex(b=>b.path===o.name),O=l[d];if(d===-1)return;l.splice(d,1),O.path=u,O.name=WO(u),o.type==="DIRECTORY"&&ZK(O,u),h.push(O);break}case"DELETE":{const u=l.findIndex(f=>f.path===o.name);u>-1&&l.splice(u,1);break}case"FEATURE":{const u=l.find(d=>d.path===o.name),h=["lock","hide","unittest","isRetainedFile"].reduce((d,O)=>(o[O]!==void 0&&(d[O]=o[O]),d),{});u&&jK(u,h);break}}t.snapshot=So(e),Ce.file.setFileTree(e)},q_e=(t,e)=>{const n=t.substring(0,t.lastIndexOf("/")),r=e.substring(0,e.lastIndexOf("/"));return n===r},B_e=(...t)=>t.filter(e=>!!e).join("/"),Y_e=t=>t==="."||t&&t.indexOf("/")===-1,Fk=t=>oe.dao.playgroundInfo().fileTreeIgnore.split(";").map(n=>(n=n.replace(/\./,function(){return"\\."}),n=n.replace(/\*/,function(){return".*"}),n.endsWith("/")&&(n=n.substring(0,n.length-1)),new RegExp(n))).some(n=>n.test(t)),LC=t=>{const e=window.localStorage.getItem("showHiddenFiles");let n=e?JSON.parse(e):{};return n=Ff(n)?n:{},n[t]===void 0?!1:n[t]},F_e=Object.prototype.toString;function q0(t){return F_e.call(t).slice(8,-1).toLowerCase()}function VK(t){return isNaN(t)}function j_e(t){return q0(t)==="number"&&!VK(t)}function Z_e(t){return q0(t)==="string"}function V_e(t){return q0(t)==="object"}function ZD(t){return Array.isArray(t)}function G_e(t){return q0(t)==="null"}function H_e(t){return q0(t)==="boolean"}function K_e(t){return q0(t)==="symbol"}function nu(t){if(VK(t)||G_e(t)||j_e(t)||Z_e(t)||H_e(t)||K_e(t))return t;if(ZD(t)||V_e(t)){const e=ZD(t)?[]:{};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const r=t[n];e[n]=nu(r)}return e}return t}const J_e={symbol:"",path:"",lineNumber:0,searchLoading:!1},_O={fileTree:null,tempFileOrFolder:{root:"",path:"",type:""},historyBaseData:new Map,doc:{openedPath:"",content:"",revision:void 0,ext:"",isExternalPath:!1,latestRevsion:void 0,selection:void 0,agentUserId:""},autoFocus:!1,docLoading:!1,docEditable:!0,selectedFilePath:"",change:!0,deletedPath:"",fileTreeLoading:!0,resetFileTreeAndEditor:!1,latestRequestTimestamp:0,fileRootId:"",lspTransport:null,lspClient:null,expandedFolders:[],showHiddenCode:!1,freezeCode:!0,pendingUpdateCount:0,editorView:void 0,scrollTrigger:"",preview:{scrollRef:void 0,contentRef:void 0,treeData:[]},syncDoc:!1,treeData:{},openSearch:!1,searchFileParams:{},searchList:[],fileStyle:{},breakPoint:{},debugInfo:{},debugStatus:"stop",debugUserId:"",hideEditFeature:void 0,hideFeature:void 0},eTe=Hw("file")(nu(_O)).extendSelectors((t,e,n)=>({getOpenedPath:()=>e.doc().openedPath,getFileBaseHistoryByPath:(r,i)=>{const s=(e.historyBaseData().get(r)||new Map).get(i);return s===void 0&&Mt.log("getFileBaseHistoryByPath is null:",r,i),s||""},getSearchList:()=>{const r=oe.dao.playgroundInfo().dockerId,i=window.localStorage.getItem(`d42SearchFileHistoryList_${r}`),o=i?JSON.parse(i):[],s=Object.keys(Object.fromEntries(Object.entries(nu(e.treeData())).filter(([,h])=>h.type==="FILE"&&!o.includes(h.index)))).filter(h=>h!=="."),a=o.length>250?300-o.length:50,l=s.slice(0,a),c=e.treeData(),u=e.hideFeature(),f=e.hideEditFeature();return o.concat(l).filter(h=>{var d,O;return!(((d=c[h])==null?void 0:d.hide)&&u==="preview"&&!f||((O=c[h])==null?void 0:O.canNotExpaned))}).filter(h=>{const d=h.split("/");return LC(r)?!0:!d.some(O=>O.startsWith("."))})},getBreakPoints:r=>{var o;return(o=e.breakPoint()[r])!=null?o:[]},getDebugScopes:()=>{var i;const r=e.debugInfo();return((i=r==null?void 0:r.scopes_body)==null?void 0:i.scopes)||[]},getDebugVariablesBodyMap:()=>{const r=e.debugInfo();return(r==null?void 0:r.variables_body_map)||{}},getDebugStackFrame:()=>{var i;const r=e.debugInfo();return((i=r==null?void 0:r.stack_trace_body)==null?void 0:i.stackFrames)||[]},getDebugBody:()=>{const r=e.debugInfo();return(r==null?void 0:r.body)||{}}})).extendActions((t,e,n)=>({reset:()=>{t.state(r=>({...nu(_O),historyBaseData:e.historyBaseData()||new Map,lspTransport:e.lspTransport(),lspClient:e.lspClient()}))},resetDoc:()=>{t.doc(nu(_O.doc))},setFileBaseHistoryData:r=>{t.historyBaseData(r)},setFileTree:r=>{t.change(!0),t.fileTree(r),Ce.file.setTreeData(HS(r)),t.fileTreeLoading(!1)},resetFile:()=>{t.doc(nu(_O.doc)),t.selectedFilePath("")},switchFile:r=>{const{openedPath:i,content:o,revision:s,ext:a,selection:l,agentUserId:c}=r;t.doc({openedPath:i,content:o,revision:s,ext:a,isExternalPath:!1,latestRevsion:s,selection:l,agentUserId:c||""})},setDocEditable:r=>{t.docEditable(r)},switchExternalFile:(r,i)=>{t.doc({openedPath:"",content:r,revision:0,latestRevsion:0,ext:"",isExternalPath:!0,selection:void 0,agentUserId:""})},setDocLoading:r=>{t.docLoading(r)},setSelectedFilePath:r=>{const i=e.doc().openedPath;t.selectedFilePath(r),i!==r&&oe.dao.isPlayBack()&&t.doc({..._O.doc,openedPath:r})},setFileTreeChange:r=>{t.change(r)},closeLspServer:()=>{var r,i;Mt.info("closeLspServer:",e.lspClient(),e.lspTransport()),(r=e.lspClient())==null||r.close(),(i=e.lspTransport())==null||i.close(),t.lspClient(null),t.lspTransport(null)},setEditorView:r=>{t.editorView(r)},setPreview:r=>{const i=e.preview();t.preview({...i,...r})},setTreeData:r=>{var a;const i=e.tempFileOrFolder().root,o=e.tempFileOrFolder().path,s=e.tempFileOrFolder().type;if(i&&o&&s){let l={};if(typeof r=="function"?l=nu(r(e.treeData())):l=nu(r),l[i]&&!l[o]){(a=l[i].children)==null||a.push(o);const c={index:o,hasChildren:s==="DIRECTORY",data:""};s==="DIRECTORY"&&Object.assign(c,{children:[]}),l[o]=c}t.treeData(l)}else typeof r=="function"?t.treeData(r(e.treeData())):t.treeData(r)},openSearch:()=>{t.openSearch(!0)},closeSearch:()=>{t.openSearch(!1)},setSearchFileParamsByPath:(r,i)=>{const o={...e.searchFileParams(),[r]:{...nu(J_e),...e.searchFileParams()[r]||{},...i}};t.searchFileParams(o)},clearSearch:()=>{t.openSearch(!1),t.searchFileParams(nu(_O.searchFileParams))},setFileStyle:r=>{t.fileStyle(r)},refresh:()=>{t.docLoading(!0),t.autoFocus(!0),oe.dao.channel().loadFile(e.getOpenedPath())},setBreakPoints:(r,i)=>{if(i){const o=e.breakPoint();o[i]=r[i],t.breakPoint(o)}else t.breakPoint(r)},resetBreakPoints:()=>{t.breakPoint({})},resetDebugInfo:()=>{t.debugInfo({})},setDebugInfo:r=>{t.debugInfo(r)}})),tTe=Hw("i18n")({language:jS.ZH}).extendActions(t=>({reset:()=>{},setLanguage:e=>{t.language(e)}})).extendSelectors((t,e,n)=>({getLanguage:()=>e.language()})),nTe=Hw("theme")({terminalTheme:VS,consoleTheme:GS}).extendSelectors((t,e,n)=>({getTheme:r=>r===Fl.terminal?e.terminalTheme():r===Fl.console?e.consoleTheme():{xterm:{},style:{}}})).extendActions((t,e,n)=>({reset:()=>{},setTheme:(r,i)=>{const o=A_e(r,i);i===Fl.terminal?t.terminalTheme(o||{xterm:{},style:{}}):i===Fl.console&&t.consoleTheme(o||{xterm:{},style:{}})}})),Gy={dao:L_e,file:eTe,theme:nTe,i18n:tTe},Qt=()=>r_("use",Gy),Dc=()=>r_("useTracked",Gy),oe=r_("get",Gy),Ce=r_("set",Gy),rTe=()=>{for(const[t,e]of Object.entries(Gy))e.set.reset()};function Tr(){return Tr=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Tr.apply(this,arguments)}function NC(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,BS(t,e)}var Hy={exports:{}},Jr={};/** @license React v16.13.1
|
|
228
228
|
* react-is.production.min.js
|
|
229
229
|
*
|
|
230
230
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -479,7 +479,7 @@ Event: ${mp(t)}`),!0):C$e(t,e.denyUrls)?((typeof __SENTRY_DEBUG__=="undefined"||
|
|
|
479
479
|
Event: ${mp(t)}.
|
|
480
480
|
Url: ${i4(t)}`),!0):R$e(t,e.allowUrls)?!1:((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
481
481
|
Event: ${mp(t)}.
|
|
482
|
-
Url: ${i4(t)}`),!0)}function E$e(t,e){return!e||!e.length?!1:A$e(t).some(n=>e.some(r=>Bv(n,r)))}function C$e(t,e){if(!e||!e.length)return!1;const n=i4(t);return n?e.some(r=>Bv(n,r)):!1}function R$e(t,e){if(!e||!e.length)return!0;const n=i4(t);return n?e.some(r=>Bv(n,r)):!0}function A$e(t){if(t.message)return[t.message];if(t.exception)try{const{type:e="",value:n=""}=t.exception.values&&t.exception.values[0]||{};return[`${n}`,`${e}: ${n}`]}catch{return(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.error(`Cannot extract message for event ${mp(t)}`),[]}return[]}function I$e(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function z$e(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function i4(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?z$e(e):null}catch{return(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.error(`Cannot extract url for event ${mp(t)}`),null}}function fee(t,e){const n=cR(t,e),r={type:e&&e.name,value:D$e(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function L$e(t,e,n,r){const o=co().getClient(),s=o&&o.getOptions().normalizeDepth,a={exception:{values:[{type:JC(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:`Non-Error ${r?"promise rejection":"exception"} captured with keys: ${d8e(e)}`}]},extra:{__serialized__:nee(e,s)}};if(n){const l=cR(t,n);l.length&&(a.exception.values[0].stacktrace={frames:l})}return a}function sP(t,e){return{exception:{values:[fee(t,e)]}}}function cR(t,e){const n=e.stacktrace||e.stack||"",r=M$e(e);try{return t(n,r)}catch{}return[]}const N$e=/Minified React error #\d+;/i;function M$e(t){if(t){if(typeof t.framesToPop=="number")return t.framesToPop;if(N$e.test(t.message))return 1}return 0}function D$e(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function X$e(t,e,n,r){const i=n&&n.syntheticException||void 0,o=uR(t,e,i,r);return Yv(o),o.level="error",n&&n.event_id&&(o.event_id=n.event_id),Mp(o)}function W$e(t,e,n="info",r,i){const o=r&&r.syntheticException||void 0,s=r8(t,e,o,i);return s.level=n,r&&r.event_id&&(s.event_id=r.event_id),Mp(s)}function uR(t,e,n,r,i){let o;if(YJ(e)&&e.error)return sP(t,e.error);if(LX(e)||KQe(e)){const s=e;if("stack"in e)o=sP(t,e);else{const a=s.name||(LX(s)?"DOMError":"DOMException"),l=s.message?`${a}: ${s.message}`:a;o=r8(t,l,n,r),HQ(o,l)}return"code"in s&&(o.tags={...o.tags,"DOMException.code":`${s.code}`}),o}return BJ(e)?sP(t,e):n0(e)||JC(e)?(o=L$e(t,e,n,i),Yv(o,{synthetic:!0}),o):(o=r8(t,e,n,r),HQ(o,`${e}`,void 0),Yv(o,{synthetic:!0}),o)}function r8(t,e,n,r){const i={message:e};if(r&&n){const o=cR(t,n);o.length&&(i.exception={values:[{value:e,stacktrace:{frames:o}}]})}return i}const dee="Breadcrumbs";class Vv{static __initStatic(){this.id=dee}__init(){this.name=Vv.id}constructor(e){Vv.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){this.options.console&&Ja("console",q$e),this.options.dom&&Ja("dom",U$e(this.options.dom)),this.options.xhr&&Ja("xhr",B$e),this.options.fetch&&Ja("fetch",Y$e),this.options.history&&Ja("history",F$e)}}Vv.__initStatic();function U$e(t){function e(n){let r,i=typeof t=="object"?t.serializeAttribute:void 0;typeof i=="string"&&(i=[i]);try{r=n.event.target?qv(n.event.target,i):qv(n.event,i)}catch{r="<unknown>"}r.length!==0&&co().addBreadcrumb({category:`ui.${n.name}`,message:r},{event:n.event,name:n.name,global:n.global})}return e}function q$e(t){const e={category:"console",data:{arguments:t.args,logger:"console"},level:X8e(t.level),message:MX(t.args," ")};if(t.level==="assert")if(t.args[0]===!1)e.message=`Assertion failed: ${MX(t.args.slice(1)," ")||"console.assert"}`,e.data.arguments=t.args.slice(1);else return;co().addBreadcrumb(e,{input:t.args,level:t.level})}function B$e(t){if(t.endTimestamp){if(t.xhr.__sentry_own_request__)return;const{method:e,url:n,status_code:r,body:i}=t.xhr.__sentry_xhr__||{};co().addBreadcrumb({category:"xhr",data:{method:e,url:n,status_code:r},type:"http"},{xhr:t.xhr,input:i});return}}function Y$e(t){!t.endTimestamp||t.fetchData.url.match(/sentry_key/)&&t.fetchData.method==="POST"||(t.error?co().addBreadcrumb({category:"fetch",data:t.fetchData,level:"error",type:"http"},{data:t.error,input:t.args}):co().addBreadcrumb({category:"fetch",data:{...t.fetchData,status_code:t.response.status},type:"http"},{input:t.args,response:t.response}))}function F$e(t){let e=t.from,n=t.to;const r=iP(bt.location.href);let i=iP(e);const o=iP(n);i.path||(i=r),r.protocol===o.protocol&&r.host===o.host&&(n=o.relative),r.protocol===i.protocol&&r.host===i.host&&(e=i.relative),co().addBreadcrumb({category:"navigation",data:{from:e,to:n}})}class j$e extends d1{constructor(e){e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:HX}],version:HX},super(e),e.sendClientReports&&bt.document&&bt.document.addEventListener("visibilitychange",()=>{bt.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,n){return X$e(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return W$e(this._options.stackParser,e,n,r,this._options.attachStacktrace)}sendEvent(e,n){const r=this.getIntegrationById(dee);r&&r.options&&r.options.sentry&&co().addBreadcrumb({category:`sentry.${e.type==="transaction"?"transaction":"event"}`,event_id:e.event_id,level:e.level,message:mp(e)},{event:e}),super.sendEvent(e,n)}_prepareEvent(e,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r)}_flushOutcomes(){const e=this._clearOutcomes();if(e.length===0){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("No outcomes to send");return}if(!this._dsn){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("No dsn provided, will not send outcomes");return}(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("Sending outcomes:",e);const n=lee(this._dsn,this._options),r=V8e(e,this._options.tunnel&&nR(this._dsn));try{Object.prototype.toString.call(bt&&bt.navigator)==="[object Navigator]"&&typeof bt.navigator.sendBeacon=="function"&&!this._options.transportOptions?bt.navigator.sendBeacon.bind(bt.navigator)(n,ree(r)):this._sendEnvelope(r)}catch(i){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.error(i)}}}let j5;function Z$e(){if(j5)return j5;if(GQ(bt.fetch))return j5=bt.fetch.bind(bt);const t=bt.document;let e=bt.fetch;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(e=r.fetch),t.head.removeChild(n)}catch(n){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return j5=e.bind(bt)}function V$e(t,e=Z$e()){function n(r){const i={body:r.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:r.body.length<=65536,...t.fetchOptions};return e(t.url,i).then(o=>({statusCode:o.status,headers:{"x-sentry-rate-limits":o.headers.get("X-Sentry-Rate-Limits"),"retry-after":o.headers.get("Retry-After")}}))}return uee(t,n)}const G$e=4;function H$e(t){function e(n){return new ea((r,i)=>{const o=new XMLHttpRequest;o.onerror=i,o.onreadystatechange=()=>{o.readyState===G$e&&r({statusCode:o.status,headers:{"x-sentry-rate-limits":o.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":o.getResponseHeader("Retry-After")}})},o.open("POST",t.url);for(const s in t.headers)Object.prototype.hasOwnProperty.call(t.headers,s)&&o.setRequestHeader(s,t.headers[s]);o.send(n.body)})}return uee(t,e)}const k_="?",K$e=30,J$e=40,eEe=50;function fR(t,e,n,r){const i={filename:t,function:e,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}const tEe=/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,nEe=/\((\S*)(?::(\d+))(?::(\d+))\)/,rEe=t=>{const e=tEe.exec(t);if(e){if(e[2]&&e[2].indexOf("eval")===0){const o=nEe.exec(e[2]);o&&(e[2]=o[1],e[3]=o[2],e[4]=o[3])}const[r,i]=hee(e[1]||k_,e[2]);return fR(i,r,e[3]?+e[3]:void 0,e[4]?+e[4]:void 0)}},iEe=[K$e,rEe],oEe=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|safari-extension|safari-web-extension|capacitor)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,sEe=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,aEe=t=>{const e=oEe.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const o=sEe.exec(e[3]);o&&(e[1]=e[1]||"eval",e[3]=o[1],e[4]=o[2],e[5]="")}let r=e[3],i=e[1]||k_;return[i,r]=hee(i,r),fR(r,i,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},lEe=[eEe,aEe],cEe=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,uEe=t=>{const e=cEe.exec(t);return e?fR(e[2],e[1]||k_,+e[3],e[4]?+e[4]:void 0):void 0},fEe=[J$e,uEe],dEe=[iEe,lEe,fEe],hEe=KJ(...dEe),hee=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:k_,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]};let i8=0;function pee(){return i8>0}function pEe(){i8+=1,setTimeout(()=>{i8-=1})}function i0(t,e={},n){if(typeof t!="function")return t;try{const i=t.__sentry_wrapped__;if(i)return i;if(iR(t))return t}catch{return t}const r=function(){const i=Array.prototype.slice.call(arguments);try{n&&typeof n=="function"&&n.apply(this,arguments);const o=i.map(s=>i0(s,e));return t.apply(this,o)}catch(o){throw pEe(),d$e(s=>{s.addEventProcessor(a=>(e.mechanism&&(HQ(a,void 0,void 0),Yv(a,e.mechanism)),a.extra={...a.extra,arguments:i},a)),f$e(o)}),o}};try{for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}catch{}GJ(r,t),rR(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}class oh{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=oh.id}__init2(){this._installFunc={onerror:OEe,onunhandledrejection:mEe}}constructor(e){oh.prototype.__init.call(this),oh.prototype.__init2.call(this),this._options={onerror:!0,onunhandledrejection:!0,...e}}setupOnce(){Error.stackTraceLimit=50;const e=this._options;for(const n in e){const r=this._installFunc[n];r&&e[n]&&(yEe(n),r(),this._installFunc[n]=void 0)}}}oh.__initStatic();function OEe(){Ja("error",t=>{const[e,n,r]=gee();if(!e.getIntegration(oh))return;const{msg:i,url:o,line:s,column:a,error:l}=t;if(pee()||l&&l.__sentry_own_request__)return;const c=l===void 0&&Np(i)?vEe(i,o,s,a):Oee(uR(n,l||i,void 0,r,!1),o,s,a);c.level="error",mee(e,l,c,"onerror")})}function mEe(){Ja("unhandledrejection",t=>{const[e,n,r]=gee();if(!e.getIntegration(oh))return;let i=t;try{"reason"in t?i=t.reason:"detail"in t&&"reason"in t.detail&&(i=t.detail.reason)}catch{}if(pee()||i&&i.__sentry_own_request__)return!0;const o=FJ(i)?gEe(i):uR(n,i,void 0,r,!0);o.level="error",mee(e,i,o,"onunhandledrejection")})}function gEe(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function vEe(t,e,n,r){const i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let o=YJ(t)?t.message:t,s="Error";const a=o.match(i);return a&&(s=a[1],o=a[2]),Oee({exception:{values:[{type:s,value:o}]}},e,n,r)}function Oee(t,e,n,r){const i=t.exception=t.exception||{},o=i.values=i.values||[],s=o[0]=o[0]||{},a=s.stacktrace=s.stacktrace||{},l=a.frames=a.frames||[],c=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,f=Np(e)&&e.length>0?e:r8e();return l.length===0&&l.push({colno:c,filename:f,function:"?",in_app:!0,lineno:u}),t}function yEe(t){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`Global Handler attached: ${t}`)}function mee(t,e,n,r){Yv(n,{handled:!1,type:r}),t.captureEvent(n,{originalException:e})}function gee(){const t=co(),e=t.getClient(),n=e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[t,n.stackParser,n.attachStacktrace]}const bEe=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class Gv{static __initStatic(){this.id="TryCatch"}__init(){this.name=Gv.id}constructor(e){Gv.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){this._options.setTimeout&&Us(bt,"setTimeout",JX),this._options.setInterval&&Us(bt,"setInterval",JX),this._options.requestAnimationFrame&&Us(bt,"requestAnimationFrame",xEe),this._options.XMLHttpRequest&&"XMLHttpRequest"in bt&&Us(XMLHttpRequest.prototype,"send",SEe);const e=this._options.eventTarget;e&&(Array.isArray(e)?e:bEe).forEach(wEe)}}Gv.__initStatic();function JX(t){return function(...e){const n=e[0];return e[0]=i0(n,{mechanism:{data:{function:hh(t)},handled:!0,type:"instrument"}}),t.apply(this,e)}}function xEe(t){return function(e){return t.apply(this,[i0(e,{mechanism:{data:{function:"requestAnimationFrame",handler:hh(t)},handled:!0,type:"instrument"}})])}}function SEe(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in n&&typeof n[i]=="function"&&Us(n,i,function(o){const s={mechanism:{data:{function:i,handler:hh(o)},handled:!0,type:"instrument"}},a=iR(o);return a&&(s.mechanism.data.handler=hh(a)),i0(o,s)})}),t.apply(this,e)}}function wEe(t){const e=bt,n=e[t]&&e[t].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(Us(n,"addEventListener",function(r){return function(i,o,s){try{typeof o.handleEvent=="function"&&(o.handleEvent=i0(o.handleEvent,{mechanism:{data:{function:"handleEvent",handler:hh(o),target:t},handled:!0,type:"instrument"}}))}catch{}return r.apply(this,[i,i0(o,{mechanism:{data:{function:"addEventListener",handler:hh(o),target:t},handled:!0,type:"instrument"}}),s])}}),Us(n,"removeEventListener",function(r){return function(i,o,s){const a=o;try{const l=a&&a.__sentry_wrapped__;l&&r.call(this,i,l,s)}catch{}return r.call(this,i,a,s)}}))}const _Ee="cause",TEe=5;class $1{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=$1.id}constructor(e={}){$1.prototype.__init.call(this),this._key=e.key||_Ee,this._limit=e.limit||TEe}setupOnce(){const e=co().getClient();!e||sR((n,r)=>{const i=co().getIntegration($1);return i?kEe(e.getOptions().stackParser,i._key,i._limit,n,r):n})}}$1.__initStatic();function kEe(t,e,n,r,i){if(!r.exception||!r.exception.values||!i||!Eu(i.originalException,Error))return r;const o=vee(t,n,i.originalException,e);return r.exception.values=[...o,...r.exception.values],r}function vee(t,e,n,r,i=[]){if(!Eu(n[r],Error)||i.length+1>=e)return i;const o=fee(t,n[r]);return vee(t,e,n[r],r,[o,...i])}class E1{constructor(){E1.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=E1.id}setupOnce(){sR(e=>{if(co().getIntegration(E1)){if(!bt.navigator&&!bt.location&&!bt.document)return e;const n=e.request&&e.request.url||bt.location&&bt.location.href,{referrer:r}=bt.document||{},{userAgent:i}=bt.navigator||{},o={...e.request&&e.request.headers,...r&&{Referer:r},...i&&{"User-Agent":i}},s={...n&&{url:n},headers:o};return{...e,request:s}}return e})}}E1.__initStatic();class C1{constructor(){C1.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=C1.id}setupOnce(e,n){const r=i=>{const o=n().getIntegration(C1);if(o){try{if(PEe(i,o._previousEvent))return(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{return o._previousEvent=i}return o._previousEvent=i}return i};r.id=this.name,e(r)}}C1.__initStatic();function PEe(t,e){return e?!!(QEe(t,e)||$Ee(t,e)):!1}function QEe(t,e){const n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!bee(t,e)||!yee(t,e))}function $Ee(t,e){const n=eW(e),r=eW(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!bee(t,e)||!yee(t,e))}function yee(t,e){let n=tW(t),r=tW(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let i=0;i<r.length;i++){const o=r[i],s=n[i];if(o.filename!==s.filename||o.lineno!==s.lineno||o.colno!==s.colno||o.function!==s.function)return!1}return!0}function bee(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function eW(t){return t.exception&&t.exception.values&&t.exception.values[0]}function tW(t){const e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch{return}}const EEe=[new Q1,new Zv,new Gv,new Vv,new oh,new $1,new C1,new E1];function CEe(t={}){t.defaultIntegrations===void 0&&(t.defaultIntegrations=EEe),t.release===void 0&&bt.SENTRY_RELEASE&&bt.SENTRY_RELEASE.id&&(t.release=bt.SENTRY_RELEASE.id),t.autoSessionTracking===void 0&&(t.autoSessionTracking=!0),t.sendClientReports===void 0&&(t.sendClientReports=!0);const e={...t,stackParser:O8e(t.stackParser||hEe),integrations:S$e(t),transport:t.transport||(JJ()?V$e:H$e)};T$e(j$e,e),t.autoSessionTracking&&REe()}function nW(t){t.startSession({ignoreDuration:!0}),t.captureSession()}function REe(){if(typeof bt.document=="undefined"){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}const t=co();!t.captureSession||(nW(t),Ja("history",({from:e,to:n})=>{e===void 0||e===n||nW(co())}))}function dR(t){const e=co().getClient(),n=t||e&&e.getOptions();return!!n&&("tracesSampleRate"in n||"tracesSampler"in n)}function tb(t){const n=(t||co()).getScope();return n&&n.getTransaction()}function gs(t){return t/1e3}function AEe(){Ja("error",rW),Ja("unhandledrejection",rW)}function rW(){const t=tb();if(t){const e="internal_error";(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Tracing] Transaction: ${e} -> Global error occured`),t.setStatus(e)}}class P_{__init(){this.spans=[]}constructor(e=1e3){P_.prototype.__init.call(this),this._maxlen=e}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}}class Sd{__init2(){this.traceId=rh()}__init3(){this.spanId=rh().substring(16)}__init4(){this.startTimestamp=Fv()}__init5(){this.tags={}}__init6(){this.data={}}constructor(e){if(Sd.prototype.__init2.call(this),Sd.prototype.__init3.call(this),Sd.prototype.__init4.call(this),Sd.prototype.__init5.call(this),Sd.prototype.__init6.call(this),!e)return this;e.traceId&&(this.traceId=e.traceId),e.spanId&&(this.spanId=e.spanId),e.parentSpanId&&(this.parentSpanId=e.parentSpanId),"sampled"in e&&(this.sampled=e.sampled),e.op&&(this.op=e.op),e.description&&(this.description=e.description),e.data&&(this.data=e.data),e.tags&&(this.tags=e.tags),e.status&&(this.status=e.status),e.startTimestamp&&(this.startTimestamp=e.startTimestamp),e.endTimestamp&&(this.endTimestamp=e.endTimestamp)}startChild(e){const n=new Sd({...e,parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId});if(n.spanRecorder=this.spanRecorder,n.spanRecorder&&n.spanRecorder.add(n),n.transaction=this.transaction,(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&n.transaction){const r=e&&e.op||"< unknown op >",i=n.transaction.name||"< unknown name >",o=n.transaction.spanId,s=`[Tracing] Starting '${r}' span on transaction '${i}' (${o}).`;n.transaction.metadata.spanMetadata[n.spanId]={logMessage:s},wt.log(s)}return n}setTag(e,n){return this.tags={...this.tags,[e]:n},this}setData(e,n){return this.data={...this.data,[e]:n},this}setStatus(e){return this.status=e,this}setHttpStatus(e){this.setTag("http.status_code",String(e));const n=IEe(e);return n!=="unknown_error"&&this.setStatus(n),this}isSuccess(){return this.status==="ok"}finish(e){if((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&this.transaction&&this.transaction.spanId!==this.spanId){const{logMessage:n}=this.transaction.metadata.spanMetadata[this.spanId];n&&wt.log(n.replace("Starting","Finishing"))}this.endTimestamp=typeof e=="number"?e:Fv()}toTraceparent(){let e="";return this.sampled!==void 0&&(e=this.sampled?"-1":"-0"),`${this.traceId}-${this.spanId}${e}`}toContext(){return nh({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})}updateWithContext(e){return this.data=Rd(e.data,()=>({})),this.description=e.description,this.endTimestamp=e.endTimestamp,this.op=e.op,this.parentSpanId=e.parentSpanId,this.sampled=e.sampled,this.spanId=Rd(e.spanId,()=>this.spanId),this.startTimestamp=Rd(e.startTimestamp,()=>this.startTimestamp),this.status=e.status,this.tags=Rd(e.tags,()=>({})),this.traceId=Rd(e.traceId,()=>this.traceId),this}getTraceContext(){return nh({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})}toJSON(){return nh({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId})}}function IEe(t){if(t<400&&t>=100)return"ok";if(t>=400&&t<500)switch(t){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(t>=500&&t<600)switch(t){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}class Hv extends Sd{__init(){this._measurements={}}__init2(){this._frozenDynamicSamplingContext=void 0}constructor(e,n){super(e),Hv.prototype.__init.call(this),Hv.prototype.__init2.call(this),this._hub=n||co(),this._name=e.name||"",this.metadata={source:"custom",...e.metadata,spanMetadata:{},changes:[],propagations:0},this._trimEnd=e.trimEnd,this.transaction=this;const r=this.metadata.dynamicSamplingContext;r&&(this._frozenDynamicSamplingContext={...r})}get name(){return this._name}set name(e){this.setName(e)}setName(e,n="custom"){(e!==this.name||n!==this.metadata.source)&&this.metadata.changes.push({source:this.metadata.source,timestamp:__(),propagations:this.metadata.propagations}),this._name=e,this.metadata.source=n}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new P_(e)),this.spanRecorder.add(this)}setMeasurement(e,n,r=""){this._measurements[e]={value:n,unit:r}}setMetadata(e){this.metadata={...this.metadata,...e}}finish(e){if(this.endTimestamp!==void 0)return;if(this.name||((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),super.finish(e),this.sampled!==!0){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled.");const s=this._hub.getClient();s&&s.recordDroppedEvent("sample_rate","transaction");return}const n=this.spanRecorder?this.spanRecorder.spans.filter(s=>s!==this&&s.endTimestamp):[];this._trimEnd&&n.length>0&&(this.endTimestamp=n.reduce((s,a)=>s.endTimestamp&&a.endTimestamp?s.endTimestamp>a.endTimestamp?s:a:s).endTimestamp);const r=this.metadata,i={contexts:{trace:this.getTraceContext()},spans:n,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:{...r,dynamicSamplingContext:this.getDynamicSamplingContext()},...r.source&&{transaction_info:{source:r.source,changes:r.changes,propagations:r.propagations}}};return Object.keys(this._measurements).length>0&&((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),i.measurements=this._measurements),(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),this._hub.captureEvent(i)}toContext(){const e=super.toContext();return nh({...e,name:this.name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this.name=Rd(e.name,()=>""),this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;const e=this._hub||co(),n=e&&e.getClient();if(!n)return{};const{environment:r,release:i}=n.getOptions()||{},{publicKey:o}=n.getDsn()||{},s=this.metadata.sampleRate,a=s!==void 0?s.toString():void 0,l=e.getScope(),{segment:c}=l&&l.getUser()||{},u=this.metadata.source,f=u&&u!=="url"?this.name:void 0;return nh({environment:r,release:i,transaction:f,user_segment:c,public_key:o,trace_id:this.traceId,sample_rate:a})}}const xee=1e3,See=3e4,wee=5e3;class zEe extends P_{constructor(e,n,r,i){super(i),this._pushActivity=e,this._popActivity=n,this.transactionSpanId=r}add(e){e.spanId!==this.transactionSpanId&&(e.finish=n=>{e.endTimestamp=typeof n=="number"?n:Fv(),this._popActivity(e.spanId)},e.endTimestamp===void 0&&this._pushActivity(e.spanId)),super.add(e)}}class h1 extends Hv{__init(){this.activities={}}__init2(){this._heartbeatCounter=0}__init3(){this._finished=!1}__init4(){this._beforeFinishCallbacks=[]}constructor(e,n,r=xee,i=See,o=wee,s=!1){super(e,n),this._idleHub=n,this._idleTimeout=r,this._finalTimeout=i,this._heartbeatInterval=o,this._onScope=s,h1.prototype.__init.call(this),h1.prototype.__init2.call(this),h1.prototype.__init3.call(this),h1.prototype.__init4.call(this),s&&(iW(n),(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),n.configureScope(a=>a.setSpan(this))),this._startIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this.finish())},this._finalTimeout)}finish(e=Fv()){if(this._finished=!0,this.activities={},this.spanRecorder){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Tracing] finishing IdleTransaction",new Date(e*1e3).toISOString(),this.op);for(const n of this._beforeFinishCallbacks)n(this,e);this.spanRecorder.spans=this.spanRecorder.spans.filter(n=>{if(n.spanId===this.spanId)return!0;n.endTimestamp||(n.endTimestamp=e,n.setStatus("cancelled"),(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(n,void 0,2)));const r=n.startTimestamp<e;return r||(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Tracing] discarding Span since it happened after Transaction was finished",JSON.stringify(n,void 0,2)),r}),(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Tracing] flushing IdleTransaction")}else(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Tracing] No active IdleTransaction");return this._onScope&&iW(this._idleHub),super.finish(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){const n=i=>{this._finished||this._pushActivity(i)},r=i=>{this._finished||this._popActivity(i)};this.spanRecorder=new zEe(n,r,this.spanId,e),(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}_cancelIdleTimeout(){this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0)}_startIdleTimeout(e){this._cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&this.finish(e)},this._idleTimeout)}_pushActivity(e){this._cancelIdleTimeout(),(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Tracing] popActivity ${e}`),delete this.activities[e],(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){const n=Fv()+this._idleTimeout/1e3;this._startIdleTimeout(n)}}_beat(){if(this._finished)return;const e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter+=1:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this.finish()):this._pingHeartbeat()}_pingHeartbeat(){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}}function iW(t){const e=t.getScope();e&&e.getTransaction()&&e.setSpan(void 0)}function LEe(){const t=this.getScope();if(t){const e=t.getSpan();if(e)return{"sentry-trace":e.toTraceparent()}}return{}}function _ee(t,e,n){if(!dR(e))return t.sampled=!1,t;if(t.sampled!==void 0)return t.setMetadata({sampleRate:Number(t.sampled)}),t;let r;return typeof e.tracesSampler=="function"?(r=e.tracesSampler(n),t.setMetadata({sampleRate:Number(r)})):n.parentSampled!==void 0?r=n.parentSampled:(r=e.tracesSampleRate,t.setMetadata({sampleRate:Number(r)})),NEe(r)?r?(t.sampled=Math.random()<r,t.sampled?((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Tracing] starting ${t.op} transaction - ${t.name}`),t):((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`),t)):((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),t.sampled=!1,t):((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)}function NEe(t){return jJ(t)||!(typeof t=="number"||typeof t=="boolean")?((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`),!1):t<0||t>1?((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`),!1):!0}function MEe(t,e){const n=this.getClient(),r=n&&n.getOptions()||{};let i=new Hv(t,this);return i=_ee(i,r,{parentSampled:t.parentSampled,transactionContext:t,...e}),i.sampled&&i.initSpanRecorder(r._experiments&&r._experiments.maxSpans),i}function DEe(t,e,n,r,i,o,s){const a=t.getClient(),l=a&&a.getOptions()||{};let c=new h1(e,t,n,r,s,i);return c=_ee(c,l,{parentSampled:e.parentSampled,transactionContext:e,...o}),c.sampled&&c.initSpanRecorder(l._experiments&&l._experiments.maxSpans),c}function XEe(){const t=j0();!t.__SENTRY__||(t.__SENTRY__.extensions=t.__SENTRY__.extensions||{},t.__SENTRY__.extensions.startTransaction||(t.__SENTRY__.extensions.startTransaction=MEe),t.__SENTRY__.extensions.traceHeaders||(t.__SENTRY__.extensions.traceHeaders=LEe))}function WEe(){const t=j0();if(!t.__SENTRY__)return;const e={mongodb(){const r=Md(module,"./integrations/node/mongo");return new r.Mongo},mongoose(){const r=Md(module,"./integrations/node/mongo");return new r.Mongo({mongoose:!0})},mysql(){const r=Md(module,"./integrations/node/mysql");return new r.Mysql},pg(){const r=Md(module,"./integrations/node/postgres");return new r.Postgres}},n=Object.keys(e).filter(r=>!!I8e(r)).map(r=>{try{return e[r]()}catch{return}}).filter(r=>r);n.length>0&&(t.__SENTRY__.integrations=[...t.__SENTRY__.integrations||[],...n])}function UEe(){XEe(),oR()&&WEe(),AEe()}function qEe(){bt&&bt.document?bt.document.addEventListener("visibilitychange",()=>{const t=tb();if(bt.document.hidden&&t){const e="cancelled";(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${t.op}`),t.status||t.setStatus(e),t.setTag("visibilitychange","document.hidden"),t.finish()}}):(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const hR=(t,e,n)=>{let r;return i=>{e.value>=0&&(i||n)&&(e.delta=e.value-(r||0),(e.delta||r===void 0)&&(r=e.value,t(e)))}},BEe=()=>`v2-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,pR=(t,e)=>({name:t,value:Rd(e,()=>-1),delta:0,entries:[],id:BEe()}),Q_=(t,e)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){if(t==="first-input"&&!("PerformanceEventTiming"in self))return;const n=new PerformanceObserver(r=>r.getEntries().map(e));return n.observe({type:t,buffered:!0}),n}}catch{}},$_=(t,e)=>{const n=r=>{(r.type==="pagehide"||bt.document.visibilityState==="hidden")&&(t(r),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},YEe=(t,e)=>{const n=pR("CLS",0);let r,i=0,o=[];const s=l=>{if(l&&!l.hadRecentInput){const c=o[0],u=o[o.length-1];i&&o.length!==0&&l.startTime-u.startTime<1e3&&l.startTime-c.startTime<5e3?(i+=l.value,o.push(l)):(i=l.value,o=[l]),i>n.value&&(n.value=i,n.entries=o,r&&r())}},a=Q_("layout-shift",s);a&&(r=hR(t,n,e),$_(()=>{a.takeRecords().map(s),r(!0)}))};let Nx=-1;const FEe=()=>bt.document.visibilityState==="hidden"?0:1/0,jEe=()=>{$_(({timeStamp:t})=>{Nx=t},!0)},OR=()=>(Nx<0&&(Nx=FEe(),jEe()),{get firstHiddenTime(){return Nx}}),ZEe=(t,e)=>{const n=OR(),r=pR("FID");let i;const o=a=>{i&&a.startTime<n.firstHiddenTime&&(r.value=a.processingStart-a.startTime,r.entries.push(a),i(!0))},s=Q_("first-input",o);s&&(i=hR(t,r,e),$_(()=>{s.takeRecords().map(o),s.disconnect()},!0))},oW={},VEe=(t,e)=>{const n=OR(),r=pR("LCP");let i;const o=a=>{const l=a.startTime;l<n.firstHiddenTime&&(r.value=l,r.entries.push(a)),i&&i()},s=Q_("largest-contentful-paint",o);if(s){i=hR(t,r,e);const a=()=>{oW[r.id]||(s.takeRecords().map(o),s.disconnect(),oW[r.id]=!0,i(!0))};["keydown","click"].forEach(l=>{addEventListener(l,a,{once:!0,capture:!0})}),$_(a,!0)}};function aP(t){return typeof t=="number"&&isFinite(t)}function o0(t,{startTimestamp:e,...n}){return e&&t.startTimestamp>e&&(t.startTimestamp=e),t.startChild({startTimestamp:e,...n})}function Tee(){return bt&&bt.addEventListener&&bt.performance}let sW=0,io={},ou,Bg;function GEe(t=!1){const e=Tee();e&&jv&&(e.mark&&bt.performance.mark("sentry-tracing-init"),KEe(),JEe(t),e7e())}function HEe(){Q_("longtask",e=>{const n=tb();if(!n)return;const r=gs(jv+e.startTime),i=gs(e.duration);n.startChild({description:"Main UI thread blocked",op:"ui.long-task",startTimestamp:r,endTimestamp:r+i})})}function KEe(){YEe(t=>{const e=t.entries.pop();!e||((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Measurements] Adding CLS"),io.cls={value:t.value,unit:""},Bg=e)})}function JEe(t){VEe(e=>{const n=e.entries.pop();!n||((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Measurements] Adding LCP"),io.lcp={value:e.value,unit:"millisecond"},ou=n)},t)}function e7e(){ZEe(t=>{const e=t.entries.pop();if(!e)return;const n=gs(jv),r=gs(e.startTime);(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Measurements] Adding FID"),io.fid={value:t.value,unit:"millisecond"},io["mark.fid"]={value:n+r,unit:"second"}})}function t7e(t){const e=Tee();if(!e||!bt.performance.getEntries||!jv)return;(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Tracing] Adding & adjusting spans using Performance API");const n=gs(jv),r=e.getEntries();let i,o;if(r.slice(sW).forEach(s=>{const a=gs(s.startTime),l=gs(s.duration);if(!(t.op==="navigation"&&n+a<t.startTimestamp))switch(s.entryType){case"navigation":{r7e(t,s,n),i=n+gs(s.responseStart),o=n+gs(s.requestStart);break}case"mark":case"paint":case"measure":{n7e(t,s,a,l,n);const c=OR(),u=s.startTime<c.firstHiddenTime;s.name==="first-paint"&&u&&((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Measurements] Adding FP"),io.fp={value:s.startTime,unit:"millisecond"}),s.name==="first-contentful-paint"&&u&&((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Measurements] Adding FCP"),io.fcp={value:s.startTime,unit:"millisecond"});break}case"resource":{const c=s.name.replace(bt.location.origin,"");o7e(t,s,c,a,l,n);break}}}),sW=Math.max(r.length-1,0),s7e(t),t.op==="pageload"){typeof i=="number"&&((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Measurements] Adding TTFB"),io.ttfb={value:(i-t.startTimestamp)*1e3,unit:"millisecond"},typeof o=="number"&&o<=i&&(io["ttfb.requestTime"]={value:(i-o)*1e3,unit:"millisecond"})),["fcp","fp","lcp"].forEach(a=>{if(!io[a]||n>=t.startTimestamp)return;const l=io[a].value,c=n+gs(l),u=Math.abs((c-t.startTimestamp)*1e3),f=u-l;(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Measurements] Normalized ${a} from ${l} to ${u} (${f})`),io[a].value=u});const s=io["mark.fid"];s&&io.fid&&(o0(t,{description:"first input delay",endTimestamp:s.value+gs(io.fid.value),op:"ui.action",startTimestamp:s.value}),delete io["mark.fid"]),"fcp"in io||delete io.cls,Object.keys(io).forEach(a=>{t.setMeasurement(a,io[a].value,io[a].unit)}),a7e(t)}ou=void 0,Bg=void 0,io={}}function n7e(t,e,n,r,i){const o=i+n,s=o+r;return o0(t,{description:e.name,endTimestamp:s,op:e.entryType,startTimestamp:o}),o}function r7e(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Z5(t,e,r,n)}),Z5(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),Z5(t,e,"fetch",n,"cache","domainLookupStart"),Z5(t,e,"domainLookup",n,"DNS"),i7e(t,e,n)}function Z5(t,e,n,r,i,o){const s=o?e[o]:e[`${n}End`],a=e[`${n}Start`];!a||!s||o0(t,{op:"browser",description:Rd(i,()=>n),startTimestamp:r+gs(a),endTimestamp:r+gs(s)})}function i7e(t,e,n){o0(t,{op:"browser",description:"request",startTimestamp:n+gs(e.requestStart),endTimestamp:n+gs(e.responseEnd)}),o0(t,{op:"browser",description:"response",startTimestamp:n+gs(e.responseStart),endTimestamp:n+gs(e.responseEnd)})}function o7e(t,e,n,r,i,o){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;const s={};"transferSize"in e&&(s["Transfer Size"]=e.transferSize),"encodedBodySize"in e&&(s["Encoded Body Size"]=e.encodedBodySize),"decodedBodySize"in e&&(s["Decoded Body Size"]=e.decodedBodySize);const a=o+r,l=a+i;o0(t,{description:n,endTimestamp:l,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",startTimestamp:a,data:s})}function s7e(t){const e=bt.navigator;if(!e)return;const n=e.connection;n&&(n.effectiveType&&t.setTag("effectiveConnectionType",n.effectiveType),n.type&&t.setTag("connectionType",n.type),aP(n.rtt)&&(io["connection.rtt"]={value:n.rtt,unit:"millisecond"})),aP(e.deviceMemory)&&t.setTag("deviceMemory",`${e.deviceMemory} GB`),aP(e.hardwareConcurrency)&&t.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}function a7e(t){ou&&((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Measurements] Adding LCP Data"),ou.element&&t.setTag("lcp.element",qv(ou.element)),ou.id&&t.setTag("lcp.id",ou.id),ou.url&&t.setTag("lcp.url",ou.url.trim().slice(0,200)),t.setTag("lcp.size",ou.size)),Bg&&Bg.sources&&((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Measurements] Adding CLS Data"),Bg.sources.forEach((e,n)=>t.setTag(`cls.source.${n+1}`,qv(e.node))))}const l7e=["localhost",/^\//],o4={traceFetch:!0,traceXHR:!0,tracingOrigins:l7e};function c7e(t){const{traceFetch:e,traceXHR:n,tracingOrigins:r,shouldCreateSpanForRequest:i}={...o4,...t},o={},s=c=>{if(o[c])return o[c];const u=r;return o[c]=u.some(f=>Bv(c,f))&&!Bv(c,"sentry_key"),o[c]};let a=s;typeof i=="function"&&(a=c=>s(c)&&i(c));const l={};e&&Ja("fetch",c=>{u7e(c,a,l)}),n&&Ja("xhr",c=>{d7e(c,a,l)})}function u7e(t,e,n){if(!dR()||!(t.fetchData&&e(t.fetchData.url)))return;if(t.endTimestamp){const i=t.fetchData.__span;if(!i)return;const o=n[i];o&&(t.response?o.setHttpStatus(t.response.status):t.error&&o.setStatus("internal_error"),o.finish(),delete n[i]);return}const r=tb();if(r){const i=r.startChild({data:{...t.fetchData,type:"fetch"},description:`${t.fetchData.method} ${t.fetchData.url}`,op:"http.client"});t.fetchData.__span=i.spanId,n[i.spanId]=i;const o=t.args[0];t.args[1]=t.args[1]||{};const s=t.args[1];s.headers=f7e(o,r.getDynamicSamplingContext(),i,s),r.metadata.propagations+=1}}function f7e(t,e,n,r){const i=oee(e),o=n.toTraceparent(),s=typeof Request!="undefined"&&Eu(t,Request)?t.headers:r.headers;if(s)if(typeof Headers!="undefined"&&Eu(s,Headers)){const a=new Headers(s);return a.append("sentry-trace",o),i&&a.append(n8,i),a}else if(Array.isArray(s)){const a=[...s,["sentry-trace",o]];return i&&a.push([n8,i]),a}else{const a="baggage"in s?s.baggage:void 0,l=[];return Array.isArray(a)?l.push(...a):a&&l.push(a),i&&l.push(i),{...s,"sentry-trace":o,baggage:l.length>0?l.join(","):void 0}}else return{"sentry-trace":o,baggage:i}}function d7e(t,e,n){if(!dR()||t.xhr&&t.xhr.__sentry_own_request__||!(t.xhr&&t.xhr.__sentry_xhr__&&e(t.xhr.__sentry_xhr__.url)))return;const r=t.xhr.__sentry_xhr__;if(t.endTimestamp){const o=t.xhr.__sentry_xhr_span_id__;if(!o)return;const s=n[o];s&&(s.setHttpStatus(r.status_code),s.finish(),delete n[o]);return}const i=tb();if(i){const o=i.startChild({data:{...r.data,type:"xhr",method:r.method,url:r.url},description:`${r.method} ${r.url}`,op:"http.client"});if(t.xhr.__sentry_xhr_span_id__=o.spanId,n[t.xhr.__sentry_xhr_span_id__]=o,t.xhr.setRequestHeader)try{t.xhr.setRequestHeader("sentry-trace",o.toTraceparent());const s=i.getDynamicSamplingContext(),a=oee(s);a&&t.xhr.setRequestHeader(n8,a),i.metadata.propagations+=1}catch{}}}function h7e(t,e=!0,n=!0){if(!bt||!bt.location){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn("Could not initialize routing instrumentation due to invalid location");return}let r=bt.location.href,i;e&&(i=t({name:bt.location.pathname,op:"pageload",metadata:{source:"url"}})),n&&Ja("history",({to:o,from:s})=>{if(s===void 0&&r&&r.indexOf(o)!==-1){r=void 0;return}s!==o&&(r=void 0,i&&((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Tracing] Finishing current transaction with op: ${i.op}`),i.finish()),i=t({name:bt.location.pathname,op:"navigation",metadata:{source:"url"}}))})}const p7e="BrowserTracing",O7e={idleTimeout:xee,finalTimeout:See,heartbeatInterval:wee,markBackgroundTransactions:!0,routingInstrumentation:h7e,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,_experiments:{enableLongTask:!0},...o4};class mR{__init(){this.name=p7e}constructor(e){mR.prototype.__init.call(this);let n=o4.tracingOrigins;e&&(e.tracingOrigins&&Array.isArray(e.tracingOrigins)?n=e.tracingOrigins:(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&(this._emitOptionsWarning=!0)),this.options={...O7e,...e,tracingOrigins:n};const{_metricOptions:r}=this.options;GEe(r&&r._reportAllChanges),h8e([this,"access",i=>i.options,"access",i=>i._experiments,"optionalAccess",i=>i.enableLongTask])&&HEe()}setupOnce(e,n){this._getCurrentHub=n,this._emitOptionsWarning&&((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn("[Tracing] You need to define `tracingOrigins` in the options. Set an array of urls or patterns to trace."),(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn(`[Tracing] We added a reasonable default for you: ${o4.tracingOrigins}`));const{routingInstrumentation:r,startTransactionOnLocationChange:i,startTransactionOnPageLoad:o,markBackgroundTransactions:s,traceFetch:a,traceXHR:l,tracingOrigins:c,shouldCreateSpanForRequest:u}=this.options;r(f=>this._createRouteTransaction(f),o,i),s&&qEe(),c7e({traceFetch:a,traceXHR:l,tracingOrigins:c,shouldCreateSpanForRequest:u})}_createRouteTransaction(e){if(!this._getCurrentHub){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`);return}const{beforeNavigate:n,idleTimeout:r,finalTimeout:i,heartbeatInterval:o}=this.options,s=e.op==="pageload",a=s?aW("sentry-trace"):null,l=s?aW("baggage"):null,c=a?B8e(a):void 0,u=l?r$e(l):void 0,f={...e,...c,metadata:{...e.metadata,dynamicSamplingContext:c&&!u?{}:u},trimEnd:!0},h=typeof n=="function"?n(f):f,d=h===void 0?{...f,sampled:!1}:h;d.metadata=d.name!==f.name?{...d.metadata,source:"custom"}:d.metadata,d.sampled===!1&&(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Tracing] Will not send ${d.op} transaction because of beforeNavigate.`),(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Tracing] Starting ${d.op} transaction on scope`);const O=this._getCurrentHub(),{location:b}=bt,v=DEe(O,d,r,i,!0,{location:b},o);return v.registerBeforeFinishCallback(p=>{t7e(p),p.setTag("sentry_reportAllChanges",Boolean(this.options._metricOptions&&this.options._metricOptions._reportAllChanges))}),v}}function aW(t){const e=i8e(`meta[name=${t}]`);return e?e.getAttribute("content"):null}(typeof __SENTRY_TRACING__=="undefined"||__SENTRY_TRACING__)&&UEe();const m7e=Ph(async()=>(await Promise.resolve().then(function(){return GCe})).FileTree),g7e=Ph(async()=>(await Promise.resolve().then(function(){return Hit})).Editor),v7e=Ph(async()=>(await Promise.resolve().then(function(){return est})).default),y7e=Ph(async()=>(await Promise.resolve().then(function(){return ost})).default),b7e=Ph(async()=>(await Promise.resolve().then(function(){return lst})).default),x7e=Ph(async()=>(await Promise.resolve().then(function(){return Ngt})).default),S7e=Ph(async()=>(await Promise.resolve().then(function(){return Ygt})).default);class w7e{constructor(e){St(this,"components",{Tree:null,Editor:null,Console:null,Browser:null,Shell:null,MarkdownPreview:null});St(this,"paasOptions");St(this,"paasDomainPath");St(this,"sdkVersion");St(this,"isRendered",!1);St(this,"markdownSchema",{});St(this,"socketParser","default");St(this,"i18nLanguage",jS.ZH);St(this,"themeType",YQ.dark);this.sdkVersion=f_e(),this.setPaasOptionsWithDefaultAvatar(e),this.setPaasDomainPathWithDefaultOrigin(e.paasDomain),this.themeType=e.themeType||YQ.dark,this.i18nLanguage=e.i18nLanguage||jS.ZH,this.init(),this.integratedSentry(e.enableSentry)}loadTheme(e){this.themeType=e,Ce.theme.setTheme(this.themeType,Fl.terminal),Ce.theme.setTheme(this.themeType,Fl.console),z_e(this.themeType)}integratedSentry(e=!1){!e||CEe({dsn:"https://7e40a817f13d4730b062e75687903544@o1334791.ingest.sentry.io/4504043835752448",integrations:[new mR],release:"d42paas-front@0.9.96",enabled:!0,environment:"production",tracesSampleRate:.02,beforeSend(n){var o;const r=((o=n==null?void 0:n.exception)==null?void 0:o.values)||[];let i=!0;return r.forEach(s=>{var l;const a=((l=s.stacktrace)==null?void 0:l.frames)||[];if(a.length){const c=a[a.length-1],u=(c==null?void 0:c.filename)||"";i=/daopaas/gi.test(u)}}),i?n:null}})}async init(){var s,a,l,c;this.reset(),this.loadTheme(this.themeType),(s=this.paasOptions.defaultOpenFiles)!=null&&s.length&&Ce.dao.defaultOpenFiles(this.paasOptions.defaultOpenFiles||""),Ce.dao.specialOpenFile(this.paasOptions.specialOpenFile||""),Ce.dao.setXtermStyle(this.paasOptions.xtermStyle),Ce.dao.isOpenDebugMode((a=this.paasOptions.isOpenDebugMode)!=null?a:!1),Ce.i18n.setLanguage(this.i18nLanguage),Qo.changeLanguage(this.i18nLanguage),Ce.dao.setIsLegacyMarkdownMath((c=(l=this.paasOptions)==null?void 0:l.isLegacyMarkdownMath)!=null?c:!1),Mt.debug(`sdk: init with ${this.paasDomainPath} passDomain`);const{url:e,userId:n,socketParser:r}=await d_e(this.paasDomainPath,this.paasOptions.ticket,this.sdkVersion);this.socketParser=r||"default",Ce.dao.openSocketBuffer(this.socketParser==="buffer");let i;try{i=await q4e(n)}catch{}const o=oe.dao.channel().visibilitychange;document.removeEventListener("visibilitychange",o),Ce.dao.reconnectMaxTimes(this.paasOptions.reconnectMaxTimes||10),oe.dao.channel().startChannel(e,{...this.paasOptions,agentUserId:i},{triggerEventForMaxTimespan:this.paasOptions.triggerEventForMaxTimespan,reconnectMaxTimes:this.paasOptions.reconnectMaxTimes,isInsertCrdt:this.paasOptions.isInsertCrdt,sockerParser:this.socketParser}),Mt.info(">>>registerVisiblityChangeEvent"),document.addEventListener("visibilitychange",o)}setPaasOptionsWithDefaultAvatar(e){this.paasOptions=e,this.paasOptions.userInfo.avatarUrl||(this.paasOptions.userInfo.avatarUrl=R9e(this.paasOptions.userInfo.username))}setPaasDomainPathWithDefaultOrigin(e){this.paasDomainPath={}.PAAS_MANAGER_API_ORIGIN||"https://www.1024paas.com",e&&(this.paasDomainPath=e)}reset(){oe.dao.channel().closeChannel(),rTe()}get playgroundStatus(){return oe.dao.playgroundInfo().status}get dockerStatus(){return oe.dao.playgroundInfo().runStatus}get currentAgentUser(){return oe.dao.currentAgentUser()}get agentUsers(){return oe.dao.playgroundInfo().agentUsers}get playgroundInfo(){return oe.dao.playgroundInfo()}get currentFollowingAgentUser(){return oe.dao.getFollowingAgentUser()}followUser(e){const n=oe.dao.playgroundInfo().agentUsers.find(r=>r.agentUserId===e);if(oe.dao.currentAgentUserId()===(n==null?void 0:n.followingAgentUserId)){const r=or("dao_paas_cannot_follow_each_other");ao.error(r);return}oe.dao.channel().followingAgentUser(e),n.fileOpened&&(Ce.file.docLoading(!0),oe.dao.channel().loadFile(n.fileOpened,"follow"))}unFollowUser(){oe.dao.channel().unFollowingAgentUser()}publishKeyEvent(e){oe.dao.channel().publishKeyEvent(e)}preparePlayback(){Ce.dao.setPlaygroundMode($u.playback),oe.dao.channel().getPlaybackInfo()}startPlayback(e){oe.dao.channel().startPlayback(e)}restartPlayback(e){oe.dao.channel().restartPlayback(e)}goToPlayback(e){oe.dao.channel().goToPlayback(e)}pausePlayback(){oe.dao.channel().pausePlayback()}stopPlayback(){Ce.dao.setPlaygroundMode($u.edit),oe.dao.channel().stopPlayback()}setRate(e){oe.dao.channel().setPlaybackRate(e)}activePlayground(){oe.dao.channel().active()}retainingAllFiles(){return oe.dao.channel().retainingAllFiles(),oe.dao.channel().off("retainingAllFiles"),new Promise(e=>{oe.dao.channel().on("retainingAllFiles",n=>{e(n)})})}runPlayground(){return new Promise((e,n)=>{const r=oe.file.pendingUpdateCount();if(r>0)return n(this.handleErrorRes(or("editor_pending_update",{pendingUpdate:r})));oe.dao.channel().run(),e(this.handleSuccessRes("running"))})}stopPlayground(){oe.dao.channel().stop()}appendCustomizeFrameData(e){oe.dao.channel().appendCustomizeFrameData(e)}statisticsPlaybackData(e,n){return new Promise((r,i)=>{if(!oe.dao.isReady())return i(this.handleErrorRes("no ready"));if(!e||!(n!=null&&n.length)){r({status:"fail",message:"please input right parmas",errorCode:"ERROR_PARMAS"});return}oe.dao.channel().statisticsPlaybackData(e,n),oe.dao.channel().off("statisticsPlaybackData"),oe.dao.channel().on("statisticsPlaybackData",o=>{r({status:"success",data:o})})})}onMessage(e){oe.dao.channel().addMessageListener(e)}onError(e){oe.dao.channel().addErrorListener(e)}subscribePlayControlEvent(e){oe.dao.channel().subscribeForPlayControl(e)}unsubscribePlayControlEvent(e){oe.dao.channel().unsubscribeForPlayControl(e)}subscribe(e,n){oe.dao.channel().subscribeForComponent(e,n)}unsubscribe(e,n){oe.dao.channel().unsubscribeForComponent(e,n)}initComponent(e,n,r){const i=document.querySelector(n);if(!i)throw new Error(or("dao_paas_not_find_mount_dom_object_for_x",{x:n}));const o=Vw(i),s=a=>{switch(e){case"Tree":return de(m7e,{...a});case"Editor":return de(g7e,{...a});case"Browser":return de(y7e,{...a});case"Console":return de(v7e,{...a});case"Shell":return de(b7e,{...a});case"MarkdownPreview":return de(x7e,{...a});case"Debug":return de(S7e,{...a});default:throw new Error(or("dao_paas_x_component_is_not_supported",{x:e}))}};this.components[e]={reactComponent:s,container:n,props:r,root:o},o.render(de(M.exports.Suspense,{fallback:de(C9e,{}),children:de(s,{...r})}))}mountMarkdownPreview(){const{MarkdownPreview:e}=this.components;if(Mt.debug("markdown\u9884\u89C8\u7EC4\u4EF6\u6302\u8F7D\u4E2D",this.markdownSchema),e)Mt.debug("\u6302\u8F7D\u5931\u8D25\uFF0C\u8BF7\u52FF\u91CD\u590D\u6302\u8F7D\u540C\u4E00\u4E2A\u7EC4\u4EF6",this.markdownSchema);else if(Object.keys(this.markdownSchema).length>0){const{item:n,container:r,props:i}=this.markdownSchema;this.initComponent(n,r,i),Mt.debug("markdown\u9884\u89C8\u7EC4\u4EF6\u6302\u8F7D\u5B8C\u6210",this.markdownSchema)}}unMountMarkdownPreview(){var n;const{MarkdownPreview:e}=this.components;Mt.debug("markdown\u9884\u89C8\u7EC4\u4EF6\u5378\u8F7D\u4E2D",e),e?((n=e.root)==null||n.unmount(),this.components.MarkdownPreview=null,Mt.debug("markdown\u9884\u89C8\u7EC4\u4EF6\u5378\u8F7D\u6210\u529F",e)):Mt.debug("\u5378\u8F7D\u5931\u8D25\uFF0Cmarkdown\u9884\u89C8\u7EC4\u4EF6\u4E0D\u5B58\u5728",e)}mapRender(e){e.forEach((n,r)=>{const{item:i,container:o,props:s}=n;i==="MarkdownPreview"&&(this.markdownSchema=n,!s.isRender)||this.initComponent(i,o,s)})}handleErrorRes(e){return{status:!1,message:e}}handleSuccessRes(e){return{status:!0,message:e}}insertTextById(e,n,r){oe.dao.channel().insertTextById(e,n,r)}removeAreaTextById(e,n,r){oe.dao.channel().removeAreaTextById(e,n,r)}jumpToAreaById(e,n){oe.dao.channel().jumpToAreaById(e,n)}switchLanguage(e,n,r,i){return new Promise((o,s)=>{if(!oe.dao.isReady())return s(this.handleErrorRes(or("dao_paas_no_ready")));oe.dao.channel().switchLanguage(e,n,r,i),oe.dao.channel().off("switchLanguage"),oe.dao.channel().on("switchLanguage",a=>{const l=oe.file.getOpenedPath(),{destination:c}=a;a.status&&r===l&&(Ce.file.setDocLoading(!0),oe.dao.channel().loadFile(c),o(this.handleSuccessRes(or("common_success")))),o(a)})})}restartServer(){return new Promise((e,n)=>{if(!oe.dao.isReady())return n(this.handleErrorRes(or("dao_paas_no_ready")));oe.dao.channel().restartServer(),oe.dao.channel().off("restartServer"),oe.dao.channel().on("restartServer",r=>{const i={status:r.success,message:r.success?r.message||r.messageId:r.error};e(i)})})}restartLSPServer(){if(!oe.dao.isReady())return this.handleErrorRes(or("dao_paas_no_ready"));oe.dao.channel().restartLSPServer()}addCDNSource(e,n,r){return new Promise((i,o)=>{if(!oe.dao.isReady())return o(this.handleErrorRes(or("dao_paas_no_ready")));oe.dao.channel().addCDNSource(e,n,r),oe.dao.channel().off("addCDNSource"),oe.dao.channel().on("addCDNSource",s=>{const a=oe.file.getOpenedPath();s.status&&r===a&&this.openFile(r),i(s)})})}openFile(e){return new Promise((n,r)=>{if(!oe.dao.isReady())return r(this.handleErrorRes(or("dao_paas_no_ready")));IK(e)?(Ce.file.setDocLoading(!0),oe.dao.channel().loadFile(e),zK(e),n(this.handleSuccessRes(or("common_success")))):r(this.handleErrorRes(or("dao_paas_file_does_not_exist")))})}updateGlobalConfig(e){const n={...oe.dao.globalConfig(),...e};window.localStorage.setItem("paasGlobalConfig",JSON.stringify(n)),Ce.dao.globalConfig(n)}updateConfig(e){const n={...oe.dao.config(),...e};Ce.dao.config(n)}toggleMarkDownPreview(e){e?this.mountMarkdownPreview():this.unMountMarkdownPreview()}reload(e=["Editor","Tree"]){const n={file:()=>{Ce.dao.setPlaygroundInfo(qK),Ce.file.reset()}},r=(e==null?void 0:e.includes("Editor"))||(e==null?void 0:e.includes("Tree"))?"file":"";e&&r&&n[r]()}switchI18nLanguage(e){Ce.i18n.setLanguage(e),oe.dao.channel().emitI18nLanguage(e),Qo.changeLanguage(e)}reloadI18nResources(e,n){try{(Array.isArray(e)?e:[{language:e,resource:n}]).forEach(i=>{Qo.addResources(i.language,"translation",i.resource)}),Qo.changeLanguage(oe.i18n.getLanguage())}catch(r){Mt.error("\u66F4\u65B0\u56FD\u9645\u5316\u6587\u672C\u5931\u8D25\uFF0C\u9519\u8BEF:",r)}}debugRun(){oe.dao.channel().debugRun()}setFileStyle(e){try{Ce.file.setFileStyle(e)}catch(n){Mt.error("\u8BBE\u7F6E\u6587\u4EF6\u6837\u5F0F\u5931\u8D25\uFF0C\u9519\u8BEF:",n)}}syncXtermKey(e){oe.dao.getFollowingAgentUser()||oe.dao.channel().xtermStatus({xtermKey:e})}dispose(){var e;Mt.debug("destroy components...",this.components),this.reset();for(const[n,r]of Object.entries(this.components)){if(!r)break;(e=r.root)==null||e.unmount(),Mt.debug(`destroy unmount: ${r.container}`)}}loggerEnable(){j4e()}}var Qf;(function(t){t.DoubleClickItemToExpand="double-click-item-to-expand",t.ClickItemToExpand="click-item-to-expand",t.ClickArrowToExpand="click-arrow-to-expand"})(Qf||(Qf={}));var s4=globalThis&&globalThis.__assign||function(){return s4=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},s4.apply(this,arguments)},_7e=function(t,e){return{mode:t.mode,createInteractiveElementProps:function(n,r,i,o){return s4(s4({},e.createInteractiveElementProps(n,r,i,o)),t.createInteractiveElementProps(n,r,i,o))}}},gR=function(t){return t.ctrlKey||navigator.platform.toUpperCase().indexOf("MAC")>=0&&t.metaKey},T7e=function(){function t(e){this.mode=Qf.DoubleClickItemToExpand,this.environment=e}return t.prototype.createInteractiveElementProps=function(e,n,r,i){var o=this;return{onClick:function(s){r.focusItem(),s.shiftKey?r.selectUpTo():gR(s)?i.isSelected?r.unselectItem():r.addToSelectedItems():r.selectItem()},onDoubleClick:function(){r.focusItem(),r.selectItem(),e.hasChildren&&r.toggleExpandedState(),(!e.hasChildren||o.environment.canInvokePrimaryActionOnItemContainer)&&r.primaryAction()},onFocus:function(){r.focusItem()},onDragStart:function(s){s.dataTransfer.dropEffect="move",r.startDragging()},onDragOver:function(s){s.preventDefault()},draggable:i.canDrag&&!i.isRenaming,tabIndex:i.isRenaming?void 0:i.isFocused?0:-1}},t}(),k7e=function(){function t(e){this.mode=Qf.ClickItemToExpand,this.environment=e}return t.prototype.createInteractiveElementProps=function(e,n,r,i){var o=this;return{onClick:function(s){r.focusItem(),s.shiftKey?r.selectUpTo():gR(s)?i.isSelected?r.unselectItem():r.addToSelectedItems():(e.hasChildren&&r.toggleExpandedState(),r.selectItem(),(!e.hasChildren||o.environment.canInvokePrimaryActionOnItemContainer)&&r.primaryAction())},onFocus:function(){r.focusItem()},onDragStart:function(s){s.dataTransfer.dropEffect="move",r.startDragging()},onDragOver:function(s){s.preventDefault()},draggable:i.canDrag&&!i.isRenaming,tabIndex:i.isRenaming?void 0:i.isFocused?0:-1}},t}(),P7e=function(){function t(e){this.mode=Qf.ClickItemToExpand,this.environment=e}return t.prototype.createInteractiveElementProps=function(e,n,r,i){var o=this;return{onClick:function(s){r.focusItem(),s.shiftKey?r.selectUpTo():gR(s)?i.isSelected?r.unselectItem():r.addToSelectedItems():(r.selectItem(),(!e.hasChildren||o.environment.canInvokePrimaryActionOnItemContainer)&&r.primaryAction())},onFocus:function(){r.focusItem()},onDragStart:function(s){s.dataTransfer.dropEffect="move",r.startDragging()},onDragOver:function(s){s.preventDefault()},draggable:i.canDrag&&!i.isRenaming,tabIndex:i.isRenaming?void 0:i.isFocused?0:-1}},t}(),lW=function(t,e){switch(t){case Qf.DoubleClickItemToExpand:return new T7e(e);case Qf.ClickItemToExpand:return new k7e(e);case Qf.ClickArrowToExpand:return new P7e(e);default:throw Error("Unknown interaction mode "+t)}},kee=M.exports.createContext(null),Q7e=function(){return M.exports.useContext(kee)},$7e=function(t){var e=xi(),n=e.defaultInteractionMode,r=M.exports.useMemo(function(){var i;return n&&typeof n!="string"?n.extends?_7e(n,lW(n.extends,e)):n:lW((i=n)!==null&&i!==void 0?i:Qf.ClickItemToExpand,e)},[]);return M.exports.createElement(kee.Provider,{value:r},t.children)},Pee=function(){var t=xi();return M.exports.useCallback(function(e,n){for(var r=t.linearItems[n],i=r[e].depth,o=e;!!r[o]&&r[o].depth!==i-1;o--);var s=r[o];return s||(s={item:t.trees[n].rootItem,depth:0},o=0),s},[t.linearItems,t.trees])},E7e=function(t,e){return t.clientX<e.left||t.clientX>e.right||t.clientY<e.top||t.clientY>e.bottom},C7e=function(t,e,n,r,i){var o=(t-e)/n,s=Math.floor(o),a=void 0,l=r||i?.2:.5;return o%1<l?a="top":o%1>1-l&&(a="bottom"),{linearIndex:s,offset:a}},R7e=function(t,e,n,r,i){var o=xi(),s=o.canDropOnItemWithChildren,a=o.canDropOnItemWithoutChildren,l=o.canDragAndDrop,c=o.linearItems,u=o.items,f=o.canReorderItems,h=o.viewState,d=Pee();return M.exports.useCallback(function(O,b,v){var p,g,y,S;if(!!l&&!!v.current&&!(O.clientX<0||O.clientY<0)){var w=v.current.getBoundingClientRect(),T=E7e(O,w),k=C7e(O.clientY,w.top,n,s,a),A=k.linearIndex,L=k.offset,$=T?"outside":""+b+A+(L!=null?L:"");if(t!==$){if(e($),T){r(void 0);return}if(A<0||A>=c[b].length){r(void 0);return}var E=c[b][A],C=E.depth,I=u[E.item];if(!L&&!a&&!I.hasChildren){r(void 0);return}if(!L&&!s&&I.hasChildren){r(void 0);return}if(L&&!f){r(void 0);return}var H=d(A,b);if(!(!((g=(p=h[b])===null||p===void 0?void 0:p.selectedItems)===null||g===void 0)&&g.includes(E.item))){var Y=u[H.item].children.indexOf(E.item)+(L==="top"?0:1);L==="top"&&C===((S=(y=c[b][A-1])===null||y===void 0?void 0:y.depth)!==null&&S!==void 0?S:-1)&&(L="bottom",A-=1);var z;L?z={targetType:"between-items",treeId:b,parentItem:H.item,depth:E.depth,linearIndex:A+(L==="top"?0:1),childIndex:Y,linePosition:L}:z={targetType:"item",treeId:b,parentItem:H.item,targetItem:E.item,depth:E.depth,linearIndex:A},i(z)}}}},[l,s,a,f,d,n,u,t,c,r,i,e,h])},Qee=function(){var t=xi();return M.exports.useCallback(function(e,n){if(e.targetType==="between-items"){if(!t.canReorderItems)return!1}else{var r=t.items[e.targetItem];if(!t.canDropOnItemWithChildren&&r.hasChildren||!t.canDropOnItemWithoutChildren&&!r.hasChildren)return!1}return!(t.canDropAt&&(!n||!t.canDropAt(n,e)))},[t])},cW=globalThis&&globalThis.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t},A7e=function(){var t=xi(),e=Pee(),n=Qee();return M.exports.useCallback(function(r,i){var o=t.linearItems[r];return o.map(function(s,a){var l,c,u=s.item,f=s.depth,h=e(a,r),d=t.items[h.item].children.indexOf(u),O={targetType:"item",parentItem:h.item,targetItem:u,linearIndex:a,depth:f,treeId:r},b={targetType:"between-items",parentItem:h.item,linePosition:"top",childIndex:d,depth:f,treeId:r,linearIndex:a},v={targetType:"between-items",parentItem:h.item,linePosition:"bottom",linearIndex:a+1,childIndex:d+1,depth:f,treeId:r},p=f===((c=(l=o[a-1])===null||l===void 0?void 0:l.depth)!==null&&c!==void 0?c:-1);return p?[O,v]:[b,O,v]}).reduce(function(s,a){return cW(cW([],s),a)},[]).filter(function(s){return n(s,i)})},[n,t.items,t.linearItems,e])},V5=globalThis&&globalThis.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t},a4=function(t,e,n){var r=M.exports.useRef();M.exports.useEffect(function(){if(!r.current)r.current=V5([],n),t();else{var i=r.current.some(function(o,s){return o!==n[s]});i&&(r.current=V5([],n),t())}},V5(V5([],e),n))},l4=globalThis&&globalThis.__assign||function(){return l4=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},l4.apply(this,arguments)},$ee=function(t,e){return t.map(function(n){return[n,e(n)]}).reduce(function(n,r){var i,o=r[0],s=r[1];return l4(l4({},n),(i={},i[o]=s,i))},{})};function Z0(){var t=M.exports.useRef(new Array);M.exports.useEffect(function(){var n=t.current;return function(){return n.forEach(function(r){return cancelAnimationFrame(r)})}},[t]);var e=M.exports.useCallback(function(n){var r=requestAnimationFrame(function(){t.current.splice(t.current.indexOf(r),1),n()});t.current.push(r)},[t]);return e}var Eee=M.exports.createContext(null),Lu=function(){return M.exports.useContext(Eee)},I7e=function(t){var e=xi(),n=M.exports.useState(!1),r=n[0],i=n[1],o=M.exports.useState(4),s=o[0],a=o[1],l=M.exports.useState({}),c=l[0],u=l[1],f=M.exports.useState(0),h=f[0],d=f[1],O=M.exports.useState(),b=O[0],v=O[1],p=M.exports.useState(),g=p[0],y=p[1],S=M.exports.useState("_nodrag"),w=S[0],T=S[1],k=A7e(),A=Z0();M.exports.useRef(!1);var L=M.exports.useCallback(function(re,Te){var Re;if(e.activeTreeId&&((Re=e.viewState[e.activeTreeId])===null||Re===void 0?void 0:Re.focusedItem)&&e.linearItems&&Te){var V=e.viewState[e.activeTreeId].focusedItem,pe=k(e.activeTreeId,Te),J=pe.findIndex(function(ae){if(ae.targetType==="item")return ae.targetItem===V;if(ae.targetType==="between-items")return e.items[ae.parentItem].children[ae.childIndex]===V});d(J?Math.min(J+1,pe.length-1):0)}else d(0)},[e.activeTreeId,e.items,e.linearItems,e.viewState,k]),$=M.exports.useCallback(function(){i(!1),a(4),u({}),d(0),v(void 0),y(void 0),T("_nodrag")},[]);a4(function(){e.activeTreeId&&e.linearItems[e.activeTreeId]&&c[e.activeTreeId]&&L(c[e.activeTreeId],b)},[b,e.activeTreeId,e.linearItems,L,c],[e.activeTreeId]),a4(function(){r&&e.activeTreeId&&y(c[e.activeTreeId][h])},[h,e.activeTreeId,r,c],[h,e.activeTreeId]);var E=Qee(),C=function(re){var Te;b&&!E(re,b)||(y(re),e.setActiveTree(re.treeId),b&&e.activeTreeId!==re.treeId&&((Te=e.onSelectItems)===null||Te===void 0||Te.call(e,b.map(function(Re){return Re.index}),re.treeId)))},I=R7e(w,T,s,y,C),H=M.exports.useCallback(function(){b&&g&&e.onDrop&&(e.onDrop(b,g),A(function(){var re;(re=e.onFocusItem)===null||re===void 0||re.call(e,b[0],g.treeId),$()}))},[b,g,e,$,A]),Y=M.exports.useCallback(function(re,Te){var Re,V,pe=$ee(e.treeIds,function(ae){return k(ae,re)}),J=(V=(Re=document.querySelector('[data-rct-tree="'+Te+'"] [data-rct-item-container="true"]'))===null||Re===void 0?void 0:Re.offsetHeight)!==null&&V!==void 0?V:5;a(J),v(re),u(pe),e.activeTreeId&&L(pe[e.activeTreeId],re)},[e.activeTreeId,e.treeIds,k,L]),z=M.exports.useCallback(function(){var re,Te,Re;if(!!e.canDragAndDrop&&e.activeTreeId){var V=(Te=(re=e.viewState[e.activeTreeId])===null||re===void 0?void 0:re.selectedItems)!==null&&Te!==void 0?Te:[(Re=e.viewState[e.activeTreeId])===null||Re===void 0?void 0:Re.focusedItem];if(V.length===0||V[0]===void 0)return;var pe=V.map(function(J){return e.items[J]});if(e.canDrag&&!e.canDrag(pe))return;Y(pe,e.activeTreeId),setTimeout(function(){i(!0)})}},[Y,e]),U=M.exports.useCallback(function(){$()},[$]),j=M.exports.useCallback(function(){H(),$()},[H,$]),K=M.exports.useCallback(function(){d(function(re){return Math.max(0,re-1)})},[]),se=M.exports.useCallback(function(){e.activeTreeId&&d(function(re){return Math.min(c[e.activeTreeId].length,re+1)})},[e.activeTreeId,c]),G={onStartDraggingItems:Y,startProgrammaticDrag:z,abortProgrammaticDrag:U,completeProgrammaticDrag:j,programmaticDragUp:K,programmaticDragDown:se,draggingItems:b,draggingPosition:g,itemHeight:s,isProgrammaticallyDragging:r,onDragOverTreeHandler:I,viableDragPositions:c};return M.exports.useEffect(function(){return window.addEventListener("dragend",$),window.addEventListener("drop",H),function(){window.removeEventListener("dragend",$),window.removeEventListener("drop",H)}},[H,$]),M.exports.createElement(Eee.Provider,{value:G},t.children)},Yg=globalThis&&globalThis.__assign||function(){return Yg=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Yg.apply(this,arguments)},z7e=function(t,e){var n=xi(),r=Lu();M.exports.useImperativeHandle(t,function(){return Yg(Yg(Yg({},e),n),{treeEnvironmentContext:n,dragAndDropContext:r})})},uW=globalThis&&globalThis.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t},Cee=M.exports.createContext(null),L7e=function(){return M.exports.useContext(Cee)},N7e=M.exports.forwardRef(function(t,e){var n=xi(),r=n.onCollapseItem,i=n.items;n.trees;var o=n.viewState,s=n.onExpandItem,a=n.onFocusItem,l=n.setActiveTree,c=n.onRenameItem,u=n.onSelectItems,f=n.onPrimaryAction,h=n.linearItems,d=Lu(),O=d.abortProgrammaticDrag,b=d.completeProgrammaticDrag,v=d.programmaticDragDown,p=d.programmaticDragUp,g=d.startProgrammaticDrag,y={abortProgrammaticDrag:M.exports.useCallback(function(){O()},[O]),collapseItem:M.exports.useCallback(function(S,w){r==null||r(i[S],w)},[i,r]),completeProgrammaticDrag:M.exports.useCallback(function(){b()},[b]),expandItem:M.exports.useCallback(function(S,w){s==null||s(i[S],w)},[i,s]),focusItem:M.exports.useCallback(function(S,w){a==null||a(i[S],w)},[i,a]),focusTree:M.exports.useCallback(function(S,w){w===void 0&&(w=!0),l(S,w)},[l]),moveFocusDown:M.exports.useCallback(function(S){var w=h[S],T=w.findIndex(function(L){var $,E=L.item;return E===(($=o[S])===null||$===void 0?void 0:$.focusedItem)}),k=T!==void 0?Math.min(w.length-1,T+1):0,A=i[w[k].item];a==null||a(A,S)},[i,h,a,o]),moveFocusUp:M.exports.useCallback(function(S){var w=h[S],T=w.findIndex(function(L){var $,E=L.item;return E===(($=o[S])===null||$===void 0?void 0:$.focusedItem)}),k=T!==void 0?Math.max(0,T-1):0,A=i[w[k].item];a==null||a(A,S)},[i,h,a,o]),moveProgrammaticDragPositionDown:M.exports.useCallback(function(){v()},[v]),moveProgrammaticDragPositionUp:M.exports.useCallback(function(){p()},[p]),renameItem:M.exports.useCallback(function(S,w,T){c==null||c(i[S],w,T)},[i,c]),selectItems:M.exports.useCallback(function(S,w){u==null||u(S,w)},[u]),startProgrammaticDrag:M.exports.useCallback(function(){g()},[g]),toggleItemExpandedState:M.exports.useCallback(function(S,w){var T,k;!((k=(T=o[w])===null||T===void 0?void 0:T.expandedItems)===null||k===void 0)&&k.includes(S)?r==null||r(i[S],w):s==null||s(i[S],w)},[i,r,s,o]),toggleItemSelectStatus:M.exports.useCallback(function(S,w){var T,k,A,L,$;!((k=(T=o[w])===null||T===void 0?void 0:T.selectedItems)===null||k===void 0)&&k.includes(S)?u==null||u((L=(A=o[w].selectedItems)===null||A===void 0?void 0:A.filter(function(E){return E!==S}))!==null&&L!==void 0?L:[],w):u==null||u(uW(uW([],($=o[w].selectedItems)!==null&&$!==void 0?$:[]),[S]),w)},[u,o]),invokePrimaryAction:M.exports.useCallback(function(S,w){f==null||f(i[S],w)},[i,f])};return z7e(e,y),M.exports.createElement(Cee.Provider,{value:y},t.children)}),M7e=function(t){if(!!t)if(t.scrollIntoViewIfNeeded)t.scrollIntoViewIfNeeded();else{var e=t.getBoundingClientRect(),n=e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth);n||t.scrollIntoView()}},Za=globalThis&&globalThis.__assign||function(){return Za=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Za.apply(this,arguments)},cd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.filter(function(n){return!!n}).join(" ")},D7e=function(t){return{renderItemTitle:function(e){var n=e.title,r=e.context,i=e.info;if(!i.isSearching||!r.isSearchMatching)return Xt.createElement(Xt.Fragment,null,n);var o=n.toLowerCase().indexOf(i.search.toLowerCase());return Xt.createElement(Xt.Fragment,null,o>0&&Xt.createElement("span",null,n.slice(0,o)),Xt.createElement("span",{className:"rct-tree-item-search-highlight"},n.slice(o,o+i.search.length)),o+i.search.length<n.length&&Xt.createElement("span",null,n.slice(o+i.search.length,n.length)))},renderItemArrow:function(e){var n=e.item,r=e.context;return Xt.createElement("div",Za({className:cd(n.hasChildren&&"rct-tree-item-arrow-hasChildren","rct-tree-item-arrow")},r.arrowProps),n.hasChildren&&(r.isExpanded?Xt.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 16 16",enableBackground:"new 0 0 16 16",xmlSpace:"preserve"},Xt.createElement("g",null,Xt.createElement("g",null,Xt.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:`M12,5c-0.28,0-0.53,0.11-0.71,0.29L8,8.59L4.71,5.29C4.53,5.11,4.28,5,4,5
|
|
482
|
+
Url: ${i4(t)}`),!0)}function E$e(t,e){return!e||!e.length?!1:A$e(t).some(n=>e.some(r=>Bv(n,r)))}function C$e(t,e){if(!e||!e.length)return!1;const n=i4(t);return n?e.some(r=>Bv(n,r)):!1}function R$e(t,e){if(!e||!e.length)return!0;const n=i4(t);return n?e.some(r=>Bv(n,r)):!0}function A$e(t){if(t.message)return[t.message];if(t.exception)try{const{type:e="",value:n=""}=t.exception.values&&t.exception.values[0]||{};return[`${n}`,`${e}: ${n}`]}catch{return(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.error(`Cannot extract message for event ${mp(t)}`),[]}return[]}function I$e(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function z$e(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function i4(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?z$e(e):null}catch{return(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.error(`Cannot extract url for event ${mp(t)}`),null}}function fee(t,e){const n=cR(t,e),r={type:e&&e.name,value:D$e(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function L$e(t,e,n,r){const o=co().getClient(),s=o&&o.getOptions().normalizeDepth,a={exception:{values:[{type:JC(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:`Non-Error ${r?"promise rejection":"exception"} captured with keys: ${d8e(e)}`}]},extra:{__serialized__:nee(e,s)}};if(n){const l=cR(t,n);l.length&&(a.exception.values[0].stacktrace={frames:l})}return a}function sP(t,e){return{exception:{values:[fee(t,e)]}}}function cR(t,e){const n=e.stacktrace||e.stack||"",r=M$e(e);try{return t(n,r)}catch{}return[]}const N$e=/Minified React error #\d+;/i;function M$e(t){if(t){if(typeof t.framesToPop=="number")return t.framesToPop;if(N$e.test(t.message))return 1}return 0}function D$e(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function X$e(t,e,n,r){const i=n&&n.syntheticException||void 0,o=uR(t,e,i,r);return Yv(o),o.level="error",n&&n.event_id&&(o.event_id=n.event_id),Mp(o)}function W$e(t,e,n="info",r,i){const o=r&&r.syntheticException||void 0,s=r8(t,e,o,i);return s.level=n,r&&r.event_id&&(s.event_id=r.event_id),Mp(s)}function uR(t,e,n,r,i){let o;if(YJ(e)&&e.error)return sP(t,e.error);if(LX(e)||KQe(e)){const s=e;if("stack"in e)o=sP(t,e);else{const a=s.name||(LX(s)?"DOMError":"DOMException"),l=s.message?`${a}: ${s.message}`:a;o=r8(t,l,n,r),HQ(o,l)}return"code"in s&&(o.tags={...o.tags,"DOMException.code":`${s.code}`}),o}return BJ(e)?sP(t,e):n0(e)||JC(e)?(o=L$e(t,e,n,i),Yv(o,{synthetic:!0}),o):(o=r8(t,e,n,r),HQ(o,`${e}`,void 0),Yv(o,{synthetic:!0}),o)}function r8(t,e,n,r){const i={message:e};if(r&&n){const o=cR(t,n);o.length&&(i.exception={values:[{value:e,stacktrace:{frames:o}}]})}return i}const dee="Breadcrumbs";class Vv{static __initStatic(){this.id=dee}__init(){this.name=Vv.id}constructor(e){Vv.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){this.options.console&&Ja("console",q$e),this.options.dom&&Ja("dom",U$e(this.options.dom)),this.options.xhr&&Ja("xhr",B$e),this.options.fetch&&Ja("fetch",Y$e),this.options.history&&Ja("history",F$e)}}Vv.__initStatic();function U$e(t){function e(n){let r,i=typeof t=="object"?t.serializeAttribute:void 0;typeof i=="string"&&(i=[i]);try{r=n.event.target?qv(n.event.target,i):qv(n.event,i)}catch{r="<unknown>"}r.length!==0&&co().addBreadcrumb({category:`ui.${n.name}`,message:r},{event:n.event,name:n.name,global:n.global})}return e}function q$e(t){const e={category:"console",data:{arguments:t.args,logger:"console"},level:X8e(t.level),message:MX(t.args," ")};if(t.level==="assert")if(t.args[0]===!1)e.message=`Assertion failed: ${MX(t.args.slice(1)," ")||"console.assert"}`,e.data.arguments=t.args.slice(1);else return;co().addBreadcrumb(e,{input:t.args,level:t.level})}function B$e(t){if(t.endTimestamp){if(t.xhr.__sentry_own_request__)return;const{method:e,url:n,status_code:r,body:i}=t.xhr.__sentry_xhr__||{};co().addBreadcrumb({category:"xhr",data:{method:e,url:n,status_code:r},type:"http"},{xhr:t.xhr,input:i});return}}function Y$e(t){!t.endTimestamp||t.fetchData.url.match(/sentry_key/)&&t.fetchData.method==="POST"||(t.error?co().addBreadcrumb({category:"fetch",data:t.fetchData,level:"error",type:"http"},{data:t.error,input:t.args}):co().addBreadcrumb({category:"fetch",data:{...t.fetchData,status_code:t.response.status},type:"http"},{input:t.args,response:t.response}))}function F$e(t){let e=t.from,n=t.to;const r=iP(bt.location.href);let i=iP(e);const o=iP(n);i.path||(i=r),r.protocol===o.protocol&&r.host===o.host&&(n=o.relative),r.protocol===i.protocol&&r.host===i.host&&(e=i.relative),co().addBreadcrumb({category:"navigation",data:{from:e,to:n}})}class j$e extends d1{constructor(e){e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:HX}],version:HX},super(e),e.sendClientReports&&bt.document&&bt.document.addEventListener("visibilitychange",()=>{bt.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,n){return X$e(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return W$e(this._options.stackParser,e,n,r,this._options.attachStacktrace)}sendEvent(e,n){const r=this.getIntegrationById(dee);r&&r.options&&r.options.sentry&&co().addBreadcrumb({category:`sentry.${e.type==="transaction"?"transaction":"event"}`,event_id:e.event_id,level:e.level,message:mp(e)},{event:e}),super.sendEvent(e,n)}_prepareEvent(e,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r)}_flushOutcomes(){const e=this._clearOutcomes();if(e.length===0){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("No outcomes to send");return}if(!this._dsn){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("No dsn provided, will not send outcomes");return}(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("Sending outcomes:",e);const n=lee(this._dsn,this._options),r=V8e(e,this._options.tunnel&&nR(this._dsn));try{Object.prototype.toString.call(bt&&bt.navigator)==="[object Navigator]"&&typeof bt.navigator.sendBeacon=="function"&&!this._options.transportOptions?bt.navigator.sendBeacon.bind(bt.navigator)(n,ree(r)):this._sendEnvelope(r)}catch(i){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.error(i)}}}let j5;function Z$e(){if(j5)return j5;if(GQ(bt.fetch))return j5=bt.fetch.bind(bt);const t=bt.document;let e=bt.fetch;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(e=r.fetch),t.head.removeChild(n)}catch(n){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return j5=e.bind(bt)}function V$e(t,e=Z$e()){function n(r){const i={body:r.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:r.body.length<=65536,...t.fetchOptions};return e(t.url,i).then(o=>({statusCode:o.status,headers:{"x-sentry-rate-limits":o.headers.get("X-Sentry-Rate-Limits"),"retry-after":o.headers.get("Retry-After")}}))}return uee(t,n)}const G$e=4;function H$e(t){function e(n){return new ea((r,i)=>{const o=new XMLHttpRequest;o.onerror=i,o.onreadystatechange=()=>{o.readyState===G$e&&r({statusCode:o.status,headers:{"x-sentry-rate-limits":o.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":o.getResponseHeader("Retry-After")}})},o.open("POST",t.url);for(const s in t.headers)Object.prototype.hasOwnProperty.call(t.headers,s)&&o.setRequestHeader(s,t.headers[s]);o.send(n.body)})}return uee(t,e)}const k_="?",K$e=30,J$e=40,eEe=50;function fR(t,e,n,r){const i={filename:t,function:e,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}const tEe=/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,nEe=/\((\S*)(?::(\d+))(?::(\d+))\)/,rEe=t=>{const e=tEe.exec(t);if(e){if(e[2]&&e[2].indexOf("eval")===0){const o=nEe.exec(e[2]);o&&(e[2]=o[1],e[3]=o[2],e[4]=o[3])}const[r,i]=hee(e[1]||k_,e[2]);return fR(i,r,e[3]?+e[3]:void 0,e[4]?+e[4]:void 0)}},iEe=[K$e,rEe],oEe=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|safari-extension|safari-web-extension|capacitor)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,sEe=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,aEe=t=>{const e=oEe.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const o=sEe.exec(e[3]);o&&(e[1]=e[1]||"eval",e[3]=o[1],e[4]=o[2],e[5]="")}let r=e[3],i=e[1]||k_;return[i,r]=hee(i,r),fR(r,i,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},lEe=[eEe,aEe],cEe=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,uEe=t=>{const e=cEe.exec(t);return e?fR(e[2],e[1]||k_,+e[3],e[4]?+e[4]:void 0):void 0},fEe=[J$e,uEe],dEe=[iEe,lEe,fEe],hEe=KJ(...dEe),hee=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:k_,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]};let i8=0;function pee(){return i8>0}function pEe(){i8+=1,setTimeout(()=>{i8-=1})}function i0(t,e={},n){if(typeof t!="function")return t;try{const i=t.__sentry_wrapped__;if(i)return i;if(iR(t))return t}catch{return t}const r=function(){const i=Array.prototype.slice.call(arguments);try{n&&typeof n=="function"&&n.apply(this,arguments);const o=i.map(s=>i0(s,e));return t.apply(this,o)}catch(o){throw pEe(),d$e(s=>{s.addEventProcessor(a=>(e.mechanism&&(HQ(a,void 0,void 0),Yv(a,e.mechanism)),a.extra={...a.extra,arguments:i},a)),f$e(o)}),o}};try{for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}catch{}GJ(r,t),rR(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}class oh{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=oh.id}__init2(){this._installFunc={onerror:OEe,onunhandledrejection:mEe}}constructor(e){oh.prototype.__init.call(this),oh.prototype.__init2.call(this),this._options={onerror:!0,onunhandledrejection:!0,...e}}setupOnce(){Error.stackTraceLimit=50;const e=this._options;for(const n in e){const r=this._installFunc[n];r&&e[n]&&(yEe(n),r(),this._installFunc[n]=void 0)}}}oh.__initStatic();function OEe(){Ja("error",t=>{const[e,n,r]=gee();if(!e.getIntegration(oh))return;const{msg:i,url:o,line:s,column:a,error:l}=t;if(pee()||l&&l.__sentry_own_request__)return;const c=l===void 0&&Np(i)?vEe(i,o,s,a):Oee(uR(n,l||i,void 0,r,!1),o,s,a);c.level="error",mee(e,l,c,"onerror")})}function mEe(){Ja("unhandledrejection",t=>{const[e,n,r]=gee();if(!e.getIntegration(oh))return;let i=t;try{"reason"in t?i=t.reason:"detail"in t&&"reason"in t.detail&&(i=t.detail.reason)}catch{}if(pee()||i&&i.__sentry_own_request__)return!0;const o=FJ(i)?gEe(i):uR(n,i,void 0,r,!0);o.level="error",mee(e,i,o,"onunhandledrejection")})}function gEe(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function vEe(t,e,n,r){const i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let o=YJ(t)?t.message:t,s="Error";const a=o.match(i);return a&&(s=a[1],o=a[2]),Oee({exception:{values:[{type:s,value:o}]}},e,n,r)}function Oee(t,e,n,r){const i=t.exception=t.exception||{},o=i.values=i.values||[],s=o[0]=o[0]||{},a=s.stacktrace=s.stacktrace||{},l=a.frames=a.frames||[],c=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,f=Np(e)&&e.length>0?e:r8e();return l.length===0&&l.push({colno:c,filename:f,function:"?",in_app:!0,lineno:u}),t}function yEe(t){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`Global Handler attached: ${t}`)}function mee(t,e,n,r){Yv(n,{handled:!1,type:r}),t.captureEvent(n,{originalException:e})}function gee(){const t=co(),e=t.getClient(),n=e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[t,n.stackParser,n.attachStacktrace]}const bEe=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class Gv{static __initStatic(){this.id="TryCatch"}__init(){this.name=Gv.id}constructor(e){Gv.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){this._options.setTimeout&&Us(bt,"setTimeout",JX),this._options.setInterval&&Us(bt,"setInterval",JX),this._options.requestAnimationFrame&&Us(bt,"requestAnimationFrame",xEe),this._options.XMLHttpRequest&&"XMLHttpRequest"in bt&&Us(XMLHttpRequest.prototype,"send",SEe);const e=this._options.eventTarget;e&&(Array.isArray(e)?e:bEe).forEach(wEe)}}Gv.__initStatic();function JX(t){return function(...e){const n=e[0];return e[0]=i0(n,{mechanism:{data:{function:hh(t)},handled:!0,type:"instrument"}}),t.apply(this,e)}}function xEe(t){return function(e){return t.apply(this,[i0(e,{mechanism:{data:{function:"requestAnimationFrame",handler:hh(t)},handled:!0,type:"instrument"}})])}}function SEe(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in n&&typeof n[i]=="function"&&Us(n,i,function(o){const s={mechanism:{data:{function:i,handler:hh(o)},handled:!0,type:"instrument"}},a=iR(o);return a&&(s.mechanism.data.handler=hh(a)),i0(o,s)})}),t.apply(this,e)}}function wEe(t){const e=bt,n=e[t]&&e[t].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(Us(n,"addEventListener",function(r){return function(i,o,s){try{typeof o.handleEvent=="function"&&(o.handleEvent=i0(o.handleEvent,{mechanism:{data:{function:"handleEvent",handler:hh(o),target:t},handled:!0,type:"instrument"}}))}catch{}return r.apply(this,[i,i0(o,{mechanism:{data:{function:"addEventListener",handler:hh(o),target:t},handled:!0,type:"instrument"}}),s])}}),Us(n,"removeEventListener",function(r){return function(i,o,s){const a=o;try{const l=a&&a.__sentry_wrapped__;l&&r.call(this,i,l,s)}catch{}return r.call(this,i,a,s)}}))}const _Ee="cause",TEe=5;class $1{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=$1.id}constructor(e={}){$1.prototype.__init.call(this),this._key=e.key||_Ee,this._limit=e.limit||TEe}setupOnce(){const e=co().getClient();!e||sR((n,r)=>{const i=co().getIntegration($1);return i?kEe(e.getOptions().stackParser,i._key,i._limit,n,r):n})}}$1.__initStatic();function kEe(t,e,n,r,i){if(!r.exception||!r.exception.values||!i||!Eu(i.originalException,Error))return r;const o=vee(t,n,i.originalException,e);return r.exception.values=[...o,...r.exception.values],r}function vee(t,e,n,r,i=[]){if(!Eu(n[r],Error)||i.length+1>=e)return i;const o=fee(t,n[r]);return vee(t,e,n[r],r,[o,...i])}class E1{constructor(){E1.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=E1.id}setupOnce(){sR(e=>{if(co().getIntegration(E1)){if(!bt.navigator&&!bt.location&&!bt.document)return e;const n=e.request&&e.request.url||bt.location&&bt.location.href,{referrer:r}=bt.document||{},{userAgent:i}=bt.navigator||{},o={...e.request&&e.request.headers,...r&&{Referer:r},...i&&{"User-Agent":i}},s={...n&&{url:n},headers:o};return{...e,request:s}}return e})}}E1.__initStatic();class C1{constructor(){C1.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=C1.id}setupOnce(e,n){const r=i=>{const o=n().getIntegration(C1);if(o){try{if(PEe(i,o._previousEvent))return(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{return o._previousEvent=i}return o._previousEvent=i}return i};r.id=this.name,e(r)}}C1.__initStatic();function PEe(t,e){return e?!!(QEe(t,e)||$Ee(t,e)):!1}function QEe(t,e){const n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!bee(t,e)||!yee(t,e))}function $Ee(t,e){const n=eW(e),r=eW(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!bee(t,e)||!yee(t,e))}function yee(t,e){let n=tW(t),r=tW(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let i=0;i<r.length;i++){const o=r[i],s=n[i];if(o.filename!==s.filename||o.lineno!==s.lineno||o.colno!==s.colno||o.function!==s.function)return!1}return!0}function bee(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function eW(t){return t.exception&&t.exception.values&&t.exception.values[0]}function tW(t){const e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch{return}}const EEe=[new Q1,new Zv,new Gv,new Vv,new oh,new $1,new C1,new E1];function CEe(t={}){t.defaultIntegrations===void 0&&(t.defaultIntegrations=EEe),t.release===void 0&&bt.SENTRY_RELEASE&&bt.SENTRY_RELEASE.id&&(t.release=bt.SENTRY_RELEASE.id),t.autoSessionTracking===void 0&&(t.autoSessionTracking=!0),t.sendClientReports===void 0&&(t.sendClientReports=!0);const e={...t,stackParser:O8e(t.stackParser||hEe),integrations:S$e(t),transport:t.transport||(JJ()?V$e:H$e)};T$e(j$e,e),t.autoSessionTracking&&REe()}function nW(t){t.startSession({ignoreDuration:!0}),t.captureSession()}function REe(){if(typeof bt.document=="undefined"){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}const t=co();!t.captureSession||(nW(t),Ja("history",({from:e,to:n})=>{e===void 0||e===n||nW(co())}))}function dR(t){const e=co().getClient(),n=t||e&&e.getOptions();return!!n&&("tracesSampleRate"in n||"tracesSampler"in n)}function tb(t){const n=(t||co()).getScope();return n&&n.getTransaction()}function gs(t){return t/1e3}function AEe(){Ja("error",rW),Ja("unhandledrejection",rW)}function rW(){const t=tb();if(t){const e="internal_error";(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Tracing] Transaction: ${e} -> Global error occured`),t.setStatus(e)}}class P_{__init(){this.spans=[]}constructor(e=1e3){P_.prototype.__init.call(this),this._maxlen=e}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}}class Sd{__init2(){this.traceId=rh()}__init3(){this.spanId=rh().substring(16)}__init4(){this.startTimestamp=Fv()}__init5(){this.tags={}}__init6(){this.data={}}constructor(e){if(Sd.prototype.__init2.call(this),Sd.prototype.__init3.call(this),Sd.prototype.__init4.call(this),Sd.prototype.__init5.call(this),Sd.prototype.__init6.call(this),!e)return this;e.traceId&&(this.traceId=e.traceId),e.spanId&&(this.spanId=e.spanId),e.parentSpanId&&(this.parentSpanId=e.parentSpanId),"sampled"in e&&(this.sampled=e.sampled),e.op&&(this.op=e.op),e.description&&(this.description=e.description),e.data&&(this.data=e.data),e.tags&&(this.tags=e.tags),e.status&&(this.status=e.status),e.startTimestamp&&(this.startTimestamp=e.startTimestamp),e.endTimestamp&&(this.endTimestamp=e.endTimestamp)}startChild(e){const n=new Sd({...e,parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId});if(n.spanRecorder=this.spanRecorder,n.spanRecorder&&n.spanRecorder.add(n),n.transaction=this.transaction,(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&n.transaction){const r=e&&e.op||"< unknown op >",i=n.transaction.name||"< unknown name >",o=n.transaction.spanId,s=`[Tracing] Starting '${r}' span on transaction '${i}' (${o}).`;n.transaction.metadata.spanMetadata[n.spanId]={logMessage:s},wt.log(s)}return n}setTag(e,n){return this.tags={...this.tags,[e]:n},this}setData(e,n){return this.data={...this.data,[e]:n},this}setStatus(e){return this.status=e,this}setHttpStatus(e){this.setTag("http.status_code",String(e));const n=IEe(e);return n!=="unknown_error"&&this.setStatus(n),this}isSuccess(){return this.status==="ok"}finish(e){if((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&this.transaction&&this.transaction.spanId!==this.spanId){const{logMessage:n}=this.transaction.metadata.spanMetadata[this.spanId];n&&wt.log(n.replace("Starting","Finishing"))}this.endTimestamp=typeof e=="number"?e:Fv()}toTraceparent(){let e="";return this.sampled!==void 0&&(e=this.sampled?"-1":"-0"),`${this.traceId}-${this.spanId}${e}`}toContext(){return nh({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})}updateWithContext(e){return this.data=Rd(e.data,()=>({})),this.description=e.description,this.endTimestamp=e.endTimestamp,this.op=e.op,this.parentSpanId=e.parentSpanId,this.sampled=e.sampled,this.spanId=Rd(e.spanId,()=>this.spanId),this.startTimestamp=Rd(e.startTimestamp,()=>this.startTimestamp),this.status=e.status,this.tags=Rd(e.tags,()=>({})),this.traceId=Rd(e.traceId,()=>this.traceId),this}getTraceContext(){return nh({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})}toJSON(){return nh({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId})}}function IEe(t){if(t<400&&t>=100)return"ok";if(t>=400&&t<500)switch(t){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(t>=500&&t<600)switch(t){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}class Hv extends Sd{__init(){this._measurements={}}__init2(){this._frozenDynamicSamplingContext=void 0}constructor(e,n){super(e),Hv.prototype.__init.call(this),Hv.prototype.__init2.call(this),this._hub=n||co(),this._name=e.name||"",this.metadata={source:"custom",...e.metadata,spanMetadata:{},changes:[],propagations:0},this._trimEnd=e.trimEnd,this.transaction=this;const r=this.metadata.dynamicSamplingContext;r&&(this._frozenDynamicSamplingContext={...r})}get name(){return this._name}set name(e){this.setName(e)}setName(e,n="custom"){(e!==this.name||n!==this.metadata.source)&&this.metadata.changes.push({source:this.metadata.source,timestamp:__(),propagations:this.metadata.propagations}),this._name=e,this.metadata.source=n}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new P_(e)),this.spanRecorder.add(this)}setMeasurement(e,n,r=""){this._measurements[e]={value:n,unit:r}}setMetadata(e){this.metadata={...this.metadata,...e}}finish(e){if(this.endTimestamp!==void 0)return;if(this.name||((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),super.finish(e),this.sampled!==!0){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled.");const s=this._hub.getClient();s&&s.recordDroppedEvent("sample_rate","transaction");return}const n=this.spanRecorder?this.spanRecorder.spans.filter(s=>s!==this&&s.endTimestamp):[];this._trimEnd&&n.length>0&&(this.endTimestamp=n.reduce((s,a)=>s.endTimestamp&&a.endTimestamp?s.endTimestamp>a.endTimestamp?s:a:s).endTimestamp);const r=this.metadata,i={contexts:{trace:this.getTraceContext()},spans:n,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:{...r,dynamicSamplingContext:this.getDynamicSamplingContext()},...r.source&&{transaction_info:{source:r.source,changes:r.changes,propagations:r.propagations}}};return Object.keys(this._measurements).length>0&&((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),i.measurements=this._measurements),(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),this._hub.captureEvent(i)}toContext(){const e=super.toContext();return nh({...e,name:this.name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this.name=Rd(e.name,()=>""),this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;const e=this._hub||co(),n=e&&e.getClient();if(!n)return{};const{environment:r,release:i}=n.getOptions()||{},{publicKey:o}=n.getDsn()||{},s=this.metadata.sampleRate,a=s!==void 0?s.toString():void 0,l=e.getScope(),{segment:c}=l&&l.getUser()||{},u=this.metadata.source,f=u&&u!=="url"?this.name:void 0;return nh({environment:r,release:i,transaction:f,user_segment:c,public_key:o,trace_id:this.traceId,sample_rate:a})}}const xee=1e3,See=3e4,wee=5e3;class zEe extends P_{constructor(e,n,r,i){super(i),this._pushActivity=e,this._popActivity=n,this.transactionSpanId=r}add(e){e.spanId!==this.transactionSpanId&&(e.finish=n=>{e.endTimestamp=typeof n=="number"?n:Fv(),this._popActivity(e.spanId)},e.endTimestamp===void 0&&this._pushActivity(e.spanId)),super.add(e)}}class h1 extends Hv{__init(){this.activities={}}__init2(){this._heartbeatCounter=0}__init3(){this._finished=!1}__init4(){this._beforeFinishCallbacks=[]}constructor(e,n,r=xee,i=See,o=wee,s=!1){super(e,n),this._idleHub=n,this._idleTimeout=r,this._finalTimeout=i,this._heartbeatInterval=o,this._onScope=s,h1.prototype.__init.call(this),h1.prototype.__init2.call(this),h1.prototype.__init3.call(this),h1.prototype.__init4.call(this),s&&(iW(n),(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),n.configureScope(a=>a.setSpan(this))),this._startIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this.finish())},this._finalTimeout)}finish(e=Fv()){if(this._finished=!0,this.activities={},this.spanRecorder){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Tracing] finishing IdleTransaction",new Date(e*1e3).toISOString(),this.op);for(const n of this._beforeFinishCallbacks)n(this,e);this.spanRecorder.spans=this.spanRecorder.spans.filter(n=>{if(n.spanId===this.spanId)return!0;n.endTimestamp||(n.endTimestamp=e,n.setStatus("cancelled"),(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(n,void 0,2)));const r=n.startTimestamp<e;return r||(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Tracing] discarding Span since it happened after Transaction was finished",JSON.stringify(n,void 0,2)),r}),(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Tracing] flushing IdleTransaction")}else(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Tracing] No active IdleTransaction");return this._onScope&&iW(this._idleHub),super.finish(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){const n=i=>{this._finished||this._pushActivity(i)},r=i=>{this._finished||this._popActivity(i)};this.spanRecorder=new zEe(n,r,this.spanId,e),(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}_cancelIdleTimeout(){this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0)}_startIdleTimeout(e){this._cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&this.finish(e)},this._idleTimeout)}_pushActivity(e){this._cancelIdleTimeout(),(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Tracing] popActivity ${e}`),delete this.activities[e],(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){const n=Fv()+this._idleTimeout/1e3;this._startIdleTimeout(n)}}_beat(){if(this._finished)return;const e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter+=1:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this.finish()):this._pingHeartbeat()}_pingHeartbeat(){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}}function iW(t){const e=t.getScope();e&&e.getTransaction()&&e.setSpan(void 0)}function LEe(){const t=this.getScope();if(t){const e=t.getSpan();if(e)return{"sentry-trace":e.toTraceparent()}}return{}}function _ee(t,e,n){if(!dR(e))return t.sampled=!1,t;if(t.sampled!==void 0)return t.setMetadata({sampleRate:Number(t.sampled)}),t;let r;return typeof e.tracesSampler=="function"?(r=e.tracesSampler(n),t.setMetadata({sampleRate:Number(r)})):n.parentSampled!==void 0?r=n.parentSampled:(r=e.tracesSampleRate,t.setMetadata({sampleRate:Number(r)})),NEe(r)?r?(t.sampled=Math.random()<r,t.sampled?((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Tracing] starting ${t.op} transaction - ${t.name}`),t):((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`),t)):((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),t.sampled=!1,t):((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)}function NEe(t){return jJ(t)||!(typeof t=="number"||typeof t=="boolean")?((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`),!1):t<0||t>1?((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`),!1):!0}function MEe(t,e){const n=this.getClient(),r=n&&n.getOptions()||{};let i=new Hv(t,this);return i=_ee(i,r,{parentSampled:t.parentSampled,transactionContext:t,...e}),i.sampled&&i.initSpanRecorder(r._experiments&&r._experiments.maxSpans),i}function DEe(t,e,n,r,i,o,s){const a=t.getClient(),l=a&&a.getOptions()||{};let c=new h1(e,t,n,r,s,i);return c=_ee(c,l,{parentSampled:e.parentSampled,transactionContext:e,...o}),c.sampled&&c.initSpanRecorder(l._experiments&&l._experiments.maxSpans),c}function XEe(){const t=j0();!t.__SENTRY__||(t.__SENTRY__.extensions=t.__SENTRY__.extensions||{},t.__SENTRY__.extensions.startTransaction||(t.__SENTRY__.extensions.startTransaction=MEe),t.__SENTRY__.extensions.traceHeaders||(t.__SENTRY__.extensions.traceHeaders=LEe))}function WEe(){const t=j0();if(!t.__SENTRY__)return;const e={mongodb(){const r=Md(module,"./integrations/node/mongo");return new r.Mongo},mongoose(){const r=Md(module,"./integrations/node/mongo");return new r.Mongo({mongoose:!0})},mysql(){const r=Md(module,"./integrations/node/mysql");return new r.Mysql},pg(){const r=Md(module,"./integrations/node/postgres");return new r.Postgres}},n=Object.keys(e).filter(r=>!!I8e(r)).map(r=>{try{return e[r]()}catch{return}}).filter(r=>r);n.length>0&&(t.__SENTRY__.integrations=[...t.__SENTRY__.integrations||[],...n])}function UEe(){XEe(),oR()&&WEe(),AEe()}function qEe(){bt&&bt.document?bt.document.addEventListener("visibilitychange",()=>{const t=tb();if(bt.document.hidden&&t){const e="cancelled";(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${t.op}`),t.status||t.setStatus(e),t.setTag("visibilitychange","document.hidden"),t.finish()}}):(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const hR=(t,e,n)=>{let r;return i=>{e.value>=0&&(i||n)&&(e.delta=e.value-(r||0),(e.delta||r===void 0)&&(r=e.value,t(e)))}},BEe=()=>`v2-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,pR=(t,e)=>({name:t,value:Rd(e,()=>-1),delta:0,entries:[],id:BEe()}),Q_=(t,e)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){if(t==="first-input"&&!("PerformanceEventTiming"in self))return;const n=new PerformanceObserver(r=>r.getEntries().map(e));return n.observe({type:t,buffered:!0}),n}}catch{}},$_=(t,e)=>{const n=r=>{(r.type==="pagehide"||bt.document.visibilityState==="hidden")&&(t(r),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},YEe=(t,e)=>{const n=pR("CLS",0);let r,i=0,o=[];const s=l=>{if(l&&!l.hadRecentInput){const c=o[0],u=o[o.length-1];i&&o.length!==0&&l.startTime-u.startTime<1e3&&l.startTime-c.startTime<5e3?(i+=l.value,o.push(l)):(i=l.value,o=[l]),i>n.value&&(n.value=i,n.entries=o,r&&r())}},a=Q_("layout-shift",s);a&&(r=hR(t,n,e),$_(()=>{a.takeRecords().map(s),r(!0)}))};let Nx=-1;const FEe=()=>bt.document.visibilityState==="hidden"?0:1/0,jEe=()=>{$_(({timeStamp:t})=>{Nx=t},!0)},OR=()=>(Nx<0&&(Nx=FEe(),jEe()),{get firstHiddenTime(){return Nx}}),ZEe=(t,e)=>{const n=OR(),r=pR("FID");let i;const o=a=>{i&&a.startTime<n.firstHiddenTime&&(r.value=a.processingStart-a.startTime,r.entries.push(a),i(!0))},s=Q_("first-input",o);s&&(i=hR(t,r,e),$_(()=>{s.takeRecords().map(o),s.disconnect()},!0))},oW={},VEe=(t,e)=>{const n=OR(),r=pR("LCP");let i;const o=a=>{const l=a.startTime;l<n.firstHiddenTime&&(r.value=l,r.entries.push(a)),i&&i()},s=Q_("largest-contentful-paint",o);if(s){i=hR(t,r,e);const a=()=>{oW[r.id]||(s.takeRecords().map(o),s.disconnect(),oW[r.id]=!0,i(!0))};["keydown","click"].forEach(l=>{addEventListener(l,a,{once:!0,capture:!0})}),$_(a,!0)}};function aP(t){return typeof t=="number"&&isFinite(t)}function o0(t,{startTimestamp:e,...n}){return e&&t.startTimestamp>e&&(t.startTimestamp=e),t.startChild({startTimestamp:e,...n})}function Tee(){return bt&&bt.addEventListener&&bt.performance}let sW=0,io={},ou,Bg;function GEe(t=!1){const e=Tee();e&&jv&&(e.mark&&bt.performance.mark("sentry-tracing-init"),KEe(),JEe(t),e7e())}function HEe(){Q_("longtask",e=>{const n=tb();if(!n)return;const r=gs(jv+e.startTime),i=gs(e.duration);n.startChild({description:"Main UI thread blocked",op:"ui.long-task",startTimestamp:r,endTimestamp:r+i})})}function KEe(){YEe(t=>{const e=t.entries.pop();!e||((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Measurements] Adding CLS"),io.cls={value:t.value,unit:""},Bg=e)})}function JEe(t){VEe(e=>{const n=e.entries.pop();!n||((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Measurements] Adding LCP"),io.lcp={value:e.value,unit:"millisecond"},ou=n)},t)}function e7e(){ZEe(t=>{const e=t.entries.pop();if(!e)return;const n=gs(jv),r=gs(e.startTime);(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Measurements] Adding FID"),io.fid={value:t.value,unit:"millisecond"},io["mark.fid"]={value:n+r,unit:"second"}})}function t7e(t){const e=Tee();if(!e||!bt.performance.getEntries||!jv)return;(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Tracing] Adding & adjusting spans using Performance API");const n=gs(jv),r=e.getEntries();let i,o;if(r.slice(sW).forEach(s=>{const a=gs(s.startTime),l=gs(s.duration);if(!(t.op==="navigation"&&n+a<t.startTimestamp))switch(s.entryType){case"navigation":{r7e(t,s,n),i=n+gs(s.responseStart),o=n+gs(s.requestStart);break}case"mark":case"paint":case"measure":{n7e(t,s,a,l,n);const c=OR(),u=s.startTime<c.firstHiddenTime;s.name==="first-paint"&&u&&((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Measurements] Adding FP"),io.fp={value:s.startTime,unit:"millisecond"}),s.name==="first-contentful-paint"&&u&&((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Measurements] Adding FCP"),io.fcp={value:s.startTime,unit:"millisecond"});break}case"resource":{const c=s.name.replace(bt.location.origin,"");o7e(t,s,c,a,l,n);break}}}),sW=Math.max(r.length-1,0),s7e(t),t.op==="pageload"){typeof i=="number"&&((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Measurements] Adding TTFB"),io.ttfb={value:(i-t.startTimestamp)*1e3,unit:"millisecond"},typeof o=="number"&&o<=i&&(io["ttfb.requestTime"]={value:(i-o)*1e3,unit:"millisecond"})),["fcp","fp","lcp"].forEach(a=>{if(!io[a]||n>=t.startTimestamp)return;const l=io[a].value,c=n+gs(l),u=Math.abs((c-t.startTimestamp)*1e3),f=u-l;(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Measurements] Normalized ${a} from ${l} to ${u} (${f})`),io[a].value=u});const s=io["mark.fid"];s&&io.fid&&(o0(t,{description:"first input delay",endTimestamp:s.value+gs(io.fid.value),op:"ui.action",startTimestamp:s.value}),delete io["mark.fid"]),"fcp"in io||delete io.cls,Object.keys(io).forEach(a=>{t.setMeasurement(a,io[a].value,io[a].unit)}),a7e(t)}ou=void 0,Bg=void 0,io={}}function n7e(t,e,n,r,i){const o=i+n,s=o+r;return o0(t,{description:e.name,endTimestamp:s,op:e.entryType,startTimestamp:o}),o}function r7e(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Z5(t,e,r,n)}),Z5(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),Z5(t,e,"fetch",n,"cache","domainLookupStart"),Z5(t,e,"domainLookup",n,"DNS"),i7e(t,e,n)}function Z5(t,e,n,r,i,o){const s=o?e[o]:e[`${n}End`],a=e[`${n}Start`];!a||!s||o0(t,{op:"browser",description:Rd(i,()=>n),startTimestamp:r+gs(a),endTimestamp:r+gs(s)})}function i7e(t,e,n){o0(t,{op:"browser",description:"request",startTimestamp:n+gs(e.requestStart),endTimestamp:n+gs(e.responseEnd)}),o0(t,{op:"browser",description:"response",startTimestamp:n+gs(e.responseStart),endTimestamp:n+gs(e.responseEnd)})}function o7e(t,e,n,r,i,o){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;const s={};"transferSize"in e&&(s["Transfer Size"]=e.transferSize),"encodedBodySize"in e&&(s["Encoded Body Size"]=e.encodedBodySize),"decodedBodySize"in e&&(s["Decoded Body Size"]=e.decodedBodySize);const a=o+r,l=a+i;o0(t,{description:n,endTimestamp:l,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",startTimestamp:a,data:s})}function s7e(t){const e=bt.navigator;if(!e)return;const n=e.connection;n&&(n.effectiveType&&t.setTag("effectiveConnectionType",n.effectiveType),n.type&&t.setTag("connectionType",n.type),aP(n.rtt)&&(io["connection.rtt"]={value:n.rtt,unit:"millisecond"})),aP(e.deviceMemory)&&t.setTag("deviceMemory",`${e.deviceMemory} GB`),aP(e.hardwareConcurrency)&&t.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}function a7e(t){ou&&((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Measurements] Adding LCP Data"),ou.element&&t.setTag("lcp.element",qv(ou.element)),ou.id&&t.setTag("lcp.id",ou.id),ou.url&&t.setTag("lcp.url",ou.url.trim().slice(0,200)),t.setTag("lcp.size",ou.size)),Bg&&Bg.sources&&((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log("[Measurements] Adding CLS Data"),Bg.sources.forEach((e,n)=>t.setTag(`cls.source.${n+1}`,qv(e.node))))}const l7e=["localhost",/^\//],o4={traceFetch:!0,traceXHR:!0,tracingOrigins:l7e};function c7e(t){const{traceFetch:e,traceXHR:n,tracingOrigins:r,shouldCreateSpanForRequest:i}={...o4,...t},o={},s=c=>{if(o[c])return o[c];const u=r;return o[c]=u.some(f=>Bv(c,f))&&!Bv(c,"sentry_key"),o[c]};let a=s;typeof i=="function"&&(a=c=>s(c)&&i(c));const l={};e&&Ja("fetch",c=>{u7e(c,a,l)}),n&&Ja("xhr",c=>{d7e(c,a,l)})}function u7e(t,e,n){if(!dR()||!(t.fetchData&&e(t.fetchData.url)))return;if(t.endTimestamp){const i=t.fetchData.__span;if(!i)return;const o=n[i];o&&(t.response?o.setHttpStatus(t.response.status):t.error&&o.setStatus("internal_error"),o.finish(),delete n[i]);return}const r=tb();if(r){const i=r.startChild({data:{...t.fetchData,type:"fetch"},description:`${t.fetchData.method} ${t.fetchData.url}`,op:"http.client"});t.fetchData.__span=i.spanId,n[i.spanId]=i;const o=t.args[0];t.args[1]=t.args[1]||{};const s=t.args[1];s.headers=f7e(o,r.getDynamicSamplingContext(),i,s),r.metadata.propagations+=1}}function f7e(t,e,n,r){const i=oee(e),o=n.toTraceparent(),s=typeof Request!="undefined"&&Eu(t,Request)?t.headers:r.headers;if(s)if(typeof Headers!="undefined"&&Eu(s,Headers)){const a=new Headers(s);return a.append("sentry-trace",o),i&&a.append(n8,i),a}else if(Array.isArray(s)){const a=[...s,["sentry-trace",o]];return i&&a.push([n8,i]),a}else{const a="baggage"in s?s.baggage:void 0,l=[];return Array.isArray(a)?l.push(...a):a&&l.push(a),i&&l.push(i),{...s,"sentry-trace":o,baggage:l.length>0?l.join(","):void 0}}else return{"sentry-trace":o,baggage:i}}function d7e(t,e,n){if(!dR()||t.xhr&&t.xhr.__sentry_own_request__||!(t.xhr&&t.xhr.__sentry_xhr__&&e(t.xhr.__sentry_xhr__.url)))return;const r=t.xhr.__sentry_xhr__;if(t.endTimestamp){const o=t.xhr.__sentry_xhr_span_id__;if(!o)return;const s=n[o];s&&(s.setHttpStatus(r.status_code),s.finish(),delete n[o]);return}const i=tb();if(i){const o=i.startChild({data:{...r.data,type:"xhr",method:r.method,url:r.url},description:`${r.method} ${r.url}`,op:"http.client"});if(t.xhr.__sentry_xhr_span_id__=o.spanId,n[t.xhr.__sentry_xhr_span_id__]=o,t.xhr.setRequestHeader)try{t.xhr.setRequestHeader("sentry-trace",o.toTraceparent());const s=i.getDynamicSamplingContext(),a=oee(s);a&&t.xhr.setRequestHeader(n8,a),i.metadata.propagations+=1}catch{}}}function h7e(t,e=!0,n=!0){if(!bt||!bt.location){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn("Could not initialize routing instrumentation due to invalid location");return}let r=bt.location.href,i;e&&(i=t({name:bt.location.pathname,op:"pageload",metadata:{source:"url"}})),n&&Ja("history",({to:o,from:s})=>{if(s===void 0&&r&&r.indexOf(o)!==-1){r=void 0;return}s!==o&&(r=void 0,i&&((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Tracing] Finishing current transaction with op: ${i.op}`),i.finish()),i=t({name:bt.location.pathname,op:"navigation",metadata:{source:"url"}}))})}const p7e="BrowserTracing",O7e={idleTimeout:xee,finalTimeout:See,heartbeatInterval:wee,markBackgroundTransactions:!0,routingInstrumentation:h7e,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,_experiments:{enableLongTask:!0},...o4};class mR{__init(){this.name=p7e}constructor(e){mR.prototype.__init.call(this);let n=o4.tracingOrigins;e&&(e.tracingOrigins&&Array.isArray(e.tracingOrigins)?n=e.tracingOrigins:(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&(this._emitOptionsWarning=!0)),this.options={...O7e,...e,tracingOrigins:n};const{_metricOptions:r}=this.options;GEe(r&&r._reportAllChanges),h8e([this,"access",i=>i.options,"access",i=>i._experiments,"optionalAccess",i=>i.enableLongTask])&&HEe()}setupOnce(e,n){this._getCurrentHub=n,this._emitOptionsWarning&&((typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn("[Tracing] You need to define `tracingOrigins` in the options. Set an array of urls or patterns to trace."),(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn(`[Tracing] We added a reasonable default for you: ${o4.tracingOrigins}`));const{routingInstrumentation:r,startTransactionOnLocationChange:i,startTransactionOnPageLoad:o,markBackgroundTransactions:s,traceFetch:a,traceXHR:l,tracingOrigins:c,shouldCreateSpanForRequest:u}=this.options;r(f=>this._createRouteTransaction(f),o,i),s&&qEe(),c7e({traceFetch:a,traceXHR:l,tracingOrigins:c,shouldCreateSpanForRequest:u})}_createRouteTransaction(e){if(!this._getCurrentHub){(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`);return}const{beforeNavigate:n,idleTimeout:r,finalTimeout:i,heartbeatInterval:o}=this.options,s=e.op==="pageload",a=s?aW("sentry-trace"):null,l=s?aW("baggage"):null,c=a?B8e(a):void 0,u=l?r$e(l):void 0,f={...e,...c,metadata:{...e.metadata,dynamicSamplingContext:c&&!u?{}:u},trimEnd:!0},h=typeof n=="function"?n(f):f,d=h===void 0?{...f,sampled:!1}:h;d.metadata=d.name!==f.name?{...d.metadata,source:"custom"}:d.metadata,d.sampled===!1&&(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Tracing] Will not send ${d.op} transaction because of beforeNavigate.`),(typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__)&&wt.log(`[Tracing] Starting ${d.op} transaction on scope`);const O=this._getCurrentHub(),{location:b}=bt,v=DEe(O,d,r,i,!0,{location:b},o);return v.registerBeforeFinishCallback(p=>{t7e(p),p.setTag("sentry_reportAllChanges",Boolean(this.options._metricOptions&&this.options._metricOptions._reportAllChanges))}),v}}function aW(t){const e=i8e(`meta[name=${t}]`);return e?e.getAttribute("content"):null}(typeof __SENTRY_TRACING__=="undefined"||__SENTRY_TRACING__)&&UEe();const m7e=Ph(async()=>(await Promise.resolve().then(function(){return GCe})).FileTree),g7e=Ph(async()=>(await Promise.resolve().then(function(){return Hit})).Editor),v7e=Ph(async()=>(await Promise.resolve().then(function(){return est})).default),y7e=Ph(async()=>(await Promise.resolve().then(function(){return ost})).default),b7e=Ph(async()=>(await Promise.resolve().then(function(){return lst})).default),x7e=Ph(async()=>(await Promise.resolve().then(function(){return Ngt})).default),S7e=Ph(async()=>(await Promise.resolve().then(function(){return Ygt})).default);class w7e{constructor(e){St(this,"components",{Tree:null,Editor:null,Console:null,Browser:null,Shell:null,MarkdownPreview:null});St(this,"paasOptions");St(this,"paasDomainPath");St(this,"sdkVersion");St(this,"isRendered",!1);St(this,"markdownSchema",{});St(this,"socketParser","default");St(this,"i18nLanguage",jS.ZH);St(this,"themeType",YQ.dark);this.sdkVersion=f_e(),this.setPaasOptionsWithDefaultAvatar(e),this.setPaasDomainPathWithDefaultOrigin(e.paasDomain),this.themeType=e.themeType||YQ.dark,this.i18nLanguage=e.i18nLanguage||jS.ZH,this.init(),this.integratedSentry(e.enableSentry)}loadTheme(e){this.themeType=e,Ce.theme.setTheme(this.themeType,Fl.terminal),Ce.theme.setTheme(this.themeType,Fl.console),z_e(this.themeType)}integratedSentry(e=!1){!e||CEe({dsn:"https://7e40a817f13d4730b062e75687903544@o1334791.ingest.sentry.io/4504043835752448",integrations:[new mR],release:"d42paas-front@0.9.97",enabled:!0,environment:"production",tracesSampleRate:.02,beforeSend(n){var o;const r=((o=n==null?void 0:n.exception)==null?void 0:o.values)||[];let i=!0;return r.forEach(s=>{var l;const a=((l=s.stacktrace)==null?void 0:l.frames)||[];if(a.length){const c=a[a.length-1],u=(c==null?void 0:c.filename)||"";i=/daopaas/gi.test(u)}}),i?n:null}})}async init(){var s,a,l,c;this.reset(),this.loadTheme(this.themeType),(s=this.paasOptions.defaultOpenFiles)!=null&&s.length&&Ce.dao.defaultOpenFiles(this.paasOptions.defaultOpenFiles||""),Ce.dao.specialOpenFile(this.paasOptions.specialOpenFile||""),Ce.dao.setXtermStyle(this.paasOptions.xtermStyle),Ce.dao.isOpenDebugMode((a=this.paasOptions.isOpenDebugMode)!=null?a:!1),Ce.i18n.setLanguage(this.i18nLanguage),Qo.changeLanguage(this.i18nLanguage),Ce.dao.setIsLegacyMarkdownMath((c=(l=this.paasOptions)==null?void 0:l.isLegacyMarkdownMath)!=null?c:!1),Mt.debug(`sdk: init with ${this.paasDomainPath} passDomain`);const{url:e,userId:n,socketParser:r}=await d_e(this.paasDomainPath,this.paasOptions.ticket,this.sdkVersion);this.socketParser=r||"default",Ce.dao.openSocketBuffer(this.socketParser==="buffer");let i;try{i=await q4e(n)}catch{}const o=oe.dao.channel().visibilitychange;document.removeEventListener("visibilitychange",o),Ce.dao.reconnectMaxTimes(this.paasOptions.reconnectMaxTimes||10),oe.dao.channel().startChannel(e,{...this.paasOptions,agentUserId:i},{triggerEventForMaxTimespan:this.paasOptions.triggerEventForMaxTimespan,reconnectMaxTimes:this.paasOptions.reconnectMaxTimes,isInsertCrdt:this.paasOptions.isInsertCrdt,sockerParser:this.socketParser}),Mt.info(">>>registerVisiblityChangeEvent"),document.addEventListener("visibilitychange",o)}setPaasOptionsWithDefaultAvatar(e){this.paasOptions=e,this.paasOptions.userInfo.avatarUrl||(this.paasOptions.userInfo.avatarUrl=R9e(this.paasOptions.userInfo.username))}setPaasDomainPathWithDefaultOrigin(e){this.paasDomainPath={}.PAAS_MANAGER_API_ORIGIN||"https://www.1024paas.com",e&&(this.paasDomainPath=e)}reset(){oe.dao.channel().closeChannel(),rTe()}get playgroundStatus(){return oe.dao.playgroundInfo().status}get dockerStatus(){return oe.dao.playgroundInfo().runStatus}get currentAgentUser(){return oe.dao.currentAgentUser()}get agentUsers(){return oe.dao.playgroundInfo().agentUsers}get playgroundInfo(){return oe.dao.playgroundInfo()}get currentFollowingAgentUser(){return oe.dao.getFollowingAgentUser()}followUser(e){const n=oe.dao.playgroundInfo().agentUsers.find(r=>r.agentUserId===e);if(oe.dao.currentAgentUserId()===(n==null?void 0:n.followingAgentUserId)){const r=or("dao_paas_cannot_follow_each_other");ao.error(r);return}oe.dao.channel().followingAgentUser(e),n.fileOpened&&(Ce.file.docLoading(!0),oe.dao.channel().loadFile(n.fileOpened,"follow"))}unFollowUser(){oe.dao.channel().unFollowingAgentUser()}publishKeyEvent(e){oe.dao.channel().publishKeyEvent(e)}preparePlayback(){Ce.dao.setPlaygroundMode($u.playback),oe.dao.channel().getPlaybackInfo()}startPlayback(e){oe.dao.channel().startPlayback(e)}restartPlayback(e){oe.dao.channel().restartPlayback(e)}goToPlayback(e){oe.dao.channel().goToPlayback(e)}pausePlayback(){oe.dao.channel().pausePlayback()}stopPlayback(){Ce.dao.setPlaygroundMode($u.edit),oe.dao.channel().stopPlayback()}setRate(e){oe.dao.channel().setPlaybackRate(e)}activePlayground(){oe.dao.channel().active()}retainingAllFiles(){return oe.dao.channel().retainingAllFiles(),oe.dao.channel().off("retainingAllFiles"),new Promise(e=>{oe.dao.channel().on("retainingAllFiles",n=>{e(n)})})}runPlayground(){return new Promise((e,n)=>{const r=oe.file.pendingUpdateCount();if(r>0)return n(this.handleErrorRes(or("editor_pending_update",{pendingUpdate:r})));oe.dao.channel().run(),e(this.handleSuccessRes("running"))})}stopPlayground(){oe.dao.channel().stop()}appendCustomizeFrameData(e){oe.dao.channel().appendCustomizeFrameData(e)}statisticsPlaybackData(e,n){return new Promise((r,i)=>{if(!oe.dao.isReady())return i(this.handleErrorRes("no ready"));if(!e||!(n!=null&&n.length)){r({status:"fail",message:"please input right parmas",errorCode:"ERROR_PARMAS"});return}oe.dao.channel().statisticsPlaybackData(e,n),oe.dao.channel().off("statisticsPlaybackData"),oe.dao.channel().on("statisticsPlaybackData",o=>{r({status:"success",data:o})})})}onMessage(e){oe.dao.channel().addMessageListener(e)}onError(e){oe.dao.channel().addErrorListener(e)}subscribePlayControlEvent(e){oe.dao.channel().subscribeForPlayControl(e)}unsubscribePlayControlEvent(e){oe.dao.channel().unsubscribeForPlayControl(e)}subscribe(e,n){oe.dao.channel().subscribeForComponent(e,n)}unsubscribe(e,n){oe.dao.channel().unsubscribeForComponent(e,n)}initComponent(e,n,r){const i=document.querySelector(n);if(!i)throw new Error(or("dao_paas_not_find_mount_dom_object_for_x",{x:n}));const o=Vw(i),s=a=>{switch(e){case"Tree":return de(m7e,{...a});case"Editor":return de(g7e,{...a});case"Browser":return de(y7e,{...a});case"Console":return de(v7e,{...a});case"Shell":return de(b7e,{...a});case"MarkdownPreview":return de(x7e,{...a});case"Debug":return de(S7e,{...a});default:throw new Error(or("dao_paas_x_component_is_not_supported",{x:e}))}};this.components[e]={reactComponent:s,container:n,props:r,root:o},o.render(de(M.exports.Suspense,{fallback:de(C9e,{}),children:de(s,{...r})}))}mountMarkdownPreview(){const{MarkdownPreview:e}=this.components;if(Mt.debug("markdown\u9884\u89C8\u7EC4\u4EF6\u6302\u8F7D\u4E2D",this.markdownSchema),e)Mt.debug("\u6302\u8F7D\u5931\u8D25\uFF0C\u8BF7\u52FF\u91CD\u590D\u6302\u8F7D\u540C\u4E00\u4E2A\u7EC4\u4EF6",this.markdownSchema);else if(Object.keys(this.markdownSchema).length>0){const{item:n,container:r,props:i}=this.markdownSchema;this.initComponent(n,r,i),Mt.debug("markdown\u9884\u89C8\u7EC4\u4EF6\u6302\u8F7D\u5B8C\u6210",this.markdownSchema)}}unMountMarkdownPreview(){var n;const{MarkdownPreview:e}=this.components;Mt.debug("markdown\u9884\u89C8\u7EC4\u4EF6\u5378\u8F7D\u4E2D",e),e?((n=e.root)==null||n.unmount(),this.components.MarkdownPreview=null,Mt.debug("markdown\u9884\u89C8\u7EC4\u4EF6\u5378\u8F7D\u6210\u529F",e)):Mt.debug("\u5378\u8F7D\u5931\u8D25\uFF0Cmarkdown\u9884\u89C8\u7EC4\u4EF6\u4E0D\u5B58\u5728",e)}mapRender(e){e.forEach((n,r)=>{const{item:i,container:o,props:s}=n;i==="MarkdownPreview"&&(this.markdownSchema=n,!s.isRender)||this.initComponent(i,o,s)})}handleErrorRes(e){return{status:!1,message:e}}handleSuccessRes(e){return{status:!0,message:e}}insertTextById(e,n,r){oe.dao.channel().insertTextById(e,n,r)}removeAreaTextById(e,n,r){oe.dao.channel().removeAreaTextById(e,n,r)}jumpToAreaById(e,n){oe.dao.channel().jumpToAreaById(e,n)}switchLanguage(e,n,r,i){return new Promise((o,s)=>{if(!oe.dao.isReady())return s(this.handleErrorRes(or("dao_paas_no_ready")));oe.dao.channel().switchLanguage(e,n,r,i),oe.dao.channel().off("switchLanguage"),oe.dao.channel().on("switchLanguage",a=>{const l=oe.file.getOpenedPath(),{destination:c}=a;a.status&&r===l&&(Ce.file.setDocLoading(!0),oe.dao.channel().loadFile(c),o(this.handleSuccessRes(or("common_success")))),o(a)})})}restartServer(){return new Promise((e,n)=>{if(!oe.dao.isReady())return n(this.handleErrorRes(or("dao_paas_no_ready")));oe.dao.channel().restartServer(),oe.dao.channel().off("restartServer"),oe.dao.channel().on("restartServer",r=>{const i={status:r.success,message:r.success?r.message||r.messageId:r.error};e(i)})})}restartLSPServer(){if(!oe.dao.isReady())return this.handleErrorRes(or("dao_paas_no_ready"));oe.dao.channel().restartLSPServer()}addCDNSource(e,n,r){return new Promise((i,o)=>{if(!oe.dao.isReady())return o(this.handleErrorRes(or("dao_paas_no_ready")));oe.dao.channel().addCDNSource(e,n,r),oe.dao.channel().off("addCDNSource"),oe.dao.channel().on("addCDNSource",s=>{const a=oe.file.getOpenedPath();s.status&&r===a&&this.openFile(r),i(s)})})}openFile(e){return new Promise((n,r)=>{if(!oe.dao.isReady())return r(this.handleErrorRes(or("dao_paas_no_ready")));IK(e)?(Ce.file.setDocLoading(!0),oe.dao.channel().loadFile(e),zK(e),n(this.handleSuccessRes(or("common_success")))):r(this.handleErrorRes(or("dao_paas_file_does_not_exist")))})}updateGlobalConfig(e){const n={...oe.dao.globalConfig(),...e};window.localStorage.setItem("paasGlobalConfig",JSON.stringify(n)),Ce.dao.globalConfig(n)}updateConfig(e){const n={...oe.dao.config(),...e};Ce.dao.config(n)}toggleMarkDownPreview(e){e?this.mountMarkdownPreview():this.unMountMarkdownPreview()}reload(e=["Editor","Tree"]){const n={file:()=>{Ce.dao.setPlaygroundInfo(qK),Ce.file.reset()}},r=(e==null?void 0:e.includes("Editor"))||(e==null?void 0:e.includes("Tree"))?"file":"";e&&r&&n[r]()}switchI18nLanguage(e){Ce.i18n.setLanguage(e),oe.dao.channel().emitI18nLanguage(e),Qo.changeLanguage(e)}reloadI18nResources(e,n){try{(Array.isArray(e)?e:[{language:e,resource:n}]).forEach(i=>{Qo.addResources(i.language,"translation",i.resource)}),Qo.changeLanguage(oe.i18n.getLanguage())}catch(r){Mt.error("\u66F4\u65B0\u56FD\u9645\u5316\u6587\u672C\u5931\u8D25\uFF0C\u9519\u8BEF:",r)}}debugRun(){oe.dao.channel().debugRun()}setFileStyle(e){try{Ce.file.setFileStyle(e)}catch(n){Mt.error("\u8BBE\u7F6E\u6587\u4EF6\u6837\u5F0F\u5931\u8D25\uFF0C\u9519\u8BEF:",n)}}syncXtermKey(e){oe.dao.getFollowingAgentUser()||oe.dao.channel().xtermStatus({xtermKey:e})}dispose(){var e;Mt.debug("destroy components...",this.components),this.reset();for(const[n,r]of Object.entries(this.components)){if(!r)break;(e=r.root)==null||e.unmount(),Mt.debug(`destroy unmount: ${r.container}`)}}loggerEnable(){j4e()}}var Qf;(function(t){t.DoubleClickItemToExpand="double-click-item-to-expand",t.ClickItemToExpand="click-item-to-expand",t.ClickArrowToExpand="click-arrow-to-expand"})(Qf||(Qf={}));var s4=globalThis&&globalThis.__assign||function(){return s4=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},s4.apply(this,arguments)},_7e=function(t,e){return{mode:t.mode,createInteractiveElementProps:function(n,r,i,o){return s4(s4({},e.createInteractiveElementProps(n,r,i,o)),t.createInteractiveElementProps(n,r,i,o))}}},gR=function(t){return t.ctrlKey||navigator.platform.toUpperCase().indexOf("MAC")>=0&&t.metaKey},T7e=function(){function t(e){this.mode=Qf.DoubleClickItemToExpand,this.environment=e}return t.prototype.createInteractiveElementProps=function(e,n,r,i){var o=this;return{onClick:function(s){r.focusItem(),s.shiftKey?r.selectUpTo():gR(s)?i.isSelected?r.unselectItem():r.addToSelectedItems():r.selectItem()},onDoubleClick:function(){r.focusItem(),r.selectItem(),e.hasChildren&&r.toggleExpandedState(),(!e.hasChildren||o.environment.canInvokePrimaryActionOnItemContainer)&&r.primaryAction()},onFocus:function(){r.focusItem()},onDragStart:function(s){s.dataTransfer.dropEffect="move",r.startDragging()},onDragOver:function(s){s.preventDefault()},draggable:i.canDrag&&!i.isRenaming,tabIndex:i.isRenaming?void 0:i.isFocused?0:-1}},t}(),k7e=function(){function t(e){this.mode=Qf.ClickItemToExpand,this.environment=e}return t.prototype.createInteractiveElementProps=function(e,n,r,i){var o=this;return{onClick:function(s){r.focusItem(),s.shiftKey?r.selectUpTo():gR(s)?i.isSelected?r.unselectItem():r.addToSelectedItems():(e.hasChildren&&r.toggleExpandedState(),r.selectItem(),(!e.hasChildren||o.environment.canInvokePrimaryActionOnItemContainer)&&r.primaryAction())},onFocus:function(){r.focusItem()},onDragStart:function(s){s.dataTransfer.dropEffect="move",r.startDragging()},onDragOver:function(s){s.preventDefault()},draggable:i.canDrag&&!i.isRenaming,tabIndex:i.isRenaming?void 0:i.isFocused?0:-1}},t}(),P7e=function(){function t(e){this.mode=Qf.ClickItemToExpand,this.environment=e}return t.prototype.createInteractiveElementProps=function(e,n,r,i){var o=this;return{onClick:function(s){r.focusItem(),s.shiftKey?r.selectUpTo():gR(s)?i.isSelected?r.unselectItem():r.addToSelectedItems():(r.selectItem(),(!e.hasChildren||o.environment.canInvokePrimaryActionOnItemContainer)&&r.primaryAction())},onFocus:function(){r.focusItem()},onDragStart:function(s){s.dataTransfer.dropEffect="move",r.startDragging()},onDragOver:function(s){s.preventDefault()},draggable:i.canDrag&&!i.isRenaming,tabIndex:i.isRenaming?void 0:i.isFocused?0:-1}},t}(),lW=function(t,e){switch(t){case Qf.DoubleClickItemToExpand:return new T7e(e);case Qf.ClickItemToExpand:return new k7e(e);case Qf.ClickArrowToExpand:return new P7e(e);default:throw Error("Unknown interaction mode "+t)}},kee=M.exports.createContext(null),Q7e=function(){return M.exports.useContext(kee)},$7e=function(t){var e=xi(),n=e.defaultInteractionMode,r=M.exports.useMemo(function(){var i;return n&&typeof n!="string"?n.extends?_7e(n,lW(n.extends,e)):n:lW((i=n)!==null&&i!==void 0?i:Qf.ClickItemToExpand,e)},[]);return M.exports.createElement(kee.Provider,{value:r},t.children)},Pee=function(){var t=xi();return M.exports.useCallback(function(e,n){for(var r=t.linearItems[n],i=r[e].depth,o=e;!!r[o]&&r[o].depth!==i-1;o--);var s=r[o];return s||(s={item:t.trees[n].rootItem,depth:0},o=0),s},[t.linearItems,t.trees])},E7e=function(t,e){return t.clientX<e.left||t.clientX>e.right||t.clientY<e.top||t.clientY>e.bottom},C7e=function(t,e,n,r,i){var o=(t-e)/n,s=Math.floor(o),a=void 0,l=r||i?.2:.5;return o%1<l?a="top":o%1>1-l&&(a="bottom"),{linearIndex:s,offset:a}},R7e=function(t,e,n,r,i){var o=xi(),s=o.canDropOnItemWithChildren,a=o.canDropOnItemWithoutChildren,l=o.canDragAndDrop,c=o.linearItems,u=o.items,f=o.canReorderItems,h=o.viewState,d=Pee();return M.exports.useCallback(function(O,b,v){var p,g,y,S;if(!!l&&!!v.current&&!(O.clientX<0||O.clientY<0)){var w=v.current.getBoundingClientRect(),T=E7e(O,w),k=C7e(O.clientY,w.top,n,s,a),A=k.linearIndex,L=k.offset,$=T?"outside":""+b+A+(L!=null?L:"");if(t!==$){if(e($),T){r(void 0);return}if(A<0||A>=c[b].length){r(void 0);return}var E=c[b][A],C=E.depth,I=u[E.item];if(!L&&!a&&!I.hasChildren){r(void 0);return}if(!L&&!s&&I.hasChildren){r(void 0);return}if(L&&!f){r(void 0);return}var H=d(A,b);if(!(!((g=(p=h[b])===null||p===void 0?void 0:p.selectedItems)===null||g===void 0)&&g.includes(E.item))){var Y=u[H.item].children.indexOf(E.item)+(L==="top"?0:1);L==="top"&&C===((S=(y=c[b][A-1])===null||y===void 0?void 0:y.depth)!==null&&S!==void 0?S:-1)&&(L="bottom",A-=1);var z;L?z={targetType:"between-items",treeId:b,parentItem:H.item,depth:E.depth,linearIndex:A+(L==="top"?0:1),childIndex:Y,linePosition:L}:z={targetType:"item",treeId:b,parentItem:H.item,targetItem:E.item,depth:E.depth,linearIndex:A},i(z)}}}},[l,s,a,f,d,n,u,t,c,r,i,e,h])},Qee=function(){var t=xi();return M.exports.useCallback(function(e,n){if(e.targetType==="between-items"){if(!t.canReorderItems)return!1}else{var r=t.items[e.targetItem];if(!t.canDropOnItemWithChildren&&r.hasChildren||!t.canDropOnItemWithoutChildren&&!r.hasChildren)return!1}return!(t.canDropAt&&(!n||!t.canDropAt(n,e)))},[t])},cW=globalThis&&globalThis.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t},A7e=function(){var t=xi(),e=Pee(),n=Qee();return M.exports.useCallback(function(r,i){var o=t.linearItems[r];return o.map(function(s,a){var l,c,u=s.item,f=s.depth,h=e(a,r),d=t.items[h.item].children.indexOf(u),O={targetType:"item",parentItem:h.item,targetItem:u,linearIndex:a,depth:f,treeId:r},b={targetType:"between-items",parentItem:h.item,linePosition:"top",childIndex:d,depth:f,treeId:r,linearIndex:a},v={targetType:"between-items",parentItem:h.item,linePosition:"bottom",linearIndex:a+1,childIndex:d+1,depth:f,treeId:r},p=f===((c=(l=o[a-1])===null||l===void 0?void 0:l.depth)!==null&&c!==void 0?c:-1);return p?[O,v]:[b,O,v]}).reduce(function(s,a){return cW(cW([],s),a)},[]).filter(function(s){return n(s,i)})},[n,t.items,t.linearItems,e])},V5=globalThis&&globalThis.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t},a4=function(t,e,n){var r=M.exports.useRef();M.exports.useEffect(function(){if(!r.current)r.current=V5([],n),t();else{var i=r.current.some(function(o,s){return o!==n[s]});i&&(r.current=V5([],n),t())}},V5(V5([],e),n))},l4=globalThis&&globalThis.__assign||function(){return l4=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},l4.apply(this,arguments)},$ee=function(t,e){return t.map(function(n){return[n,e(n)]}).reduce(function(n,r){var i,o=r[0],s=r[1];return l4(l4({},n),(i={},i[o]=s,i))},{})};function Z0(){var t=M.exports.useRef(new Array);M.exports.useEffect(function(){var n=t.current;return function(){return n.forEach(function(r){return cancelAnimationFrame(r)})}},[t]);var e=M.exports.useCallback(function(n){var r=requestAnimationFrame(function(){t.current.splice(t.current.indexOf(r),1),n()});t.current.push(r)},[t]);return e}var Eee=M.exports.createContext(null),Lu=function(){return M.exports.useContext(Eee)},I7e=function(t){var e=xi(),n=M.exports.useState(!1),r=n[0],i=n[1],o=M.exports.useState(4),s=o[0],a=o[1],l=M.exports.useState({}),c=l[0],u=l[1],f=M.exports.useState(0),h=f[0],d=f[1],O=M.exports.useState(),b=O[0],v=O[1],p=M.exports.useState(),g=p[0],y=p[1],S=M.exports.useState("_nodrag"),w=S[0],T=S[1],k=A7e(),A=Z0();M.exports.useRef(!1);var L=M.exports.useCallback(function(re,Te){var Re;if(e.activeTreeId&&((Re=e.viewState[e.activeTreeId])===null||Re===void 0?void 0:Re.focusedItem)&&e.linearItems&&Te){var V=e.viewState[e.activeTreeId].focusedItem,pe=k(e.activeTreeId,Te),J=pe.findIndex(function(ae){if(ae.targetType==="item")return ae.targetItem===V;if(ae.targetType==="between-items")return e.items[ae.parentItem].children[ae.childIndex]===V});d(J?Math.min(J+1,pe.length-1):0)}else d(0)},[e.activeTreeId,e.items,e.linearItems,e.viewState,k]),$=M.exports.useCallback(function(){i(!1),a(4),u({}),d(0),v(void 0),y(void 0),T("_nodrag")},[]);a4(function(){e.activeTreeId&&e.linearItems[e.activeTreeId]&&c[e.activeTreeId]&&L(c[e.activeTreeId],b)},[b,e.activeTreeId,e.linearItems,L,c],[e.activeTreeId]),a4(function(){r&&e.activeTreeId&&y(c[e.activeTreeId][h])},[h,e.activeTreeId,r,c],[h,e.activeTreeId]);var E=Qee(),C=function(re){var Te;b&&!E(re,b)||(y(re),e.setActiveTree(re.treeId),b&&e.activeTreeId!==re.treeId&&((Te=e.onSelectItems)===null||Te===void 0||Te.call(e,b.map(function(Re){return Re.index}),re.treeId)))},I=R7e(w,T,s,y,C),H=M.exports.useCallback(function(){b&&g&&e.onDrop&&(e.onDrop(b,g),A(function(){var re;(re=e.onFocusItem)===null||re===void 0||re.call(e,b[0],g.treeId),$()}))},[b,g,e,$,A]),Y=M.exports.useCallback(function(re,Te){var Re,V,pe=$ee(e.treeIds,function(ae){return k(ae,re)}),J=(V=(Re=document.querySelector('[data-rct-tree="'+Te+'"] [data-rct-item-container="true"]'))===null||Re===void 0?void 0:Re.offsetHeight)!==null&&V!==void 0?V:5;a(J),v(re),u(pe),e.activeTreeId&&L(pe[e.activeTreeId],re)},[e.activeTreeId,e.treeIds,k,L]),z=M.exports.useCallback(function(){var re,Te,Re;if(!!e.canDragAndDrop&&e.activeTreeId){var V=(Te=(re=e.viewState[e.activeTreeId])===null||re===void 0?void 0:re.selectedItems)!==null&&Te!==void 0?Te:[(Re=e.viewState[e.activeTreeId])===null||Re===void 0?void 0:Re.focusedItem];if(V.length===0||V[0]===void 0)return;var pe=V.map(function(J){return e.items[J]});if(e.canDrag&&!e.canDrag(pe))return;Y(pe,e.activeTreeId),setTimeout(function(){i(!0)})}},[Y,e]),U=M.exports.useCallback(function(){$()},[$]),j=M.exports.useCallback(function(){H(),$()},[H,$]),K=M.exports.useCallback(function(){d(function(re){return Math.max(0,re-1)})},[]),se=M.exports.useCallback(function(){e.activeTreeId&&d(function(re){return Math.min(c[e.activeTreeId].length,re+1)})},[e.activeTreeId,c]),G={onStartDraggingItems:Y,startProgrammaticDrag:z,abortProgrammaticDrag:U,completeProgrammaticDrag:j,programmaticDragUp:K,programmaticDragDown:se,draggingItems:b,draggingPosition:g,itemHeight:s,isProgrammaticallyDragging:r,onDragOverTreeHandler:I,viableDragPositions:c};return M.exports.useEffect(function(){return window.addEventListener("dragend",$),window.addEventListener("drop",H),function(){window.removeEventListener("dragend",$),window.removeEventListener("drop",H)}},[H,$]),M.exports.createElement(Eee.Provider,{value:G},t.children)},Yg=globalThis&&globalThis.__assign||function(){return Yg=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Yg.apply(this,arguments)},z7e=function(t,e){var n=xi(),r=Lu();M.exports.useImperativeHandle(t,function(){return Yg(Yg(Yg({},e),n),{treeEnvironmentContext:n,dragAndDropContext:r})})},uW=globalThis&&globalThis.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t},Cee=M.exports.createContext(null),L7e=function(){return M.exports.useContext(Cee)},N7e=M.exports.forwardRef(function(t,e){var n=xi(),r=n.onCollapseItem,i=n.items;n.trees;var o=n.viewState,s=n.onExpandItem,a=n.onFocusItem,l=n.setActiveTree,c=n.onRenameItem,u=n.onSelectItems,f=n.onPrimaryAction,h=n.linearItems,d=Lu(),O=d.abortProgrammaticDrag,b=d.completeProgrammaticDrag,v=d.programmaticDragDown,p=d.programmaticDragUp,g=d.startProgrammaticDrag,y={abortProgrammaticDrag:M.exports.useCallback(function(){O()},[O]),collapseItem:M.exports.useCallback(function(S,w){r==null||r(i[S],w)},[i,r]),completeProgrammaticDrag:M.exports.useCallback(function(){b()},[b]),expandItem:M.exports.useCallback(function(S,w){s==null||s(i[S],w)},[i,s]),focusItem:M.exports.useCallback(function(S,w){a==null||a(i[S],w)},[i,a]),focusTree:M.exports.useCallback(function(S,w){w===void 0&&(w=!0),l(S,w)},[l]),moveFocusDown:M.exports.useCallback(function(S){var w=h[S],T=w.findIndex(function(L){var $,E=L.item;return E===(($=o[S])===null||$===void 0?void 0:$.focusedItem)}),k=T!==void 0?Math.min(w.length-1,T+1):0,A=i[w[k].item];a==null||a(A,S)},[i,h,a,o]),moveFocusUp:M.exports.useCallback(function(S){var w=h[S],T=w.findIndex(function(L){var $,E=L.item;return E===(($=o[S])===null||$===void 0?void 0:$.focusedItem)}),k=T!==void 0?Math.max(0,T-1):0,A=i[w[k].item];a==null||a(A,S)},[i,h,a,o]),moveProgrammaticDragPositionDown:M.exports.useCallback(function(){v()},[v]),moveProgrammaticDragPositionUp:M.exports.useCallback(function(){p()},[p]),renameItem:M.exports.useCallback(function(S,w,T){c==null||c(i[S],w,T)},[i,c]),selectItems:M.exports.useCallback(function(S,w){u==null||u(S,w)},[u]),startProgrammaticDrag:M.exports.useCallback(function(){g()},[g]),toggleItemExpandedState:M.exports.useCallback(function(S,w){var T,k;!((k=(T=o[w])===null||T===void 0?void 0:T.expandedItems)===null||k===void 0)&&k.includes(S)?r==null||r(i[S],w):s==null||s(i[S],w)},[i,r,s,o]),toggleItemSelectStatus:M.exports.useCallback(function(S,w){var T,k,A,L,$;!((k=(T=o[w])===null||T===void 0?void 0:T.selectedItems)===null||k===void 0)&&k.includes(S)?u==null||u((L=(A=o[w].selectedItems)===null||A===void 0?void 0:A.filter(function(E){return E!==S}))!==null&&L!==void 0?L:[],w):u==null||u(uW(uW([],($=o[w].selectedItems)!==null&&$!==void 0?$:[]),[S]),w)},[u,o]),invokePrimaryAction:M.exports.useCallback(function(S,w){f==null||f(i[S],w)},[i,f])};return z7e(e,y),M.exports.createElement(Cee.Provider,{value:y},t.children)}),M7e=function(t){if(!!t)if(t.scrollIntoViewIfNeeded)t.scrollIntoViewIfNeeded();else{var e=t.getBoundingClientRect(),n=e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth);n||t.scrollIntoView()}},Za=globalThis&&globalThis.__assign||function(){return Za=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Za.apply(this,arguments)},cd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.filter(function(n){return!!n}).join(" ")},D7e=function(t){return{renderItemTitle:function(e){var n=e.title,r=e.context,i=e.info;if(!i.isSearching||!r.isSearchMatching)return Xt.createElement(Xt.Fragment,null,n);var o=n.toLowerCase().indexOf(i.search.toLowerCase());return Xt.createElement(Xt.Fragment,null,o>0&&Xt.createElement("span",null,n.slice(0,o)),Xt.createElement("span",{className:"rct-tree-item-search-highlight"},n.slice(o,o+i.search.length)),o+i.search.length<n.length&&Xt.createElement("span",null,n.slice(o+i.search.length,n.length)))},renderItemArrow:function(e){var n=e.item,r=e.context;return Xt.createElement("div",Za({className:cd(n.hasChildren&&"rct-tree-item-arrow-hasChildren","rct-tree-item-arrow")},r.arrowProps),n.hasChildren&&(r.isExpanded?Xt.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 16 16",enableBackground:"new 0 0 16 16",xmlSpace:"preserve"},Xt.createElement("g",null,Xt.createElement("g",null,Xt.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:`M12,5c-0.28,0-0.53,0.11-0.71,0.29L8,8.59L4.71,5.29C4.53,5.11,4.28,5,4,5
|
|
483
483
|
C3.45,5,3,5.45,3,6c0,0.28,0.11,0.53,0.29,0.71l4,4C7.47,10.89,7.72,11,8,11s0.53-0.11,0.71-0.29l4-4C12.89,6.53,13,6.28,13,6
|
|
484
484
|
C13,5.45,12.55,5,12,5z`,className:"rct-tree-item-arrow-path"})))):Xt.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 16 16",enableBackground:"new 0 0 16 16",xmlSpace:"preserve"},Xt.createElement("g",null,Xt.createElement("g",null,Xt.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:`M10.71,7.29l-4-4C6.53,3.11,6.28,3,6,3C5.45,3,5,3.45,5,4
|
|
485
485
|
c0,0.28,0.11,0.53,0.29,0.71L8.59,8l-3.29,3.29C5.11,11.47,5,11.72,5,12c0,0.55,0.45,1,1,1c0.28,0,0.53-0.11,0.71-0.29l4-4
|
|
@@ -1618,7 +1618,7 @@ ${We}`:"";mt.push(Ze+fn);let lt=I==null?void 0:I.state.replaceSelection(mt.join(
|
|
|
1618
1618
|
background-color: transparent;
|
|
1619
1619
|
z-index: 9998;
|
|
1620
1620
|
}
|
|
1621
|
-
`,Fit=()=>{const{t}=pl(),e=Qt().file.treeData(),[n,r]=M.exports.useState(""),[i,o]=M.exports.useState(1);M.exports.useState("");const s=Qt().file.openSearch(),a=M.exports.useMemo(()=>Object.fromEntries(Object.entries(e).filter(([,A])=>A.type==="FILE")),[e]),[l,c]=M.exports.useState([]),[u,f]=M.exports.useState(0),h=M.exports.useRef(null),[d,O]=M.exports.useState(!1);Qt().dao.playgroundInfo();const b=Dc().file.hideFeature(),v=Dc().file.hideEditFeature(),p=Qt().file.getSearchList();M.exports.useEffect(()=>{f(0)},[n]);const g=M.exports.useMemo(()=>{const A=Array.from(new Set(l.concat(Object.keys(a).filter(L=>L!==".")).filter(L=>{const $=L.split("/");return!d&&$.some(
|
|
1621
|
+
`,Fit=()=>{const{t}=pl(),e=Qt().file.treeData(),[n,r]=M.exports.useState(""),[i,o]=M.exports.useState(1);M.exports.useState("");const s=Qt().file.openSearch(),a=M.exports.useMemo(()=>Object.fromEntries(Object.entries(e).filter(([,A])=>A.type==="FILE")),[e]),[l,c]=M.exports.useState([]),[u,f]=M.exports.useState(0),h=M.exports.useRef(null),[d,O]=M.exports.useState(!1);Qt().dao.playgroundInfo();const b=Dc().file.hideFeature(),v=Dc().file.hideEditFeature(),p=Qt().file.getSearchList();M.exports.useEffect(()=>{f(0)},[n]);const g=M.exports.useMemo(()=>{const A=Array.from(new Set(l.concat(Object.keys(a).filter(L=>L!==".")).filter(L=>{var E,C;const $=L.split("/");return!d&&$.some(I=>I.startsWith("."))||((E=e[L])==null?void 0:E.hide)&&b==="preview"&&!v||((C=e[L])==null?void 0:C.canNotExpaned)?!1:n?L.includes(n):!0})));return A.sort((L,$)=>l.indexOf(L)>-1&&L.indexOf(n)>-1||l.indexOf($)>-1&&$.indexOf(n)>-1?1:L.indexOf(n)-$.indexOf(n)),A},[l,a,d,e,b,v,n]);M.exports.useEffect(()=>{const A=L=>{switch(s&&["ArrowDown","ArrowUp","Enter"].includes(L.code)&&(L.preventDefault(),L.stopPropagation(),L.stopImmediatePropagation()),L.code){case"ArrowDown":{f(u===g.length-1?0:u+1);break}case"ArrowUp":{const E=u===0?g.length-1:u-1;f(E);break}case"Enter":k.length&&S(g[u]),Ce.file.closeSearch()}};return s?window.addEventListener("keydown",A,!1):window.removeEventListener("keydown",A),()=>{window.removeEventListener("keydown",A)}},[u,g,g.length]),M.exports.useEffect(()=>{const A=L=>{if((L.ctrlKey||L.metaKey)&&L.key==="p"){L.preventDefault();const $=oe.dao.playgroundInfo().dockerId,E=window.localStorage.getItem(`d42SearchFileHistoryList_${$}`),C=new Set(Object.keys(a));let I=E?JSON.parse(E):[];I.length&&(I=I.filter(H=>C.has(H)&&!e[H].canNotExpaned),window.localStorage.setItem(`d42SearchFileHistoryList_${$}`,JSON.stringify(I))),c(I),$&&O(LC($)),Ce.file.openSearch();return}};return window.addEventListener("keydown",A,!0),()=>{window.removeEventListener("keydown",A)}},[]),M.exports.useEffect(()=>{var $;if(!h.current)return;const A=h.current.getBoundingClientRect().height||360,L=($=h.current.firstElementChild)==null?void 0:$.childNodes[u];h.current.scrollTop=L.offsetTop-A},[u,g.length]);const y=A=>A.substring(A.lastIndexOf("/")+1);M.exports.useEffect(()=>{const A=()=>{Ce.file.closeSearch()};return window.addEventListener("click",A,!1),()=>{window.removeEventListener("click",A)}},[]);const S=A=>{Ce.file.setSearchFileParamsByPath(A,{lineNumber:i}),oe.file.getOpenedPath()!==A&&(Ce.file.docLoading(!0),zK(A),oe.dao.channel().loadFile(A))},w=A=>A.replace(n,function(L){return`<span>${L}</span>`}),T=A=>{const L=/([^:@]+)((?::)(\d+))?((?:@)(\w+))?/,[,$,,E,,C]=Array.from(A.currentTarget.value.match(L)||[]);o(E?Number(E):1),Mt.log("[SearchFile]",E,C),r($)};M.exports.useEffect(()=>{s||(f(0),r(""))},[s]);const k=M.exports.useMemo(()=>n?g:p,[g,n,p]);return de(Yit,{children:s?on(up,{children:[on("div",{className:"d42-search-box",children:[de("div",{className:"d42-search-input-wrapper",children:de("input",{autoFocus:!0,placeholder:t("editor_search_files_by_name"),type:"text",onChange:A=>{T(A)},onClick:A=>{A.stopPropagation(),A.preventDefault()}})}),de("div",{ref:h,className:"d42-search-filelist-wrapper",children:k.length>0?de("ul",{children:k.map((A,L)=>{const $=y(A),E=yR($);return on("li",{className:Yn("d42-search-file-item",{active:L===u}),onClick:()=>S(A),children:[de("div",{className:"d42-file-box",children:E?de("em",{className:Yn("d42-file-icon",E)}):de("em",{className:"d42-file-icon",children:de(bR,{style:{width:12}})})}),on("div",{className:"d42-search-file-name-wrapper",children:[de("strong",{title:A.split("/").slice(0,-1).join("/"),className:"d42-search-prefix-filename",dangerouslySetInnerHTML:{__html:w($)}}),de("div",{title:A,className:"d42-file-path",dangerouslySetInnerHTML:{__html:w(A.split("/").slice(0,-1).join("/"))}})]}),l.includes(A)&&L===0&&de("div",{className:"d42-search-file-item-suffix-label",children:"\u6700\u8FD1\u6253\u5F00"})]},A)})}):de("div",{className:"d42-search-no-data",children:t("No results")})})]}),de("div",{className:"d42-search-mask"})]}):null})},jit=()=>on("div",{style:{margin:10},children:[de("div",{children:de(vW,{height:100,speed:1,backgroundColor:"var(--d42-editor__skeleton--bg)",foregroundColor:"var(--d42-editor__skeleton--foregroundColor)"})}),de("div",{children:de(vW,{style:{marginTop:10},height:100,speed:1,backgroundColor:"var(--d42-editor__skeleton--bg)",foregroundColor:"var(--d42-editor__skeleton--foregroundColor)"})})]}),Zit=Zr.div`
|
|
1622
1622
|
&.d42-editor-layout {
|
|
1623
1623
|
height: 100%;
|
|
1624
1624
|
}
|