-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.min.js
1 lines (1 loc) · 7.61 KB
/
client.min.js
1
var components=function(){"use strict";var e=t;function t(e){return function(t){return t==e}}t.fn=function(e){return"function"==typeof e},t.str=function(e){return"string"==typeof e},t.num=function(e){return"number"==typeof e},t.obj=function(e){return"object"==typeof e},t.lit=function(e){return e.constructor==Object},t.bol=function(e){return"boolean"==typeof e},t.truthy=function(e){return 1==!!e},t.falsy=function(e){return 0==!!e},t.arr=function(e){return e instanceof Array},t.null=function(e){return null===e},t.def=function(e){return void 0!==e},t.in=function(e){return function(t){return!!e&&(e.indexOf?~e.indexOf(t):t in e)}},t.promise=function(e){return e instanceof Promise},t.stream=function(e){return!(!e||!e.next)};var n=Object.freeze({default:e,__moduleExports:e}),r=n&&e||n,o={arr:function(e){return Array.prototype.slice.call(e,0)},obj:function(e){var t="id";return 1==arguments.length?(t=e,n):n.apply(this,arguments);function n(e,n,o){return 0===o&&(e={}),e[r.fn(t)?t(n,o):n[t]]=n,e}}};var u=o.arr,i=o.obj,c=Object.freeze({default:o,__moduleExports:o,arr:u,obj:i}),f="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var s="undefined"!=typeof window,a=Object.freeze({default:s,__moduleExports:s}),l=a&&s||a,p=l?window:f,d=Object.freeze({default:p,__moduleExports:p}),h=c&&o||c,m=d&&p||d,y=function(e){return function(t){if(!m.console||!console.log.apply)return t;r.arr(arguments[2])&&(arguments[2]=arguments[2].length);var n=h.arr(arguments),o="[log]["+(new Date).toISOString()+"]"+e;return n.unshift(o.grey?o.grey:o),console.log.apply(console,n),t}},b=Object.freeze({default:y,__moduleExports:y}),v=function(e){return document.body?e():document.addEventListener("DOMContentLoaded",e.bind(this))},w=Object.freeze({default:v,__moduleExports:v}),_=function(e){return x(e.class?e.class:e.prototype?e.prototype.render?e:e.prototype.connected?e:O(e):O(e))},x=Object.assign,O=function(e){return e.class=e.class||function(){function t(){}return t.prototype.render=function(){e.apply(this,arguments)},t}()},g=Object.freeze({default:_,__moduleExports:_}),j=function(){var e,t,n=new Promise(function(n,r){e=n,t=r});return arguments.length&&e(arguments[0]),n.resolve=e,n.reject=t,n};var E,z=Object.freeze({default:j,__moduleExports:j}),A=function e(t,n){return n instanceof Array&&(n=n.reduce(e,[])),(t=t||[]).concat(n)},C=Object.freeze({default:A,__moduleExports:A}),P=function(e,t){return t in e},N=Object.freeze({default:P,__moduleExports:P}),L=N&&P||N,S=function(e,t,n,r){return e.host&&e.host.nodeName&&(e=e.host),t.name&&(n=t,t=t.name),!L(e,t)&&Object.defineProperty(e,t,{value:n,writable:r}),e[t]},$=Object.freeze({default:S,__moduleExports:S}),k=z&&j||z,q=C&&A||C,D=$&&S||$,I=function(){},M=function e(t,n){return n=n||{},D(t=t||{},"emit",function(e,n,o){for(var u=t.on[e.split(".")[0]]||[],i=[],c=0;c<u.length;c++)u[c].ns&&o&&!o(u[c].ns)||i.push(r(u[c].isOnce?u.splice(c--,1)[0]:u[c],n));for(var c=0;c<t.on["*"].length;c++)i.push(r(t.on["*"][c],[e,n]));return i.reduce(q,[])},1),D(t,"once",function(e,n){return t.on(e,n,!0)},1),D(t,"off",function(e,n){o(t.on[e]||[],n),n&&n.ns&&delete t.on[e]["$"+n.ns];return t},1),D(t,"on",function(e,r,i){var c=e.split(".")[0],f=e.split(".")[1],s=t.on[c]=t.on[c]||[],a="function"==typeof r?r:0;return!a&&f?(a=t.on[c]["$"+f])?a:l(u(t,r)):a||f?a&&f?l((o(s,t.on[c]["$"+f]||-1),a)):!(!a||f)&&l(a):l(u(t,r));function l(e){return e.isOnce=i,e.type=c,f&&(t.on[c]["$"+(e.ns=f)]=e),s.push(e),(n.on||I)(e),e.next?e:t}},1),t.on["*"]=t.on["*"]||[],t;function r(e,n){return e.next?e.next(n):n instanceof Array?e.apply(t,n):e.call(t,n)}function o(e,t){for(var r=e.length;~--r;)t!=e[r]&&t!=e[r].fn&&t||(n.off||I)(e.splice(r,1)[0])}function u(t,n){var r=e((n=n||{}).base||k());return r.i=0,r.li=[],r.fn=n.fn,r.parent=t,r.source=n.fn?r.parent.source:r,r.on("stop",function(e){return r.type?r.parent.off(r.type,r):r.parent.off(r),r.reason=e}),r.each=function(e){var t=e.next?e:u(r,{fn:e});return r.li.push(t),t},r.pipe=function(e){return e(r)},r.map=function(e){return r.each(function(t,n,r){return r.next(e(t,n,r))})},r.filter=function(e){return r.each(function(t,n,r){return e(t,n,r)&&r.next(t)})},r.reduce=function(e,t){return r.each(function(n,r,o){return o.next(t=e(t,n,r,o))})},r.unpromise=function(){var e=u(r,{base:{},fn:function(t){return e.next(t)}});return r.li.push(e),e},r.next=function(e){return r.resolve&&r.resolve(e),r.li.length?r.li.map(function(t){return t.fn(e,t.i++,t)}):e},r.until=function(e){return e?e.each?e.each(r.stop):e.then?e.then(r.stop):e.call?r.filter(e).map(r.stop):0:0},r.off=function(e){return o(r.li,e),r},r.start=function(e){return r.until(e),r.source.emit("start"),r},r.stop=function(e){return r.source.emit("stop",e)},r[Symbol.asyncIterator]=function(){return{next:function(){return r.wait=new Promise(function(e){r.wait=!0,r.map(function(t,n,o){delete r.wait,r.off(o),e({value:t,done:!1})}),r.emit("pull",r)})}}},r}},H=Object.freeze({default:M,__moduleExports:M}),T=H&&M||H,B=function(e){if(!(e=e.host&&e.host.nodeName?e.host:e).on){e.listeners={};T(e,{on:function(n){var r=n.type.split(".").shift();e.listeners[r]||e.addEventListener(r,e.listeners[r]=function(n){return n.detail&&n.detail.emitted?0:t(r,[n,e.state,e])})},off:function(t){e.on[t.type]&&e.on[t.type].length||(e.removeEventListener(t.type,e.listeners[t.type]),delete e.listeners[t.type])}});var t=e.emit;e.emit=function(n,r){var o=new CustomEvent(n,{detail:{params:r,emitted:!0},bubbles:!1,cancelable:!0});return e.dispatchEvent(o),t(n,o)}}},F=Object.freeze({default:B,__moduleExports:B}),G=g&&_||g,J=F&&B||F,K=(function(e){var t=function(){},n=l&&window.HTMLElement||function(){return function(){}}(),r=l&&window.customElements||{};e.exports=function(e,t){if(1==arguments.length&&(t=e,e="anon-"+r.anon++),t.hasOwnProperty("wrapper"))return t.wrapper;if(e.includes("-")){if(!l)return o(G(t));var n=r.get(e);if(n){if(n.class==G(t))return n;n.class=G(t),Array.from(document.querySelectorAll(e)).map(function(e){e.disconnectedCallback(),e.methods.map(function(t){delete e[t]}),e.connectedCallback()})}else r.define(e,n=o(G(t)));return n}};var o=function(e){return e.hasOwnProperty("wrapper")||(e.wrapper=function(n){function r(){n.call(this),J(this),this.ready=this.once("ready"),this.state=this.state||{}}return n&&(r.__proto__=n),r.prototype=Object.create(n&&n.prototype),r.prototype.constructor=r,r.prototype.connectedCallback=function(){var n=this,r=e.wrapper.class.prototype;return this.methods=Object.getOwnPropertyNames(r).filter(function(e){return!(e in u)}).map(function(e){return n[e]=r[e].bind(n),e}),Promise.resolve((this.connected||t).call(this,this,this.state)).then(function(){return n.emit("ready"),n.render()})},r.prototype.render=function(){var t=this,n=e.wrapper.class.prototype;return this.pending=this.pending||this.ready.then(function(){return delete t.pending,n.render.call(t,t,t.state)})},r.prototype.disconnectedCallback=function(){(this.disconnected||t).call(this,this,this.state),this.dispatchEvent(new CustomEvent("disconnected")),this.initialised=!1},r.prototype.get=function(e){return this.querySelector(e)},r}(n)),e.wrapper.class=e,e.wrapper},u={length:1,prototype:1,name:1,render:1};r.anon=r.anon||1}(E={exports:{}},E.exports),E.exports),Q=Object.freeze({default:K,__moduleExports:K}),R=w&&v||w,U=Q&&K||Q,V=(b&&y||b)("[ri/components]");return function(e){return l?(V("creating"),Node.prototype.render=function(){var t=this.nodeName.toLowerCase();if(t.includes("-"))return this.state=this.state||{},this.fn$=this.fn$||e.subscribe(t).map(function(e){return U(t,e)})},Node.prototype.draw=function(){this.render()},R(function(){return Array.from(document.querySelectorAll("*")).filter(function(e){return e.nodeName.includes("-")}).map(function(e){return e.render()})}),e):e}}();