@lmjs/core 2.1.2 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/bundle.js CHANGED
@@ -127,25 +127,37 @@ function buildCommonTail() {
127
127
  // third-party portion has no comments to lose in the first place.
128
128
  parts.push(stripComments(readVendor('reconnecting-websocket.js')));
129
129
 
130
- // index-bootstrap.js runs here — right after the WHOLE vendor file
131
- // above, not spliced into the middle of it (tried that first,
132
- // 2026-09-14 — see git history if curious). This file defines
133
- // `Reactor` early in its own source but other framework globals real
134
- // index.js scripts commonly reference (`cookies`, `session`, ...) much
135
- // later in the same file — no single splice point could satisfy both
136
- // "run after everything index.js might need" and "run before this
137
- // file's own $(document).ready() handler, which can fire
138
- // synchronously". Running after the whole file satisfies the first
139
- // constraint completely; the second is now handled by making that
140
- // ready() handler itself wait for `appSettings` (see its own comment,
141
- // right above `function _lumenReadyHandler()` in this vendor file)
142
- // instead of assuming an execution-order guarantee that doesn't
143
- // actually hold.
144
- parts.push(stripComments(read('index-bootstrap.js')));
145
-
146
130
  parts.push(stripComments(read('ws.js')));
147
131
  parts.push(stripComments(read('lstnrs.js')));
148
132
 
133
+ // index-bootstrap.js runs here — after the vendor file AND ws.js/
134
+ // lstnrs.js, not spliced into the middle of the vendor file (tried
135
+ // that first, 2026-09-14 — see git history if curious). Used to sit
136
+ // directly after the vendor file, before ws.js/lstnrs.js — see the
137
+ // comment that used to be here. **Real bug found 2026-09-20, migrating
138
+ // a real V1 project**: index-bootstrap.js runs index.js's compiled
139
+ // code via a SYNCHRONOUS XHR + eval (see that file's own comment for
140
+ // why synchronous) — meaning it executes fully, inline, before any
141
+ // bundle code positioned after it ever runs. A real index.js using the
142
+ // legacy BEA SDK (`bea = new BEA({...})`, still real/ported/working —
143
+ // see vendor/reconnecting-websocket.js's own BEA class) crashed with
144
+ // "Cannot read properties of undefined (reading 'req')": BEA.request()
145
+ // calls the global `API` object, defined in ws.js — which, at the old
146
+ // position, hadn't executed yet. `var` hoisting only guarantees the
147
+ // *declaration* exists, not the assignment. Moving index-bootstrap.js
148
+ // to run after ws.js/lstnrs.js instead fixes this generally (any real
149
+ // index.js code depending on `API`, or anything else those two files
150
+ // define) without reintroducing the original splice problem — nothing
151
+ // in ws.js/lstnrs.js's own top-level code depends on index.js having
152
+ // already run, only the vendor file's `$(document).ready()` handler
153
+ // does, and that's still satisfied (it's guarded to wait for
154
+ // `appSettings` regardless of ordering, per the constraint below).
155
+ // `Reactor` (defined early in the vendor file) and other framework
156
+ // globals real index.js scripts commonly reference (`cookies`,
157
+ // `session`, .... defined later in that same file) are both still
158
+ // satisfied by running after the WHOLE vendor file, same as before.
159
+ parts.push(stripComments(read('index-bootstrap.js')));
160
+
149
161
  return parts.join('\n');
150
162
  }
151
163
 
@@ -33,8 +33,6 @@ var cl=console.log;class _v{static name;static type;static vars;static fns;stati
33
33
  {{Text}}
34
34
  </div>`;if(!al)al="topCenter";if(!ty)ty="";if(!$("[notify]").length)$("body").append("<div notify class='"+al+"'></div>");else $("[notify]").attr("class","").addClass(al);$("[notify]").prepend(notify2.split("{{Title}}").join(ti!=""?"<h5>"+ti+"</h5>":"").split("{{Icon}}").join(i2).split("{{Text}}").join(tx).split("{{Type}}").join(ty).split("{{Type}}").join(ti).split("{{Type}}").join(ti));$(".notify").fadeIn();setTimeout(function(){$("[close-notify]:last").click()},5e3)}function _isScrollable(el2){let o1=el2.css("overflow-y")=="scroll"||el2.css("overflow-y")=="auto"&&el2[0].scrollHeight>el2.height()+15;let o2=el2.css("overflow-x")=="scroll"||el2.css("overflow-x")=="auto"&&el2[0].scrollWidth>el2.width()+15;return o1||o2}function _setPos(self,p,el2){var left=self.offset().left;var top=self.offset().top;if(p==""||p=="bottom"){left+=self.innerWidth()/2;top+=self.innerHeight()}else if(p=="left"){top+=self.innerHeight()/2}else if(p=="top"){left+=self.innerWidth()/2}else{left+=self.innerWidth();top+=self.innerHeight()/2}$("tip").css({left,top,right:"unset",bottom:"unset"});if(top+15<el2.offset().top||top>el2.offset().top+el2.height()+10||left+15<el2.offset().left||left>el2.offset().left+el2.width()+10)$("tip").hide();else $("tip").show()}String.prototype.rtrim=function(s){if(s==void 0)s="\\s";try{return this.replace(new RegExp("["+s+"]+$"),"")}catch{return this.replace(new RegExp("[\\"+s+"]+$"),"")}};String.prototype.ltrim=function(s){if(s==void 0)s="\\s";try{return this.replace(new RegExp("^["+s+"]+"),"")}catch{return this.replace(new RegExp("^[\\"+s+"]+"),"")}};
35
35
 
36
- if(typeof _beaTn==="undefined"||!_beaTn){if(typeof XMLHttpRequest==="function"){try{var _idxXhr=new XMLHttpRequest;_idxXhr.open("GET","/index.js",false);_idxXhr.send(null);if(_idxXhr.status>=200&&_idxXhr.status<300){(0,eval)(_idxXhr.responseText)}else{console.log("Failed to load index.js: HTTP "+_idxXhr.status)}}catch(e){console.error("Failed to load index.js: ",e)}}}
37
-
38
36
  class AbstractWebSocket{constructor(url,connectionTimeout=5e3){this.url=url;this.socket=null;this.reconnectInterval=3e3;this.reconnectTimeout=null;this.connectionTimeout=connectionTimeout;this.connectionTimeoutId=null;this.connected=false;this.messageQueue=[]}connect(){this.socket=new WebSocket(this.url);this.connectionTimeoutId=setTimeout(()=>{this.handleConnectionTimeout()},this.connectionTimeout);this.socket.onopen=()=>{clearTimeout(this.connectionTimeoutId);this.connected=true;this.onOpen();this.processMessageQueue()};this.socket.onmessage=event=>{this.onMessage(event.data)};this.socket.onclose=event=>{clearTimeout(this.connectionTimeoutId);this.connected=false;this.onClose(event.code);this.reconnect()};this.socket.onerror=error=>{clearTimeout(this.connectionTimeoutId);this.onError(error)}}send(message){cl("Sending ",message);if(this.connected){this.socket.send(message)}else{this.messageQueue.push(message);console.error("WebSocket is not open. Unable to send message.")}}processMessageQueue(){while(this.messageQueue.length>0){const message=this.messageQueue.shift();cl("Sending From Queue ",message);this.socket.send(message)}}handleConnectionTimeout(){this.socket.close()}disconnect(){if(this.socket){this.socket.close()}clearTimeout(this.reconnectTimeout)}onOpen(){}onMessage(message){}onClose(code){}onError(error){}reconnect(){clearTimeout(this.reconnectTimeout);this.reconnectTimeout=setTimeout(()=>{this.connect()},this.reconnectInterval)}}class MyWebSocket extends AbstractWebSocket{constructor(url){super(url)}onOpen(){super.onOpen()}onMessage(message){super.onMessage(message)}onClose(code){super.onClose(code)}onError(error){super.onError(error)}}class Nuclear{_iter=0;reconnectAttempts=0;timeoutInterval=4e3;cbs={};_cbs={};lstnrs={};_ws;srvr=void 0;constructor(srvr){this.srvr=srvr;this.init();return this}on(e,cb){if(!this.lstnrs.hasOwnProperty(e))this.lstnrs[e]=[];this.lstnrs[e].push(cb);if(e=="open"&&this._ws?.readyState==1){this.trigger("open",this._ws)}return this}off(e){if(e=="connect")return this;if(this.lstnrs.hasOwnProperty(e))delete this.lstnrs[e];return this}subscribe(e,cb){return this.on(e,cb)}unsubscribe(e,cb){return this.off(e,cb)}trigger(n,e){if(this.lstnrs.hasOwnProperty(n)){for(let x=0;x<this.lstnrs[n].length;x++){this.lstnrs[n][x](e)}}return this}emit(e,data,cb){try{this._iter++;if(cb)this.cbs["cb_"+this._iter]=cb;if(this.ready()){this._ws.send(JSON.stringify({e,payload:data,_iter:this._iter}))}else{this._send(JSON.stringify({e,payload:data,_iter:this._iter}))}}catch(error){if(_debugMode)cl(error)}return this}_emit(e,data){this._iter++;let prom=defer();this._cbs["cb_"+this._iter]=prom;if(this.ready()){this._ws.send(JSON.stringify({e,payload:data,_iter:this._iter}))}else{this._send(JSON.stringify({e,payload:data,_iter:this._iter}))}return prom}_send(m){let _s=this;setTimeout(function(){if(_s.ready())_s._ws.send(m);else _s._send(m)},500)}ready(){return this._ws!==void 0&&this._ws.readyState==WebSocket.OPEN}connecting(){return this._ws!==void 0&&this._ws.readyState==WebSocket.CONNECTING}init(){var _s=this;this._ws=new ReconnectingWebSocket(this.srvr?this.srvr:"wss://www.beaapis.com/");this._ws.addEventListener("error",event=>{return false});this._ws.onopen=function(e){_s.trigger("connect",e);_s.trigger("open",e)};this._ws.onclose=function(e){_s._iter=0;_s.cbs={};_gn=0;barSet(1,200);_s.reconnectAttempts++};this._ws.onmessage=function(e){try{let data=JSON.parse(e.data);if(data.hasOwnProperty("e")){let event=data["e"];let iter=data["_iter"];const customEvent=new CustomEvent(event,{detail:data["payload"]});customEvent.data=data["payload"];if(event!="rooms")_s.trigger(event,customEvent);if(_s.cbs["cb_"+iter])_s.cbs["cb_"+iter](customEvent);if(_s._cbs["cb_"+iter])_s._cbs["cb_"+iter].resolve(customEvent)}}catch(e2){if(_debugMode)cl(e2)}};this._ws.onerror=function(e){_gn=0;barSet(1,200)}}}class _Ticker{id="";tick=1e3;duration=1e4;data={};status="created";user=void 0;channel=void 0;_cbs={};constructor(obj,channel,user){this.id=obj.id;this.tick=obj?.tick??1e3;this.duration=obj?.duration??1e4;this.data=obj?.data??{};this.user=user;this.channel=channel;this.user.id=this.user.id;this.init();return this}init(opts,lstnrs){let t=this.tick;let d=this.duration;let data=this.data;if(opts){if(opts.hasOwnProperty("tick"))t=opts.tick;if(opts.hasOwnProperty("duration"))d=opts.duration;if(opts.hasOwnProperty("data"))data=opts.data}this.user.nuke.emit("subscribe",{type:"ticker",ticker:this.id,channel:this.channel.id,user:this.user.id,data:{tick:t,duration:d,data}});if(!this.user.nuke._tickers.hasOwnProperty(this.channel.id))this.user.nuke._tickers[this.channel.id]={};this.user.nuke._tickers[this.channel.id][this.id]=this;if(!lstnrs){var self=this;this.on("create.class",function(e){self.status="created"});this.on("start.class",function(e){self.status="started"});this.on("tick.class",function(e){self.status="started"});this.on("pause.class",function(e){self.status="paused"});this.on("finish.class",function(e){self.status="finished"})}}start(){if(this.status=="started"){setError(null,`This ticker is already started`);return this}if(this.status=="finished"){setError(null,`This ticker is finished`);return this}this.user.nuke.emit("ticker",{ticker:this.id,channel:this.channel.id,user:this.user.id,ev:"start"})}pause(){if(this.status=="paused"){setError(null,`This ticker is already paused`);return this}if(this.status!="started"){setError(null,`This ticker is not started yet!`);return this}this.user.nuke.emit("ticker",{ticker:this.id,channel:this.channel.id,user:this.user.id,ev:"pause"})}restart(opts){if(this.status!="finished"){setError(null,`This ticker is not finished yet!`);return this}this.init(opts,true)}delete(){this.user.nuke.emit("unsubscribe",{type:"ticker",ticker:this.id,channel:this.channel.id,user:this.user.id,ev:"delete"})}extend(t){this.user.nuke.emit("ticker",{ticker:this.id,channel:this.channel.id,user:this.user.id,ev:"extend",data:{time:t}})}on(e,cb){let myRef2=document.createElement("live");myRef2.dataset["cb"]=cb;document.body.append(myRef2);if(this._cbs.hasOwnProperty(e)){this._cbs[e].push(cb)}else this._cbs[e]=[cb];return this}off(e){if(this._cbs.hasOwnProperty(e))delete this._cbs[e];return this}trigger(e,customEvent){if(this._cbs.hasOwnProperty(e)){for(let i=0;i<this._cbs[e].length;i++){const cb=this._cbs[e][i];cb(customEvent)}}return this}}class _Channel{id="/";user=void 0;type="room";_cbs={};constructor(id,type,user){this.id=id;this.type=type;this.user=user;this.user.id=this.user.id??"Guest";return this}trigger(e,customEvent){if(this._cbs.hasOwnProperty(e)){for(let i=0;i<this._cbs[e].length;i++){const cb=this._cbs[e][i];cb(customEvent)}}return this}join(){this.user.nuke.emit("subscribe",{type:this.type,channel:this.id,user:this.user.id});if(!this.user.nuke._chnls.hasOwnProperty(this.user.id))this.user.nuke._chnls[this.user.id]={};this.user.nuke._chnls[this.user.id][this.id]=this}leave(){this.user.nuke.emit("unsubscribe",{type:this.type,channel:this.id,user:this.user.id,ev:"leave"});if(this.user.nuke._chnls.hasOwnProperty(this.user.id)){delete this.user.nuke._chnls[this.user.id][this.id]}}broadcast(ev,options){this.user.nuke.emit("broadcast",{type:"room",channel:this.id,user:this.user.id,ev,includeMe:options?.includeMe??true,data:options?.data??{}})}off(e){if(e=="connect")return this;if(this._cbs.hasOwnProperty(e))delete this._cbs[e];return this}on(e,cb){let myRef2=document.createElement("live");myRef2.dataset["cb"]=cb;document.body.append(myRef2);if(this._cbs.hasOwnProperty(e)){this._cbs[e].push(cb)}else this._cbs[e]=[cb];return this}createTicker(obj){if(!this.user.nuke._tickers.hasOwnProperty(this.id)){this.user.nuke._tickers[this.id]={}}let t=new _Ticker(obj,this,this.user);return t}getTicker(id){this.user.nuke.emit("get",{type:"ticker",channel:this.id,user:this.user.id,ticker:id})}}class _User{id="";nuke=void 0;_cbs={};constructor(id,nuke){this.id=id;this.nuke=nuke;this.init();return this}init(){this.nuke.emit("subscribe",{type:"user",channel:this.id,user:this.id});if(!this.nuke._users.hasOwnProperty("/"+this.id))this.nuke._users["/"+this.id]=this}on(e,cb){if(this.nuke._users["/"+this.id]._cbs.hasOwnProperty(e)){this.nuke._users["/"+this.id]._cbs[e].push(cb)}else this.nuke._users["/"+this.id]._cbs[e]=[cb];return this}off(e){if(this._cbs.hasOwnProperty(e))delete this._cbs[e];return this}broadcast(ev,options){this.nuke.emit("broadcast",{type:"user",channel:this.id,user:this.id,ev,includeMe:options?.includeMe??true,data:options?.data??{}})}trigger(e,customEvent){if(this._cbs.hasOwnProperty(e)){for(let i=0;i<this._cbs[e].length;i++){const cb=this._cbs[e][i];cb(customEvent)}}return this}_broadcastToAll(IDs,e,d,t){this.nuke.emit("broadcast",{type:t=="u"?"user":"room",user:this.id,ev:e,includeMe:d["includeMe"]??true,data:d["data"],...t=="u"?{users:IDs.join(",")}:{channels:IDs.join(",")}})}broadcastToUsers(uIDs,e,d){this._broadcastToAll(uIDs,e,d,"u")}broadcastToChannels(cIDs,e,d){this._broadcastToAll(cIDs,e,d,"c")}unsubscribe(c){if(this.nuke._chnls.hasOwnProperty(this.id)){if(this.nuke._chnls[this.id].hasOwnProperty(c))this.nuke._chnls[this.id][c].leave()}}subscribe(e,cb){if(!this.nuke._chnls.hasOwnProperty(this.id)){this.nuke._chnls[this.id]={}}let channel=new _Channel(e,"room",this);channel.join();return channel}destroy(){this._cbs={};if(this.nuke._chnls.hasOwnProperty(this.id)){let chnls=this.nuke._chnls[this.id];for(const chnl in chnls){this.unsubscribe(chnl)}}}}class _Live{_chnls={};_users={};_tickers={};_iter=0;reconnectAttempts=0;timeoutInterval=4e3;cbs={};_cbs={};lstnrs={};_ws;srvr=void 0;constructor(srvr){this.srvr=srvr;this.init();return this}on(e,cb){if(!this.lstnrs.hasOwnProperty(e))this.lstnrs[e]=[];this.lstnrs[e].push(cb);if(e=="open"&&this._ws?.readyState==1){this.trigger("open",this._ws)}return this}off(e){if(e=="connect")return this;if(this.lstnrs.hasOwnProperty(e))delete this.lstnrs[e];return this}createUser(id){let user=new _User(id,this);return user}subscribe(e,cb){return this.on(e,cb)}unsubscribe(e,cb){return this.off(e,cb)}trigger(n,e){if(this.lstnrs.hasOwnProperty(n)){for(let x=0;x<this.lstnrs[n].length;x++){this.lstnrs[n][x](e)}}return this}emit(e,data,cb){try{this._iter++;if(cb)this.cbs["cb_"+this._iter]=cb;if(this.ready()){this._ws.send(JSON.stringify({e,payload:data,_iter:this._iter}))}else{this._send(JSON.stringify({e,payload:data,_iter:this._iter}))}}catch(error){if(_debugMode)cl(error)}return this}_emit(e,data){this._iter++;let prom=defer();this._cbs["cb_"+this._iter]=prom;if(this.ready()){this._ws.send(JSON.stringify({e,payload:data,_iter:this._iter}))}else{this._send(JSON.stringify({e,payload:data,_iter:this._iter}))}return prom}_send(m){let _s=this;setTimeout(function(){if(_s.ready())_s._ws.send(m);else _s._send(m)},500)}ready(){return this._ws!==void 0&&this._ws.readyState==WebSocket.OPEN}connecting(){return this._ws!==void 0&&this._ws.readyState==WebSocket.CONNECTING}init(){var _s=this;if(_s.ready()||_s.connecting()){return}this._ws=new ReconnectingWebSocket(this.srvr?this.srvr:"wss://www.beaapis.com/");this._ws.addEventListener("error",event=>{});this._ws.onopen=function(e){_s.trigger("connect",e);_s.trigger("open",e)};this._ws.onclose=function(e){_s._iter=0;_s.cbs={};_gn=0;barSet(1,200);_s.reconnectAttempts++};this._ws.onmessage=function(e){try{let data=JSON.parse(e.data);if(data.hasOwnProperty("for")){let t=data["type"]??"room";let ev=data["ev"]??"message";const customEvent=new CustomEvent(ev,{detail:data["payload"]});customEvent.data=data["payload"];let payload=data["payload"];if(payload.hasOwnProperty("user")){if(t=="user"){_s._users[data["for"]].trigger(ev,customEvent)}else if(t=="room")_s._chnls[payload.user.id][data["for"]].trigger(ev,customEvent);else if(t=="ticker"){_s._tickers[data["for"]][payload?.ticker?.id].trigger(ev,customEvent);_s._tickers[data["for"]][payload?.ticker?.id].trigger(ev+".class",customEvent)}}}else if(data.hasOwnProperty("e")){let event=data["e"];let iter=data["_iter"];const customEvent=new CustomEvent(event,{detail:data["payload"]});customEvent.data=data["payload"];if(event!="rooms")_s.trigger(event,customEvent);if(_s.cbs["cb_"+iter])_s.cbs["cb_"+iter](customEvent);if(_s._cbs["cb_"+iter])_s._cbs["cb_"+iter].resolve(customEvent)}}catch(e2){if(_debugMode)cl(e2)}};this._ws.onerror=function(e){_gn=0;barSet(1,200)}}}let LIVE;let Nuke;LIVE=new _Live("wss://www.beaapis.com/");Nuke=new Nuclear(_beaTn?void 0:(window.location.protocol==="https:"?"wss://":"ws://")+window.location.hostname+(window.location.port?":"+window.location.port:""));let _ovcD,_vcD;function syncViewFiles(){Nuke.emit("getfiles",{},function(e){var _files=e.data;let views=_files["views"];let layouts=_files["layouts"];_vcD=_files;if(!_ovcD)_ovcD=clone(_vcD);else{for(var key in views){if(_ovcD["views"].hasOwnProperty(key)){if(!deepCompare(clone(_ovcD["views"][key]),clone(views[key]))){cl("Changed the view "+atob(key));let n=atob(key).split("src/views/").join("").split(".view").join("");let nodes=getURLNodes();_ovcD["views"][key]=views[key];cl("view",n,atob(key));if(n.indexOf("widgets/")===0){let changedWidgetName=n.split("widgets/").join("");for(let regionName in _vt.Widgets){if(_vt.Widgets[regionName]._resolvedFile===changedWidgetName){_vt.Widgets[regionName]._resolvedFile=void 0}}renderView(nodes[0],null,View.props??{})}else if(nodes[0]==n){renderView(nodes[0],null,View.props??{})}else{renderView(n,true,{})}}}}for(var key in layouts){if(_ovcD["layouts"].hasOwnProperty(key)){if(!deepCompare(clone(_ovcD["layouts"][key]),clone(layouts[key]))){cl("Changed the layout "+atob(key));let n=atob(key).split("src/layouts/").join("").split(".layout").join("");let nodes=getURLNodes();_ovcD["layouts"][key]=layouts[key];cl("layout",n,atob(key));renderView(n,false,{},"layouts")}}}}})}Nuke.on("connect",function(){if(_beaTn){Nuke.emit("get_uniquer",{beajsToken:_beaTn,uniquer:globals.uniquer},function(e){let d=e.data;let data=d.uniquer;globals.uniquer=data})}else{syncViewFiles()}});Nuke.on("files-changed",function(){if(!_beaTn)syncViewFiles()});var API={get:function(u,d,h,a,opts){return this.req(u,d,h,"GET",a,opts)},put:function(u,d,h,a,opts){return this.req(u,d,h,"PUT",a,opts)},post:function(u,d,h,a,opts){return this.req(u,d,h,"POST",a,opts)},delete:function(u,d,h,a,opts){return this.req(u,d,h,"DELETE",a,opts)},patch:function(u,d,h,a,opts){return this.req(u,d,h,"PATCH",a,opts)},req:function(u,d,h,m,a,opts,_prom){if(!opts)opts={full:false,progress:true};let prog=opts.hasOwnProperty("progress")?opts.progress:true;let full=opts.hasOwnProperty("full")?opts.full:false;let prom=_prom?_prom:defer();try{return prom}finally{if(Nuke&&Nuke._ws&&Nuke._ws.readyState==1&&(_beaTn?globals.uniquer>0:true)){if(prog){_gn=0;_work()}Nuke.emit("request",{body:{method:m,path:u,api:a??0,headers:h,full},uniquer:globals.uniquer??0,data:d},function(e){if(prog){_gn=0;barSet(1,200)}var r=e.data;prom.resolve(r)})}else{if(_beaTn&&_beaTn!=""){$.ajax({"url":"https://www.beaapis.com/req",headers:{},type:"POST",dataType:"json",data:{body:{method:m,path:u,api:a??0,headers:h,full},uniquer:globals.uniquer??0,_beaTn,data:d},cache:false,success:function(r,s){prom.resolve(r)},error:function(){prom.reject("error")}})}else{setTimeout(()=>{this.req(u,d,h,m,a,opts,prom)},_tickTime)}}}}};
39
37
 
40
38
  var _navT=0;var _nav=false;var _pbc;var _vuid={};$("body").on("click touch tap",function(e2){if(!_pbc)_pbc=new AudioContext;if(_pbc.state=="suspended"){_pbc.resume().then(()=>{})}});$("body").on("click touch",".navTgl",function(e2){_nav=false;clearTimeout(_navT);if($("nav").hasClass("nav-opened")){$("nav").removeClass("nav-opened");$("body").removeClass("nav-opened")}else{$("nav").addClass("nav-opened");$("body").addClass("nav-opened");_navT=setTimeout(function(){_nav=true},20)}e2.stopPropagation()});$(document).keydown(function(e2){var keyCode=e2.keyCode||e2.which;if(keyCode==27){e2.preventDefault();e2.stopPropagation();if($("[loader]").length){if(_loader.options.Dismissible)_loader.hide()}else if(_nav){$("nav").removeClass("nav-opened");$("body").removeClass("nav-opened");_nav=false}else{if($("popup").length&&$("droplet").length){$("droplet").removeClass("is-visible").each(function(){var p=$(this);setTimeout(function(){p.remove()},150)})}else if($("popup").length){$("[close-modal]:last").click()}else{$("body").css({overflow:"visible"});$("droplet").removeClass("is-visible").each(function(){var p=$(this);setTimeout(function(){p.remove()},150)})}}}});_csswrk.on("css-ready",function(e2){let data=e2.originalEvent.data;_vuid[data.key].resolve(data.csses)});_upwrk.on("message",function(e2){let data=e2.originalEvent.data});_upwrk.on("files-added",function(e2){let data=e2.originalEvent.data;processEv(e2,$('[upid="'+data.upid+'"]'),"files-added",data.files,data.newfiles)});_upwrk.on("queue-changed",function(e2){let data=e2.originalEvent.data;processEv(e2,$('[upid="'+data.upid+'"]'),"queue-changed",data.files)});_upwrk.on("file-removed",function(e2){let data=e2.originalEvent.data;processEv(e2,$('[upid="'+data.upid+'"]'),"file-removed",data.files,data.removedfile)});_upwrk.on("upload-start",function(e2){let data=e2.originalEvent.data;processEv(e2,$('[upid="'+data.upid+'"]'),"upload-start",data.files)});_upwrk.on("file-uploaded",function(e2){let data=e2.originalEvent.data;processEv(e2,$('[upid="'+data.upid+'"]'),"file-uploaded",data.files,data.file)});_upwrk.on("upload-progress",function(e2){let data=e2.originalEvent.data;processEv(e2,$('[upid="'+data.upid+'"]'),"upload-progress",data.files)});_upwrk.on("upload-complete",function(e2){let data=e2.originalEvent.data;processEv(e2,$('[upid="'+data.upid+'"]'),"upload-complete",data.files)});_upwrk.on("upload-stop",function(e2){let data=e2.originalEvent.data;processEv(e2,$('[upid="'+data.upid+'"]'),"upload-stop",data.files)});_upwrk.on("queue-empty",function(e2){let data=e2.originalEvent.data;processEv(e2,$('[upid="'+data.upid+'"]'),"queue-empty")});$.fn.extend({startUpload:function(){if(this.hasAttr("up")){_upwrk.trigger("start-upload",{"upid":this.attr("upid")})}return this},stopUpload:function(){if(this.hasAttr("up")){_upwrk.trigger("stop-upload",{"upid":this.attr("upid")})}return this},removeFile:function(id2){if(this.hasAttr("up")){_upwrk.trigger("remove-file",{"upid":this.attr("upid"),"id":id2})}return this}});$("body").on("FilesAdded","[up]",function(e2,files){let t=$(this);var size=t.attr("data-mxs")?t.attr("data-mxs"):"10mb";_upwrk.trigger("handle-files",{"upid":t.attr("upid"),"files":files});processEv(e2,t,"browse-files",files)});$("body").on("dragover","[up] [drpzn]",function(e2){e2.stopPropagation();e2.preventDefault();let t=$(this).closest("[up]");$(this).addClass("dragover");e2.originalEvent.dataTransfer.dropEffect="copy";return false});$("body").on("dragleave","[up] [drpzn]",function(e2){e2.stopPropagation();e2.preventDefault();$(this).removeClass("dragover")});$("body").on("drop","[up] [drpzn]",function(e2){e2.stopPropagation();e2.preventDefault();var files=e2.originalEvent.dataTransfer?.files||e2.target?.files;let t=$(this).closest("[up]");$(this).removeClass("dragover");t.trigger("FilesAdded",[files]);return false});$("body").on("click","[up] [browse]",function(e2){e2.stopPropagation();e2.preventDefault();let t=$(this).closest("[up]");t.find("[files]").click()});$("body").on("change","[up] [files]",function(e2){e2.stopPropagation();e2.preventDefault();var files=e2.originalEvent.dataTransfer?.files||e2.target?.files;let t=$(this).closest("[up]");t.trigger("FilesAdded",[files])});$("body").on("click touch","[ctc]",function(ev){var el=$(this);var ctc=el.attr("ctc");var selector=el;if(ctc.indexOf("el.")!==-1){selector=eval(ctc)}else if(ctc!="")selector=$(ctc);if(!navigator.clipboard){var temp=$("<textarea class='pf' style='left: -40%;' />");$("body").append(temp);temp.val(selector.text()).select();document.execCommand("copy");temp.remove()}else{navigator.clipboard.writeText(selector.text()).then(function(){},function(err){var temp2=$("<textarea class='pf' style='left: -40%;' />");$("body").append(temp2);temp2.val(selector.text()).select();document.execCommand("copy");temp2.remove()})}if(el.hasAttr("stop"))ev.stopPropagation()});$("body").on("click touch","[scroll-left]",function(ev2){var _el=$(this);var _wrap=_el.closest("[wrapper]");if(_wrap.length){var _p=_wrap.find("div").first();_p.stop().animate({scrollLeft:_p.scrollLeft()-100},{duration:200,easing:"easeOutCirc",complete:function(){}})}});$("body").on("click touch","[scroll-right]",function(ev2){var _el=$(this);var _wrap=_el.closest("[wrapper]");if(_wrap.length){var _p=_wrap.find("div").first();_p.stop().animate({scrollLeft:_p.scrollLeft()+100},{duration:200,easing:"easeOutCirc",complete:function(){}})}});$("body").on("click touch","[scroll-top]",function(ev2){var _el=$(this);var _wrap=_el.closest("[wrapper]");if(_wrap.length){var _p=_wrap.find("div").first();_p.stop().animate({scrollTop:_p.scrollTop()-100},{duration:200,easing:"easeOutCirc",complete:function(){}})}});$("body").on("click touch","[scroll-bottom]",function(ev2){var _el=$(this);var _wrap=_el.closest("[wrapper]");if(_wrap.length){var _p=_wrap.find("div").first();_p.stop().animate({scrollTop:_p.scrollTop()+100},{duration:200,easing:"easeOutCirc",complete:function(){}})}});function bs(t){$("body").css({overflow:t?"visible":"hidden"})}$("body").on("open-modal","[modal]",function(ev2){var el2=$(this);var n2=popups.modals.length;var _view=el2.attr("modal");bs();var va=el2.attr("modal-align")??"center middle";var padding=el2.attr("modal-spacing")??"p10";var ov=el2.attr("modal-ov")??"bgb20";va=va.split(" ");if(va.length==2){va={h:["left","center","right"].indexOf(va[0])>=0?va[0]:"center",v:["top","center","middle","bottom"].indexOf(va[1])>=0?va[1]:"middle"}}else{va={h:"center",v:"middle"};setError(null,"Modal align should be modal-align='vertical horizontal'.")}if(!el2.hasAttr("data-modal")){var selector2="modals_"+n2;var popup='<popup class="ov pf [c] z10000"><pop-o class="ov pf [ov]"></pop-o><tbl_nm fixed class="hv100"><cl class="[va] [ta] [p]"><pop-c><pop-x close-modal data-dismiss="modal" aria-label="Close"><span aria-hidden="true" class="cc c">&times;</span></pop-x><pop-h><pop-t>[t]</pop-t><pop-d>[d]</pop-d></pop-h><pop-b>[b]</pop-b><pop-f>[f]</pop-f></pop-c></cl></tbl_nm></popup>';var verticalAlign=va["v"]=="center"||va["v"]=="middle"?"vm":va["v"]=="top"?"vt":"vb";var textAlign=va["h"]=="center"?"c":va["h"]=="left"?"l":"r";popup=popup.split("[va]").join(verticalAlign).split("[p]").join(padding).split("[ta]").join(textAlign).split("[ov]").join(ov);let attrsData={t:el2.attr("modal-title")??"New Modal",d:el2.attr("modal-description")??"",c:el2.attr("modal-class")??""};if(_view!=""){popup=popup.split("[t]").join(attrsData.t);popup=popup.split("[d]").join(attrsData.d);popup=popup.split("[b]").join('<div for-modal="'+selector2+`" view='`+_view+"'></div>");popup=popup.split("[f]").join("")}else{var c=getComData(el2);if(!c){if(el2.find("modal").length>0){var modalData=el2.find("modal:first");var c=getComData(modalData,true)}}if(c){if(c.Title)popup=popup.split("[t]").join(c.Title??attrsData.t);popup=popup.split("[d]").join(c.Description??attrsData.d);popup=popup.split("[b]").join(c.Body??"");popup=popup.split("[f]").join(c.Footer??"")}else{popup=popup.split("[t]").join(attrsData.t);popup=popup.split("[d]").join(attrsData.d);popup=popup.split("[b]").join("");popup=popup.split("[f]").join("")}}popup=popup.split("[c]").join(attrsData.c);var newModal=$(popup);newModal.attr("id",selector2).appendTo("body");let modal2=$("#"+selector2);el2.trigger("modal-open",[modal2]);modal2.data("props",el2.data("props"));modal2.addClass("modal-open").delay(10).queue(function(next){$(this).addClass("in");next()});$(this).attr("data-modal",selector2);popups["modals"].push(newModal.get(0));globalWatch()}if(el2.hasAttr("stop"))ev2.stopPropagation()});$("body").on("click touch","[modal]",function(ev2){let modalTriggered=false;var obj={};$.each($(this)[0].attributes,function(){if(this.value.toLowerCase()=="openmodal"){modalTriggered=true;return}obj[this.name]=this.value});if(!modalTriggered){$(this).trigger("open-modal")}});$("body").on("modal-close","[\\@modal-close]",function(ev,modal,cb){let el=$(this),_v=el.attr("@modal-close");let props=modal.data("props");let _fn=_v.split("(")[0];try{if(typeof window[_v]==="function")cb(window[_fn](ev,el,modal,props));else{let _eva=eval(_v);cb(_eva)}}catch(e2){cb()}});$("body").on("modal-open","[\\@modal-open]",function(ev,modal){let el=$(this),_v=el.attr("@modal-open");let _fn=_v.split("(")[0];try{if(typeof window[_v]==="function"){var _data=window[_fn](ev,el,modal);modal.data("props",_data)}else{let _eva=eval(_v);modal.data("props",_eva)}}catch(e2){}});function evalEvAttr(_v,ev,el,n,arg1,arg2,arg3){let _fn=_v.split("(")[0];try{let _rawEl=el[0];let _ownerFns=_rawEl&&_rawEl._ownerRe&&_rawEl._ownerRe.view&&_rawEl._ownerRe.view.fns;let _ownFn=_v===_fn&&_ownerFns&&typeof _ownerFns[_fn]==="function"?_ownerFns[_fn]:null;if(_ownFn||typeof window[_v]==="function"){ev["cType"]=n;let _handler=_ownFn||window[_fn];var _data=arg3?_handler(ev,el,arg1,arg2,arg3):arg2?_handler(ev,el,arg1,arg2):arg1?_handler(ev,el,arg1):_handler(ev,el);return _data}else{let _eva=eval(_v);return _eva}}catch(e2){return false}}function processEv(ev2,el2,n2,arg12,arg22,arg32){if(el2.attr("stop"))ev2.stopPropagation();if(n2=="focusin")n2="focus";else if(n2=="focusout")n2="blur";if(!el2.hasAttr("@"+n2))return;if(el2.hasAttr("@before-"+n2)){if(!evalEvAttr(el2.attr("@before-"+n2),ev2,el2,n2,arg12,arg22,arg32))return}let _v2=el2.attr("@"+n2);if(_v2.toLowerCase()=="openmodal"){el2.trigger("open-modal");return}evalEvAttr(_v2,ev2,el2,n2,arg12,arg22,arg32)}$("body").on("click touch","[ci]",function(ev2){var el2=$(this);var f=el2.closest("form");var inputs=$("");if(el2.attr("ci")!=""){let ci=el2.attr("ci").split(",");for(let index2=0;index2<ci.length;index2++){const selector2=ci[index2];inputs=inputs.add(f.find(selector2))}}else{inputs=f.find($("input[\\:required],select[\\:required],textarea[\\:required]"))}f.removeClass("validation-error");for(var i=0;i<inputs.length;i++){if(!checkFormInputs(f,inputs[i])){f.addClass("validation-error");break}}});$("body").on("doubletap","[\\@dblclick]",function(ev2){processEv(ev2,$(this),"dblclick")});$("body").on("doubletap","[\\@dbltap]",function(ev2){processEv(ev2,$(this),"dbltap")});$("body").on("singletap","[\\@singleclick]",function(ev2){processEv(ev2,$(this),"singleclick")});$("body").on("singletap","[\\@singletap]",function(ev2){processEv(ev2,$(this),"singletap")});$("body").on("taphold","[\\@taphold]",function(ev2){processEv(ev2,$(this),"taphold")});$("body").on("taphold","[\\@clickhold]",function(ev2){processEv(ev2,$(this),"clickhold")});$("body").on("click touch","[\\@click]",function(ev2){processEv(ev2,$(this),"click")});$("body").on("tap","[\\@tap]",function(ev2){processEv(ev2,$(this),"click touch")});$("body").on("tap2","[\\@click2]",function(ev2){processEv(ev2,$(this),"click2")});$("body").on("tap2","[\\@tap2]",function(ev2){processEv(ev2,$(this),"tap2")});$("body").on("tap2hold","[\\@click2hold]",function(ev2){processEv(ev2,$(this),"click2hold")});$("body").on("tap2hold","[\\@tap2hold]",function(ev2){processEv(ev2,$(this),"tap2hold")});$("body").on("orientationchange","[\\@orientationchange]",function(ev2){processEv(ev2,$(this),"orientationchange")});$("body").on("swipe swipeleft swipedown swipeend swipeup swiperight","[\\@swipe],[\\@swipe-down],[\\@swipe-up],[\\@swipe-left],[\\@swipe-right],[\\@swipe-end]",function(ev2){let _v2=ev2.type.length==5?"swipe":ev2.type.split("swipe").join("swipe-");processEv(ev2,$(this),_v2)});$("body").on("mouseover","[\\@mouse-over]",function(ev2){processEv(ev2,$(this),"mouse-over")});$("body").on("mousedown touchstart","[\\@mouse-down]",function(ev2){processEv(ev2,$(this),"mouse-down")});$("body").on("tapstart","[\\@tap-start]",function(ev2){processEv(ev2,$(this),"tap-start")});$("body").on("tapend","[\\@tap-end]",function(ev2){processEv(ev2,$(this),"tap-end")});$("body").on("tapmove","[\\@tap-move]",function(ev2){processEv(ev2,$(this),"tap-move")});$("body").on("mouseup touchend","[\\@mouse-up]",function(ev2){processEv(ev2,$(this),"mouse-up")});$("body").on("mouseout","[\\@mouse-out]",function(ev2){processEv(ev2,$(this),"mouse-out")});$("body").on("mouseenter touchmove","[\\:hover]",function(ev2){let _s=$(this).attr(":hover");$(this).attr("style",($(this).hasAttr("style")?$(this).attr("style").rtrim(";")+";":"")+_s)});$("body").on("mouseleave touchend","[\\:hover]",function(ev2){let _s=$(this).attr(":hover");$(this).attr("style",$(this).attr("style").split(_s).join(""))});$("body").on("mouseenter","[\\@mouse-enter]",function(ev2){processEv(ev2,$(this),"mouse-enter")});$("body").on("mouseleave","[\\@mouse-leave]",function(ev2){processEv(ev2,$(this),"mouse-leave")});$("body").on("mousemove","[\\@mouse-move]",function(ev2){processEv(ev2,$(this),"mouse-move")});$("body").on("touchmove","[\\@mouse-move]",function(ev2){processEv(ev2,$(this),"mouse-move")});$("body").on("sort","[\\@sort]",function(ev2,ui){processEv(ev2,$(this),"sort",ui)});$("body").on("sortupdate","[\\@sort-update]",function(ev2,ui){processEv(ev2,$(this),"sort-update",ui)});$("body").on("sortchange","[\\@sort-change]",function(ev2,ui){processEv(ev2,$(this),"sort-change",ui)});$("body").on("sortstart","[\\@sort-start]",function(ev2,ui){processEv(ev2,$(this),"sort-start",ui)});$("body").on("sortstop","[\\@sort-stop]",function(ev2,ui){processEv(ev2,$(this),"sort-stop",ui)});$("body").on("sortbeforestop","[\\@sort-before-stop]",function(ev2,ui){processEv(ev2,$(this),"sort-before-stop",ui)});$("body").on("drag","[\\@drag]",function(ev2,ui){processEv(ev2,$(this),"drag",ui)});$("body").on("dragstart","[\\@drag-start]",function(ev2,ui){processEv(ev2,$(this),"drag-start",ui)});$("body").on("dragstop","[\\@drag-stop]",function(ev2,ui){processEv(ev2,$(this),"drag-stop",ui)});$("body").on("drop","[\\@drop]",function(ev2,ui){processEv(ev2,$(this),"drop",ui)});$("body").on("clear","[sl]",function(ev2,ui){let t=$(this);t.empty().change();try{let opts=t.data("select2")?.options?.options;opts.data=null;t.select2(opts)}catch(e2){cl(e2)}});$("body").on("change blur focus keyup keydown input","[\\@input],[\\@change],[\\@blur],[\\@focus],[\\@keyup],[\\@keydown]",function(ev2){processEv(ev2,$(this),ev2.type)});$("body").on("click touch","[close-modal]",function(ev){var el=$(this);var modal=el.closest("popup");var id=modal.attr("id");var element_to_remove=$("#"+id).get(0);var index=$.inArray(element_to_remove,popups.modals);var modalOwner=$("[modal][data-modal="+id+"]");if(el.attr("stop"))ev.stopPropagation();ev.preventDefault();if(modalOwner.hasAttr("@modal-beforeclose")){cl("kuku");try{let _bv=modalOwner.attr("@modal-beforeclose");let _fn=_bv.split("(")[0];if(typeof window[_bv]==="function"){cl("sasha");if(window[_fn](ev,el,modalOwner)==false)return;else{cl("llll");let _eva=eval(_bv);if(_eva==false)return;cl("khaaawwwww")}}}catch(e2){cl("haha");cl(e2)}}if(modalOwner.hasAttr("@modal-close")){modalOwner.trigger("modal-close",[modal,function(res){if(res===false)return;$(".select2-container:not(.select2),.colorpicker.colorpicker-visible").remove();if(index>-1){$("[modal][data-modal="+id+"]").removeAttr("data-modal");modal.removeClass("in").delay(150).queue(function(next){$(this).remove();if(popups.modals.length==0)bs(true);next()});popups.modals.splice(index,1)}}])}else{$(".select2-container:not(.select2),.colorpicker.colorpicker-visible").remove();if(index>-1){$("[modal][data-modal="+id+"]").removeAttr("data-modal");modal.removeClass("in").delay(150).queue(function(next){$(this).remove();if(popups.modals.length==0)bs(true);next()});popups.modals.splice(index,1)}}});$("body").on("change keyup","[password]",function(e2){let el2=$(this);let lbl=el2.closest("label");let f=el2.closest("form");var v=$.trim($(this).val());let allCls="has-spaces weak strong very-strong medium";let cls=passwordStrength(v);el2.removeClass(allCls).addClass(cls);if(f.length)f.removeClass(allCls).addClass(cls);if(lbl.length)lbl.removeClass(allCls).addClass(cls);if(!$(this).next().hasClass("passStrength"))$(this).after("<span class='passStrength'></span>");$(this).parent().find(".passStrength").removeClass(allCls).addClass(cls)});$("body").on("change keyup","[username]",function(e2){var keyCode=e2.keyCode||e2.which;if(keyCode!=9&&keyCode!=16&&keyCode!=27&&keyCode!=93&&keyCode!=91&&keyCode!=17&&keyCode!=18){var el2=$(this);let f=el2.closest("form");checkFormInputs(f,el2,true)}});$("body").on("focus","input:not(.select2-search__field,.mobinit),textarea,select",function(ev2){var el2=$(this);var f=el2.closest("form");let lbl=el2.closest("label");if(f.length)f.addClass("focused");if(lbl.length)lbl.addClass("focused");el2.parent().addClass("focused");el2.addClass("focused")});$("body").on("blur","input:not(.select2-search__field,.mobinit),textarea,select",function(ev2){var el2=$(this);var f=el2.closest("form");if(f.length)f.removeClass("focused");el2.parent().removeClass("focused");el2.removeClass("focused")});$("body").on("change keyup","input:not(.select2-search__field,.mobinit),textarea,select",function(ev2){var el2=$(this);let f=el2.closest("form");checkFormInputs(f,el2,true)});var _lookups=0;var _debs={};var _proms={};$("body").on("change keyup","[\\:lookup]",function(e2){var keyCode=e2.keyCode||e2.which;if(keyCode!=9&&keyCode!=16&&keyCode!=27&&keyCode!=93&&keyCode!=91&&keyCode!=17&&keyCode!=18){var el2=$(this);if(!el2.attr("data-i")){el2.attr("data-i",_lookups);_lookups++}var key="lu_"+el2.attr("data-i");clearTimeout(_debs[key]);var v=$(this).val();var callback=el2.attr(":lookup-callback");if(!_proms.hasOwnProperty(key)){_proms[key]=defer();_proms[key].then(function(val){el2.addClass("finished").removeClass("pending")}).catch(reason=>{el2.addClass("pending").removeClass("finished")})}else{}el2.addClass("pending").removeClass("finished");_debs[key]=setTimeout(function(){_proms[key].reject();_proms[key]=defer();_proms[key].then(function(val){el2.addClass("finished").removeClass("pending")}).catch(reason=>{el2.addClass("pending").removeClass("finished")});window[callback](v,_proms[key])},200)}});$("body").on("click touch","a,area",function(e2){var el2=$(this);var link=el2.attr("href");if(link==""||$(this).closest(".cke").length==1||$(this).closest(".chosen-container").length==1||$(this).attr("target")=="_blank"||$(this).attr("target")=="_new"||$(this).hasClass("norm")||$(this).closest(".gm-style").length==1){}else{var local=false;var l=getLocation(link);var l2=getLocation(appSettings.Base);var url="home";local=l.hostname==l2.hostname;var url=l.pathname.split(l2.pathname);if(l.pathname=="/"||l.pathname=="/home"){url="home"}else{url=url.join("/")}if(local&&!cntrlon){e2.preventDefault();if(el2.hasAttr("stop"))e2.stopPropagation();pushURL(url+(l.search!=""?l.search:""))}else{}}});$("body").on("click touch","[h],[s]",function(e){var el=$(this);if(el.hasAttr("confirm")){if(!confirm(el.attr("confirm")))return false}if(el.hasAttr("econfirm"))eval(el.attr("econfirm"));var attrs=el.attr();var hI=Object.keys(attrs).indexOf("h");var sI=Object.keys(attrs).indexOf("s");if(sI<hI){$(el.attr("s")).show();$(el.attr("h")).hide()}else{$(el.attr("h")).hide();$(el.attr("s")).show()}if(el.hasAttr("stop"))e.stopPropagation()});$("body").on("click touch","[e]",function(e){var el=$(this);if(el.hasAttr("confirm")){if(!confirm(el.attr("confirm")))return false}if(el.hasAttr("econfirm"))eval(el.attr("econfirm"));if($($(this).attr("e")).is("input"))$($(this).attr("e")).val("");else $($(this).attr("e")).empty()});$("body").on("click touch","[f]",function(e2){var el2=$(this);$(el2.attr("f")).trigger("focus");if(el2.hasAttr("stop"))e2.stopPropagation()});$("body").on("click touch","[tgl]",function(e){var el=$(this);if(el.hasAttr("confirm")){if(!confirm(el.attr("confirm")))return false}if(el.hasAttr("econfirm"))eval(el.attr("econfirm"));el.toggleClass(el.attr("tgl"));el.toggleClass("toggled");if(el.hasAttr("stop"))e.stopPropagation()});$("body").on("click touch","[t]",function(e){var el=$(this);var tcn=el.attr("tcn")?el.attr("tcn"):"active";if(el.hasAttr("confirm")){if(!confirm(el.attr("confirm")))return false}if(el.hasAttr("econfirm"))eval(el.attr("econfirm"));$(el.attr("t")).toggleClass(tcn);el.toggleClass("toggled");if(el.hasAttr("stop"))e.stopPropagation()});$("body").on("click touch","[actv]",function(e2){let el2=$(this);if(el2.attr("actv")!="")$(el2.attr("actv")).removeClass("active");el2.addClass("active");if(el2.attr("stop"))e2.stopPropagation()});$("body").on("click touch","[actvt]",function(e2){let el2=$(this);if(el2.attr("actvt")!="")$(el2.attr("actvt")).removeClass("active");if(el2.hasClass("active"))el2.removeClass("active");else el2.addClass("active");if(el2.attr("stop"))e2.stopPropagation()});$("body").on("click touch","[close-notify]",function(e2){var tis=$(this).parent();tis.fadeOut(function(){tis.remove()});if($(this).attr("stop"))e2.stopPropagation()});let _keyInt;$("body").on("change blur focus keyup keydown input","[icons_search]",function(ev2){var key=$.trim($(this).val());var outlet=$($(this).attr("icons_outlet"));var count_outlet=$($(this).attr("icons_count_outlet"));clearTimeout(_keyInt);if(key==""||key.length<=2){count_outlet.hide();outlet.html("")}else{_keyInt=setTimeout(function(){fetch("https://api.iconify.design/search?query="+key+"&limit=250",{method:"GET"}).then(function(response){return response.json()}).then(function(r){count_outlet.show();let icons=r.icons;outlet.html("");count_outlet.html((r.total>250?r.total+"+":r.total)+" icons found..");for(let i=0;i<icons.length;i++){outlet.append(`
@@ -48,3 +46,5 @@ var _navT=0;var _nav=false;var _pbc;var _vuid={};$("body").on("click touch tap",
48
46
  </div>
49
47
  </div>
50
48
  `;$("body").append(l);if(this.options.hasOwnProperty("Progress")){var min=this.options.Progress;var max=100;if(this.options.hasOwnProperty("MaxProgress"))max=this.options.MaxProgress;$("."+this.options.Class+"[loader] .wrapper").append($('<div class="prog">'+min+"/"+max+"</div>"))}}show(){if($("."+this.options.Class+"[loader]").length)return;this.init();$("body").css("overflow","hidden")}hide(){$("."+this.options.Class+"[loader]").unbind("click");$("."+this.options.Class+"[loader]").remove();$("body").css("overflow","auto")}update(options){for(var k in options){this.options[k]=options[k]}if(options.hasOwnProperty("Message")){$("."+this.options.Class+"[loader] .wrapper .text").html(options.Message)}if(options.hasOwnProperty("Progress")){var max=100;if(options.hasOwnProperty("MaxProgress"))max=this.options.MaxProgress;if(!$("."+this.options.Class+"[loader] .wrapper .prog").length)$("."+this.options.Class+"[loader] .wrapper").append($('<div class="prog">'+options.Progress+"/"+max+"</div>"));else $("."+this.options.Class+"[loader] .wrapper .prog").html(options.Progress+"/"+max)}}}var _loader=new Loader;
49
+
50
+ if(typeof _beaTn==="undefined"||!_beaTn){if(typeof XMLHttpRequest==="function"){try{var _idxXhr=new XMLHttpRequest;_idxXhr.open("GET","/index.js",false);_idxXhr.send(null);if(_idxXhr.status>=200&&_idxXhr.status<300){(0,eval)(_idxXhr.responseText)}else{console.log("Failed to load index.js: HTTP "+_idxXhr.status)}}catch(e){console.error("Failed to load index.js: ",e)}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lmjs/core",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "description": "LumenJS reactive core runtime — the reactive engine, HTML/JS AST compiler, realtime socket client, and delegated event listeners powering LumenJS applications.",
5
5
  "files": [
6
6
  "dist/",