@iebh/tera-fy 2.3.11 → 2.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/api.md +8 -11
  3. package/dist/plugin.vue2.es2019.js +7 -7
  4. package/dist/terafy.bootstrapper.es2019.js +2 -2
  5. package/dist/terafy.bootstrapper.js +2 -2
  6. package/dist/terafy.es2019.js +5 -5
  7. package/dist/terafy.js +5 -5
  8. package/eslint.config.js +4 -66
  9. package/lib/{projectFile.ts → projectFile.js} +52 -76
  10. package/lib/syncro/{entities.ts → entities.js} +14 -83
  11. package/lib/syncro/{keyed.ts → keyed.js} +46 -68
  12. package/lib/syncro/{syncro.ts → syncro.js} +104 -136
  13. package/lib/{terafy.bootstrapper.ts → terafy.bootstrapper.js} +20 -30
  14. package/lib/{terafy.client.ts → terafy.client.js} +85 -84
  15. package/lib/{terafy.proxy.ts → terafy.proxy.js} +12 -26
  16. package/lib/{terafy.server.ts → terafy.server.js} +204 -229
  17. package/package.json +20 -39
  18. package/plugins/{base.ts → base.js} +3 -5
  19. package/plugins/{firebase.ts → firebase.js} +22 -21
  20. package/plugins/{vite.ts → vite.js} +3 -3
  21. package/plugins/{vue2.ts → vue2.js} +8 -10
  22. package/plugins/{vue3.ts → vue3.js} +7 -10
  23. package/utils/mixin.js +15 -0
  24. package/utils/{pathTools.ts → pathTools.js} +8 -9
  25. package/widgets/tera-file-select.vue +1 -1
  26. package/dist/lib/projectFile.d.ts +0 -190
  27. package/dist/lib/projectFile.js +0 -305
  28. package/dist/lib/projectFile.js.map +0 -1
  29. package/dist/lib/syncro/entities.d.ts +0 -34
  30. package/dist/lib/syncro/entities.js +0 -212
  31. package/dist/lib/syncro/entities.js.map +0 -1
  32. package/dist/lib/syncro/keyed (Rhino's conflicted copy 2026-05-10).js +0 -287
  33. package/dist/lib/syncro/keyed.d.ts +0 -95
  34. package/dist/lib/syncro/keyed.js +0 -288
  35. package/dist/lib/syncro/keyed.js (Rhino's conflicted copy 2026-05-10).map +0 -1
  36. package/dist/lib/syncro/keyed.js.map +0 -1
  37. package/dist/lib/syncro/syncro (Rhino's conflicted copy 2026-05-10).js +0 -765
  38. package/dist/lib/syncro/syncro.d (Rhino's conflicted copy 2026-05-10).ts +0 -336
  39. package/dist/lib/syncro/syncro.d.ts +0 -343
  40. package/dist/lib/syncro/syncro.js +0 -771
  41. package/dist/lib/syncro/syncro.js (Rhino's conflicted copy 2026-05-10).map +0 -1
  42. package/dist/lib/syncro/syncro.js.map +0 -1
  43. package/dist/lib/terafy.bootstrapper.d.ts +0 -42
  44. package/dist/lib/terafy.bootstrapper.js +0 -129
  45. package/dist/lib/terafy.bootstrapper.js.map +0 -1
  46. package/dist/lib/terafy.client.d.ts +0 -555
  47. package/dist/lib/terafy.client.js +0 -1153
  48. package/dist/lib/terafy.client.js.map +0 -1
  49. package/dist/lib/terafy.proxy.d.ts +0 -66
  50. package/dist/lib/terafy.proxy.js +0 -130
  51. package/dist/lib/terafy.proxy.js.map +0 -1
  52. package/dist/lib/terafy.server.d.ts +0 -697
  53. package/dist/lib/terafy.server.js +0 -2062
  54. package/dist/lib/terafy.server.js.map +0 -1
  55. package/dist/plugin.vue2.es2019 (Rhino's conflicted copy 2026-05-10).js +0 -1271
  56. package/dist/plugins/base.d.ts +0 -20
  57. package/dist/plugins/base.js +0 -22
  58. package/dist/plugins/base.js.map +0 -1
  59. package/dist/plugins/firebase.d.ts +0 -62
  60. package/dist/plugins/firebase.js +0 -123
  61. package/dist/plugins/firebase.js.map +0 -1
  62. package/dist/plugins/vite.d.ts +0 -12
  63. package/dist/plugins/vite.js +0 -22
  64. package/dist/plugins/vite.js.map +0 -1
  65. package/dist/plugins/vue2.d.ts +0 -67
  66. package/dist/plugins/vue2.js +0 -104
  67. package/dist/plugins/vue2.js.map +0 -1
  68. package/dist/plugins/vue3.d.ts +0 -63
  69. package/dist/plugins/vue3.js +0 -93
  70. package/dist/plugins/vue3.js.map +0 -1
  71. package/dist/utils/mixin.d.ts +0 -11
  72. package/dist/utils/mixin.js +0 -15
  73. package/dist/utils/mixin.js.map +0 -1
  74. package/dist/utils/pDefer.d.ts +0 -16
  75. package/dist/utils/pDefer.js +0 -19
  76. package/dist/utils/pDefer.js.map +0 -1
  77. package/dist/utils/pathTools.d.ts +0 -70
  78. package/dist/utils/pathTools.js +0 -120
  79. package/dist/utils/pathTools.js.map +0 -1
  80. package/tsconfig.json +0 -30
  81. package/utils/mixin.ts +0 -18
  82. package/utils/pDefer.ts +0 -27
@@ -1,4 +1,4 @@
1
- var Se=Object.defineProperty;var Ee=(t,e,r)=>e in t?Se(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Z=(t,e,r)=>Ee(t,typeof e!="symbol"?e+"":e,r);var Me=typeof global=="object"&&global&&global.Object===Object&&global,N=Me;var De=typeof self=="object"&&self&&self.Object===Object&&self,Re=N||De||Function("return this")(),d=Re;var Be=d.Symbol,_=Be;var st=Object.prototype,Le=st.hasOwnProperty,Fe=st.toString,M=_?_.toStringTag:void 0;function Ne(t){var e=Le.call(t,M),r=t[M];try{t[M]=void 0;var o=!0}catch{}var a=Fe.call(t);return o&&(e?t[M]=r:delete t[M]),a}var pt=Ne;var ze=Object.prototype,We=ze.toString;function Ue(t){return We.call(t)}var it=Ue;var Ge="[object Null]",He="[object Undefined]",nt=_?_.toStringTag:void 0;function qe(t){return t==null?t===void 0?He:Ge:nt&&nt in Object(t)?pt(t):it(t)}var h=qe;function $e(t){return t!=null&&typeof t=="object"}var x=$e;var Ke=Array.isArray,D=Ke;function Ve(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var u=Ve;function ke(t){return t}var z=ke;var Ye="[object AsyncFunction]",Je="[object Function]",Xe="[object GeneratorFunction]",Ze="[object Proxy]";function Qe(t){if(!u(t))return!1;var e=h(t);return e==Je||e==Xe||e==Ye||e==Ze}var O=Qe;var tr=d["__core-js_shared__"],W=tr;var ut=(function(){var t=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function er(t){return!!ut&&ut in t}var lt=er;var rr=Function.prototype,or=rr.toString;function ar(t){if(t!=null){try{return or.call(t)}catch{}try{return t+""}catch{}}return""}var mt=ar;var fr=/[\\^$.*+?()[\]{}|]/g,sr=/^\[object .+?Constructor\]$/,pr=Function.prototype,ir=Object.prototype,nr=pr.toString,ur=ir.hasOwnProperty,lr=RegExp("^"+nr.call(ur).replace(fr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function mr(t){if(!u(t)||lt(t))return!1;var e=O(t)?lr:sr;return e.test(mt(t))}var dt=mr;function dr(t,e){return t==null?void 0:t[e]}var xt=dr;function xr(t,e){var r=xt(t,e);return dt(r)?r:void 0}var T=xr;var ct=Object.create,cr=(function(){function t(){}return function(e){if(!u(e))return{};if(ct)return ct(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),ht=cr;function hr(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var gt=hr;function gr(t,e){var r=-1,o=t.length;for(e||(e=Array(o));++r<o;)e[r]=t[r];return e}var yt=gr;var yr=800,br=16,vr=Date.now;function _r(t){var e=0,r=0;return function(){var o=vr(),a=br-(o-r);if(r=o,a>0){if(++e>=yr)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var bt=_r;function Or(t){return function(){return t}}var vt=Or;var Tr=(function(){try{var t=T(Object,"defineProperty");return t({},"",{}),t}catch{}})(),j=Tr;var jr=j?function(t,e){return j(t,"toString",{configurable:!0,enumerable:!1,value:vt(e),writable:!0})}:z,_t=jr;var wr=bt(_t),Ot=wr;var Ar=9007199254740991,Ir=/^(?:0|[1-9]\d*)$/;function Cr(t,e){var r=typeof t;return e=e==null?Ar:e,!!e&&(r=="number"||r!="symbol"&&Ir.test(t))&&t>-1&&t%1==0&&t<e}var U=Cr;function Pr(t,e,r){e=="__proto__"&&j?j(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var w=Pr;function Sr(t,e){return t===e||t!==t&&e!==e}var g=Sr;var Er=Object.prototype,Mr=Er.hasOwnProperty;function Dr(t,e,r){var o=t[e];(!(Mr.call(t,e)&&g(o,r))||r===void 0&&!(e in t))&&w(t,e,r)}var Tt=Dr;function Rr(t,e,r,o){var a=!r;r||(r={});for(var s=-1,p=e.length;++s<p;){var f=e[s],n=o?o(r[f],t[f],f,r,t):void 0;n===void 0&&(n=t[f]),a?w(r,f,n):Tt(r,f,n)}return r}var jt=Rr;var wt=Math.max;function Br(t,e,r){return e=wt(e===void 0?t.length-1:e,0),function(){for(var o=arguments,a=-1,s=wt(o.length-e,0),p=Array(s);++a<s;)p[a]=o[e+a];a=-1;for(var f=Array(e+1);++a<e;)f[a]=o[a];return f[e]=r(p),gt(t,this,f)}}var At=Br;function Lr(t,e){return Ot(At(t,e,z),t+"")}var It=Lr;var Fr=9007199254740991;function Nr(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Fr}var G=Nr;function zr(t){return t!=null&&G(t.length)&&!O(t)}var A=zr;function Wr(t,e,r){if(!u(r))return!1;var o=typeof e;return(o=="number"?A(r)&&U(e,r.length):o=="string"&&e in r)?g(r[e],t):!1}var Ct=Wr;function Ur(t){return It(function(e,r){var o=-1,a=r.length,s=a>1?r[a-1]:void 0,p=a>2?r[2]:void 0;for(s=t.length>3&&typeof s=="function"?(a--,s):void 0,p&&Ct(r[0],r[1],p)&&(s=a<3?void 0:s,a=1),e=Object(e);++o<a;){var f=r[o];f&&t(e,f,o,s)}return e})}var Pt=Ur;var Gr=Object.prototype;function Hr(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Gr;return t===r}var H=Hr;function qr(t,e){for(var r=-1,o=Array(t);++r<t;)o[r]=e(r);return o}var St=qr;var $r="[object Arguments]";function Kr(t){return x(t)&&h(t)==$r}var Q=Kr;var Et=Object.prototype,Vr=Et.hasOwnProperty,kr=Et.propertyIsEnumerable,Yr=Q((function(){return arguments})())?Q:function(t){return x(t)&&Vr.call(t,"callee")&&!kr.call(t,"callee")},R=Yr;function Jr(){return!1}var Mt=Jr;var Bt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Dt=Bt&&typeof module=="object"&&module&&!module.nodeType&&module,Xr=Dt&&Dt.exports===Bt,Rt=Xr?d.Buffer:void 0,Zr=Rt?Rt.isBuffer:void 0,Qr=Zr||Mt,q=Qr;var to="[object Arguments]",eo="[object Array]",ro="[object Boolean]",oo="[object Date]",ao="[object Error]",fo="[object Function]",so="[object Map]",po="[object Number]",io="[object Object]",no="[object RegExp]",uo="[object Set]",lo="[object String]",mo="[object WeakMap]",xo="[object ArrayBuffer]",co="[object DataView]",ho="[object Float32Array]",go="[object Float64Array]",yo="[object Int8Array]",bo="[object Int16Array]",vo="[object Int32Array]",_o="[object Uint8Array]",Oo="[object Uint8ClampedArray]",To="[object Uint16Array]",jo="[object Uint32Array]",i={};i[ho]=i[go]=i[yo]=i[bo]=i[vo]=i[_o]=i[Oo]=i[To]=i[jo]=!0;i[to]=i[eo]=i[xo]=i[ro]=i[co]=i[oo]=i[ao]=i[fo]=i[so]=i[po]=i[io]=i[no]=i[uo]=i[lo]=i[mo]=!1;function wo(t){return x(t)&&G(t.length)&&!!i[h(t)]}var Lt=wo;function Ao(t){return function(e){return t(e)}}var Ft=Ao;var Nt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,B=Nt&&typeof module=="object"&&module&&!module.nodeType&&module,Io=B&&B.exports===Nt,tt=Io&&N.process,Co=(function(){try{var t=B&&B.require&&B.require("util").types;return t||tt&&tt.binding&&tt.binding("util")}catch{}})(),et=Co;var zt=et&&et.isTypedArray,Po=zt?Ft(zt):Lt,$=Po;var So=Object.prototype,Eo=So.hasOwnProperty;function Mo(t,e){var r=D(t),o=!r&&R(t),a=!r&&!o&&q(t),s=!r&&!o&&!a&&$(t),p=r||o||a||s,f=p?St(t.length,String):[],n=f.length;for(var m in t)(e||Eo.call(t,m))&&!(p&&(m=="length"||a&&(m=="offset"||m=="parent")||s&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||U(m,n)))&&f.push(m);return f}var Wt=Mo;function Do(t,e){return function(r){return t(e(r))}}var Ut=Do;function Ro(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Gt=Ro;var Bo=Object.prototype,Lo=Bo.hasOwnProperty;function Fo(t){if(!u(t))return Gt(t);var e=H(t),r=[];for(var o in t)o=="constructor"&&(e||!Lo.call(t,o))||r.push(o);return r}var Ht=Fo;function No(t){return A(t)?Wt(t,!0):Ht(t)}var K=No;var zo=T(Object,"create"),c=zo;function Wo(){this.__data__=c?c(null):{},this.size=0}var qt=Wo;function Uo(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var $t=Uo;var Go="__lodash_hash_undefined__",Ho=Object.prototype,qo=Ho.hasOwnProperty;function $o(t){var e=this.__data__;if(c){var r=e[t];return r===Go?void 0:r}return qo.call(e,t)?e[t]:void 0}var Kt=$o;var Ko=Object.prototype,Vo=Ko.hasOwnProperty;function ko(t){var e=this.__data__;return c?e[t]!==void 0:Vo.call(e,t)}var Vt=ko;var Yo="__lodash_hash_undefined__";function Jo(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=c&&e===void 0?Yo:e,this}var kt=Jo;function I(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}I.prototype.clear=qt;I.prototype.delete=$t;I.prototype.get=Kt;I.prototype.has=Vt;I.prototype.set=kt;var rt=I;function Xo(){this.__data__=[],this.size=0}var Yt=Xo;function Zo(t,e){for(var r=t.length;r--;)if(g(t[r][0],e))return r;return-1}var y=Zo;var Qo=Array.prototype,ta=Qo.splice;function ea(t){var e=this.__data__,r=y(e,t);if(r<0)return!1;var o=e.length-1;return r==o?e.pop():ta.call(e,r,1),--this.size,!0}var Jt=ea;function ra(t){var e=this.__data__,r=y(e,t);return r<0?void 0:e[r][1]}var Xt=ra;function oa(t){return y(this.__data__,t)>-1}var Zt=oa;function aa(t,e){var r=this.__data__,o=y(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}var Qt=aa;function C(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}C.prototype.clear=Yt;C.prototype.delete=Jt;C.prototype.get=Xt;C.prototype.has=Zt;C.prototype.set=Qt;var b=C;var fa=T(d,"Map"),V=fa;function sa(){this.size=0,this.__data__={hash:new rt,map:new(V||b),string:new rt}}var te=sa;function pa(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var ee=pa;function ia(t,e){var r=t.__data__;return ee(e)?r[typeof e=="string"?"string":"hash"]:r.map}var v=ia;function na(t){var e=v(this,t).delete(t);return this.size-=e?1:0,e}var re=na;function ua(t){return v(this,t).get(t)}var oe=ua;function la(t){return v(this,t).has(t)}var ae=la;function ma(t,e){var r=v(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}var fe=ma;function P(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}P.prototype.clear=te;P.prototype.delete=re;P.prototype.get=oe;P.prototype.has=ae;P.prototype.set=fe;var se=P;var da=Ut(Object.getPrototypeOf,Object),k=da;var xa="[object Object]",ca=Function.prototype,ha=Object.prototype,pe=ca.toString,ga=ha.hasOwnProperty,ya=pe.call(Object);function ba(t){if(!x(t)||h(t)!=xa)return!1;var e=k(t);if(e===null)return!0;var r=ga.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&pe.call(r)==ya}var ie=ba;function va(){this.__data__=new b,this.size=0}var ne=va;function _a(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var ue=_a;function Oa(t){return this.__data__.get(t)}var le=Oa;function Ta(t){return this.__data__.has(t)}var me=Ta;var ja=200;function wa(t,e){var r=this.__data__;if(r instanceof b){var o=r.__data__;if(!V||o.length<ja-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new se(o)}return r.set(t,e),this.size=r.size,this}var de=wa;function S(t){var e=this.__data__=new b(t);this.size=e.size}S.prototype.clear=ne;S.prototype.delete=ue;S.prototype.get=le;S.prototype.has=me;S.prototype.set=de;var xe=S;var ye=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ce=ye&&typeof module=="object"&&module&&!module.nodeType&&module,Aa=ce&&ce.exports===ye,he=Aa?d.Buffer:void 0,ge=he?he.allocUnsafe:void 0;function Ia(t,e){if(e)return t.slice();var r=t.length,o=ge?ge(r):new t.constructor(r);return t.copy(o),o}var be=Ia;var Ca=d.Uint8Array,ot=Ca;function Pa(t){var e=new t.constructor(t.byteLength);return new ot(e).set(new ot(t)),e}var ve=Pa;function Sa(t,e){var r=e?ve(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var _e=Sa;function Ea(t){return typeof t.constructor=="function"&&!H(t)?ht(k(t)):{}}var Oe=Ea;function Ma(t){return function(e,r,o){for(var a=-1,s=Object(e),p=o(e),f=p.length;f--;){var n=p[t?f:++a];if(r(s[n],n,s)===!1)break}return e}}var Te=Ma;var Da=Te(),je=Da;function Ra(t,e,r){(r!==void 0&&!g(t[e],r)||r===void 0&&!(e in t))&&w(t,e,r)}var L=Ra;function Ba(t){return x(t)&&A(t)}var we=Ba;function La(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var F=La;function Fa(t){return jt(t,K(t))}var Ae=Fa;function Na(t,e,r,o,a,s,p){var f=F(t,r),n=F(e,r),m=p.get(n);if(m){L(t,r,m);return}var l=s?s(f,n,r+"",t,e,p):void 0,E=l===void 0;if(E){var J=D(n),X=!J&&q(n),ft=!J&&!X&&$(n);l=n,J||X||ft?D(f)?l=f:we(f)?l=yt(f):X?(E=!1,l=be(n,!0)):ft?(E=!1,l=_e(n,!0)):l=[]:ie(n)||R(n)?(l=f,R(f)?l=Ae(f):(!u(f)||O(f))&&(l=Oe(n))):E=!1}E&&(p.set(n,l),a(l,n,o,s,p),p.delete(n)),L(t,r,l)}var Ie=Na;function Ce(t,e,r,o,a){t!==e&&je(e,function(s,p){if(a||(a=new xe),u(s))Ie(t,e,p,r,Ce,o,a);else{var f=o?o(F(t,p),s,p+"",t,e,a):void 0;f===void 0&&(f=s),L(t,p,f)}},K)}var Pe=Ce;var za=Pt(function(t,e,r){Pe(t,e,r)}),Y=za;var at=class{constructor(e){Z(this,"settings",{client:"tera-fy",clientType:"esm"});Z(this,"bootstrapperDeferredMethods",[]);e&&Y(this.settings,e),["set","setIfDev","use"].forEach(r=>{this[r]=(...o)=>(this.bootstrapperDeferredMethods.push({method:r,args:o}),this)})}init(e){let r=o=>`https://dev.tera-tools.com/api/tera-fy/${o}.js`;return Promise.resolve().then(()=>this.settings.clientType=="esm"?this.bootstrapperImport(r(this.settings.client)).then(o=>typeof o=="function"?o:Promise.reject("Tera-fy import didn't return a class")):Promise.reject(`Unsupported TERA-fy clientType "${this.settings.clientType}"`)).then(o=>{let a=new o;if(!a.mixin)throw new Error("TERA-fy client doesn't expose a mixin() method");a.mixin(this,a),Y(this.settings,a.settings,e||{})}).then(()=>{if(console.log("IAM",this),!this.init||typeof this.init!="function")throw new Error("Newly mixed-in TERA-fy client doesn't expose a init() method");if(!this.detectMode||typeof this.detectMode!="function")throw new Error("Newly mixed-in TERA-fy client doesn't expose a detectMode() method")}).then(()=>this.bootstrapperDeferredMethods.reduce((o,a)=>o.then(()=>a.method=="use"&&typeof a.args[0]=="string"?(console.log("TERA-FY DEFERRED-USE",a.args[0]),this.bootstrapperImport(r(a.args[0])).then(s=>typeof s=="function"?s:Promise.reject("Tera-fy plugin import didn't return a class")).then(s=>this.use(s,...a.args.slice(1)))):(console.log("TERA-FY DEFERRED-METHOD",a),Promise.resolve(this[a.method].apply(this,a.args)))),Promise.resolve())).then(()=>{delete this.bootstrapperDeferredMethods}).then(()=>console.log("TYBS","Init")).then(()=>this.init.call(this,e)).then(()=>this)}bootstrapperImport(e){return new Promise((r,o)=>{let a=`installTFyBS${Math.random().toString(36).slice(2)}`,s=document.createElement("script");s.type="module",s.textContent=`
1
+ var Ce=Object.defineProperty;var Ee=(t,e,r)=>e in t?Ce(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Z=(t,e,r)=>Ee(t,typeof e!="symbol"?e+"":e,r);var Me=typeof global=="object"&&global&&global.Object===Object&&global,N=Me;var De=typeof self=="object"&&self&&self.Object===Object&&self,Re=N||De||Function("return this")(),d=Re;var Be=d.Symbol,_=Be;var st=Object.prototype,Le=st.hasOwnProperty,Fe=st.toString,M=_?_.toStringTag:void 0;function Ne(t){var e=Le.call(t,M),r=t[M];try{t[M]=void 0;var o=!0}catch{}var a=Fe.call(t);return o&&(e?t[M]=r:delete t[M]),a}var pt=Ne;var ze=Object.prototype,We=ze.toString;function Ue(t){return We.call(t)}var it=Ue;var Ge="[object Null]",He="[object Undefined]",nt=_?_.toStringTag:void 0;function qe(t){return t==null?t===void 0?He:Ge:nt&&nt in Object(t)?pt(t):it(t)}var h=qe;function $e(t){return t!=null&&typeof t=="object"}var x=$e;var Ke=Array.isArray,D=Ke;function Ve(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var u=Ve;function ke(t){return t}var z=ke;var Ye="[object AsyncFunction]",Je="[object Function]",Xe="[object GeneratorFunction]",Ze="[object Proxy]";function Qe(t){if(!u(t))return!1;var e=h(t);return e==Je||e==Xe||e==Ye||e==Ze}var O=Qe;var tr=d["__core-js_shared__"],W=tr;var ut=(function(){var t=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function er(t){return!!ut&&ut in t}var lt=er;var rr=Function.prototype,or=rr.toString;function ar(t){if(t!=null){try{return or.call(t)}catch{}try{return t+""}catch{}}return""}var mt=ar;var fr=/[\\^$.*+?()[\]{}|]/g,sr=/^\[object .+?Constructor\]$/,pr=Function.prototype,ir=Object.prototype,nr=pr.toString,ur=ir.hasOwnProperty,lr=RegExp("^"+nr.call(ur).replace(fr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function mr(t){if(!u(t)||lt(t))return!1;var e=O(t)?lr:sr;return e.test(mt(t))}var dt=mr;function dr(t,e){return t==null?void 0:t[e]}var xt=dr;function xr(t,e){var r=xt(t,e);return dt(r)?r:void 0}var T=xr;var ct=Object.create,cr=(function(){function t(){}return function(e){if(!u(e))return{};if(ct)return ct(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),ht=cr;function hr(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var gt=hr;function gr(t,e){var r=-1,o=t.length;for(e||(e=Array(o));++r<o;)e[r]=t[r];return e}var yt=gr;var yr=800,br=16,vr=Date.now;function _r(t){var e=0,r=0;return function(){var o=vr(),a=br-(o-r);if(r=o,a>0){if(++e>=yr)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var bt=_r;function Or(t){return function(){return t}}var vt=Or;var Tr=(function(){try{var t=T(Object,"defineProperty");return t({},"",{}),t}catch{}})(),j=Tr;var jr=j?function(t,e){return j(t,"toString",{configurable:!0,enumerable:!1,value:vt(e),writable:!0})}:z,_t=jr;var wr=bt(_t),Ot=wr;var Ar=9007199254740991,Ir=/^(?:0|[1-9]\d*)$/;function Sr(t,e){var r=typeof t;return e=e==null?Ar:e,!!e&&(r=="number"||r!="symbol"&&Ir.test(t))&&t>-1&&t%1==0&&t<e}var U=Sr;function Pr(t,e,r){e=="__proto__"&&j?j(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var w=Pr;function Cr(t,e){return t===e||t!==t&&e!==e}var g=Cr;var Er=Object.prototype,Mr=Er.hasOwnProperty;function Dr(t,e,r){var o=t[e];(!(Mr.call(t,e)&&g(o,r))||r===void 0&&!(e in t))&&w(t,e,r)}var Tt=Dr;function Rr(t,e,r,o){var a=!r;r||(r={});for(var s=-1,p=e.length;++s<p;){var f=e[s],n=o?o(r[f],t[f],f,r,t):void 0;n===void 0&&(n=t[f]),a?w(r,f,n):Tt(r,f,n)}return r}var jt=Rr;var wt=Math.max;function Br(t,e,r){return e=wt(e===void 0?t.length-1:e,0),function(){for(var o=arguments,a=-1,s=wt(o.length-e,0),p=Array(s);++a<s;)p[a]=o[e+a];a=-1;for(var f=Array(e+1);++a<e;)f[a]=o[a];return f[e]=r(p),gt(t,this,f)}}var At=Br;function Lr(t,e){return Ot(At(t,e,z),t+"")}var It=Lr;var Fr=9007199254740991;function Nr(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Fr}var G=Nr;function zr(t){return t!=null&&G(t.length)&&!O(t)}var A=zr;function Wr(t,e,r){if(!u(r))return!1;var o=typeof e;return(o=="number"?A(r)&&U(e,r.length):o=="string"&&e in r)?g(r[e],t):!1}var St=Wr;function Ur(t){return It(function(e,r){var o=-1,a=r.length,s=a>1?r[a-1]:void 0,p=a>2?r[2]:void 0;for(s=t.length>3&&typeof s=="function"?(a--,s):void 0,p&&St(r[0],r[1],p)&&(s=a<3?void 0:s,a=1),e=Object(e);++o<a;){var f=r[o];f&&t(e,f,o,s)}return e})}var Pt=Ur;var Gr=Object.prototype;function Hr(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Gr;return t===r}var H=Hr;function qr(t,e){for(var r=-1,o=Array(t);++r<t;)o[r]=e(r);return o}var Ct=qr;var $r="[object Arguments]";function Kr(t){return x(t)&&h(t)==$r}var Q=Kr;var Et=Object.prototype,Vr=Et.hasOwnProperty,kr=Et.propertyIsEnumerable,Yr=Q((function(){return arguments})())?Q:function(t){return x(t)&&Vr.call(t,"callee")&&!kr.call(t,"callee")},R=Yr;function Jr(){return!1}var Mt=Jr;var Bt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Dt=Bt&&typeof module=="object"&&module&&!module.nodeType&&module,Xr=Dt&&Dt.exports===Bt,Rt=Xr?d.Buffer:void 0,Zr=Rt?Rt.isBuffer:void 0,Qr=Zr||Mt,q=Qr;var to="[object Arguments]",eo="[object Array]",ro="[object Boolean]",oo="[object Date]",ao="[object Error]",fo="[object Function]",so="[object Map]",po="[object Number]",io="[object Object]",no="[object RegExp]",uo="[object Set]",lo="[object String]",mo="[object WeakMap]",xo="[object ArrayBuffer]",co="[object DataView]",ho="[object Float32Array]",go="[object Float64Array]",yo="[object Int8Array]",bo="[object Int16Array]",vo="[object Int32Array]",_o="[object Uint8Array]",Oo="[object Uint8ClampedArray]",To="[object Uint16Array]",jo="[object Uint32Array]",i={};i[ho]=i[go]=i[yo]=i[bo]=i[vo]=i[_o]=i[Oo]=i[To]=i[jo]=!0;i[to]=i[eo]=i[xo]=i[ro]=i[co]=i[oo]=i[ao]=i[fo]=i[so]=i[po]=i[io]=i[no]=i[uo]=i[lo]=i[mo]=!1;function wo(t){return x(t)&&G(t.length)&&!!i[h(t)]}var Lt=wo;function Ao(t){return function(e){return t(e)}}var Ft=Ao;var Nt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,B=Nt&&typeof module=="object"&&module&&!module.nodeType&&module,Io=B&&B.exports===Nt,tt=Io&&N.process,So=(function(){try{var t=B&&B.require&&B.require("util").types;return t||tt&&tt.binding&&tt.binding("util")}catch{}})(),et=So;var zt=et&&et.isTypedArray,Po=zt?Ft(zt):Lt,$=Po;var Co=Object.prototype,Eo=Co.hasOwnProperty;function Mo(t,e){var r=D(t),o=!r&&R(t),a=!r&&!o&&q(t),s=!r&&!o&&!a&&$(t),p=r||o||a||s,f=p?Ct(t.length,String):[],n=f.length;for(var m in t)(e||Eo.call(t,m))&&!(p&&(m=="length"||a&&(m=="offset"||m=="parent")||s&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||U(m,n)))&&f.push(m);return f}var Wt=Mo;function Do(t,e){return function(r){return t(e(r))}}var Ut=Do;function Ro(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Gt=Ro;var Bo=Object.prototype,Lo=Bo.hasOwnProperty;function Fo(t){if(!u(t))return Gt(t);var e=H(t),r=[];for(var o in t)o=="constructor"&&(e||!Lo.call(t,o))||r.push(o);return r}var Ht=Fo;function No(t){return A(t)?Wt(t,!0):Ht(t)}var K=No;var zo=T(Object,"create"),c=zo;function Wo(){this.__data__=c?c(null):{},this.size=0}var qt=Wo;function Uo(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var $t=Uo;var Go="__lodash_hash_undefined__",Ho=Object.prototype,qo=Ho.hasOwnProperty;function $o(t){var e=this.__data__;if(c){var r=e[t];return r===Go?void 0:r}return qo.call(e,t)?e[t]:void 0}var Kt=$o;var Ko=Object.prototype,Vo=Ko.hasOwnProperty;function ko(t){var e=this.__data__;return c?e[t]!==void 0:Vo.call(e,t)}var Vt=ko;var Yo="__lodash_hash_undefined__";function Jo(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=c&&e===void 0?Yo:e,this}var kt=Jo;function I(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}I.prototype.clear=qt;I.prototype.delete=$t;I.prototype.get=Kt;I.prototype.has=Vt;I.prototype.set=kt;var rt=I;function Xo(){this.__data__=[],this.size=0}var Yt=Xo;function Zo(t,e){for(var r=t.length;r--;)if(g(t[r][0],e))return r;return-1}var y=Zo;var Qo=Array.prototype,ta=Qo.splice;function ea(t){var e=this.__data__,r=y(e,t);if(r<0)return!1;var o=e.length-1;return r==o?e.pop():ta.call(e,r,1),--this.size,!0}var Jt=ea;function ra(t){var e=this.__data__,r=y(e,t);return r<0?void 0:e[r][1]}var Xt=ra;function oa(t){return y(this.__data__,t)>-1}var Zt=oa;function aa(t,e){var r=this.__data__,o=y(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}var Qt=aa;function S(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}S.prototype.clear=Yt;S.prototype.delete=Jt;S.prototype.get=Xt;S.prototype.has=Zt;S.prototype.set=Qt;var b=S;var fa=T(d,"Map"),V=fa;function sa(){this.size=0,this.__data__={hash:new rt,map:new(V||b),string:new rt}}var te=sa;function pa(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var ee=pa;function ia(t,e){var r=t.__data__;return ee(e)?r[typeof e=="string"?"string":"hash"]:r.map}var v=ia;function na(t){var e=v(this,t).delete(t);return this.size-=e?1:0,e}var re=na;function ua(t){return v(this,t).get(t)}var oe=ua;function la(t){return v(this,t).has(t)}var ae=la;function ma(t,e){var r=v(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}var fe=ma;function P(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}P.prototype.clear=te;P.prototype.delete=re;P.prototype.get=oe;P.prototype.has=ae;P.prototype.set=fe;var se=P;var da=Ut(Object.getPrototypeOf,Object),k=da;var xa="[object Object]",ca=Function.prototype,ha=Object.prototype,pe=ca.toString,ga=ha.hasOwnProperty,ya=pe.call(Object);function ba(t){if(!x(t)||h(t)!=xa)return!1;var e=k(t);if(e===null)return!0;var r=ga.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&pe.call(r)==ya}var ie=ba;function va(){this.__data__=new b,this.size=0}var ne=va;function _a(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var ue=_a;function Oa(t){return this.__data__.get(t)}var le=Oa;function Ta(t){return this.__data__.has(t)}var me=Ta;var ja=200;function wa(t,e){var r=this.__data__;if(r instanceof b){var o=r.__data__;if(!V||o.length<ja-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new se(o)}return r.set(t,e),this.size=r.size,this}var de=wa;function C(t){var e=this.__data__=new b(t);this.size=e.size}C.prototype.clear=ne;C.prototype.delete=ue;C.prototype.get=le;C.prototype.has=me;C.prototype.set=de;var xe=C;var ye=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ce=ye&&typeof module=="object"&&module&&!module.nodeType&&module,Aa=ce&&ce.exports===ye,he=Aa?d.Buffer:void 0,ge=he?he.allocUnsafe:void 0;function Ia(t,e){if(e)return t.slice();var r=t.length,o=ge?ge(r):new t.constructor(r);return t.copy(o),o}var be=Ia;var Sa=d.Uint8Array,ot=Sa;function Pa(t){var e=new t.constructor(t.byteLength);return new ot(e).set(new ot(t)),e}var ve=Pa;function Ca(t,e){var r=e?ve(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var _e=Ca;function Ea(t){return typeof t.constructor=="function"&&!H(t)?ht(k(t)):{}}var Oe=Ea;function Ma(t){return function(e,r,o){for(var a=-1,s=Object(e),p=o(e),f=p.length;f--;){var n=p[t?f:++a];if(r(s[n],n,s)===!1)break}return e}}var Te=Ma;var Da=Te(),je=Da;function Ra(t,e,r){(r!==void 0&&!g(t[e],r)||r===void 0&&!(e in t))&&w(t,e,r)}var L=Ra;function Ba(t){return x(t)&&A(t)}var we=Ba;function La(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var F=La;function Fa(t){return jt(t,K(t))}var Ae=Fa;function Na(t,e,r,o,a,s,p){var f=F(t,r),n=F(e,r),m=p.get(n);if(m){L(t,r,m);return}var l=s?s(f,n,r+"",t,e,p):void 0,E=l===void 0;if(E){var J=D(n),X=!J&&q(n),ft=!J&&!X&&$(n);l=n,J||X||ft?D(f)?l=f:we(f)?l=yt(f):X?(E=!1,l=be(n,!0)):ft?(E=!1,l=_e(n,!0)):l=[]:ie(n)||R(n)?(l=f,R(f)?l=Ae(f):(!u(f)||O(f))&&(l=Oe(n))):E=!1}E&&(p.set(n,l),a(l,n,o,s,p),p.delete(n)),L(t,r,l)}var Ie=Na;function Se(t,e,r,o,a){t!==e&&je(e,function(s,p){if(a||(a=new xe),u(s))Ie(t,e,p,r,Se,o,a);else{var f=o?o(F(t,p),s,p+"",t,e,a):void 0;f===void 0&&(f=s),L(t,p,f)}},K)}var Pe=Se;var za=Pt(function(t,e,r){Pe(t,e,r)}),Y=za;var at=class{constructor(e){Z(this,"settings",{client:"tera-fy",clientType:"esm"});Z(this,"bootstrapperDeferredMethods",[]);e&&Y(this.settings,e),["set","setIfDev","use"].forEach(r=>{this[r]=(...o)=>(this.bootstrapperDeferredMethods.push({method:r,args:o}),this)})}init(e){let r=o=>`https://dev.tera-tools.com/api/tera-fy/${o}.js`;return Promise.resolve().then(()=>this.settings.clientType=="esm"?this.bootstrapperImport(r(this.settings.client)).then(o=>typeof o=="function"?o:Promise.reject("Tera-fy import didn't return a class")):Promise.reject(`Unsupported TERA-fy clientType "${this.settings.clientType}"`)).then(o=>{let a=new o;if(!a.mixin)throw new Error("TERA-fy client doesn't expose a mixin() method");a.mixin(this,a),Y(this.settings,a.settings,e||{})}).then(()=>{if(console.log("IAM",this),!this.init||typeof this.init!="function")throw new Error("Newly mixed-in TERA-fy client doesn't expose a init() method");if(!this.detectMode||typeof this.detectMode!="function")throw new Error("Newly mixed-in TERA-fy client doesn't expose a detectMode() method")}).then(()=>this.bootstrapperDeferredMethods.reduce((o,a)=>o.then(()=>a.method=="use"&&typeof a.args[0]=="string"?(console.log("TERA-FY DEFERRED-USE",a.args[0]),this.bootstrapperImport(r(a.args[0])).then(s=>typeof s=="function"?s:Promise.reject("Tera-fy plugin import didn't return a class")).then(s=>this.use(s,...a.args.slice(1)))):(console.log("TERA-FY DEFERRED-METHOD",a),Promise.resolve(this[a.method].apply(this,a.args)))),Promise.resolve())).then(()=>{delete this.bootstrapperDeferredMethods}).then(()=>console.log("TYBS","Init")).then(()=>this.init.call(this,e)).then(()=>this)}bootstrapperImport(e){return new Promise((r,o)=>{let a=`installTFyBS${Math.random().toString(36).slice(2)}`,s=document.createElement("script");s.type="module",s.textContent=`
2
2
  import mod from '${e}';
3
3
  window['installMod${a}'](mod);
4
4
  `;let p=()=>{delete window[`installMod${a}`],s.parentNode&&s.remove()};window[`installMod${a}`]=f=>{console.log("Accept module from",e,"=",f),r(f),p()},s.addEventListener("error",f=>{o(new Error(`Failed to load module script from ${e}. Event type: ${f.type}`)),p()}),document.head.append(s)})}};export{at as default};
@@ -8,7 +8,7 @@ lodash-es/lodash.js:
8
8
  (**
9
9
  * @license
10
10
  * Lodash (Custom Build) <https://lodash.com/>
11
- * Build: `lodash modularize exports="es" -o ./`
11
+ * Build: `lodash modularize exports="es" --repo lodash/lodash#4.18.1 -o ./`
12
12
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
13
13
  * Released under MIT license <https://lodash.com/license>
14
14
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
@@ -1,4 +1,4 @@
1
- var Pe=typeof global=="object"&&global&&global.Object===Object&&global,N=Pe;var Se=typeof self=="object"&&self&&self.Object===Object&&self,Ee=N||Se||Function("return this")(),d=Ee;var Me=d.Symbol,_=Me;var ft=Object.prototype,De=ft.hasOwnProperty,Re=ft.toString,M=_?_.toStringTag:void 0;function Be(t){var e=De.call(t,M),r=t[M];try{t[M]=void 0;var o=!0}catch{}var a=Re.call(t);return o&&(e?t[M]=r:delete t[M]),a}var st=Be;var Le=Object.prototype,Fe=Le.toString;function Ne(t){return Fe.call(t)}var pt=Ne;var ze="[object Null]",We="[object Undefined]",it=_?_.toStringTag:void 0;function Ue(t){return t==null?t===void 0?We:ze:it&&it in Object(t)?st(t):pt(t)}var h=Ue;function Ge(t){return t!=null&&typeof t=="object"}var x=Ge;var He=Array.isArray,D=He;function qe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var u=qe;function $e(t){return t}var z=$e;var Ke="[object AsyncFunction]",Ve="[object Function]",ke="[object GeneratorFunction]",Ye="[object Proxy]";function Je(t){if(!u(t))return!1;var e=h(t);return e==Ve||e==ke||e==Ke||e==Ye}var O=Je;var Xe=d["__core-js_shared__"],W=Xe;var nt=(function(){var t=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function Ze(t){return!!nt&&nt in t}var ut=Ze;var Qe=Function.prototype,tr=Qe.toString;function er(t){if(t!=null){try{return tr.call(t)}catch{}try{return t+""}catch{}}return""}var lt=er;var rr=/[\\^$.*+?()[\]{}|]/g,or=/^\[object .+?Constructor\]$/,ar=Function.prototype,fr=Object.prototype,sr=ar.toString,pr=fr.hasOwnProperty,ir=RegExp("^"+sr.call(pr).replace(rr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nr(t){if(!u(t)||ut(t))return!1;var e=O(t)?ir:or;return e.test(lt(t))}var mt=nr;function ur(t,e){return t?.[e]}var dt=ur;function lr(t,e){var r=dt(t,e);return mt(r)?r:void 0}var T=lr;var xt=Object.create,mr=(function(){function t(){}return function(e){if(!u(e))return{};if(xt)return xt(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),ct=mr;function dr(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var ht=dr;function xr(t,e){var r=-1,o=t.length;for(e||(e=Array(o));++r<o;)e[r]=t[r];return e}var gt=xr;var cr=800,hr=16,gr=Date.now;function yr(t){var e=0,r=0;return function(){var o=gr(),a=hr-(o-r);if(r=o,a>0){if(++e>=cr)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var yt=yr;function br(t){return function(){return t}}var bt=br;var vr=(function(){try{var t=T(Object,"defineProperty");return t({},"",{}),t}catch{}})(),j=vr;var _r=j?function(t,e){return j(t,"toString",{configurable:!0,enumerable:!1,value:bt(e),writable:!0})}:z,vt=_r;var Or=yt(vt),_t=Or;var Tr=9007199254740991,jr=/^(?:0|[1-9]\d*)$/;function wr(t,e){var r=typeof t;return e=e??Tr,!!e&&(r=="number"||r!="symbol"&&jr.test(t))&&t>-1&&t%1==0&&t<e}var U=wr;function Ar(t,e,r){e=="__proto__"&&j?j(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var w=Ar;function Ir(t,e){return t===e||t!==t&&e!==e}var g=Ir;var Cr=Object.prototype,Pr=Cr.hasOwnProperty;function Sr(t,e,r){var o=t[e];(!(Pr.call(t,e)&&g(o,r))||r===void 0&&!(e in t))&&w(t,e,r)}var Ot=Sr;function Er(t,e,r,o){var a=!r;r||(r={});for(var s=-1,p=e.length;++s<p;){var f=e[s],n=o?o(r[f],t[f],f,r,t):void 0;n===void 0&&(n=t[f]),a?w(r,f,n):Ot(r,f,n)}return r}var Tt=Er;var jt=Math.max;function Mr(t,e,r){return e=jt(e===void 0?t.length-1:e,0),function(){for(var o=arguments,a=-1,s=jt(o.length-e,0),p=Array(s);++a<s;)p[a]=o[e+a];a=-1;for(var f=Array(e+1);++a<e;)f[a]=o[a];return f[e]=r(p),ht(t,this,f)}}var wt=Mr;function Dr(t,e){return _t(wt(t,e,z),t+"")}var At=Dr;var Rr=9007199254740991;function Br(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Rr}var G=Br;function Lr(t){return t!=null&&G(t.length)&&!O(t)}var A=Lr;function Fr(t,e,r){if(!u(r))return!1;var o=typeof e;return(o=="number"?A(r)&&U(e,r.length):o=="string"&&e in r)?g(r[e],t):!1}var It=Fr;function Nr(t){return At(function(e,r){var o=-1,a=r.length,s=a>1?r[a-1]:void 0,p=a>2?r[2]:void 0;for(s=t.length>3&&typeof s=="function"?(a--,s):void 0,p&&It(r[0],r[1],p)&&(s=a<3?void 0:s,a=1),e=Object(e);++o<a;){var f=r[o];f&&t(e,f,o,s)}return e})}var Ct=Nr;var zr=Object.prototype;function Wr(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||zr;return t===r}var H=Wr;function Ur(t,e){for(var r=-1,o=Array(t);++r<t;)o[r]=e(r);return o}var Pt=Ur;var Gr="[object Arguments]";function Hr(t){return x(t)&&h(t)==Gr}var Z=Hr;var St=Object.prototype,qr=St.hasOwnProperty,$r=St.propertyIsEnumerable,Kr=Z((function(){return arguments})())?Z:function(t){return x(t)&&qr.call(t,"callee")&&!$r.call(t,"callee")},R=Kr;function Vr(){return!1}var Et=Vr;var Rt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mt=Rt&&typeof module=="object"&&module&&!module.nodeType&&module,kr=Mt&&Mt.exports===Rt,Dt=kr?d.Buffer:void 0,Yr=Dt?Dt.isBuffer:void 0,Jr=Yr||Et,q=Jr;var Xr="[object Arguments]",Zr="[object Array]",Qr="[object Boolean]",to="[object Date]",eo="[object Error]",ro="[object Function]",oo="[object Map]",ao="[object Number]",fo="[object Object]",so="[object RegExp]",po="[object Set]",io="[object String]",no="[object WeakMap]",uo="[object ArrayBuffer]",lo="[object DataView]",mo="[object Float32Array]",xo="[object Float64Array]",co="[object Int8Array]",ho="[object Int16Array]",go="[object Int32Array]",yo="[object Uint8Array]",bo="[object Uint8ClampedArray]",vo="[object Uint16Array]",_o="[object Uint32Array]",i={};i[mo]=i[xo]=i[co]=i[ho]=i[go]=i[yo]=i[bo]=i[vo]=i[_o]=!0;i[Xr]=i[Zr]=i[uo]=i[Qr]=i[lo]=i[to]=i[eo]=i[ro]=i[oo]=i[ao]=i[fo]=i[so]=i[po]=i[io]=i[no]=!1;function Oo(t){return x(t)&&G(t.length)&&!!i[h(t)]}var Bt=Oo;function To(t){return function(e){return t(e)}}var Lt=To;var Ft=typeof exports=="object"&&exports&&!exports.nodeType&&exports,B=Ft&&typeof module=="object"&&module&&!module.nodeType&&module,jo=B&&B.exports===Ft,Q=jo&&N.process,wo=(function(){try{var t=B&&B.require&&B.require("util").types;return t||Q&&Q.binding&&Q.binding("util")}catch{}})(),tt=wo;var Nt=tt&&tt.isTypedArray,Ao=Nt?Lt(Nt):Bt,$=Ao;var Io=Object.prototype,Co=Io.hasOwnProperty;function Po(t,e){var r=D(t),o=!r&&R(t),a=!r&&!o&&q(t),s=!r&&!o&&!a&&$(t),p=r||o||a||s,f=p?Pt(t.length,String):[],n=f.length;for(var m in t)(e||Co.call(t,m))&&!(p&&(m=="length"||a&&(m=="offset"||m=="parent")||s&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||U(m,n)))&&f.push(m);return f}var zt=Po;function So(t,e){return function(r){return t(e(r))}}var Wt=So;function Eo(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Ut=Eo;var Mo=Object.prototype,Do=Mo.hasOwnProperty;function Ro(t){if(!u(t))return Ut(t);var e=H(t),r=[];for(var o in t)o=="constructor"&&(e||!Do.call(t,o))||r.push(o);return r}var Gt=Ro;function Bo(t){return A(t)?zt(t,!0):Gt(t)}var K=Bo;var Lo=T(Object,"create"),c=Lo;function Fo(){this.__data__=c?c(null):{},this.size=0}var Ht=Fo;function No(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var qt=No;var zo="__lodash_hash_undefined__",Wo=Object.prototype,Uo=Wo.hasOwnProperty;function Go(t){var e=this.__data__;if(c){var r=e[t];return r===zo?void 0:r}return Uo.call(e,t)?e[t]:void 0}var $t=Go;var Ho=Object.prototype,qo=Ho.hasOwnProperty;function $o(t){var e=this.__data__;return c?e[t]!==void 0:qo.call(e,t)}var Kt=$o;var Ko="__lodash_hash_undefined__";function Vo(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=c&&e===void 0?Ko:e,this}var Vt=Vo;function I(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}I.prototype.clear=Ht;I.prototype.delete=qt;I.prototype.get=$t;I.prototype.has=Kt;I.prototype.set=Vt;var et=I;function ko(){this.__data__=[],this.size=0}var kt=ko;function Yo(t,e){for(var r=t.length;r--;)if(g(t[r][0],e))return r;return-1}var y=Yo;var Jo=Array.prototype,Xo=Jo.splice;function Zo(t){var e=this.__data__,r=y(e,t);if(r<0)return!1;var o=e.length-1;return r==o?e.pop():Xo.call(e,r,1),--this.size,!0}var Yt=Zo;function Qo(t){var e=this.__data__,r=y(e,t);return r<0?void 0:e[r][1]}var Jt=Qo;function ta(t){return y(this.__data__,t)>-1}var Xt=ta;function ea(t,e){var r=this.__data__,o=y(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}var Zt=ea;function C(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}C.prototype.clear=kt;C.prototype.delete=Yt;C.prototype.get=Jt;C.prototype.has=Xt;C.prototype.set=Zt;var b=C;var ra=T(d,"Map"),V=ra;function oa(){this.size=0,this.__data__={hash:new et,map:new(V||b),string:new et}}var Qt=oa;function aa(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var te=aa;function fa(t,e){var r=t.__data__;return te(e)?r[typeof e=="string"?"string":"hash"]:r.map}var v=fa;function sa(t){var e=v(this,t).delete(t);return this.size-=e?1:0,e}var ee=sa;function pa(t){return v(this,t).get(t)}var re=pa;function ia(t){return v(this,t).has(t)}var oe=ia;function na(t,e){var r=v(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}var ae=na;function P(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}P.prototype.clear=Qt;P.prototype.delete=ee;P.prototype.get=re;P.prototype.has=oe;P.prototype.set=ae;var fe=P;var ua=Wt(Object.getPrototypeOf,Object),k=ua;var la="[object Object]",ma=Function.prototype,da=Object.prototype,se=ma.toString,xa=da.hasOwnProperty,ca=se.call(Object);function ha(t){if(!x(t)||h(t)!=la)return!1;var e=k(t);if(e===null)return!0;var r=xa.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&se.call(r)==ca}var pe=ha;function ga(){this.__data__=new b,this.size=0}var ie=ga;function ya(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var ne=ya;function ba(t){return this.__data__.get(t)}var ue=ba;function va(t){return this.__data__.has(t)}var le=va;var _a=200;function Oa(t,e){var r=this.__data__;if(r instanceof b){var o=r.__data__;if(!V||o.length<_a-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new fe(o)}return r.set(t,e),this.size=r.size,this}var me=Oa;function S(t){var e=this.__data__=new b(t);this.size=e.size}S.prototype.clear=ie;S.prototype.delete=ne;S.prototype.get=ue;S.prototype.has=le;S.prototype.set=me;var de=S;var ge=typeof exports=="object"&&exports&&!exports.nodeType&&exports,xe=ge&&typeof module=="object"&&module&&!module.nodeType&&module,Ta=xe&&xe.exports===ge,ce=Ta?d.Buffer:void 0,he=ce?ce.allocUnsafe:void 0;function ja(t,e){if(e)return t.slice();var r=t.length,o=he?he(r):new t.constructor(r);return t.copy(o),o}var ye=ja;var wa=d.Uint8Array,rt=wa;function Aa(t){var e=new t.constructor(t.byteLength);return new rt(e).set(new rt(t)),e}var be=Aa;function Ia(t,e){var r=e?be(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var ve=Ia;function Ca(t){return typeof t.constructor=="function"&&!H(t)?ct(k(t)):{}}var _e=Ca;function Pa(t){return function(e,r,o){for(var a=-1,s=Object(e),p=o(e),f=p.length;f--;){var n=p[t?f:++a];if(r(s[n],n,s)===!1)break}return e}}var Oe=Pa;var Sa=Oe(),Te=Sa;function Ea(t,e,r){(r!==void 0&&!g(t[e],r)||r===void 0&&!(e in t))&&w(t,e,r)}var L=Ea;function Ma(t){return x(t)&&A(t)}var je=Ma;function Da(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var F=Da;function Ra(t){return Tt(t,K(t))}var we=Ra;function Ba(t,e,r,o,a,s,p){var f=F(t,r),n=F(e,r),m=p.get(n);if(m){L(t,r,m);return}var l=s?s(f,n,r+"",t,e,p):void 0,E=l===void 0;if(E){var J=D(n),X=!J&&q(n),at=!J&&!X&&$(n);l=n,J||X||at?D(f)?l=f:je(f)?l=gt(f):X?(E=!1,l=ye(n,!0)):at?(E=!1,l=ve(n,!0)):l=[]:pe(n)||R(n)?(l=f,R(f)?l=we(f):(!u(f)||O(f))&&(l=_e(n))):E=!1}E&&(p.set(n,l),a(l,n,o,s,p),p.delete(n)),L(t,r,l)}var Ae=Ba;function Ie(t,e,r,o,a){t!==e&&Te(e,function(s,p){if(a||(a=new de),u(s))Ae(t,e,p,r,Ie,o,a);else{var f=o?o(F(t,p),s,p+"",t,e,a):void 0;f===void 0&&(f=s),L(t,p,f)}},K)}var Ce=Ie;var La=Ct(function(t,e,r){Ce(t,e,r)}),Y=La;var ot=class{settings={client:"tera-fy",clientType:"esm"};init(e){let r=o=>`https://dev.tera-tools.com/api/tera-fy/${o}.js`;return Promise.resolve().then(()=>this.settings.clientType=="esm"?this.bootstrapperImport(r(this.settings.client)).then(o=>typeof o=="function"?o:Promise.reject("Tera-fy import didn't return a class")):Promise.reject(`Unsupported TERA-fy clientType "${this.settings.clientType}"`)).then(o=>{let a=new o;if(!a.mixin)throw new Error("TERA-fy client doesn't expose a mixin() method");a.mixin(this,a),Y(this.settings,a.settings,e||{})}).then(()=>{if(console.log("IAM",this),!this.init||typeof this.init!="function")throw new Error("Newly mixed-in TERA-fy client doesn't expose a init() method");if(!this.detectMode||typeof this.detectMode!="function")throw new Error("Newly mixed-in TERA-fy client doesn't expose a detectMode() method")}).then(()=>this.bootstrapperDeferredMethods.reduce((o,a)=>o.then(()=>a.method=="use"&&typeof a.args[0]=="string"?(console.log("TERA-FY DEFERRED-USE",a.args[0]),this.bootstrapperImport(r(a.args[0])).then(s=>typeof s=="function"?s:Promise.reject("Tera-fy plugin import didn't return a class")).then(s=>this.use(s,...a.args.slice(1)))):(console.log("TERA-FY DEFERRED-METHOD",a),Promise.resolve(this[a.method].apply(this,a.args)))),Promise.resolve())).then(()=>{delete this.bootstrapperDeferredMethods}).then(()=>console.log("TYBS","Init")).then(()=>this.init.call(this,e)).then(()=>this)}bootstrapperDeferredMethods=[];bootstrapperImport(e){return new Promise((r,o)=>{let a=`installTFyBS${Math.random().toString(36).slice(2)}`,s=document.createElement("script");s.type="module",s.textContent=`
1
+ var Pe=typeof global=="object"&&global&&global.Object===Object&&global,N=Pe;var Ce=typeof self=="object"&&self&&self.Object===Object&&self,Ee=N||Ce||Function("return this")(),d=Ee;var Me=d.Symbol,_=Me;var ft=Object.prototype,De=ft.hasOwnProperty,Re=ft.toString,M=_?_.toStringTag:void 0;function Be(t){var e=De.call(t,M),r=t[M];try{t[M]=void 0;var o=!0}catch{}var a=Re.call(t);return o&&(e?t[M]=r:delete t[M]),a}var st=Be;var Le=Object.prototype,Fe=Le.toString;function Ne(t){return Fe.call(t)}var pt=Ne;var ze="[object Null]",We="[object Undefined]",it=_?_.toStringTag:void 0;function Ue(t){return t==null?t===void 0?We:ze:it&&it in Object(t)?st(t):pt(t)}var h=Ue;function Ge(t){return t!=null&&typeof t=="object"}var x=Ge;var He=Array.isArray,D=He;function qe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var u=qe;function $e(t){return t}var z=$e;var Ke="[object AsyncFunction]",Ve="[object Function]",ke="[object GeneratorFunction]",Ye="[object Proxy]";function Je(t){if(!u(t))return!1;var e=h(t);return e==Ve||e==ke||e==Ke||e==Ye}var O=Je;var Xe=d["__core-js_shared__"],W=Xe;var nt=(function(){var t=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function Ze(t){return!!nt&&nt in t}var ut=Ze;var Qe=Function.prototype,tr=Qe.toString;function er(t){if(t!=null){try{return tr.call(t)}catch{}try{return t+""}catch{}}return""}var lt=er;var rr=/[\\^$.*+?()[\]{}|]/g,or=/^\[object .+?Constructor\]$/,ar=Function.prototype,fr=Object.prototype,sr=ar.toString,pr=fr.hasOwnProperty,ir=RegExp("^"+sr.call(pr).replace(rr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nr(t){if(!u(t)||ut(t))return!1;var e=O(t)?ir:or;return e.test(lt(t))}var mt=nr;function ur(t,e){return t?.[e]}var dt=ur;function lr(t,e){var r=dt(t,e);return mt(r)?r:void 0}var T=lr;var xt=Object.create,mr=(function(){function t(){}return function(e){if(!u(e))return{};if(xt)return xt(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),ct=mr;function dr(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var ht=dr;function xr(t,e){var r=-1,o=t.length;for(e||(e=Array(o));++r<o;)e[r]=t[r];return e}var gt=xr;var cr=800,hr=16,gr=Date.now;function yr(t){var e=0,r=0;return function(){var o=gr(),a=hr-(o-r);if(r=o,a>0){if(++e>=cr)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var yt=yr;function br(t){return function(){return t}}var bt=br;var vr=(function(){try{var t=T(Object,"defineProperty");return t({},"",{}),t}catch{}})(),j=vr;var _r=j?function(t,e){return j(t,"toString",{configurable:!0,enumerable:!1,value:bt(e),writable:!0})}:z,vt=_r;var Or=yt(vt),_t=Or;var Tr=9007199254740991,jr=/^(?:0|[1-9]\d*)$/;function wr(t,e){var r=typeof t;return e=e??Tr,!!e&&(r=="number"||r!="symbol"&&jr.test(t))&&t>-1&&t%1==0&&t<e}var U=wr;function Ar(t,e,r){e=="__proto__"&&j?j(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var w=Ar;function Ir(t,e){return t===e||t!==t&&e!==e}var g=Ir;var Sr=Object.prototype,Pr=Sr.hasOwnProperty;function Cr(t,e,r){var o=t[e];(!(Pr.call(t,e)&&g(o,r))||r===void 0&&!(e in t))&&w(t,e,r)}var Ot=Cr;function Er(t,e,r,o){var a=!r;r||(r={});for(var s=-1,p=e.length;++s<p;){var f=e[s],n=o?o(r[f],t[f],f,r,t):void 0;n===void 0&&(n=t[f]),a?w(r,f,n):Ot(r,f,n)}return r}var Tt=Er;var jt=Math.max;function Mr(t,e,r){return e=jt(e===void 0?t.length-1:e,0),function(){for(var o=arguments,a=-1,s=jt(o.length-e,0),p=Array(s);++a<s;)p[a]=o[e+a];a=-1;for(var f=Array(e+1);++a<e;)f[a]=o[a];return f[e]=r(p),ht(t,this,f)}}var wt=Mr;function Dr(t,e){return _t(wt(t,e,z),t+"")}var At=Dr;var Rr=9007199254740991;function Br(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Rr}var G=Br;function Lr(t){return t!=null&&G(t.length)&&!O(t)}var A=Lr;function Fr(t,e,r){if(!u(r))return!1;var o=typeof e;return(o=="number"?A(r)&&U(e,r.length):o=="string"&&e in r)?g(r[e],t):!1}var It=Fr;function Nr(t){return At(function(e,r){var o=-1,a=r.length,s=a>1?r[a-1]:void 0,p=a>2?r[2]:void 0;for(s=t.length>3&&typeof s=="function"?(a--,s):void 0,p&&It(r[0],r[1],p)&&(s=a<3?void 0:s,a=1),e=Object(e);++o<a;){var f=r[o];f&&t(e,f,o,s)}return e})}var St=Nr;var zr=Object.prototype;function Wr(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||zr;return t===r}var H=Wr;function Ur(t,e){for(var r=-1,o=Array(t);++r<t;)o[r]=e(r);return o}var Pt=Ur;var Gr="[object Arguments]";function Hr(t){return x(t)&&h(t)==Gr}var Z=Hr;var Ct=Object.prototype,qr=Ct.hasOwnProperty,$r=Ct.propertyIsEnumerable,Kr=Z((function(){return arguments})())?Z:function(t){return x(t)&&qr.call(t,"callee")&&!$r.call(t,"callee")},R=Kr;function Vr(){return!1}var Et=Vr;var Rt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mt=Rt&&typeof module=="object"&&module&&!module.nodeType&&module,kr=Mt&&Mt.exports===Rt,Dt=kr?d.Buffer:void 0,Yr=Dt?Dt.isBuffer:void 0,Jr=Yr||Et,q=Jr;var Xr="[object Arguments]",Zr="[object Array]",Qr="[object Boolean]",to="[object Date]",eo="[object Error]",ro="[object Function]",oo="[object Map]",ao="[object Number]",fo="[object Object]",so="[object RegExp]",po="[object Set]",io="[object String]",no="[object WeakMap]",uo="[object ArrayBuffer]",lo="[object DataView]",mo="[object Float32Array]",xo="[object Float64Array]",co="[object Int8Array]",ho="[object Int16Array]",go="[object Int32Array]",yo="[object Uint8Array]",bo="[object Uint8ClampedArray]",vo="[object Uint16Array]",_o="[object Uint32Array]",i={};i[mo]=i[xo]=i[co]=i[ho]=i[go]=i[yo]=i[bo]=i[vo]=i[_o]=!0;i[Xr]=i[Zr]=i[uo]=i[Qr]=i[lo]=i[to]=i[eo]=i[ro]=i[oo]=i[ao]=i[fo]=i[so]=i[po]=i[io]=i[no]=!1;function Oo(t){return x(t)&&G(t.length)&&!!i[h(t)]}var Bt=Oo;function To(t){return function(e){return t(e)}}var Lt=To;var Ft=typeof exports=="object"&&exports&&!exports.nodeType&&exports,B=Ft&&typeof module=="object"&&module&&!module.nodeType&&module,jo=B&&B.exports===Ft,Q=jo&&N.process,wo=(function(){try{var t=B&&B.require&&B.require("util").types;return t||Q&&Q.binding&&Q.binding("util")}catch{}})(),tt=wo;var Nt=tt&&tt.isTypedArray,Ao=Nt?Lt(Nt):Bt,$=Ao;var Io=Object.prototype,So=Io.hasOwnProperty;function Po(t,e){var r=D(t),o=!r&&R(t),a=!r&&!o&&q(t),s=!r&&!o&&!a&&$(t),p=r||o||a||s,f=p?Pt(t.length,String):[],n=f.length;for(var m in t)(e||So.call(t,m))&&!(p&&(m=="length"||a&&(m=="offset"||m=="parent")||s&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||U(m,n)))&&f.push(m);return f}var zt=Po;function Co(t,e){return function(r){return t(e(r))}}var Wt=Co;function Eo(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Ut=Eo;var Mo=Object.prototype,Do=Mo.hasOwnProperty;function Ro(t){if(!u(t))return Ut(t);var e=H(t),r=[];for(var o in t)o=="constructor"&&(e||!Do.call(t,o))||r.push(o);return r}var Gt=Ro;function Bo(t){return A(t)?zt(t,!0):Gt(t)}var K=Bo;var Lo=T(Object,"create"),c=Lo;function Fo(){this.__data__=c?c(null):{},this.size=0}var Ht=Fo;function No(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var qt=No;var zo="__lodash_hash_undefined__",Wo=Object.prototype,Uo=Wo.hasOwnProperty;function Go(t){var e=this.__data__;if(c){var r=e[t];return r===zo?void 0:r}return Uo.call(e,t)?e[t]:void 0}var $t=Go;var Ho=Object.prototype,qo=Ho.hasOwnProperty;function $o(t){var e=this.__data__;return c?e[t]!==void 0:qo.call(e,t)}var Kt=$o;var Ko="__lodash_hash_undefined__";function Vo(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=c&&e===void 0?Ko:e,this}var Vt=Vo;function I(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}I.prototype.clear=Ht;I.prototype.delete=qt;I.prototype.get=$t;I.prototype.has=Kt;I.prototype.set=Vt;var et=I;function ko(){this.__data__=[],this.size=0}var kt=ko;function Yo(t,e){for(var r=t.length;r--;)if(g(t[r][0],e))return r;return-1}var y=Yo;var Jo=Array.prototype,Xo=Jo.splice;function Zo(t){var e=this.__data__,r=y(e,t);if(r<0)return!1;var o=e.length-1;return r==o?e.pop():Xo.call(e,r,1),--this.size,!0}var Yt=Zo;function Qo(t){var e=this.__data__,r=y(e,t);return r<0?void 0:e[r][1]}var Jt=Qo;function ta(t){return y(this.__data__,t)>-1}var Xt=ta;function ea(t,e){var r=this.__data__,o=y(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}var Zt=ea;function S(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}S.prototype.clear=kt;S.prototype.delete=Yt;S.prototype.get=Jt;S.prototype.has=Xt;S.prototype.set=Zt;var b=S;var ra=T(d,"Map"),V=ra;function oa(){this.size=0,this.__data__={hash:new et,map:new(V||b),string:new et}}var Qt=oa;function aa(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var te=aa;function fa(t,e){var r=t.__data__;return te(e)?r[typeof e=="string"?"string":"hash"]:r.map}var v=fa;function sa(t){var e=v(this,t).delete(t);return this.size-=e?1:0,e}var ee=sa;function pa(t){return v(this,t).get(t)}var re=pa;function ia(t){return v(this,t).has(t)}var oe=ia;function na(t,e){var r=v(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}var ae=na;function P(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}P.prototype.clear=Qt;P.prototype.delete=ee;P.prototype.get=re;P.prototype.has=oe;P.prototype.set=ae;var fe=P;var ua=Wt(Object.getPrototypeOf,Object),k=ua;var la="[object Object]",ma=Function.prototype,da=Object.prototype,se=ma.toString,xa=da.hasOwnProperty,ca=se.call(Object);function ha(t){if(!x(t)||h(t)!=la)return!1;var e=k(t);if(e===null)return!0;var r=xa.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&se.call(r)==ca}var pe=ha;function ga(){this.__data__=new b,this.size=0}var ie=ga;function ya(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var ne=ya;function ba(t){return this.__data__.get(t)}var ue=ba;function va(t){return this.__data__.has(t)}var le=va;var _a=200;function Oa(t,e){var r=this.__data__;if(r instanceof b){var o=r.__data__;if(!V||o.length<_a-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new fe(o)}return r.set(t,e),this.size=r.size,this}var me=Oa;function C(t){var e=this.__data__=new b(t);this.size=e.size}C.prototype.clear=ie;C.prototype.delete=ne;C.prototype.get=ue;C.prototype.has=le;C.prototype.set=me;var de=C;var ge=typeof exports=="object"&&exports&&!exports.nodeType&&exports,xe=ge&&typeof module=="object"&&module&&!module.nodeType&&module,Ta=xe&&xe.exports===ge,ce=Ta?d.Buffer:void 0,he=ce?ce.allocUnsafe:void 0;function ja(t,e){if(e)return t.slice();var r=t.length,o=he?he(r):new t.constructor(r);return t.copy(o),o}var ye=ja;var wa=d.Uint8Array,rt=wa;function Aa(t){var e=new t.constructor(t.byteLength);return new rt(e).set(new rt(t)),e}var be=Aa;function Ia(t,e){var r=e?be(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var ve=Ia;function Sa(t){return typeof t.constructor=="function"&&!H(t)?ct(k(t)):{}}var _e=Sa;function Pa(t){return function(e,r,o){for(var a=-1,s=Object(e),p=o(e),f=p.length;f--;){var n=p[t?f:++a];if(r(s[n],n,s)===!1)break}return e}}var Oe=Pa;var Ca=Oe(),Te=Ca;function Ea(t,e,r){(r!==void 0&&!g(t[e],r)||r===void 0&&!(e in t))&&w(t,e,r)}var L=Ea;function Ma(t){return x(t)&&A(t)}var je=Ma;function Da(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var F=Da;function Ra(t){return Tt(t,K(t))}var we=Ra;function Ba(t,e,r,o,a,s,p){var f=F(t,r),n=F(e,r),m=p.get(n);if(m){L(t,r,m);return}var l=s?s(f,n,r+"",t,e,p):void 0,E=l===void 0;if(E){var J=D(n),X=!J&&q(n),at=!J&&!X&&$(n);l=n,J||X||at?D(f)?l=f:je(f)?l=gt(f):X?(E=!1,l=ye(n,!0)):at?(E=!1,l=ve(n,!0)):l=[]:pe(n)||R(n)?(l=f,R(f)?l=we(f):(!u(f)||O(f))&&(l=_e(n))):E=!1}E&&(p.set(n,l),a(l,n,o,s,p),p.delete(n)),L(t,r,l)}var Ae=Ba;function Ie(t,e,r,o,a){t!==e&&Te(e,function(s,p){if(a||(a=new de),u(s))Ae(t,e,p,r,Ie,o,a);else{var f=o?o(F(t,p),s,p+"",t,e,a):void 0;f===void 0&&(f=s),L(t,p,f)}},K)}var Se=Ie;var La=St(function(t,e,r){Se(t,e,r)}),Y=La;var ot=class{settings={client:"tera-fy",clientType:"esm"};init(e){let r=o=>`https://dev.tera-tools.com/api/tera-fy/${o}.js`;return Promise.resolve().then(()=>this.settings.clientType=="esm"?this.bootstrapperImport(r(this.settings.client)).then(o=>typeof o=="function"?o:Promise.reject("Tera-fy import didn't return a class")):Promise.reject(`Unsupported TERA-fy clientType "${this.settings.clientType}"`)).then(o=>{let a=new o;if(!a.mixin)throw new Error("TERA-fy client doesn't expose a mixin() method");a.mixin(this,a),Y(this.settings,a.settings,e||{})}).then(()=>{if(console.log("IAM",this),!this.init||typeof this.init!="function")throw new Error("Newly mixed-in TERA-fy client doesn't expose a init() method");if(!this.detectMode||typeof this.detectMode!="function")throw new Error("Newly mixed-in TERA-fy client doesn't expose a detectMode() method")}).then(()=>this.bootstrapperDeferredMethods.reduce((o,a)=>o.then(()=>a.method=="use"&&typeof a.args[0]=="string"?(console.log("TERA-FY DEFERRED-USE",a.args[0]),this.bootstrapperImport(r(a.args[0])).then(s=>typeof s=="function"?s:Promise.reject("Tera-fy plugin import didn't return a class")).then(s=>this.use(s,...a.args.slice(1)))):(console.log("TERA-FY DEFERRED-METHOD",a),Promise.resolve(this[a.method].apply(this,a.args)))),Promise.resolve())).then(()=>{delete this.bootstrapperDeferredMethods}).then(()=>console.log("TYBS","Init")).then(()=>this.init.call(this,e)).then(()=>this)}bootstrapperDeferredMethods=[];bootstrapperImport(e){return new Promise((r,o)=>{let a=`installTFyBS${Math.random().toString(36).slice(2)}`,s=document.createElement("script");s.type="module",s.textContent=`
2
2
  import mod from '${e}';
3
3
  window['installMod${a}'](mod);
4
4
  `;let p=()=>{delete window[`installMod${a}`],s.parentNode&&s.remove()};window[`installMod${a}`]=f=>{console.log("Accept module from",e,"=",f),r(f),p()},s.addEventListener("error",f=>{o(new Error(`Failed to load module script from ${e}. Event type: ${f.type}`)),p()}),document.head.append(s)})}constructor(e){e&&Y(this.settings,e),["set","setIfDev","use"].forEach(r=>{this[r]=(...o)=>(this.bootstrapperDeferredMethods.push({method:r,args:o}),this)})}};export{ot as default};
@@ -8,7 +8,7 @@ lodash-es/lodash.js:
8
8
  (**
9
9
  * @license
10
10
  * Lodash (Custom Build) <https://lodash.com/>
11
- * Build: `lodash modularize exports="es" -o ./`
11
+ * Build: `lodash modularize exports="es" --repo lodash/lodash#4.18.1 -o ./`
12
12
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
13
13
  * Released under MIT license <https://lodash.com/license>
14
14
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
@@ -1,12 +1,12 @@
1
- var jo=Object.defineProperty;var Ao=(t,e,r)=>e in t?jo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var p=(t,e,r)=>Ao(t,typeof e!="symbol"?e+"":e,r);var So=typeof global=="object"&&global&&global.Object===Object&&global,ut=So;var Io=typeof self=="object"&&self&&self.Object===Object&&self,_o=ut||Io||Function("return this")(),h=_o;var Eo=h.Symbol,y=Eo;var te=Object.prototype,Fo=te.hasOwnProperty,Co=te.toString,it=y?y.toStringTag:void 0;function Mo(t){var e=Fo.call(t,it),r=t[it];try{t[it]=void 0;var o=!0}catch{}var a=Co.call(t);return o&&(e?t[it]=r:delete t[it]),a}var ee=Mo;var No=Object.prototype,Ro=No.toString;function Lo(t){return Ro.call(t)}var re=Lo;var Bo="[object Null]",Do="[object Undefined]",oe=y?y.toStringTag:void 0;function ko(t){return t==null?t===void 0?Do:Bo:oe&&oe in Object(t)?ee(t):re(t)}var P=ko;function Uo(t){return t!=null&&typeof t=="object"}var T=Uo;var Go="[object Symbol]";function zo(t){return typeof t=="symbol"||T(t)&&P(t)==Go}var k=zo;function Ko(t,e){for(var r=-1,o=t==null?0:t.length,a=Array(o);++r<o;)a[r]=e(t[r],r,t);return a}var dt=Ko;var Wo=Array.isArray,x=Wo;var Yo=1/0,ae=y?y.prototype:void 0,ie=ae?ae.toString:void 0;function ne(t){if(typeof t=="string")return t;if(x(t))return dt(t,ne)+"";if(k(t))return ie?ie.call(t):"";var e=t+"";return e=="0"&&1/t==-Yo?"-0":e}var se=ne;function $o(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var O=$o;function Ho(t){return t}var fe=Ho;var Vo="[object AsyncFunction]",qo="[object Function]",Zo="[object GeneratorFunction]",Jo="[object Proxy]";function Xo(t){if(!O(t))return!1;var e=P(t);return e==qo||e==Zo||e==Vo||e==Jo}var ct=Xo;var Qo=h["__core-js_shared__"],ht=Qo;var pe=(function(){var t=/[^.]+$/.exec(ht&&ht.keys&&ht.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function ta(t){return!!pe&&pe in t}var le=ta;var ea=Function.prototype,ra=ea.toString;function oa(t){if(t!=null){try{return ra.call(t)}catch{}try{return t+""}catch{}}return""}var S=oa;var aa=/[\\^$.*+?()[\]{}|]/g,ia=/^\[object .+?Constructor\]$/,na=Function.prototype,sa=Object.prototype,fa=na.toString,pa=sa.hasOwnProperty,la=RegExp("^"+fa.call(pa).replace(aa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ma(t){if(!O(t)||le(t))return!1;var e=ct(t)?la:ia;return e.test(S(t))}var me=ma;function ua(t,e){return t==null?void 0:t[e]}var ue=ua;function da(t,e){var r=ue(t,e);return me(r)?r:void 0}var w=da;var ca=w(h,"WeakMap"),gt=ca;var de=Object.create,ha=(function(){function t(){}return function(e){if(!O(e))return{};if(de)return de(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),ce=ha;function ga(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var he=ga;function xa(t,e){var r=-1,o=t.length;for(e||(e=Array(o));++r<o;)e[r]=t[r];return e}var ge=xa;var ya=800,ba=16,va=Date.now;function Ta(t){var e=0,r=0;return function(){var o=va(),a=ba-(o-r);if(r=o,a>0){if(++e>=ya)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var xe=Ta;function wa(t){return function(){return t}}var ye=wa;var Pa=(function(){try{var t=w(Object,"defineProperty");return t({},"",{}),t}catch{}})(),U=Pa;var Oa=U?function(t,e){return U(t,"toString",{configurable:!0,enumerable:!1,value:ye(e),writable:!0})}:fe,be=Oa;var ja=xe(be),ve=ja;function Aa(t,e){for(var r=-1,o=t==null?0:t.length;++r<o&&e(t[r],r,t)!==!1;);return t}var Te=Aa;var Sa=9007199254740991,Ia=/^(?:0|[1-9]\d*)$/;function _a(t,e){var r=typeof t;return e=e==null?Sa:e,!!e&&(r=="number"||r!="symbol"&&Ia.test(t))&&t>-1&&t%1==0&&t<e}var G=_a;function Ea(t,e,r){e=="__proto__"&&U?U(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var xt=Ea;function Fa(t,e){return t===e||t!==t&&e!==e}var yt=Fa;var Ca=Object.prototype,Ma=Ca.hasOwnProperty;function Na(t,e,r){var o=t[e];(!(Ma.call(t,e)&&yt(o,r))||r===void 0&&!(e in t))&&xt(t,e,r)}var z=Na;function Ra(t,e,r,o){var a=!r;r||(r={});for(var n=-1,i=e.length;++n<i;){var s=e[n],f=o?o(r[s],t[s],s,r,t):void 0;f===void 0&&(f=t[s]),a?xt(r,s,f):z(r,s,f)}return r}var A=Ra;var we=Math.max;function La(t,e,r){return e=we(e===void 0?t.length-1:e,0),function(){for(var o=arguments,a=-1,n=we(o.length-e,0),i=Array(n);++a<n;)i[a]=o[e+a];a=-1;for(var s=Array(e+1);++a<e;)s[a]=o[a];return s[e]=r(i),he(t,this,s)}}var Pe=La;var Ba=9007199254740991;function Da(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Ba}var K=Da;function ka(t){return t!=null&&K(t.length)&&!ct(t)}var bt=ka;var Ua=Object.prototype;function Ga(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Ua;return t===r}var W=Ga;function za(t,e){for(var r=-1,o=Array(t);++r<t;)o[r]=e(r);return o}var Oe=za;var Ka="[object Arguments]";function Wa(t){return T(t)&&P(t)==Ka}var Gt=Wa;var je=Object.prototype,Ya=je.hasOwnProperty,$a=je.propertyIsEnumerable,Ha=Gt((function(){return arguments})())?Gt:function(t){return T(t)&&Ya.call(t,"callee")&&!$a.call(t,"callee")},Y=Ha;function Va(){return!1}var Ae=Va;var _e=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Se=_e&&typeof module=="object"&&module&&!module.nodeType&&module,qa=Se&&Se.exports===_e,Ie=qa?h.Buffer:void 0,Za=Ie?Ie.isBuffer:void 0,Ja=Za||Ae,vt=Ja;var Xa="[object Arguments]",Qa="[object Array]",ti="[object Boolean]",ei="[object Date]",ri="[object Error]",oi="[object Function]",ai="[object Map]",ii="[object Number]",ni="[object Object]",si="[object RegExp]",fi="[object Set]",pi="[object String]",li="[object WeakMap]",mi="[object ArrayBuffer]",ui="[object DataView]",di="[object Float32Array]",ci="[object Float64Array]",hi="[object Int8Array]",gi="[object Int16Array]",xi="[object Int32Array]",yi="[object Uint8Array]",bi="[object Uint8ClampedArray]",vi="[object Uint16Array]",Ti="[object Uint32Array]",d={};d[di]=d[ci]=d[hi]=d[gi]=d[xi]=d[yi]=d[bi]=d[vi]=d[Ti]=!0;d[Xa]=d[Qa]=d[mi]=d[ti]=d[ui]=d[ei]=d[ri]=d[oi]=d[ai]=d[ii]=d[ni]=d[si]=d[fi]=d[pi]=d[li]=!1;function wi(t){return T(t)&&K(t.length)&&!!d[P(t)]}var Ee=wi;function Pi(t){return function(e){return t(e)}}var $=Pi;var Fe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,nt=Fe&&typeof module=="object"&&module&&!module.nodeType&&module,Oi=nt&&nt.exports===Fe,zt=Oi&&ut.process,ji=(function(){try{var t=nt&&nt.require&&nt.require("util").types;return t||zt&&zt.binding&&zt.binding("util")}catch{}})(),I=ji;var Ce=I&&I.isTypedArray,Ai=Ce?$(Ce):Ee,Me=Ai;var Si=Object.prototype,Ii=Si.hasOwnProperty;function _i(t,e){var r=x(t),o=!r&&Y(t),a=!r&&!o&&vt(t),n=!r&&!o&&!a&&Me(t),i=r||o||a||n,s=i?Oe(t.length,String):[],f=s.length;for(var l in t)(e||Ii.call(t,l))&&!(i&&(l=="length"||a&&(l=="offset"||l=="parent")||n&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||G(l,f)))&&s.push(l);return s}var Tt=_i;function Ei(t,e){return function(r){return t(e(r))}}var wt=Ei;var Fi=wt(Object.keys,Object),Ne=Fi;var Ci=Object.prototype,Mi=Ci.hasOwnProperty;function Ni(t){if(!W(t))return Ne(t);var e=[];for(var r in Object(t))Mi.call(t,r)&&r!="constructor"&&e.push(r);return e}var Re=Ni;function Ri(t){return bt(t)?Tt(t):Re(t)}var H=Ri;function Li(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Le=Li;var Bi=Object.prototype,Di=Bi.hasOwnProperty;function ki(t){if(!O(t))return Le(t);var e=W(t),r=[];for(var o in t)o=="constructor"&&(e||!Di.call(t,o))||r.push(o);return r}var Be=ki;function Ui(t){return bt(t)?Tt(t,!0):Be(t)}var V=Ui;var Gi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zi=/^\w*$/;function Ki(t,e){if(x(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||k(t)?!0:zi.test(t)||!Gi.test(t)||e!=null&&t in Object(e)}var De=Ki;var Wi=w(Object,"create"),_=Wi;function Yi(){this.__data__=_?_(null):{},this.size=0}var ke=Yi;function $i(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Ue=$i;var Hi="__lodash_hash_undefined__",Vi=Object.prototype,qi=Vi.hasOwnProperty;function Zi(t){var e=this.__data__;if(_){var r=e[t];return r===Hi?void 0:r}return qi.call(e,t)?e[t]:void 0}var Ge=Zi;var Ji=Object.prototype,Xi=Ji.hasOwnProperty;function Qi(t){var e=this.__data__;return _?e[t]!==void 0:Xi.call(e,t)}var ze=Qi;var tn="__lodash_hash_undefined__";function en(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=_&&e===void 0?tn:e,this}var Ke=en;function q(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}q.prototype.clear=ke;q.prototype.delete=Ue;q.prototype.get=Ge;q.prototype.has=ze;q.prototype.set=Ke;var Kt=q;function rn(){this.__data__=[],this.size=0}var We=rn;function on(t,e){for(var r=t.length;r--;)if(yt(t[r][0],e))return r;return-1}var C=on;var an=Array.prototype,nn=an.splice;function sn(t){var e=this.__data__,r=C(e,t);if(r<0)return!1;var o=e.length-1;return r==o?e.pop():nn.call(e,r,1),--this.size,!0}var Ye=sn;function fn(t){var e=this.__data__,r=C(e,t);return r<0?void 0:e[r][1]}var $e=fn;function pn(t){return C(this.__data__,t)>-1}var He=pn;function ln(t,e){var r=this.__data__,o=C(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}var Ve=ln;function Z(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}Z.prototype.clear=We;Z.prototype.delete=Ye;Z.prototype.get=$e;Z.prototype.has=He;Z.prototype.set=Ve;var M=Z;var mn=w(h,"Map"),N=mn;function un(){this.size=0,this.__data__={hash:new Kt,map:new(N||M),string:new Kt}}var qe=un;function dn(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Ze=dn;function cn(t,e){var r=t.__data__;return Ze(e)?r[typeof e=="string"?"string":"hash"]:r.map}var R=cn;function hn(t){var e=R(this,t).delete(t);return this.size-=e?1:0,e}var Je=hn;function gn(t){return R(this,t).get(t)}var Xe=gn;function xn(t){return R(this,t).has(t)}var Qe=xn;function yn(t,e){var r=R(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}var tr=yn;function J(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}J.prototype.clear=qe;J.prototype.delete=Je;J.prototype.get=Xe;J.prototype.has=Qe;J.prototype.set=tr;var st=J;var bn="Expected a function";function Wt(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(bn);var r=function(){var o=arguments,a=e?e.apply(this,o):o[0],n=r.cache;if(n.has(a))return n.get(a);var i=t.apply(this,o);return r.cache=n.set(a,i)||n,i};return r.cache=new(Wt.Cache||st),r}Wt.Cache=st;var er=Wt;var vn=500;function Tn(t){var e=er(t,function(o){return r.size===vn&&r.clear(),o}),r=e.cache;return e}var rr=Tn;var wn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pn=/\\(\\)?/g,On=rr(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(wn,function(r,o,a,n){e.push(a?n.replace(Pn,"$1"):o||r)}),e}),or=On;function jn(t){return t==null?"":se(t)}var ar=jn;function An(t,e){return x(t)?t:De(t,e)?[t]:or(ar(t))}var j=An;var Sn=1/0;function In(t){if(typeof t=="string"||k(t))return t;var e=t+"";return e=="0"&&1/t==-Sn?"-0":e}var L=In;function _n(t,e){e=j(e,t);for(var r=0,o=e.length;t!=null&&r<o;)t=t[L(e[r++])];return r&&r==o?t:void 0}var Pt=_n;function En(t,e){for(var r=-1,o=e.length,a=t.length;++r<o;)t[a+r]=e[r];return t}var X=En;var ir=y?y.isConcatSpreadable:void 0;function Fn(t){return x(t)||Y(t)||!!(ir&&t&&t[ir])}var nr=Fn;function sr(t,e,r,o,a){var n=-1,i=t.length;for(r||(r=nr),a||(a=[]);++n<i;){var s=t[n];e>0&&r(s)?e>1?sr(s,e-1,r,o,a):X(a,s):o||(a[a.length]=s)}return a}var fr=sr;function Cn(t){var e=t==null?0:t.length;return e?fr(t,1):[]}var pr=Cn;function Mn(t){return ve(Pe(t,void 0,pr),t+"")}var Ot=Mn;var Nn=wt(Object.getPrototypeOf,Object),Q=Nn;var Rn="[object Object]",Ln=Function.prototype,Bn=Object.prototype,lr=Ln.toString,Dn=Bn.hasOwnProperty,kn=lr.call(Object);function Un(t){if(!T(t)||P(t)!=Rn)return!1;var e=Q(t);if(e===null)return!0;var r=Dn.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&lr.call(r)==kn}var mr=Un;function Gn(t,e,r){var o=-1,a=t.length;e<0&&(e=-e>a?0:a+e),r=r>a?a:r,r<0&&(r+=a),a=e>r?0:r-e>>>0,e>>>=0;for(var n=Array(a);++o<a;)n[o]=t[o+e];return n}var ur=Gn;function zn(){this.__data__=new M,this.size=0}var dr=zn;function Kn(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var cr=Kn;function Wn(t){return this.__data__.get(t)}var hr=Wn;function Yn(t){return this.__data__.has(t)}var gr=Yn;var $n=200;function Hn(t,e){var r=this.__data__;if(r instanceof M){var o=r.__data__;if(!N||o.length<$n-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new st(o)}return r.set(t,e),this.size=r.size,this}var xr=Hn;function tt(t){var e=this.__data__=new M(t);this.size=e.size}tt.prototype.clear=dr;tt.prototype.delete=cr;tt.prototype.get=hr;tt.prototype.has=gr;tt.prototype.set=xr;var yr=tt;function Vn(t,e){return t&&A(e,H(e),t)}var br=Vn;function qn(t,e){return t&&A(e,V(e),t)}var vr=qn;var Or=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Tr=Or&&typeof module=="object"&&module&&!module.nodeType&&module,Zn=Tr&&Tr.exports===Or,wr=Zn?h.Buffer:void 0,Pr=wr?wr.allocUnsafe:void 0;function Jn(t,e){if(e)return t.slice();var r=t.length,o=Pr?Pr(r):new t.constructor(r);return t.copy(o),o}var jr=Jn;function Xn(t,e){for(var r=-1,o=t==null?0:t.length,a=0,n=[];++r<o;){var i=t[r];e(i,r,t)&&(n[a++]=i)}return n}var Ar=Xn;function Qn(){return[]}var jt=Qn;var ts=Object.prototype,es=ts.propertyIsEnumerable,Sr=Object.getOwnPropertySymbols,rs=Sr?function(t){return t==null?[]:(t=Object(t),Ar(Sr(t),function(e){return es.call(t,e)}))}:jt,et=rs;function os(t,e){return A(t,et(t),e)}var Ir=os;var as=Object.getOwnPropertySymbols,is=as?function(t){for(var e=[];t;)X(e,et(t)),t=Q(t);return e}:jt,At=is;function ns(t,e){return A(t,At(t),e)}var _r=ns;function ss(t,e,r){var o=e(t);return x(t)?o:X(o,r(t))}var St=ss;function fs(t){return St(t,H,et)}var Er=fs;function ps(t){return St(t,V,At)}var It=ps;var ls=w(h,"DataView"),_t=ls;var ms=w(h,"Promise"),Et=ms;var us=w(h,"Set"),Ft=us;var Fr="[object Map]",ds="[object Object]",Cr="[object Promise]",Mr="[object Set]",Nr="[object WeakMap]",Rr="[object DataView]",cs=S(_t),hs=S(N),gs=S(Et),xs=S(Ft),ys=S(gt),B=P;(_t&&B(new _t(new ArrayBuffer(1)))!=Rr||N&&B(new N)!=Fr||Et&&B(Et.resolve())!=Cr||Ft&&B(new Ft)!=Mr||gt&&B(new gt)!=Nr)&&(B=function(t){var e=P(t),r=e==ds?t.constructor:void 0,o=r?S(r):"";if(o)switch(o){case cs:return Rr;case hs:return Fr;case gs:return Cr;case xs:return Mr;case ys:return Nr}return e});var rt=B;var bs=Object.prototype,vs=bs.hasOwnProperty;function Ts(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&vs.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Lr=Ts;var ws=h.Uint8Array,Yt=ws;function Ps(t){var e=new t.constructor(t.byteLength);return new Yt(e).set(new Yt(t)),e}var ot=Ps;function Os(t,e){var r=e?ot(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Br=Os;var js=/\w*$/;function As(t){var e=new t.constructor(t.source,js.exec(t));return e.lastIndex=t.lastIndex,e}var Dr=As;var kr=y?y.prototype:void 0,Ur=kr?kr.valueOf:void 0;function Ss(t){return Ur?Object(Ur.call(t)):{}}var Gr=Ss;function Is(t,e){var r=e?ot(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var zr=Is;var _s="[object Boolean]",Es="[object Date]",Fs="[object Map]",Cs="[object Number]",Ms="[object RegExp]",Ns="[object Set]",Rs="[object String]",Ls="[object Symbol]",Bs="[object ArrayBuffer]",Ds="[object DataView]",ks="[object Float32Array]",Us="[object Float64Array]",Gs="[object Int8Array]",zs="[object Int16Array]",Ks="[object Int32Array]",Ws="[object Uint8Array]",Ys="[object Uint8ClampedArray]",$s="[object Uint16Array]",Hs="[object Uint32Array]";function Vs(t,e,r){var o=t.constructor;switch(e){case Bs:return ot(t);case _s:case Es:return new o(+t);case Ds:return Br(t,r);case ks:case Us:case Gs:case zs:case Ks:case Ws:case Ys:case $s:case Hs:return zr(t,r);case Fs:return new o;case Cs:case Rs:return new o(t);case Ms:return Dr(t);case Ns:return new o;case Ls:return Gr(t)}}var Kr=Vs;function qs(t){return typeof t.constructor=="function"&&!W(t)?ce(Q(t)):{}}var Wr=qs;var Zs="[object Map]";function Js(t){return T(t)&&rt(t)==Zs}var Yr=Js;var $r=I&&I.isMap,Xs=$r?$($r):Yr,Hr=Xs;var Qs="[object Set]";function tf(t){return T(t)&&rt(t)==Qs}var Vr=tf;var qr=I&&I.isSet,ef=qr?$(qr):Vr,Zr=ef;var rf=1,of=2,af=4,Jr="[object Arguments]",nf="[object Array]",sf="[object Boolean]",ff="[object Date]",pf="[object Error]",Xr="[object Function]",lf="[object GeneratorFunction]",mf="[object Map]",uf="[object Number]",Qr="[object Object]",df="[object RegExp]",cf="[object Set]",hf="[object String]",gf="[object Symbol]",xf="[object WeakMap]",yf="[object ArrayBuffer]",bf="[object DataView]",vf="[object Float32Array]",Tf="[object Float64Array]",wf="[object Int8Array]",Pf="[object Int16Array]",Of="[object Int32Array]",jf="[object Uint8Array]",Af="[object Uint8ClampedArray]",Sf="[object Uint16Array]",If="[object Uint32Array]",u={};u[Jr]=u[nf]=u[yf]=u[bf]=u[sf]=u[ff]=u[vf]=u[Tf]=u[wf]=u[Pf]=u[Of]=u[mf]=u[uf]=u[Qr]=u[df]=u[cf]=u[hf]=u[gf]=u[jf]=u[Af]=u[Sf]=u[If]=!0;u[pf]=u[Xr]=u[xf]=!1;function Ct(t,e,r,o,a,n){var i,s=e&rf,f=e&of,l=e&af;if(r&&(i=a?r(t,o,a,n):r(t)),i!==void 0)return i;if(!O(t))return t;var b=x(t);if(b){if(i=Lr(t),!s)return ge(t,i)}else{var g=rt(t),D=g==Xr||g==lf;if(vt(t))return jr(t,s);if(g==Qr||g==Jr||D&&!a){if(i=f||D?{}:Wr(t),!s)return f?_r(t,vr(i,t)):Ir(t,br(i,t))}else{if(!u[g])return a?t:{};i=Kr(t,g,s)}}n||(n=new yr);var at=n.get(t);if(at)return at;n.set(t,i),Zr(t)?t.forEach(function(v){i.add(Ct(v,e,r,v,t,n))}):Hr(t)&&t.forEach(function(v,m){i.set(m,Ct(v,e,r,m,t,n))});var ft=l?f?It:Er:f?V:H,pt=b?void 0:ft(t);return Te(pt||t,function(v,m){pt&&(m=v,v=t[m]),z(i,m,Ct(v,e,r,m,t,n))}),i}var Mt=Ct;var _f=1,Ef=4;function Ff(t){return Mt(t,_f|Ef)}var $t=Ff;function Cf(t,e){return t!=null&&e in Object(t)}var to=Cf;function Mf(t,e,r){e=j(e,t);for(var o=-1,a=e.length,n=!1;++o<a;){var i=L(e[o]);if(!(n=t!=null&&r(t,i)))break;t=t[i]}return n||++o!=a?n:(a=t==null?0:t.length,!!a&&K(a)&&G(i,a)&&(x(t)||Y(t)))}var eo=Mf;function Nf(t,e){return t!=null&&eo(t,e,to)}var ro=Nf;function Rf(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var oo=Rf;function Lf(t,e){return e.length<2?t:Pt(t,ur(e,0,-1))}var ao=Lf;var Bf=Object.prototype,Df=Bf.hasOwnProperty;function kf(t,e){e=j(e,t);var r=-1,o=e.length;if(!o)return!0;for(var a=t==null||typeof t!="object"&&typeof t!="function";++r<o;){var n=e[r];if(typeof n=="string"){if(n==="__proto__"&&!Df.call(t,"__proto__"))return!1;if(n==="constructor"&&r+1<o&&typeof e[r+1]=="string"&&e[r+1]==="prototype"){if(a&&r===0)continue;return!1}}}var i=ao(t,e);return i==null||delete i[L(oo(e))]}var io=kf;function Uf(t){return mr(t)?void 0:t}var no=Uf;var Gf=1,zf=2,Kf=4,Wf=Ot(function(t,e){var r={};if(t==null)return r;var o=!1;e=dt(e,function(n){return n=j(n,t),o||(o=n.length>1),n}),A(t,It(t),r),o&&(r=Mt(r,Gf|zf|Kf,no));for(var a=e.length;a--;)io(r,e[a]);return r}),Ht=Wf;function Yf(t,e,r,o){if(!O(t))return t;e=j(e,t);for(var a=-1,n=e.length,i=n-1,s=t;s!=null&&++a<n;){var f=L(e[a]),l=r;if(f==="__proto__"||f==="constructor"||f==="prototype")return t;if(a!=i){var b=s[f];l=o?o(b,f,s):void 0,l===void 0&&(l=O(b)?b:G(e[a+1])?[]:{})}z(s,f,l),s=s[f]}return t}var so=Yf;function $f(t,e,r){for(var o=-1,a=e.length,n={};++o<a;){var i=e[o],s=Pt(t,i);r(s,i)&&so(n,j(i,t),s)}return n}var fo=$f;function Hf(t,e){return fo(t,e,function(r,o){return ro(t,o)})}var po=Hf;var Vf=Ot(function(t,e){return t==null?{}:po(t,e)}),Nt=Vf;function lo(t){return{all:t=t||new Map,on:function(e,r){var o=t.get(e);o?o.push(r):t.set(e,[r])},off:function(e,r){var o=t.get(e);o&&(r?o.splice(o.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var o=t.get(e);o&&o.slice().map(function(a){a(r)}),(o=t.get("*"))&&o.slice().map(function(a){a(e,r)})}}}var mo="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Vt=(t=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=mo[r[t]&63];return e};var qf="Invalid number",Zf="Invalid rounding method";var Rt="jedec";var co="bits",ho="byte",go="bytes",Jf="kbit";var xo="array",Xf="function",yo="object",Qf="string",bo="exponent",tp="round";var Lt={symbol:{iec:{bits:["bit","Kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["bit","Kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},fullform:{iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]}},ep=[1,1024,1048576,1073741824,1099511627776,0x4000000000000,1152921504606847e3,11805916207174113e5,12089258196146292e8],rp=[1,1e3,1e6,1e9,1e12,1e15,1e18,1e21,1e24],op=Math.log(1024),ap=Math.log(1e3),uo={si:{isDecimal:!0,ceil:1e3,actualStandard:Rt},iec:{isDecimal:!1,ceil:1024,actualStandard:"iec"},[Rt]:{isDecimal:!1,ceil:1024,actualStandard:Rt}};function ip(t,e){return uo[t]?uo[t]:e===2?{isDecimal:!1,ceil:1024,actualStandard:"iec"}:{isDecimal:!0,ceil:1e3,actualStandard:Rt}}function np(t,e,r,o,a,n,i,s){let f=[];f[0]=t>0?0 .toPrecision(t):0;let l=f[1]=Lt.symbol[e][r?co:go][0];return i===bo?0:(o[f[1]]&&(f[1]=o[f[1]]),a&&(f[1]=n[0]||Lt.fullform[e][0]+(r?"bit":ho)),i===xo?f:i===yo?{value:f[0],symbol:f[1],exponent:0,unit:l}:f.join(s))}function vo(t,e,r,o,a){let n=r?rp[e]:ep[e],i=t/n;return o&&(i*=8,i>=a&&e<8&&(i/=a,e++)),{result:i,e}}function sp(t,e,r,o,a,n,i,s,f){let l=t.toPrecision(e);if(l.includes("e")&&r<8){r++;let{result:b}=vo(o,r,a,n,i),g=f>0?Math.pow(10,f):1;l=(g===1?s(b):s(b*g)/g).toPrecision(e)}return{value:l,e:r}}function fp(t,e,r,o,a,n){let i=t;if(e===!0?i=i.toLocaleString():e.length>0?i=i.toLocaleString(e,r):o.length>0&&(i=i.toString().replace(".",o)),a&&n>0){let s=i.toString(),f=o||(s.match(/(\D)/g)||[]).pop()||".",l=s.split(f),b=l[1]||"",g=b.length,D=n-g;i=`${l[0]}${f}${b.padEnd(g+D,"0")}`}return i}function To(t,{bits:e=!1,pad:r=!1,base:o=-1,round:a=2,locale:n="",localeOptions:i={},separator:s="",spacer:f=" ",symbols:l={},standard:b="",output:g=Qf,fullform:D=!1,fullforms:at=[],exponent:ft=-1,roundingMethod:pt=tp,precision:v=0}={}){let m=ft,F=Number(t),c=[],Bt=0,Zt="",{isDecimal:lt,ceil:Dt,actualStandard:kt}=ip(b,o),Jt=D===!0,Xt=F<0,mt=Math[pt];if(typeof t!="bigint"&&isNaN(t))throw new TypeError(qf);if(typeof mt!==Xf)throw new TypeError(Zf);if(Xt&&(F=-F),F===0)return np(v,kt,e,l,Jt,at,g,f);if((m===-1||isNaN(m))&&(m=Math.floor(lt?Math.log(F)/ap:Math.log(F)/op),m<0&&(m=0)),m>8&&(v>0&&(v+=8-m),m=8),g===bo)return m;let{result:wo,e:Po}=vo(F,m,lt,e,Dt);Bt=wo,m=Po;let Ut=m>0&&a>0?Math.pow(10,a):1;if(c[0]=Ut===1?mt(Bt):mt(Bt*Ut)/Ut,c[0]===Dt&&m<8&&ft===-1&&(c[0]=1,m++),v>0){let Qt=sp(c[0],v,m,F,lt,e,Dt,mt,a);c[0]=Qt.value,m=Qt.e}let Oo=Lt.symbol[kt][e?co:go];return Zt=c[1]=lt&&m===1?e?Jf:"kB":Oo[m],Xt&&(c[0]=-c[0]),l[c[1]]&&(c[1]=l[c[1]]),c[0]=fp(c[0],n,i,s,r,a),Jt&&(c[1]=at[m]||Lt.fullform[kt][m]+(e?"bit":ho)+(c[0]===1?"":"s")),g===xo?c:g===yo?{value:c[0],symbol:c[1],exponent:m,unit:Zt}:f===" "?`${c[0]} ${c[1]}`:c.join(f)}var E=class t{constructor(e){p(this,"_tera");p(this,"id");p(this,"sbId");p(this,"name");p(this,"icon");p(this,"path");p(this,"url");p(this,"teraUrl");p(this,"parsedName");p(this,"created");p(this,"createdFormatted");p(this,"modified");p(this,"modifiedFormatted");p(this,"accessed");p(this,"accessedFormatted");p(this,"size");p(this,"sizeFormatted");p(this,"mime");p(this,"meta",{});p(this,"isFolder");p(this,"files");var o;if(!e.tera)throw new Error("Basic file requires a `tera` key to access the Tera instance");Object.assign(this,Ht(e,"encodeIdFunction")),e.encodeIdFunction&&typeof e.encodeIdFunction=="function"&&(this.id=e.encodeIdFunction(this.id));let r=this.tera;Object.defineProperty(this,"_tera",{enumerable:!1,configurable:!1,get(){return r}}),delete this.tera,this.created&&typeof this.created=="string"&&(this.created=new Date(this.created)),this.modified&&typeof this.modified=="string"&&(this.modified=new Date(this.modified)),this.accessed&&typeof this.accessed=="string"&&(this.accessed=new Date(this.accessed)),this.isFolder&&(this.files=(o=this.files)==null?void 0:o.map(a=>{let n=a.path.split(/\//).slice(3).join("/"),i=this.url+"/"+a.name;return a.meta.reflib&&(i=i.replace(/\/project\/download\//,"/project/library/")),new t({tera:this._tera,...a,sbId:a.id,id:a.path,encodeIdFunction:e.encodeIdFunction,path:n,url:i})})),this.teraUrl=this.url.replace(/^https?:\/\/(?:.+?)\/projects\/(?:.+?)\/project\/(.+)$/,"/project/$1"),this.sizeFormatted=To(this.size||0,{spacer:""}),this.createdFormatted=this.created?this.created.toLocaleDateString():"Unknown created date",this.modifiedFormatted=this.modified?this.modified.toLocaleDateString():"Unknown modified date",this.accessedFormatted=this.accessed?this.accessed.toLocaleDateString():"Unknown access date"}getContents(e){return this._tera.getProjectFileContents(this.id,e)}setContents(e){return this._tera.setProjectFileContents(this.id,e,{})}getRefs(){return this._tera.getProjectLibrary(this.id)}setRefs(e){return this._tera.setProjectLibrary(this.id,e)}serialize(){return Nt(this,["id","sbId","name","icon","path","url","parsedName","created","modified","accessed","size","mime","meta"])}static deserialize(e){let r=Nt(e,["tera","id","sbId","name","icon","path","url","parsedName","created","modified","accessed","size","mime","meta"]);return new t(r)}};var qt=class{constructor(e){p(this,"settings",{session:null,devMode:!1,verbosity:1,mode:"detect",modeTimeout:300,modeFallback:"child",modeOverrides:{child(e){e.siteUrl=="https://tera-tools.com/embed"&&(e.siteUrl="https://dev.tera-tools.com/embed")}},siteUrl:"https://tera-tools.com/embed",restrictOrigin:"*",frameSandbox:["allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-popups-to-escape-sandbox","allow-presentation","allow-same-origin","allow-scripts","allow-top-navigation"],handshakeInterval:1e3,handshakeTimeout:1e4,debugPaths:null});p(this,"events",lo());p(this,"dom",{el:null,iframe:null,popup:null,stylesheet:null});p(this,"methods",["handshake","setServerVerbosity","getUser","requireUser","getCredentials","getKindeToken","bindProject","getProject","getProjects","setActiveProject","requireProject","selectProject","getNamespace","setNamespace","listNamespaces","getProjectState","setProjectState","setProjectStateDefaults","setProjectStateRefresh","getProjectFileContents","deleteProjectFile","setProjectFileContents","createProjectFolder","deleteProjectFolder","selectProjectLibrary","getProjectLibrary","setProjectLibrary","projectLog","setPage","uiAlert","uiConfirm","uiJson","uiPanic","uiProgress","uiPrompt","uiThrow","uiSplat","uiWindow"]);p(this,"plugins",[]);p(this,"namespaces",{});p(this,"acceptPostboxes",{});p(this,"initPromise",null);e&&this.set(e)}send(e){let r=Vt();return this.acceptPostboxes[r]={},this.acceptPostboxes[r].promise=new Promise((o,a)=>{Object.assign(this.acceptPostboxes[r],{resolve:o,reject:a}),this.sendRaw({id:r,...e})}),this.acceptPostboxes[r].promise}sendRaw(e){let r;try{if(r={TERA:1,id:e.id||Vt(),...$t(e)},this.settings.mode=="parent")window.parent.postMessage(r,this.settings.restrictOrigin);else if(this.settings.mode=="child")this.dom.iframe.contentWindow.postMessage(r,this.settings.restrictOrigin);else if(this.settings.mode=="popup")this.dom.popup.postMessage(r,this.settings.restrictOrigin);else throw this.settings.mode=="detect"?new Error("Call init() or detectMode() before trying to send data to determine the mode"):new Error(`Unknown TERA communication mode "${this.settings.mode}"`)}catch(o){throw this.debug("ERROR",1,"Message compose client->server:",o),this.debug("ERROR",1,"Attempted to dispatch payload client->server",r),o}}rpc(e,...r){return this.send({action:"rpc",method:e,args:r})}acceptMessage(e){if(e.origin==window.location.origin)return Promise.resolve();let r=e.data;return!r.TERA||!r.id?Promise.resolve():(this.debug("INFO",3,"Received message",r),(r==null?void 0:r.action)=="response"&&this.acceptPostboxes[r.id]?(r.isError===!0?this.acceptPostboxes[r.id].reject(r.response):this.acceptPostboxes[r.id].resolve(r.response),Promise.resolve()):(r==null?void 0:r.action)=="rpc"?Promise.resolve().then(()=>this[r.method].apply(this,r.args)).then(o=>this.sendRaw({id:r.id,action:"response",response:o})).catch(o=>{console.warn(`TERA-FY client threw on RPC:${r.method}:`,o),this.sendRaw({id:r.id,action:"response",isError:!0,response:o&&o.toString()})}):(r==null?void 0:r.action)=="event"?Promise.resolve().then(()=>this.events.emit(r.event,...r.payload)).catch(o=>{throw console.warn(`TERA-FY client threw while handling emitted event "${r.event}"`,{message:r}),o}):r!=null&&r.id?(this.debug("INFO",3,`Ignoring message ID ${r.id} - was meant for someone else?`),Promise.resolve()):(this.debug("INFO",3,"Unexpected incoming TERA-FY CLIENT message",{message:r}),Promise.resolve()))}mountNamespace(e){if(!/^[\w-]+$/.test(e))throw new Error("Namespaces must be alphanumeric + hyphens + underscores");return this.namespaces[e]?Promise.resolve(this.namespaces[e]):Promise.resolve().then(()=>this._mountNamespace(e)).then(()=>this.namespaces[e]||Promise.reject(`teraFy.mountNamespace('${e}') resolved but no namespace has been mounted`))}_mountNamespace(e){throw console.warn(`teraFy._mountNamespace() for ${e} has not been overridden by a TERA-fy plugin, load one to add this functionality for your preferred framework`),new Error("teraFy._mountNamespace() is not supported")}unmountNamespace(e){return this.namespaces[e]?this._unmountNamespace(e):Promise.resolve()}_unmountNamespace(e){console.warn(`teraFy.unbindNamespace() for ${e} has not been overridden by a TERA-fy plugin, load one to add this functionality for your preferred framework`)}init(e){if(e&&this.set(e),this.initPromise)return this.initPromise;window.addEventListener("message",this.acceptMessage.bind(this));let r=this;return this.initPromise=Promise.resolve().then(()=>{var o;return(o=this.settings).session||(o.session="tfy-"+this.getEntropicString(16))}).then(()=>this.debug("INFO",4,"[0/6] Init","Session",this.settings.session,"against",this.settings.siteUrl)).then(()=>{this.settings.devMode&&(this.settings.debugPaths?this.settings.debugPaths=this.settings.debugPaths.map(o=>Array.isArray(o)?o.join("."):typeof o=="string"?o:(()=>{throw new Error("Unknown path type - should be an array or string in dotted notation")})()):this.settings.debugPaths=null,this.debug("INFO",0,"Watching state paths",this.settings.debugPaths))}).then(()=>this.detectMode()).then(o=>{if(this.debug("INFO",4,"[1/6] Setting client mode to",o),this.settings.mode=o,this.settings.modeOverrides[o])return this.debug("INFO",4,"[1/6] Applying specific config overrides for mode",o),this.settings.modeOverrides[o](this.settings)}).then(()=>this.debug("INFO",4,"[2/6] Injecting comms + styles + methods")).then(()=>Promise.all([this.injectComms(),this.injectStylesheet(),this.injectMethods()])).then(()=>{if(this.settings.verbosity<=1){this.debug("INFO",4,"[3/6] Skip - Server verbosity is already at 1");return}else return this.debug("INFO",4,`[3/6] Set server verbosity to ${this.settings.verbosity}`),this.rpc("setServerVerbosity",this.settings.verbosity)}).then(()=>this.debug("INFO",4,`[4/6] Set server mode to "${this.settings.mode}"`)).then(()=>this.rpc("setServerMode",this.settings.mode=="child"?"embedded":this.settings.mode=="parent"?"frame":this.settings.mode=="popup"?"popup":(()=>{throw new Error(`Unknown server mode "${this.settings.mode}"`)})())).then(()=>this.debug("INFO",4,"[5/6] Run client plugins")).then(()=>Promise.all(this.plugins.map(o=>o.init.call(r,this.settings)))).then(()=>(this.debug("INFO",4,"[6/6] Init complete"),r)).catch(o=>{throw this.debug("WARN",0,"Init process fault",o),o}),this.initPromise}detectMode(){return this.settings.mode!="detect"?Promise.resolve(this.settings.mode):window.self===window.parent?Promise.resolve(this.settings.modeFallback):Promise.resolve().then(()=>this.settings.mode="parent").then(()=>new Promise((e,r)=>{let o=setTimeout(()=>r("TIMEOUT"),this.settings.modeTimeout);this.rpc("handshake").then(()=>clearTimeout(o)).then(()=>e()).catch(r)})).then(()=>"parent").catch(()=>this.settings.modeFallback)}injectComms(){switch(this.settings.mode){case"child":return Promise.resolve().then(()=>new Promise(e=>{this.debug("INFO",2,"Injecting TERA site as iFrame child"),this.dom.el=document.createElement("div"),this.dom.el.id="tera-fy",this.dom.el.classList.toggle("dev-mode",this.settings.devMode),this.dom.el.classList.add("minimized"),document.body.append(this.dom.el),this.dom.el.addEventListener("click",()=>this.dom.el.classList.toggle("minimized")),this.dom.iframe=document.createElement("iframe"),this.dom.iframe.setAttribute("sandbox",this.settings.frameSandbox.join(" ")),this.dom.iframe.addEventListener("load",()=>{this.debug("INFO",3,"Embedded iframe ready"),e()}),this.dom.iframe.src=this.settings.siteUrl,this.dom.el.append(this.dom.iframe)})).then(()=>this.handshakeLoop());case"parent":return this.debug("INFO",2,"Using TERA window parent"),Promise.resolve();case"popup":return this.debug("INFO",2,"Injecting TERA site as a popup window"),this.dom.popup=window.open(this.settings.siteUrl,"_blank","popup=1, location=0, menubar=0, status=0, scrollbars=0, width=500, height=600"),this.handshakeLoop().then(()=>this.debug("INFO",3,"Popup window accepted handshake"));default:throw new Error(`Unsupported mode "${this.settings.mode}" when calling injectComms()`)}}handshakeLoop(e){let r={handshakeInterval:this.settings.handshakeInterval,handshakeTimeout:this.settings.handshakeTimeout,...e};return new Promise((o,a)=>{let n=0,i,s=setTimeout(()=>{clearTimeout(i),a("TIMEOUT")},r.handshakeTimeout),f=()=>{this.debug("INFO",4,"Trying handshake",++n),clearTimeout(i),i=setTimeout(f,r.handshakeInterval),this.rpc("handshake").then(()=>{clearTimeout(s),clearTimeout(i)}).then(()=>o()).catch(a)};f()})}injectStylesheet(){switch(this.settings.mode){case"child":this.dom.stylesheet=document.createElement("style"),this.dom.stylesheet.innerHTML=[":root {","--TERA-accent: #4d659c;","}","#tera-fy {","display: none;","position: fixed;","right: 50px;","bottom: 50px;","width: 300px;","height: 150px;","background: transparent;","body:not(.tera-fy-focus) &.minimized.dev-mode {","background: var(--TERA-accent) !important;","opacity: 0.5;","right: 0px;","bottom: 0px;","width: 30px;","height: 30px;","transition: opacity 0.2s ease-out;","cursor: pointer;","border: none;","border-top-left-radius: 30px;","border-top: 2px solid var(--TERA-accent);","border-left: 2px solid var(--TERA-accent);","display: flex;","justify-content: center;","align-items: center;","&::before {","margin: 2px 0 0 0;",'content: "\u{1F300}";',"color: #FFF;","}","&:hover {","opacity: 1;","}","& > iframe {","display: none;","}","}","body:not(.tera-fy-focus) &:not(.minimized) {","&::before {","display: flex;","align-items: center;","justify-content: center;","cursor: pointer;","background: var(--TERA-accent) !important;","opacity: 0.5;","transition: opacity 0.2s ease-out;","position: absolute;","right: 0px;","bottom: 0px;","width: 20px;","height: 20px;","margin: 2px 0 0 0;",'content: "\u2B68";',"color: #FFF;","border: none;","border-top-left-radius: 30px;","border-top: 2px solid var(--TERA-accent);","border-left: 2px solid var(--TERA-accent);","}","&:hover::before {","opacity: 1;","}","}","&.dev-mode {","display: flex;","border: 5px solid var(--TERA-accent);","background: #FFF;","}","& > iframe {","width: 100%;","height: 100%;","}","}","body.tera-fy-focus {","overflow: hidden;","& #tera-fy {","display: flex !important;","position: fixed !important;","top: 0px !important;","width: 100vw !important;","height: 100vh !important;","left: 0px !important;","z-index: 10000 !important;","}","}"].join(`
2
- `),document.head.append(this.dom.stylesheet);break;case"parent":case"popup":break;default:throw new Error(`Unsupported mode "${this.settings.mode}" when injectStylesheet()`)}return Promise.resolve()}injectMethods(){return this.methods.forEach(e=>this[e]=this.rpc.bind(this,e)),Promise.resolve()}debug(...e){if(!this.settings.devMode||this.settings.verbosity<1)return;let r="log",o=1;typeof e[0]=="string"&&["INFO","LOG","WARN","ERROR"].includes(e[0])&&(r=e.shift().toLowerCase()),typeof e[0]=="number"&&(o=e[0],e.shift()),!(this.settings.verbosity<o)&&console[r]("%c[TERA-FY CLIENT]","font-weight: bold; color: #ff5722;",...e)}set(e,r,o){let a={ignoreNullish:!0,...o};return typeof e=="string"?(!a.ignoreNullish||r!=null)&&(this.settings[e]=r):Object.assign(this.settings,e),this.toggleDevMode(this.settings.devMode)}setIfDev(e,r,o){return!this.settings.devMode||r===void 0?this:this.set(e,r,o)}use(e,r){let o=typeof e=="function"?new e(this,r):typeof e=="object"?e:typeof e=="string"?(()=>{throw new Error("use(String) is not yet supported")})():(()=>{throw new Error("Expected use() call to be provided with a class initializer")})();return this.mixin(this,o),this.plugins.push(o),this}mixin(e,r){let o=[],a=r;do o.unshift(a);while(a=Object.getPrototypeOf(a));o.forEach(n=>Object.getOwnPropertyNames(n).filter(i=>!["constructor","init","prototype","name"].includes(i)&&!i.startsWith("__")).forEach(i=>{typeof r[i]=="function"?Object.defineProperty(e,i,{enumerable:!1,value:r[i].bind(e)}):e[i]=r[i]}))}toggleDevMode(e="toggle"){var r;return e==="toggle"?this.settings.devMode=!this.settings.devMode:e==="proxy"?Object.assign(this.settings,{devMode:!0,siteUrl:"http://localhost:7334/embed",mode:"child"}):this.settings.devMode=!!e,this.settings.devMode&&(this.settings.restrictOrigin="*"),(r=this.dom)!=null&&r.el&&this.dom.el.classList.toggle("dev-mode",this.settings.devMode),this}toggleFocus(e="toggle"){this.debug("INFO",2,"Request focus",{isFocused:e}),globalThis.document.body.classList.toggle("tera-fy-focus",e==="toggle"?void 0:e)}getEntropicString(e=32){let r=new Uint32Array(4);return window.crypto.getRandomValues(r),btoa(String.fromCodePoint(...new Uint8Array(r.buffer))).replace(/[+/]/g,"").slice(0,e)}selectProjectFile(e){return this.rpc("selectProjectFile",e).then(r=>r&&new E({tera:this,...r}))}getProjectFiles(e){return this.rpc("getProjectFiles",e).then(r=>r.map(o=>new E({tera:this,...o})))}getProjectFile(e,r){return this.rpc("getProjectFile",e,r).then(o=>o&&new E({tera:this,...o}))}createProjectFile(e){return this.rpc("createProjectFile",e).then(r=>r&&new E({tera:this,...r}))}moveProjectFile(e,r,o){return this.rpc("moveProjectFile",e,r,o).then(a=>a?new E({tera:this,...a}):null)}};export{qt as default};
1
+ var jo=Object.defineProperty;var Ao=(t,e,r)=>e in t?jo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var l=(t,e,r)=>Ao(t,typeof e!="symbol"?e+"":e,r);var Io=typeof global=="object"&&global&&global.Object===Object&&global,ut=Io;var _o=typeof self=="object"&&self&&self.Object===Object&&self,Eo=ut||_o||Function("return this")(),c=Eo;var Co=c.Symbol,v=Co;var re=Object.prototype,Fo=re.hasOwnProperty,No=re.toString,nt=v?v.toStringTag:void 0;function Mo(t){var e=Fo.call(t,nt),r=t[nt];try{t[nt]=void 0;var o=!0}catch{}var a=No.call(t);return o&&(e?t[nt]=r:delete t[nt]),a}var oe=Mo;var Ro=Object.prototype,Lo=Ro.toString;function Bo(t){return Lo.call(t)}var ae=Bo;var Do="[object Null]",ko="[object Undefined]",ie=v?v.toStringTag:void 0;function Uo(t){return t==null?t===void 0?ko:Do:ie&&ie in Object(t)?oe(t):ae(t)}var P=Uo;function Go(t){return t!=null&&typeof t=="object"}var w=Go;var zo="[object Symbol]";function Ko(t){return typeof t=="symbol"||w(t)&&P(t)==zo}var z=Ko;function Wo(t,e){for(var r=-1,o=t==null?0:t.length,a=Array(o);++r<o;)a[r]=e(t[r],r,t);return a}var dt=Wo;var Yo=Array.isArray,g=Yo;var $o=1/0,se=v?v.prototype:void 0,ne=se?se.toString:void 0;function fe(t){if(typeof t=="string")return t;if(g(t))return dt(t,fe)+"";if(z(t))return ne?ne.call(t):"";var e=t+"";return e=="0"&&1/t==-$o?"-0":e}var pe=fe;function Ho(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var O=Ho;function Vo(t){return t}var le=Vo;var qo="[object AsyncFunction]",Jo="[object Function]",Zo="[object GeneratorFunction]",Xo="[object Proxy]";function Qo(t){if(!O(t))return!1;var e=P(t);return e==Jo||e==Zo||e==qo||e==Xo}var ct=Qo;var ta=c["__core-js_shared__"],ht=ta;var me=(function(){var t=/[^.]+$/.exec(ht&&ht.keys&&ht.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function ea(t){return!!me&&me in t}var ue=ea;var ra=Function.prototype,oa=ra.toString;function aa(t){if(t!=null){try{return oa.call(t)}catch{}try{return t+""}catch{}}return""}var E=aa;var ia=/[\\^$.*+?()[\]{}|]/g,sa=/^\[object .+?Constructor\]$/,na=Function.prototype,fa=Object.prototype,pa=na.toString,la=fa.hasOwnProperty,ma=RegExp("^"+pa.call(la).replace(ia,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ua(t){if(!O(t)||ue(t))return!1;var e=ct(t)?ma:sa;return e.test(E(t))}var de=ua;function da(t,e){return t==null?void 0:t[e]}var ce=da;function ca(t,e){var r=ce(t,e);return de(r)?r:void 0}var T=ca;var ha=T(c,"WeakMap"),xt=ha;var he=Object.create,xa=(function(){function t(){}return function(e){if(!O(e))return{};if(he)return he(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),xe=xa;function ga(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var ge=ga;function ba(t,e){var r=-1,o=t.length;for(e||(e=Array(o));++r<o;)e[r]=t[r];return e}var be=ba;var ya=800,va=16,wa=Date.now;function Ta(t){var e=0,r=0;return function(){var o=wa(),a=va-(o-r);if(r=o,a>0){if(++e>=ya)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var ye=Ta;function Pa(t){return function(){return t}}var ve=Pa;var Oa=(function(){try{var t=T(Object,"defineProperty");return t({},"",{}),t}catch{}})(),K=Oa;var Sa=K?function(t,e){return K(t,"toString",{configurable:!0,enumerable:!1,value:ve(e),writable:!0})}:le,we=Sa;var ja=ye(we),Te=ja;function Aa(t,e){for(var r=-1,o=t==null?0:t.length;++r<o&&e(t[r],r,t)!==!1;);return t}var Pe=Aa;var Ia=9007199254740991,_a=/^(?:0|[1-9]\d*)$/;function Ea(t,e){var r=typeof t;return e=e==null?Ia:e,!!e&&(r=="number"||r!="symbol"&&_a.test(t))&&t>-1&&t%1==0&&t<e}var W=Ea;function Ca(t,e,r){e=="__proto__"&&K?K(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var gt=Ca;function Fa(t,e){return t===e||t!==t&&e!==e}var bt=Fa;var Na=Object.prototype,Ma=Na.hasOwnProperty;function Ra(t,e,r){var o=t[e];(!(Ma.call(t,e)&&bt(o,r))||r===void 0&&!(e in t))&&gt(t,e,r)}var Y=Ra;function La(t,e,r,o){var a=!r;r||(r={});for(var s=-1,i=e.length;++s<i;){var n=e[s],f=o?o(r[n],t[n],n,r,t):void 0;f===void 0&&(f=t[n]),a?gt(r,n,f):Y(r,n,f)}return r}var _=La;var Oe=Math.max;function Ba(t,e,r){return e=Oe(e===void 0?t.length-1:e,0),function(){for(var o=arguments,a=-1,s=Oe(o.length-e,0),i=Array(s);++a<s;)i[a]=o[e+a];a=-1;for(var n=Array(e+1);++a<e;)n[a]=o[a];return n[e]=r(i),ge(t,this,n)}}var Se=Ba;var Da=9007199254740991;function ka(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Da}var $=ka;function Ua(t){return t!=null&&$(t.length)&&!ct(t)}var yt=Ua;var Ga=Object.prototype;function za(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Ga;return t===r}var H=za;function Ka(t,e){for(var r=-1,o=Array(t);++r<t;)o[r]=e(r);return o}var je=Ka;var Wa="[object Arguments]";function Ya(t){return w(t)&&P(t)==Wa}var Ut=Ya;var Ae=Object.prototype,$a=Ae.hasOwnProperty,Ha=Ae.propertyIsEnumerable,Va=Ut((function(){return arguments})())?Ut:function(t){return w(t)&&$a.call(t,"callee")&&!Ha.call(t,"callee")},V=Va;function qa(){return!1}var Ie=qa;var Ce=typeof exports=="object"&&exports&&!exports.nodeType&&exports,_e=Ce&&typeof module=="object"&&module&&!module.nodeType&&module,Ja=_e&&_e.exports===Ce,Ee=Ja?c.Buffer:void 0,Za=Ee?Ee.isBuffer:void 0,Xa=Za||Ie,vt=Xa;var Qa="[object Arguments]",ti="[object Array]",ei="[object Boolean]",ri="[object Date]",oi="[object Error]",ai="[object Function]",ii="[object Map]",si="[object Number]",ni="[object Object]",fi="[object RegExp]",pi="[object Set]",li="[object String]",mi="[object WeakMap]",ui="[object ArrayBuffer]",di="[object DataView]",ci="[object Float32Array]",hi="[object Float64Array]",xi="[object Int8Array]",gi="[object Int16Array]",bi="[object Int32Array]",yi="[object Uint8Array]",vi="[object Uint8ClampedArray]",wi="[object Uint16Array]",Ti="[object Uint32Array]",u={};u[ci]=u[hi]=u[xi]=u[gi]=u[bi]=u[yi]=u[vi]=u[wi]=u[Ti]=!0;u[Qa]=u[ti]=u[ui]=u[ei]=u[di]=u[ri]=u[oi]=u[ai]=u[ii]=u[si]=u[ni]=u[fi]=u[pi]=u[li]=u[mi]=!1;function Pi(t){return w(t)&&$(t.length)&&!!u[P(t)]}var Fe=Pi;function Oi(t){return function(e){return t(e)}}var q=Oi;var Ne=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ft=Ne&&typeof module=="object"&&module&&!module.nodeType&&module,Si=ft&&ft.exports===Ne,Gt=Si&&ut.process,ji=(function(){try{var t=ft&&ft.require&&ft.require("util").types;return t||Gt&&Gt.binding&&Gt.binding("util")}catch{}})(),C=ji;var Me=C&&C.isTypedArray,Ai=Me?q(Me):Fe,Re=Ai;var Ii=Object.prototype,_i=Ii.hasOwnProperty;function Ei(t,e){var r=g(t),o=!r&&V(t),a=!r&&!o&&vt(t),s=!r&&!o&&!a&&Re(t),i=r||o||a||s,n=i?je(t.length,String):[],f=n.length;for(var p in t)(e||_i.call(t,p))&&!(i&&(p=="length"||a&&(p=="offset"||p=="parent")||s&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||W(p,f)))&&n.push(p);return n}var wt=Ei;function Ci(t,e){return function(r){return t(e(r))}}var Tt=Ci;var Fi=Tt(Object.keys,Object),Le=Fi;var Ni=Object.prototype,Mi=Ni.hasOwnProperty;function Ri(t){if(!H(t))return Le(t);var e=[];for(var r in Object(t))Mi.call(t,r)&&r!="constructor"&&e.push(r);return e}var Be=Ri;function Li(t){return yt(t)?wt(t):Be(t)}var J=Li;function Bi(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var De=Bi;var Di=Object.prototype,ki=Di.hasOwnProperty;function Ui(t){if(!O(t))return De(t);var e=H(t),r=[];for(var o in t)o=="constructor"&&(e||!ki.call(t,o))||r.push(o);return r}var ke=Ui;function Gi(t){return yt(t)?wt(t,!0):ke(t)}var Z=Gi;var zi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ki=/^\w*$/;function Wi(t,e){if(g(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||z(t)?!0:Ki.test(t)||!zi.test(t)||e!=null&&t in Object(e)}var Ue=Wi;var Yi=T(Object,"create"),F=Yi;function $i(){this.__data__=F?F(null):{},this.size=0}var Ge=$i;function Hi(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var ze=Hi;var Vi="__lodash_hash_undefined__",qi=Object.prototype,Ji=qi.hasOwnProperty;function Zi(t){var e=this.__data__;if(F){var r=e[t];return r===Vi?void 0:r}return Ji.call(e,t)?e[t]:void 0}var Ke=Zi;var Xi=Object.prototype,Qi=Xi.hasOwnProperty;function ts(t){var e=this.__data__;return F?e[t]!==void 0:Qi.call(e,t)}var We=ts;var es="__lodash_hash_undefined__";function rs(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=F&&e===void 0?es:e,this}var Ye=rs;function X(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}X.prototype.clear=Ge;X.prototype.delete=ze;X.prototype.get=Ke;X.prototype.has=We;X.prototype.set=Ye;var zt=X;function os(){this.__data__=[],this.size=0}var $e=os;function as(t,e){for(var r=t.length;r--;)if(bt(t[r][0],e))return r;return-1}var L=as;var is=Array.prototype,ss=is.splice;function ns(t){var e=this.__data__,r=L(e,t);if(r<0)return!1;var o=e.length-1;return r==o?e.pop():ss.call(e,r,1),--this.size,!0}var He=ns;function fs(t){var e=this.__data__,r=L(e,t);return r<0?void 0:e[r][1]}var Ve=fs;function ps(t){return L(this.__data__,t)>-1}var qe=ps;function ls(t,e){var r=this.__data__,o=L(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}var Je=ls;function Q(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}Q.prototype.clear=$e;Q.prototype.delete=He;Q.prototype.get=Ve;Q.prototype.has=qe;Q.prototype.set=Je;var B=Q;var ms=T(c,"Map"),D=ms;function us(){this.size=0,this.__data__={hash:new zt,map:new(D||B),string:new zt}}var Ze=us;function ds(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Xe=ds;function cs(t,e){var r=t.__data__;return Xe(e)?r[typeof e=="string"?"string":"hash"]:r.map}var k=cs;function hs(t){var e=k(this,t).delete(t);return this.size-=e?1:0,e}var Qe=hs;function xs(t){return k(this,t).get(t)}var tr=xs;function gs(t){return k(this,t).has(t)}var er=gs;function bs(t,e){var r=k(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}var rr=bs;function tt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}tt.prototype.clear=Ze;tt.prototype.delete=Qe;tt.prototype.get=tr;tt.prototype.has=er;tt.prototype.set=rr;var pt=tt;var ys="Expected a function";function Kt(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(ys);var r=function(){var o=arguments,a=e?e.apply(this,o):o[0],s=r.cache;if(s.has(a))return s.get(a);var i=t.apply(this,o);return r.cache=s.set(a,i)||s,i};return r.cache=new(Kt.Cache||pt),r}Kt.Cache=pt;var or=Kt;var vs=500;function ws(t){var e=or(t,function(o){return r.size===vs&&r.clear(),o}),r=e.cache;return e}var ar=ws;var Ts=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ps=/\\(\\)?/g,Os=ar(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Ts,function(r,o,a,s){e.push(a?s.replace(Ps,"$1"):o||r)}),e}),ir=Os;function Ss(t){return t==null?"":pe(t)}var sr=Ss;function js(t,e){return g(t)?t:Ue(t,e)?[t]:ir(sr(t))}var S=js;var As=1/0;function Is(t){if(typeof t=="string"||z(t))return t;var e=t+"";return e=="0"&&1/t==-As?"-0":e}var N=Is;function _s(t,e){e=S(e,t);for(var r=0,o=e.length;t!=null&&r<o;)t=t[N(e[r++])];return r&&r==o?t:void 0}var Pt=_s;function Es(t,e){for(var r=-1,o=e.length,a=t.length;++r<o;)t[a+r]=e[r];return t}var et=Es;var nr=v?v.isConcatSpreadable:void 0;function Cs(t){return g(t)||V(t)||!!(nr&&t&&t[nr])}var fr=Cs;function pr(t,e,r,o,a){var s=-1,i=t.length;for(r||(r=fr),a||(a=[]);++s<i;){var n=t[s];e>0&&r(n)?e>1?pr(n,e-1,r,o,a):et(a,n):o||(a[a.length]=n)}return a}var lr=pr;function Fs(t){var e=t==null?0:t.length;return e?lr(t,1):[]}var mr=Fs;function Ns(t){return Te(Se(t,void 0,mr),t+"")}var Ot=Ns;var Ms=Tt(Object.getPrototypeOf,Object),rt=Ms;var Rs="[object Object]",Ls=Function.prototype,Bs=Object.prototype,ur=Ls.toString,Ds=Bs.hasOwnProperty,ks=ur.call(Object);function Us(t){if(!w(t)||P(t)!=Rs)return!1;var e=rt(t);if(e===null)return!0;var r=Ds.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&ur.call(r)==ks}var dr=Us;function Gs(t,e,r){var o=-1,a=t.length;e<0&&(e=-e>a?0:a+e),r=r>a?a:r,r<0&&(r+=a),a=e>r?0:r-e>>>0,e>>>=0;for(var s=Array(a);++o<a;)s[o]=t[o+e];return s}var cr=Gs;function zs(){this.__data__=new B,this.size=0}var hr=zs;function Ks(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var xr=Ks;function Ws(t){return this.__data__.get(t)}var gr=Ws;function Ys(t){return this.__data__.has(t)}var br=Ys;var $s=200;function Hs(t,e){var r=this.__data__;if(r instanceof B){var o=r.__data__;if(!D||o.length<$s-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new pt(o)}return r.set(t,e),this.size=r.size,this}var yr=Hs;function ot(t){var e=this.__data__=new B(t);this.size=e.size}ot.prototype.clear=hr;ot.prototype.delete=xr;ot.prototype.get=gr;ot.prototype.has=br;ot.prototype.set=yr;var vr=ot;function Vs(t,e){return t&&_(e,J(e),t)}var wr=Vs;function qs(t,e){return t&&_(e,Z(e),t)}var Tr=qs;var jr=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Pr=jr&&typeof module=="object"&&module&&!module.nodeType&&module,Js=Pr&&Pr.exports===jr,Or=Js?c.Buffer:void 0,Sr=Or?Or.allocUnsafe:void 0;function Zs(t,e){if(e)return t.slice();var r=t.length,o=Sr?Sr(r):new t.constructor(r);return t.copy(o),o}var Ar=Zs;function Xs(t,e){for(var r=-1,o=t==null?0:t.length,a=0,s=[];++r<o;){var i=t[r];e(i,r,t)&&(s[a++]=i)}return s}var Ir=Xs;function Qs(){return[]}var St=Qs;var tn=Object.prototype,en=tn.propertyIsEnumerable,_r=Object.getOwnPropertySymbols,rn=_r?function(t){return t==null?[]:(t=Object(t),Ir(_r(t),function(e){return en.call(t,e)}))}:St,at=rn;function on(t,e){return _(t,at(t),e)}var Er=on;var an=Object.getOwnPropertySymbols,sn=an?function(t){for(var e=[];t;)et(e,at(t)),t=rt(t);return e}:St,jt=sn;function nn(t,e){return _(t,jt(t),e)}var Cr=nn;function fn(t,e,r){var o=e(t);return g(t)?o:et(o,r(t))}var At=fn;function pn(t){return At(t,J,at)}var Fr=pn;function ln(t){return At(t,Z,jt)}var It=ln;var mn=T(c,"DataView"),_t=mn;var un=T(c,"Promise"),Et=un;var dn=T(c,"Set"),Ct=dn;var Nr="[object Map]",cn="[object Object]",Mr="[object Promise]",Rr="[object Set]",Lr="[object WeakMap]",Br="[object DataView]",hn=E(_t),xn=E(D),gn=E(Et),bn=E(Ct),yn=E(xt),U=P;(_t&&U(new _t(new ArrayBuffer(1)))!=Br||D&&U(new D)!=Nr||Et&&U(Et.resolve())!=Mr||Ct&&U(new Ct)!=Rr||xt&&U(new xt)!=Lr)&&(U=function(t){var e=P(t),r=e==cn?t.constructor:void 0,o=r?E(r):"";if(o)switch(o){case hn:return Br;case xn:return Nr;case gn:return Mr;case bn:return Rr;case yn:return Lr}return e});var it=U;var vn=Object.prototype,wn=vn.hasOwnProperty;function Tn(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&wn.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Dr=Tn;var Pn=c.Uint8Array,Wt=Pn;function On(t){var e=new t.constructor(t.byteLength);return new Wt(e).set(new Wt(t)),e}var st=On;function Sn(t,e){var r=e?st(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var kr=Sn;var jn=/\w*$/;function An(t){var e=new t.constructor(t.source,jn.exec(t));return e.lastIndex=t.lastIndex,e}var Ur=An;var Gr=v?v.prototype:void 0,zr=Gr?Gr.valueOf:void 0;function In(t){return zr?Object(zr.call(t)):{}}var Kr=In;function _n(t,e){var r=e?st(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Wr=_n;var En="[object Boolean]",Cn="[object Date]",Fn="[object Map]",Nn="[object Number]",Mn="[object RegExp]",Rn="[object Set]",Ln="[object String]",Bn="[object Symbol]",Dn="[object ArrayBuffer]",kn="[object DataView]",Un="[object Float32Array]",Gn="[object Float64Array]",zn="[object Int8Array]",Kn="[object Int16Array]",Wn="[object Int32Array]",Yn="[object Uint8Array]",$n="[object Uint8ClampedArray]",Hn="[object Uint16Array]",Vn="[object Uint32Array]";function qn(t,e,r){var o=t.constructor;switch(e){case Dn:return st(t);case En:case Cn:return new o(+t);case kn:return kr(t,r);case Un:case Gn:case zn:case Kn:case Wn:case Yn:case $n:case Hn:case Vn:return Wr(t,r);case Fn:return new o;case Nn:case Ln:return new o(t);case Mn:return Ur(t);case Rn:return new o;case Bn:return Kr(t)}}var Yr=qn;function Jn(t){return typeof t.constructor=="function"&&!H(t)?xe(rt(t)):{}}var $r=Jn;var Zn="[object Map]";function Xn(t){return w(t)&&it(t)==Zn}var Hr=Xn;var Vr=C&&C.isMap,Qn=Vr?q(Vr):Hr,qr=Qn;var tf="[object Set]";function ef(t){return w(t)&&it(t)==tf}var Jr=ef;var Zr=C&&C.isSet,rf=Zr?q(Zr):Jr,Xr=rf;var of=1,af=2,sf=4,Qr="[object Arguments]",nf="[object Array]",ff="[object Boolean]",pf="[object Date]",lf="[object Error]",to="[object Function]",mf="[object GeneratorFunction]",uf="[object Map]",df="[object Number]",eo="[object Object]",cf="[object RegExp]",hf="[object Set]",xf="[object String]",gf="[object Symbol]",bf="[object WeakMap]",yf="[object ArrayBuffer]",vf="[object DataView]",wf="[object Float32Array]",Tf="[object Float64Array]",Pf="[object Int8Array]",Of="[object Int16Array]",Sf="[object Int32Array]",jf="[object Uint8Array]",Af="[object Uint8ClampedArray]",If="[object Uint16Array]",_f="[object Uint32Array]",m={};m[Qr]=m[nf]=m[yf]=m[vf]=m[ff]=m[pf]=m[wf]=m[Tf]=m[Pf]=m[Of]=m[Sf]=m[uf]=m[df]=m[eo]=m[cf]=m[hf]=m[xf]=m[gf]=m[jf]=m[Af]=m[If]=m[_f]=!0;m[lf]=m[to]=m[bf]=!1;function Ft(t,e,r,o,a,s){var i,n=e&of,f=e&af,p=e&sf;if(r&&(i=a?r(t,o,a,s):r(t)),i!==void 0)return i;if(!O(t))return t;var x=g(t);if(x){if(i=Dr(t),!n)return be(t,i)}else{var h=it(t),j=h==to||h==mf;if(vt(t))return Ar(t,n);if(h==eo||h==Qr||j&&!a){if(i=f||j?{}:$r(t),!n)return f?Cr(t,Tr(i,t)):Er(t,wr(i,t))}else{if(!m[h])return a?t:{};i=Yr(t,h,n)}}s||(s=new vr);var b=s.get(t);if(b)return b;s.set(t,i),Xr(t)?t.forEach(function(A){i.add(Ft(A,e,r,A,t,s))}):qr(t)&&t.forEach(function(A,d){i.set(d,Ft(A,e,r,d,t,s))});var y=p?f?It:Fr:f?Z:J,R=x?void 0:y(t);return Pe(R||t,function(A,d){R&&(d=A,A=t[d]),Y(i,d,Ft(A,e,r,d,t,s))}),i}var Nt=Ft;var Ef=1,Cf=4;function Ff(t){return Nt(t,Ef|Cf)}var Yt=Ff;function Nf(t,e){return t!=null&&e in Object(t)}var ro=Nf;function Mf(t,e,r){e=S(e,t);for(var o=-1,a=e.length,s=!1;++o<a;){var i=N(e[o]);if(!(s=t!=null&&r(t,i)))break;t=t[i]}return s||++o!=a?s:(a=t==null?0:t.length,!!a&&$(a)&&W(i,a)&&(g(t)||V(t)))}var oo=Mf;function Rf(t,e){return t!=null&&oo(t,e,ro)}var ao=Rf;function Lf(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var io=Lf;function Bf(t,e){return e.length<2?t:Pt(t,cr(e,0,-1))}var so=Bf;var Df=Object.prototype,kf=Df.hasOwnProperty;function Uf(t,e){e=S(e,t);var r=-1,o=e.length;if(!o)return!0;for(;++r<o;){var a=N(e[r]);if(a==="__proto__"&&!kf.call(t,"__proto__")||(a==="constructor"||a==="prototype")&&r<o-1)return!1}var s=so(t,e);return s==null||delete s[N(io(e))]}var no=Uf;function Gf(t){return dr(t)?void 0:t}var fo=Gf;var zf=1,Kf=2,Wf=4,Yf=Ot(function(t,e){var r={};if(t==null)return r;var o=!1;e=dt(e,function(s){return s=S(s,t),o||(o=s.length>1),s}),_(t,It(t),r),o&&(r=Nt(r,zf|Kf|Wf,fo));for(var a=e.length;a--;)no(r,e[a]);return r}),$t=Yf;function $f(t,e,r,o){if(!O(t))return t;e=S(e,t);for(var a=-1,s=e.length,i=s-1,n=t;n!=null&&++a<s;){var f=N(e[a]),p=r;if(f==="__proto__"||f==="constructor"||f==="prototype")return t;if(a!=i){var x=n[f];p=o?o(x,f,n):void 0,p===void 0&&(p=O(x)?x:W(e[a+1])?[]:{})}Y(n,f,p),n=n[f]}return t}var po=$f;function Hf(t,e,r){for(var o=-1,a=e.length,s={};++o<a;){var i=e[o],n=Pt(t,i);r(n,i)&&po(s,S(i,t),n)}return s}var lo=Hf;function Vf(t,e){return lo(t,e,function(r,o){return ao(t,o)})}var mo=Vf;var qf=Ot(function(t,e){return t==null?{}:mo(t,e)}),Mt=qf;function uo(t){return{all:t=t||new Map,on:function(e,r){var o=t.get(e);o?o.push(r):t.set(e,[r])},off:function(e,r){var o=t.get(e);o&&(r?o.splice(o.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var o=t.get(e);o&&o.slice().map(function(a){a(r)}),(o=t.get("*"))&&o.slice().map(function(a){a(e,r)})}}}var co="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Ht=(t=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=co[r[t]&63];return e};var ho="Invalid number",Jf="Invalid rounding method";var Rt="jedec";var Zf="bits",go="byte",Xf="bytes",Qf="kbit";var bo="array",tp="function",yo="object",ep="string",vo="exponent",rp="round";var lt={symbol:{iec:{bits:["bit","Kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["bit","Kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},fullform:{iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]}},op=[1,1024,1048576,1073741824,1099511627776,0x4000000000000,1152921504606847e3,11805916207174113e5,12089258196146292e8],ap=[1,1e3,1e6,1e9,1e12,1e15,1e18,1e21,1e24],ip=Math.log(1024),sp=Math.log(1e3),xo={si:{isDecimal:!0,ceil:1e3,actualStandard:Rt},iec:{isDecimal:!1,ceil:1024,actualStandard:"iec"},[Rt]:{isDecimal:!1,ceil:1024,actualStandard:Rt}};function np(t,e){return xo[t]?xo[t]:e===2?{isDecimal:!1,ceil:1024,actualStandard:"iec"}:{isDecimal:!0,ceil:1e3,actualStandard:Rt}}function fp(t,e,r,o,a,s,i,n,f){let p;return t>0?p=0 .toPrecision(t):p=0,i===vo?0:(f||(f=r?lt.symbol[e].bits[0]:lt.symbol[e].bytes[0]),o[f]&&(f=o[f]),a&&(s[0]?f=s[0]:(f=lt.fullform[e][0],r?f+="bit":f+=go)),i===bo?[p,f]:i===yo?{value:p,symbol:f,exponent:0,unit:f}:p+n+f)}function wo(t,e,r,o,a,s=!0){let i;r?i=ap[e]:i=op[e];let n=t/i;return o&&(n*=8,s&&n>=a&&e<8&&(n/=a,e++)),{result:n,e}}function pp(t,e,r,o,a,s,i,n,f,p){typeof t=="string"&&(t=parseFloat(t));let x=t.toPrecision(e),h=p===-1||isNaN(p);if(x.includes("e")&&r<8&&h){r++;let{result:j}=wo(o,r,a,s,i),b;f>0?b=Math.pow(10,f):b=1;let y;b===1?y=n(j):y=n(j*b)/b,x=y.toPrecision(e)}return{value:x,e:r}}function lp(t,e,r,o,a,s){let i=t;if(e===!0?i=i.toLocaleString():e.length>0?i=i.toLocaleString(e,r):o.length>0&&(i=i.toString().replace(".",o)),a&&s>0){let n=i.toString(),f=o||(n.slice(1).match(/[.,]/g)||[]).pop()||".",p=n.split(f),x=p[1]||"",h=x.length,j=s-h;i=`${p[0]}${f}${x.padEnd(h+j,"0")}`}return i}function mp(t,e,r,o,a){return(e===-1||isNaN(e))&&(o?e=Math.floor(Math.log(t)/sp):e=Math.floor(Math.log(t)/ip),e<0&&(e=0)),e>8?(a>0&&(a+=8-e),{e:8,precision:a}):{e,precision:a}}function up(t,e,r,o,a,s){let i;r>0&&o>0?i=Math.pow(10,o):i=1;let n;return i===1?n=a(t):n=a(t*i)/i,n===e&&r<8&&s&&(n=1,r++),{value:n,e:r}}function dp(t,e,r,o){let a=lt.symbol[t][e?Zf:Xf],s;return o&&r===1?e?s=Qf:s="kB":s=a[r],s}function cp(t,e,r,o,a,s,i,n,f,p,x,h,j){if(e&&(t[0]=-t[0]),r[t[1]]&&(t[1]=r[t[1]]),t[0]=lp(t[0],o,a,s,i,n),f){let b;j?b="bit":b=go;let y;typeof t[0]=="string"?y=parseFloat(t[0]):y=t[0];let R;y===1?R="":R="s",p[h]?t[1]=p[h]:t[1]=lt.fullform[x][h]+b+R}}function hp(t,e,r,o,a){if(o===bo)return t;if(o===yo)return{value:t[0],symbol:t[1],exponent:e,unit:r};let s;return a===" "?s=`${t[0]} ${t[1]}`:s=t.join(a),s}function To(t,{bits:e=!1,pad:r=!1,base:o=-1,round:a=2,locale:s="",localeOptions:i={},separator:n="",spacer:f=" ",symbols:p={},standard:x="",output:h=ep,fullform:j=!1,fullforms:b=[],exponent:y=-1,roundingMethod:R=rp,precision:A=0}={}){let d=y,I,G=[],qt=0,Lt="";if(typeof t=="bigint")I=Number(t);else{if(I=Number(t),isNaN(t))throw new TypeError(ho);if(!isFinite(I))throw new TypeError(ho)}let{isDecimal:mt,ceil:Bt,actualStandard:Dt}=np(x,o),Jt=j===!0,Zt=I<0,kt=Math[R];if(typeof kt!==tp)throw new TypeError(Jf);if(Zt&&(I=-I),I===0)return fp(A,Dt,e,p,Jt,b,h,f);let{e:Po,precision:Xt}=mp(I,d,y,mt,A);d=Po;let Qt=y===-1||isNaN(y);if(h===vo)return d;let{result:Oo,e:So}=wo(I,d,mt,e,Bt,Qt);qt=Oo,d=So;let te=up(qt,Bt,d,a,kt,Qt);if(G[0]=te.value,d=te.e,Xt>0){let ee=pp(G[0],Xt,d,I,mt,e,Bt,kt,a,y);G[0]=ee.value,d=ee.e}return Lt=dp(Dt,e,d,mt),G[1]=Lt,cp(G,Zt,p,s,i,n,r,a,Jt,b,Dt,d,e),hp(G,d,Lt,h,f)}var M=class t{constructor(e){l(this,"_tera");l(this,"id");l(this,"sbId");l(this,"name");l(this,"icon");l(this,"path");l(this,"url");l(this,"teraUrl");l(this,"parsedName");l(this,"created");l(this,"createdFormatted");l(this,"modified");l(this,"modifiedFormatted");l(this,"accessed");l(this,"accessedFormatted");l(this,"size");l(this,"sizeFormatted");l(this,"mime");l(this,"meta",{});l(this,"isFolder");l(this,"files");var o;if(!e.tera)throw new Error("Basic file requires a `tera` key to access the Tera instance");Object.assign(this,$t(e,"encodeIdFunction")),e.encodeIdFunction&&typeof e.encodeIdFunction=="function"&&(this.id=e.encodeIdFunction(this.id));let r=this.tera;Object.defineProperty(this,"_tera",{enumerable:!1,configurable:!1,get(){return r}}),delete this.tera,this.created&&typeof this.created=="string"&&(this.created=new Date(this.created)),this.modified&&typeof this.modified=="string"&&(this.modified=new Date(this.modified)),this.accessed&&typeof this.accessed=="string"&&(this.accessed=new Date(this.accessed)),this.isFolder&&(this.files=(o=this.files)==null?void 0:o.map(a=>{let s=a.path.split(/\//).slice(3).join("/"),i=this.url+"/"+a.name;return a.meta.reflib&&(i=i.replace(/\/project\/download\//,"/project/library/")),new t({tera:r,...a,sbId:a.id,id:a.path,encodeIdFunction:e.encodeIdFunction,path:s,url:i})})),this.teraUrl=this.url.replace(/^https?:\/\/(?:.+?)\/projects\/(?:.+?)\/project\/(.+)$/,"/project/$1"),this.sizeFormatted=To(this.size||0,{spacer:""}),this.createdFormatted=this.created?this.created.toLocaleDateString():"Unknown created date",this.modifiedFormatted=this.modified?this.modified.toLocaleDateString():"Unknown modified date",this.accessedFormatted=this.accessed?this.accessed.toLocaleDateString():"Unknown access date"}getContents(e){return this._tera.getProjectFileContents(this.id,e)}setContents(e){return this._tera.setProjectFileContents(this.id,e,{})}getRefs(){return this._tera.getProjectLibrary(this.id)}setRefs(e){return this._tera.setProjectLibrary(this.id,e)}serialize(){return Mt(this,["id","sbId","name","icon","path","url","parsedName","created","modified","accessed","size","mime","meta"])}static deserialize(e){let r=Mt(e,["tera","id","sbId","name","icon","path","url","parsedName","created","modified","accessed","size","mime","meta"]);return new t(r)}};var Vt=class{constructor(e){l(this,"settings",{session:null,devMode:!1,verbosity:1,mode:"detect",modeTimeout:300,modeFallback:"child",modeOverrides:{child(e){e.siteUrl=="https://tera-tools.com/embed"&&(e.siteUrl="https://dev.tera-tools.com/embed")}},siteUrl:"https://tera-tools.com/embed",restrictOrigin:"*",frameSandbox:["allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-popups-to-escape-sandbox","allow-presentation","allow-same-origin","allow-scripts","allow-top-navigation"],handshakeInterval:1e3,handshakeTimeout:1e4,debugPaths:null});l(this,"events",uo());l(this,"dom",{el:null,iframe:null,popup:null,stylesheet:null});l(this,"methods",["handshake","setServerVerbosity","getUser","requireUser","getCredentials","getKindeToken","bindProject","getProject","getProjects","setActiveProject","requireProject","selectProject","getNamespace","setNamespace","listNamespaces","getProjectState","setProjectState","setProjectStateDefaults","setProjectStateRefresh","getProjectFileContents","deleteProjectFile","setProjectFileContents","createProjectFolder","deleteProjectFolder","selectProjectLibrary","getProjectLibrary","setProjectLibrary","projectLog","setPage","uiAlert","uiConfirm","uiJson","uiPanic","uiProgress","uiPrompt","uiThrow","uiSplat","uiWindow"]);l(this,"plugins",[]);l(this,"namespaces",{});l(this,"acceptPostboxes",{});l(this,"initPromise",null);e&&this.set(e)}send(e){let r=Ht();return this.acceptPostboxes[r]={},this.acceptPostboxes[r].promise=new Promise((o,a)=>{Object.assign(this.acceptPostboxes[r],{resolve:o,reject:a}),this.sendRaw({id:r,...e})}),this.acceptPostboxes[r].promise}sendRaw(e){let r;try{if(r={TERA:1,id:e.id||Ht(),...Yt(e)},this.settings.mode=="parent")window.parent.postMessage(r,this.settings.restrictOrigin);else if(this.settings.mode=="child")this.dom.iframe.contentWindow.postMessage(r,this.settings.restrictOrigin);else if(this.settings.mode=="popup")this.dom.popup.postMessage(r,this.settings.restrictOrigin);else throw this.settings.mode=="detect"?new Error("Call init() or detectMode() before trying to send data to determine the mode"):new Error(`Unknown TERA communication mode "${this.settings.mode}"`)}catch(o){throw this.debug("ERROR",1,"Message compose client->server:",o),this.debug("ERROR",1,"Attempted to dispatch payload client->server",r),o}}rpc(e,...r){return this.send({action:"rpc",method:e,args:r})}acceptMessage(e){if(e.origin==window.location.origin)return Promise.resolve();let r=e.data;return!r.TERA||!r.id?Promise.resolve():(this.debug("INFO",3,"Received message",r),(r==null?void 0:r.action)=="response"&&this.acceptPostboxes[r.id]?(r.isError===!0?this.acceptPostboxes[r.id].reject(r.response):this.acceptPostboxes[r.id].resolve(r.response),Promise.resolve()):(r==null?void 0:r.action)=="rpc"?Promise.resolve().then(()=>this[r.method].apply(this,r.args)).then(o=>this.sendRaw({id:r.id,action:"response",response:o})).catch(o=>{console.warn(`TERA-FY client threw on RPC:${r.method}:`,o),this.sendRaw({id:r.id,action:"response",isError:!0,response:o&&o.toString()})}):(r==null?void 0:r.action)=="event"?Promise.resolve().then(()=>this.events.emit(r.event,...r.payload)).catch(o=>{throw console.warn(`TERA-FY client threw while handling emitted event "${r.event}"`,{message:r}),o}):r!=null&&r.id?(this.debug("INFO",3,`Ignoring message ID ${r.id} - was meant for someone else?`),Promise.resolve()):(this.debug("INFO",3,"Unexpected incoming TERA-FY CLIENT message",{message:r}),Promise.resolve()))}mountNamespace(e){if(!/^[\w-]+$/.test(e))throw new Error("Namespaces must be alphanumeric + hyphens + underscores");return this.namespaces[e]?Promise.resolve(this.namespaces[e]):Promise.resolve().then(()=>this._mountNamespace(e)).then(()=>this.namespaces[e]||Promise.reject(`teraFy.mountNamespace('${e}') resolved but no namespace has been mounted`))}_mountNamespace(e){throw console.warn(`teraFy._mountNamespace() for ${e} has not been overridden by a TERA-fy plugin, load one to add this functionality for your preferred framework`),new Error("teraFy._mountNamespace() is not supported")}unmountNamespace(e){return this.namespaces[e]?this._unmountNamespace(e):Promise.resolve()}_unmountNamespace(e){console.warn(`teraFy.unbindNamespace() for ${e} has not been overridden by a TERA-fy plugin, load one to add this functionality for your preferred framework`)}init(e){if(e&&this.set(e),this.initPromise)return this.initPromise;window.addEventListener("message",this.acceptMessage.bind(this));let r=this;return this.initPromise=Promise.resolve().then(()=>{var o;return(o=this.settings).session||(o.session="tfy-"+this.getEntropicString(16))}).then(()=>this.debug("INFO",4,"[0/6] Init","Session",this.settings.session,"against",this.settings.siteUrl)).then(()=>{this.settings.devMode&&(this.settings.debugPaths?this.settings.debugPaths=this.settings.debugPaths.map(o=>Array.isArray(o)?o.join("."):typeof o=="string"?o:(()=>{throw new Error("Unknown path type - should be an array or string in dotted notation")})()):this.settings.debugPaths=null,this.debug("INFO",0,"Watching state paths",this.settings.debugPaths))}).then(()=>this.detectMode()).then(o=>{if(this.debug("INFO",4,"[1/6] Setting client mode to",o),this.settings.mode=o,this.settings.modeOverrides[o])return this.debug("INFO",4,"[1/6] Applying specific config overrides for mode",o),this.settings.modeOverrides[o](this.settings)}).then(()=>this.debug("INFO",4,"[2/6] Injecting comms + styles + methods")).then(()=>Promise.all([this.injectComms(),this.injectStylesheet(),this.injectMethods()])).then(()=>{if(this.settings.verbosity<=1){this.debug("INFO",4,"[3/6] Skip - Server verbosity is already at 1");return}else return this.debug("INFO",4,`[3/6] Set server verbosity to ${this.settings.verbosity}`),this.rpc("setServerVerbosity",this.settings.verbosity)}).then(()=>this.debug("INFO",4,`[4/6] Set server mode to "${this.settings.mode}"`)).then(()=>this.rpc("setServerMode",this.settings.mode=="child"?"embedded":this.settings.mode=="parent"?"frame":this.settings.mode=="popup"?"popup":(()=>{throw new Error(`Unknown server mode "${this.settings.mode}"`)})())).then(()=>this.debug("INFO",4,"[5/6] Run client plugins")).then(()=>Promise.all(this.plugins.map(o=>o.init.call(r,this.settings)))).then(()=>(this.debug("INFO",4,"[6/6] Init complete"),r)).catch(o=>{throw this.debug("WARN",0,"Init process fault",o),o}),this.initPromise}detectMode(){return this.settings.mode!="detect"?Promise.resolve(this.settings.mode):window.self===window.parent?Promise.resolve(this.settings.modeFallback):Promise.resolve().then(()=>this.settings.mode="parent").then(()=>new Promise((e,r)=>{let o=setTimeout(()=>r("TIMEOUT"),this.settings.modeTimeout);this.rpc("handshake").then(()=>clearTimeout(o)).then(()=>e()).catch(r)})).then(()=>"parent").catch(()=>this.settings.modeFallback)}injectComms(){switch(this.settings.mode){case"child":return Promise.resolve().then(()=>new Promise(e=>{this.debug("INFO",2,"Injecting TERA site as iFrame child"),this.dom.el=document.createElement("div"),this.dom.el.id="tera-fy",this.dom.el.classList.toggle("dev-mode",this.settings.devMode),this.dom.el.classList.add("minimized"),document.body.append(this.dom.el),this.dom.el.addEventListener("click",()=>this.dom.el.classList.toggle("minimized")),this.dom.iframe=document.createElement("iframe"),this.dom.iframe.setAttribute("sandbox",this.settings.frameSandbox.join(" ")),this.dom.iframe.addEventListener("load",()=>{this.debug("INFO",3,"Embedded iframe ready"),e()}),this.dom.iframe.src=this.settings.siteUrl,this.dom.el.append(this.dom.iframe)})).then(()=>this.handshakeLoop());case"parent":return this.debug("INFO",2,"Using TERA window parent"),Promise.resolve();case"popup":return this.debug("INFO",2,"Injecting TERA site as a popup window"),this.dom.popup=window.open(this.settings.siteUrl,"_blank","popup=1, location=0, menubar=0, status=0, scrollbars=0, width=500, height=600"),this.handshakeLoop().then(()=>this.debug("INFO",3,"Popup window accepted handshake"));default:throw new Error(`Unsupported mode "${this.settings.mode}" when calling injectComms()`)}}handshakeLoop(e){let r={handshakeInterval:this.settings.handshakeInterval,handshakeTimeout:this.settings.handshakeTimeout,...e};return new Promise((o,a)=>{let s=0,i,n=setTimeout(()=>{clearTimeout(i),a("TIMEOUT")},r.handshakeTimeout),f=()=>{this.debug("INFO",4,"Trying handshake",++s),clearTimeout(i),i=setTimeout(f,r.handshakeInterval),this.rpc("handshake").then(()=>{clearTimeout(n),clearTimeout(i)}).then(()=>o()).catch(a)};f()})}injectStylesheet(){switch(this.settings.mode){case"child":this.dom.stylesheet=document.createElement("style"),this.dom.stylesheet.innerHTML=[":root {","--TERA-accent: #4d659c;","}","#tera-fy {","display: none;","position: fixed;","right: 50px;","bottom: 50px;","width: 300px;","height: 150px;","background: transparent;","body:not(.tera-fy-focus) &.minimized.dev-mode {","background: var(--TERA-accent) !important;","opacity: 0.5;","right: 0px;","bottom: 0px;","width: 30px;","height: 30px;","transition: opacity 0.2s ease-out;","cursor: pointer;","border: none;","border-top-left-radius: 30px;","border-top: 2px solid var(--TERA-accent);","border-left: 2px solid var(--TERA-accent);","display: flex;","justify-content: center;","align-items: center;","&::before {","margin: 2px 0 0 0;",'content: "\u{1F300}";',"color: #FFF;","}","&:hover {","opacity: 1;","}","& > iframe {","display: none;","}","}","body:not(.tera-fy-focus) &:not(.minimized) {","&::before {","display: flex;","align-items: center;","justify-content: center;","cursor: pointer;","background: var(--TERA-accent) !important;","opacity: 0.5;","transition: opacity 0.2s ease-out;","position: absolute;","right: 0px;","bottom: 0px;","width: 20px;","height: 20px;","margin: 2px 0 0 0;",'content: "\u2B68";',"color: #FFF;","border: none;","border-top-left-radius: 30px;","border-top: 2px solid var(--TERA-accent);","border-left: 2px solid var(--TERA-accent);","}","&:hover::before {","opacity: 1;","}","}","&.dev-mode {","display: flex;","border: 5px solid var(--TERA-accent);","background: #FFF;","}","& > iframe {","width: 100%;","height: 100%;","}","}","body.tera-fy-focus {","overflow: hidden;","& #tera-fy {","display: flex !important;","position: fixed !important;","top: 0px !important;","width: 100vw !important;","height: 100vh !important;","left: 0px !important;","z-index: 10000 !important;","}","}"].join(`
2
+ `),document.head.append(this.dom.stylesheet);break;case"parent":case"popup":break;default:throw new Error(`Unsupported mode "${this.settings.mode}" when injectStylesheet()`)}return Promise.resolve()}injectMethods(){return this.methods.forEach(e=>this[e]=this.rpc.bind(this,e)),Promise.resolve()}debug(...e){if(!this.settings.devMode||this.settings.verbosity<1)return;let r="log",o=1;typeof e[0]=="string"&&["INFO","LOG","WARN","ERROR"].includes(e[0])&&(r=e.shift().toLowerCase()),typeof e[0]=="number"&&(o=e[0],e.shift()),!(this.settings.verbosity<o)&&console[r]("%c[TERA-FY CLIENT]","font-weight: bold; color: #ff5722;",...e)}set(e,r,o){let a={ignoreNullish:!0,...o};return typeof e=="string"?(!a.ignoreNullish||r!=null)&&(this.settings[e]=r):Object.assign(this.settings,e),this.toggleDevMode(this.settings.devMode)}setIfDev(e,r,o){return!this.settings.devMode||r===void 0?this:this.set(e,r,o)}use(e,r){let o=typeof e=="function"?new e(this,r):typeof e=="object"?e:typeof e=="string"?(()=>{throw new Error("use(String) is not yet supported")})():(()=>{throw new Error("Expected use() call to be provided with a class initializer")})();return this.mixin(this,o),this.plugins.push(o),this}mixin(e,r){let o=[],a=r;do o.unshift(a);while(a=Object.getPrototypeOf(a));o.forEach(s=>Object.getOwnPropertyNames(s).filter(i=>!["constructor","init","prototype","name"].includes(i)&&!i.startsWith("__")).forEach(i=>{typeof r[i]=="function"?Object.defineProperty(e,i,{enumerable:!1,value:r[i].bind(e)}):e[i]=r[i]}))}toggleDevMode(e="toggle"){var r;return e==="toggle"?this.settings.devMode=!this.settings.devMode:e==="proxy"?Object.assign(this.settings,{devMode:!0,siteUrl:"http://localhost:7334/embed",mode:"child"}):this.settings.devMode=!!e,this.settings.devMode&&(this.settings.restrictOrigin="*"),(r=this.dom)!=null&&r.el&&this.dom.el.classList.toggle("dev-mode",this.settings.devMode),this}toggleFocus(e="toggle"){this.debug("INFO",2,"Request focus",{isFocused:e}),globalThis.document.body.classList.toggle("tera-fy-focus",e==="toggle"?void 0:e)}getEntropicString(e=32){let r=new Uint32Array(4);return window.crypto.getRandomValues(r),btoa(String.fromCodePoint(...new Uint8Array(r.buffer))).replace(/[+/]/g,"").slice(0,e)}selectProjectFile(e){return this.rpc("selectProjectFile",e).then(r=>r&&new M({tera:this,...r}))}getProjectFiles(e){return this.rpc("getProjectFiles",e).then(r=>r.map(o=>new M({tera:this,...o})))}getProjectFile(e,r){return this.rpc("getProjectFile",e,r).then(o=>o&&new M({tera:this,...o}))}createProjectFile(e){return this.rpc("createProjectFile",e).then(r=>r&&new M({tera:this,...r}))}moveProjectFile(e,r,o){return this.rpc("moveProjectFile",e,r,o).then(a=>a?new M({tera:this,...a}):null)}};export{Vt as default};
3
3
  /*! Bundled license information:
4
4
 
5
5
  lodash-es/lodash.js:
6
6
  (**
7
7
  * @license
8
8
  * Lodash (Custom Build) <https://lodash.com/>
9
- * Build: `lodash modularize exports="es" -o ./`
9
+ * Build: `lodash modularize exports="es" --repo lodash/lodash#4.18.1 -o ./`
10
10
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
11
11
  * Released under MIT license <https://lodash.com/license>
12
12
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
@@ -17,8 +17,8 @@ filesize/dist/filesize.js:
17
17
  (**
18
18
  * filesize
19
19
  *
20
- * @copyright 2025 Jason Mulligan <jason.mulligan@avoidwork.com>
20
+ * @copyright 2026 Jason Mulligan <jason.mulligan@avoidwork.com>
21
21
  * @license BSD-3-Clause
22
- * @version 11.0.13
22
+ * @version 11.0.17
23
23
  *)
24
24
  */