UNPKG

neft

Version:

Universal Platform

2 lines 314 kB
var Neft = (function(){var process="undefined"!=typeof global&&global.process||{env:{}};process.env.NEFT_PLATFORM="android",process.env.NEFT_CLIENT="1",process.env.NEFT_NATIVE="1",process.env.NEFT_ANDROID="1";var t=[function(exports){var module={exports:exports},require=n({"src/app":2,"src/utils":153,"src/signal":145,"src/dict":10,"src/list":49,"src/log":50,"src/resources":133,"src/renderer":99,"src/networking":60,"src/schema":135,"src/document":36,"src/assert":4,"src/db":9,"src/native":54,"src/styles":148,"src/eventLoop":48,"src/tryCatch":150,"src/binding":5}),exports=module.exports;return function(){(function(){"use strict";var exports;exports=module.exports=require("src/app"),exports.utils=require("src/utils"),exports.signal=require("src/signal"),exports.Dict=require("src/dict"),exports.List=require("src/list"),exports.log=require("src/log"),exports.Resources=require("src/resources"),exports.Renderer=require("src/renderer"),exports.Networking=require("src/networking"),exports.Schema=require("src/schema"),exports.Document=require("src/document"),exports.styles=require("src/styles"),exports.assert=require("src/assert"),exports.db=require("src/db"),exports.eventLoop=require("src/eventLoop"),exports.tryCatch=require("src/tryCatch"),exports.Binding=require("src/binding"),exports.native=function(){try{return require("src/native")}catch(t){}}(),exports.nmlParser=function(){try{return require("src/nml-parser")}catch(t){}}()}).call(this)}(),module.exports},function(exports){var module={exports:exports},exports=(n({}),module.exports);return function(){module.exports={name:"neft",version:"0.11.23",preferGlobal:!0,description:"Universal Platform",keywords:["framework","native","android","ios","webgl"],bin:{neft:"bin/neft.js"},main:"index.coffee",license:"Apache-2.0",homepage:"http://neft.io",author:"Krystian Kruk <krystian@neft.io>",contributors:[],repository:{type:"git",url:"https://github.com/Neft-io/neft.git"},bugs:"https://github.com/Neft-io/neft/issues",engines:{node:">=8.0.0"},scripts:{bundle:"cross-env NODE_PATH=./ coffee --nodejs --harmony scripts/bundle.coffee",test:"node ./bin/neft.js test","update-api-docs":"cross-env NODE_PATH=./ coffee scripts/api-docs.coffee",prepublishOnly:"npm run bundle"},dependencies:{acorn:"^5.2.1","babel-core":"6.22.1","babel-preset-es2015":"6.22.0","babel-preset-es2016":"6.22.0","babel-preset-es2017":"6.22.0",chokidar:"1.5.1","coffee-script":"1.10.0","cross-env":"1.0.8","form-data":"1.0.0-rc4","fs-extra":"0.30.0",glob:"7.0.3",htmlparser2:"3.9.0","http-server":"0.9.0",jimp:"0.2.27","js-yaml":"3.6.1",mkdirp:"0.5.1",mustache:"2.2.1","node-notifier":"4.6.0","node-static":"0.7.7",open:"0.0.5",pegjs:"0.10.0",pngjs:"3.0.0",qs:"6.2.0",semver:"5.1.0",slash:"1.0.0","uglify-js":"2.7.5",which:"1.2.12",xcode:"0.8.7"},devDependencies:{"coffee-coverage":"1.0.1",coveralls:"2.11.14","escape-html":"1.0.3",imgur:"0.2.1",istanbul:"^0.4.5",wd:"0.4.0"},android:{package:"io.neft.tests",versionCode:1,versionName:"1.0",application:{label:"Neft.io Tests"}},ios:{package:"io.neft.tests",application:{label:"Neft.io Tests"}}}}(),module.exports},function(exports){var module={exports:exports},require=n({"src/utils":153,"src/log":50,"src/signal":145,"src/db":9,"src/assert":4,"src/schema":135,"src/networking":60,"src/document":36,"src/renderer":99,"src/styles":148,"src/resources":133,"src/dict":10,"./route":3,"package.json":1}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r,i,o,s,u,l,a,c,p,h,exports,f,d,_;_=require("src/utils"),f=require("src/log"),d=require("src/signal"),h=require("src/db"),c=require("src/assert"),l=require("src/schema"),o=require("src/networking"),i=require("src/document"),s=require("src/renderer"),a=require("src/styles"),u=require("src/resources"),r=require("src/dict"),t=require("./route"),p=function(){try{return require("./bootstrap/route.node")}catch(t){}}(),e=/(.+)\.(?:node|server|client|browser|ios|android|native)/,n={title:"Neft.io Application",protocol:"http",port:3e3,host:"localhost",language:"en",type:"app"},exports=module.exports=function(l,c){var f,g,m,y,v,b,x,S,E,I,P,O,w,C,A,T,R,N,L,k,D,F,M,V,j,B,H,W,U,z,q;if(null==l&&(l={}),null==c&&(c={}),v=_.clone(n),v=_.mergeAll(v,l.config,c),m=new r,m.config=v,m.networking=new o({type:o.HTTP,protocol:v.protocol,port:parseInt(v.port,10),host:v.host,url:v.url,language:v.language}),m.routes={},m.styles={},m.components={},m.resources=function(){return l.resources?u.fromJSON(l.resources):new u}(),d.create(m,"onReady"),null==v.type&&(v.type="app"),m.Route=t(m),f="__neft_cookies",g=!process.env.NEFT_SERVER,m.cookies=r(),N=function(t){if(m.cookies=t,g)return t.set("sessionId",_.uid(16))},h.get(f,h.OBSERVABLE,function(t,e){var n;return e?N(e):(n=g?{clientId:_.uid(16)}:{},h.set(f,n,function(t){return h.get(f,h.OBSERVABLE,function(t,e){if(e)return N(e)})}))}),m.networking.onRequest(function(t,e){g?_.merge(t.cookies,m.cookies):_.merge(e.cookies,m.cookies),t.onLoadEnd.listeners.unshift(function(){var t,n,r;if(g){n=e.cookies;for(t in n)r=n[t],_.isEqual(m.cookies[t],r)||m.cookies.set(t,r)}},null)}),s.setResources(m.resources),s.setServerUrl(m.networking.url),s.onLinkUri(function(t){return m.networking.createLocalRequest({method:o.Request.GET,type:o.Request.HTML_TYPE,uri:t})}),m.documentScripts=_.arrayToObject(l.scripts,function(t,e){return e.name},function(t,e){return e.file}),i.Scripts.initialize(m.documentScripts),null!=l.styles)for(D=l.styles,x=0,O=D.length;x<O;x++)if(W=D[x],"windowItem"===(F=W.name)||"__windowItem__"===F){W.file._init({windowItem:null}),z=W.file._main({document:null});break}if(m.windowItem=q=null!=z?z.item:void 0,s.setWindowItem(q),null!=l.styles)for(U={windowItem:q},M=l.styles,E=0,w=M.length;E<w;E++)W=M[E],null!=W.name&&("windowItem"!==W.name&&W.file._init(U),m.styles[W.name]=W.file);if(a({windowStyle:z,styles:m.styles,queries:l.styleQueries,resources:m.resources}),"function"==typeof p&&p(m),S=function(t,n){var r,i,o,s,u,l,a;for(l=0,a=t.length;l<a;l++)s=t[l],null!=s.name&&"function"==typeof s.file&&(u=s.file(m),n[s.name]=u,(o=e.exec(s.name))&&(r=o[0],i=o[1],null!=n[i]&&_.isPlainObject(n[i])&&_.isPlainObject(u)&&(u=_.merge(Object.create(n[i]),u)),n[i]=u))},_.isObject(l.extensions))for(V=l.extensions,I=0,C=V.length;I<C;I++)(b=V[I])(m);for(exports.app={Route:m.Route},j=l.components,P=0,A=j.length;P<A;P++)y=j[P],null!=y.name&&(m.components[y.name]=i.fromJSON(y.file));S(l.routes,m.routes),B=m.routes;for(L in B){if(R=B[L],k={},_.isObject(R)&&!(R instanceof m.Route))for(T in R)l=R[T],_.isObject(l)?(H=new m.Route(T,l),k[H.name]=H):k[T]=l;m.routes[L]=k}return m.routes.index||(m.routes.index=new m.Route("get /",{})),m.onReady.emit(),m}}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=n({"src/utils":153,"src/signal":145,"src/assert":4,"src/log":50,"src/schema":135,"src/networking":60,"src/document":36,"src/renderer":99,"src/dict":10}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r,i,o,s,u,l,a,c;c=require("src/utils"),a=require("src/signal"),u=require("src/assert"),l=require("src/log"),s=require("src/schema"),i=require("src/networking"),e=require("src/document"),o=require("src/renderer"),t=require("src/dict"),l=l.scope("App","Route"),r=process.env.NEFT_NODE,n=!r,module.exports=function(o){var u;return u=function(){function u(t,e,n){var r,u,l;c.isObject(t)?n=t:c.isObject(e)?n=e:c.isObject(n)||(n={}),"string"==typeof t&&"string"!=typeof e?n.uri=t:"string"==typeof t&&"string"==typeof e&&(null==n.method&&(n.method=t),null==n.uri&&(n.uri=e)),"function"==typeof e&&null==n.getData&&(n.getData=e),n=c.clone(n),"string"==typeof n.uri&&(u=n.uri.indexOf(" "),u!==-1&&(null==n.method&&(n.method=n.uri.slice(0,u)),n.uri=n.uri.slice(u+1)),n.uri=new i.Uri(n.uri)),null==n.method&&(n.method="get"),n.method=n.method.toLowerCase(),null!=n.schema&&c.isPlainObject(n.schema)&&(n.schema=new s(n.schema)),null!=n.redirect&&"string"==typeof n.redirect&&(n.redirect=new i.Uri(n.redirect)),c.isObject(n.toHTML)&&(n.toHTML=h(n.toHTML));for(r in n)l=n[r],this[r]=l;this.__id__=c.uid(),this.app=o,this.name||(this.name=m(this)),o.networking.createHandler({method:this.method,uri:this.uri,schema:this.schema,callback:c.bindFunctionContext(y,this)})}var p,h,f,d,_,g,m,y,v,b,x,S,E,I,P,O,w,C;return r?C=[]:w=Object.create(null),u.lastClientRoute=null,u.onLastClientRouteChange=a.create(),u.getTemplateComponent=function(){return r?function(e){var n,r;return n={app:o,routes:new t},r=o.components[e].render(null,n),C.push(r),r}:function(e){var n;return n={app:o,routes:new t},null!=w[e]?w[e]:w[e]=o.components[e].render(null,n)}}(),m=function(t){var e;for(e=t.uri._uri,e=e.replace(i.Uri.NAMES_RE,""),e=e.replace(/\*/g,"");e.indexOf("//")!==-1;)e=e.replace(/\/\//g,"/");return e=e.replace(/^\//,""),e=e.replace(/\/$/,"")},O=Object.create(null),b=Object.create(null),d=function(){var t;return t=function(t){var e;return e=Object.create(t),e.__hash__=c.uid(),"function"==typeof e.factory&&e.factory(),e},function(e){var n,r;return n=e.__id__,null==O[n]&&(O[n]=[]),r=O[n].pop()||t(e),r=Object.create(r),r.request=r.response=null,r.route=r,r._dataPrepared=!1,r._destroyComponentOnEnd=!1,r}}(),f=function(t){if(t.response.onSend.disconnect(v,t),delete b[t.__hash__],"function"==typeof t.destroy&&t.destroy(),t._dataPrepared)switch(t.request.type){case"text":"function"==typeof t.destroyText&&t.destroyText();break;case"json":"function"==typeof t.destroyJSON&&t.destroyJSON();break;case"html":"function"==typeof t.destroyHTML&&t.destroyHTML()}t._destroyComponentOnEnd&&t.response.data.destroy(),O[t.__id__].push(Object.getPrototypeOf(t)),u.lastClientRoute===t&&(u.lastClientRoute=null,u.onLastClientRouteChange.emit(t))},I=function(t){return t.data=t.getData()},E=function(t,e,n){if(null!=e){if(200===t.response.status&&(t.response.status=500),t._dataPrepared&&t.error===e)return!1;t.error=e}else{if(t._dataPrepared&&t.data===n)return!1;t.data=n}return!0},x=function(t){var n,r,i;switch(i=t.response,t.error,r=i.data,t.request.type){case"text":n=t.toText();break;case"json":n=t.toJSON();break;case"html":n=t.toHTML(),r instanceof e&&t._destroyComponentOnEnd&&(r.destroy(),i.data=null),n instanceof e||i.data!==r||(n=S.call(t,n))}return t._dataPrepared=!0,null!=n?i.data=n:i.data===r?i.data="":void 0},v=function(){(r||"html"!==this.request.type)&&(f(this),r&&c.has(C,this.response.data)&&(this.response.data.destroy(),c.remove(C,this.response.data)))},_=function(t){n&&t.response.data instanceof e&&(o.windowItem.node=t.response.data.node),t.response.pending&&t.response.send()},p=function(t,e){return!b[t.__hash__]&&(t.response.pending&&e(),!0)},y=function(t,e,r){var o,s,l,a,c,h;if(h=d(this),l=h.__hash__,n&&(u.lastClientRoute&&f(u.lastClientRoute),a=u.lastClientRoute,u.lastClientRoute=h,u.onLastClientRouteChange.emit(a)),h.request=t,h.response=e,b[l]=!0,e.onSend(v,h),"function"==typeof h.init&&h.init(),!b[l])return r();if(c=h.redirect,"function"==typeof c&&(c=h.redirect(),!b[l]))return r();if("string"==typeof c&&(c=new i.Uri(c)),c instanceof i.Uri)return void e.redirect(c.toString(t.params));if(s=h.getData,o=!1,"function"==typeof s)if(1===s.length)h.getData(function(t,e){if(o=!0,!p(h,r)&&E(h,t,e)&&(x(h),!p(h,r)))return _(h)});else{if(I(h),p(h,r))return;if(x(h),p(h,r))return;_(h)}else{if(x(h),p(h,r))return;_(h)}!o&&p(h,r)},u.prototype.next=function(){return f(this)},u.prototype.toJSON=function(){var t,e;return this.response.status<400?(null!=(e=this.data)&&"function"==typeof e.toJSON?e.toJSON():void 0)||this.data:("function"==typeof(t=this.error).toJSON?t.toJSON():void 0)||this.error},u.prototype.toText=function(){return this.response.status<400?this.data+"":this.error+""},P=function(){return this.method+" "+this.uri},g=function(){var t;if(t="components/"+this.name+".xhtml",o.components[t])return t},S=function(t){var e,n,r,i,s,a,c,p;return n=(null!=t?t.component:void 0)||g.call(this)||"components/index.xhtml",c=(null!=t?t.template:void 0)||n,p=(null!=t?t.use:void 0)||"body",r=l.time("Render"),n!==c&&(s=o.components[c])&&(a=u.getTemplateComponent(c),a.use(p,null)),(e=o.components[n])&&(i=e.render(null,this)),a?(i=null!=i?a.use(p,i):a,a.context.routes.has(p)&&a.context.routes.pop(p),a.context.routes.set(p,this),this._destroyComponentOnEnd=!1):this._destroyComponentOnEnd=!0,i},h=function(t){return function(){return S.call(this,t)}},u.prototype.toHTML=h({component:"",template:"",use:""}),u}()}}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=n({"src/utils":153}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r,i=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},o={}.hasOwnProperty;r=require("src/utils"),e=module.exports=function(t,n){if(!t)return e.fail(t,!0,n,"==",e)},e.AssertionError=t=function(t){function e(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,this.scope=t.scope,this.message=e.generateMessage(this,t.message),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t.stackStartFunction),"android"===process.env.NEFT_PLATFORM}var n;return i(e,t),n=function(t){var e;return r.isObject(t)&&(e=function(){try{return JSON.stringify(t)}catch(t){}}()),e||String(t)},e.generateMessage=function(t,e){return e||n(t.actual)+" "+t.operator+" "+n(t.expected)},e}(Error),n=function(t){var e;return e=function(n,r,i,o,s){throw new t.AssertionError({actual:n,expected:r,message:i,operator:o,scope:t._scope,stackStartFunction:s||e})}},e.scope=function(t){var i;return t=""+this._scope+t,i=function(t,n){return e(t,n)},r.merge(i,e),i.fail=n(i),i._scope=t,i},e.fail=n(e),e._scope="",e.ok=e,e.notOk=function(t,n){if(t)return this.fail(t,!0,n,"!=",e.notOk)},e.is=function(t,n,i){if(!r.is(t,n))return this.fail(t,n,i,"===",e.is)},e.isNot=function(t,n,i){if(r.is(t,n))return this.fail(t,n,i,"!==",e.isNot)},e.isDefined=function(t,n){if(null==t)return this.fail(t,null,n,"!=",e.isDefined)},e.isNotDefined=function(t,n){if(null!=t)return this.fail(t,null,n,"==",e.isNotDefined)},e.isPrimitive=function(t,n){if(!r.isPrimitive(t))return this.fail(t,"primitive",n,"is",e.isPrimitive)},e.isNotPrimitive=function(t,n){if(r.isPrimitive(t))return this.fail(t,"primitive",n,"isn't",e.isNotPrimitive)},e.isString=function(t,n){if("string"!=typeof t)return this.fail(t,"string",n,"is",e.isString)},e.isNotString=function(t,n){if("string"==typeof t)return this.fail(t,"string",n,"isn't",e.isNotString)},e.isFloat=function(t,n){if(!r.isFloat(t))return this.fail(t,"float",n,"is",e.isFloat)},e.isNotFloat=function(t,n){if(r.isFloat(t))return this.fail(t,"float",n,"isn't",e.isNotFloat)},e.isInteger=function(t,n){if(!r.isInteger(t))return this.fail(t,"integer",n,"is",e.isInteger)},e.isNotInteger=function(t,n){if(r.isInteger(t))return this.fail(t,"integer",n,"isn't",e.isNotInteger)},e.isBoolean=function(t,n){if("boolean"!=typeof t)return this.fail(t,"boolean",n,"is",e.isBoolean)},e.isNotBoolean=function(t,n){if("boolean"==typeof t)return this.fail(t,"boolean",n,"isn't",e.isNotBoolean)},e.isFunction=function(t,n){if("function"!=typeof t)return this.fail(t,"function",n,"is",e.isFunction)},e.isNotFunction=function(t,n){if("function"==typeof t)return this.fail(t,"function",n,"isn't",e.isNotFunction)},e.isObject=function(t,n){if(null===t||"object"!=typeof t)return this.fail(t,"object",n,"is",e.isObject)},e.isNotObject=function(t,n){if(null!==t&&"object"==typeof t)return this.fail(t,"object",n,"isn't",e.isNotObject)},e.isPlainObject=function(t,n){if(!r.isPlainObject(t))return this.fail(t,"plain object",n,"is",e.isPlainObject)},e.isNotPlainObject=function(t,n){if(r.isPlainObject(t))return this.fail(t,"plain object",n,"isn't",e.isNotPlainObject)},e.isArray=function(t,n){if(!Array.isArray(t))return this.fail(t,"array",n,"is",e.isArray)},e.isNotArray=function(t,n){if(Array.isArray(t))return this.fail(t,"array",n,"isn't",e.isNotArray)},e.isEqual=function(t,n,i,o){if("object"==typeof i&&(o=i,i=void 0),!r.isEqual(t,n,null!=o?o.maxDeep:void 0))return this.fail(t,n,i,"equal",e.isEqual)},e.isNotEqual=function(t,n,i,o){if("object"==typeof i&&(o=i,i=void 0),r.isEqual(t,n,null!=o?o.maxDeep:void 0))return this.fail(t,n,i,"isn't equal",e.isNotEqual)},e.instanceOf=function(t,n,r){var i;if(!(t instanceof n))return i=n.__path__||n.__name__||n.name||n,this.fail(t,i,r,"instanceof",e.instanceOf)},e.notInstanceOf=function(t,n,r){var i;if(t instanceof n)return i=n.__path__||n.__name__||n.name||n,this.fail(t,i,r,"instanceof",e.notInstanceOf)},e.lengthOf=function(t,n,r){if((null!=t?t.length:void 0)!==n)return this.fail(t,n,r,".length ===",e.lengthOf)},e.notLengthOf=function(t,n,r){if((null!=t?t.length:void 0)===n)return this.fail(t,n,r,".length !==",e.notLengthOf)},e.operator=function(t,n,r,i){var o;if(o=function(){switch(n){case">":return t>r;case">=":return t>=r;case"<":return t<r;case"<=":return t<=r;default:throw new TypeError("Unexpected operator `"+n+"`")}}(),!o)return this.fail(t,r,i,n,e.operator)},e.match=function(t,n,r){if(!n.test(t))return this.fail(t,n,r,"match",e.match)},e.notMatch=function(t,n,r){if(n.test(t))return this.fail(t,n,r,"not match",e.match)}}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=n({"src/utils":153,"src/log":50,"src/assert":4,"src/dict":10,"src/list":49}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r,i,o,s,u,l,a;a=require("src/utils"),l=require("src/log"),o=require("src/assert"),n=require("src/dict"),r=require("src/list"),l=l.scope("Binding"),u=Array.isArray,i=50,s=function(){var t;return t=Object.create(null),function(e){return t[e]||(t[e]="on"+a.capitalize(e)+"Change")}}(),e=function(){function t(e,n,r,i){this.binding=e,this.prop=r,this.parent=i,this.handlerName=s(this.prop),this.isConnected=!1,u(n)?(this.itemId="",this.child=t.factory(this.binding,n[0],n[1],this),this.item=this.child.getValue()):(this.itemId=n,this.child=null,this.item=this.binding.getItemById(n)),this.connect()}var e;return e=[],t.factory=function(n,r,i,o){var s;return null==o&&(o=null),e.length>0&&(s=e.pop())?(t.call(s,n,r,i,o),s):new t(n,r,i,o)},t.prototype.getSignalChangeListener=function(){var t,e,r,i;return r=function(t,e){void 0!==e&&"string"==typeof t&&this.parent.prop!==t||this.parent.updateItem()},t=function(){this.binding.update()},i=function(t){this.prop===t&&this.parent.updateItem()},e=function(t){this.prop===t&&this.binding.update()},function(){return this.item instanceof n?this.parent?i:e:this.parent?r:t}}(),t.prototype.update=function(){return this.getSignalChangeListener().call(this)},t.prototype.connect=function(){var t,e;e=this.item,e&&(e instanceof n?(this.isConnected=!0,e.onChange(this.getSignalChangeListener(),this)):e instanceof r?(this.isConnected=!0,t=this.getSignalChangeListener(),e.onChange(t,this),e.onInsert(t,this),e.onPop(t,this)):(t=e[this.handlerName])&&(this.isConnected=!0,t(this.getSignalChangeListener(),this)))},t.prototype.disconnect=function(){var t,e;e=this.item,e&&this.isConnected&&(t=this.getSignalChangeListener(),e instanceof n?e.onChange.disconnect(t,this):e instanceof r?(e.onChange.disconnect(t,this),e.onInsert.disconnect(t,this),e.onPop.disconnect(t,this)):e[this.handlerName].disconnect(t,this)),this.isConnected=!1},t.prototype.updateItem=function(){var t,e;t=this.item,e=this.child?this.child.getValue():this.binding.getItemById(this.itemId),t&&!this.isConnected&&(this.connect(),t=null),t!==e&&(this.disconnect(),this.item=e,this.connect(),this.parent||this.binding.update()),this.parent&&this.parent.updateItem()},t.prototype.getValue=function(){return this.item?this.item[this.prop]:null},t.prototype.destroy=function(){var t;this.disconnect(),null!=(t=this.child)&&t.destroy(),e.push(this)},t}(),module.exports=t=function(){function t(t,e){this.ctx=e,this.func=t[0],this.args=null,this.connections||(this.connections=[])}return t.New=function(n,r,i){var o,s,l,a,c;for(null==i&&(i=new t(n,r)),o=i.connections,c=n[1],l=0,a=c.length;l<a;l++)s=c[l],u(s)&&o.push(e.factory(i,s[0],s[1]));return i},t.prototype.getItemById=function(t){throw new Error("Not implemented")},t.prototype.getValue=function(){throw new Error("Not implemented")},t.prototype.getDefaultValue=function(){switch(typeof this.getValue()){case"string":return"";case"number":return 0;case"boolean":return!1;default:return null}},t.prototype.setValue=function(t){throw new Error("Not implemented")},t.prototype.onError=function(t){},t.prototype.update=function(){var t;t=a.tryFunction(this.func,this.ctx,this.args),t instanceof Error&&(this.onError(t),t=this.getDefaultValue()),this.setValue(t)},t.prototype.getLoopDetectedErrorMessage=function(){return"Potential loop detected"},t.prototype.destroy=function(){for(var t;t=this.connections.pop();)t.destroy();this.args=null},t}()}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=n({"src/utils":153,"./implementations/native":8,"./implementations/memory":7}),exports=module.exports;return function(){(function(){"use strict";var t;t=require("src/utils"),module.exports=function(){var t;return t=function(){try{return require("./implementations/browser")}catch(t){}}(),t||(t=function(){try{return require("./implementations/native")}catch(t){}}()),t||(t=require("./implementations/memory")),t}()}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=n({"src/utils":153}),exports=module.exports;return function(){(function(){"use strict";var t,e;e=require("src/utils"),t=Object.create(null),exports.get=function(n,r){var i;return i=t[n],i=e.cloneDeep(i),r(null,i)},exports.set=function(e,n,r){return t[e]=n,r(null)},exports.remove=function(e,n){return t[e]=void 0,n(null)}}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=n({"src/utils":153,"src/native":54}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r,i,o,s,u;u=require("src/utils"),o=require("src/native"),t=o.callNativeFunction,i=o.onNativeEvent,r=0,e=Object.create(null),i("__neftDbResponse",function(t,n,r){return"function"==typeof e[t]&&e[t](n,r),delete e[t]}),s=function(t){return e[r]=t,r+=1,r%=99999},n=function(t){return encodeURIComponent(String(t))},exports.get=function(e,i){return t("__neftDbGet",n(e),r),s(function(t,e){return t&&(t=new Error(t)),e=u.tryFunction(JSON.parse,null,[e],e),i(t,e)})},exports.set=function(e,i,o){var l;if(u.isObject(i))try{i=JSON.stringify(i)}catch(t){return l=t,o(l)}return t("__neftDbSet",n(e),String(i),r),s(o)},exports.remove=function(e,i){return t("__neftDbRemove",n(e),r),s(i)}}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=n({"src/utils":153,"src/assert":4,"src/list":49,"src/dict":10,"./implementation":6}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r,i,o,s,u,l,a,c,p,h=function(t,e){function n(){this.constructor=t}for(var r in e)f.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},f={}.hasOwnProperty;a=require("src/utils"),s=require("src/assert"),i=require("src/list"),r=require("src/dict"),s=s.scope("Database"),o=function(){},l=require("./implementation"),p=Object.create(null),c=Object.create(null),exports.OBSERVABLE=1<<29,t=exports.OBSERVABLE,exports.get=function(t,r,i){return"function"==typeof r&&(i=r,r=0),r&exports.OBSERVABLE&&null!=c[t]?i(null,c[t].spawn()):void l.get(t,function(o,s){var u;return null==o&&s?(r&exports.OBSERVABLE&&(Array.isArray(s)?s=new n(t,s,r):a.isObject(s)&&(s=new e(t,s,r)),s=(null!=(u=c[t])?u.spawn():void 0)||s),i(null,s)):i(o,s)})},exports.set=function(t,e,n){var r;null==n&&(n=o),null!=(r=c[t])&&r.disconnect(),l.set(t,e,n)},exports.remove=function(t,e,n){var r;null==n&&(n=o),"function"==typeof e&&(n=e,e=null),null!=e?exports.get(t,function(r,i){var o,s,u,p,h,f,d,_,g;if(null!=r)return n(r);if(!Array.isArray(i))return n(new Error("'"+t+"' is not an array"));if(_=c[t])if((s=_.items().indexOf(e))!==-1)_.pop(s);else for(g=_.items(),o=p=0,f=g.length;p<f;o=++p)if(u=g[o],a.isEqual(u,e)){_.pop(o);break}if((s=i.indexOf(e))!==-1)i.splice(s,1);else for(o=h=0,d=i.length;h<d;o=++h)if(u=i[o],a.isEqual(u,e)){i.splice(o,1);break}return l.set(t,i,n)}):(null!=(r=c[t])&&r.disconnect(),l.remove(t,n))},exports.append=function(t,e,n){null==n&&(n=o),exports.get(t,function(r,i){var o;return null!=r?n(r):(null==i&&(i=[]),Array.isArray(i)?(null!=(o=c[t])&&o.append(e),i.push(e),l.set(t,i,n)):n(new Error("'"+t+"' is not an array")))})},u=function(t,e){return a.defineProperty(t,e,null,function(){return Object.getPrototypeOf(this)[e]},function(t){return Object.getPrototypeOf(this)[e]=t})},n=function(t){function e(t,r,i){e.__super__.constructor.call(this,r),this._key=t,this._watchersCount=0,c[t]=this,this.onChange(n),this.onInsert(n),this.onPop(n)}var n;return h(e,t),n=function(t){this._watchersCount>0&&l.set(this._key,this._data,o)},e.prototype.spawn=function(){return this._watchersCount+=1,this},e.prototype.disconnect=function(){--p[this._key]||(c[this._key]=null)},e}(i),e=function(t){function e(t,r,i){e.__super__.constructor.call(this,r),a.defineProperty(this,"_key",0,t),a.defineProperty(this,"_watchersCount",a.WRITABLE,0),c[t]=this,this.onChange(n)}var n;return h(e,t),n=function(t){this._watchersCount>0&&l.set(this._key,this,o)},e.prototype.spawn=function(){return this._watchersCount+=1,this},e.prototype.disconnect=function(){--p[this._key]||(c[this._key]=null)},e}(r)}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=n({"src/utils":153,"src/assert":4,"src/signal":145}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r,i=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},o={}.hasOwnProperty;r=require("src/utils"),e=require("src/assert"),n=require("src/signal"),module.exports=t=function(t){function e(t){return this instanceof e?(e.__super__.constructor.call(this),r.defineProperty(this,"_signals",r.WRITABLE,this._signals),r.defineProperty(this,"_keys",r.WRITABLE,null),r.defineProperty(this,"_values",r.WRITABLE,null),r.defineProperty(this,"_items",r.WRITABLE,null),r.defineProperty(this,"_dirty",r.WRITABLE,o),void(r.isObject(t)&&r.merge(this,t))):new e(t)}var o,s,u,l,a,c;return i(e,t),e.__name__="Dict",e.__path__="Dict",u=1,a=2,s=4,o=(s<<1)-1,e.fromJSON=function(t){return t=r.tryFunction(JSON.parse,JSON,[t],t),new e(t)},l=r.CONFIGURABLE|r.WRITABLE,r.defineProperty(e.prototype,"constructor",l,e),c=l,r.defineProperty(e.prototype,"length",c,function(){return this.keys().length},null),n.Emitter.createSignal(e,"onChange"),r.defineProperty(e.prototype,"set",l,function(t,e){var n;return n=this[t],n===e?e:(this[t]=e,this._dirty|=o,this.onChange.emit(t,n),e)}),r.defineProperty(e.prototype,"has",l,function(t){return void 0!==this[t]}),r.defineProperty(e.prototype,"extend",l,function(t){var e,n;for(e in t)n=t[e],t.hasOwnProperty(e)&&this.set(e,n);return this}),r.defineProperty(e.prototype,"pop",l,function(t){var e;return e=this[t],delete this[t],this._dirty|=o,this.onChange.emit(t,e),e}),r.defineProperty(e.prototype,"clear",l,function(){var t,e;for(t in this)e=this[t],this.pop(t)}),r.defineProperty(e.prototype,"keys",l,function(){var t,e,n,r;if(this._dirty&u){this._dirty^=u,t=null!=this._keys?this._keys:this._keys=[],e=0;for(n in this)r=this[n],t[e]=n,e++;t.length=e}return this._keys}),r.defineProperty(e.prototype,"values",l,function(){var t,e,n,r;if(this._dirty&a){this._dirty^=a,t=null!=this._values?this._values:this._values=[],e=0;for(n in this)r=this[n],t[e]=r,e++;t.length=e}return this._values}),r.defineProperty(e.prototype,"items",l,function(){var t,e,n,r;if(this._dirty&s){t=null!=this._values?this._values:this._values=[],e=0;for(n in this)r=this[n],null==t[e]&&(t[e]=["",null]),t[e][0]=n,t[e][1]=r,e++;t.length=e}return this._values}),e}(n.Emitter)}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=n({"src/assert":4}),exports=module.exports;return function(){(function(){"use strict";var t;t=require("src/assert"),module.exports=function(t){var e;return e=function(){function e(t,e,n){this.file=t,this.node=e,this.elseNode=null!=n?n:null,"undefined"!=typeof elseNode&&null!==elseNode,this.node.onPropsChange(u,this)}var n,r,i,o,s,u;return e.__name__="Condition",e.__path__="File.Condition",r=e.JSON_CTOR_ID=t.JSON_CTORS.push(e)-1,s=1,o=s++,i=s++,n=e.JSON_ARGS_LENGTH=s,e._fromJSON=function(t,n,r){var s,u;return r||(u=t.node.getChildByAccessPath(n[o]),n[i]&&(s=t.node.getChildByAccessPath(n[i])),r=new e(t,u,s)),r},u=function(t){"n-if"===t&&this.update()},e.prototype.update=function(){var t,e;e=this.node.visible=!!this.node.props["n-if"],null!=(t=this.elseNode)&&(t.visible=!e)},e.prototype.render=function(){return this.update()},e.prototype.clone=function(t,n){var r,i;return i=t.node.getCopiedElement(this.node,n.node),this.elseNode&&(r=t.node.getCopiedElement(this.elseNode,n.node)),new e(n,i,r)},e.prototype.toJSON=function(t,e){var s;return e||(e=new Array(n),e[0]=r),e[o]=this.node.getAccessPath(this.file.node),e[i]=null!=(s=this.elseNode)?s.getAccessPath(this.file.node):void 0,e},e}()}}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=n({"src/utils":153,"src/assert":4,"src/signal":145,"./element/text":17,"./element/tag":13}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r,i,o,s,u=function(t,e){function n(){this.constructor=t}for(var r in e)l.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},l={}.hasOwnProperty;s=require("src/utils"),n=require("src/assert"),o=require("src/signal"),i=Array.isArray,e=o.Emitter,r=e.emitSignal,n=n.scope("View.Element"),t=function(t){function n(){e.call(this),this._parent=null,this._nextSibling=null,this._previousSibling=null,this._style=null,this._documentStyle=null,this._visible=!0,this._watchers=null,this._inWatchers=null,this._checkWatchers=0}var i,l,a,c,p,h;return u(n,t),n.__name__="Element",n.__path__="File.Element",n.JSON_CTORS=[],l=n.JSON_CTOR_ID=n.JSON_CTORS.push(n)-1,p=1,a=p++,i=n.JSON_ARGS_LENGTH=p,n.fromHTML=function(t){if("node"!==process.env.NEFT_PLATFORM)throw new Error("Creating Views from HTML files is allowed only on a server");return n.parser.parse(t)},n.fromJSON=function(t){return"string"==typeof t&&(t=JSON.parse(t)),n.JSON_CTORS[t[0]]._fromJSON(t)},n._fromJSON=function(t,e){return null==e&&(e=new n),e._visible=1===t[a],e},n.Text=require("./element/text")(n),n.Tag=c=require("./element/tag")(n),h=s.CONFIGURABLE,s.defineProperty(n.prototype,"index",h,function(){var t;return(null!=(t=this.parent)?t.children.indexOf(this):void 0)||0},function(t){var e,n,r,i,o,s,u;return!!(r=this._parent)&&(n=this.index,e=r.children,t>e.length&&(t=e.length),n!==t&&n!==t-1&&(null!=(i=this._previousSibling)&&(i._nextSibling=this._nextSibling),null!=(o=this._nextSibling)&&(o._previousSibling=this._previousSibling),e.splice(n,1),t>n&&t--,e.splice(t,0,this),this._previousSibling=e[t-1]||null,this._nextSibling=e[t+1]||null,null!=(s=this._previousSibling)&&(s._nextSibling=this),null!=(u=this._nextSibling)&&(u._previousSibling=this),!0))}),h=s.CONFIGURABLE,s.defineProperty(n.prototype,"nextSibling",h,function(){return this._nextSibling},null),h=s.CONFIGURABLE,s.defineProperty(n.prototype,"previousSibling",h,function(){return this._previousSibling},null),h=s.CONFIGURABLE,s.defineProperty(n.prototype,"parent",h,function(){return this._parent},function(t){var e,n,i,o,s,u,l;return i=this._parent,i!==t&&(this._parent&&(o=this._parent.children,this._nextSibling?this._previousSibling?(e=o.indexOf(this),o.splice(e,1)):o.shift():o.pop(),r(this._parent,"onChildrenChange",null,this),null!=(u=this._previousSibling)&&(u._nextSibling=this._nextSibling),null!=(l=this._nextSibling)&&(l._previousSibling=this._previousSibling),this._previousSibling=null,this._nextSibling=null), this._parent=s=t,s&&(n=this._parent.children,e=n.push(this)-1,r(s,"onChildrenChange",this),0===e?this._previousSibling=null:(this._previousSibling=n[e-1],this._previousSibling._nextSibling=this)),this._previousSibling,r(this,"onParentChange",i),c.query.checkWatchersDeeply(this,i),c.query.checkWatchersDeeply(this),!0)}),o.Emitter.createSignal(n,"onParentChange"),h=s.CONFIGURABLE,s.defineProperty(n.prototype,"style",h,function(){return this._style},function(t){var e;return e=this._style,e!==t&&(this._style=t,r(this,"onStyleChange",e,t),!0)}),o.Emitter.createSignal(n,"onStyleChange"),h=s.CONFIGURABLE,s.defineProperty(n.prototype,"visible",h,function(){return this._visible},function(t){var e;return e=this._visible,e!==t&&(this._visible=t,r(this,"onVisibleChange",e),!0)}),o.Emitter.createSignal(n,"onVisibleChange"),n.prototype.queryAllParents=c.query.queryAllParents,n.prototype.queryParents=c.query.queryParents,n.prototype.getAccessPath=function(t){var e,n,r;for(e=[],p=0,n=this,r=this;(r=n._parent)&&(e.push(r.children.indexOf(n)),n=r,r!==t););return e},n.prototype.clone=function(t){return null==t&&(t=new n),t._visible=this._visible,t},n.prototype.toJSON=function(t){return t||(t=new Array(i),t[0]=l),t[a]=this.visible?1:0,t},"node"===process.env.NEFT_PLATFORM&&(n.parser=require("./element/parser")(n)),n}(e),module.exports=t}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=n({"src/utils":153,"src/assert":4,"src/signal":145,"./tag/query":15,"./tag/props":14,"./tag/stringify":16,"src/typed-array":151}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r,i,o,s,u,l=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;u=require("src/utils"),n=require("src/assert"),o=require("src/signal"),s=require("./tag/stringify"),e=require("src/typed-array"),r=o.Emitter.emitSignal,n=n.scope("View.Element.Tag"),i=function(t){return null!=t},t=/\#([^\s]+)/,module.exports=function(t){var n;return n=function(n){function r(){t.call(this),this.name="blank",this.children=[],this.props=new f(this)}var i,a,c,p,h,f,d,_;return l(r,n),r.Props=f=require("./tag/props")(r),r.DEFAULT_STRINGIFY_REPLACEMENTS=Object.create(null),r.extensions=Object.create(null),r.__name__="Tag",r.__path__="File.Element.Tag",p=r.JSON_CTOR_ID=t.JSON_CTORS.push(r)-1,d=t.JSON_ARGS_LENGTH,h=d++,c=d++,a=d++,i=r.JSON_ARGS_LENGTH=d,r._fromJSON=function(e,n){var i,o,s,l,p,f;for(null==n&&(n=new r),t._fromJSON(e,n),n.name=e[h],u.merge(n.props,e[a]),p=null,f=e[c],s=0,l=f.length;s<l;s++)i=f[s],o=t.fromJSON(i),n.children.push(o),o._parent=n,(o._previousSibling=p)&&(p._nextSibling=o),p=o;return n},o.Emitter.createSignal(r,"onChildrenChange"),o.Emitter.createSignal(r,"onPropsChange"),r.prototype.clone=function(t){return null==t&&(t=new r),r.__super__.clone.call(this,t),t.name=this.name,u.merge(t.props,this.props),t},r.prototype.cloneDeep=function(){var t,e,n,i,o,s,u;for(e=this.clone(),s=null,u=this.children,i=0,o=u.length;i<o;i++)t=u[i],n=t instanceof r?t.cloneDeep():t.clone(),e.children.push(n),n._parent=e,(n._previousSibling=s)&&(s._nextSibling=n),s=n;return e},r.prototype.getCopiedElement=function(){var t;return t=new e.Uint16(256),function(e,n){var r,i,o;if(e===this)return n;for(d=0,r=e;(o=r._parent)&&(t[d++]=o.children.indexOf(r),r=o,r!==this););for(r=n;d-- >0;)i=t[d],r=r.children[i];return r}}(),r.prototype.getChildByAccessPath=function(t){var e,n;for(e=this,n=t.length-1;n>=0;n+=-1)if(d=t[n],!(e=e.children[d]))return null;return e},r.query=_=require("./tag/query")(t,r),r.prototype.queryAll=_.queryAll,r.prototype.query=_.query,r.prototype.watch=_.watch,r.prototype.stringify=function(t){return null==t&&(t=r.DEFAULT_STRINGIFY_REPLACEMENTS),s.getOuterHTML(this,t)},r.prototype.stringifyChildren=function(t){return null==t&&(t=r.DEFAULT_STRINGIFY_REPLACEMENTS),s.getInnerHTML(this,t)},r.prototype.replace=function(t,e){var n;return n=this.children.indexOf(t),t.parent=void 0,e.parent=this,e.index=n,null},r.prototype.toJSON=function(t){var e,n,o,s,u;for(t||(t=new Array(i),t[0]=p),r.__super__.toJSON.call(this,t),t[h]=this.name,n=t[c]=[],t[a]=this.props,u=this.children,o=0,s=u.length;o<s;o++)e=u[o],n.push(e.toJSON());return t},r}(t)}}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=n({"src/utils":153,"src/assert":4,"src/signal":145}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r;r=require("src/utils"),t=require("src/assert"),n=require("src/signal"),e=n.Emitter.emitSignal,module.exports=function(t){var n;return n=function(){function n(t){r.defineProperty(this,"_ref",0,t)}var i;return i=r.CONFIGURABLE|r.WRITABLE,r.defineProperty(n.prototype,"constructor",i,n),r.defineProperty(n.prototype,"item",i,function(t,e){var n,r,i;null==e&&(e=[]),e[0]=e[1]=void 0,n=0;for(r in this){if(i=this[r],this.hasOwnProperty(r)&&n===t){e[0]=r,e[1]=i;break}n++}return e}),r.defineProperty(n.prototype,"has",i,function(t){return this.hasOwnProperty(t)}),r.defineProperty(n.prototype,"set",i,function(n,r){var i;return i=this[n],i!==r&&(this[n]=r,e(this._ref,"onPropsChange",n,i),t.query.checkWatchersDeeply(this._ref),!0)}),n}()}}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=n({"src/utils":153,"src/signal":145,"src/eventLoop":48,"src/assert":4}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r,i,o,s,u,l,a,c,p,h,f,d,_,g,m,y,v,b,x,S,E,I,P,O,w,C,A,T,R,N,L,k,D,F,M,V,j,B,H,W,U=function(t,e){function n(){this.constructor=t}for(var r in e)z.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},z={}.hasOwnProperty;W=require("src/utils"),B=require("src/signal"),D=require("src/eventLoop"),I=require("src/assert"),k=B.Emitter.emitSignal,y=v=null,u=0,l=1,t=100,H=function(t,e,n,r,i,o){for(var s,u,l;n<e.length;){if(l=e[n],l.isIterator)return l(t,e,n+3,r,i,o);if(s=e[n+1],u=e[n+2],!l(t,s,u))return!1;n+=3}return r.call(i,t),!0},S=function(t,e,n,r,i,o){var s,u,l,a;for(a=t.children,u=0,l=a.length;u<l;u++){if(s=a[u],(!(s instanceof y)||"blank"!==s.name)&&H(s,e,n,r,i,o)&&o)return!0;if(s instanceof y&&S(s,e,n,r,i,o)&&o)return!0}return!1},S.isIterator=!0,S.priority=u,S.toString=function(){return"anyDescendant"},L=function(t,e,n,r,i,o){var s;if(s=t._parent){if(H(s,e,n,r,i,o))return!0;if("blank"===s.name)return L(s,e,n,r,i,o)}return!1},L.isIterator=!0,L.priority=u,L.toString=function(){return"directParent"},x=function(t,e,n,r,i,o){var s,u,l,a;for(a=t.children,u=0,l=a.length;u<l;u++)if(s=a[u],s instanceof y&&"blank"===s.name){if(x(s,e,n,r,i,o)&&o)return!0}else if(H(s,e,n,r,i,o)&&o)return!0;return!1},x.isIterator=!0,x.priority=u,x.toString=function(){return"anyChild"},E=function(t,e,n,r,i,o){var s;return!!(s=t._parent)&&(!!H(s,e,n,r,i,o)||E(s,e,n,r,i,o))},E.isIterator=!0,E.priority=u,E.toString=function(){return"anyParent"},O=function(t,e){return t instanceof y?t.name===e:"#text"===e&&t instanceof v||void 0},O.isIterator=!1,O.priority=l,O.toString=function(){return"byName"},P=function(t,e){return t instanceof e},P.isIterator=!1,P.priority=u,P.toString=function(){return"byInstance"},N=function(t,e){return t===e},N.isIterator=!1,N.priority=u,N.toString=function(){return"byTag"},w=function(t,e){return t instanceof y&&void 0!==t.props[e]},w.isIterator=!1,w.priority=t,w.toString=function(){return"byProp"},R=function(t,e,n){return t instanceof y&&t.props[e]==n},R.isIterator=!1,R.priority=t,R.toString=function(){return"byPropValue"},T=function(t,e,n){var r;return t instanceof y&&(r=t.props[e],"string"==typeof r)&&0===r.indexOf(n)},T.isIterator=!1,T.priority=t,T.toString=function(){return"byPropStartsWithValue"},A=function(t,e,n){var r;return t instanceof y&&(r=t.props[e],"string"==typeof r)&&r.indexOf(n,r.length-n.length)>-1},A.isIterator=!1,A.priority=t,A.toString=function(){return"byPropEndsWithValue"},C=function(t,e,n){var r;return t instanceof y&&(r=t.props[e],"string"==typeof r)&&r.indexOf(n)>-1},C.isIterator=!1,C.priority=t,C.toString=function(){return"byPropContainsValue"},m=/^#?[a-zA-Z0-9|\-:_]+/,s=/^([ ]*)>([ ]*)|^([ ]+)/,n=/^\[([^\]]+?)\]/,i=/^\[([^=]+?)=([^\]]+?)\]/,e=/^\.([a-zA-Z0-9|\-_]+)/,_=/\^$/,a=/\$$/,o=/\*$/,g=/(?:'|")?([^'"]*)/,r={__proto__:null,true:!0,false:!1,null:null,undefined:void 0},M=0,h=1<<M++,f=1<<M++,p=1<<M++,c=2e3,d=100,V=[],j=[],F=function(t,u){var l,v,b,I,k,D,F,M,B,H,W,U,z,q,J,G,Y,K,X,Q,$,Z;if(null==u&&(u=0),X=!!(u&f),G=null!=(Y=V[u])?Y[t]:void 0)return G;for(D=X?E:S,I=X?L:x,v=X?"unshift":"push",Q=X?"push":"unshift",H=[],J=[H],$=t.trim();$.length;)if("*"===$[0])$=$.slice(1),H[v](P,y,null);else if("&"===$[0])$=$.slice(1),u&h||H[v](N,null,null);else if(F=m.exec($))$=$.slice(F[0].length),q=F[0],H[v](O,q,null);else if(F=i.exec($))$=$.slice(F[0].length),l=F[0],q=F[1],Z=F[2],Z=Z in r?r[Z]:g.exec(Z)[1],B=_.test(q)?T:a.test(q)?A:o.test(q)?C:R,B!==R&&(q=q.slice(0,-1)),H[v](B,q,Z);else if(F=n.exec($))$=$.slice(F[0].length),H[v](w,F[1],null);else if(F=e.exec($))$=$.slice(F[0].length),H[v](C,"class",F[1]);else if(F=s.exec($))$=$.slice(F[0].length),k=F[0].trim(),""===k?H[v](D,null,null):">"===k&&H[v](I,null,null);else{if(","!==$[0])throw new Error("queryAll: unexpected selector '"+$+"' in '"+t+"'");H=[],J.push(H),$=$.slice(1),$=$.trim()}for(W=0,z=J.length;W<z;W++)H=J[W],M=!X||u&h?H[0]:H[H.length-3],M!==N&&(u&h&&!(null!=M?M.isIterator:void 0)?H[v](D,null,null):X&&!(null!=M?M.isIterator:void 0)?H[Q](D,null,null):X||(null!=M?M.isIterator:void 0)||H[Q](D,null,null),u&p&&H[Q](N,null,null));if((b=V[u])||(b=V[u]={},j[u]=0),b[t]=J,(j[u]+=1)>c){K=0;for(U in b)if(delete b[U],K+=1,K>=d)break;j[u]-=K}return J},b=function(t){function e(t,n){e.__super__.constructor.call(this),this._forceUpdate=!0,this.node=t,this.queries=n,this.uid=r++ +"",this.nodes=[],this.nodesToAdd=[],this.nodesToRemove=[],this.nodesWillChange=!1}var n,r,i;return U(e,t),n=function(){},r=0,i=[],e.create=function(t,n){var r,o;return i.length?(o=i.pop(),o.node=t,o.queries=n,o._forceUpdate=!0):o=new e(t,n),r=null!=t._watchers?t._watchers:t._watchers=[],r.push(o),o},B.Emitter.createSignal(e,"onAdd"),B.Emitter.createSignal(e,"onRemove"),e.prototype.test=function(t){var e,r,i,o;for(o=this.queries,r=0,i=o.length;r<i;r++)if(e=o[r],e[e.length-2]=this.node,H(t,e,0,n,null,!0))return!0;return!1},e.prototype.disconnect=function(){var t,e,n,r,o;for(o=this.uid,t=this.node,e=this.nodes,n=this.nodesToAdd,r=this.nodesToRemove,W.remove(t._watchers,this);t=n.pop();)delete t._inWatchers[o];for(;t=r.pop();)k(this,"onRemove",t);for(;t=e.pop();)delete t._inWatchers[o],k(this,"onRemove",t);this.onAdd.disconnectAll(),this.onRemove.disconnectAll(),this.node=this.queries=null,i.push(this)},e}(B.Emitter),module.exports=function(t,e){var n,r,i;return y=e,v=t.Text,{getSelectorCommandsLength:module.exports.getSelectorCommandsLength,queryAll:i=function(t,e,n,r){var i,o,s,u,l;for(null==e&&(e=[]),null==n&&(n=e),null==r&&(r=0),l=F(t,r),i=Array.isArray(e)?e.push:e,s=0,u=l.length;s<u;s++)o=l[s],o[0](this,o,3,i,n,!1);if(Array.isArray(e))return e},queryAllParents:function(t,e,n){var r,o,s;if(null==e&&(e=[]),null==n&&(n=e),r=Array.isArray(e)?e.push:e,s=f|h,o=function(e){r.call(n,e),i.call(e,t,o,null,s)},i.call(this,t,o,null,s),Array.isArray(e))return e},query:r=function(){var t,e;return t=null,e=function(e){return t=e},function(n,r){var i,o,s,u;for(null==r&&(r=0),u=F(n,r),o=0,s=u.length;o<s;o++)if(i=u[o],i[0](this,i,3,e,null,!0))return t;return null}}(),queryParents:function(t){return r.call(this,t,f|h)},watch:function(t){var e,r;return e=F(t,f|p),r=b.create(this,e),n(this),r},checkWatchersDeeply:n=function(){var t,e,n,r,i,o,s,u,l,a,c;return u=!1,s=[],c=[],a=[],M=0,n=1<<M++,t=1<<M++,e=1<<M++,i=function(t){t.nodesWillChange||(c.push(t),t.nodesWillChange=!0)},o=function(t,e){var n;for(n=t;n=n._parent;)if(n===e)return!0;return!1},r=function(e,s,u,l){var a,c,p,h,f,d,_,g,m,v,b,x,S,E,I,P,O,w;if(a=e._checkWatchers,u|=a,w=e._watchers)for(h=0,_=w.length;h<_;h++)for(I=w[h],s.push(I),!l&&I._forceUpdate&&(l=!0),P=I.node,x=I.nodes,M=b=x.length;M-- >0;)c=x[M],c===P||o(c,P)||(delete c._inWatchers[I.uid],x[M]=x[b-1],x.pop(),I.nodesToRemove.push(c),i(I),b--);if(l||u&n)for(p=e._inWatchers,f=0,g=s.length;f<g;f++)I=s[f],(!l||I._forceUpdate||u&n)&&(O=I.uid,p&&p[O]||!I.test(e)?p&&p[O]&&!I.test(e)&&(delete p[O],W.removeFromUnorderedArray(I.nodes,e),I.nodesToRemove.push(e),i(I)):(p||(p=e._inWatchers={}),p[O]=!0,I.nodesToAdd.push(e),i(I)));if(u&t&&e instanceof y)for(S=e.children,d=0,m=S.length;d<m;d++)c=S[d],(l||u&n||c._checkWatchers>0)&&r(c,s,u,l);if(w)for(M=v=0,E=w.length;v<E;M=v+=1)I=s.pop();e._checkWatchers=0},l=function(){var t,e,n,i,o;for(u=!1;t=s.pop();)t._parent||r(t,a,0,!1);for(;o=c.pop();){for(n=o.nodesToAdd,i=o.nodesToRemove;e=i.pop();)k(o,"onRemove",e);for(;e=n.pop();)o.nodes.push(e),k(o,"onAdd",e);o.nodesWillChange=!1}},function(r,i){var o;for(null==i&&(i=r._parent),r._checkWatchers|=n,r instanceof y&&(r._checkWatchers|=t),o=r;i&&(o=i,!(o._checkWatchers&t));)o._checkWatchers|=t,i=o._parent;i||o._checkWatchers&e||(s.push(o),o._checkWatchers|=e),u||(u=!0,D.setImmediate(l))}}()}},module.exports.getSelectorCommandsLength=function(t,e,n){var r,i,o,s,u;for(null==e&&(e=0),null==n&&(n=1/0),u=0,o=F(t,0),M=r=0,i=o.length;r<i;M=++r)if(s=o[M],!(M<e)){if(M>=n)break;u+=s.length}return u},module.exports.getSelectorPriority=function(t,e,n){var r,i,o,s,u,l,a,c;for(null==e&&(e=0),null==n&&(n=1/0),c=0,l=F(t,0),M=i=0,s=l.length;i<s;M=++i)if(a=l[M],!(M<e)){if(M>=n)break;for(o=0,u=a.length;o<u;o+=3)r=a[o],c+=r.priority}return c}}).call(this)}(),module.exports},function(exports){var module={exports:exports},exports=(n({}),module.exports);return function(){(function(){"use strict";var t,e,n,r;t={__proto__:null,area:!0,base:!0,basefont:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,isindex:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},r=function(t){return"blank"!==t&&!/^(?:n-|style:)/.test(t)},e=function(t,e){var r,i,o,s,u;if(t.children){for(s="",u=t.children,i=0,o=u.length;i<o;i++)r=u[i],s+=n(r,e);return s}return""},n=function(n,i){var o,s,u,l,a,c,p;if(n._visible===!1)return"";if(void 0!==n._text)return n._text;if(i&&(c=i[n.name])&&(n=c(n)||n),s=n.name,!s||!r(s))return e(n,i);p="<"+s,a=n.props;for(u in a)l=a[u],a.hasOwnProperty(u)&&null!=l&&"function"!=typeof l&&r(u)&&(p+=" "+u+'="'+l+'"');return o=e(n,i),!o&&t[s]?p+" />":p+">"+o+"</"+s+">"},module.exports={getInnerHTML:e,getOuterHTML:n}}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=n({"src/utils":153,"src/assert":4,"src/signal":145}),exports=module.exports;return function(){(function(){"use strict";var t,e,n,r,i=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},o={}.hasOwnProperty;r=require("src/utils"),t=require("src/assert"),n=require("src/signal"),e=n.Emitter.emitSignal,t=t.scope("View.Element.Text"),module.exports=function(t){var o;return o=function(o){function s(){t.call(this),this._text=""}var u,l,a,c,p;return i(s,o),s.__name__="Text",s.__path__="File.Element.Text",l=s.JSON_CTOR_ID=t.JSON_CTORS.push(s)-1,c=t.JSON_ARGS_LENGTH,a=c++,u=s.JSON_ARGS_LENGTH=c,s._fromJSON=function(e,n){return null==n&&(n=new s),t._fromJSON(e,n),n._text=e[a],n},s.prototype.clone=function(t){return null==t&&(t=new s),s.__super__.clone.call(this,t),t._text=this._text,t},p=r.CONFIGURABLE,r.defineProperty(s.prototype,"text",p,function(){return this._text},function(n){var r;return r=this._text,r!==n&&(this._text=n,e(this,"onTextChange",r),t.Tag.query.checkWatchersDeeply(this),!0)}),n.Emitter.createSignal(s,"onTextChange"),s.prototype.toJSON=function(t){return t||(t=new Array(u),t[0]=l),s.__super__.toJSON.call(this,t),t[a]=this.text,t},s}(t)}}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=n({"./element":12}),exports=module.exports;return function(){(function(){module.exports=require("./element")}).call(this)}(),module.exports},function(exports){var module={exports:exports},exports=(n({}),module.exports);return function(){(function(){"use strict";module.exports=function(t){var e,n,r,i;return e=t.Element,n=e.Tag,r=e.Text,i=function(t){var e,o,s;if(t instanceof r&&(t.text=t.text.replace(/^[\s\uFEFF\xA0]+/g,""),t.text=t.text.replace(/([^\r\n]+)(?:[\s\uFEFF\xA0]*)$/g,"$1"),0===t.text.length&&(t.parent=null)),t instanceof n)for(s=t.children,o=s.length-1;o>=0;o+=-1)e=s[o],i(e)}}}).call(this)}(),module.exports},function(exports){var module={exports:exports},require=n({"src/utils":153,"./links":23}),exports=module.exports;return function(){(function(){"use strict";var t;t=require("src/utils"),module.exports=function(t){var e;return e=require("./links")(t),function(n){var r,i,o,s,u,l,a,c,p,h,f,d,_,g,m,y,v,b,x,S;for(u=n.components,a=[],v=e(n),p=0,d=v.length;p<d;p++){m=v[p],x=m.namespace?m.namespace+":":"",m.path in t._files||t.onError.emit(new t.LoadError(m.path)),y=t._files[m.path],m.namespace&&(u[m.namespace]=y.path),S=y.components;for(b in S)i=S[b],u[x+b]=i}for(c=function(e){var r,o,s,l,p,h;if(o=e.children){for(s=-1,l=o.length,h=[];++s<l;)r=o[s],"component"===r.name?(r.props.name&&(r.props["n-name"]=r.props.name,delete r.props.name),(b=r.props["n-name"])&&(r.name="blank",r.parent=null,s--,l--,p=n.path+"#"+b,i=new t(p,r),u[b]=p,h.push(a.push(i)))):c(r);return h}},c(n.node),h=0,_=a.length;h<_;h++){l=a[h];for(s in u)o=u[s],null==(r=l.components)[s]&&(r[s]=o)}for(f=0,g=a.length;f<g;f++)l=a[f],t.parse(l)}}}).call(this)}(),module.exports},function(exports){var module={exports:exports},exports=(n({}),module.exports);return function(){(function(){"use strict";module.exports=function(t){var e;return e=t.Condition,function(e){var n,r;return n=e.conditions,(r=function(i){var o,s,u,l,a,c,p;for(a=i.children,u=0,l=a.length;u<l;u++)o=a[u],o instanceof t.Element.Tag&&(