This commit is contained in:
Akko
2025-01-21 19:11:39 +01:00
parent 37fdefdfa4
commit 71f708ff8c
1004 changed files with 100768 additions and 700 deletions

View File

@@ -0,0 +1,462 @@
goog.provide('cljs.core.async.impl.buffers');
cljs.core.async.impl.buffers.acopy = (function cljs$core$async$impl$buffers$acopy(src,src_start,dest,dest_start,len){
var cnt = (0);
while(true){
if((cnt < len)){
(dest[(dest_start + cnt)] = (src[(src_start + cnt)]));
var G__20193 = (cnt + (1));
cnt = G__20193;
continue;
} else {
return null;
}
break;
}
});
/**
* @constructor
*/
cljs.core.async.impl.buffers.RingBuffer = (function (head,tail,length,arr){
this.head = head;
this.tail = tail;
this.length = length;
this.arr = arr;
});
(cljs.core.async.impl.buffers.RingBuffer.prototype.pop = (function (){
var self__ = this;
var _ = this;
if((self__.length === (0))){
return null;
} else {
var x = (self__.arr[self__.tail]);
(self__.arr[self__.tail] = null);
(self__.tail = ((self__.tail + (1)) % self__.arr.length));
(self__.length = (self__.length - (1)));
return x;
}
}));
(cljs.core.async.impl.buffers.RingBuffer.prototype.unshift = (function (x){
var self__ = this;
var _ = this;
(self__.arr[self__.head] = x);
(self__.head = ((self__.head + (1)) % self__.arr.length));
(self__.length = (self__.length + (1)));
return null;
}));
(cljs.core.async.impl.buffers.RingBuffer.prototype.unbounded_unshift = (function (x){
var self__ = this;
var this$ = this;
if(((self__.length + (1)) === self__.arr.length)){
this$.resize();
} else {
}
return this$.unshift(x);
}));
(cljs.core.async.impl.buffers.RingBuffer.prototype.resize = (function (){
var self__ = this;
var _ = this;
var new_arr_size = (self__.arr.length * (2));
var new_arr = (new Array(new_arr_size));
if((self__.tail < self__.head)){
cljs.core.async.impl.buffers.acopy(self__.arr,self__.tail,new_arr,(0),self__.length);
(self__.tail = (0));
(self__.head = self__.length);
return (self__.arr = new_arr);
} else {
if((self__.tail > self__.head)){
cljs.core.async.impl.buffers.acopy(self__.arr,self__.tail,new_arr,(0),(self__.arr.length - self__.tail));
cljs.core.async.impl.buffers.acopy(self__.arr,(0),new_arr,(self__.arr.length - self__.tail),self__.head);
(self__.tail = (0));
(self__.head = self__.length);
return (self__.arr = new_arr);
} else {
if((self__.tail === self__.head)){
(self__.tail = (0));
(self__.head = (0));
return (self__.arr = new_arr);
} else {
return null;
}
}
}
}));
(cljs.core.async.impl.buffers.RingBuffer.prototype.cleanup = (function (keep_QMARK_){
var self__ = this;
var this$ = this;
var n__5593__auto__ = self__.length;
var x = (0);
while(true){
if((x < n__5593__auto__)){
var v_20250 = this$.pop();
if((keep_QMARK_.cljs$core$IFn$_invoke$arity$1 ? keep_QMARK_.cljs$core$IFn$_invoke$arity$1(v_20250) : keep_QMARK_.call(null, v_20250))){
this$.unshift(v_20250);
} else {
}
var G__20254 = (x + (1));
x = G__20254;
continue;
} else {
return null;
}
break;
}
}));
(cljs.core.async.impl.buffers.RingBuffer.getBasis = (function (){
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.with_meta(new cljs.core.Symbol(null,"head","head",869147608,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),cljs.core.with_meta(new cljs.core.Symbol(null,"tail","tail",494507963,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),cljs.core.with_meta(new cljs.core.Symbol(null,"length","length",-2065447907,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),cljs.core.with_meta(new cljs.core.Symbol(null,"arr","arr",2115492975,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null))], null);
}));
(cljs.core.async.impl.buffers.RingBuffer.cljs$lang$type = true);
(cljs.core.async.impl.buffers.RingBuffer.cljs$lang$ctorStr = "cljs.core.async.impl.buffers/RingBuffer");
(cljs.core.async.impl.buffers.RingBuffer.cljs$lang$ctorPrWriter = (function (this__5287__auto__,writer__5288__auto__,opt__5289__auto__){
return cljs.core._write(writer__5288__auto__,"cljs.core.async.impl.buffers/RingBuffer");
}));
/**
* Positional factory function for cljs.core.async.impl.buffers/RingBuffer.
*/
cljs.core.async.impl.buffers.__GT_RingBuffer = (function cljs$core$async$impl$buffers$__GT_RingBuffer(head,tail,length,arr){
return (new cljs.core.async.impl.buffers.RingBuffer(head,tail,length,arr));
});
cljs.core.async.impl.buffers.ring_buffer = (function cljs$core$async$impl$buffers$ring_buffer(n){
if((n > (0))){
} else {
throw (new Error(["Assert failed: ","Can't create a ring buffer of size 0","\n","(> n 0)"].join('')));
}
return (new cljs.core.async.impl.buffers.RingBuffer((0),(0),(0),(new Array(n))));
});
/**
* @constructor
* @implements {cljs.core.ICounted}
* @implements {cljs.core.async.impl.protocols.Buffer}
*/
cljs.core.async.impl.buffers.FixedBuffer = (function (buf,n){
this.buf = buf;
this.n = n;
this.cljs$lang$protocol_mask$partition0$ = 2;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
(cljs.core.async.impl.buffers.FixedBuffer.prototype.cljs$core$async$impl$protocols$Buffer$ = cljs.core.PROTOCOL_SENTINEL);
(cljs.core.async.impl.buffers.FixedBuffer.prototype.cljs$core$async$impl$protocols$Buffer$full_QMARK_$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return (self__.buf.length >= self__.n);
}));
(cljs.core.async.impl.buffers.FixedBuffer.prototype.cljs$core$async$impl$protocols$Buffer$remove_BANG_$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return self__.buf.pop();
}));
(cljs.core.async.impl.buffers.FixedBuffer.prototype.cljs$core$async$impl$protocols$Buffer$add_BANG__STAR_$arity$2 = (function (this$,itm){
var self__ = this;
var this$__$1 = this;
self__.buf.unbounded_unshift(itm);
return this$__$1;
}));
(cljs.core.async.impl.buffers.FixedBuffer.prototype.cljs$core$async$impl$protocols$Buffer$close_buf_BANG_$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return null;
}));
(cljs.core.async.impl.buffers.FixedBuffer.prototype.cljs$core$ICounted$_count$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return self__.buf.length;
}));
(cljs.core.async.impl.buffers.FixedBuffer.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"buf","buf",1426618187,null),new cljs.core.Symbol(null,"n","n",-2092305744,null)], null);
}));
(cljs.core.async.impl.buffers.FixedBuffer.cljs$lang$type = true);
(cljs.core.async.impl.buffers.FixedBuffer.cljs$lang$ctorStr = "cljs.core.async.impl.buffers/FixedBuffer");
(cljs.core.async.impl.buffers.FixedBuffer.cljs$lang$ctorPrWriter = (function (this__5287__auto__,writer__5288__auto__,opt__5289__auto__){
return cljs.core._write(writer__5288__auto__,"cljs.core.async.impl.buffers/FixedBuffer");
}));
/**
* Positional factory function for cljs.core.async.impl.buffers/FixedBuffer.
*/
cljs.core.async.impl.buffers.__GT_FixedBuffer = (function cljs$core$async$impl$buffers$__GT_FixedBuffer(buf,n){
return (new cljs.core.async.impl.buffers.FixedBuffer(buf,n));
});
cljs.core.async.impl.buffers.fixed_buffer = (function cljs$core$async$impl$buffers$fixed_buffer(n){
return (new cljs.core.async.impl.buffers.FixedBuffer(cljs.core.async.impl.buffers.ring_buffer(n),n));
});
/**
* @constructor
* @implements {cljs.core.ICounted}
* @implements {cljs.core.async.impl.protocols.UnblockingBuffer}
* @implements {cljs.core.async.impl.protocols.Buffer}
*/
cljs.core.async.impl.buffers.DroppingBuffer = (function (buf,n){
this.buf = buf;
this.n = n;
this.cljs$lang$protocol_mask$partition0$ = 2;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
(cljs.core.async.impl.buffers.DroppingBuffer.prototype.cljs$core$async$impl$protocols$UnblockingBuffer$ = cljs.core.PROTOCOL_SENTINEL);
(cljs.core.async.impl.buffers.DroppingBuffer.prototype.cljs$core$async$impl$protocols$Buffer$ = cljs.core.PROTOCOL_SENTINEL);
(cljs.core.async.impl.buffers.DroppingBuffer.prototype.cljs$core$async$impl$protocols$Buffer$full_QMARK_$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return false;
}));
(cljs.core.async.impl.buffers.DroppingBuffer.prototype.cljs$core$async$impl$protocols$Buffer$remove_BANG_$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return self__.buf.pop();
}));
(cljs.core.async.impl.buffers.DroppingBuffer.prototype.cljs$core$async$impl$protocols$Buffer$add_BANG__STAR_$arity$2 = (function (this$,itm){
var self__ = this;
var this$__$1 = this;
if((self__.buf.length === self__.n)){
} else {
self__.buf.unshift(itm);
}
return this$__$1;
}));
(cljs.core.async.impl.buffers.DroppingBuffer.prototype.cljs$core$async$impl$protocols$Buffer$close_buf_BANG_$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return null;
}));
(cljs.core.async.impl.buffers.DroppingBuffer.prototype.cljs$core$ICounted$_count$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return self__.buf.length;
}));
(cljs.core.async.impl.buffers.DroppingBuffer.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"buf","buf",1426618187,null),new cljs.core.Symbol(null,"n","n",-2092305744,null)], null);
}));
(cljs.core.async.impl.buffers.DroppingBuffer.cljs$lang$type = true);
(cljs.core.async.impl.buffers.DroppingBuffer.cljs$lang$ctorStr = "cljs.core.async.impl.buffers/DroppingBuffer");
(cljs.core.async.impl.buffers.DroppingBuffer.cljs$lang$ctorPrWriter = (function (this__5287__auto__,writer__5288__auto__,opt__5289__auto__){
return cljs.core._write(writer__5288__auto__,"cljs.core.async.impl.buffers/DroppingBuffer");
}));
/**
* Positional factory function for cljs.core.async.impl.buffers/DroppingBuffer.
*/
cljs.core.async.impl.buffers.__GT_DroppingBuffer = (function cljs$core$async$impl$buffers$__GT_DroppingBuffer(buf,n){
return (new cljs.core.async.impl.buffers.DroppingBuffer(buf,n));
});
cljs.core.async.impl.buffers.dropping_buffer = (function cljs$core$async$impl$buffers$dropping_buffer(n){
return (new cljs.core.async.impl.buffers.DroppingBuffer(cljs.core.async.impl.buffers.ring_buffer(n),n));
});
/**
* @constructor
* @implements {cljs.core.ICounted}
* @implements {cljs.core.async.impl.protocols.UnblockingBuffer}
* @implements {cljs.core.async.impl.protocols.Buffer}
*/
cljs.core.async.impl.buffers.SlidingBuffer = (function (buf,n){
this.buf = buf;
this.n = n;
this.cljs$lang$protocol_mask$partition0$ = 2;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
(cljs.core.async.impl.buffers.SlidingBuffer.prototype.cljs$core$async$impl$protocols$UnblockingBuffer$ = cljs.core.PROTOCOL_SENTINEL);
(cljs.core.async.impl.buffers.SlidingBuffer.prototype.cljs$core$async$impl$protocols$Buffer$ = cljs.core.PROTOCOL_SENTINEL);
(cljs.core.async.impl.buffers.SlidingBuffer.prototype.cljs$core$async$impl$protocols$Buffer$full_QMARK_$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return false;
}));
(cljs.core.async.impl.buffers.SlidingBuffer.prototype.cljs$core$async$impl$protocols$Buffer$remove_BANG_$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return self__.buf.pop();
}));
(cljs.core.async.impl.buffers.SlidingBuffer.prototype.cljs$core$async$impl$protocols$Buffer$add_BANG__STAR_$arity$2 = (function (this$,itm){
var self__ = this;
var this$__$1 = this;
if((self__.buf.length === self__.n)){
this$__$1.cljs$core$async$impl$protocols$Buffer$remove_BANG_$arity$1(null, );
} else {
}
self__.buf.unshift(itm);
return this$__$1;
}));
(cljs.core.async.impl.buffers.SlidingBuffer.prototype.cljs$core$async$impl$protocols$Buffer$close_buf_BANG_$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return null;
}));
(cljs.core.async.impl.buffers.SlidingBuffer.prototype.cljs$core$ICounted$_count$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return self__.buf.length;
}));
(cljs.core.async.impl.buffers.SlidingBuffer.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"buf","buf",1426618187,null),new cljs.core.Symbol(null,"n","n",-2092305744,null)], null);
}));
(cljs.core.async.impl.buffers.SlidingBuffer.cljs$lang$type = true);
(cljs.core.async.impl.buffers.SlidingBuffer.cljs$lang$ctorStr = "cljs.core.async.impl.buffers/SlidingBuffer");
(cljs.core.async.impl.buffers.SlidingBuffer.cljs$lang$ctorPrWriter = (function (this__5287__auto__,writer__5288__auto__,opt__5289__auto__){
return cljs.core._write(writer__5288__auto__,"cljs.core.async.impl.buffers/SlidingBuffer");
}));
/**
* Positional factory function for cljs.core.async.impl.buffers/SlidingBuffer.
*/
cljs.core.async.impl.buffers.__GT_SlidingBuffer = (function cljs$core$async$impl$buffers$__GT_SlidingBuffer(buf,n){
return (new cljs.core.async.impl.buffers.SlidingBuffer(buf,n));
});
cljs.core.async.impl.buffers.sliding_buffer = (function cljs$core$async$impl$buffers$sliding_buffer(n){
return (new cljs.core.async.impl.buffers.SlidingBuffer(cljs.core.async.impl.buffers.ring_buffer(n),n));
});
if((typeof cljs !== 'undefined') && (typeof cljs.core !== 'undefined') && (typeof cljs.core.async !== 'undefined') && (typeof cljs.core.async.impl !== 'undefined') && (typeof cljs.core.async.impl.buffers !== 'undefined') && (typeof cljs.core.async.impl.buffers.NO_VAL !== 'undefined')){
} else {
cljs.core.async.impl.buffers.NO_VAL = (new Object());
}
cljs.core.async.impl.buffers.undelivered_QMARK_ = (function cljs$core$async$impl$buffers$undelivered_QMARK_(val){
return (cljs.core.async.impl.buffers.NO_VAL === val);
});
/**
* @constructor
* @implements {cljs.core.ICounted}
* @implements {cljs.core.async.impl.protocols.UnblockingBuffer}
* @implements {cljs.core.async.impl.protocols.Buffer}
*/
cljs.core.async.impl.buffers.PromiseBuffer = (function (val){
this.val = val;
this.cljs$lang$protocol_mask$partition0$ = 2;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
(cljs.core.async.impl.buffers.PromiseBuffer.prototype.cljs$core$async$impl$protocols$UnblockingBuffer$ = cljs.core.PROTOCOL_SENTINEL);
(cljs.core.async.impl.buffers.PromiseBuffer.prototype.cljs$core$async$impl$protocols$Buffer$ = cljs.core.PROTOCOL_SENTINEL);
(cljs.core.async.impl.buffers.PromiseBuffer.prototype.cljs$core$async$impl$protocols$Buffer$full_QMARK_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return false;
}));
(cljs.core.async.impl.buffers.PromiseBuffer.prototype.cljs$core$async$impl$protocols$Buffer$remove_BANG_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return self__.val;
}));
(cljs.core.async.impl.buffers.PromiseBuffer.prototype.cljs$core$async$impl$protocols$Buffer$add_BANG__STAR_$arity$2 = (function (this$,itm){
var self__ = this;
var this$__$1 = this;
if(cljs.core.async.impl.buffers.undelivered_QMARK_(self__.val)){
(self__.val = itm);
} else {
}
return this$__$1;
}));
(cljs.core.async.impl.buffers.PromiseBuffer.prototype.cljs$core$async$impl$protocols$Buffer$close_buf_BANG_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
if(cljs.core.async.impl.buffers.undelivered_QMARK_(self__.val)){
return (self__.val = null);
} else {
return null;
}
}));
(cljs.core.async.impl.buffers.PromiseBuffer.prototype.cljs$core$ICounted$_count$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
if(cljs.core.async.impl.buffers.undelivered_QMARK_(self__.val)){
return (0);
} else {
return (1);
}
}));
(cljs.core.async.impl.buffers.PromiseBuffer.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.with_meta(new cljs.core.Symbol(null,"val","val",1769233139,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null))], null);
}));
(cljs.core.async.impl.buffers.PromiseBuffer.cljs$lang$type = true);
(cljs.core.async.impl.buffers.PromiseBuffer.cljs$lang$ctorStr = "cljs.core.async.impl.buffers/PromiseBuffer");
(cljs.core.async.impl.buffers.PromiseBuffer.cljs$lang$ctorPrWriter = (function (this__5287__auto__,writer__5288__auto__,opt__5289__auto__){
return cljs.core._write(writer__5288__auto__,"cljs.core.async.impl.buffers/PromiseBuffer");
}));
/**
* Positional factory function for cljs.core.async.impl.buffers/PromiseBuffer.
*/
cljs.core.async.impl.buffers.__GT_PromiseBuffer = (function cljs$core$async$impl$buffers$__GT_PromiseBuffer(val){
return (new cljs.core.async.impl.buffers.PromiseBuffer(val));
});
cljs.core.async.impl.buffers.promise_buffer = (function cljs$core$async$impl$buffers$promise_buffer(){
return (new cljs.core.async.impl.buffers.PromiseBuffer(cljs.core.async.impl.buffers.NO_VAL));
});
//# sourceMappingURL=cljs.core.async.impl.buffers.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,682 @@
goog.provide('cljs.core.async.impl.channels');
/**
* @constructor
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IDeref}
* @implements {cljs.core.IWithMeta}
*/
cljs.core.async.impl.channels.t_cljs$core$async$impl$channels21775 = (function (val,meta21776){
this.val = val;
this.meta21776 = meta21776;
this.cljs$lang$protocol_mask$partition0$ = 425984;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
(cljs.core.async.impl.channels.t_cljs$core$async$impl$channels21775.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_21777,meta21776__$1){
var self__ = this;
var _21777__$1 = this;
return (new cljs.core.async.impl.channels.t_cljs$core$async$impl$channels21775(self__.val,meta21776__$1));
}));
(cljs.core.async.impl.channels.t_cljs$core$async$impl$channels21775.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_21777){
var self__ = this;
var _21777__$1 = this;
return self__.meta21776;
}));
(cljs.core.async.impl.channels.t_cljs$core$async$impl$channels21775.prototype.cljs$core$IDeref$_deref$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return self__.val;
}));
(cljs.core.async.impl.channels.t_cljs$core$async$impl$channels21775.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"val","val",1769233139,null),new cljs.core.Symbol(null,"meta21776","meta21776",406646773,null)], null);
}));
(cljs.core.async.impl.channels.t_cljs$core$async$impl$channels21775.cljs$lang$type = true);
(cljs.core.async.impl.channels.t_cljs$core$async$impl$channels21775.cljs$lang$ctorStr = "cljs.core.async.impl.channels/t_cljs$core$async$impl$channels21775");
(cljs.core.async.impl.channels.t_cljs$core$async$impl$channels21775.cljs$lang$ctorPrWriter = (function (this__5287__auto__,writer__5288__auto__,opt__5289__auto__){
return cljs.core._write(writer__5288__auto__,"cljs.core.async.impl.channels/t_cljs$core$async$impl$channels21775");
}));
/**
* Positional factory function for cljs.core.async.impl.channels/t_cljs$core$async$impl$channels21775.
*/
cljs.core.async.impl.channels.__GT_t_cljs$core$async$impl$channels21775 = (function cljs$core$async$impl$channels$__GT_t_cljs$core$async$impl$channels21775(val,meta21776){
return (new cljs.core.async.impl.channels.t_cljs$core$async$impl$channels21775(val,meta21776));
});
cljs.core.async.impl.channels.box = (function cljs$core$async$impl$channels$box(val){
return (new cljs.core.async.impl.channels.t_cljs$core$async$impl$channels21775(val,cljs.core.PersistentArrayMap.EMPTY));
});
/**
* @constructor
*/
cljs.core.async.impl.channels.PutBox = (function (handler,val){
this.handler = handler;
this.val = val;
});
(cljs.core.async.impl.channels.PutBox.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"handler","handler",1444934915,null),new cljs.core.Symbol(null,"val","val",1769233139,null)], null);
}));
(cljs.core.async.impl.channels.PutBox.cljs$lang$type = true);
(cljs.core.async.impl.channels.PutBox.cljs$lang$ctorStr = "cljs.core.async.impl.channels/PutBox");
(cljs.core.async.impl.channels.PutBox.cljs$lang$ctorPrWriter = (function (this__5287__auto__,writer__5288__auto__,opt__5289__auto__){
return cljs.core._write(writer__5288__auto__,"cljs.core.async.impl.channels/PutBox");
}));
/**
* Positional factory function for cljs.core.async.impl.channels/PutBox.
*/
cljs.core.async.impl.channels.__GT_PutBox = (function cljs$core$async$impl$channels$__GT_PutBox(handler,val){
return (new cljs.core.async.impl.channels.PutBox(handler,val));
});
cljs.core.async.impl.channels.put_active_QMARK_ = (function cljs$core$async$impl$channels$put_active_QMARK_(box){
return cljs.core.async.impl.protocols.active_QMARK_(box.handler);
});
cljs.core.async.impl.channels.MAX_DIRTY = (64);
/**
* @interface
*/
cljs.core.async.impl.channels.MMC = function(){};
var cljs$core$async$impl$channels$MMC$abort$dyn_22053 = (function (this$){
var x__5350__auto__ = (((this$ == null))?null:this$);
var m__5351__auto__ = (cljs.core.async.impl.channels.abort[goog.typeOf(x__5350__auto__)]);
if((!((m__5351__auto__ == null)))){
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$1(this$) : m__5351__auto__.call(null, this$));
} else {
var m__5349__auto__ = (cljs.core.async.impl.channels.abort["_"]);
if((!((m__5349__auto__ == null)))){
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$1(this$) : m__5349__auto__.call(null, this$));
} else {
throw cljs.core.missing_protocol("MMC.abort",this$);
}
}
});
cljs.core.async.impl.channels.abort = (function cljs$core$async$impl$channels$abort(this$){
if((((!((this$ == null)))) && ((!((this$.cljs$core$async$impl$channels$MMC$abort$arity$1 == null)))))){
return this$.cljs$core$async$impl$channels$MMC$abort$arity$1(this$);
} else {
return cljs$core$async$impl$channels$MMC$abort$dyn_22053(this$);
}
});
/**
* @constructor
* @implements {cljs.core.async.impl.channels.MMC}
* @implements {cljs.core.async.impl.protocols.Channel}
* @implements {cljs.core.async.impl.protocols.WritePort}
* @implements {cljs.core.async.impl.protocols.ReadPort}
*/
cljs.core.async.impl.channels.ManyToManyChannel = (function (takes,dirty_takes,puts,dirty_puts,buf,closed,add_BANG_){
this.takes = takes;
this.dirty_takes = dirty_takes;
this.puts = puts;
this.dirty_puts = dirty_puts;
this.buf = buf;
this.closed = closed;
this.add_BANG_ = add_BANG_;
});
(cljs.core.async.impl.channels.ManyToManyChannel.prototype.cljs$core$async$impl$channels$MMC$ = cljs.core.PROTOCOL_SENTINEL);
(cljs.core.async.impl.channels.ManyToManyChannel.prototype.cljs$core$async$impl$channels$MMC$abort$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
while(true){
var putter_22065 = self__.puts.pop();
if((putter_22065 == null)){
} else {
var put_handler_22066 = putter_22065.handler;
var val_22067 = putter_22065.val;
if(put_handler_22066.cljs$core$async$impl$protocols$Handler$active_QMARK_$arity$1(null, )){
var put_cb_22068 = put_handler_22066.cljs$core$async$impl$protocols$Handler$commit$arity$1(null, );
cljs.core.async.impl.dispatch.run(((function (put_cb_22068,put_handler_22066,val_22067,putter_22065,this$__$1){
return (function (){
return (put_cb_22068.cljs$core$IFn$_invoke$arity$1 ? put_cb_22068.cljs$core$IFn$_invoke$arity$1(true) : put_cb_22068.call(null, true));
});})(put_cb_22068,put_handler_22066,val_22067,putter_22065,this$__$1))
);
} else {
continue;
}
}
break;
}
self__.puts.cleanup(cljs.core.constantly(false));
return this$__$1.cljs$core$async$impl$protocols$Channel$close_BANG_$arity$1(null, );
}));
(cljs.core.async.impl.channels.ManyToManyChannel.prototype.cljs$core$async$impl$protocols$WritePort$ = cljs.core.PROTOCOL_SENTINEL);
(cljs.core.async.impl.channels.ManyToManyChannel.prototype.cljs$core$async$impl$protocols$WritePort$put_BANG_$arity$3 = (function (this$,val,handler){
var self__ = this;
var this$__$1 = this;
if((!((val == null)))){
} else {
throw (new Error(["Assert failed: ","Can't put nil on a channel","\n","(not (nil? val))"].join('')));
}
var closed__$1 = self__.closed;
if((!(handler.cljs$core$async$impl$protocols$Handler$active_QMARK_$arity$1(null, )))){
return cljs.core.async.impl.channels.box((!(closed__$1)));
} else {
if(closed__$1){
handler.cljs$core$async$impl$protocols$Handler$commit$arity$1(null, );
return cljs.core.async.impl.channels.box(false);
} else {
if(cljs.core.truth_((function (){var and__5000__auto__ = self__.buf;
if(cljs.core.truth_(and__5000__auto__)){
return cljs.core.not(self__.buf.cljs$core$async$impl$protocols$Buffer$full_QMARK_$arity$1(null, ));
} else {
return and__5000__auto__;
}
})())){
handler.cljs$core$async$impl$protocols$Handler$commit$arity$1(null, );
var done_QMARK_ = cljs.core.reduced_QMARK_((self__.add_BANG_.cljs$core$IFn$_invoke$arity$2 ? self__.add_BANG_.cljs$core$IFn$_invoke$arity$2(self__.buf,val) : self__.add_BANG_.call(null, self__.buf,val)));
var take_cbs = (function (){var takers = cljs.core.PersistentVector.EMPTY;
while(true){
if((((self__.takes.length > (0))) && ((cljs.core.count(self__.buf) > (0))))){
var taker = self__.takes.pop();
if(taker.cljs$core$async$impl$protocols$Handler$active_QMARK_$arity$1(null, )){
var ret = taker.cljs$core$async$impl$protocols$Handler$commit$arity$1(null, );
var val__$1 = self__.buf.cljs$core$async$impl$protocols$Buffer$remove_BANG_$arity$1(null, );
var G__22074 = cljs.core.conj.cljs$core$IFn$_invoke$arity$2(takers,((function (takers,ret,val__$1,taker,done_QMARK_,closed__$1,this$__$1){
return (function (){
return (ret.cljs$core$IFn$_invoke$arity$1 ? ret.cljs$core$IFn$_invoke$arity$1(val__$1) : ret.call(null, val__$1));
});})(takers,ret,val__$1,taker,done_QMARK_,closed__$1,this$__$1))
);
takers = G__22074;
continue;
} else {
var G__22075 = takers;
takers = G__22075;
continue;
}
} else {
return takers;
}
break;
}
})();
if(done_QMARK_){
this$__$1.cljs$core$async$impl$channels$MMC$abort$arity$1(null, );
} else {
}
if(cljs.core.seq(take_cbs)){
var seq__21855_22081 = cljs.core.seq(take_cbs);
var chunk__21856_22082 = null;
var count__21857_22083 = (0);
var i__21858_22084 = (0);
while(true){
if((i__21858_22084 < count__21857_22083)){
var f_22087 = chunk__21856_22082.cljs$core$IIndexed$_nth$arity$2(null, i__21858_22084);
cljs.core.async.impl.dispatch.run(f_22087);
var G__22092 = seq__21855_22081;
var G__22093 = chunk__21856_22082;
var G__22094 = count__21857_22083;
var G__22095 = (i__21858_22084 + (1));
seq__21855_22081 = G__22092;
chunk__21856_22082 = G__22093;
count__21857_22083 = G__22094;
i__21858_22084 = G__22095;
continue;
} else {
var temp__5804__auto___22096 = cljs.core.seq(seq__21855_22081);
if(temp__5804__auto___22096){
var seq__21855_22097__$1 = temp__5804__auto___22096;
if(cljs.core.chunked_seq_QMARK_(seq__21855_22097__$1)){
var c__5525__auto___22102 = cljs.core.chunk_first(seq__21855_22097__$1);
var G__22104 = cljs.core.chunk_rest(seq__21855_22097__$1);
var G__22105 = c__5525__auto___22102;
var G__22106 = cljs.core.count(c__5525__auto___22102);
var G__22107 = (0);
seq__21855_22081 = G__22104;
chunk__21856_22082 = G__22105;
count__21857_22083 = G__22106;
i__21858_22084 = G__22107;
continue;
} else {
var f_22108 = cljs.core.first(seq__21855_22097__$1);
cljs.core.async.impl.dispatch.run(f_22108);
var G__22112 = cljs.core.next(seq__21855_22097__$1);
var G__22113 = null;
var G__22114 = (0);
var G__22115 = (0);
seq__21855_22081 = G__22112;
chunk__21856_22082 = G__22113;
count__21857_22083 = G__22114;
i__21858_22084 = G__22115;
continue;
}
} else {
}
}
break;
}
} else {
}
return cljs.core.async.impl.channels.box(true);
} else {
var taker = (function (){while(true){
var taker = self__.takes.pop();
if(cljs.core.truth_(taker)){
if(cljs.core.truth_(taker.cljs$core$async$impl$protocols$Handler$active_QMARK_$arity$1(null, ))){
return taker;
} else {
continue;
}
} else {
return null;
}
break;
}
})();
if(cljs.core.truth_(taker)){
var take_cb = taker.cljs$core$async$impl$protocols$Handler$commit$arity$1(null, );
handler.cljs$core$async$impl$protocols$Handler$commit$arity$1(null, );
cljs.core.async.impl.dispatch.run((function (){
return (take_cb.cljs$core$IFn$_invoke$arity$1 ? take_cb.cljs$core$IFn$_invoke$arity$1(val) : take_cb.call(null, val));
}));
return cljs.core.async.impl.channels.box(true);
} else {
if((self__.dirty_puts > (64))){
(self__.dirty_puts = (0));
self__.puts.cleanup(cljs.core.async.impl.channels.put_active_QMARK_);
} else {
(self__.dirty_puts = (self__.dirty_puts + (1)));
}
if(cljs.core.truth_(handler.cljs$core$async$impl$protocols$Handler$blockable_QMARK_$arity$1(null, ))){
if((self__.puts.length < (1024))){
} else {
throw (new Error(["Assert failed: ",["No more than ",cljs.core.str.cljs$core$IFn$_invoke$arity$1((1024))," pending puts are allowed on a single channel."," Consider using a windowed buffer."].join(''),"\n","(< (.-length puts) impl/MAX-QUEUE-SIZE)"].join('')));
}
self__.puts.unbounded_unshift((new cljs.core.async.impl.channels.PutBox(handler,val)));
} else {
}
return null;
}
}
}
}
}));
(cljs.core.async.impl.channels.ManyToManyChannel.prototype.cljs$core$async$impl$protocols$ReadPort$ = cljs.core.PROTOCOL_SENTINEL);
(cljs.core.async.impl.channels.ManyToManyChannel.prototype.cljs$core$async$impl$protocols$ReadPort$take_BANG_$arity$2 = (function (this$,handler){
var self__ = this;
var this$__$1 = this;
if((!(handler.cljs$core$async$impl$protocols$Handler$active_QMARK_$arity$1(null, )))){
return null;
} else {
if((((!((self__.buf == null)))) && ((cljs.core.count(self__.buf) > (0))))){
var temp__5802__auto__ = handler.cljs$core$async$impl$protocols$Handler$commit$arity$1(null, );
if(cljs.core.truth_(temp__5802__auto__)){
var take_cb = temp__5802__auto__;
var val = self__.buf.cljs$core$async$impl$protocols$Buffer$remove_BANG_$arity$1(null, );
var vec__21906 = ((((cljs.core.not(self__.buf.cljs$core$async$impl$protocols$Buffer$full_QMARK_$arity$1(null, ))) && ((self__.puts.length > (0)))))?(function (){var cbs = cljs.core.PersistentVector.EMPTY;
while(true){
var putter = self__.puts.pop();
var put_handler = putter.handler;
var val__$1 = putter.val;
var cb = (function (){var and__5000__auto__ = put_handler.cljs$core$async$impl$protocols$Handler$active_QMARK_$arity$1(null, );
if(and__5000__auto__){
return put_handler.cljs$core$async$impl$protocols$Handler$commit$arity$1(null, );
} else {
return and__5000__auto__;
}
})();
var cbs__$1 = (cljs.core.truth_(cb)?cljs.core.conj.cljs$core$IFn$_invoke$arity$2(cbs,cb):cbs);
var done_QMARK_ = (cljs.core.truth_(cb)?cljs.core.reduced_QMARK_((self__.add_BANG_.cljs$core$IFn$_invoke$arity$2 ? self__.add_BANG_.cljs$core$IFn$_invoke$arity$2(self__.buf,val__$1) : self__.add_BANG_.call(null, self__.buf,val__$1))):null);
if(((cljs.core.not(done_QMARK_)) && (((cljs.core.not(self__.buf.cljs$core$async$impl$protocols$Buffer$full_QMARK_$arity$1(null, ))) && ((self__.puts.length > (0))))))){
var G__22142 = cbs__$1;
cbs = G__22142;
continue;
} else {
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [done_QMARK_,cbs__$1], null);
}
break;
}
})():null);
var done_QMARK_ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__21906,(0),null);
var cbs = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__21906,(1),null);
if(cljs.core.truth_(done_QMARK_)){
this$__$1.cljs$core$async$impl$channels$MMC$abort$arity$1(null, );
} else {
}
var seq__21936_22144 = cljs.core.seq(cbs);
var chunk__21937_22145 = null;
var count__21938_22146 = (0);
var i__21939_22147 = (0);
while(true){
if((i__21939_22147 < count__21938_22146)){
var cb_22148 = chunk__21937_22145.cljs$core$IIndexed$_nth$arity$2(null, i__21939_22147);
cljs.core.async.impl.dispatch.run(((function (seq__21936_22144,chunk__21937_22145,count__21938_22146,i__21939_22147,cb_22148,val,vec__21906,done_QMARK_,cbs,take_cb,temp__5802__auto__,this$__$1){
return (function (){
return (cb_22148.cljs$core$IFn$_invoke$arity$1 ? cb_22148.cljs$core$IFn$_invoke$arity$1(true) : cb_22148.call(null, true));
});})(seq__21936_22144,chunk__21937_22145,count__21938_22146,i__21939_22147,cb_22148,val,vec__21906,done_QMARK_,cbs,take_cb,temp__5802__auto__,this$__$1))
);
var G__22157 = seq__21936_22144;
var G__22158 = chunk__21937_22145;
var G__22159 = count__21938_22146;
var G__22160 = (i__21939_22147 + (1));
seq__21936_22144 = G__22157;
chunk__21937_22145 = G__22158;
count__21938_22146 = G__22159;
i__21939_22147 = G__22160;
continue;
} else {
var temp__5804__auto___22165 = cljs.core.seq(seq__21936_22144);
if(temp__5804__auto___22165){
var seq__21936_22166__$1 = temp__5804__auto___22165;
if(cljs.core.chunked_seq_QMARK_(seq__21936_22166__$1)){
var c__5525__auto___22170 = cljs.core.chunk_first(seq__21936_22166__$1);
var G__22172 = cljs.core.chunk_rest(seq__21936_22166__$1);
var G__22173 = c__5525__auto___22170;
var G__22174 = cljs.core.count(c__5525__auto___22170);
var G__22175 = (0);
seq__21936_22144 = G__22172;
chunk__21937_22145 = G__22173;
count__21938_22146 = G__22174;
i__21939_22147 = G__22175;
continue;
} else {
var cb_22176 = cljs.core.first(seq__21936_22166__$1);
cljs.core.async.impl.dispatch.run(((function (seq__21936_22144,chunk__21937_22145,count__21938_22146,i__21939_22147,cb_22176,seq__21936_22166__$1,temp__5804__auto___22165,val,vec__21906,done_QMARK_,cbs,take_cb,temp__5802__auto__,this$__$1){
return (function (){
return (cb_22176.cljs$core$IFn$_invoke$arity$1 ? cb_22176.cljs$core$IFn$_invoke$arity$1(true) : cb_22176.call(null, true));
});})(seq__21936_22144,chunk__21937_22145,count__21938_22146,i__21939_22147,cb_22176,seq__21936_22166__$1,temp__5804__auto___22165,val,vec__21906,done_QMARK_,cbs,take_cb,temp__5802__auto__,this$__$1))
);
var G__22178 = cljs.core.next(seq__21936_22166__$1);
var G__22179 = null;
var G__22180 = (0);
var G__22181 = (0);
seq__21936_22144 = G__22178;
chunk__21937_22145 = G__22179;
count__21938_22146 = G__22180;
i__21939_22147 = G__22181;
continue;
}
} else {
}
}
break;
}
return cljs.core.async.impl.channels.box(val);
} else {
return null;
}
} else {
var putter = (function (){while(true){
var putter = self__.puts.pop();
if(cljs.core.truth_(putter)){
if(cljs.core.async.impl.protocols.active_QMARK_(putter.handler)){
return putter;
} else {
continue;
}
} else {
return null;
}
break;
}
})();
if(cljs.core.truth_(putter)){
var put_cb = cljs.core.async.impl.protocols.commit(putter.handler);
handler.cljs$core$async$impl$protocols$Handler$commit$arity$1(null, );
cljs.core.async.impl.dispatch.run((function (){
return (put_cb.cljs$core$IFn$_invoke$arity$1 ? put_cb.cljs$core$IFn$_invoke$arity$1(true) : put_cb.call(null, true));
}));
return cljs.core.async.impl.channels.box(putter.val);
} else {
if(cljs.core.truth_(self__.closed)){
if(cljs.core.truth_(self__.buf)){
(self__.add_BANG_.cljs$core$IFn$_invoke$arity$1 ? self__.add_BANG_.cljs$core$IFn$_invoke$arity$1(self__.buf) : self__.add_BANG_.call(null, self__.buf));
} else {
}
if(cljs.core.truth_((function (){var and__5000__auto__ = handler.cljs$core$async$impl$protocols$Handler$active_QMARK_$arity$1(null, );
if(cljs.core.truth_(and__5000__auto__)){
return handler.cljs$core$async$impl$protocols$Handler$commit$arity$1(null, );
} else {
return and__5000__auto__;
}
})())){
var has_val = (function (){var and__5000__auto__ = self__.buf;
if(cljs.core.truth_(and__5000__auto__)){
return (cljs.core.count(self__.buf) > (0));
} else {
return and__5000__auto__;
}
})();
var val = (cljs.core.truth_(has_val)?self__.buf.cljs$core$async$impl$protocols$Buffer$remove_BANG_$arity$1(null, ):null);
return cljs.core.async.impl.channels.box(val);
} else {
return null;
}
} else {
if((self__.dirty_takes > (64))){
(self__.dirty_takes = (0));
self__.takes.cleanup(cljs.core.async.impl.protocols.active_QMARK_);
} else {
(self__.dirty_takes = (self__.dirty_takes + (1)));
}
if(cljs.core.truth_(handler.cljs$core$async$impl$protocols$Handler$blockable_QMARK_$arity$1(null, ))){
if((self__.takes.length < (1024))){
} else {
throw (new Error(["Assert failed: ",["No more than ",cljs.core.str.cljs$core$IFn$_invoke$arity$1((1024))," pending takes are allowed on a single channel."].join(''),"\n","(< (.-length takes) impl/MAX-QUEUE-SIZE)"].join('')));
}
self__.takes.unbounded_unshift(handler);
} else {
}
return null;
}
}
}
}
}));
(cljs.core.async.impl.channels.ManyToManyChannel.prototype.cljs$core$async$impl$protocols$Channel$ = cljs.core.PROTOCOL_SENTINEL);
(cljs.core.async.impl.channels.ManyToManyChannel.prototype.cljs$core$async$impl$protocols$Channel$closed_QMARK_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return self__.closed;
}));
(cljs.core.async.impl.channels.ManyToManyChannel.prototype.cljs$core$async$impl$protocols$Channel$close_BANG_$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
if(self__.closed){
return null;
} else {
(self__.closed = true);
if(cljs.core.truth_((function (){var and__5000__auto__ = self__.buf;
if(cljs.core.truth_(and__5000__auto__)){
return (self__.puts.length === (0));
} else {
return and__5000__auto__;
}
})())){
(self__.add_BANG_.cljs$core$IFn$_invoke$arity$1 ? self__.add_BANG_.cljs$core$IFn$_invoke$arity$1(self__.buf) : self__.add_BANG_.call(null, self__.buf));
} else {
}
while(true){
var taker_22201 = self__.takes.pop();
if((taker_22201 == null)){
} else {
if(taker_22201.cljs$core$async$impl$protocols$Handler$active_QMARK_$arity$1(null, )){
var take_cb_22202 = taker_22201.cljs$core$async$impl$protocols$Handler$commit$arity$1(null, );
var val_22203 = (cljs.core.truth_((function (){var and__5000__auto__ = self__.buf;
if(cljs.core.truth_(and__5000__auto__)){
return (cljs.core.count(self__.buf) > (0));
} else {
return and__5000__auto__;
}
})())?self__.buf.cljs$core$async$impl$protocols$Buffer$remove_BANG_$arity$1(null, ):null);
cljs.core.async.impl.dispatch.run(((function (take_cb_22202,val_22203,taker_22201,this$__$1){
return (function (){
return (take_cb_22202.cljs$core$IFn$_invoke$arity$1 ? take_cb_22202.cljs$core$IFn$_invoke$arity$1(val_22203) : take_cb_22202.call(null, val_22203));
});})(take_cb_22202,val_22203,taker_22201,this$__$1))
);
} else {
}
continue;
}
break;
}
if(cljs.core.truth_(self__.buf)){
self__.buf.cljs$core$async$impl$protocols$Buffer$close_buf_BANG_$arity$1(null, );
} else {
}
return null;
}
}));
(cljs.core.async.impl.channels.ManyToManyChannel.getBasis = (function (){
return new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"takes","takes",298247964,null),cljs.core.with_meta(new cljs.core.Symbol(null,"dirty-takes","dirty-takes",575642138,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),new cljs.core.Symbol(null,"puts","puts",-1883877054,null),cljs.core.with_meta(new cljs.core.Symbol(null,"dirty-puts","dirty-puts",57041148,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),cljs.core.with_meta(new cljs.core.Symbol(null,"buf","buf",1426618187,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tag","tag",-1290361223),new cljs.core.Symbol(null,"not-native","not-native",-236392494,null)], null)),cljs.core.with_meta(new cljs.core.Symbol(null,"closed","closed",720856168,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),new cljs.core.Symbol(null,"add!","add!",2046056845,null)], null);
}));
(cljs.core.async.impl.channels.ManyToManyChannel.cljs$lang$type = true);
(cljs.core.async.impl.channels.ManyToManyChannel.cljs$lang$ctorStr = "cljs.core.async.impl.channels/ManyToManyChannel");
(cljs.core.async.impl.channels.ManyToManyChannel.cljs$lang$ctorPrWriter = (function (this__5287__auto__,writer__5288__auto__,opt__5289__auto__){
return cljs.core._write(writer__5288__auto__,"cljs.core.async.impl.channels/ManyToManyChannel");
}));
/**
* Positional factory function for cljs.core.async.impl.channels/ManyToManyChannel.
*/
cljs.core.async.impl.channels.__GT_ManyToManyChannel = (function cljs$core$async$impl$channels$__GT_ManyToManyChannel(takes,dirty_takes,puts,dirty_puts,buf,closed,add_BANG_){
return (new cljs.core.async.impl.channels.ManyToManyChannel(takes,dirty_takes,puts,dirty_puts,buf,closed,add_BANG_));
});
cljs.core.async.impl.channels.ex_handler = (function cljs$core$async$impl$channels$ex_handler(ex){
console.log(ex);
return null;
});
cljs.core.async.impl.channels.handle = (function cljs$core$async$impl$channels$handle(buf,exh,t){
var else$ = (function (){var fexpr__21984 = (function (){var or__5002__auto__ = exh;
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__auto__;
} else {
return cljs.core.async.impl.channels.ex_handler;
}
})();
return (fexpr__21984.cljs$core$IFn$_invoke$arity$1 ? fexpr__21984.cljs$core$IFn$_invoke$arity$1(t) : fexpr__21984.call(null, t));
})();
if((else$ == null)){
return buf;
} else {
return cljs.core.async.impl.protocols.add_BANG_.cljs$core$IFn$_invoke$arity$2(buf,else$);
}
});
cljs.core.async.impl.channels.chan = (function cljs$core$async$impl$channels$chan(var_args){
var G__21991 = arguments.length;
switch (G__21991) {
case 1:
return cljs.core.async.impl.channels.chan.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
break;
case 2:
return cljs.core.async.impl.channels.chan.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
break;
case 3:
return cljs.core.async.impl.channels.chan.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));
break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
}
});
(cljs.core.async.impl.channels.chan.cljs$core$IFn$_invoke$arity$1 = (function (buf){
return cljs.core.async.impl.channels.chan.cljs$core$IFn$_invoke$arity$2(buf,null);
}));
(cljs.core.async.impl.channels.chan.cljs$core$IFn$_invoke$arity$2 = (function (buf,xform){
return cljs.core.async.impl.channels.chan.cljs$core$IFn$_invoke$arity$3(buf,xform,null);
}));
(cljs.core.async.impl.channels.chan.cljs$core$IFn$_invoke$arity$3 = (function (buf,xform,exh){
return (new cljs.core.async.impl.channels.ManyToManyChannel(cljs.core.async.impl.buffers.ring_buffer((32)),(0),cljs.core.async.impl.buffers.ring_buffer((32)),(0),buf,false,(function (){var add_BANG_ = (cljs.core.truth_(xform)?(xform.cljs$core$IFn$_invoke$arity$1 ? xform.cljs$core$IFn$_invoke$arity$1(cljs.core.async.impl.protocols.add_BANG_) : xform.call(null, cljs.core.async.impl.protocols.add_BANG_)):cljs.core.async.impl.protocols.add_BANG_);
return (function() {
var G__22213 = null;
var G__22213__1 = (function (buf__$1){
try{return (add_BANG_.cljs$core$IFn$_invoke$arity$1 ? add_BANG_.cljs$core$IFn$_invoke$arity$1(buf__$1) : add_BANG_.call(null, buf__$1));
}catch (e22006){var t = e22006;
return cljs.core.async.impl.channels.handle(buf__$1,exh,t);
}});
var G__22213__2 = (function (buf__$1,val){
try{return (add_BANG_.cljs$core$IFn$_invoke$arity$2 ? add_BANG_.cljs$core$IFn$_invoke$arity$2(buf__$1,val) : add_BANG_.call(null, buf__$1,val));
}catch (e22007){var t = e22007;
return cljs.core.async.impl.channels.handle(buf__$1,exh,t);
}});
G__22213 = function(buf__$1,val){
switch(arguments.length){
case 1:
return G__22213__1.call(this,buf__$1);
case 2:
return G__22213__2.call(this,buf__$1,val);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
G__22213.cljs$core$IFn$_invoke$arity$1 = G__22213__1;
G__22213.cljs$core$IFn$_invoke$arity$2 = G__22213__2;
return G__22213;
})()
})()));
}));
(cljs.core.async.impl.channels.chan.cljs$lang$maxFixedArity = 3);
//# sourceMappingURL=cljs.core.async.impl.channels.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,54 @@
goog.provide('cljs.core.async.impl.dispatch');
cljs.core.async.impl.dispatch.tasks = cljs.core.async.impl.buffers.ring_buffer((32));
cljs.core.async.impl.dispatch.running_QMARK_ = false;
cljs.core.async.impl.dispatch.queued_QMARK_ = false;
cljs.core.async.impl.dispatch.TASK_BATCH_SIZE = (1024);
cljs.core.async.impl.dispatch.process_messages = (function cljs$core$async$impl$dispatch$process_messages(){
(cljs.core.async.impl.dispatch.running_QMARK_ = true);
(cljs.core.async.impl.dispatch.queued_QMARK_ = false);
var count_21745 = (0);
while(true){
var m_21746 = cljs.core.async.impl.dispatch.tasks.pop();
if((m_21746 == null)){
} else {
(m_21746.cljs$core$IFn$_invoke$arity$0 ? m_21746.cljs$core$IFn$_invoke$arity$0() : m_21746.call(null, ));
if((count_21745 < cljs.core.async.impl.dispatch.TASK_BATCH_SIZE)){
var G__21748 = (count_21745 + (1));
count_21745 = G__21748;
continue;
} else {
}
}
break;
}
(cljs.core.async.impl.dispatch.running_QMARK_ = false);
if((cljs.core.async.impl.dispatch.tasks.length > (0))){
return (cljs.core.async.impl.dispatch.queue_dispatcher.cljs$core$IFn$_invoke$arity$0 ? cljs.core.async.impl.dispatch.queue_dispatcher.cljs$core$IFn$_invoke$arity$0() : cljs.core.async.impl.dispatch.queue_dispatcher.call(null, ));
} else {
return null;
}
});
cljs.core.async.impl.dispatch.queue_dispatcher = (function cljs$core$async$impl$dispatch$queue_dispatcher(){
if(((cljs.core.async.impl.dispatch.queued_QMARK_) && (cljs.core.async.impl.dispatch.running_QMARK_))){
return null;
} else {
(cljs.core.async.impl.dispatch.queued_QMARK_ = true);
return goog.async.nextTick(cljs.core.async.impl.dispatch.process_messages);
}
});
cljs.core.async.impl.dispatch.run = (function cljs$core$async$impl$dispatch$run(f){
cljs.core.async.impl.dispatch.tasks.unbounded_unshift(f);
return cljs.core.async.impl.dispatch.queue_dispatcher();
});
cljs.core.async.impl.dispatch.queue_delay = (function cljs$core$async$impl$dispatch$queue_delay(f,delay){
return setTimeout(f,delay);
});
//# sourceMappingURL=cljs.core.async.impl.dispatch.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["cljs/core/async/impl/dispatch.cljs"],"mappings":";AAYA,AAAKA,sCAAM,yCAAA,zCAACC;AACZ,+CAAA,/CAAKC;AACL,8CAAA,9CAAKC;AAEL,gDAAA,hDAAKC;AAEL,AAAA,AAEA,iDAAA,jDAAMC;AAAN,AACE,gDAAA,/CAAMH;;AACN,+CAAA,9CAAMC;;AACN,kBAAA,dAAOG;;AAAP,AACE,IAAMC,UAAE,AAAMP;AAAd,AACE,GAAU,YAAA,XAAMO;AAAhB;AAAA,AACE,CAACA,wCAAAA,0CAAAA;;AACD,GAAM,CAAGD,cAAMF;AAAf,AACE,eAAO,eAAA,dAAKE;;;;AADd;;;;;AAEN,gDAAA,/CAAMJ;;AACN,GAAM,8CAAA,7CAAG,AAAUF;AAAnB,AACE,QAACQ,+EAAAA,iFAAAA;;AADH;;;AAGF,iDAAA,jDAAMA;AAAN,AACE,GAAU,EAAKL,iDAAQD;AAAvB;;AAAA,AACE,+CAAA,9CAAMC;;AACN,OAACM,oBAAoBJ;;;AAEzB,oCAAA,pCAAMK,gFAAKC;AAAX,AACE,AAAoBX,sDAAMW;;AAC1B,OAACH;;AAEH,4CAAA,5CAAMI,gGAAaD,EAAEE;AAArB,AACE,OAACC,WAAcH,EAAEE","names":["cljs.core.async.impl.dispatch/tasks","cljs.core.async.impl.buffers/ring-buffer","cljs.core.async.impl.dispatch/running?","cljs.core.async.impl.dispatch/queued?","cljs.core.async.impl.dispatch/TASK_BATCH_SIZE","cljs.core.async.impl.dispatch/process-messages","count","m","cljs.core.async.impl.dispatch/queue-dispatcher","js/goog.async.nextTick","cljs.core.async.impl.dispatch/run","f","cljs.core.async.impl.dispatch/queue-delay","delay","js/setTimeout"],"sourcesContent":[";; Copyright (c) Rich Hickey and contributors. All rights reserved.\n;; The use and distribution terms for this software are covered by the\n;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)\n;; which can be found in the file epl-v10.html at the root of this distribution.\n;; By using this software in any fashion, you are agreeing to be bound by\n;; the terms of this license.\n;; You must not remove this notice, or any other, from this software.\n\n(ns cljs.core.async.impl.dispatch\n (:require [cljs.core.async.impl.buffers :as buffers]\n [goog.async.nextTick]))\n\n(def tasks (buffers/ring-buffer 32))\n(def running? false)\n(def queued? false)\n\n(def TASK_BATCH_SIZE 1024)\n\n(declare queue-dispatcher)\n\n(defn process-messages []\n (set! running? true)\n (set! queued? false)\n (loop [count 0]\n (let [m (.pop tasks)]\n (when-not (nil? m)\n (m)\n (when (< count TASK_BATCH_SIZE)\n (recur (inc count))))))\n (set! running? false)\n (when (> (.-length tasks) 0)\n (queue-dispatcher)))\n\n(defn queue-dispatcher []\n (when-not (and queued? running?)\n (set! queued? true)\n (goog.async.nextTick process-messages)))\n\n(defn run [f]\n (.unbounded-unshift tasks f)\n (queue-dispatcher))\n\n(defn queue-delay [f delay]\n (js/setTimeout f delay))\n\n"],"x_google_ignoreList":[0]}

View File

@@ -0,0 +1,165 @@
goog.provide('cljs.core.async.impl.ioc_helpers');
cljs.core.async.impl.ioc_helpers.FN_IDX = (0);
cljs.core.async.impl.ioc_helpers.STATE_IDX = (1);
cljs.core.async.impl.ioc_helpers.VALUE_IDX = (2);
cljs.core.async.impl.ioc_helpers.BINDINGS_IDX = (3);
cljs.core.async.impl.ioc_helpers.EXCEPTION_FRAMES = (4);
cljs.core.async.impl.ioc_helpers.CURRENT_EXCEPTION = (5);
cljs.core.async.impl.ioc_helpers.USER_START_IDX = (6);
cljs.core.async.impl.ioc_helpers.aset_object = (function cljs$core$async$impl$ioc_helpers$aset_object(arr,idx,o){
return (arr[idx][o]);
});
cljs.core.async.impl.ioc_helpers.aget_object = (function cljs$core$async$impl$ioc_helpers$aget_object(arr,idx){
return (arr[idx]);
});
/**
* Returns true if the machine is in a finished state
*/
cljs.core.async.impl.ioc_helpers.finished_QMARK_ = (function cljs$core$async$impl$ioc_helpers$finished_QMARK_(state_array){
return cljs.core.keyword_identical_QMARK_((state_array[(1)]),new cljs.core.Keyword(null,"finished","finished",-1018867731));
});
/**
* @constructor
* @implements {cljs.core.async.impl.protocols.Handler}
* @implements {cljs.core.IMeta}
* @implements {cljs.core.IWithMeta}
*/
cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers21600 = (function (f,meta21601){
this.f = f;
this.meta21601 = meta21601;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
(cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers21600.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_21602,meta21601__$1){
var self__ = this;
var _21602__$1 = this;
return (new cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers21600(self__.f,meta21601__$1));
}));
(cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers21600.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_21602){
var self__ = this;
var _21602__$1 = this;
return self__.meta21601;
}));
(cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers21600.prototype.cljs$core$async$impl$protocols$Handler$ = cljs.core.PROTOCOL_SENTINEL);
(cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers21600.prototype.cljs$core$async$impl$protocols$Handler$active_QMARK_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return true;
}));
(cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers21600.prototype.cljs$core$async$impl$protocols$Handler$blockable_QMARK_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return true;
}));
(cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers21600.prototype.cljs$core$async$impl$protocols$Handler$commit$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return self__.f;
}));
(cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers21600.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"f","f",43394975,null),new cljs.core.Symbol(null,"meta21601","meta21601",2086909939,null)], null);
}));
(cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers21600.cljs$lang$type = true);
(cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers21600.cljs$lang$ctorStr = "cljs.core.async.impl.ioc-helpers/t_cljs$core$async$impl$ioc_helpers21600");
(cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers21600.cljs$lang$ctorPrWriter = (function (this__5287__auto__,writer__5288__auto__,opt__5289__auto__){
return cljs.core._write(writer__5288__auto__,"cljs.core.async.impl.ioc-helpers/t_cljs$core$async$impl$ioc_helpers21600");
}));
/**
* Positional factory function for cljs.core.async.impl.ioc-helpers/t_cljs$core$async$impl$ioc_helpers21600.
*/
cljs.core.async.impl.ioc_helpers.__GT_t_cljs$core$async$impl$ioc_helpers21600 = (function cljs$core$async$impl$ioc_helpers$__GT_t_cljs$core$async$impl$ioc_helpers21600(f,meta21601){
return (new cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers21600(f,meta21601));
});
cljs.core.async.impl.ioc_helpers.fn_handler = (function cljs$core$async$impl$ioc_helpers$fn_handler(f){
return (new cljs.core.async.impl.ioc_helpers.t_cljs$core$async$impl$ioc_helpers21600(f,cljs.core.PersistentArrayMap.EMPTY));
});
cljs.core.async.impl.ioc_helpers.run_state_machine = (function cljs$core$async$impl$ioc_helpers$run_state_machine(state){
var fexpr__21641 = cljs.core.async.impl.ioc_helpers.aget_object(state,(0));
return (fexpr__21641.cljs$core$IFn$_invoke$arity$1 ? fexpr__21641.cljs$core$IFn$_invoke$arity$1(state) : fexpr__21641.call(null, state));
});
cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped = (function cljs$core$async$impl$ioc_helpers$run_state_machine_wrapped(state){
try{return cljs.core.async.impl.ioc_helpers.run_state_machine(state);
}catch (e21644){if((e21644 instanceof Object)){
var ex = e21644;
cljs.core.async.impl.ioc_helpers.aget_object(state,(6)).cljs$core$async$impl$protocols$Channel$close_BANG_$arity$1(null, );
throw ex;
} else {
throw e21644;
}
}});
cljs.core.async.impl.ioc_helpers.take_BANG_ = (function cljs$core$async$impl$ioc_helpers$take_BANG_(state,blk,c){
var temp__5802__auto__ = c.cljs$core$async$impl$protocols$ReadPort$take_BANG_$arity$2(null, cljs.core.async.impl.ioc_helpers.fn_handler((function (x){
var statearr_21649_21695 = state;
(statearr_21649_21695[(2)] = x);
(statearr_21649_21695[(1)] = blk);
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped(state);
})));
if(cljs.core.truth_(temp__5802__auto__)){
var cb = temp__5802__auto__;
var statearr_21652_21704 = state;
(statearr_21652_21704[(2)] = cljs.core.deref(cb));
(statearr_21652_21704[(1)] = blk);
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
});
cljs.core.async.impl.ioc_helpers.put_BANG_ = (function cljs$core$async$impl$ioc_helpers$put_BANG_(state,blk,c,val){
var temp__5802__auto__ = c.cljs$core$async$impl$protocols$WritePort$put_BANG_$arity$3(null, val,cljs.core.async.impl.ioc_helpers.fn_handler((function (ret_val){
var statearr_21659_21706 = state;
(statearr_21659_21706[(2)] = ret_val);
(statearr_21659_21706[(1)] = blk);
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped(state);
})));
if(cljs.core.truth_(temp__5802__auto__)){
var cb = temp__5802__auto__;
var statearr_21662_21709 = state;
(statearr_21662_21709[(2)] = cljs.core.deref(cb));
(statearr_21662_21709[(1)] = blk);
return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
});
cljs.core.async.impl.ioc_helpers.return_chan = (function cljs$core$async$impl$ioc_helpers$return_chan(state,value){
var c = (state[(6)]);
if((value == null)){
} else {
c.cljs$core$async$impl$protocols$WritePort$put_BANG_$arity$3(null, value,cljs.core.async.impl.ioc_helpers.fn_handler((function (_){
return null;
})));
}
c.cljs$core$async$impl$protocols$Channel$close_BANG_$arity$1(null, );
return c;
});
//# sourceMappingURL=cljs.core.async.impl.ioc_helpers.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,342 @@
goog.provide('cljs.core.async.impl.protocols');
cljs.core.async.impl.protocols.MAX_QUEUE_SIZE = (1024);
/**
* @interface
*/
cljs.core.async.impl.protocols.ReadPort = function(){};
var cljs$core$async$impl$protocols$ReadPort$take_BANG_$dyn_19863 = (function (port,fn1_handler){
var x__5350__auto__ = (((port == null))?null:port);
var m__5351__auto__ = (cljs.core.async.impl.protocols.take_BANG_[goog.typeOf(x__5350__auto__)]);
if((!((m__5351__auto__ == null)))){
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$2 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$2(port,fn1_handler) : m__5351__auto__.call(null, port,fn1_handler));
} else {
var m__5349__auto__ = (cljs.core.async.impl.protocols.take_BANG_["_"]);
if((!((m__5349__auto__ == null)))){
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$2 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$2(port,fn1_handler) : m__5349__auto__.call(null, port,fn1_handler));
} else {
throw cljs.core.missing_protocol("ReadPort.take!",port);
}
}
});
/**
* derefable val if taken, nil if take was enqueued
*/
cljs.core.async.impl.protocols.take_BANG_ = (function cljs$core$async$impl$protocols$take_BANG_(port,fn1_handler){
if((((!((port == null)))) && ((!((port.cljs$core$async$impl$protocols$ReadPort$take_BANG_$arity$2 == null)))))){
return port.cljs$core$async$impl$protocols$ReadPort$take_BANG_$arity$2(port,fn1_handler);
} else {
return cljs$core$async$impl$protocols$ReadPort$take_BANG_$dyn_19863(port,fn1_handler);
}
});
/**
* @interface
*/
cljs.core.async.impl.protocols.WritePort = function(){};
var cljs$core$async$impl$protocols$WritePort$put_BANG_$dyn_19876 = (function (port,val,fn1_handler){
var x__5350__auto__ = (((port == null))?null:port);
var m__5351__auto__ = (cljs.core.async.impl.protocols.put_BANG_[goog.typeOf(x__5350__auto__)]);
if((!((m__5351__auto__ == null)))){
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$3 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$3(port,val,fn1_handler) : m__5351__auto__.call(null, port,val,fn1_handler));
} else {
var m__5349__auto__ = (cljs.core.async.impl.protocols.put_BANG_["_"]);
if((!((m__5349__auto__ == null)))){
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$3 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$3(port,val,fn1_handler) : m__5349__auto__.call(null, port,val,fn1_handler));
} else {
throw cljs.core.missing_protocol("WritePort.put!",port);
}
}
});
/**
* derefable boolean (false if already closed) if handled, nil if put was enqueued.
* Must throw on nil val.
*/
cljs.core.async.impl.protocols.put_BANG_ = (function cljs$core$async$impl$protocols$put_BANG_(port,val,fn1_handler){
if((((!((port == null)))) && ((!((port.cljs$core$async$impl$protocols$WritePort$put_BANG_$arity$3 == null)))))){
return port.cljs$core$async$impl$protocols$WritePort$put_BANG_$arity$3(port,val,fn1_handler);
} else {
return cljs$core$async$impl$protocols$WritePort$put_BANG_$dyn_19876(port,val,fn1_handler);
}
});
/**
* @interface
*/
cljs.core.async.impl.protocols.Channel = function(){};
var cljs$core$async$impl$protocols$Channel$close_BANG_$dyn_19884 = (function (chan){
var x__5350__auto__ = (((chan == null))?null:chan);
var m__5351__auto__ = (cljs.core.async.impl.protocols.close_BANG_[goog.typeOf(x__5350__auto__)]);
if((!((m__5351__auto__ == null)))){
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$1(chan) : m__5351__auto__.call(null, chan));
} else {
var m__5349__auto__ = (cljs.core.async.impl.protocols.close_BANG_["_"]);
if((!((m__5349__auto__ == null)))){
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$1(chan) : m__5349__auto__.call(null, chan));
} else {
throw cljs.core.missing_protocol("Channel.close!",chan);
}
}
});
cljs.core.async.impl.protocols.close_BANG_ = (function cljs$core$async$impl$protocols$close_BANG_(chan){
if((((!((chan == null)))) && ((!((chan.cljs$core$async$impl$protocols$Channel$close_BANG_$arity$1 == null)))))){
return chan.cljs$core$async$impl$protocols$Channel$close_BANG_$arity$1(chan);
} else {
return cljs$core$async$impl$protocols$Channel$close_BANG_$dyn_19884(chan);
}
});
var cljs$core$async$impl$protocols$Channel$closed_QMARK_$dyn_19892 = (function (chan){
var x__5350__auto__ = (((chan == null))?null:chan);
var m__5351__auto__ = (cljs.core.async.impl.protocols.closed_QMARK_[goog.typeOf(x__5350__auto__)]);
if((!((m__5351__auto__ == null)))){
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$1(chan) : m__5351__auto__.call(null, chan));
} else {
var m__5349__auto__ = (cljs.core.async.impl.protocols.closed_QMARK_["_"]);
if((!((m__5349__auto__ == null)))){
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$1(chan) : m__5349__auto__.call(null, chan));
} else {
throw cljs.core.missing_protocol("Channel.closed?",chan);
}
}
});
cljs.core.async.impl.protocols.closed_QMARK_ = (function cljs$core$async$impl$protocols$closed_QMARK_(chan){
if((((!((chan == null)))) && ((!((chan.cljs$core$async$impl$protocols$Channel$closed_QMARK_$arity$1 == null)))))){
return chan.cljs$core$async$impl$protocols$Channel$closed_QMARK_$arity$1(chan);
} else {
return cljs$core$async$impl$protocols$Channel$closed_QMARK_$dyn_19892(chan);
}
});
/**
* @interface
*/
cljs.core.async.impl.protocols.Handler = function(){};
var cljs$core$async$impl$protocols$Handler$active_QMARK_$dyn_19908 = (function (h){
var x__5350__auto__ = (((h == null))?null:h);
var m__5351__auto__ = (cljs.core.async.impl.protocols.active_QMARK_[goog.typeOf(x__5350__auto__)]);
if((!((m__5351__auto__ == null)))){
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$1(h) : m__5351__auto__.call(null, h));
} else {
var m__5349__auto__ = (cljs.core.async.impl.protocols.active_QMARK_["_"]);
if((!((m__5349__auto__ == null)))){
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$1(h) : m__5349__auto__.call(null, h));
} else {
throw cljs.core.missing_protocol("Handler.active?",h);
}
}
});
/**
* returns true if has callback. Must work w/o lock
*/
cljs.core.async.impl.protocols.active_QMARK_ = (function cljs$core$async$impl$protocols$active_QMARK_(h){
if((((!((h == null)))) && ((!((h.cljs$core$async$impl$protocols$Handler$active_QMARK_$arity$1 == null)))))){
return h.cljs$core$async$impl$protocols$Handler$active_QMARK_$arity$1(h);
} else {
return cljs$core$async$impl$protocols$Handler$active_QMARK_$dyn_19908(h);
}
});
var cljs$core$async$impl$protocols$Handler$blockable_QMARK_$dyn_19919 = (function (h){
var x__5350__auto__ = (((h == null))?null:h);
var m__5351__auto__ = (cljs.core.async.impl.protocols.blockable_QMARK_[goog.typeOf(x__5350__auto__)]);
if((!((m__5351__auto__ == null)))){
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$1(h) : m__5351__auto__.call(null, h));
} else {
var m__5349__auto__ = (cljs.core.async.impl.protocols.blockable_QMARK_["_"]);
if((!((m__5349__auto__ == null)))){
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$1(h) : m__5349__auto__.call(null, h));
} else {
throw cljs.core.missing_protocol("Handler.blockable?",h);
}
}
});
/**
* returns true if this handler may be blocked, otherwise it must not block
*/
cljs.core.async.impl.protocols.blockable_QMARK_ = (function cljs$core$async$impl$protocols$blockable_QMARK_(h){
if((((!((h == null)))) && ((!((h.cljs$core$async$impl$protocols$Handler$blockable_QMARK_$arity$1 == null)))))){
return h.cljs$core$async$impl$protocols$Handler$blockable_QMARK_$arity$1(h);
} else {
return cljs$core$async$impl$protocols$Handler$blockable_QMARK_$dyn_19919(h);
}
});
var cljs$core$async$impl$protocols$Handler$commit$dyn_19929 = (function (h){
var x__5350__auto__ = (((h == null))?null:h);
var m__5351__auto__ = (cljs.core.async.impl.protocols.commit[goog.typeOf(x__5350__auto__)]);
if((!((m__5351__auto__ == null)))){
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$1(h) : m__5351__auto__.call(null, h));
} else {
var m__5349__auto__ = (cljs.core.async.impl.protocols.commit["_"]);
if((!((m__5349__auto__ == null)))){
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$1(h) : m__5349__auto__.call(null, h));
} else {
throw cljs.core.missing_protocol("Handler.commit",h);
}
}
});
/**
* commit to fulfilling its end of the transfer, returns cb. Must be called within lock
*/
cljs.core.async.impl.protocols.commit = (function cljs$core$async$impl$protocols$commit(h){
if((((!((h == null)))) && ((!((h.cljs$core$async$impl$protocols$Handler$commit$arity$1 == null)))))){
return h.cljs$core$async$impl$protocols$Handler$commit$arity$1(h);
} else {
return cljs$core$async$impl$protocols$Handler$commit$dyn_19929(h);
}
});
/**
* @interface
*/
cljs.core.async.impl.protocols.Buffer = function(){};
var cljs$core$async$impl$protocols$Buffer$full_QMARK_$dyn_19942 = (function (b){
var x__5350__auto__ = (((b == null))?null:b);
var m__5351__auto__ = (cljs.core.async.impl.protocols.full_QMARK_[goog.typeOf(x__5350__auto__)]);
if((!((m__5351__auto__ == null)))){
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$1(b) : m__5351__auto__.call(null, b));
} else {
var m__5349__auto__ = (cljs.core.async.impl.protocols.full_QMARK_["_"]);
if((!((m__5349__auto__ == null)))){
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$1(b) : m__5349__auto__.call(null, b));
} else {
throw cljs.core.missing_protocol("Buffer.full?",b);
}
}
});
/**
* returns true if buffer cannot accept put
*/
cljs.core.async.impl.protocols.full_QMARK_ = (function cljs$core$async$impl$protocols$full_QMARK_(b){
if((((!((b == null)))) && ((!((b.cljs$core$async$impl$protocols$Buffer$full_QMARK_$arity$1 == null)))))){
return b.cljs$core$async$impl$protocols$Buffer$full_QMARK_$arity$1(b);
} else {
return cljs$core$async$impl$protocols$Buffer$full_QMARK_$dyn_19942(b);
}
});
var cljs$core$async$impl$protocols$Buffer$remove_BANG_$dyn_19955 = (function (b){
var x__5350__auto__ = (((b == null))?null:b);
var m__5351__auto__ = (cljs.core.async.impl.protocols.remove_BANG_[goog.typeOf(x__5350__auto__)]);
if((!((m__5351__auto__ == null)))){
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$1(b) : m__5351__auto__.call(null, b));
} else {
var m__5349__auto__ = (cljs.core.async.impl.protocols.remove_BANG_["_"]);
if((!((m__5349__auto__ == null)))){
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$1(b) : m__5349__auto__.call(null, b));
} else {
throw cljs.core.missing_protocol("Buffer.remove!",b);
}
}
});
/**
* remove and return next item from buffer, called under chan mutex
*/
cljs.core.async.impl.protocols.remove_BANG_ = (function cljs$core$async$impl$protocols$remove_BANG_(b){
if((((!((b == null)))) && ((!((b.cljs$core$async$impl$protocols$Buffer$remove_BANG_$arity$1 == null)))))){
return b.cljs$core$async$impl$protocols$Buffer$remove_BANG_$arity$1(b);
} else {
return cljs$core$async$impl$protocols$Buffer$remove_BANG_$dyn_19955(b);
}
});
var cljs$core$async$impl$protocols$Buffer$add_BANG__STAR_$dyn_19972 = (function (b,itm){
var x__5350__auto__ = (((b == null))?null:b);
var m__5351__auto__ = (cljs.core.async.impl.protocols.add_BANG__STAR_[goog.typeOf(x__5350__auto__)]);
if((!((m__5351__auto__ == null)))){
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$2 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$2(b,itm) : m__5351__auto__.call(null, b,itm));
} else {
var m__5349__auto__ = (cljs.core.async.impl.protocols.add_BANG__STAR_["_"]);
if((!((m__5349__auto__ == null)))){
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$2 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$2(b,itm) : m__5349__auto__.call(null, b,itm));
} else {
throw cljs.core.missing_protocol("Buffer.add!*",b);
}
}
});
/**
* if room, add item to the buffer, returns b, called under chan mutex
*/
cljs.core.async.impl.protocols.add_BANG__STAR_ = (function cljs$core$async$impl$protocols$add_BANG__STAR_(b,itm){
if((((!((b == null)))) && ((!((b.cljs$core$async$impl$protocols$Buffer$add_BANG__STAR_$arity$2 == null)))))){
return b.cljs$core$async$impl$protocols$Buffer$add_BANG__STAR_$arity$2(b,itm);
} else {
return cljs$core$async$impl$protocols$Buffer$add_BANG__STAR_$dyn_19972(b,itm);
}
});
var cljs$core$async$impl$protocols$Buffer$close_buf_BANG_$dyn_19984 = (function (b){
var x__5350__auto__ = (((b == null))?null:b);
var m__5351__auto__ = (cljs.core.async.impl.protocols.close_buf_BANG_[goog.typeOf(x__5350__auto__)]);
if((!((m__5351__auto__ == null)))){
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$1(b) : m__5351__auto__.call(null, b));
} else {
var m__5349__auto__ = (cljs.core.async.impl.protocols.close_buf_BANG_["_"]);
if((!((m__5349__auto__ == null)))){
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$1(b) : m__5349__auto__.call(null, b));
} else {
throw cljs.core.missing_protocol("Buffer.close-buf!",b);
}
}
});
/**
* called on chan closed under chan mutex, return ignored
*/
cljs.core.async.impl.protocols.close_buf_BANG_ = (function cljs$core$async$impl$protocols$close_buf_BANG_(b){
if((((!((b == null)))) && ((!((b.cljs$core$async$impl$protocols$Buffer$close_buf_BANG_$arity$1 == null)))))){
return b.cljs$core$async$impl$protocols$Buffer$close_buf_BANG_$arity$1(b);
} else {
return cljs$core$async$impl$protocols$Buffer$close_buf_BANG_$dyn_19984(b);
}
});
cljs.core.async.impl.protocols.add_BANG_ = (function cljs$core$async$impl$protocols$add_BANG_(var_args){
var G__19845 = arguments.length;
switch (G__19845) {
case 1:
return cljs.core.async.impl.protocols.add_BANG_.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
break;
case 2:
return cljs.core.async.impl.protocols.add_BANG_.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
}
});
(cljs.core.async.impl.protocols.add_BANG_.cljs$core$IFn$_invoke$arity$1 = (function (b){
return b;
}));
(cljs.core.async.impl.protocols.add_BANG_.cljs$core$IFn$_invoke$arity$2 = (function (b,itm){
if((!((itm == null)))){
} else {
throw (new Error("Assert failed: (not (nil? itm))"));
}
return cljs.core.async.impl.protocols.add_BANG__STAR_(b,itm);
}));
(cljs.core.async.impl.protocols.add_BANG_.cljs$lang$maxFixedArity = 2);
/**
* @interface
*/
cljs.core.async.impl.protocols.UnblockingBuffer = function(){};
//# sourceMappingURL=cljs.core.async.impl.protocols.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,481 @@
goog.provide('cljs.core.async.impl.timers');
cljs.core.async.impl.timers.MAX_LEVEL = (15);
cljs.core.async.impl.timers.P = ((1) / (2));
cljs.core.async.impl.timers.random_level = (function cljs$core$async$impl$timers$random_level(var_args){
var G__22091 = arguments.length;
switch (G__22091) {
case 0:
return cljs.core.async.impl.timers.random_level.cljs$core$IFn$_invoke$arity$0();
break;
case 1:
return cljs.core.async.impl.timers.random_level.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
}
});
(cljs.core.async.impl.timers.random_level.cljs$core$IFn$_invoke$arity$0 = (function (){
return cljs.core.async.impl.timers.random_level.cljs$core$IFn$_invoke$arity$1((0));
}));
(cljs.core.async.impl.timers.random_level.cljs$core$IFn$_invoke$arity$1 = (function (level){
while(true){
if((((Math.random() < cljs.core.async.impl.timers.P)) && ((level < cljs.core.async.impl.timers.MAX_LEVEL)))){
var G__22297 = (level + (1));
level = G__22297;
continue;
} else {
return level;
}
break;
}
}));
(cljs.core.async.impl.timers.random_level.cljs$lang$maxFixedArity = 1);
/**
* @constructor
* @implements {cljs.core.ISeqable}
* @implements {cljs.core.IPrintWithWriter}
*/
cljs.core.async.impl.timers.SkipListNode = (function (key,val,forward){
this.key = key;
this.val = val;
this.forward = forward;
this.cljs$lang$protocol_mask$partition0$ = 2155872256;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
(cljs.core.async.impl.timers.SkipListNode.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (coll){
var self__ = this;
var coll__$1 = this;
return (new cljs.core.List(null,self__.key,(new cljs.core.List(null,self__.val,null,(1),null)),(2),null));
}));
(cljs.core.async.impl.timers.SkipListNode.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (coll,writer,opts){
var self__ = this;
var coll__$1 = this;
return cljs.core.pr_sequential_writer(writer,cljs.core.pr_writer,"["," ","]",opts,coll__$1);
}));
(cljs.core.async.impl.timers.SkipListNode.getBasis = (function (){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"key","key",124488940,null),cljs.core.with_meta(new cljs.core.Symbol(null,"val","val",1769233139,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null)),new cljs.core.Symbol(null,"forward","forward",1083186224,null)], null);
}));
(cljs.core.async.impl.timers.SkipListNode.cljs$lang$type = true);
(cljs.core.async.impl.timers.SkipListNode.cljs$lang$ctorStr = "cljs.core.async.impl.timers/SkipListNode");
(cljs.core.async.impl.timers.SkipListNode.cljs$lang$ctorPrWriter = (function (this__5287__auto__,writer__5288__auto__,opt__5289__auto__){
return cljs.core._write(writer__5288__auto__,"cljs.core.async.impl.timers/SkipListNode");
}));
/**
* Positional factory function for cljs.core.async.impl.timers/SkipListNode.
*/
cljs.core.async.impl.timers.__GT_SkipListNode = (function cljs$core$async$impl$timers$__GT_SkipListNode(key,val,forward){
return (new cljs.core.async.impl.timers.SkipListNode(key,val,forward));
});
cljs.core.async.impl.timers.skip_list_node = (function cljs$core$async$impl$timers$skip_list_node(var_args){
var G__22164 = arguments.length;
switch (G__22164) {
case 1:
return cljs.core.async.impl.timers.skip_list_node.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
break;
case 3:
return cljs.core.async.impl.timers.skip_list_node.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));
break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
}
});
(cljs.core.async.impl.timers.skip_list_node.cljs$core$IFn$_invoke$arity$1 = (function (level){
return cljs.core.async.impl.timers.skip_list_node.cljs$core$IFn$_invoke$arity$3(null,null,level);
}));
(cljs.core.async.impl.timers.skip_list_node.cljs$core$IFn$_invoke$arity$3 = (function (k,v,level){
var arr = (new Array((level + (1))));
var i_22330 = (0);
while(true){
if((i_22330 < arr.length)){
(arr[i_22330] = null);
var G__22331 = (i_22330 + (1));
i_22330 = G__22331;
continue;
} else {
}
break;
}
return (new cljs.core.async.impl.timers.SkipListNode(k,v,arr));
}));
(cljs.core.async.impl.timers.skip_list_node.cljs$lang$maxFixedArity = 3);
cljs.core.async.impl.timers.least_greater_node = (function cljs$core$async$impl$timers$least_greater_node(var_args){
var G__22197 = arguments.length;
switch (G__22197) {
case 3:
return cljs.core.async.impl.timers.least_greater_node.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));
break;
case 4:
return cljs.core.async.impl.timers.least_greater_node.cljs$core$IFn$_invoke$arity$4((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),(arguments[(3)]));
break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
}
});
(cljs.core.async.impl.timers.least_greater_node.cljs$core$IFn$_invoke$arity$3 = (function (x,k,level){
return cljs.core.async.impl.timers.least_greater_node.cljs$core$IFn$_invoke$arity$4(x,k,level,null);
}));
(cljs.core.async.impl.timers.least_greater_node.cljs$core$IFn$_invoke$arity$4 = (function (x,k,level,update){
while(true){
if((!((level < (0))))){
var x__$1 = (function (){var x__$1 = x;
while(true){
var temp__5802__auto__ = (((level < x__$1.forward.length))?(x__$1.forward[level]):null);
if(cljs.core.truth_(temp__5802__auto__)){
var x_SINGLEQUOTE_ = temp__5802__auto__;
if((x_SINGLEQUOTE_.key < k)){
var G__22349 = x_SINGLEQUOTE_;
x__$1 = G__22349;
continue;
} else {
return x__$1;
}
} else {
return x__$1;
}
break;
}
})();
if((update == null)){
} else {
(update[level] = x__$1);
}
var G__22351 = x__$1;
var G__22352 = k;
var G__22353 = (level - (1));
var G__22354 = update;
x = G__22351;
k = G__22352;
level = G__22353;
update = G__22354;
continue;
} else {
return x;
}
break;
}
}));
(cljs.core.async.impl.timers.least_greater_node.cljs$lang$maxFixedArity = 4);
/**
* @constructor
* @implements {cljs.core.ISeqable}
* @implements {cljs.core.IPrintWithWriter}
*/
cljs.core.async.impl.timers.SkipList = (function (header,level){
this.header = header;
this.level = level;
this.cljs$lang$protocol_mask$partition0$ = 2155872256;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
(cljs.core.async.impl.timers.SkipList.prototype.put = (function (k,v){
var self__ = this;
var coll = this;
var update = (new Array(cljs.core.async.impl.timers.MAX_LEVEL));
var x = cljs.core.async.impl.timers.least_greater_node.cljs$core$IFn$_invoke$arity$4(self__.header,k,self__.level,update);
var x__$1 = (x.forward[(0)]);
if((((!((x__$1 == null)))) && ((x__$1.key === k)))){
return (x__$1.val = v);
} else {
var new_level = cljs.core.async.impl.timers.random_level.cljs$core$IFn$_invoke$arity$0();
if((new_level > self__.level)){
var i_22359 = (self__.level + (1));
while(true){
if((i_22359 <= (new_level + (1)))){
(update[i_22359] = self__.header);
var G__22363 = (i_22359 + (1));
i_22359 = G__22363;
continue;
} else {
}
break;
}
(self__.level = new_level);
} else {
}
var x__$2 = cljs.core.async.impl.timers.skip_list_node.cljs$core$IFn$_invoke$arity$3(k,v,(new Array(new_level)));
var i = (0);
while(true){
if((i <= self__.level)){
var links_22372 = (update[i]).forward;
if((i < x__$2.forward.length)){
(x__$2.forward[i] = (links_22372[i]));
} else {
x__$2.forward.push((((i < links_22372.length))?(links_22372[i]):null));
}
if((i < links_22372.length)){
(links_22372[i] = x__$2);
} else {
links_22372.push(x__$2);
}
var G__22392 = (i + (1));
i = G__22392;
continue;
} else {
return null;
}
break;
}
}
}));
(cljs.core.async.impl.timers.SkipList.prototype.remove = (function (k){
var self__ = this;
var coll = this;
var update = (new Array(cljs.core.async.impl.timers.MAX_LEVEL));
var x = cljs.core.async.impl.timers.least_greater_node.cljs$core$IFn$_invoke$arity$4(self__.header,k,self__.level,update);
var x__$1 = (((x.forward.length === (0)))?null:(x.forward[(0)]));
if((((!((x__$1 == null)))) && ((x__$1.key === k)))){
var i_22401 = (0);
while(true){
if((i_22401 <= self__.level)){
var links_22402 = (update[i_22401]).forward;
if((x__$1 === (((i_22401 < links_22402.length))?(links_22402[i_22401]):null))){
(links_22402[i_22401] = (x__$1.forward[i_22401]));
var G__22415 = (i_22401 + (1));
i_22401 = G__22415;
continue;
} else {
var G__22416 = (i_22401 + (1));
i_22401 = G__22416;
continue;
}
} else {
}
break;
}
while(true){
if(((((((0) < self__.level)) && ((self__.level < self__.header.forward.length)))) && (((self__.header.forward[self__.level]) == null)))){
(self__.level = (self__.level - (1)));
continue;
} else {
return null;
}
break;
}
} else {
return null;
}
}));
(cljs.core.async.impl.timers.SkipList.prototype.ceilingEntry = (function (k){
var self__ = this;
var coll = this;
var x = self__.header;
var level__$1 = self__.level;
while(true){
if((!((level__$1 < (0))))){
var nx = (function (){var x__$1 = x;
while(true){
var x_SINGLEQUOTE_ = (((level__$1 < x__$1.forward.length))?(x__$1.forward[level__$1]):null);
if((!((x_SINGLEQUOTE_ == null)))){
if((x_SINGLEQUOTE_.key > k)){
return x__$1;
} else {
var G__22448 = x_SINGLEQUOTE_;
x__$1 = G__22448;
continue;
}
} else {
if((level__$1 === (0))){
return x__$1;
} else {
return null;
}
}
break;
}
})();
if(cljs.core.truth_(nx)){
var G__22451 = nx;
var G__22452 = (level__$1 - (1));
x = G__22451;
level__$1 = G__22452;
continue;
} else {
var G__22454 = x;
var G__22455 = (level__$1 - (1));
x = G__22454;
level__$1 = G__22455;
continue;
}
} else {
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(x.key,k)){
return x;
} else {
return (x.forward[(0)]);
}
}
break;
}
}));
(cljs.core.async.impl.timers.SkipList.prototype.floorEntry = (function (k){
var self__ = this;
var coll = this;
var x = self__.header;
var level__$1 = self__.level;
while(true){
if((!((level__$1 < (0))))){
var nx = (function (){var x__$1 = x;
while(true){
var x_SINGLEQUOTE_ = (((level__$1 < x__$1.forward.length))?(x__$1.forward[level__$1]):null);
if((!((x_SINGLEQUOTE_ == null)))){
if((x_SINGLEQUOTE_.key > k)){
return x__$1;
} else {
var G__22470 = x_SINGLEQUOTE_;
x__$1 = G__22470;
continue;
}
} else {
if((level__$1 === (0))){
return x__$1;
} else {
return null;
}
}
break;
}
})();
if(cljs.core.truth_(nx)){
var G__22473 = nx;
var G__22474 = (level__$1 - (1));
x = G__22473;
level__$1 = G__22474;
continue;
} else {
var G__22477 = x;
var G__22478 = (level__$1 - (1));
x = G__22477;
level__$1 = G__22478;
continue;
}
} else {
if((x === self__.header)){
return null;
} else {
return x;
}
}
break;
}
}));
(cljs.core.async.impl.timers.SkipList.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (coll){
var self__ = this;
var coll__$1 = this;
var iter = (function cljs$core$async$impl$timers$iter(node){
return (new cljs.core.LazySeq(null,(function (){
if((node == null)){
return null;
} else {
return cljs.core.cons(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [node.key,node.val], null),cljs$core$async$impl$timers$iter((node.forward[(0)])));
}
}),null,null));
});
return iter((self__.header.forward[(0)]));
}));
(cljs.core.async.impl.timers.SkipList.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (coll,writer,opts){
var self__ = this;
var coll__$1 = this;
var pr_pair = (function (keyval){
return cljs.core.pr_sequential_writer(writer,cljs.core.pr_writer,""," ","",opts,keyval);
});
return cljs.core.pr_sequential_writer(writer,pr_pair,"{",", ","}",opts,coll__$1);
}));
(cljs.core.async.impl.timers.SkipList.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"header","header",1759972661,null),cljs.core.with_meta(new cljs.core.Symbol(null,"level","level",-1363938217,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null))], null);
}));
(cljs.core.async.impl.timers.SkipList.cljs$lang$type = true);
(cljs.core.async.impl.timers.SkipList.cljs$lang$ctorStr = "cljs.core.async.impl.timers/SkipList");
(cljs.core.async.impl.timers.SkipList.cljs$lang$ctorPrWriter = (function (this__5287__auto__,writer__5288__auto__,opt__5289__auto__){
return cljs.core._write(writer__5288__auto__,"cljs.core.async.impl.timers/SkipList");
}));
/**
* Positional factory function for cljs.core.async.impl.timers/SkipList.
*/
cljs.core.async.impl.timers.__GT_SkipList = (function cljs$core$async$impl$timers$__GT_SkipList(header,level){
return (new cljs.core.async.impl.timers.SkipList(header,level));
});
cljs.core.async.impl.timers.skip_list = (function cljs$core$async$impl$timers$skip_list(){
return (new cljs.core.async.impl.timers.SkipList(cljs.core.async.impl.timers.skip_list_node.cljs$core$IFn$_invoke$arity$1((0)),(0)));
});
cljs.core.async.impl.timers.timeouts_map = cljs.core.async.impl.timers.skip_list();
cljs.core.async.impl.timers.TIMEOUT_RESOLUTION_MS = (10);
/**
* returns a channel that will close after msecs
*/
cljs.core.async.impl.timers.timeout = (function cljs$core$async$impl$timers$timeout(msecs){
var timeout = ((new Date()).valueOf() + msecs);
var me = cljs.core.async.impl.timers.timeouts_map.ceilingEntry(timeout);
var or__5002__auto__ = (cljs.core.truth_((function (){var and__5000__auto__ = me;
if(cljs.core.truth_(and__5000__auto__)){
return (me.key < (timeout + cljs.core.async.impl.timers.TIMEOUT_RESOLUTION_MS));
} else {
return and__5000__auto__;
}
})())?me.val:null);
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__auto__;
} else {
var timeout_channel = cljs.core.async.impl.channels.chan.cljs$core$IFn$_invoke$arity$1(null);
cljs.core.async.impl.timers.timeouts_map.put(timeout,timeout_channel);
cljs.core.async.impl.dispatch.queue_delay((function (){
cljs.core.async.impl.timers.timeouts_map.remove(timeout);
return cljs.core.async.impl.protocols.close_BANG_(timeout_channel);
}),msecs);
return timeout_channel;
}
});
//# sourceMappingURL=cljs.core.async.impl.timers.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,629 @@
goog.provide('cljs.repl');
cljs.repl.print_doc = (function cljs$repl$print_doc(p__26281){
var map__26282 = p__26281;
var map__26282__$1 = cljs.core.__destructure_map(map__26282);
var m = map__26282__$1;
var n = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26282__$1,new cljs.core.Keyword(null,"ns","ns",441598760));
var nm = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26282__$1,new cljs.core.Keyword(null,"name","name",1843675177));
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["-------------------------"], 0));
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([(function (){var or__5002__auto__ = new cljs.core.Keyword(null,"spec","spec",347520401).cljs$core$IFn$_invoke$arity$1(m);
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__auto__;
} else {
return [(function (){var temp__5804__auto__ = new cljs.core.Keyword(null,"ns","ns",441598760).cljs$core$IFn$_invoke$arity$1(m);
if(cljs.core.truth_(temp__5804__auto__)){
var ns = temp__5804__auto__;
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(ns),"/"].join('');
} else {
return null;
}
})(),cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"name","name",1843675177).cljs$core$IFn$_invoke$arity$1(m))].join('');
}
})()], 0));
if(cljs.core.truth_(new cljs.core.Keyword(null,"protocol","protocol",652470118).cljs$core$IFn$_invoke$arity$1(m))){
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["Protocol"], 0));
} else {
}
if(cljs.core.truth_(new cljs.core.Keyword(null,"forms","forms",2045992350).cljs$core$IFn$_invoke$arity$1(m))){
var seq__26303_26741 = cljs.core.seq(new cljs.core.Keyword(null,"forms","forms",2045992350).cljs$core$IFn$_invoke$arity$1(m));
var chunk__26304_26742 = null;
var count__26305_26743 = (0);
var i__26306_26744 = (0);
while(true){
if((i__26306_26744 < count__26305_26743)){
var f_26750 = chunk__26304_26742.cljs$core$IIndexed$_nth$arity$2(null, i__26306_26744);
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",f_26750], 0));
var G__26752 = seq__26303_26741;
var G__26753 = chunk__26304_26742;
var G__26754 = count__26305_26743;
var G__26755 = (i__26306_26744 + (1));
seq__26303_26741 = G__26752;
chunk__26304_26742 = G__26753;
count__26305_26743 = G__26754;
i__26306_26744 = G__26755;
continue;
} else {
var temp__5804__auto___26756 = cljs.core.seq(seq__26303_26741);
if(temp__5804__auto___26756){
var seq__26303_26757__$1 = temp__5804__auto___26756;
if(cljs.core.chunked_seq_QMARK_(seq__26303_26757__$1)){
var c__5525__auto___26758 = cljs.core.chunk_first(seq__26303_26757__$1);
var G__26759 = cljs.core.chunk_rest(seq__26303_26757__$1);
var G__26760 = c__5525__auto___26758;
var G__26761 = cljs.core.count(c__5525__auto___26758);
var G__26762 = (0);
seq__26303_26741 = G__26759;
chunk__26304_26742 = G__26760;
count__26305_26743 = G__26761;
i__26306_26744 = G__26762;
continue;
} else {
var f_26763 = cljs.core.first(seq__26303_26757__$1);
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",f_26763], 0));
var G__26766 = cljs.core.next(seq__26303_26757__$1);
var G__26767 = null;
var G__26768 = (0);
var G__26769 = (0);
seq__26303_26741 = G__26766;
chunk__26304_26742 = G__26767;
count__26305_26743 = G__26768;
i__26306_26744 = G__26769;
continue;
}
} else {
}
}
break;
}
} else {
if(cljs.core.truth_(new cljs.core.Keyword(null,"arglists","arglists",1661989754).cljs$core$IFn$_invoke$arity$1(m))){
var arglists_26771 = new cljs.core.Keyword(null,"arglists","arglists",1661989754).cljs$core$IFn$_invoke$arity$1(m);
if(cljs.core.truth_((function (){var or__5002__auto__ = new cljs.core.Keyword(null,"macro","macro",-867863404).cljs$core$IFn$_invoke$arity$1(m);
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__auto__;
} else {
return new cljs.core.Keyword(null,"repl-special-function","repl-special-function",1262603725).cljs$core$IFn$_invoke$arity$1(m);
}
})())){
cljs.core.prn.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([arglists_26771], 0));
} else {
cljs.core.prn.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(new cljs.core.Symbol(null,"quote","quote",1377916282,null),cljs.core.first(arglists_26771)))?cljs.core.second(arglists_26771):arglists_26771)], 0));
}
} else {
}
}
if(cljs.core.truth_(new cljs.core.Keyword(null,"special-form","special-form",-1326536374).cljs$core$IFn$_invoke$arity$1(m))){
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["Special Form"], 0));
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",new cljs.core.Keyword(null,"doc","doc",1913296891).cljs$core$IFn$_invoke$arity$1(m)], 0));
if(cljs.core.contains_QMARK_(m,new cljs.core.Keyword(null,"url","url",276297046))){
if(cljs.core.truth_(new cljs.core.Keyword(null,"url","url",276297046).cljs$core$IFn$_invoke$arity$1(m))){
return cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([["\n Please see http://clojure.org/",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"url","url",276297046).cljs$core$IFn$_invoke$arity$1(m))].join('')], 0));
} else {
return null;
}
} else {
return cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([["\n Please see http://clojure.org/special_forms#",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"name","name",1843675177).cljs$core$IFn$_invoke$arity$1(m))].join('')], 0));
}
} else {
if(cljs.core.truth_(new cljs.core.Keyword(null,"macro","macro",-867863404).cljs$core$IFn$_invoke$arity$1(m))){
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["Macro"], 0));
} else {
}
if(cljs.core.truth_(new cljs.core.Keyword(null,"spec","spec",347520401).cljs$core$IFn$_invoke$arity$1(m))){
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["Spec"], 0));
} else {
}
if(cljs.core.truth_(new cljs.core.Keyword(null,"repl-special-function","repl-special-function",1262603725).cljs$core$IFn$_invoke$arity$1(m))){
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["REPL Special Function"], 0));
} else {
}
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",new cljs.core.Keyword(null,"doc","doc",1913296891).cljs$core$IFn$_invoke$arity$1(m)], 0));
if(cljs.core.truth_(new cljs.core.Keyword(null,"protocol","protocol",652470118).cljs$core$IFn$_invoke$arity$1(m))){
var seq__26325_26778 = cljs.core.seq(new cljs.core.Keyword(null,"methods","methods",453930866).cljs$core$IFn$_invoke$arity$1(m));
var chunk__26327_26779 = null;
var count__26328_26780 = (0);
var i__26329_26781 = (0);
while(true){
if((i__26329_26781 < count__26328_26780)){
var vec__26354_26784 = chunk__26327_26779.cljs$core$IIndexed$_nth$arity$2(null, i__26329_26781);
var name_26785 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__26354_26784,(0),null);
var map__26357_26786 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__26354_26784,(1),null);
var map__26357_26787__$1 = cljs.core.__destructure_map(map__26357_26786);
var doc_26788 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26357_26787__$1,new cljs.core.Keyword(null,"doc","doc",1913296891));
var arglists_26789 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26357_26787__$1,new cljs.core.Keyword(null,"arglists","arglists",1661989754));
cljs.core.println();
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",name_26785], 0));
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",arglists_26789], 0));
if(cljs.core.truth_(doc_26788)){
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",doc_26788], 0));
} else {
}
var G__26799 = seq__26325_26778;
var G__26800 = chunk__26327_26779;
var G__26801 = count__26328_26780;
var G__26802 = (i__26329_26781 + (1));
seq__26325_26778 = G__26799;
chunk__26327_26779 = G__26800;
count__26328_26780 = G__26801;
i__26329_26781 = G__26802;
continue;
} else {
var temp__5804__auto___26806 = cljs.core.seq(seq__26325_26778);
if(temp__5804__auto___26806){
var seq__26325_26807__$1 = temp__5804__auto___26806;
if(cljs.core.chunked_seq_QMARK_(seq__26325_26807__$1)){
var c__5525__auto___26810 = cljs.core.chunk_first(seq__26325_26807__$1);
var G__26813 = cljs.core.chunk_rest(seq__26325_26807__$1);
var G__26814 = c__5525__auto___26810;
var G__26815 = cljs.core.count(c__5525__auto___26810);
var G__26816 = (0);
seq__26325_26778 = G__26813;
chunk__26327_26779 = G__26814;
count__26328_26780 = G__26815;
i__26329_26781 = G__26816;
continue;
} else {
var vec__26364_26818 = cljs.core.first(seq__26325_26807__$1);
var name_26819 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__26364_26818,(0),null);
var map__26367_26820 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__26364_26818,(1),null);
var map__26367_26821__$1 = cljs.core.__destructure_map(map__26367_26820);
var doc_26822 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26367_26821__$1,new cljs.core.Keyword(null,"doc","doc",1913296891));
var arglists_26823 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26367_26821__$1,new cljs.core.Keyword(null,"arglists","arglists",1661989754));
cljs.core.println();
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",name_26819], 0));
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",arglists_26823], 0));
if(cljs.core.truth_(doc_26822)){
cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([" ",doc_26822], 0));
} else {
}
var G__26838 = cljs.core.next(seq__26325_26807__$1);
var G__26839 = null;
var G__26840 = (0);
var G__26841 = (0);
seq__26325_26778 = G__26838;
chunk__26327_26779 = G__26839;
count__26328_26780 = G__26840;
i__26329_26781 = G__26841;
continue;
}
} else {
}
}
break;
}
} else {
}
if(cljs.core.truth_(n)){
var temp__5804__auto__ = cljs.spec.alpha.get_spec(cljs.core.symbol.cljs$core$IFn$_invoke$arity$2(cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.ns_name(n)),cljs.core.name(nm)));
if(cljs.core.truth_(temp__5804__auto__)){
var fnspec = temp__5804__auto__;
cljs.core.print.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["Spec"], 0));
var seq__26373 = cljs.core.seq(new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"args","args",1315556576),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Keyword(null,"fn","fn",-1175266204)], null));
var chunk__26374 = null;
var count__26375 = (0);
var i__26376 = (0);
while(true){
if((i__26376 < count__26375)){
var role = chunk__26374.cljs$core$IIndexed$_nth$arity$2(null, i__26376);
var temp__5804__auto___26850__$1 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(fnspec,role);
if(cljs.core.truth_(temp__5804__auto___26850__$1)){
var spec_26853 = temp__5804__auto___26850__$1;
cljs.core.print.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([["\n ",cljs.core.name(role),":"].join(''),cljs.spec.alpha.describe(spec_26853)], 0));
} else {
}
var G__26856 = seq__26373;
var G__26857 = chunk__26374;
var G__26858 = count__26375;
var G__26859 = (i__26376 + (1));
seq__26373 = G__26856;
chunk__26374 = G__26857;
count__26375 = G__26858;
i__26376 = G__26859;
continue;
} else {
var temp__5804__auto____$1 = cljs.core.seq(seq__26373);
if(temp__5804__auto____$1){
var seq__26373__$1 = temp__5804__auto____$1;
if(cljs.core.chunked_seq_QMARK_(seq__26373__$1)){
var c__5525__auto__ = cljs.core.chunk_first(seq__26373__$1);
var G__26861 = cljs.core.chunk_rest(seq__26373__$1);
var G__26862 = c__5525__auto__;
var G__26863 = cljs.core.count(c__5525__auto__);
var G__26864 = (0);
seq__26373 = G__26861;
chunk__26374 = G__26862;
count__26375 = G__26863;
i__26376 = G__26864;
continue;
} else {
var role = cljs.core.first(seq__26373__$1);
var temp__5804__auto___26867__$2 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(fnspec,role);
if(cljs.core.truth_(temp__5804__auto___26867__$2)){
var spec_26869 = temp__5804__auto___26867__$2;
cljs.core.print.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([["\n ",cljs.core.name(role),":"].join(''),cljs.spec.alpha.describe(spec_26869)], 0));
} else {
}
var G__26870 = cljs.core.next(seq__26373__$1);
var G__26871 = null;
var G__26872 = (0);
var G__26873 = (0);
seq__26373 = G__26870;
chunk__26374 = G__26871;
count__26375 = G__26872;
i__26376 = G__26873;
continue;
}
} else {
return null;
}
}
break;
}
} else {
return null;
}
} else {
return null;
}
}
});
/**
* Constructs a data representation for a Error with keys:
* :cause - root cause message
* :phase - error phase
* :via - cause chain, with cause keys:
* :type - exception class symbol
* :message - exception message
* :data - ex-data
* :at - top stack element
* :trace - root cause stack elements
*/
cljs.repl.Error__GT_map = (function cljs$repl$Error__GT_map(o){
return cljs.core.Throwable__GT_map(o);
});
/**
* Returns an analysis of the phase, error, cause, and location of an error that occurred
* based on Throwable data, as returned by Throwable->map. All attributes other than phase
* are optional:
* :clojure.error/phase - keyword phase indicator, one of:
* :read-source :compile-syntax-check :compilation :macro-syntax-check :macroexpansion
* :execution :read-eval-result :print-eval-result
* :clojure.error/source - file name (no path)
* :clojure.error/line - integer line number
* :clojure.error/column - integer column number
* :clojure.error/symbol - symbol being expanded/compiled/invoked
* :clojure.error/class - cause exception class symbol
* :clojure.error/cause - cause exception message
* :clojure.error/spec - explain-data for spec error
*/
cljs.repl.ex_triage = (function cljs$repl$ex_triage(datafied_throwable){
var map__26467 = datafied_throwable;
var map__26467__$1 = cljs.core.__destructure_map(map__26467);
var via = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26467__$1,new cljs.core.Keyword(null,"via","via",-1904457336));
var trace = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26467__$1,new cljs.core.Keyword(null,"trace","trace",-1082747415));
var phase = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__26467__$1,new cljs.core.Keyword(null,"phase","phase",575722892),new cljs.core.Keyword(null,"execution","execution",253283524));
var map__26468 = cljs.core.last(via);
var map__26468__$1 = cljs.core.__destructure_map(map__26468);
var type = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26468__$1,new cljs.core.Keyword(null,"type","type",1174270348));
var message = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26468__$1,new cljs.core.Keyword(null,"message","message",-406056002));
var data = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26468__$1,new cljs.core.Keyword(null,"data","data",-232669377));
var map__26469 = data;
var map__26469__$1 = cljs.core.__destructure_map(map__26469);
var problems = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26469__$1,new cljs.core.Keyword("cljs.spec.alpha","problems","cljs.spec.alpha/problems",447400814));
var fn = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26469__$1,new cljs.core.Keyword("cljs.spec.alpha","fn","cljs.spec.alpha/fn",408600443));
var caller = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26469__$1,new cljs.core.Keyword("cljs.spec.test.alpha","caller","cljs.spec.test.alpha/caller",-398302390));
var map__26470 = new cljs.core.Keyword(null,"data","data",-232669377).cljs$core$IFn$_invoke$arity$1(cljs.core.first(via));
var map__26470__$1 = cljs.core.__destructure_map(map__26470);
var top_data = map__26470__$1;
var source = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26470__$1,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397));
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3((function (){var G__26497 = phase;
var G__26497__$1 = (((G__26497 instanceof cljs.core.Keyword))?G__26497.fqn:null);
switch (G__26497__$1) {
case "read-source":
var map__26509 = data;
var map__26509__$1 = cljs.core.__destructure_map(map__26509);
var line = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26509__$1,new cljs.core.Keyword("clojure.error","line","clojure.error/line",-1816287471));
var column = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26509__$1,new cljs.core.Keyword("clojure.error","column","clojure.error/column",304721553));
var G__26511 = cljs.core.merge.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.Keyword(null,"data","data",-232669377).cljs$core$IFn$_invoke$arity$1(cljs.core.second(via)),top_data], 0));
var G__26511__$1 = (cljs.core.truth_(source)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__26511,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397),source):G__26511);
var G__26511__$2 = (cljs.core.truth_((function (){var fexpr__26516 = new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, ["NO_SOURCE_PATH",null,"NO_SOURCE_FILE",null], null), null);
return (fexpr__26516.cljs$core$IFn$_invoke$arity$1 ? fexpr__26516.cljs$core$IFn$_invoke$arity$1(source) : fexpr__26516.call(null, source));
})())?cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(G__26511__$1,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397)):G__26511__$1);
if(cljs.core.truth_(message)){
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__26511__$2,new cljs.core.Keyword("clojure.error","cause","clojure.error/cause",-1879175742),message);
} else {
return G__26511__$2;
}
break;
case "compile-syntax-check":
case "compilation":
case "macro-syntax-check":
case "macroexpansion":
var G__26526 = top_data;
var G__26526__$1 = (cljs.core.truth_(source)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__26526,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397),source):G__26526);
var G__26526__$2 = (cljs.core.truth_((function (){var fexpr__26528 = new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, ["NO_SOURCE_PATH",null,"NO_SOURCE_FILE",null], null), null);
return (fexpr__26528.cljs$core$IFn$_invoke$arity$1 ? fexpr__26528.cljs$core$IFn$_invoke$arity$1(source) : fexpr__26528.call(null, source));
})())?cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(G__26526__$1,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397)):G__26526__$1);
var G__26526__$3 = (cljs.core.truth_(type)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__26526__$2,new cljs.core.Keyword("clojure.error","class","clojure.error/class",278435890),type):G__26526__$2);
var G__26526__$4 = (cljs.core.truth_(message)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__26526__$3,new cljs.core.Keyword("clojure.error","cause","clojure.error/cause",-1879175742),message):G__26526__$3);
if(cljs.core.truth_(problems)){
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__26526__$4,new cljs.core.Keyword("clojure.error","spec","clojure.error/spec",2055032595),data);
} else {
return G__26526__$4;
}
break;
case "read-eval-result":
case "print-eval-result":
var vec__26537 = cljs.core.first(trace);
var source__$1 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__26537,(0),null);
var method = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__26537,(1),null);
var file = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__26537,(2),null);
var line = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__26537,(3),null);
var G__26544 = top_data;
var G__26544__$1 = (cljs.core.truth_(line)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__26544,new cljs.core.Keyword("clojure.error","line","clojure.error/line",-1816287471),line):G__26544);
var G__26544__$2 = (cljs.core.truth_(file)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__26544__$1,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397),file):G__26544__$1);
var G__26544__$3 = (cljs.core.truth_((function (){var and__5000__auto__ = source__$1;
if(cljs.core.truth_(and__5000__auto__)){
return method;
} else {
return and__5000__auto__;
}
})())?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__26544__$2,new cljs.core.Keyword("clojure.error","symbol","clojure.error/symbol",1544821994),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[source__$1,method],null))):G__26544__$2);
var G__26544__$4 = (cljs.core.truth_(type)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__26544__$3,new cljs.core.Keyword("clojure.error","class","clojure.error/class",278435890),type):G__26544__$3);
if(cljs.core.truth_(message)){
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__26544__$4,new cljs.core.Keyword("clojure.error","cause","clojure.error/cause",-1879175742),message);
} else {
return G__26544__$4;
}
break;
case "execution":
var vec__26557 = cljs.core.first(trace);
var source__$1 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__26557,(0),null);
var method = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__26557,(1),null);
var file = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__26557,(2),null);
var line = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__26557,(3),null);
var file__$1 = cljs.core.first(cljs.core.remove.cljs$core$IFn$_invoke$arity$2((function (p1__26446_SHARP_){
var or__5002__auto__ = (p1__26446_SHARP_ == null);
if(or__5002__auto__){
return or__5002__auto__;
} else {
var fexpr__26571 = new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, ["NO_SOURCE_PATH",null,"NO_SOURCE_FILE",null], null), null);
return (fexpr__26571.cljs$core$IFn$_invoke$arity$1 ? fexpr__26571.cljs$core$IFn$_invoke$arity$1(p1__26446_SHARP_) : fexpr__26571.call(null, p1__26446_SHARP_));
}
}),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"file","file",-1269645878).cljs$core$IFn$_invoke$arity$1(caller),file], null)));
var err_line = (function (){var or__5002__auto__ = new cljs.core.Keyword(null,"line","line",212345235).cljs$core$IFn$_invoke$arity$1(caller);
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__auto__;
} else {
return line;
}
})();
var G__26576 = new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword("clojure.error","class","clojure.error/class",278435890),type], null);
var G__26576__$1 = (cljs.core.truth_(err_line)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__26576,new cljs.core.Keyword("clojure.error","line","clojure.error/line",-1816287471),err_line):G__26576);
var G__26576__$2 = (cljs.core.truth_(message)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__26576__$1,new cljs.core.Keyword("clojure.error","cause","clojure.error/cause",-1879175742),message):G__26576__$1);
var G__26576__$3 = (cljs.core.truth_((function (){var or__5002__auto__ = fn;
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__auto__;
} else {
var and__5000__auto__ = source__$1;
if(cljs.core.truth_(and__5000__auto__)){
return method;
} else {
return and__5000__auto__;
}
}
})())?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__26576__$2,new cljs.core.Keyword("clojure.error","symbol","clojure.error/symbol",1544821994),(function (){var or__5002__auto__ = fn;
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__auto__;
} else {
return (new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[source__$1,method],null));
}
})()):G__26576__$2);
var G__26576__$4 = (cljs.core.truth_(file__$1)?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__26576__$3,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397),file__$1):G__26576__$3);
if(cljs.core.truth_(problems)){
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__26576__$4,new cljs.core.Keyword("clojure.error","spec","clojure.error/spec",2055032595),data);
} else {
return G__26576__$4;
}
break;
default:
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__26497__$1)].join('')));
}
})(),new cljs.core.Keyword("clojure.error","phase","clojure.error/phase",275140358),phase);
});
/**
* Returns a string from exception data, as produced by ex-triage.
* The first line summarizes the exception phase and location.
* The subsequent lines describe the cause.
*/
cljs.repl.ex_str = (function cljs$repl$ex_str(p__26593){
var map__26594 = p__26593;
var map__26594__$1 = cljs.core.__destructure_map(map__26594);
var triage_data = map__26594__$1;
var phase = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26594__$1,new cljs.core.Keyword("clojure.error","phase","clojure.error/phase",275140358));
var source = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26594__$1,new cljs.core.Keyword("clojure.error","source","clojure.error/source",-2011936397));
var line = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26594__$1,new cljs.core.Keyword("clojure.error","line","clojure.error/line",-1816287471));
var column = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26594__$1,new cljs.core.Keyword("clojure.error","column","clojure.error/column",304721553));
var symbol = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26594__$1,new cljs.core.Keyword("clojure.error","symbol","clojure.error/symbol",1544821994));
var class$ = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26594__$1,new cljs.core.Keyword("clojure.error","class","clojure.error/class",278435890));
var cause = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26594__$1,new cljs.core.Keyword("clojure.error","cause","clojure.error/cause",-1879175742));
var spec = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__26594__$1,new cljs.core.Keyword("clojure.error","spec","clojure.error/spec",2055032595));
var loc = [cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var or__5002__auto__ = source;
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__auto__;
} else {
return "<cljs repl>";
}
})()),":",cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var or__5002__auto__ = line;
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__auto__;
} else {
return (1);
}
})()),(cljs.core.truth_(column)?[":",cljs.core.str.cljs$core$IFn$_invoke$arity$1(column)].join(''):"")].join('');
var class_name = cljs.core.name((function (){var or__5002__auto__ = class$;
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__auto__;
} else {
return "";
}
})());
var simple_class = class_name;
var cause_type = ((cljs.core.contains_QMARK_(new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, ["RuntimeException",null,"Exception",null], null), null),simple_class))?"":[" (",simple_class,")"].join(''));
var format = goog.string.format;
var G__26616 = phase;
var G__26616__$1 = (((G__26616 instanceof cljs.core.Keyword))?G__26616.fqn:null);
switch (G__26616__$1) {
case "read-source":
return (format.cljs$core$IFn$_invoke$arity$3 ? format.cljs$core$IFn$_invoke$arity$3("Syntax error reading source at (%s).\n%s\n",loc,cause) : format.call(null, "Syntax error reading source at (%s).\n%s\n",loc,cause));
break;
case "macro-syntax-check":
var G__26624 = "Syntax error macroexpanding %sat (%s).\n%s";
var G__26625 = (cljs.core.truth_(symbol)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(symbol)," "].join(''):"");
var G__26626 = loc;
var G__26627 = (cljs.core.truth_(spec)?(function (){var sb__5647__auto__ = (new goog.string.StringBuffer());
var _STAR_print_newline_STAR__orig_val__26631_26976 = cljs.core._STAR_print_newline_STAR_;
var _STAR_print_fn_STAR__orig_val__26632_26977 = cljs.core._STAR_print_fn_STAR_;
var _STAR_print_newline_STAR__temp_val__26633_26978 = true;
var _STAR_print_fn_STAR__temp_val__26634_26979 = (function (x__5648__auto__){
return sb__5647__auto__.append(x__5648__auto__);
});
(cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__temp_val__26633_26978);
(cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR__temp_val__26634_26979);
try{cljs.spec.alpha.explain_out(cljs.core.update.cljs$core$IFn$_invoke$arity$3(spec,new cljs.core.Keyword("cljs.spec.alpha","problems","cljs.spec.alpha/problems",447400814),(function (probs){
return cljs.core.map.cljs$core$IFn$_invoke$arity$2((function (p1__26588_SHARP_){
return cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(p1__26588_SHARP_,new cljs.core.Keyword(null,"in","in",-1531184865));
}),probs);
}))
);
}finally {(cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR__orig_val__26632_26977);
(cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__orig_val__26631_26976);
}
return cljs.core.str.cljs$core$IFn$_invoke$arity$1(sb__5647__auto__);
})():(format.cljs$core$IFn$_invoke$arity$2 ? format.cljs$core$IFn$_invoke$arity$2("%s\n",cause) : format.call(null, "%s\n",cause)));
return (format.cljs$core$IFn$_invoke$arity$4 ? format.cljs$core$IFn$_invoke$arity$4(G__26624,G__26625,G__26626,G__26627) : format.call(null, G__26624,G__26625,G__26626,G__26627));
break;
case "macroexpansion":
var G__26640 = "Unexpected error%s macroexpanding %sat (%s).\n%s\n";
var G__26641 = cause_type;
var G__26642 = (cljs.core.truth_(symbol)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(symbol)," "].join(''):"");
var G__26643 = loc;
var G__26644 = cause;
return (format.cljs$core$IFn$_invoke$arity$5 ? format.cljs$core$IFn$_invoke$arity$5(G__26640,G__26641,G__26642,G__26643,G__26644) : format.call(null, G__26640,G__26641,G__26642,G__26643,G__26644));
break;
case "compile-syntax-check":
var G__26645 = "Syntax error%s compiling %sat (%s).\n%s\n";
var G__26646 = cause_type;
var G__26647 = (cljs.core.truth_(symbol)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(symbol)," "].join(''):"");
var G__26648 = loc;
var G__26649 = cause;
return (format.cljs$core$IFn$_invoke$arity$5 ? format.cljs$core$IFn$_invoke$arity$5(G__26645,G__26646,G__26647,G__26648,G__26649) : format.call(null, G__26645,G__26646,G__26647,G__26648,G__26649));
break;
case "compilation":
var G__26653 = "Unexpected error%s compiling %sat (%s).\n%s\n";
var G__26654 = cause_type;
var G__26655 = (cljs.core.truth_(symbol)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(symbol)," "].join(''):"");
var G__26656 = loc;
var G__26657 = cause;
return (format.cljs$core$IFn$_invoke$arity$5 ? format.cljs$core$IFn$_invoke$arity$5(G__26653,G__26654,G__26655,G__26656,G__26657) : format.call(null, G__26653,G__26654,G__26655,G__26656,G__26657));
break;
case "read-eval-result":
return (format.cljs$core$IFn$_invoke$arity$5 ? format.cljs$core$IFn$_invoke$arity$5("Error reading eval result%s at %s (%s).\n%s\n",cause_type,symbol,loc,cause) : format.call(null, "Error reading eval result%s at %s (%s).\n%s\n",cause_type,symbol,loc,cause));
break;
case "print-eval-result":
return (format.cljs$core$IFn$_invoke$arity$5 ? format.cljs$core$IFn$_invoke$arity$5("Error printing return value%s at %s (%s).\n%s\n",cause_type,symbol,loc,cause) : format.call(null, "Error printing return value%s at %s (%s).\n%s\n",cause_type,symbol,loc,cause));
break;
case "execution":
if(cljs.core.truth_(spec)){
var G__26663 = "Execution error - invalid arguments to %s at (%s).\n%s";
var G__26664 = symbol;
var G__26665 = loc;
var G__26666 = (function (){var sb__5647__auto__ = (new goog.string.StringBuffer());
var _STAR_print_newline_STAR__orig_val__26674_27016 = cljs.core._STAR_print_newline_STAR_;
var _STAR_print_fn_STAR__orig_val__26675_27017 = cljs.core._STAR_print_fn_STAR_;
var _STAR_print_newline_STAR__temp_val__26676_27018 = true;
var _STAR_print_fn_STAR__temp_val__26677_27019 = (function (x__5648__auto__){
return sb__5647__auto__.append(x__5648__auto__);
});
(cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__temp_val__26676_27018);
(cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR__temp_val__26677_27019);
try{cljs.spec.alpha.explain_out(cljs.core.update.cljs$core$IFn$_invoke$arity$3(spec,new cljs.core.Keyword("cljs.spec.alpha","problems","cljs.spec.alpha/problems",447400814),(function (probs){
return cljs.core.map.cljs$core$IFn$_invoke$arity$2((function (p1__26591_SHARP_){
return cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(p1__26591_SHARP_,new cljs.core.Keyword(null,"in","in",-1531184865));
}),probs);
}))
);
}finally {(cljs.core._STAR_print_fn_STAR_ = _STAR_print_fn_STAR__orig_val__26675_27017);
(cljs.core._STAR_print_newline_STAR_ = _STAR_print_newline_STAR__orig_val__26674_27016);
}
return cljs.core.str.cljs$core$IFn$_invoke$arity$1(sb__5647__auto__);
})();
return (format.cljs$core$IFn$_invoke$arity$4 ? format.cljs$core$IFn$_invoke$arity$4(G__26663,G__26664,G__26665,G__26666) : format.call(null, G__26663,G__26664,G__26665,G__26666));
} else {
var G__26687 = "Execution error%s at %s(%s).\n%s\n";
var G__26688 = cause_type;
var G__26689 = (cljs.core.truth_(symbol)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(symbol)," "].join(''):"");
var G__26690 = loc;
var G__26691 = cause;
return (format.cljs$core$IFn$_invoke$arity$5 ? format.cljs$core$IFn$_invoke$arity$5(G__26687,G__26688,G__26689,G__26690,G__26691) : format.call(null, G__26687,G__26688,G__26689,G__26690,G__26691));
}
break;
default:
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__26616__$1)].join('')));
}
});
cljs.repl.error__GT_str = (function cljs$repl$error__GT_str(error){
return cljs.repl.ex_str(cljs.repl.ex_triage(cljs.repl.Error__GT_map(error)));
});
//# sourceMappingURL=cljs.repl.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
goog.provide('cljs.user');
//# sourceMappingURL=cljs.user.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["cljs/user.cljs"],"mappings":"","names":[],"sourcesContent":["[(ns cljs.user (:require [cljs.repl :refer (doc find-doc source apropos pst dir)]))]"],"x_google_ignoreList":[0]}

View File

@@ -0,0 +1,94 @@
goog.provide('clojure.core.protocols');
/**
* @interface
*/
clojure.core.protocols.Datafiable = function(){};
var clojure$core$protocols$Datafiable$datafy$dyn_19774 = (function (o){
var x__5350__auto__ = (((o == null))?null:o);
var m__5351__auto__ = (clojure.core.protocols.datafy[goog.typeOf(x__5350__auto__)]);
if((!((m__5351__auto__ == null)))){
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$1(o) : m__5351__auto__.call(null, o));
} else {
var m__5349__auto__ = (clojure.core.protocols.datafy["_"]);
if((!((m__5349__auto__ == null)))){
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$1(o) : m__5349__auto__.call(null, o));
} else {
throw cljs.core.missing_protocol("Datafiable.datafy",o);
}
}
});
/**
* return a representation of o as data (default identity)
*/
clojure.core.protocols.datafy = (function clojure$core$protocols$datafy(o){
var temp__5802__auto__ = cljs.core.get.cljs$core$IFn$_invoke$arity$2(cljs.core.meta(o),cljs.core.with_meta(new cljs.core.Symbol("clojure.core.protocols","datafy","clojure.core.protocols/datafy",707534751,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword("cljs.analyzer","no-resolve","cljs.analyzer/no-resolve",-1872351017),true], null)));
if(temp__5802__auto__){
var meta_impl__5352__auto__ = temp__5802__auto__;
return (meta_impl__5352__auto__.cljs$core$IFn$_invoke$arity$1 ? meta_impl__5352__auto__.cljs$core$IFn$_invoke$arity$1(o) : meta_impl__5352__auto__.call(null, o));
} else {
if((((!((o == null)))) && ((!((o.clojure$core$protocols$Datafiable$datafy$arity$1 == null)))))){
return o.clojure$core$protocols$Datafiable$datafy$arity$1(o);
} else {
return clojure$core$protocols$Datafiable$datafy$dyn_19774(o);
}
}
});
(clojure.core.protocols.Datafiable["null"] = true);
(clojure.core.protocols.datafy["null"] = (function (_){
return null;
}));
(clojure.core.protocols.Datafiable["_"] = true);
(clojure.core.protocols.datafy["_"] = (function (o){
return o;
}));
/**
* @interface
*/
clojure.core.protocols.Navigable = function(){};
var clojure$core$protocols$Navigable$nav$dyn_19792 = (function (coll,k,v){
var x__5350__auto__ = (((coll == null))?null:coll);
var m__5351__auto__ = (clojure.core.protocols.nav[goog.typeOf(x__5350__auto__)]);
if((!((m__5351__auto__ == null)))){
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$3 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$3(coll,k,v) : m__5351__auto__.call(null, coll,k,v));
} else {
var m__5349__auto__ = (clojure.core.protocols.nav["_"]);
if((!((m__5349__auto__ == null)))){
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$3 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$3(coll,k,v) : m__5349__auto__.call(null, coll,k,v));
} else {
throw cljs.core.missing_protocol("Navigable.nav",coll);
}
}
});
/**
* return (possibly transformed) v in the context of coll and k (a key/index or nil),
* defaults to returning v.
*/
clojure.core.protocols.nav = (function clojure$core$protocols$nav(coll,k,v){
var temp__5802__auto__ = cljs.core.get.cljs$core$IFn$_invoke$arity$2(cljs.core.meta(coll),cljs.core.with_meta(new cljs.core.Symbol("clojure.core.protocols","nav","clojure.core.protocols/nav",298936762,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword("cljs.analyzer","no-resolve","cljs.analyzer/no-resolve",-1872351017),true], null)));
if(temp__5802__auto__){
var meta_impl__5352__auto__ = temp__5802__auto__;
return (meta_impl__5352__auto__.cljs$core$IFn$_invoke$arity$3 ? meta_impl__5352__auto__.cljs$core$IFn$_invoke$arity$3(coll,k,v) : meta_impl__5352__auto__.call(null, coll,k,v));
} else {
if((((!((coll == null)))) && ((!((coll.clojure$core$protocols$Navigable$nav$arity$3 == null)))))){
return coll.clojure$core$protocols$Navigable$nav$arity$3(coll,k,v);
} else {
return clojure$core$protocols$Navigable$nav$dyn_19792(coll,k,v);
}
}
});
(clojure.core.protocols.Navigable["_"] = true);
(clojure.core.protocols.nav["_"] = (function (_,___$1,x){
return x;
}));
//# sourceMappingURL=clojure.core.protocols.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["clojure/core/protocols.cljs"],"mappings":";AAUA,AAAA;AAAA;;;oCAAA,pCAAaW;;AAAb,IAAAX,qDAAA,WAEWY;AAFX,AAAA,IAAAX,kBAAA,EAAA,MAAA,OAAA,ZAEWW,iBAAAA;IAFXV,kBAAA,CAAAC,8BAAA,AAAAC,YAAAH;AAAA,AAAA,GAAA,GAAA,CAAAC,mBAAA;AAAA,QAAAA,gDAAAA,mDAAAA,LAEWU,gCAAAA;;AAFX,IAAAP,kBAAA,CAAAF,8BAAA;AAAA,AAAA,GAAA,GAAA,CAAAE,mBAAA;AAAA,QAAAA,gDAAAA,mDAAAA,LAEWO,gCAAAA;;AAFX,MAAA,AAAAN,2BAAA,oBAEWM;;;;AAFX,AAAA;;;gCAAA,hCAEGT,wEAAQS;AAFX,AAAA,IAAAL,qBAAA,AAAAC,4CAAA,AAAAC,kBAAA,AAAA,HAEWG;AAFX,AAAA,GAAAL;AAAA,IAAAG,0BAAAH;AAAA,AAAA,QAAAG,wDAAAA,2DAAAA,LAEWE,wCAAAA;;AAFX,GAAA,EAAA,GAAA,MAAA,aAAA,GAAA,CAAA,sDAAA,5EAEWA,sBAAAA;AAFX,OAEWA,mDAAAA;;AAFX,OAAAZ,mDAEWY;;;;;AAFX,AAIA,AAAA,AAAA,CAAAD,kCAAA,UAAA;;AAAA,CAAAR,8BAAA,UAEE,WAASU;AAAT,AAAA;;;AAFF,AAAA,CAAAF,kCAAA,OAAA;;AAAA,CAAAR,8BAAA,OAKE,WAASS;AAAT,AAAYA;;AAEd,AAAA;AAAA;;;mCAAA,nCAAaI;;AAAb,IAAAF,iDAAA,WAEQG,KAAKC,EAAEC;AAFf,AAAA,IAAAlB,kBAAA,EAAA,SAAA,OAAA,fAEQgB,oBAAAA;IAFRf,kBAAA,CAAAa,2BAAA,AAAAX,YAAAH;AAAA,AAAA,GAAA,GAAA,CAAAC,mBAAA;AAAA,QAAAA,gDAAAA,0DAAAA,ZAEQe,uCAAAA,lCAAKC,uCAAAA,rCAAEC,uCAAAA;;AAFf,IAAAd,kBAAA,CAAAU,2BAAA;AAAA,AAAA,GAAA,GAAA,CAAAV,mBAAA;AAAA,QAAAA,gDAAAA,0DAAAA,ZAEQY,uCAAAA,lCAAKC,uCAAAA,rCAAEC,uCAAAA;;AAFf,MAAA,AAAAb,2BAAA,gBAEQW;;;;AAFR,AAAA;;;;6BAAA,7BAEGF,kEAAKE,KAAKC,EAAEC;AAFf,AAAA,IAAAZ,qBAAA,AAAAC,4CAAA,AAAAC,qBAAA,AAAA,NAEQQ;AAFR,AAAA,GAAAV;AAAA,IAAAG,0BAAAH;AAAA,AAAA,QAAAG,wDAAAA,kEAAAA,ZAEQO,+CAAAA,1CAAKC,+CAAAA,7CAAEC,+CAAAA;;AAFf,GAAA,EAAA,GAAA,SAAA,aAAA,GAAA,CAAA,qDAAA,9EAEQF,yBAAAA;AAFR,OAEQA,kDAAAA,KAAKC,EAAEC;;AAFf,OAAAL,+CAEQG,KAAKC,EAAEC;;;;;AAFf,AAKA,AAAA,AAAA,CAAAH,iCAAA,OAAA;;AAAA,CAAAD,2BAAA,OAEE,WAAMF,EAAEA,MAAEO;AAAV,AAAaA","names":["clojure$core$protocols$Datafiable$datafy$dyn","x__5350__auto__","m__5351__auto__","clojure.core.protocols/datafy","goog/typeOf","m__5349__auto__","cljs.core/missing-protocol","temp__5802__auto__","cljs.core.get","cljs.core/meta","meta-impl__5352__auto__","clojure.core.protocols/Datafiable","o","_","clojure$core$protocols$Navigable$nav$dyn","clojure.core.protocols/nav","clojure.core.protocols/Navigable","coll","k","v","x"],"sourcesContent":["; Copyright (c) Rich Hickey. All rights reserved.\n; The use and distribution terms for this software are covered by the\n; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)\n; which can be found in the file epl-v10.html at the root of this distribution.\n; By using this software in any fashion, you are agreeing to be bound by\n; the terms of this license.\n; You must not remove this notice, or any other, from this software.\n\n(ns clojure.core.protocols)\n\n(defprotocol Datafiable\n :extend-via-metadata true\n (datafy [o] \"return a representation of o as data (default identity)\"))\n\n(extend-protocol Datafiable\n nil\n (datafy [_] nil)\n\n default\n (datafy [o] o))\n\n(defprotocol Navigable\n :extend-via-metadata true\n (nav [coll k v] \"return (possibly transformed) v in the context of coll and k (a key/index or nil),\ndefaults to returning v.\"))\n\n(extend-protocol Navigable\n default\n (nav [_ _ x] x))\n"],"x_google_ignoreList":[0]}

View File

@@ -0,0 +1,292 @@
goog.provide('clojure.data');
/**
* Internal helper for diff.
*/
clojure.data.atom_diff = (function clojure$data$atom_diff(a,b){
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(a,b)){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,null,a], null);
} else {
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [a,b,null], null);
}
});
/**
* Convert an associative-by-numeric-index collection into
* an equivalent vector, with nil for any missing keys
*/
clojure.data.vectorize = (function clojure$data$vectorize(m){
if(cljs.core.seq(m)){
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (result,p__19897){
var vec__19900 = p__19897;
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__19900,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__19900,(1),null);
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(result,k,v);
}),cljs.core.vec(cljs.core.repeat.cljs$core$IFn$_invoke$arity$2(cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.max,cljs.core.keys(m)),null)),m);
} else {
return null;
}
});
/**
* Diff associative things a and b, comparing only the key k.
*/
clojure.data.diff_associative_key = (function clojure$data$diff_associative_key(a,b,k){
var va = cljs.core.get.cljs$core$IFn$_invoke$arity$2(a,k);
var vb = cljs.core.get.cljs$core$IFn$_invoke$arity$2(b,k);
var vec__19913 = clojure.data.diff(va,vb);
var a_STAR_ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__19913,(0),null);
var b_STAR_ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__19913,(1),null);
var ab = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__19913,(2),null);
var in_a = cljs.core.contains_QMARK_(a,k);
var in_b = cljs.core.contains_QMARK_(b,k);
var same = ((in_a) && (((in_b) && ((((!((ab == null)))) || ((((va == null)) && ((vb == null)))))))));
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [((((in_a) && ((((!((a_STAR_ == null)))) || ((!(same)))))))?cljs.core.PersistentArrayMap.createAsIfByAssoc([k,a_STAR_]):null),((((in_b) && ((((!((b_STAR_ == null)))) || ((!(same)))))))?cljs.core.PersistentArrayMap.createAsIfByAssoc([k,b_STAR_]):null),((same)?cljs.core.PersistentArrayMap.createAsIfByAssoc([k,ab]):null)], null);
});
/**
* Diff associative things a and b, comparing only keys in ks (if supplied).
*/
clojure.data.diff_associative = (function clojure$data$diff_associative(var_args){
var G__19934 = arguments.length;
switch (G__19934) {
case 2:
return clojure.data.diff_associative.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
break;
case 3:
return clojure.data.diff_associative.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));
break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
}
});
(clojure.data.diff_associative.cljs$core$IFn$_invoke$arity$2 = (function (a,b){
return clojure.data.diff_associative.cljs$core$IFn$_invoke$arity$3(a,b,clojure.set.union.cljs$core$IFn$_invoke$arity$2(cljs.core.keys(a),cljs.core.keys(b)));
}));
(clojure.data.diff_associative.cljs$core$IFn$_invoke$arity$3 = (function (a,b,ks){
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (diff1,diff2){
return cljs.core.doall.cljs$core$IFn$_invoke$arity$1(cljs.core.map.cljs$core$IFn$_invoke$arity$3(cljs.core.merge,diff1,diff2));
}),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,null,null], null),cljs.core.map.cljs$core$IFn$_invoke$arity$2(cljs.core.partial.cljs$core$IFn$_invoke$arity$3(clojure.data.diff_associative_key,a,b),ks));
}));
(clojure.data.diff_associative.cljs$lang$maxFixedArity = 3);
clojure.data.diff_sequential = (function clojure$data$diff_sequential(a,b){
return cljs.core.vec(cljs.core.map.cljs$core$IFn$_invoke$arity$2(clojure.data.vectorize,clojure.data.diff_associative.cljs$core$IFn$_invoke$arity$3(((cljs.core.vector_QMARK_(a))?a:cljs.core.vec(a)),((cljs.core.vector_QMARK_(b))?b:cljs.core.vec(b)),cljs.core.range.cljs$core$IFn$_invoke$arity$1((function (){var x__5087__auto__ = cljs.core.count(a);
var y__5088__auto__ = cljs.core.count(b);
return ((x__5087__auto__ > y__5088__auto__) ? x__5087__auto__ : y__5088__auto__);
})()))));
});
clojure.data.diff_set = (function clojure$data$diff_set(a,b){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.not_empty(clojure.set.difference.cljs$core$IFn$_invoke$arity$2(a,b)),cljs.core.not_empty(clojure.set.difference.cljs$core$IFn$_invoke$arity$2(b,a)),cljs.core.not_empty(clojure.set.intersection.cljs$core$IFn$_invoke$arity$2(a,b))], null);
});
/**
* Implementation detail. Subject to change.
* @interface
*/
clojure.data.EqualityPartition = function(){};
var clojure$data$EqualityPartition$equality_partition$dyn_20169 = (function (x){
var x__5350__auto__ = (((x == null))?null:x);
var m__5351__auto__ = (clojure.data.equality_partition[goog.typeOf(x__5350__auto__)]);
if((!((m__5351__auto__ == null)))){
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$1(x) : m__5351__auto__.call(null, x));
} else {
var m__5349__auto__ = (clojure.data.equality_partition["_"]);
if((!((m__5349__auto__ == null)))){
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$1(x) : m__5349__auto__.call(null, x));
} else {
throw cljs.core.missing_protocol("EqualityPartition.equality-partition",x);
}
}
});
/**
* Implementation detail. Subject to change.
*/
clojure.data.equality_partition = (function clojure$data$equality_partition(x){
if((((!((x == null)))) && ((!((x.clojure$data$EqualityPartition$equality_partition$arity$1 == null)))))){
return x.clojure$data$EqualityPartition$equality_partition$arity$1(x);
} else {
return clojure$data$EqualityPartition$equality_partition$dyn_20169(x);
}
});
/**
* Implementation detail. Subject to change.
* @interface
*/
clojure.data.Diff = function(){};
var clojure$data$Diff$diff_similar$dyn_20181 = (function (a,b){
var x__5350__auto__ = (((a == null))?null:a);
var m__5351__auto__ = (clojure.data.diff_similar[goog.typeOf(x__5350__auto__)]);
if((!((m__5351__auto__ == null)))){
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$2 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$2(a,b) : m__5351__auto__.call(null, a,b));
} else {
var m__5349__auto__ = (clojure.data.diff_similar["_"]);
if((!((m__5349__auto__ == null)))){
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$2 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$2(a,b) : m__5349__auto__.call(null, a,b));
} else {
throw cljs.core.missing_protocol("Diff.diff-similar",a);
}
}
});
/**
* Implementation detail. Subject to change.
*/
clojure.data.diff_similar = (function clojure$data$diff_similar(a,b){
if((((!((a == null)))) && ((!((a.clojure$data$Diff$diff_similar$arity$2 == null)))))){
return a.clojure$data$Diff$diff_similar$arity$2(a,b);
} else {
return clojure$data$Diff$diff_similar$dyn_20181(a,b);
}
});
(clojure.data.EqualityPartition["null"] = true);
(clojure.data.equality_partition["null"] = (function (x){
return new cljs.core.Keyword(null,"atom","atom",-397043653);
}));
(clojure.data.EqualityPartition["string"] = true);
(clojure.data.equality_partition["string"] = (function (x){
return new cljs.core.Keyword(null,"atom","atom",-397043653);
}));
(clojure.data.EqualityPartition["number"] = true);
(clojure.data.equality_partition["number"] = (function (x){
return new cljs.core.Keyword(null,"atom","atom",-397043653);
}));
(clojure.data.EqualityPartition["array"] = true);
(clojure.data.equality_partition["array"] = (function (x){
return new cljs.core.Keyword(null,"sequential","sequential",-1082983960);
}));
(clojure.data.EqualityPartition["function"] = true);
(clojure.data.equality_partition["function"] = (function (x){
return new cljs.core.Keyword(null,"atom","atom",-397043653);
}));
(clojure.data.EqualityPartition["boolean"] = true);
(clojure.data.equality_partition["boolean"] = (function (x){
return new cljs.core.Keyword(null,"atom","atom",-397043653);
}));
(clojure.data.EqualityPartition["_"] = true);
(clojure.data.equality_partition["_"] = (function (x){
if((((!((x == null))))?(((((x.cljs$lang$protocol_mask$partition0$ & (1024))) || ((cljs.core.PROTOCOL_SENTINEL === x.cljs$core$IMap$))))?true:(((!x.cljs$lang$protocol_mask$partition0$))?cljs.core.native_satisfies_QMARK_(cljs.core.IMap,x):false)):cljs.core.native_satisfies_QMARK_(cljs.core.IMap,x))){
return new cljs.core.Keyword(null,"map","map",1371690461);
} else {
if((((!((x == null))))?(((((x.cljs$lang$protocol_mask$partition0$ & (4096))) || ((cljs.core.PROTOCOL_SENTINEL === x.cljs$core$ISet$))))?true:(((!x.cljs$lang$protocol_mask$partition0$))?cljs.core.native_satisfies_QMARK_(cljs.core.ISet,x):false)):cljs.core.native_satisfies_QMARK_(cljs.core.ISet,x))){
return new cljs.core.Keyword(null,"set","set",304602554);
} else {
if((((!((x == null))))?(((((x.cljs$lang$protocol_mask$partition0$ & (16777216))) || ((cljs.core.PROTOCOL_SENTINEL === x.cljs$core$ISequential$))))?true:(((!x.cljs$lang$protocol_mask$partition0$))?cljs.core.native_satisfies_QMARK_(cljs.core.ISequential,x):false)):cljs.core.native_satisfies_QMARK_(cljs.core.ISequential,x))){
return new cljs.core.Keyword(null,"sequential","sequential",-1082983960);
} else {
return new cljs.core.Keyword(null,"atom","atom",-397043653);
}
}
}
}));
(clojure.data.Diff["null"] = true);
(clojure.data.diff_similar["null"] = (function (a,b){
return clojure.data.atom_diff(a,b);
}));
(clojure.data.Diff["string"] = true);
(clojure.data.diff_similar["string"] = (function (a,b){
return clojure.data.atom_diff(a,b);
}));
(clojure.data.Diff["number"] = true);
(clojure.data.diff_similar["number"] = (function (a,b){
return clojure.data.atom_diff(a,b);
}));
(clojure.data.Diff["array"] = true);
(clojure.data.diff_similar["array"] = (function (a,b){
return clojure.data.diff_sequential(a,b);
}));
(clojure.data.Diff["function"] = true);
(clojure.data.diff_similar["function"] = (function (a,b){
return clojure.data.atom_diff(a,b);
}));
(clojure.data.Diff["boolean"] = true);
(clojure.data.diff_similar["boolean"] = (function (a,b){
return clojure.data.atom_diff(a,b);
}));
(clojure.data.Diff["_"] = true);
(clojure.data.diff_similar["_"] = (function (a,b){
var fexpr__20076 = (function (){var G__20077 = clojure.data.equality_partition(a);
var G__20077__$1 = (((G__20077 instanceof cljs.core.Keyword))?G__20077.fqn:null);
switch (G__20077__$1) {
case "atom":
return clojure.data.atom_diff;
break;
case "set":
return clojure.data.diff_set;
break;
case "sequential":
return clojure.data.diff_sequential;
break;
case "map":
return clojure.data.diff_associative;
break;
default:
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__20077__$1)].join('')));
}
})();
return (fexpr__20076.cljs$core$IFn$_invoke$arity$2 ? fexpr__20076.cljs$core$IFn$_invoke$arity$2(a,b) : fexpr__20076.call(null, a,b));
}));
/**
* Recursively compares a and b, returning a tuple of
* [things-only-in-a things-only-in-b things-in-both].
* Comparison rules:
*
* * For equal a and b, return [nil nil a].
* * Maps are subdiffed where keys match and values differ.
* * Sets are never subdiffed.
* * All sequential things are treated as associative collections
* by their indexes, with results returned as vectors.
* * Everything else (including strings!) is treated as
* an atom and compared for equality.
*/
clojure.data.diff = (function clojure$data$diff(a,b){
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(a,b)){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,null,a], null);
} else {
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(clojure.data.equality_partition(a),clojure.data.equality_partition(b))){
return clojure.data.diff_similar(a,b);
} else {
return clojure.data.atom_diff(a,b);
}
}
});
//# sourceMappingURL=clojure.data.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,83 @@
goog.provide('clojure.datafy');
/**
* Attempts to return x as data.
* datafy will return the value of clojure.protocols/datafy. If
* the value has been transformed and the result supports
* metadata, :clojure.datafy/obj will be set on the metadata to the
* original value of x.
*/
clojure.datafy.datafy = (function clojure$datafy$datafy(x){
var v = clojure.core.protocols.datafy(x);
if((v === x)){
return v;
} else {
if((((!((v == null))))?(((((v.cljs$lang$protocol_mask$partition0$ & (262144))) || ((cljs.core.PROTOCOL_SENTINEL === v.cljs$core$IWithMeta$))))?true:false):false)){
return cljs.core.vary_meta.cljs$core$IFn$_invoke$arity$4(v,cljs.core.assoc,new cljs.core.Keyword("clojure.datafy","obj","clojure.datafy/obj",-330079421),x);
} else {
return v;
}
}
});
/**
* Returns (possibly transformed) v in the context of coll and k (a
* key/index or nil). Callers should attempt to provide the key/index
* context k for Indexed/Associative/ILookup colls if possible, but not
* to fabricate one e.g. for sequences (pass nil). nav will return the
* value of clojure.core.protocols/nav.
*/
clojure.datafy.nav = (function clojure$datafy$nav(coll,k,v){
return clojure.core.protocols.nav(coll,k,v);
});
clojure.datafy.datify_ref = (function clojure$datafy$datify_ref(r){
return cljs.core.with_meta(new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.deref(r)], null),cljs.core.meta(r));
});
(Error.prototype.clojure$core$protocols$Datafiable$ = cljs.core.PROTOCOL_SENTINEL);
(Error.prototype.clojure$core$protocols$Datafiable$datafy$arity$1 = (function (x){
var x__$1 = this;
return cljs.core.Throwable__GT_map(x__$1);
}));
(cljs.core.ExceptionInfo.prototype.clojure$core$protocols$Datafiable$ = cljs.core.PROTOCOL_SENTINEL);
(cljs.core.ExceptionInfo.prototype.clojure$core$protocols$Datafiable$datafy$arity$1 = (function (x){
var x__$1 = this;
return cljs.core.Throwable__GT_map(x__$1);
}));
(cljs.core.Var.prototype.clojure$core$protocols$Datafiable$ = cljs.core.PROTOCOL_SENTINEL);
(cljs.core.Var.prototype.clojure$core$protocols$Datafiable$datafy$arity$1 = (function (r){
var r__$1 = this;
return clojure.datafy.datify_ref(r__$1);
}));
(cljs.core.Reduced.prototype.clojure$core$protocols$Datafiable$ = cljs.core.PROTOCOL_SENTINEL);
(cljs.core.Reduced.prototype.clojure$core$protocols$Datafiable$datafy$arity$1 = (function (r){
var r__$1 = this;
return clojure.datafy.datify_ref(r__$1);
}));
(cljs.core.Atom.prototype.clojure$core$protocols$Datafiable$ = cljs.core.PROTOCOL_SENTINEL);
(cljs.core.Atom.prototype.clojure$core$protocols$Datafiable$datafy$arity$1 = (function (r){
var r__$1 = this;
return clojure.datafy.datify_ref(r__$1);
}));
(cljs.core.Volatile.prototype.clojure$core$protocols$Datafiable$ = cljs.core.PROTOCOL_SENTINEL);
(cljs.core.Volatile.prototype.clojure$core$protocols$Datafiable$datafy$arity$1 = (function (r){
var r__$1 = this;
return clojure.datafy.datify_ref(r__$1);
}));
(cljs.core.Delay.prototype.clojure$core$protocols$Datafiable$ = cljs.core.PROTOCOL_SENTINEL);
(cljs.core.Delay.prototype.clojure$core$protocols$Datafiable$datafy$arity$1 = (function (r){
var r__$1 = this;
return clojure.datafy.datify_ref(r__$1);
}));
//# sourceMappingURL=clojure.datafy.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["clojure/datafy.cljs"],"mappings":";AAaA;;;;;;;wBAAA,xBAAMA,wDAMHC;AANH,AAOE,IAAMC,IAAE,AAACC,8BAASF;AAAlB,AACE,GAAI,CAAYC,MAAED;AAChBC;;AACA,GAAI,EAAA,GAAA,MAAA,SAAA,EAAA,EAAA,CAAA,wCAAA,eAAA,CAAAE,gCAAA,2BAAA,KAAA,OAAA,lJAAuBF,mBAAAA,wFAAAA;AACzB,2EAAA,pEAACG,kDAAUH,EAAEI,8FAAYL;;AAIzBC;;;;AAER;;;;;;;qBAAA,rBAAMK,kDAMHC,KAAKC,EAAEP;AANV,AAOE,OAACQ,2BAAMF,KAAKC,EAAEP;;AAEhB,4BAAA,5BAAOS,gEAAYC;AAAnB,AACE,2BAAA,pBAACC,uGAAW,AAACC,gBAAMF,WAAI,AAACG,eAAKH;;AAE/B,AAAA,AAAA,CAAA,AAAA,qDAAAR,rDACEY;;AADF,CAAA,AAAA,AACEA,mEACA,WAASf;AAAT,AAAA,YAAA,RAASA;AAAT,AAAY,OAACgB,4BAAehB;;;AAF9B,AAAA,CAAA,AAAA,uEAAAG,vEAIEc;;AAJF,CAAA,AAAA,AAIEA,qFACA,WAASjB;AAAT,AAAA,YAAA,RAASA;AAAT,AAAY,OAACgB,4BAAehB;;;AAL9B,AAAA,CAAA,AAAA,6DAAAG,7DAOEe;;AAPF,CAAA,AAAA,AAOEA,2EACA,WAASP;AAAT,AAAA,YAAA,RAASA;AAAT,AAAY,OAACD,0BAAWC;;;AAR1B,AAAA,CAAA,AAAA,iEAAAR,jEAUEgB;;AAVF,CAAA,AAAA,AAUEA,+EACA,WAASR;AAAT,AAAA,YAAA,RAASA;AAAT,AAAY,OAACD,0BAAWC;;;AAX1B,AAAA,CAAA,AAAA,8DAAAR,9DAaEiB;;AAbF,CAAA,AAAA,AAaEA,4EACA,WAAST;AAAT,AAAA,YAAA,RAASA;AAAT,AAAY,OAACD,0BAAWC;;;AAd1B,AAAA,CAAA,AAAA,kEAAAR,lEAgBEkB;;AAhBF,CAAA,AAAA,AAgBEA,gFACA,WAASV;AAAT,AAAA,YAAA,RAASA;AAAT,AAAY,OAACD,0BAAWC;;;AAjB1B,AAAA,CAAA,AAAA,+DAAAR,/DAmBEmB;;AAnBF,CAAA,AAAA,AAmBEA,6EACA,WAASX;AAAT,AAAA,YAAA,RAASA;AAAT,AAAY,OAACD,0BAAWC","names":["clojure.datafy/datafy","x","v","clojure.core.protocols/datafy","cljs.core/PROTOCOL_SENTINEL","cljs.core.vary_meta","cljs.core/assoc","clojure.datafy/nav","coll","k","clojure.core.protocols/nav","clojure.datafy/datify-ref","r","cljs.core/with-meta","cljs.core/deref","cljs.core/meta","js/Error","cljs.core/Throwable->map","cljs.core/ExceptionInfo","cljs.core/Var","cljs.core/Reduced","cljs.core/Atom","cljs.core/Volatile","cljs.core/Delay"],"sourcesContent":["; Copyright (c) Rich Hickey. All rights reserved.\n; The use and distribution terms for this software are covered by the\n; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)\n; which can be found in the file epl-v10.html at the root of this distribution.\n; By using this software in any fashion, you are agreeing to be bound by\n; the terms of this license.\n; You must not remove this notice, or any other, from this software.\n\n(ns\n ^{:doc \"Functions to turn objects into data. Alpha, subject to change\"}\n clojure.datafy\n (:require [clojure.core.protocols :as p]))\n\n(defn datafy\n \"Attempts to return x as data.\n datafy will return the value of clojure.protocols/datafy. If\n the value has been transformed and the result supports\n metadata, :clojure.datafy/obj will be set on the metadata to the\n original value of x.\"\n [x]\n (let [v (p/datafy x)]\n (if (identical? v x)\n v\n (if (implements? IWithMeta v)\n (vary-meta v assoc ::obj x\n ;; Circling back to this at a later date per @dnolen\n ;; ::class (-> x .-constructor .-name symbol)\n )\n v))))\n\n(defn nav\n \"Returns (possibly transformed) v in the context of coll and k (a\n key/index or nil). Callers should attempt to provide the key/index\n context k for Indexed/Associative/ILookup colls if possible, but not\n to fabricate one e.g. for sequences (pass nil). nav will return the\n value of clojure.core.protocols/nav.\"\n [coll k v]\n (p/nav coll k v))\n\n(defn- datify-ref [r]\n (with-meta [(deref r)] (meta r)))\n\n(extend-protocol p/Datafiable\n js/Error\n (datafy [x] (Throwable->map x))\n\n ExceptionInfo\n (datafy [x] (Throwable->map x))\n\n Var\n (datafy [r] (datify-ref r))\n\n Reduced\n (datafy [r] (datify-ref r))\n\n Atom\n (datafy [r] (datify-ref r))\n\n Volatile\n (datafy [r] (datify-ref r))\n\n Delay\n (datafy [r] (datify-ref r)))\n"],"x_google_ignoreList":[0]}

View File

@@ -0,0 +1,380 @@
goog.provide('clojure.set');
clojure.set.bubble_max_key = (function clojure$set$bubble_max_key(k,coll){
var max = cljs.core.apply.cljs$core$IFn$_invoke$arity$3(cljs.core.max_key,k,coll);
return cljs.core.cons(max,cljs.core.remove.cljs$core$IFn$_invoke$arity$2((function (p1__19722_SHARP_){
return (max === p1__19722_SHARP_);
}),coll));
});
/**
* Return a set that is the union of the input sets
*/
clojure.set.union = (function clojure$set$union(var_args){
var G__19735 = arguments.length;
switch (G__19735) {
case 0:
return clojure.set.union.cljs$core$IFn$_invoke$arity$0();
break;
case 1:
return clojure.set.union.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
break;
case 2:
return clojure.set.union.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
break;
default:
var args_arr__5751__auto__ = [];
var len__5726__auto___19881 = arguments.length;
var i__5727__auto___19882 = (0);
while(true){
if((i__5727__auto___19882 < len__5726__auto___19881)){
args_arr__5751__auto__.push((arguments[i__5727__auto___19882]));
var G__19883 = (i__5727__auto___19882 + (1));
i__5727__auto___19882 = G__19883;
continue;
} else {
}
break;
}
var argseq__5752__auto__ = ((((2) < args_arr__5751__auto__.length))?(new cljs.core.IndexedSeq(args_arr__5751__auto__.slice((2)),(0),null)):null);
return clojure.set.union.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),argseq__5752__auto__);
}
});
(clojure.set.union.cljs$core$IFn$_invoke$arity$0 = (function (){
return cljs.core.PersistentHashSet.EMPTY;
}));
(clojure.set.union.cljs$core$IFn$_invoke$arity$1 = (function (s1){
return s1;
}));
(clojure.set.union.cljs$core$IFn$_invoke$arity$2 = (function (s1,s2){
if((cljs.core.count(s1) < cljs.core.count(s2))){
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core.conj,s2,s1);
} else {
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core.conj,s1,s2);
}
}));
(clojure.set.union.cljs$core$IFn$_invoke$arity$variadic = (function (s1,s2,sets){
var bubbled_sets = clojure.set.bubble_max_key(cljs.core.count,cljs.core.conj.cljs$core$IFn$_invoke$arity$variadic(sets,s2,cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([s1], 0)));
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core.into,cljs.core.first(bubbled_sets),cljs.core.rest(bubbled_sets));
}));
/** @this {Function} */
(clojure.set.union.cljs$lang$applyTo = (function (seq19731){
var G__19732 = cljs.core.first(seq19731);
var seq19731__$1 = cljs.core.next(seq19731);
var G__19733 = cljs.core.first(seq19731__$1);
var seq19731__$2 = cljs.core.next(seq19731__$1);
var self__5711__auto__ = this;
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__19732,G__19733,seq19731__$2);
}));
(clojure.set.union.cljs$lang$maxFixedArity = (2));
/**
* Return a set that is the intersection of the input sets
*/
clojure.set.intersection = (function clojure$set$intersection(var_args){
var G__19759 = arguments.length;
switch (G__19759) {
case 1:
return clojure.set.intersection.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
break;
case 2:
return clojure.set.intersection.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
break;
default:
var args_arr__5751__auto__ = [];
var len__5726__auto___19895 = arguments.length;
var i__5727__auto___19896 = (0);
while(true){
if((i__5727__auto___19896 < len__5726__auto___19895)){
args_arr__5751__auto__.push((arguments[i__5727__auto___19896]));
var G__19898 = (i__5727__auto___19896 + (1));
i__5727__auto___19896 = G__19898;
continue;
} else {
}
break;
}
var argseq__5752__auto__ = ((((2) < args_arr__5751__auto__.length))?(new cljs.core.IndexedSeq(args_arr__5751__auto__.slice((2)),(0),null)):null);
return clojure.set.intersection.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),argseq__5752__auto__);
}
});
(clojure.set.intersection.cljs$core$IFn$_invoke$arity$1 = (function (s1){
return s1;
}));
(clojure.set.intersection.cljs$core$IFn$_invoke$arity$2 = (function (s1,s2){
while(true){
if((cljs.core.count(s2) < cljs.core.count(s1))){
var G__19905 = s2;
var G__19906 = s1;
s1 = G__19905;
s2 = G__19906;
continue;
} else {
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(((function (s1,s2){
return (function (result,item){
if(cljs.core.contains_QMARK_(s2,item)){
return result;
} else {
return cljs.core.disj.cljs$core$IFn$_invoke$arity$2(result,item);
}
});})(s1,s2))
,s1,s1);
}
break;
}
}));
(clojure.set.intersection.cljs$core$IFn$_invoke$arity$variadic = (function (s1,s2,sets){
var bubbled_sets = clojure.set.bubble_max_key((function (p1__19750_SHARP_){
return (- cljs.core.count(p1__19750_SHARP_));
}),cljs.core.conj.cljs$core$IFn$_invoke$arity$variadic(sets,s2,cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([s1], 0)));
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(clojure.set.intersection,cljs.core.first(bubbled_sets),cljs.core.rest(bubbled_sets));
}));
/** @this {Function} */
(clojure.set.intersection.cljs$lang$applyTo = (function (seq19752){
var G__19753 = cljs.core.first(seq19752);
var seq19752__$1 = cljs.core.next(seq19752);
var G__19754 = cljs.core.first(seq19752__$1);
var seq19752__$2 = cljs.core.next(seq19752__$1);
var self__5711__auto__ = this;
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__19753,G__19754,seq19752__$2);
}));
(clojure.set.intersection.cljs$lang$maxFixedArity = (2));
/**
* Return a set that is the first set without elements of the remaining sets
*/
clojure.set.difference = (function clojure$set$difference(var_args){
var G__19786 = arguments.length;
switch (G__19786) {
case 1:
return clojure.set.difference.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
break;
case 2:
return clojure.set.difference.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
break;
default:
var args_arr__5751__auto__ = [];
var len__5726__auto___19917 = arguments.length;
var i__5727__auto___19918 = (0);
while(true){
if((i__5727__auto___19918 < len__5726__auto___19917)){
args_arr__5751__auto__.push((arguments[i__5727__auto___19918]));
var G__19920 = (i__5727__auto___19918 + (1));
i__5727__auto___19918 = G__19920;
continue;
} else {
}
break;
}
var argseq__5752__auto__ = ((((2) < args_arr__5751__auto__.length))?(new cljs.core.IndexedSeq(args_arr__5751__auto__.slice((2)),(0),null)):null);
return clojure.set.difference.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),argseq__5752__auto__);
}
});
(clojure.set.difference.cljs$core$IFn$_invoke$arity$1 = (function (s1){
return s1;
}));
(clojure.set.difference.cljs$core$IFn$_invoke$arity$2 = (function (s1,s2){
if((cljs.core.count(s1) < cljs.core.count(s2))){
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (result,item){
if(cljs.core.contains_QMARK_(s2,item)){
return cljs.core.disj.cljs$core$IFn$_invoke$arity$2(result,item);
} else {
return result;
}
}),s1,s1);
} else {
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core.disj,s1,s2);
}
}));
(clojure.set.difference.cljs$core$IFn$_invoke$arity$variadic = (function (s1,s2,sets){
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(clojure.set.difference,s1,cljs.core.conj.cljs$core$IFn$_invoke$arity$2(sets,s2));
}));
/** @this {Function} */
(clojure.set.difference.cljs$lang$applyTo = (function (seq19783){
var G__19784 = cljs.core.first(seq19783);
var seq19783__$1 = cljs.core.next(seq19783);
var G__19785 = cljs.core.first(seq19783__$1);
var seq19783__$2 = cljs.core.next(seq19783__$1);
var self__5711__auto__ = this;
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__19784,G__19785,seq19783__$2);
}));
(clojure.set.difference.cljs$lang$maxFixedArity = (2));
/**
* Returns a set of the elements for which pred is true
*/
clojure.set.select = (function clojure$set$select(pred,xset){
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (s,k){
if(cljs.core.truth_((pred.cljs$core$IFn$_invoke$arity$1 ? pred.cljs$core$IFn$_invoke$arity$1(k) : pred.call(null, k)))){
return s;
} else {
return cljs.core.disj.cljs$core$IFn$_invoke$arity$2(s,k);
}
}),xset,xset);
});
/**
* Returns a rel of the elements of xrel with only the keys in ks
*/
clojure.set.project = (function clojure$set$project(xrel,ks){
return cljs.core.set(cljs.core.map.cljs$core$IFn$_invoke$arity$2((function (p1__19805_SHARP_){
return cljs.core.select_keys(p1__19805_SHARP_,ks);
}),xrel));
});
/**
* Returns the map with the keys in kmap renamed to the vals in kmap
*/
clojure.set.rename_keys = (function clojure$set$rename_keys(map,kmap){
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (m,p__19811){
var vec__19812 = p__19811;
var old = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__19812,(0),null);
var new$ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__19812,(1),null);
if(cljs.core.contains_QMARK_(map,old)){
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(m,new$,cljs.core.get.cljs$core$IFn$_invoke$arity$2(map,old));
} else {
return m;
}
}),cljs.core.apply.cljs$core$IFn$_invoke$arity$3(cljs.core.dissoc,map,cljs.core.keys(kmap)),kmap);
});
/**
* Returns a rel of the maps in xrel with the keys in kmap renamed to the vals in kmap
*/
clojure.set.rename = (function clojure$set$rename(xrel,kmap){
return cljs.core.set(cljs.core.map.cljs$core$IFn$_invoke$arity$2((function (p1__19816_SHARP_){
return clojure.set.rename_keys(p1__19816_SHARP_,kmap);
}),xrel));
});
/**
* Returns a map of the distinct values of ks in the xrel mapped to a
* set of the maps in xrel with the corresponding values of ks.
*/
clojure.set.index = (function clojure$set$index(xrel,ks){
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (m,x){
var ik = cljs.core.select_keys(x,ks);
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(m,ik,cljs.core.conj.cljs$core$IFn$_invoke$arity$2(cljs.core.get.cljs$core$IFn$_invoke$arity$3(m,ik,cljs.core.PersistentHashSet.EMPTY),x));
}),cljs.core.PersistentArrayMap.EMPTY,xrel);
});
/**
* Returns the map with the vals mapped to the keys.
*/
clojure.set.map_invert = (function clojure$set$map_invert(m){
return cljs.core.persistent_BANG_(cljs.core.reduce_kv((function (m__$1,k,v){
return cljs.core.assoc_BANG_.cljs$core$IFn$_invoke$arity$3(m__$1,v,k);
}),cljs.core.transient$(cljs.core.PersistentArrayMap.EMPTY),m));
});
/**
* When passed 2 rels, returns the rel corresponding to the natural
* join. When passed an additional keymap, joins on the corresponding
* keys.
*/
clojure.set.join = (function clojure$set$join(var_args){
var G__19832 = arguments.length;
switch (G__19832) {
case 2:
return clojure.set.join.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
break;
case 3:
return clojure.set.join.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));
break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
}
});
(clojure.set.join.cljs$core$IFn$_invoke$arity$2 = (function (xrel,yrel){
if(((cljs.core.seq(xrel)) && (cljs.core.seq(yrel)))){
var ks = clojure.set.intersection.cljs$core$IFn$_invoke$arity$2(cljs.core.set(cljs.core.keys(cljs.core.first(xrel))),cljs.core.set(cljs.core.keys(cljs.core.first(yrel))));
var vec__19836 = (((cljs.core.count(xrel) <= cljs.core.count(yrel)))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [xrel,yrel], null):new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [yrel,xrel], null));
var r = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__19836,(0),null);
var s = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__19836,(1),null);
var idx = clojure.set.index(r,ks);
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (ret,x){
var found = (function (){var G__19841 = cljs.core.select_keys(x,ks);
return (idx.cljs$core$IFn$_invoke$arity$1 ? idx.cljs$core$IFn$_invoke$arity$1(G__19841) : idx.call(null, G__19841));
})();
if(cljs.core.truth_(found)){
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (p1__19825_SHARP_,p2__19826_SHARP_){
return cljs.core.conj.cljs$core$IFn$_invoke$arity$2(p1__19825_SHARP_,cljs.core.merge.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([p2__19826_SHARP_,x], 0)));
}),ret,found);
} else {
return ret;
}
}),cljs.core.PersistentHashSet.EMPTY,s);
} else {
return cljs.core.PersistentHashSet.EMPTY;
}
}));
(clojure.set.join.cljs$core$IFn$_invoke$arity$3 = (function (xrel,yrel,km){
var vec__19850 = (((cljs.core.count(xrel) <= cljs.core.count(yrel)))?new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [xrel,yrel,clojure.set.map_invert(km)], null):new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [yrel,xrel,km], null));
var r = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__19850,(0),null);
var s = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__19850,(1),null);
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__19850,(2),null);
var idx = clojure.set.index(r,cljs.core.vals(k));
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (ret,x){
var found = (function (){var G__19853 = clojure.set.rename_keys(cljs.core.select_keys(x,cljs.core.keys(k)),k);
return (idx.cljs$core$IFn$_invoke$arity$1 ? idx.cljs$core$IFn$_invoke$arity$1(G__19853) : idx.call(null, G__19853));
})();
if(cljs.core.truth_(found)){
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (p1__19827_SHARP_,p2__19828_SHARP_){
return cljs.core.conj.cljs$core$IFn$_invoke$arity$2(p1__19827_SHARP_,cljs.core.merge.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([p2__19828_SHARP_,x], 0)));
}),ret,found);
} else {
return ret;
}
}),cljs.core.PersistentHashSet.EMPTY,s);
}));
(clojure.set.join.cljs$lang$maxFixedArity = 3);
/**
* Is set1 a subset of set2?
*/
clojure.set.subset_QMARK_ = (function clojure$set$subset_QMARK_(set1,set2){
return (((cljs.core.count(set1) <= cljs.core.count(set2))) && (cljs.core.every_QMARK_((function (p1__19858_SHARP_){
return cljs.core.contains_QMARK_(set2,p1__19858_SHARP_);
}),set1)));
});
/**
* Is set1 a superset of set2?
*/
clojure.set.superset_QMARK_ = (function clojure$set$superset_QMARK_(set1,set2){
return (((cljs.core.count(set1) >= cljs.core.count(set2))) && (cljs.core.every_QMARK_((function (p1__19872_SHARP_){
return cljs.core.contains_QMARK_(set1,p1__19872_SHARP_);
}),set2)));
});
//# sourceMappingURL=clojure.set.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,476 @@
goog.provide('clojure.string');
clojure.string.seq_reverse = (function clojure$string$seq_reverse(coll){
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core.conj,cljs.core.List.EMPTY,coll);
});
clojure.string.re_surrogate_pair = (new RegExp("([\\uD800-\\uDBFF])([\\uDC00-\\uDFFF])","g"));
/**
* Returns s with its characters reversed.
*/
clojure.string.reverse = (function clojure$string$reverse(s){
return s.replace(clojure.string.re_surrogate_pair,"$2$1").split("").reverse().join("");
});
clojure.string.replace_all = (function clojure$string$replace_all(s,re,replacement){
var r = (new RegExp(re.source,(function (){var G__19793 = "g";
var G__19793__$1 = (cljs.core.truth_(re.ignoreCase)?[G__19793,"i"].join(''):G__19793);
var G__19793__$2 = (cljs.core.truth_(re.multiline)?[G__19793__$1,"m"].join(''):G__19793__$1);
if(cljs.core.truth_(re.unicode)){
return [G__19793__$2,"u"].join('');
} else {
return G__19793__$2;
}
})()));
return s.replace(r,replacement);
});
clojure.string.replace_with = (function clojure$string$replace_with(f){
return (function() {
var G__20068__delegate = function (args){
var matches = cljs.core.drop_last.cljs$core$IFn$_invoke$arity$2((2),args);
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(cljs.core.count(matches),(1))){
var G__19807 = cljs.core.first(matches);
return (f.cljs$core$IFn$_invoke$arity$1 ? f.cljs$core$IFn$_invoke$arity$1(G__19807) : f.call(null, G__19807));
} else {
var G__19808 = cljs.core.vec(matches);
return (f.cljs$core$IFn$_invoke$arity$1 ? f.cljs$core$IFn$_invoke$arity$1(G__19808) : f.call(null, G__19808));
}
};
var G__20068 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__20073__i = 0, G__20073__a = new Array(arguments.length - 0);
while (G__20073__i < G__20073__a.length) {G__20073__a[G__20073__i] = arguments[G__20073__i + 0]; ++G__20073__i;}
args = new cljs.core.IndexedSeq(G__20073__a,0,null);
}
return G__20068__delegate.call(this,args);};
G__20068.cljs$lang$maxFixedArity = 0;
G__20068.cljs$lang$applyTo = (function (arglist__20074){
var args = cljs.core.seq(arglist__20074);
return G__20068__delegate(args);
});
G__20068.cljs$core$IFn$_invoke$arity$variadic = G__20068__delegate;
return G__20068;
})()
;
});
/**
* Replaces all instance of match with replacement in s.
*
* match/replacement can be:
*
* string / string
* pattern / (string or function of match).
*
* See also replace-first.
*
* The replacement is literal (i.e. none of its characters are treated
* specially) for all cases above except pattern / string.
*
* For pattern / string, $1, $2, etc. in the replacement string are
* substituted with the string that matched the corresponding
* parenthesized group in the pattern.
*
* Example:
* (clojure.string/replace "Almost Pig Latin" #"\b(\w)(\w+)\b" "$2$1ay")
* -> "lmostAay igPay atinLay"
*/
clojure.string.replace = (function clojure$string$replace(s,match,replacement){
if(typeof match === 'string'){
return s.replace((new RegExp(goog.string.regExpEscape(match),"g")),replacement);
} else {
if((match instanceof RegExp)){
if(typeof replacement === 'string'){
return clojure.string.replace_all(s,match,replacement);
} else {
return clojure.string.replace_all(s,match,clojure.string.replace_with(replacement));
}
} else {
throw ["Invalid match arg: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(match)].join('');
}
}
});
/**
* Replaces the first instance of match with replacement in s.
*
* match/replacement can be:
*
* string / string
* pattern / (string or function of match).
*
* See also replace.
*
* The replacement is literal (i.e. none of its characters are treated
* specially) for all cases above except pattern / string.
*
* For pattern / string, $1, $2, etc. in the replacement string are
* substituted with the string that matched the corresponding
* parenthesized group in the pattern.
*
* Example:
* (clojure.string/replace-first "swap first two words"
* #"(\w+)(\s+)(\w+)" "$3$2$1")
* -> "first swap two words"
*/
clojure.string.replace_first = (function clojure$string$replace_first(s,match,replacement){
return s.replace(match,replacement);
});
/**
* Returns a string of all elements in coll, as returned by (seq coll),
* separated by an optional separator.
*/
clojure.string.join = (function clojure$string$join(var_args){
var G__19821 = arguments.length;
switch (G__19821) {
case 1:
return clojure.string.join.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
break;
case 2:
return clojure.string.join.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
}
});
(clojure.string.join.cljs$core$IFn$_invoke$arity$1 = (function (coll){
var sb = (new goog.string.StringBuffer());
var coll__$1 = cljs.core.seq(coll);
while(true){
if((!((coll__$1 == null)))){
var G__20104 = sb.append(cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.first(coll__$1)));
var G__20105 = cljs.core.next(coll__$1);
sb = G__20104;
coll__$1 = G__20105;
continue;
} else {
return sb.toString();
}
break;
}
}));
(clojure.string.join.cljs$core$IFn$_invoke$arity$2 = (function (separator,coll){
var sb = (new goog.string.StringBuffer());
var coll__$1 = cljs.core.seq(coll);
while(true){
if((!((coll__$1 == null)))){
sb.append(cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.first(coll__$1)));
var coll__$2 = cljs.core.next(coll__$1);
if((coll__$2 == null)){
} else {
sb.append(separator);
}
var G__20115 = sb;
var G__20116 = coll__$2;
sb = G__20115;
coll__$1 = G__20116;
continue;
} else {
return sb.toString();
}
break;
}
}));
(clojure.string.join.cljs$lang$maxFixedArity = 2);
/**
* Converts string to all upper-case.
*/
clojure.string.upper_case = (function clojure$string$upper_case(s){
return s.toUpperCase();
});
/**
* Converts string to all lower-case.
*/
clojure.string.lower_case = (function clojure$string$lower_case(s){
return s.toLowerCase();
});
/**
* Converts first character of the string to upper-case, all other
* characters to lower-case.
*/
clojure.string.capitalize = (function clojure$string$capitalize(s){
return goog.string.capitalize(s);
});
clojure.string.pop_last_while_empty = (function clojure$string$pop_last_while_empty(v){
var v__$1 = v;
while(true){
if(("" === cljs.core.peek(v__$1))){
var G__20122 = cljs.core.pop(v__$1);
v__$1 = G__20122;
continue;
} else {
return v__$1;
}
break;
}
});
clojure.string.discard_trailing_if_needed = (function clojure$string$discard_trailing_if_needed(limit,v){
if(((((0) === limit)) && (((1) < cljs.core.count(v))))){
return clojure.string.pop_last_while_empty(v);
} else {
return v;
}
});
clojure.string.split_with_empty_regex = (function clojure$string$split_with_empty_regex(s,limit){
if((((limit <= (0))) || ((limit >= ((2) + cljs.core.count(s)))))){
return cljs.core.conj.cljs$core$IFn$_invoke$arity$2(cljs.core.vec(cljs.core.cons("",cljs.core.map.cljs$core$IFn$_invoke$arity$2(cljs.core.str,cljs.core.seq(s)))),"");
} else {
var pred__19873 = cljs.core._EQ__EQ_;
var expr__19874 = limit;
if(cljs.core.truth_((pred__19873.cljs$core$IFn$_invoke$arity$2 ? pred__19873.cljs$core$IFn$_invoke$arity$2((1),expr__19874) : pred__19873.call(null, (1),expr__19874)))){
return (new cljs.core.PersistentVector(null,1,(5),cljs.core.PersistentVector.EMPTY_NODE,[s],null));
} else {
if(cljs.core.truth_((pred__19873.cljs$core$IFn$_invoke$arity$2 ? pred__19873.cljs$core$IFn$_invoke$arity$2((2),expr__19874) : pred__19873.call(null, (2),expr__19874)))){
return (new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,["",s],null));
} else {
var c = (limit - (2));
return cljs.core.conj.cljs$core$IFn$_invoke$arity$2(cljs.core.vec(cljs.core.cons("",cljs.core.subvec.cljs$core$IFn$_invoke$arity$3(cljs.core.vec(cljs.core.map.cljs$core$IFn$_invoke$arity$2(cljs.core.str,cljs.core.seq(s))),(0),c))),cljs.core.subs.cljs$core$IFn$_invoke$arity$2(s,c));
}
}
}
});
/**
* Splits string on a regular expression. Optional argument limit is
* the maximum number of parts. Not lazy. Returns vector of the parts.
* Trailing empty strings are not returned - pass limit of -1 to return all.
*/
clojure.string.split = (function clojure$string$split(var_args){
var G__19880 = arguments.length;
switch (G__19880) {
case 2:
return clojure.string.split.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
break;
case 3:
return clojure.string.split.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));
break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
}
});
(clojure.string.split.cljs$core$IFn$_invoke$arity$2 = (function (s,re){
return clojure.string.split.cljs$core$IFn$_invoke$arity$3(s,re,(0));
}));
(clojure.string.split.cljs$core$IFn$_invoke$arity$3 = (function (s,re,limit){
return clojure.string.discard_trailing_if_needed(limit,((("/(?:)/" === cljs.core.str.cljs$core$IFn$_invoke$arity$1(re)))?clojure.string.split_with_empty_regex(s,limit):(((limit < (1)))?cljs.core.vec(cljs.core.str.cljs$core$IFn$_invoke$arity$1(s).split(re)):(function (){var s__$1 = s;
var limit__$1 = limit;
var parts = cljs.core.PersistentVector.EMPTY;
while(true){
if(((1) === limit__$1)){
return cljs.core.conj.cljs$core$IFn$_invoke$arity$2(parts,s__$1);
} else {
var m = cljs.core.re_find(re,s__$1);
if((!((m == null)))){
var index = s__$1.indexOf(m);
var G__20182 = s__$1.substring((index + cljs.core.count(m)));
var G__20183 = (limit__$1 - (1));
var G__20184 = cljs.core.conj.cljs$core$IFn$_invoke$arity$2(parts,s__$1.substring((0),index));
s__$1 = G__20182;
limit__$1 = G__20183;
parts = G__20184;
continue;
} else {
return cljs.core.conj.cljs$core$IFn$_invoke$arity$2(parts,s__$1);
}
}
break;
}
})())));
}));
(clojure.string.split.cljs$lang$maxFixedArity = 3);
/**
* Splits s on \n or \r\n. Trailing empty lines are not returned.
*/
clojure.string.split_lines = (function clojure$string$split_lines(s){
return clojure.string.split.cljs$core$IFn$_invoke$arity$2(s,/\n|\r\n/);
});
/**
* Removes whitespace from both ends of string.
*/
clojure.string.trim = (function clojure$string$trim(s){
return goog.string.trim(s);
});
/**
* Removes whitespace from the left side of string.
*/
clojure.string.triml = (function clojure$string$triml(s){
return goog.string.trimLeft(s);
});
/**
* Removes whitespace from the right side of string.
*/
clojure.string.trimr = (function clojure$string$trimr(s){
return goog.string.trimRight(s);
});
/**
* Removes all trailing newline \n or return \r characters from
* string. Similar to Perl's chomp.
*/
clojure.string.trim_newline = (function clojure$string$trim_newline(s){
var index = s.length;
while(true){
if((index === (0))){
return "";
} else {
var ch = cljs.core.get.cljs$core$IFn$_invoke$arity$2(s,(index - (1)));
if(((("\n" === ch)) || (("\r" === ch)))){
var G__20212 = (index - (1));
index = G__20212;
continue;
} else {
return s.substring((0),index);
}
}
break;
}
});
/**
* True if s is nil, empty, or contains only whitespace.
*/
clojure.string.blank_QMARK_ = (function clojure$string$blank_QMARK_(s){
return goog.string.isEmptyOrWhitespace(goog.string.makeSafe(s));
});
/**
* Return a new string, using cmap to escape each character ch
* from s as follows:
*
* If (cmap ch) is nil, append ch to the new string.
* If (cmap ch) is non-nil, append (str (cmap ch)) instead.
*/
clojure.string.escape = (function clojure$string$escape(s,cmap){
var buffer = (new goog.string.StringBuffer());
var length = s.length;
var index = (0);
while(true){
if((length === index)){
return buffer.toString();
} else {
var ch = s.charAt(index);
var replacement = (cmap.cljs$core$IFn$_invoke$arity$1 ? cmap.cljs$core$IFn$_invoke$arity$1(ch) : cmap.call(null, ch));
if((!((replacement == null)))){
buffer.append(cljs.core.str.cljs$core$IFn$_invoke$arity$1(replacement));
} else {
buffer.append(ch);
}
var G__20224 = (index + (1));
index = G__20224;
continue;
}
break;
}
});
/**
* Return index of value (string or char) in s, optionally searching
* forward from from-index or nil if not found.
*/
clojure.string.index_of = (function clojure$string$index_of(var_args){
var G__19970 = arguments.length;
switch (G__19970) {
case 2:
return clojure.string.index_of.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
break;
case 3:
return clojure.string.index_of.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));
break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
}
});
(clojure.string.index_of.cljs$core$IFn$_invoke$arity$2 = (function (s,value){
var result = s.indexOf(value);
if((result < (0))){
return null;
} else {
return result;
}
}));
(clojure.string.index_of.cljs$core$IFn$_invoke$arity$3 = (function (s,value,from_index){
var result = s.indexOf(value,from_index);
if((result < (0))){
return null;
} else {
return result;
}
}));
(clojure.string.index_of.cljs$lang$maxFixedArity = 3);
/**
* Return last index of value (string or char) in s, optionally
* searching backward from from-index or nil if not found.
*/
clojure.string.last_index_of = (function clojure$string$last_index_of(var_args){
var G__19995 = arguments.length;
switch (G__19995) {
case 2:
return clojure.string.last_index_of.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
break;
case 3:
return clojure.string.last_index_of.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));
break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
}
});
(clojure.string.last_index_of.cljs$core$IFn$_invoke$arity$2 = (function (s,value){
var result = s.lastIndexOf(value);
if((result < (0))){
return null;
} else {
return result;
}
}));
(clojure.string.last_index_of.cljs$core$IFn$_invoke$arity$3 = (function (s,value,from_index){
var result = s.lastIndexOf(value,from_index);
if((result < (0))){
return null;
} else {
return result;
}
}));
(clojure.string.last_index_of.cljs$lang$maxFixedArity = 3);
/**
* True if s starts with substr.
*/
clojure.string.starts_with_QMARK_ = (function clojure$string$starts_with_QMARK_(s,substr){
return goog.string.startsWith(s,substr);
});
/**
* True if s ends with substr.
*/
clojure.string.ends_with_QMARK_ = (function clojure$string$ends_with_QMARK_(s,substr){
return goog.string.endsWith(s,substr);
});
/**
* True if s includes substr.
*/
clojure.string.includes_QMARK_ = (function clojure$string$includes_QMARK_(s,substr){
return goog.string.contains(s,substr);
});
//# sourceMappingURL=clojure.string.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,130 @@
goog.provide('clojure.walk');
/**
* Traverses form, an arbitrary data structure. inner and outer are
* functions. Applies inner to each element of form, building up a
* data structure of the same type, then applies outer to the result.
* Recognizes all Clojure data structures. Consumes seqs as with doall.
*/
clojure.walk.walk = (function clojure$walk$walk(inner,outer,form){
if(cljs.core.list_QMARK_(form)){
var G__21737 = cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.list,cljs.core.map.cljs$core$IFn$_invoke$arity$2(inner,form));
return (outer.cljs$core$IFn$_invoke$arity$1 ? outer.cljs$core$IFn$_invoke$arity$1(G__21737) : outer.call(null, G__21737));
} else {
if(cljs.core.map_entry_QMARK_(form)){
var G__21738 = (new cljs.core.MapEntry((function (){var G__21739 = cljs.core.key(form);
return (inner.cljs$core$IFn$_invoke$arity$1 ? inner.cljs$core$IFn$_invoke$arity$1(G__21739) : inner.call(null, G__21739));
})(),(function (){var G__21740 = cljs.core.val(form);
return (inner.cljs$core$IFn$_invoke$arity$1 ? inner.cljs$core$IFn$_invoke$arity$1(G__21740) : inner.call(null, G__21740));
})(),null));
return (outer.cljs$core$IFn$_invoke$arity$1 ? outer.cljs$core$IFn$_invoke$arity$1(G__21738) : outer.call(null, G__21738));
} else {
if(cljs.core.seq_QMARK_(form)){
var G__21742 = cljs.core.doall.cljs$core$IFn$_invoke$arity$1(cljs.core.map.cljs$core$IFn$_invoke$arity$2(inner,form));
return (outer.cljs$core$IFn$_invoke$arity$1 ? outer.cljs$core$IFn$_invoke$arity$1(G__21742) : outer.call(null, G__21742));
} else {
if(cljs.core.record_QMARK_(form)){
var G__21743 = cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (r,x){
return cljs.core.conj.cljs$core$IFn$_invoke$arity$2(r,(inner.cljs$core$IFn$_invoke$arity$1 ? inner.cljs$core$IFn$_invoke$arity$1(x) : inner.call(null, x)));
}),form,form);
return (outer.cljs$core$IFn$_invoke$arity$1 ? outer.cljs$core$IFn$_invoke$arity$1(G__21743) : outer.call(null, G__21743));
} else {
if(cljs.core.coll_QMARK_(form)){
var G__21744 = cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.empty(form),cljs.core.map.cljs$core$IFn$_invoke$arity$2(inner,form));
return (outer.cljs$core$IFn$_invoke$arity$1 ? outer.cljs$core$IFn$_invoke$arity$1(G__21744) : outer.call(null, G__21744));
} else {
return (outer.cljs$core$IFn$_invoke$arity$1 ? outer.cljs$core$IFn$_invoke$arity$1(form) : outer.call(null, form));
}
}
}
}
}
});
/**
* Performs a depth-first, post-order traversal of form. Calls f on
* each sub-form, uses f's return value in place of the original.
* Recognizes all Clojure data structures. Consumes seqs as with doall.
*/
clojure.walk.postwalk = (function clojure$walk$postwalk(f,form){
return clojure.walk.walk(cljs.core.partial.cljs$core$IFn$_invoke$arity$2(clojure.walk.postwalk,f),f,form);
});
/**
* Like postwalk, but does pre-order traversal.
*/
clojure.walk.prewalk = (function clojure$walk$prewalk(f,form){
return clojure.walk.walk(cljs.core.partial.cljs$core$IFn$_invoke$arity$2(clojure.walk.prewalk,f),cljs.core.identity,(f.cljs$core$IFn$_invoke$arity$1 ? f.cljs$core$IFn$_invoke$arity$1(form) : f.call(null, form)));
});
/**
* Recursively transforms all map keys from strings to keywords.
*/
clojure.walk.keywordize_keys = (function clojure$walk$keywordize_keys(m){
var f = (function (p__21785){
var vec__21786 = p__21785;
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__21786,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__21786,(1),null);
if(typeof k === 'string'){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.keyword.cljs$core$IFn$_invoke$arity$1(k),v], null);
} else {
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [k,v], null);
}
});
return clojure.walk.postwalk((function (x){
if(cljs.core.map_QMARK_(x)){
return cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentArrayMap.EMPTY,cljs.core.map.cljs$core$IFn$_invoke$arity$2(f,x));
} else {
return x;
}
}),m);
});
/**
* Recursively transforms all map keys from keywords to strings.
*/
clojure.walk.stringify_keys = (function clojure$walk$stringify_keys(m){
var f = (function (p__21795){
var vec__21796 = p__21795;
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__21796,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__21796,(1),null);
if((k instanceof cljs.core.Keyword)){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.name(k),v], null);
} else {
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [k,v], null);
}
});
return clojure.walk.postwalk((function (x){
if(cljs.core.map_QMARK_(x)){
return cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentArrayMap.EMPTY,cljs.core.map.cljs$core$IFn$_invoke$arity$2(f,x));
} else {
return x;
}
}),m);
});
/**
* Recursively transforms form by replacing keys in smap with their
* values. Like clojure/replace but works on any data structure. Does
* replacement at the root of the tree first.
*/
clojure.walk.prewalk_replace = (function clojure$walk$prewalk_replace(smap,form){
return clojure.walk.prewalk((function (x){
if(cljs.core.contains_QMARK_(smap,x)){
return (smap.cljs$core$IFn$_invoke$arity$1 ? smap.cljs$core$IFn$_invoke$arity$1(x) : smap.call(null, x));
} else {
return x;
}
}),form);
});
/**
* Recursively transforms form by replacing keys in smap with their
* values. Like clojure/replace but works on any data structure. Does
* replacement at the leaves of the tree first.
*/
clojure.walk.postwalk_replace = (function clojure$walk$postwalk_replace(smap,form){
return clojure.walk.postwalk((function (x){
if(cljs.core.contains_QMARK_(smap,x)){
return (smap.cljs$core$IFn$_invoke$arity$1 ? smap.cljs$core$IFn$_invoke$arity$1(x) : smap.call(null, x));
} else {
return x;
}
}),form);
});
//# sourceMappingURL=clojure.walk.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,112 @@
goog.provide("com.cognitect.transit.caching");
goog.require("com.cognitect.transit.delimiters");
goog.scope(function() {
var caching = com.cognitect.transit.caching;
var d = com.cognitect.transit.delimiters;
caching.MIN_SIZE_CACHEABLE = 3;
caching.BASE_CHAR_IDX = 48;
caching.CACHE_CODE_DIGITS = 44;
caching.MAX_CACHE_ENTRIES = caching.CACHE_CODE_DIGITS * caching.CACHE_CODE_DIGITS;
caching.MAX_CACHE_SIZE = 4096;
caching.isCacheable = function(string, asMapKey) {
if (string.length > caching.MIN_SIZE_CACHEABLE) {
if (asMapKey) {
return true;
} else {
var c0 = string.charAt(0);
var c1 = string.charAt(1);
if (c0 === d.ESC) {
return c1 === ":" || c1 === "$" || c1 === "#";
} else {
return false;
}
}
} else {
return false;
}
};
caching.idxToCode = function(idx) {
var hi = Math.floor(idx / caching.CACHE_CODE_DIGITS);
var lo = idx % caching.CACHE_CODE_DIGITS;
var loc = String.fromCharCode(lo + caching.BASE_CHAR_IDX);
if (hi === 0) {
return d.SUB + loc;
} else {
return d.SUB + String.fromCharCode(hi + caching.BASE_CHAR_IDX) + loc;
}
};
caching.WriteCache = function() {
this.idx = 0;
this.gen = 0;
this.cacheSize = 0;
this.cache = {};
};
caching.WriteCache.prototype.write = function(string, asMapKey) {
if (caching.isCacheable(string, asMapKey)) {
if (this.cacheSize === caching.MAX_CACHE_SIZE) {
this.clear();
this.gen = 0;
this.cache = {};
} else if (this.idx === caching.MAX_CACHE_ENTRIES) {
this.clear();
}
var entry = this.cache[string];
if (entry == null) {
this.cache[string] = [caching.idxToCode(this.idx), this.gen];
this.idx++;
return string;
} else if (entry[1] != this.gen) {
entry[1] = this.gen;
entry[0] = caching.idxToCode(this.idx);
this.idx++;
return string;
} else {
return entry[0];
}
} else {
return string;
}
};
caching.WriteCache.prototype.clear = function Transit$WriteCache() {
this.idx = 0;
this.gen++;
};
caching.writeCache = function() {
return new caching.WriteCache();
};
caching.isCacheCode = function(string) {
return string.charAt(0) === d.SUB && string.charAt(1) !== " ";
};
caching.codeToIdx = function(code) {
if (code.length === 2) {
return code.charCodeAt(1) - caching.BASE_CHAR_IDX;
} else {
var hi = (code.charCodeAt(1) - caching.BASE_CHAR_IDX) * caching.CACHE_CODE_DIGITS;
var lo = code.charCodeAt(2) - caching.BASE_CHAR_IDX;
return hi + lo;
}
};
caching.ReadCache = function Transit$ReadCache() {
this.idx = 0;
this.cache = [];
};
caching.ReadCache.prototype.write = function(obj, asMapKey) {
if (this.idx == caching.MAX_CACHE_ENTRIES) {
this.idx = 0;
}
this.cache[this.idx] = obj;
this.idx++;
return obj;
};
caching.ReadCache.prototype.read = function(string, asMapKey) {
return this.cache[caching.codeToIdx(string)];
};
caching.ReadCache.prototype.clear = function() {
this.idx = 0;
};
caching.readCache = function() {
return new caching.ReadCache();
};
});
//# sourceMappingURL=com.cognitect.transit.caching.js.map

View File

@@ -0,0 +1,9 @@
{
"version":3,
"file":"com.cognitect.transit.caching.js",
"lineCount":111,
"mappings":"AAcAA,IAAKC,CAAAA,OAAL,CAAa,+BAAb,CAAA;AACAD,IAAKE,CAAAA,OAAL,CAAa,kCAAb,CAAA;AAEAF,IAAKG,CAAAA,KAAL,CAAW,QAAQ,EAAG;AAAA,MAElBC,UAAUC,GAAIC,CAAAA,SAAUC,CAAAA,OAAQH,CAAAA,OAFd;AAEtB,MACII,IAAUH,GAAIC,CAAAA,SAAUC,CAAAA,OAAQE,CAAAA,UADpC;AAOAL,SAAQM,CAAAA,kBAAR,GAA6B,CAA7B;AAMAN,SAAQO,CAAAA,aAAR,GAAwB,EAAxB;AAMAP,SAAQQ,CAAAA,iBAAR,GAA4B,EAA5B;AAMAR,SAAQS,CAAAA,iBAAR,GAA4BT,OAAQQ,CAAAA,iBAApC,GAAsDR,OAAQQ,CAAAA,iBAA9D;AAMAR,SAAQU,CAAAA,cAAR,GAAyB,IAAzB;AAEAV,SAAQW,CAAAA,WAAR,GAAsBC,QAAQ,CAACC,MAAD,EAASC,QAAT,CAAmB;AAC7C,QAAGD,MAAOE,CAAAA,MAAV,GAAmBf,OAAQM,CAAAA,kBAA3B;AACI,UAAGQ,QAAH;AACI,eAAO,IAAP;AADJ,YAEO;AAAA,YACCE,KAAKH,MAAOI,CAAAA,MAAP,CAAc,CAAd,CADN;AACH,YACIC,KAAKL,MAAOI,CAAAA,MAAP,CAAc,CAAd,CADT;AAEA,YAAGD,EAAH,KAAUZ,CAAEe,CAAAA,GAAZ;AACI,iBAAOD,EAAP,KAAc,GAAd,IAAqBA,EAArB,KAA4B,GAA5B,IAAmCA,EAAnC,KAA0C,GAA1C;AADJ;AAGI,iBAAO,KAAP;AAHJ;AAHG;AAHX;AAaI,aAAO,KAAP;AAbJ;AAD6C,GAAjD;AAqBAlB,SAAQoB,CAAAA,SAAR,GAAoBC,QAAQ,CAACC,GAAD,CAAM;AAAA,QAC1BC,KAAMC,IAAKC,CAAAA,KAAL,CAAWH,GAAX,GAAiBtB,OAAQQ,CAAAA,iBAAzB,CADoB;AAAA,QAE1BkB,KAAMJ,GAANI,GAAY1B,OAAQQ,CAAAA,iBAFM;AAC9B,QAEImB,MAAMC,MAAOC,CAAAA,YAAP,CAAoBH,EAApB,GAAyB1B,OAAQO,CAAAA,aAAjC,CAFV;AAGA,QAAGgB,EAAH,KAAU,CAAV;AACI,aAAOnB,CAAE0B,CAAAA,GAAT,GAAeH,GAAf;AADJ;AAGI,aAAOvB,CAAE0B,CAAAA,GAAT,GAAeF,MAAOC,CAAAA,YAAP,CAAoBN,EAApB,GAAyBvB,OAAQO,CAAAA,aAAjC,CAAf,GAAiEoB,GAAjE;AAHJ;AAJ8B,GAAlC;AAcA3B,SAAQ+B,CAAAA,UAAR,GAAqBC,QAAQ,EAAG;AAC5B,QAAKV,CAAAA,GAAL,GAAW,CAAX;AACA,QAAKW,CAAAA,GAAL,GAAW,CAAX;AACA,QAAKC,CAAAA,SAAL,GAAiB,CAAjB;AACA,QAAKC,CAAAA,KAAL,GAAa,EAAb;AAJ4B,GAAhC;AAOAnC,SAAQ+B,CAAAA,UAAWK,CAAAA,SAAUC,CAAAA,KAA7B,GAAqCC,QAAQ,CAACzB,MAAD,EAASC,QAAT,CAAmB;AAC5D,QAAGd,OAAQW,CAAAA,WAAR,CAAoBE,MAApB,EAA4BC,QAA5B,CAAH,CAA0C;AACtC,UAAG,IAAKoB,CAAAA,SAAR,KAAsBlC,OAAQU,CAAAA,cAA9B,CAA8C;AAC1C,YAAK6B,CAAAA,KAAL,EAAA;AACA,YAAKN,CAAAA,GAAL,GAAW,CAAX;AACA,YAAKE,CAAAA,KAAL,GAAa,EAAb;AAH0C,OAA9C,KAIO,KAAG,IAAKb,CAAAA,GAAR,KAAgBtB,OAAQS,CAAAA,iBAAxB;AACH,YAAK8B,CAAAA,KAAL,EAAA;AADG;AAGP,UAAIC,QAAQ,IAAKL,CAAAA,KAAL,CAAWtB,MAAX,CAAZ;AACA,UAAG2B,KAAH,IAAY,IAAZ,CAAkB;AACd,YAAKL,CAAAA,KAAL,CAAWtB,MAAX,CAAA,GAAqB,CAACb,OAAQoB,CAAAA,SAAR,CAAkB,IAAKE,CAAAA,GAAvB,CAAD,EAA8B,IAAKW,CAAAA,GAAnC,CAArB;AACA,YAAKX,CAAAA,GAAL,EAAA;AACA,eAAOT,MAAP;AAHc,OAAlB,KAIO,KAAG2B,KAAA,CAAM,CAAN,CAAH,IAAe,IAAKP,CAAAA,GAApB,CAAyB;AAC5BO,aAAA,CAAM,CAAN,CAAA,GAAW,IAAKP,CAAAA,GAAhB;AACAO,aAAA,CAAM,CAAN,CAAA,GAAWxC,OAAQoB,CAAAA,SAAR,CAAkB,IAAKE,CAAAA,GAAvB,CAAX;AACA,YAAKA,CAAAA,GAAL,EAAA;AACA,eAAOT,MAAP;AAJ4B,OAAzB;AAMH,eAAO2B,KAAA,CAAM,CAAN,CAAP;AANG;AAb+B,KAA1C;AAsBI,aAAO3B,MAAP;AAtBJ;AAD4D,GAAhE;AA2BAb,SAAQ+B,CAAAA,UAAWK,CAAAA,SAAUG,CAAAA,KAA7B,GAAqCE,QAASC,mBAAkB,EAAG;AAC/D,QAAKpB,CAAAA,GAAL,GAAW,CAAX;AACA,QAAKW,CAAAA,GAAL,EAAA;AAF+D,GAAnE;AAKAjC,SAAQ2C,CAAAA,UAAR,GAAqBC,QAAQ,EAAG;AAC5B,WAAO,IAAI5C,OAAQ+B,CAAAA,UAAZ,EAAP;AAD4B,GAAhC;AAOA/B,SAAQ6C,CAAAA,WAAR,GAAsBC,QAAQ,CAACjC,MAAD,CAAS;AACnC,WAAQA,MAAOI,CAAAA,MAAP,CAAc,CAAd,CAAR,KAA6Bb,CAAE0B,CAAAA,GAA/B,IAAwCjB,MAAOI,CAAAA,MAAP,CAAc,CAAd,CAAxC,KAA6D,GAA7D;AADmC,GAAvC;AAIAjB,SAAQ+C,CAAAA,SAAR,GAAoBC,QAAQ,CAACC,IAAD,CAAO;AAC/B,QAAGA,IAAKlC,CAAAA,MAAR,KAAmB,CAAnB;AACI,aAAOkC,IAAKC,CAAAA,UAAL,CAAgB,CAAhB,CAAP,GAA4BlD,OAAQO,CAAAA,aAApC;AADJ,UAEO;AAAA,UACCgB,MAAM0B,IAAKC,CAAAA,UAAL,CAAgB,CAAhB,CAAN3B,GAA2BvB,OAAQO,CAAAA,aAAnCgB,IAAoDvB,OAAQQ,CAAAA,iBAD7D;AACH,UACIkB,KAAMuB,IAAKC,CAAAA,UAAL,CAAgB,CAAhB,CAANxB,GAA2B1B,OAAQO,CAAAA,aADvC;AAEA,aAAOgB,EAAP,GAAYG,EAAZ;AAHG;AAHwB,GAAnC;AAaA1B,SAAQmD,CAAAA,SAAR,GAAoBC,QAASC,kBAAiB,EAAG;AAC7C,QAAK/B,CAAAA,GAAL,GAAW,CAAX;AACA,QAAKa,CAAAA,KAAL,GAAa,EAAb;AAF6C,GAAjD;AAKAnC,SAAQmD,CAAAA,SAAUf,CAAAA,SAAUC,CAAAA,KAA5B,GAAoCiB,QAAQ,CAACC,GAAD,EAAMzC,QAAN,CAAgB;AACxD,QAAG,IAAKQ,CAAAA,GAAR,IAAetB,OAAQS,CAAAA,iBAAvB;AACI,UAAKa,CAAAA,GAAL,GAAW,CAAX;AADJ;AAGA,QAAKa,CAAAA,KAAL,CAAW,IAAKb,CAAAA,GAAhB,CAAA,GAAuBiC,GAAvB;AACA,QAAKjC,CAAAA,GAAL,EAAA;AACA,WAAOiC,GAAP;AANwD,GAA5D;AASAvD,SAAQmD,CAAAA,SAAUf,CAAAA,SAAUoB,CAAAA,IAA5B,GAAmCC,QAAQ,CAAC5C,MAAD,EAASC,QAAT,CAAmB;AAC1D,WAAO,IAAKqB,CAAAA,KAAL,CAAWnC,OAAQ+C,CAAAA,SAAR,CAAkBlC,MAAlB,CAAX,CAAP;AAD0D,GAA9D;AAIAb,SAAQmD,CAAAA,SAAUf,CAAAA,SAAUG,CAAAA,KAA5B,GAAoCmB,QAAQ,EAAG;AAC3C,QAAKpC,CAAAA,GAAL,GAAW,CAAX;AAD2C,GAA/C;AAIAtB,SAAQ2D,CAAAA,SAAR,GAAoBC,QAAQ,EAAG;AAC3B,WAAO,IAAI5D,OAAQmD,CAAAA,SAAZ,EAAP;AAD2B,GAA/B;AA3JsB,CAAtB,CAAA;;",
"sources":["com/cognitect/transit/caching.js"],
"sourcesContent":["// Copyright 2014 Cognitect. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\ngoog.provide(\"com.cognitect.transit.caching\");\ngoog.require(\"com.cognitect.transit.delimiters\");\n\ngoog.scope(function() {\n\nvar caching = com.cognitect.transit.caching,\n d = com.cognitect.transit.delimiters;\n\n/**\n * @const\n * @type {number}\n */\ncaching.MIN_SIZE_CACHEABLE = 3;\n\n/**\n * @const\n * @type {number}\n */\ncaching.BASE_CHAR_IDX = 48;\n\n/**\n * @const\n * @type {number}\n */\ncaching.CACHE_CODE_DIGITS = 44;\n\n/**\n * @const\n * @type {number}\n */\ncaching.MAX_CACHE_ENTRIES = caching.CACHE_CODE_DIGITS*caching.CACHE_CODE_DIGITS;\n\n/**\n * @const\n * @type {number}\n */\ncaching.MAX_CACHE_SIZE = 4096;\n\ncaching.isCacheable = function(string, asMapKey) {\n if(string.length > caching.MIN_SIZE_CACHEABLE) {\n if(asMapKey) {\n return true;\n } else {\n var c0 = string.charAt(0),\n c1 = string.charAt(1);\n if(c0 === d.ESC) {\n return c1 === \":\" || c1 === \"$\" || c1 === \"#\";\n } else {\n return false;\n }\n }\n } else {\n return false;\n }\n};\n\n// =============================================================================\n// WriteCache\n\ncaching.idxToCode = function(idx) {\n var hi = Math.floor(idx / caching.CACHE_CODE_DIGITS),\n lo = idx % caching.CACHE_CODE_DIGITS,\n loc = String.fromCharCode(lo + caching.BASE_CHAR_IDX)\n if(hi === 0) {\n return d.SUB + loc;\n } else {\n return d.SUB + String.fromCharCode(hi + caching.BASE_CHAR_IDX) + loc;\n }\n};\n\n/**\n * @constructor\n */\ncaching.WriteCache = function() {\n this.idx = 0;\n this.gen = 0;\n this.cacheSize = 0;\n this.cache = {};\n};\n\ncaching.WriteCache.prototype.write = function(string, asMapKey) {\n if(caching.isCacheable(string, asMapKey)) {\n if(this.cacheSize === caching.MAX_CACHE_SIZE) {\n this.clear();\n this.gen = 0;\n this.cache = {};\n } else if(this.idx === caching.MAX_CACHE_ENTRIES) {\n this.clear();\n }\n var entry = this.cache[string];\n if(entry == null) {\n this.cache[string] = [caching.idxToCode(this.idx), this.gen];\n this.idx++;\n return string;\n } else if(entry[1] != this.gen) {\n entry[1] = this.gen;\n entry[0] = caching.idxToCode(this.idx);\n this.idx++;\n return string;\n } else {\n return entry[0];\n }\n } else {\n return string;\n }\n};\n\ncaching.WriteCache.prototype.clear = function Transit$WriteCache() {\n this.idx = 0;\n this.gen++;\n};\n\ncaching.writeCache = function() {\n return new caching.WriteCache();\n};\n\n// =============================================================================\n// ReadCache\n\ncaching.isCacheCode = function(string) {\n return (string.charAt(0) === d.SUB) && (string.charAt(1) !== \" \");\n};\n\ncaching.codeToIdx = function(code) {\n if(code.length === 2) {\n return code.charCodeAt(1) - caching.BASE_CHAR_IDX; \n } else {\n var hi = (code.charCodeAt(1) - caching.BASE_CHAR_IDX) * caching.CACHE_CODE_DIGITS,\n lo = (code.charCodeAt(2) - caching.BASE_CHAR_IDX);\n return hi + lo; \n }\n};\n\n/**\n * @constructor\n */\ncaching.ReadCache = function Transit$ReadCache() {\n this.idx = 0;\n this.cache = [];\n};\n\ncaching.ReadCache.prototype.write = function(obj, asMapKey) {\n if(this.idx == caching.MAX_CACHE_ENTRIES) {\n this.idx = 0;\n }\n this.cache[this.idx] = obj;\n this.idx++;\n return obj;\n};\n\ncaching.ReadCache.prototype.read = function(string, asMapKey) {\n return this.cache[caching.codeToIdx(string)];\n};\n\ncaching.ReadCache.prototype.clear = function() {\n this.idx = 0;\n};\n\ncaching.readCache = function() {\n return new caching.ReadCache();\n};\n\n}); \n"],
"names":["goog","provide","require","scope","caching","com","cognitect","transit","d","delimiters","MIN_SIZE_CACHEABLE","BASE_CHAR_IDX","CACHE_CODE_DIGITS","MAX_CACHE_ENTRIES","MAX_CACHE_SIZE","isCacheable","caching.isCacheable","string","asMapKey","length","c0","charAt","c1","ESC","idxToCode","caching.idxToCode","idx","hi","Math","floor","lo","loc","String","fromCharCode","SUB","WriteCache","caching.WriteCache","gen","cacheSize","cache","prototype","write","caching.WriteCache.prototype.write","clear","entry","caching.WriteCache.prototype.clear","Transit$WriteCache","writeCache","caching.writeCache","isCacheCode","caching.isCacheCode","codeToIdx","caching.codeToIdx","code","charCodeAt","ReadCache","caching.ReadCache","Transit$ReadCache","caching.ReadCache.prototype.write","obj","read","caching.ReadCache.prototype.read","caching.ReadCache.prototype.clear","readCache","caching.readCache"]
}

View File

@@ -0,0 +1,11 @@
goog.provide("com.cognitect.transit.delimiters");
goog.scope(function() {
var delimiters = com.cognitect.transit.delimiters;
delimiters.ESC = "~";
delimiters.TAG = "#";
delimiters.SUB = "^";
delimiters.RES = "`";
delimiters.ESC_TAG = "~#";
});
//# sourceMappingURL=com.cognitect.transit.delimiters.js.map

View File

@@ -0,0 +1,9 @@
{
"version":3,
"file":"com.cognitect.transit.delimiters.js",
"lineCount":10,
"mappings":"AAcAA,IAAKC,CAAAA,OAAL,CAAa,kCAAb,CAAA;AAEAD,IAAKE,CAAAA,KAAL,CAAW,QAAQ,EAAG;AAEtB,MAAIC,aAAaC,GAAIC,CAAAA,SAAUC,CAAAA,OAAQH,CAAAA,UAAvC;AAMAA,YAAWI,CAAAA,GAAX,GAAqB,GAArB;AAMAJ,YAAWK,CAAAA,GAAX,GAAqB,GAArB;AAMAL,YAAWM,CAAAA,GAAX,GAAqB,GAArB;AAMAN,YAAWO,CAAAA,GAAX,GAAqB,GAArB;AAMAP,YAAWQ,CAAAA,OAAX,GAAqB,IAArB;AAhCsB,CAAtB,CAAA;;",
"sources":["com/cognitect/transit/delimiters.js"],
"sourcesContent":["// Copyright 2014 Cognitect. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\ngoog.provide(\"com.cognitect.transit.delimiters\");\n\ngoog.scope(function() {\n\nvar delimiters = com.cognitect.transit.delimiters;\n \n/**\n * @const\n * @type {string}\n */\ndelimiters.ESC = \"~\";\n\n/**\n * @const\n * @type {string}\n */\ndelimiters.TAG = \"#\";\n\n/**\n * @const\n * @type {string}\n */\ndelimiters.SUB = \"^\";\n\n/**\n * @const\n * @type {string}\n */\ndelimiters.RES = \"`\";\n\n/**\n * @const\n * @type {string}\n */\ndelimiters.ESC_TAG = \"~#\";\n\n});\n"],
"names":["goog","provide","scope","delimiters","com","cognitect","transit","ESC","TAG","SUB","RES","ESC_TAG"]
}

View File

@@ -0,0 +1,168 @@
goog.provide("com.cognitect.transit.eq");
goog.require("com.cognitect.transit.util");
goog.scope(function() {
var eq = com.cognitect.transit.eq;
var util = com.cognitect.transit.util;
eq.hashCodeProperty = "transit$hashCode$";
eq.hashCodeCounter = 1;
eq.equals = function(x, y) {
if (x == null) {
return y == null;
} else if (x === y) {
return true;
} else if (typeof x === "object") {
if (util.isArray(x)) {
if (util.isArray(y)) {
if (x.length === y.length) {
var i = 0;
for (; i < x.length; i++) {
if (!eq.equals(x[i], y[i])) {
return false;
}
}
return true;
} else {
return false;
}
} else {
return false;
}
} else if (x.com$cognitect$transit$equals) {
return x.com$cognitect$transit$equals(y);
} else if (y != null && typeof y === "object") {
if (y.com$cognitect$transit$equals) {
return y.com$cognitect$transit$equals(x);
} else {
var xklen = 0;
var yklen = util.objectKeys(y).length;
var p;
for (p in x) {
if (!x.hasOwnProperty(p)) {
continue;
}
xklen++;
if (!y.hasOwnProperty(p)) {
return false;
} else {
if (!eq.equals(x[p], y[p])) {
return false;
}
}
}
return xklen === yklen;
}
} else {
return false;
}
} else {
return false;
}
};
eq.hashCombine = function(seed, hash) {
return seed ^ hash + 2654435769 + (seed << 6) + (seed >> 2);
};
eq.stringCodeCache = {};
eq.stringCodeCacheSize = 0;
eq.STR_CACHE_MAX = 256;
eq.hashString = function(str) {
var cached = eq.stringCodeCache[str];
if (cached != null) {
return cached;
}
var code = 0;
var i = 0;
for (; i < str.length; ++i) {
code = 31 * code + str.charCodeAt(i);
code = code % 4294967296;
}
eq.stringCodeCacheSize++;
if (eq.stringCodeCacheSize >= eq.STR_CACHE_MAX) {
eq.stringCodeCache = {};
eq.stringCodeCacheSize = 1;
}
eq.stringCodeCache[str] = code;
return code;
};
eq.hashMapLike = function(m) {
var code = 0;
if (m.forEach != null) {
m.forEach(function(val, key, m) {
code = (code + (eq.hashCode(key) ^ eq.hashCode(val))) % 4503599627370496;
});
} else {
var keys = util.objectKeys(m);
var i = 0;
for (; i < keys.length; i++) {
var key = keys[i];
var val = m[key];
code = (code + (eq.hashCode(key) ^ eq.hashCode(val))) % 4503599627370496;
}
}
return code;
};
eq.hashArrayLike = function(arr) {
var code = 0;
if (util.isArray(arr)) {
var i = 0;
for (; i < arr.length; i++) {
code = eq.hashCombine(code, eq.hashCode(arr[i]));
}
} else if (arr.forEach) {
arr.forEach(function(x, i) {
code = eq.hashCombine(code, eq.hashCode(x));
});
}
return code;
};
eq.hashCode = function(x) {
if (x == null) {
return 0;
} else {
switch(typeof x) {
case "number":
return x;
break;
case "boolean":
return x === true ? 1 : 0;
break;
case "string":
return eq.hashString(x);
break;
case "function":
var code = x[eq.hashCodeProperty];
if (code) {
return code;
} else {
code = eq.hashCodeCounter;
if (typeof Object.defineProperty != "undefined") {
Object.defineProperty(x, eq.hashCodeProperty, {value:code, enumerable:false});
} else {
x[eq.hashCodeProperty] = code;
}
eq.hashCodeCounter++;
return code;
}
break;
default:
if (x instanceof Date) {
return x.valueOf();
} else if (util.isArray(x)) {
return eq.hashArrayLike(x);
}
if (x.com$cognitect$transit$hashCode) {
return x.com$cognitect$transit$hashCode();
} else {
return eq.hashMapLike(x);
}
break;
}
}
};
eq.extendToEQ = function(obj, opts) {
obj.com$cognitect$transit$hashCode = opts["hashCode"];
obj.com$cognitect$transit$equals = opts["equals"];
return obj;
};
});
//# sourceMappingURL=com.cognitect.transit.eq.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,330 @@
goog.provide("com.cognitect.transit.handlers");
goog.require("com.cognitect.transit.util");
goog.require("com.cognitect.transit.types");
goog.require("goog.math.Long");
goog.scope(function() {
var handlers = com.cognitect.transit.handlers;
var util = com.cognitect.transit.util;
var types = com.cognitect.transit.types;
var Long = goog.math.Long;
handlers.ctorGuid = 0;
handlers.ctorGuidProperty = "transit$guid$" + util.randomUUID();
handlers.typeTag = function(ctor) {
if (ctor == null) {
return "null";
} else if (ctor === String) {
return "string";
} else if (ctor === Boolean) {
return "boolean";
} else if (ctor === Number) {
return "number";
} else if (ctor === Array) {
return "array";
} else if (ctor === Object) {
return "map";
} else {
var tag = ctor[handlers.ctorGuidProperty];
if (tag == null) {
if (typeof Object.defineProperty != "undefined") {
tag = ++handlers.ctorGuid;
Object.defineProperty(ctor, handlers.ctorGuidProperty, {value:tag, enumerable:false});
} else {
ctor[handlers.ctorGuidProperty] = tag = ++handlers.ctorGuid;
}
}
return tag;
}
};
handlers.constructor = function(x) {
if (x == null) {
return null;
} else {
return x.constructor;
}
};
handlers.padZeros = function(n, m) {
var s = n.toString();
var i = s.length;
for (; i < m; i++) {
s = "0" + s;
}
return s;
};
handlers.stringableKeys = function(m) {
var stringable = false;
var ks = util.objectKeys(m);
var i = 0;
for (; i < ks.length; i++) {
}
return true;
};
handlers.NilHandler = function Transit$NilHandler() {
};
handlers.NilHandler.prototype.tag = function(v) {
return "_";
};
handlers.NilHandler.prototype.rep = function(v) {
return null;
};
handlers.NilHandler.prototype.stringRep = function(v) {
return "null";
};
handlers.StringHandler = function Transit$StringHandler() {
};
handlers.StringHandler.prototype.tag = function(v) {
return "s";
};
handlers.StringHandler.prototype.rep = function(v) {
return v;
};
handlers.StringHandler.prototype.stringRep = function(v) {
return v;
};
handlers.NumberHandler = function Transit$NumberHandler() {
};
handlers.NumberHandler.prototype.tag = function(v) {
return "i";
};
handlers.NumberHandler.prototype.rep = function(v) {
return v;
};
handlers.NumberHandler.prototype.stringRep = function(v) {
return v.toString();
};
handlers.IntegerHandler = function Transit$IntegerHandler() {
};
handlers.IntegerHandler.prototype.tag = function(v) {
return "i";
};
handlers.IntegerHandler.prototype.rep = function(v) {
return v.toString();
};
handlers.IntegerHandler.prototype.stringRep = function(v) {
return v.toString();
};
handlers.BooleanHandler = function Transit$BooleanHandler() {
};
handlers.BooleanHandler.prototype.tag = function(v) {
return "?";
};
handlers.BooleanHandler.prototype.rep = function(v) {
return v;
};
handlers.BooleanHandler.prototype.stringRep = function(v) {
return v.toString();
};
handlers.ArrayHandler = function Transit$ArrayHandler() {
};
handlers.ArrayHandler.prototype.tag = function(v) {
return "array";
};
handlers.ArrayHandler.prototype.rep = function(v) {
return v;
};
handlers.ArrayHandler.prototype.stringRep = function(v) {
return null;
};
handlers.MapHandler = function Transit$MapHandler() {
};
handlers.MapHandler.prototype.tag = function(v) {
return "map";
};
handlers.MapHandler.prototype.rep = function(v) {
return v;
};
handlers.MapHandler.prototype.stringRep = function(v) {
return null;
};
handlers.VerboseDateHandler = function Transit$VerboseDateHandler() {
};
handlers.VerboseDateHandler.prototype.tag = function(v) {
return "t";
};
handlers.VerboseDateHandler.prototype.rep = function(v) {
return v.getUTCFullYear() + "-" + handlers.padZeros(v.getUTCMonth() + 1, 2) + "-" + handlers.padZeros(v.getUTCDate(), 2) + "T" + handlers.padZeros(v.getUTCHours(), 2) + ":" + handlers.padZeros(v.getUTCMinutes(), 2) + ":" + handlers.padZeros(v.getUTCSeconds(), 2) + "." + handlers.padZeros(v.getUTCMilliseconds(), 3) + "Z";
};
handlers.VerboseDateHandler.prototype.stringRep = function(v, h) {
return h.rep(v);
};
handlers.DateHandler = function Transit$DateHandler() {
};
handlers.DateHandler.prototype.tag = function(v) {
return "m";
};
handlers.DateHandler.prototype.rep = function(v) {
return v.valueOf();
};
handlers.DateHandler.prototype.stringRep = function(v) {
return v.valueOf().toString();
};
handlers.DateHandler.prototype.getVerboseHandler = function(v) {
return new handlers.VerboseDateHandler();
};
handlers.UUIDHandler = function Transit$UUIDHandler() {
};
handlers.UUIDHandler.prototype.tag = function(v) {
return "u";
};
handlers.UUIDHandler.prototype.rep = function(v) {
return v.toString();
};
handlers.UUIDHandler.prototype.stringRep = function(v) {
return v.toString();
};
handlers.KeywordHandler = function Transit$KeywordHandler() {
};
handlers.KeywordHandler.prototype.tag = function(v) {
return ":";
};
handlers.KeywordHandler.prototype.rep = function(v) {
return v._name;
};
handlers.KeywordHandler.prototype.stringRep = function(v, h) {
return h.rep(v);
};
handlers.SymbolHandler = function Transit$SymbolHandler() {
};
handlers.SymbolHandler.prototype.tag = function(v) {
return "$";
};
handlers.SymbolHandler.prototype.rep = function(v) {
return v._name;
};
handlers.SymbolHandler.prototype.stringRep = function(v, h) {
return h.rep(v);
};
handlers.TaggedHandler = function Transit$TaggedHandler() {
};
handlers.TaggedHandler.prototype.tag = function(v) {
return v.tag;
};
handlers.TaggedHandler.prototype.rep = function(v) {
return v.rep;
};
handlers.TaggedHandler.prototype.stringRep = function(v, h) {
return null;
};
handlers.TransitSetHandler = function Transit$TransitSetHandler() {
};
handlers.TransitSetHandler.prototype.tag = function(v) {
return "set";
};
handlers.TransitSetHandler.prototype.rep = function(v) {
var arr = [];
v.forEach(function(key, set) {
arr.push(key);
});
return types.taggedValue("array", arr);
};
handlers.TransitSetHandler.prototype.stringRep = function(v, h) {
return null;
};
handlers.TransitArrayMapHandler = function Transit$ArrayMapHandler() {
};
handlers.TransitArrayMapHandler.prototype.tag = function(v) {
return "map";
};
handlers.TransitArrayMapHandler.prototype.rep = function(v) {
return v;
};
handlers.TransitArrayMapHandler.prototype.stringRep = function(v, h) {
return null;
};
handlers.TransitMapHandler = function Transit$MapHandler() {
};
handlers.TransitMapHandler.prototype.tag = function(v) {
return "map";
};
handlers.TransitMapHandler.prototype.rep = function(v) {
return v;
};
handlers.TransitMapHandler.prototype.stringRep = function(v, h) {
return null;
};
handlers.BufferHandler = function Transit$BufferHandler() {
};
handlers.BufferHandler.prototype.tag = function(v) {
return "b";
};
handlers.BufferHandler.prototype.rep = function(v) {
return v.toString("base64");
};
handlers.BufferHandler.prototype.stringRep = function(v, h) {
return null;
};
handlers.Uint8ArrayHandler = function Transit$Uint8ArrayHandler() {
};
handlers.Uint8ArrayHandler.prototype.tag = function(v) {
return "b";
};
handlers.Uint8ArrayHandler.prototype.rep = function(v) {
return util.Uint8ToBase64(v);
};
handlers.Uint8ArrayHandler.prototype.stringRep = function(v, h) {
return null;
};
handlers.defaultHandlers = function(hs) {
hs.set(null, new handlers.NilHandler());
hs.set(String, new handlers.StringHandler());
hs.set(Number, new handlers.NumberHandler());
hs.set(Long, new handlers.IntegerHandler());
hs.set(Boolean, new handlers.BooleanHandler());
hs.set(Array, new handlers.ArrayHandler());
hs.set(Object, new handlers.MapHandler());
hs.set(Date, new handlers.DateHandler());
hs.set(types.UUID, new handlers.UUIDHandler());
hs.set(types.Keyword, new handlers.KeywordHandler());
hs.set(types.Symbol, new handlers.SymbolHandler());
hs.set(types.TaggedValue, new handlers.TaggedHandler());
hs.set(types.TransitSet, new handlers.TransitSetHandler());
hs.set(types.TransitArrayMap, new handlers.TransitArrayMapHandler());
hs.set(types.TransitMap, new handlers.TransitMapHandler());
if (typeof goog.global.Buffer != "undefined") {
hs.set(goog.global.Buffer, new handlers.BufferHandler());
}
if (typeof Uint8Array != "undefined") {
hs.set(Uint8Array, new handlers.Uint8ArrayHandler());
}
return hs;
};
handlers.Handlers = function Transit$Handlers() {
this.handlers = {};
handlers.defaultHandlers(this);
};
handlers.Handlers.prototype.get = function(ctor) {
var h = null;
if (typeof ctor === "string") {
h = this.handlers[ctor];
} else {
h = this.handlers[handlers.typeTag(ctor)];
}
if (h != null) {
return h;
} else {
return this.handlers["default"];
}
};
handlers.Handlers.prototype["get"] = handlers.Handlers.prototype.get;
handlers.validTag = function(tag) {
switch(tag) {
case "null":
case "string":
case "boolean":
case "number":
case "array":
case "map":
return false;
break;
}
return true;
};
handlers.Handlers.prototype.set = function(ctor, handler) {
if (typeof ctor === "string" && handlers.validTag(ctor)) {
this.handlers[ctor] = handler;
} else {
this.handlers[handlers.typeTag(ctor)] = handler;
}
};
});
//# sourceMappingURL=com.cognitect.transit.handlers.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,281 @@
goog.provide("com.cognitect.transit.impl.decoder");
goog.require("com.cognitect.transit.util");
goog.require("com.cognitect.transit.delimiters");
goog.require("com.cognitect.transit.caching");
goog.require("com.cognitect.transit.types");
goog.scope(function() {
var decoder = com.cognitect.transit.impl.decoder;
var util = com.cognitect.transit.util;
var d = com.cognitect.transit.delimiters;
var caching = com.cognitect.transit.caching;
var types = com.cognitect.transit.types;
decoder.Tag = function Transit$Tag(s) {
this.str = s;
};
decoder.tag = function(s) {
return new decoder.Tag(s);
};
decoder.isTag = function(x) {
return x && x instanceof decoder.Tag;
};
decoder.isGroundHandler = function(handler) {
switch(handler) {
case "_":
case "s":
case "?":
case "i":
case "d":
case "b":
case "'":
case "array":
case "map":
return true;
}
return false;
};
decoder.Decoder = function Transit$Decoder(options) {
this.options = options || {};
this.handlers = {};
var h;
for (h in this.defaults.handlers) {
this.handlers[h] = this.defaults.handlers[h];
}
for (h in this.options["handlers"]) {
if (decoder.isGroundHandler(h)) {
throw new Error('Cannot override handler for ground type "' + h + '"');
}
this.handlers[h] = this.options["handlers"][h];
}
this.preferStrings = this.options["preferStrings"] != null ? this.options["preferStrings"] : this.defaults.preferStrings;
this.preferBuffers = this.options["preferBuffers"] != null ? this.options["preferBuffers"] : this.defaults.preferBuffers;
this.defaultHandler = this.options["defaultHandler"] || this.defaults.defaultHandler;
this.mapBuilder = this.options["mapBuilder"];
this.arrayBuilder = this.options["arrayBuilder"];
};
decoder.Decoder.prototype.defaults = {handlers:{"_":function(v, d) {
return types.nullValue();
}, "?":function(v, d) {
return types.boolValue(v);
}, "b":function(v, d) {
return types.binary(v, d);
}, "i":function(v, d) {
return types.intValue(v);
}, "n":function(v, d) {
return types.bigInteger(v);
}, "d":function(v, d) {
return types.floatValue(v);
}, "f":function(v, d) {
return types.bigDecimalValue(v);
}, "c":function(v, d) {
return types.charValue(v);
}, ":":function(v, d) {
return types.keyword(v);
}, "$":function(v, d) {
return types.symbol(v);
}, "r":function(v, d) {
return types.uri(v);
}, "z":function(v, d) {
return types.specialDouble(v);
}, "'":function(v, d) {
return v;
}, "m":function(v, d) {
return types.date(v);
}, "t":function(v, d) {
return types.verboseDate(v);
}, "u":function(v, d) {
return types.uuid(v);
}, "set":function(v, d) {
return types.set(v);
}, "list":function(v, d) {
return types.list(v);
}, "link":function(v, d) {
return types.link(v);
}, "cmap":function(v, d) {
return types.map(v, false);
}}, defaultHandler:function(c, val) {
return types.taggedValue(c, val);
}, preferStrings:true, preferBuffers:true};
decoder.Decoder.prototype.decode = function(node, cache, asMapKey, tagValue) {
if (node == null) {
return null;
}
var t = typeof node;
switch(t) {
case "string":
return this.decodeString(node, cache, asMapKey, tagValue);
break;
case "object":
if (util.isArray(node)) {
if (node[0] === "^ ") {
return this.decodeArrayHash(node, cache, asMapKey, tagValue);
} else {
return this.decodeArray(node, cache, asMapKey, tagValue);
}
} else {
return this.decodeHash(node, cache, asMapKey, tagValue);
}
break;
}
return node;
};
decoder.Decoder.prototype["decode"] = decoder.Decoder.prototype.decode;
decoder.Decoder.prototype.decodeString = function(string, cache, asMapKey, tagValue) {
if (caching.isCacheable(string, asMapKey)) {
var val = this.parseString(string, cache, false);
if (cache) {
cache.write(val, asMapKey);
}
return val;
} else if (caching.isCacheCode(string)) {
return cache.read(string, asMapKey);
} else {
return this.parseString(string, cache, asMapKey);
}
};
decoder.Decoder.prototype.decodeHash = function(hash, cache, asMapKey, tagValue) {
var ks = util.objectKeys(hash);
var key = ks[0];
var tag = ks.length == 1 ? this.decode(key, cache, false, false) : null;
if (decoder.isTag(tag)) {
var val = hash[key];
var handler = this.handlers[tag.str];
if (handler != null) {
return handler(this.decode(val, cache, false, true), this);
} else {
return types.taggedValue(tag.str, this.decode(val, cache, false, false));
}
} else if (this.mapBuilder) {
if (ks.length < types.SMALL_ARRAY_MAP_THRESHOLD * 2 && this.mapBuilder.fromArray) {
var nodep = [];
var i = 0;
for (; i < ks.length; i++) {
var strKey = ks[i];
nodep.push(this.decode(strKey, cache, true, false));
nodep.push(this.decode(hash[strKey], cache, false, false));
}
return this.mapBuilder.fromArray(nodep, hash);
} else {
var ret = this.mapBuilder.init(hash);
i = 0;
for (; i < ks.length; i++) {
strKey = ks[i];
ret = this.mapBuilder.add(ret, this.decode(strKey, cache, true, false), this.decode(hash[strKey], cache, false, false), hash);
}
return this.mapBuilder.finalize(ret, hash);
}
} else {
nodep = [];
i = 0;
for (; i < ks.length; i++) {
strKey = ks[i];
nodep.push(this.decode(strKey, cache, true, false));
nodep.push(this.decode(hash[strKey], cache, false, false));
}
return types.map(nodep, false);
}
};
decoder.Decoder.prototype.decodeArrayHash = function(node, cache, asMapKey, tagValue) {
if (this.mapBuilder) {
if (node.length < types.SMALL_ARRAY_MAP_THRESHOLD * 2 + 1 && this.mapBuilder.fromArray) {
var nodep = [];
var i = 1;
for (; i < node.length; i = i + 2) {
nodep.push(this.decode(node[i], cache, true, false));
nodep.push(this.decode(node[i + 1], cache, false, false));
}
return this.mapBuilder.fromArray(nodep, node);
} else {
var ret = this.mapBuilder.init(node);
i = 1;
for (; i < node.length; i = i + 2) {
ret = this.mapBuilder.add(ret, this.decode(node[i], cache, true, false), this.decode(node[i + 1], cache, false, false), node);
}
return this.mapBuilder.finalize(ret, node);
}
} else {
nodep = [];
i = 1;
for (; i < node.length; i = i + 2) {
nodep.push(this.decode(node[i], cache, true, false));
nodep.push(this.decode(node[i + 1], cache, false, false));
}
return types.map(nodep, false);
}
};
decoder.Decoder.prototype.decodeArray = function(node, cache, asMapKey, tagValue) {
if (tagValue) {
var ret = [];
var i = 0;
for (; i < node.length; i++) {
ret.push(this.decode(node[i], cache, asMapKey, false));
}
return ret;
} else {
var cacheIdx = cache && cache.idx;
if (node.length === 2 && typeof node[0] === "string") {
var tag = this.decode(node[0], cache, false, false);
if (decoder.isTag(tag)) {
var val = node[1];
var handler = this.handlers[tag.str];
if (handler != null) {
ret = handler(this.decode(val, cache, asMapKey, true), this);
return ret;
} else {
return types.taggedValue(tag.str, this.decode(val, cache, asMapKey, false));
}
}
}
if (cache && cacheIdx != cache.idx) {
cache.idx = cacheIdx;
}
if (this.arrayBuilder) {
if (node.length <= 32 && this.arrayBuilder.fromArray) {
var arr = [];
i = 0;
for (; i < node.length; i++) {
arr.push(this.decode(node[i], cache, asMapKey, false));
}
return this.arrayBuilder.fromArray(arr, node);
} else {
ret = this.arrayBuilder.init(node);
i = 0;
for (; i < node.length; i++) {
ret = this.arrayBuilder.add(ret, this.decode(node[i], cache, asMapKey, false), node);
}
return this.arrayBuilder.finalize(ret, node);
}
} else {
ret = [];
i = 0;
for (; i < node.length; i++) {
ret.push(this.decode(node[i], cache, asMapKey, false));
}
return ret;
}
}
};
decoder.Decoder.prototype.parseString = function(string, cache, asMapKey) {
if (string.charAt(0) === d.ESC) {
var c = string.charAt(1);
if (c === d.ESC || c === d.SUB || c === d.RES) {
return string.substring(1);
} else if (c === d.TAG) {
return decoder.tag(string.substring(2));
} else {
var handler = this.handlers[c];
if (handler == null) {
return this.defaultHandler(c, string.substring(2));
} else {
return handler(string.substring(2), this);
}
}
} else {
return string;
}
};
decoder.decoder = function(options) {
return new decoder.Decoder(options);
};
});
//# sourceMappingURL=com.cognitect.transit.impl.decoder.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,27 @@
goog.provide("com.cognitect.transit.impl.reader");
goog.require("com.cognitect.transit.impl.decoder");
goog.require("com.cognitect.transit.caching");
goog.scope(function() {
var reader = com.cognitect.transit.impl.reader;
var decoder = com.cognitect.transit.impl.decoder;
var caching = com.cognitect.transit.caching;
reader.JSONUnmarshaller = function Transit$JSONUnmarshaller(opts) {
this.decoder = new decoder.Decoder(opts);
};
reader.JSONUnmarshaller.prototype.unmarshal = function(str, cache) {
return this.decoder.decode(JSON.parse(str), cache);
};
reader.Reader = function Transit$Reader(unmarshaller, options) {
this.unmarshaller = unmarshaller;
this.options = options || {};
this.cache = this.options["cache"] ? this.options["cache"] : new caching.ReadCache();
};
reader.Reader.prototype.read = function(str) {
var ret = this.unmarshaller.unmarshal(str, this.cache);
this.cache.clear();
return ret;
};
reader.Reader.prototype["read"] = reader.Reader.prototype.read;
});
//# sourceMappingURL=com.cognitect.transit.impl.reader.js.map

View File

@@ -0,0 +1,9 @@
{
"version":3,
"file":"com.cognitect.transit.impl.reader.js",
"lineCount":26,
"mappings":"AAcAA,IAAKC,CAAAA,OAAL,CAAa,mCAAb,CAAA;AACAD,IAAKE,CAAAA,OAAL,CAAa,oCAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,+BAAb,CAAA;AAEAF,IAAKG,CAAAA,KAAL,CAAW,QAAS,EAAG;AAAA,MAEfC,SAAUC,GAAIC,CAAAA,SAAUC,CAAAA,OAAQC,CAAAA,IAAKJ,CAAAA,MAFtB;AAAA,MAGfK,UAAUJ,GAAIC,CAAAA,SAAUC,CAAAA,OAAQC,CAAAA,IAAKC,CAAAA,OAHtB;AAEnB,MAEIC,UAAUL,GAAIC,CAAAA,SAAUC,CAAAA,OAAQG,CAAAA,OAFpC;AAQAN,QAAOO,CAAAA,gBAAP,GAA0BC,QAASC,yBAAwB,CAACC,IAAD,CAAO;AAC9D,QAAKL,CAAAA,OAAL,GAAe,IAAIA,OAAQM,CAAAA,OAAZ,CAAoBD,IAApB,CAAf;AAD8D,GAAlE;AASAV,QAAOO,CAAAA,gBAAiBK,CAAAA,SAAUC,CAAAA,SAAlC,GAA8CC,QAAS,CAACC,GAAD,EAAMC,KAAN,CAAa;AAChE,WAAO,IAAKX,CAAAA,OAAQY,CAAAA,MAAb,CAAoBC,IAAKC,CAAAA,KAAL,CAAWJ,GAAX,CAApB,EAAqCC,KAArC,CAAP;AADgE,GAApE;AAUAhB,QAAOoB,CAAAA,MAAP,GAAgBC,QAASC,eAAc,CAACC,YAAD,EAAeC,OAAf,CAAwB;AAC3D,QAAKD,CAAAA,YAAL,GAAoBA,YAApB;AACA,QAAKC,CAAAA,OAAL,GAAeA,OAAf,IAA0B,EAA1B;AACA,QAAKR,CAAAA,KAAL,GAAa,IAAKQ,CAAAA,OAAL,CAAa,OAAb,CAAA,GAAwB,IAAKA,CAAAA,OAAL,CAAa,OAAb,CAAxB,GAAgD,IAAIlB,OAAQmB,CAAAA,SAAZ,EAA7D;AAH2D,GAA/D;AAUAzB,QAAOoB,CAAAA,MAAOR,CAAAA,SAAUc,CAAAA,IAAxB,GAA+BC,QAAS,CAACZ,GAAD,CAAM;AAC1C,QAAIa,MAAM,IAAKL,CAAAA,YAAaV,CAAAA,SAAlB,CAA4BE,GAA5B,EAAiC,IAAKC,CAAAA,KAAtC,CAAV;AACA,QAAKA,CAAAA,KAAMa,CAAAA,KAAX,EAAA;AACA,WAAOD,GAAP;AAH0C,GAA9C;AAKA5B,QAAOoB,CAAAA,MAAOR,CAAAA,SAAd,CAAwB,MAAxB,CAAA,GAAkCZ,MAAOoB,CAAAA,MAAOR,CAAAA,SAAUc,CAAAA,IAA1D;AA5CmB,CAAvB,CAAA;;",
"sources":["com/cognitect/transit/impl/reader.js"],
"sourcesContent":["// Copyright 2014 Cognitect. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\ngoog.provide(\"com.cognitect.transit.impl.reader\");\ngoog.require(\"com.cognitect.transit.impl.decoder\");\ngoog.require(\"com.cognitect.transit.caching\");\n\ngoog.scope(function () {\n\n var reader = com.cognitect.transit.impl.reader,\n decoder = com.cognitect.transit.impl.decoder,\n caching = com.cognitect.transit.caching;\n\n /**\n * A JSON unmarshaller\n * @constructor\n */\n reader.JSONUnmarshaller = function Transit$JSONUnmarshaller(opts) {\n this.decoder = new decoder.Decoder(opts);\n };\n\n /**\n * @param {string} str a JSON string\n * @param {caching.ReadCache} cache a read cache\n * @returns {*}\n */\n reader.JSONUnmarshaller.prototype.unmarshal = function (str, cache) {\n return this.decoder.decode(JSON.parse(str), cache);\n };\n\n /**\n * A transit reader\n * @constructor\n * @param {reader.JSONUnmarshaller} unmarshaller\n * @param {Object=} options\n */\n reader.Reader = function Transit$Reader(unmarshaller, options) {\n this.unmarshaller = unmarshaller;\n this.options = options || {};\n this.cache = this.options[\"cache\"] ? this.options[\"cache\"] : new caching.ReadCache();\n };\n\n /**\n * @param {string} str a string to be read\n * @returns {*}\n */\n reader.Reader.prototype.read = function (str) {\n var ret = this.unmarshaller.unmarshal(str, this.cache)\n this.cache.clear();\n return ret;\n };\n reader.Reader.prototype[\"read\"] = reader.Reader.prototype.read;\n\n});\n"],
"names":["goog","provide","require","scope","reader","com","cognitect","transit","impl","decoder","caching","JSONUnmarshaller","reader.JSONUnmarshaller","Transit$JSONUnmarshaller","opts","Decoder","prototype","unmarshal","reader.JSONUnmarshaller.prototype.unmarshal","str","cache","decode","JSON","parse","Reader","reader.Reader","Transit$Reader","unmarshaller","options","ReadCache","read","reader.Reader.prototype.read","ret","clear"]
}

View File

@@ -0,0 +1,440 @@
goog.provide("com.cognitect.transit.impl.writer");
goog.require("com.cognitect.transit.util");
goog.require("com.cognitect.transit.caching");
goog.require("com.cognitect.transit.handlers");
goog.require("com.cognitect.transit.types");
goog.require("com.cognitect.transit.delimiters");
goog.require("goog.math.Long");
goog.scope(function() {
var writer = com.cognitect.transit.impl.writer;
var util = com.cognitect.transit.util;
var caching = com.cognitect.transit.caching;
var handlers = com.cognitect.transit.handlers;
var types = com.cognitect.transit.types;
var d = com.cognitect.transit.delimiters;
var Long = goog.math.Long;
writer.escape = function(string) {
if (string.length > 0) {
var c = string.charAt(0);
if (c === d.ESC || c === d.SUB || c === d.RES) {
return d.ESC + string;
} else {
return string;
}
} else {
return string;
}
};
writer.JSONMarshaller = function Transit$JSONMarshaller(opts) {
this.opts = opts || {};
this.preferStrings = this.opts["preferStrings"] != null ? this.opts["preferStrings"] : true;
this.objectBuilder = this.opts["objectBuilder"] || null;
this.transform = this.opts["transform"] || null;
this.handlers = new handlers.Handlers();
var optsHandlers = this.opts["handlers"];
if (optsHandlers) {
if (util.isArray(optsHandlers) || !optsHandlers.forEach) {
throw new Error('transit writer "handlers" option must be a map');
}
var self = this;
optsHandlers.forEach(function(v, k) {
if (k !== undefined) {
self.handlers.set(k, v);
} else {
throw new Error("Cannot create handler for JavaScript undefined");
}
});
}
this.handlerForForeign = this.opts["handlerForForeign"];
this.unpack = this.opts["unpack"] || function(x) {
if (types.isArrayMap(x) && x.backingMap === null) {
return x._entries;
} else {
return false;
}
};
this.verbose = this.opts && this.opts["verbose"] || false;
};
writer.JSONMarshaller.prototype.handler = function(obj) {
var h = this.handlers.get(handlers.constructor(obj));
if (h != null) {
return h;
} else {
var tag = obj && obj["transitTag"];
if (tag) {
return this.handlers.get(tag);
} else {
return null;
}
}
};
writer.JSONMarshaller.prototype.registerHandler = function(ctor, handler) {
this.handlers.set(ctor, handler);
};
writer.JSONMarshaller.prototype.emitNil = function(asMapKey, cache) {
if (asMapKey) {
return this.emitString(d.ESC, "_", "", asMapKey, cache);
} else {
return null;
}
};
writer.JSONMarshaller.prototype.emitString = function(prefix, tag, s, asMapKey, cache) {
var string = prefix + tag + s;
if (cache) {
return cache.write(string, asMapKey);
} else {
return string;
}
};
writer.JSONMarshaller.prototype.emitBoolean = function(b, asMapKey, cache) {
if (asMapKey) {
var s = b.toString();
return this.emitString(d.ESC, "?", s[0], asMapKey, cache);
} else {
return b;
}
};
writer.JSONMarshaller.prototype.emitInteger = function(i, asMapKey, cache) {
if (i === Infinity) {
return this.emitString(d.ESC, "z", "INF", asMapKey, cache);
} else if (i === -Infinity) {
return this.emitString(d.ESC, "z", "-INF", asMapKey, cache);
} else if (isNaN(i)) {
return this.emitString(d.ESC, "z", "NaN", asMapKey, cache);
} else if (asMapKey || typeof i === "string" || i instanceof Long) {
return this.emitString(d.ESC, "i", i.toString(), asMapKey, cache);
} else {
return i;
}
};
writer.JSONMarshaller.prototype.emitDouble = function(d, asMapKey, cache) {
if (asMapKey) {
return this.emitString(d.ESC, "d", d, asMapKey, cache);
} else {
return d;
}
};
writer.JSONMarshaller.prototype.emitBinary = function(b, asMapKey, cache) {
return this.emitString(d.ESC, "b", b, asMapKey, cache);
};
writer.JSONMarshaller.prototype.emitQuoted = function(em, obj, cache) {
if (em.verbose) {
var ret = {};
var k = this.emitString(d.ESC_TAG, "'", "", true, cache);
ret[k] = writer.marshal(this, obj, false, cache);
return ret;
} else {
return [this.emitString(d.ESC_TAG, "'", "", true, cache), writer.marshal(this, obj, false, cache)];
}
};
writer.emitObjects = function(em, iterable, cache) {
var ret = [];
if (util.isArray(iterable)) {
var i = 0;
for (; i < iterable.length; i++) {
ret.push(writer.marshal(em, iterable[i], false, cache));
}
} else {
iterable.forEach(function(v, i) {
ret.push(writer.marshal(em, v, false, cache));
});
}
return ret;
};
writer.emitArray = function(em, iterable, skip, cache) {
return writer.emitObjects(em, iterable, cache);
};
writer.isStringableKey = function(em, k) {
if (typeof k !== "string") {
var h = em.handler(k);
return h && h.tag(k).length === 1;
} else {
return true;
}
};
writer.stringableKeys = function(em, obj) {
var arr = em.unpack(obj);
var stringableKeys = true;
if (arr) {
var i = 0;
for (; i < arr.length; i = i + 2) {
stringableKeys = writer.isStringableKey(em, arr[i]);
if (!stringableKeys) {
break;
}
}
return stringableKeys;
} else if (obj.keys) {
var iter = obj.keys();
var step = null;
if (iter.next) {
step = iter.next();
for (; !step.done;) {
stringableKeys = writer.isStringableKey(em, step.value);
if (!stringableKeys) {
break;
}
step = iter.next();
}
return stringableKeys;
}
}
if (obj.forEach) {
obj.forEach(function(v, k) {
stringableKeys = stringableKeys && writer.isStringableKey(em, k);
});
return stringableKeys;
} else {
throw new Error("Cannot walk keys of object type " + handlers.constructor(obj).name);
}
};
writer.isForeignObject = function(x) {
if (x.constructor["transit$isObject"]) {
return true;
}
var ret = x.constructor.toString();
ret = ret.substr("function ".length);
ret = ret.substr(0, ret.indexOf("("));
var isObject = ret == "Object";
if (typeof Object.defineProperty != "undefined") {
Object.defineProperty(x.constructor, "transit$isObject", {value:isObject, enumerable:false});
} else {
x.constructor["transit$isObject"] = isObject;
}
return isObject;
};
writer.emitMap = function(em, obj, skip, cache) {
var arr = null;
var rep = null;
var tag = null;
var ks = null;
var i = 0;
if (obj.constructor === Object || obj.forEach != null || em.handlerForForeign && writer.isForeignObject(obj)) {
if (em.verbose) {
if (obj.forEach != null) {
if (writer.stringableKeys(em, obj)) {
var ret = {};
obj.forEach(function(v, k) {
ret[writer.marshal(em, k, true, false)] = writer.marshal(em, v, false, cache);
});
return ret;
} else {
arr = em.unpack(obj);
rep = [];
tag = em.emitString(d.ESC_TAG, "cmap", "", true, cache);
if (arr) {
for (; i < arr.length; i = i + 2) {
rep.push(writer.marshal(em, arr[i], false, false));
rep.push(writer.marshal(em, arr[i + 1], false, cache));
}
} else {
obj.forEach(function(v, k) {
rep.push(writer.marshal(em, k, false, false));
rep.push(writer.marshal(em, v, false, cache));
});
}
ret = {};
ret[tag] = rep;
return ret;
}
} else {
ks = util.objectKeys(obj);
ret = {};
for (; i < ks.length; i++) {
ret[writer.marshal(em, ks[i], true, false)] = writer.marshal(em, obj[ks[i]], false, cache);
}
return ret;
}
} else {
if (obj.forEach != null) {
if (writer.stringableKeys(em, obj)) {
arr = em.unpack(obj);
ret = ["^ "];
if (arr) {
for (; i < arr.length; i = i + 2) {
ret.push(writer.marshal(em, arr[i], true, cache));
ret.push(writer.marshal(em, arr[i + 1], false, cache));
}
} else {
obj.forEach(function(v, k) {
ret.push(writer.marshal(em, k, true, cache));
ret.push(writer.marshal(em, v, false, cache));
});
}
return ret;
} else {
arr = em.unpack(obj);
rep = [];
tag = em.emitString(d.ESC_TAG, "cmap", "", true, cache);
if (arr) {
for (; i < arr.length; i = i + 2) {
rep.push(writer.marshal(em, arr[i], false, cache));
rep.push(writer.marshal(em, arr[i + 1], false, cache));
}
} else {
obj.forEach(function(v, k) {
rep.push(writer.marshal(em, k, false, cache));
rep.push(writer.marshal(em, v, false, cache));
});
}
return [tag, rep];
}
} else {
ret = ["^ "];
ks = util.objectKeys(obj);
for (; i < ks.length; i++) {
ret.push(writer.marshal(em, ks[i], true, cache));
ret.push(writer.marshal(em, obj[ks[i]], false, cache));
}
return ret;
}
}
} else if (em.objectBuilder != null) {
return em.objectBuilder(obj, function(k) {
return writer.marshal(em, k, true, cache);
}, function(v) {
return writer.marshal(em, v, false, cache);
});
} else {
var name = handlers.constructor(obj).name;
var err = new Error("Cannot write " + name);
err.data = {obj:obj, type:name};
throw err;
}
};
writer.emitTaggedMap = function(em, tag, rep, skip, cache) {
if (em.verbose) {
var ret = {};
ret[em.emitString(d.ESC_TAG, tag, "", true, cache)] = writer.marshal(em, rep, false, cache);
return ret;
} else {
return [em.emitString(d.ESC_TAG, tag, "", true, cache), writer.marshal(em, rep, false, cache)];
}
};
writer.emitEncoded = function(em, h, tag, rep, obj, asMapKey, cache) {
if (tag.length === 1) {
if (typeof rep === "string") {
return em.emitString(d.ESC, tag, rep, asMapKey, cache);
} else if (asMapKey || em.preferStrings) {
var vh = em.verbose && h.getVerboseHandler();
if (vh) {
tag = vh.tag(obj);
rep = vh.stringRep(obj, vh);
} else {
rep = h.stringRep(obj, h);
}
if (rep !== null) {
return em.emitString(d.ESC, tag, rep, asMapKey, cache);
} else {
var err = new Error('Tag "' + tag + '" cannot be encoded as string');
err.data = {tag:tag, rep:rep, obj:obj};
throw err;
}
} else {
return writer.emitTaggedMap(em, tag, rep, asMapKey, cache);
}
} else {
return writer.emitTaggedMap(em, tag, rep, asMapKey, cache);
}
};
writer.marshal = function(em, obj, asMapKey, cache) {
if (em.transform !== null) {
obj = em.transform(obj);
}
var h = em.handler(obj) || (em.handlerForForeign ? em.handlerForForeign(obj, em.handlers) : null);
var tag = h ? h.tag(obj) : null;
var rep = h ? h.rep(obj) : null;
if (h != null && tag != null) {
switch(tag) {
case "_":
return em.emitNil(asMapKey, cache);
break;
case "s":
return em.emitString("", "", writer.escape(rep), asMapKey, cache);
break;
case "?":
return em.emitBoolean(rep, asMapKey, cache);
break;
case "i":
return em.emitInteger(rep, asMapKey, cache);
break;
case "d":
return em.emitDouble(rep, asMapKey, cache);
break;
case "b":
return em.emitBinary(rep, asMapKey, cache);
break;
case "'":
return em.emitQuoted(em, rep, cache);
break;
case "array":
return writer.emitArray(em, rep, asMapKey, cache);
break;
case "map":
return writer.emitMap(em, rep, asMapKey, cache);
break;
default:
return writer.emitEncoded(em, h, tag, rep, obj, asMapKey, cache);
break;
}
} else {
var name = handlers.constructor(obj).name;
var err = new Error("Cannot write " + name);
err.data = {obj:obj, type:name};
throw err;
}
};
writer.maybeQuoted = function(em, obj) {
var h = em.handler(obj) || (em.handlerForForeign ? em.handlerForForeign(obj, em.handlers) : null);
if (h != null) {
if (h.tag(obj).length === 1) {
return types.quoted(obj);
} else {
return obj;
}
} else {
var name = handlers.constructor(obj).name;
var err = new Error("Cannot write " + name);
err.data = {obj:obj, type:name};
throw err;
}
};
writer.marshalTop = function(em, obj, asMapKey, cache) {
return JSON.stringify(writer.marshal(em, writer.maybeQuoted(em, obj), asMapKey, cache));
};
writer.Writer = function Transit$Writer(marshaller, options) {
this._marshaller = marshaller;
this.options = options || {};
if (this.options["cache"] === false) {
this.cache = null;
} else {
this.cache = this.options["cache"] ? this.options["cache"] : new caching.WriteCache();
}
};
writer.Writer.prototype.marshaller = function() {
return this._marshaller;
};
writer.Writer.prototype["marshaller"] = writer.Writer.prototype.marshaller;
writer.Writer.prototype.write = function(obj, opts) {
var ret = null;
var ropts = opts || {};
var asMapKey = ropts["asMapKey"] || false;
var cache = this._marshaller.verbose ? false : this.cache;
if (ropts["marshalTop"] === false) {
ret = writer.marshal(this._marshaller, obj, asMapKey, cache);
} else {
ret = writer.marshalTop(this._marshaller, obj, asMapKey, cache);
}
if (this.cache != null) {
this.cache.clear();
}
return ret;
};
writer.Writer.prototype["write"] = writer.Writer.prototype.write;
writer.Writer.prototype.register = function(type, handler) {
this._marshaller.registerHandler(type, handler);
};
writer.Writer.prototype["register"] = writer.Writer.prototype.register;
});
//# sourceMappingURL=com.cognitect.transit.impl.writer.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,183 @@
goog.provide("com.cognitect.transit");
goog.require("com.cognitect.transit.util");
goog.require("com.cognitect.transit.impl.reader");
goog.require("com.cognitect.transit.impl.writer");
goog.require("com.cognitect.transit.types");
goog.require("com.cognitect.transit.eq");
goog.require("com.cognitect.transit.impl.decoder");
goog.require("com.cognitect.transit.caching");
var TRANSIT_DEV = true;
var TRANSIT_NODE_TARGET = false;
var TRANSIT_BROWSER_TARGET = false;
var TRANSIT_BROWSER_AMD_TARGET = false;
goog.scope(function() {
var transit = com.cognitect.transit;
var util = com.cognitect.transit.util;
var reader = com.cognitect.transit.impl.reader;
var writer = com.cognitect.transit.impl.writer;
var decoder = com.cognitect.transit.impl.decoder;
var types = com.cognitect.transit.types;
var eq = com.cognitect.transit.eq;
var caching = com.cognitect.transit.caching;
transit.MapLike;
transit.SetLike;
transit.reader = function(type, opts) {
if (type === "json" || type === "json-verbose" || type == null) {
type = "json";
var unmarshaller = new reader.JSONUnmarshaller(opts);
return new reader.Reader(unmarshaller, opts);
} else {
throw new Error("Cannot create reader of type " + type);
}
};
transit.writer = function(type, opts) {
if (type === "json" || type === "json-verbose" || type == null) {
if (type === "json-verbose") {
if (opts == null) {
opts = {};
}
opts["verbose"] = true;
}
var marshaller = new writer.JSONMarshaller(opts);
return new writer.Writer(marshaller, opts);
} else {
var err = new Error('Type must be "json"');
err.data = {type:type};
throw err;
}
};
transit.makeWriteHandler = function(obj) {
var Handler = function() {
};
Handler.prototype.tag = obj["tag"];
Handler.prototype.rep = obj["rep"];
Handler.prototype.stringRep = obj["stringRep"];
Handler.prototype.getVerboseHandler = obj["getVerboseHandler"];
return new Handler();
};
transit.makeBuilder = function(obj) {
var Builder = function() {
};
Builder.prototype.init = obj["init"];
Builder.prototype.add = obj["add"];
Builder.prototype.finalize = obj["finalize"];
Builder.prototype.fromArray = obj["fromArray"];
return new Builder();
};
transit.date = types.date;
transit.integer = types.intValue;
transit.isInteger = types.isInteger;
transit.uuid = types.uuid;
transit.isUUID = types.isUUID;
transit.bigInt = types.bigInteger;
transit.isBigInt = types.isBigInteger;
transit.bigDec = types.bigDecimalValue;
transit.isBigDec = types.isBigDecimal;
transit.keyword = types.keyword;
transit.isKeyword = types.isKeyword;
transit.symbol = types.symbol;
transit.isSymbol = types.isSymbol;
transit.binary = types.binary;
transit.isBinary = types.isBinary;
transit.uri = types.uri;
transit.isURI = types.isURI;
transit.map = types.map;
transit.isMap = types.isMap;
transit.set = types.set;
transit.isSet = types.isSet;
transit.list = types.list;
transit.isList = types.isList;
transit.quoted = types.quoted;
transit.isQuoted = types.isQuoted;
transit.tagged = types.taggedValue;
transit.isTaggedValue = types.isTaggedValue;
transit.link = types.link;
transit.isLink = types.isLink;
transit.hash = eq.hashCode;
transit.hashMapLike = eq.hashMapLike;
transit.hashArrayLike = eq.hashArrayLike;
transit.equals = eq.equals;
transit.extendToEQ = eq.extendToEQ;
transit.mapToObject = function(m) {
var ret = {};
m.forEach(function(v, k) {
if (typeof k !== "string") {
throw Error("Cannot convert map with non-string keys");
} else {
ret[k] = v;
}
});
return ret;
};
transit.objectToMap = function(obj) {
var ret = transit.map();
var p;
for (p in obj) {
if (obj.hasOwnProperty(p)) {
ret.set(p, obj[p]);
}
}
return ret;
};
transit.decoder = decoder.decoder;
transit.readCache = caching.readCache;
transit.writeCache = caching.writeCache;
transit.UUIDfromString = types.UUIDfromString;
transit.randomUUID = util.randomUUID;
transit.stringableKeys = writer.stringableKeys;
if (TRANSIT_BROWSER_TARGET) {
goog.exportSymbol("transit.reader", transit.reader);
goog.exportSymbol("transit.writer", transit.writer);
goog.exportSymbol("transit.makeBuilder", transit.makeBuilder);
goog.exportSymbol("transit.makeWriteHandler", transit.makeWriteHandler);
goog.exportSymbol("transit.date", types.date);
goog.exportSymbol("transit.integer", types.intValue);
goog.exportSymbol("transit.isInteger", types.isInteger);
goog.exportSymbol("transit.uuid", types.uuid);
goog.exportSymbol("transit.isUUID", types.isUUID);
goog.exportSymbol("transit.bigInt", types.bigInteger);
goog.exportSymbol("transit.isBigInt", types.isBigInteger);
goog.exportSymbol("transit.bigDec", types.bigDecimalValue);
goog.exportSymbol("transit.isBigDec", types.isBigDecimal);
goog.exportSymbol("transit.keyword", types.keyword);
goog.exportSymbol("transit.isKeyword", types.isKeyword);
goog.exportSymbol("transit.symbol", types.symbol);
goog.exportSymbol("transit.isSymbol", types.isSymbol);
goog.exportSymbol("transit.binary", types.binary);
goog.exportSymbol("transit.isBinary", types.isBinary);
goog.exportSymbol("transit.uri", types.uri);
goog.exportSymbol("transit.isURI", types.isURI);
goog.exportSymbol("transit.map", types.map);
goog.exportSymbol("transit.isMap", types.isMap);
goog.exportSymbol("transit.set", types.set);
goog.exportSymbol("transit.isSet", types.isSet);
goog.exportSymbol("transit.list", types.list);
goog.exportSymbol("transit.isList", types.isList);
goog.exportSymbol("transit.quoted", types.quoted);
goog.exportSymbol("transit.isQuoted", types.isQuoted);
goog.exportSymbol("transit.tagged", types.taggedValue);
goog.exportSymbol("transit.isTaggedValue", types.isTaggedValue);
goog.exportSymbol("transit.link", types.link);
goog.exportSymbol("transit.isLink", types.isLink);
goog.exportSymbol("transit.hash", eq.hashCode);
goog.exportSymbol("transit.hashMapLike", eq.hashMapLike);
goog.exportSymbol("transit.hashArrayLike", eq.hashArrayLike);
goog.exportSymbol("transit.equals", eq.equals);
goog.exportSymbol("transit.extendToEQ", eq.extendToEQ);
goog.exportSymbol("transit.mapToObject", transit.mapToObject);
goog.exportSymbol("transit.objectToMap", transit.objectToMap);
goog.exportSymbol("transit.decoder", decoder.decoder);
goog.exportSymbol("transit.UUIDfromString", types.UUIDfromString);
goog.exportSymbol("transit.randomUUID", util.randomUUID);
goog.exportSymbol("transit.stringableKeys", writer.stringableKeys);
goog.exportSymbol("transit.readCache", caching.readCache);
goog.exportSymbol("transit.writeCache", caching.writeCache);
}
if (TRANSIT_NODE_TARGET) {
module.exports = {reader:transit.reader, writer:transit.writer, makeBuilder:transit.makeBuilder, makeWriteHandler:transit.makeWriteHandler, date:types.date, integer:types.intValue, isInteger:types.isInteger, uuid:types.uuid, isUUID:types.isUUID, bigInt:types.bigInteger, isBigInt:types.isBigInteger, bigDec:types.bigDecimalValue, isBigDec:types.isBigDecimal, keyword:types.keyword, isKeyword:types.isKeyword, symbol:types.symbol, isSymbol:types.isSymbol, binary:types.binary, isBinary:types.isBinary,
uri:types.uri, isURI:types.isURI, map:types.map, isMap:types.isMap, set:types.set, isSet:types.isSet, list:types.list, isList:types.isList, quoted:types.quoted, isQuoted:types.isQuoted, tagged:types.taggedValue, isTaggedValue:types.isTaggedValue, link:types.link, isLink:types.isLink, hash:eq.hashCode, hashArrayLike:eq.hashArrayLike, hashMapLike:eq.hashMapLike, equals:eq.equals, extendToEQ:eq.extendToEQ, mapToObject:transit.mapToObject, objectToMap:transit.objectToMap, decoder:decoder.decoder,
UUIDfromString:types.UUIDfromString, randomUUID:util.randomUUID, stringableKeys:writer.stringableKeys, readCache:caching.readCache, writeCache:caching.writeCache};
}
});
//# sourceMappingURL=com.cognitect.transit.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,102 @@
goog.provide("com.cognitect.transit.util");
goog.require("goog.object");
goog.scope(function() {
var util = com.cognitect.transit.util;
var gobject = goog.object;
if (typeof Object.keys != "undefined") {
util.objectKeys = function(obj) {
return Object.keys(obj);
};
} else {
util.objectKeys = function(obj) {
return gobject.getKeys(obj);
};
}
if (typeof Array.isArray != "undefined") {
util.isArray = function(obj) {
return Array.isArray(obj);
};
} else {
util.isArray = function(obj) {
return goog.typeOf(obj) === "array";
};
}
util.chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\x3d";
util.randInt = function(ub) {
return Math.round(Math.random() * ub);
};
util.randHex = function() {
return util.randInt(15).toString(16);
};
util.randomUUID = function() {
var rhex = (8 | 3 & util.randInt(14)).toString(16);
var ret = util.randHex() + util.randHex() + util.randHex() + util.randHex() + util.randHex() + util.randHex() + util.randHex() + util.randHex() + "-" + util.randHex() + util.randHex() + util.randHex() + util.randHex() + "-" + "4" + util.randHex() + util.randHex() + util.randHex() + "-" + rhex + util.randHex() + util.randHex() + util.randHex() + "-" + util.randHex() + util.randHex() + util.randHex() + util.randHex() + util.randHex() + util.randHex() + util.randHex() + util.randHex() + util.randHex() +
util.randHex() + util.randHex() + util.randHex();
return ret;
};
util.btoa = function(input) {
if (typeof btoa != "undefined") {
return btoa(input);
} else {
var str = String(input);
var block;
var charCode;
var idx = 0;
var map = util.chars;
var output = "";
for (; str.charAt(idx | 0) || (map = "\x3d", idx % 1); output = output + map.charAt(63 & block >> 8 - idx % 1 * 8)) {
charCode = str.charCodeAt(idx = idx + 3 / 4);
if (charCode > 255) {
throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");
}
block = block << 8 | charCode;
}
return output;
}
};
util.atob = function(input) {
if (typeof atob != "undefined") {
return atob(input);
} else {
var str = String(input).replace(/=+$/, "");
if (str.length % 4 == 1) {
throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");
}
var bc = 0;
var bs;
var buffer;
var idx = 0;
var output = "";
for (; buffer = str.charAt(idx++); ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, bc++ % 4) ? output = output + String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0) {
buffer = util.chars.indexOf(buffer);
}
return output;
}
};
util.Uint8ToBase64 = function(u8Arr) {
var CHUNK_SIZE = 32768;
var index = 0;
var length = u8Arr.length;
var result = "";
var slice = null;
for (; index < length;) {
slice = u8Arr.subarray(index, Math.min(index + CHUNK_SIZE, length));
result = result + String.fromCharCode.apply(null, slice);
index = index + CHUNK_SIZE;
}
return util.btoa(result);
};
util.Base64ToUint8 = function(base64) {
var binary_string = util.atob(base64);
var len = binary_string.length;
var bytes = new Uint8Array(len);
var i = 0;
for (; i < len; i++) {
var ascii = binary_string.charCodeAt(i);
bytes[i] = ascii;
}
return bytes;
};
});
//# sourceMappingURL=com.cognitect.transit.util.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,6 @@
goog.provide('emptyhead.contract.eval');
emptyhead.contract.eval.evaluate = (function emptyhead$contract$eval$evaluate(contract,idea){
return true;
});
//# sourceMappingURL=emptyhead.contract.eval.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["emptyhead/contract/eval.cljs"],"mappings":";AAKA,mCAAA,nCAAMA,8EAAUC,SAASC;AAAzB,AAAA","names":["emptyhead.contract.eval/evaluate","contract","idea"],"sourcesContent":["(ns emptyhead.contract.eval\n \"Implements contract evaluation on ideas.\"\n (:require [emptyhead.idea.protocol :as prtc]))\n\n;; TODO stub\n(defn evaluate [contract idea]\n true)\n"]}

View File

@@ -0,0 +1,149 @@
goog.provide('emptyhead.idea.crud');
/**
* Helper function to scaffold an 'empty' idea.
*/
emptyhead.idea.crud.register_idea_BANG_ = (function emptyhead$idea$crud$register_idea_BANG_(ref){
cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$4(emptyhead.idea.state.state,cljs.core.assoc_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [ref,new cljs.core.Keyword(null,"_meta","_meta",937543236),new cljs.core.Keyword(null,"_properties","_properties",-1501471594)], null),cljs.core.PersistentHashSet.EMPTY);
cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$4(emptyhead.idea.state.state,cljs.core.assoc_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [ref,new cljs.core.Keyword(null,"_meta","_meta",937543236),new cljs.core.Keyword(null,"_reference","_reference",-253513596)], null),ref);
return ref;
});
/**
* Swap data inside `idea` with given `data`.
* Returns a reference to `idea`.
*/
emptyhead.idea.crud.swap_idea_BANG_ = (function emptyhead$idea$crud$swap_idea_BANG_(idea,data){
cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$4(emptyhead.idea.state.state,cljs.core.assoc,emptyhead.idea.protocol.reference(idea),cljs.core.merge.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([data,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"_meta","_meta",937543236),emptyhead.idea.protocol.val_fn(new cljs.core.Keyword(null,"_meta","_meta",937543236),idea)], null)], 0)));
return emptyhead.idea.protocol.reference(idea);
});
/**
* Merge `data` into state of `idea`.
* Returns a reference to `idea`.
*/
emptyhead.idea.crud.extend_idea_BANG_ = (function emptyhead$idea$crud$extend_idea_BANG_(idea,data){
cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$4(emptyhead.idea.state.state,cljs.core.assoc,emptyhead.idea.protocol.reference(idea),emptyhead.idea.protocol.val_fn.cljs$core$IFn$_invoke$arity$variadic(cljs.core.merge,idea,cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([data], 0)));
return emptyhead.idea.protocol.reference(idea);
});
/**
* Evaluate `fun` on `idea` with optional extra `args`, then replace `idea` by the result.
* Returns a reference to `idea`.
*/
emptyhead.idea.crud.mutate_idea_BANG_ = (function emptyhead$idea$crud$mutate_idea_BANG_(var_args){
var args__5732__auto__ = [];
var len__5726__auto___31653 = arguments.length;
var i__5727__auto___31654 = (0);
while(true){
if((i__5727__auto___31654 < len__5726__auto___31653)){
args__5732__auto__.push((arguments[i__5727__auto___31654]));
var G__31655 = (i__5727__auto___31654 + (1));
i__5727__auto___31654 = G__31655;
continue;
} else {
}
break;
}
var argseq__5733__auto__ = ((((2) < args__5732__auto__.length))?(new cljs.core.IndexedSeq(args__5732__auto__.slice((2)),(0),null)):null);
return emptyhead.idea.crud.mutate_idea_BANG_.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),argseq__5733__auto__);
});
(emptyhead.idea.crud.mutate_idea_BANG_.cljs$core$IFn$_invoke$arity$variadic = (function (fun,idea,args){
emptyhead.idea.crud.swap_idea_BANG_(idea,emptyhead.idea.protocol.val_fn.cljs$core$IFn$_invoke$arity$variadic(fun,idea,cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([args], 0)));
return emptyhead.idea.protocol.reference(idea);
}));
(emptyhead.idea.crud.mutate_idea_BANG_.cljs$lang$maxFixedArity = (2));
/** @this {Function} */
(emptyhead.idea.crud.mutate_idea_BANG_.cljs$lang$applyTo = (function (seq31644){
var G__31645 = cljs.core.first(seq31644);
var seq31644__$1 = cljs.core.next(seq31644);
var G__31646 = cljs.core.first(seq31644__$1);
var seq31644__$2 = cljs.core.next(seq31644__$1);
var self__5711__auto__ = this;
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__31645,G__31646,seq31644__$2);
}));
/**
* Delete `idea` from the state.
* Returns a copy of the `idea`.
*/
emptyhead.idea.crud.forget_idea_BANG_ = (function emptyhead$idea$crud$forget_idea_BANG_(idea){
var val = emptyhead.idea.protocol.value(idea);
cljs.core.apply.cljs$core$IFn$_invoke$arity$3(emptyhead.idea.property.remove_property_BANG_,idea,emptyhead.idea.property.properties(idea));
emptyhead.idea.protocol.ref_fn((function (p1__31647_SHARP_){
return cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$3(emptyhead.idea.state.state,cljs.core.dissoc,p1__31647_SHARP_);
}),idea);
return emptyhead.idea.protocol.copy(val);
});
/**
* Instantiate up to `count` new ideas, optionally prefixing reference symbol with `prefix`.
* Additionally allows you to immediately attach `properties` and `data`.
* Returns a single idea or a list of ideas depending on whether `count` was given.
*/
emptyhead.idea.crud.have_idea_BANG_ = (function emptyhead$idea$crud$have_idea_BANG_(var_args){
var args__5732__auto__ = [];
var len__5726__auto___31656 = arguments.length;
var i__5727__auto___31657 = (0);
while(true){
if((i__5727__auto___31657 < len__5726__auto___31656)){
args__5732__auto__.push((arguments[i__5727__auto___31657]));
var G__31658 = (i__5727__auto___31657 + (1));
i__5727__auto___31657 = G__31658;
continue;
} else {
}
break;
}
var argseq__5733__auto__ = ((((0) < args__5732__auto__.length))?(new cljs.core.IndexedSeq(args__5732__auto__.slice((0)),(0),null)):null);
return emptyhead.idea.crud.have_idea_BANG_.cljs$core$IFn$_invoke$arity$variadic(argseq__5733__auto__);
});
(emptyhead.idea.crud.have_idea_BANG_.cljs$core$IFn$_invoke$arity$variadic = (function (p__31651){
var map__31652 = p__31651;
var map__31652__$1 = cljs.core.__destructure_map(map__31652);
var prefix = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__31652__$1,new cljs.core.Keyword(null,"prefix","prefix",-265908465),"idea_");
var count = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__31652__$1,new cljs.core.Keyword(null,"count","count",2139924085),(1));
var properties = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__31652__$1,new cljs.core.Keyword(null,"properties","properties",685819552),cljs.core.PersistentVector.EMPTY);
var data = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__31652__$1,new cljs.core.Keyword(null,"data","data",-232669377));
var fun = (function (){
return emptyhead.idea.crud.register_idea_BANG_(cljs.core.gensym.cljs$core$IFn$_invoke$arity$1(prefix));
});
var ideas = cljs.core.take.cljs$core$IFn$_invoke$arity$2(count,cljs.core.repeatedly.cljs$core$IFn$_invoke$arity$1(fun));
cljs.core.run_BANG_((function (p1__31648_SHARP_){
return cljs.core.apply.cljs$core$IFn$_invoke$arity$3(emptyhead.idea.property.register_property_BANG_,p1__31648_SHARP_,properties);
}),ideas);
if(cljs.core.truth_(data)){
cljs.core.run_BANG_((function (p1__31649_SHARP_){
return emptyhead.idea.crud.extend_idea_BANG_(p1__31649_SHARP_,data);
}),ideas);
} else {
}
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(count,(1))){
return cljs.core.first(ideas);
} else {
return ideas;
}
}));
(emptyhead.idea.crud.have_idea_BANG_.cljs$lang$maxFixedArity = (0));
/** @this {Function} */
(emptyhead.idea.crud.have_idea_BANG_.cljs$lang$applyTo = (function (seq31650){
var self__5712__auto__ = this;
return self__5712__auto__.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq(seq31650));
}));
//# sourceMappingURL=emptyhead.idea.crud.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,148 @@
goog.provide('emptyhead.idea.property');
/**
* Returns a set of all properties associated with `idea`.
*/
emptyhead.idea.property.properties = (function emptyhead$idea$property$properties(idea){
return emptyhead.idea.protocol.val_fn((function (p1__31629_SHARP_){
return cljs.core.get_in.cljs$core$IFn$_invoke$arity$2(p1__31629_SHARP_,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"_meta","_meta",937543236),new cljs.core.Keyword(null,"_properties","_properties",-1501471594)], null));
}),idea);
});
/**
* Returns a set of all ideas with `property`.
*/
emptyhead.idea.property.with_property = (function emptyhead$idea$property$with_property(property){
return cljs.core.get_in.cljs$core$IFn$_invoke$arity$2(cljs.core.deref(emptyhead.idea.state.state),cljs.core.concat.cljs$core$IFn$_invoke$arity$variadic(new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"_properties","_properties",-1501471594)], null),property,cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"_node","_node",-620154476)], null)], 0)));
});
/**
* Returns the single idea with `property`.
*/
emptyhead.idea.property.just_property = (function emptyhead$idea$property$just_property(property){
return cljs.core.first(emptyhead.idea.property.with_property(property));
});
/**
* Returns true if and only if `property` is associated with `idea`.
*/
emptyhead.idea.property.has_property_QMARK_ = (function emptyhead$idea$property$has_property_QMARK_(idea,property){
return cljs.core.contains_QMARK_(emptyhead.idea.property.properties(idea),property);
});
/**
* Associate one or more `properties` to an `idea`.
*/
emptyhead.idea.property.register_property_BANG_ = (function emptyhead$idea$property$register_property_BANG_(var_args){
var args__5732__auto__ = [];
var len__5726__auto___31638 = arguments.length;
var i__5727__auto___31639 = (0);
while(true){
if((i__5727__auto___31639 < len__5726__auto___31638)){
args__5732__auto__.push((arguments[i__5727__auto___31639]));
var G__31640 = (i__5727__auto___31639 + (1));
i__5727__auto___31639 = G__31640;
continue;
} else {
}
break;
}
var argseq__5733__auto__ = ((((1) < args__5732__auto__.length))?(new cljs.core.IndexedSeq(args__5732__auto__.slice((1)),(0),null)):null);
return emptyhead.idea.property.register_property_BANG_.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__5733__auto__);
});
(emptyhead.idea.property.register_property_BANG_.cljs$core$IFn$_invoke$arity$variadic = (function (idea,properties){
var property = cljs.core.first(properties);
var tail = cljs.core.rest(properties);
var iref = emptyhead.idea.protocol.reference(idea);
if(cljs.core.truth_(property)){
cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (acc,property__$1){
cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$variadic(emptyhead.idea.state.state,cljs.core.update_in,cljs.core.conj.cljs$core$IFn$_invoke$arity$variadic(acc,property__$1,cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.Keyword(null,"_node","_node",-620154476)], 0)),cljs.core.fnil.cljs$core$IFn$_invoke$arity$2(cljs.core.conj,cljs.core.PersistentHashSet.EMPTY),cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([iref], 0));
cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$variadic(emptyhead.idea.state.state,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [iref,new cljs.core.Keyword(null,"_meta","_meta",937543236),new cljs.core.Keyword(null,"_properties","_properties",-1501471594)], null),cljs.core.fnil.cljs$core$IFn$_invoke$arity$2(cljs.core.conj,cljs.core.PersistentHashSet.EMPTY),cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([cljs.core.conj.cljs$core$IFn$_invoke$arity$2(cljs.core.vec(cljs.core.rest(acc)),property__$1)], 0));
return cljs.core.conj.cljs$core$IFn$_invoke$arity$2(acc,property__$1);
}),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"_properties","_properties",-1501471594)], null),property);
} else {
}
if(tail){
cljs.core.run_BANG_((function (p1__31630_SHARP_){
return emptyhead.idea.property.register_property_BANG_.cljs$core$IFn$_invoke$arity$variadic(idea,cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([p1__31630_SHARP_], 0));
}),tail);
} else {
}
return iref;
}));
(emptyhead.idea.property.register_property_BANG_.cljs$lang$maxFixedArity = (1));
/** @this {Function} */
(emptyhead.idea.property.register_property_BANG_.cljs$lang$applyTo = (function (seq31631){
var G__31632 = cljs.core.first(seq31631);
var seq31631__$1 = cljs.core.next(seq31631);
var self__5711__auto__ = this;
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__31632,seq31631__$1);
}));
emptyhead.idea.property.remove_property_node_BANG_ = (function emptyhead$idea$property$remove_property_node_BANG_(idea,property){
cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$variadic(emptyhead.idea.state.state,cljs.core.update_in,cljs.core.concat.cljs$core$IFn$_invoke$arity$variadic(new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"_properties","_properties",-1501471594)], null),property,cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"_node","_node",-620154476)], null)], 0)),cljs.core.disj,cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([emptyhead.idea.protocol.reference(idea)], 0));
return emptyhead.idea.protocol.reference(idea);
});
emptyhead.idea.property.child_properties = (function emptyhead$idea$property$child_properties(property){
return cljs.core.map.cljs$core$IFn$_invoke$arity$2((function (p1__31633_SHARP_){
return cljs.core.conj.cljs$core$IFn$_invoke$arity$2(property,p1__31633_SHARP_);
}),cljs.core.disj.cljs$core$IFn$_invoke$arity$2(cljs.core.set(cljs.core.keys(cljs.core.get_in.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"_properties","_properties",-1501471594).cljs$core$IFn$_invoke$arity$1(cljs.core.deref(emptyhead.idea.state.state)),property))),new cljs.core.Keyword(null,"_node","_node",-620154476)));
});
emptyhead.idea.property.rm_prop_BANG_ = (function emptyhead$idea$property$rm_prop_BANG_(idea,property){
cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$variadic(emptyhead.idea.state.state,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [idea,new cljs.core.Keyword(null,"_meta","_meta",937543236),new cljs.core.Keyword(null,"_properties","_properties",-1501471594)], null),cljs.core.disj,cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([property], 0));
emptyhead.idea.property.remove_property_node_BANG_(idea,property);
var children = clojure.set.intersection.cljs$core$IFn$_invoke$arity$2(cljs.core.set(emptyhead.idea.property.child_properties(property)),emptyhead.idea.property.properties(idea));
return cljs.core.run_BANG_((function (p1__31634_SHARP_){
return (emptyhead.idea.property.rm_prop_BANG_.cljs$core$IFn$_invoke$arity$2 ? emptyhead.idea.property.rm_prop_BANG_.cljs$core$IFn$_invoke$arity$2(idea,p1__31634_SHARP_) : emptyhead.idea.property.rm_prop_BANG_.call(null, idea,p1__31634_SHARP_));
}),children);
});
/**
* Dissociate one or more `properties` from `idea`.
*/
emptyhead.idea.property.remove_property_BANG_ = (function emptyhead$idea$property$remove_property_BANG_(var_args){
var args__5732__auto__ = [];
var len__5726__auto___31641 = arguments.length;
var i__5727__auto___31642 = (0);
while(true){
if((i__5727__auto___31642 < len__5726__auto___31641)){
args__5732__auto__.push((arguments[i__5727__auto___31642]));
var G__31643 = (i__5727__auto___31642 + (1));
i__5727__auto___31642 = G__31643;
continue;
} else {
}
break;
}
var argseq__5733__auto__ = ((((1) < args__5732__auto__.length))?(new cljs.core.IndexedSeq(args__5732__auto__.slice((1)),(0),null)):null);
return emptyhead.idea.property.remove_property_BANG_.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__5733__auto__);
});
(emptyhead.idea.property.remove_property_BANG_.cljs$core$IFn$_invoke$arity$variadic = (function (idea,properties){
cljs.core.run_BANG_((function (p1__31635_SHARP_){
return emptyhead.idea.protocol.ref_fn.cljs$core$IFn$_invoke$arity$variadic(emptyhead.idea.property.rm_prop_BANG_,idea,cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([p1__31635_SHARP_], 0));
}),properties);
return emptyhead.idea.protocol.reference(idea);
}));
(emptyhead.idea.property.remove_property_BANG_.cljs$lang$maxFixedArity = (1));
/** @this {Function} */
(emptyhead.idea.property.remove_property_BANG_.cljs$lang$applyTo = (function (seq31636){
var G__31637 = cljs.core.first(seq31636);
var seq31636__$1 = cljs.core.next(seq31636);
var self__5711__auto__ = this;
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__31637,seq31636__$1);
}));
//# sourceMappingURL=emptyhead.idea.property.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,289 @@
goog.provide('emptyhead.idea.protocol');
emptyhead.idea.protocol.to_reference = (function emptyhead$idea$protocol$to_reference(val){
var ref = cljs.core.get_in.cljs$core$IFn$_invoke$arity$2(val,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"_meta","_meta",937543236),new cljs.core.Keyword(null,"_reference","_reference",-253513596)], null));
if(cljs.core.truth_(cljs.core.get_in.cljs$core$IFn$_invoke$arity$2(val,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"_meta","_meta",937543236),new cljs.core.Keyword(null,"_stale-reference","_stale-reference",748081018)], null)))){
return emptyhead.util.logging.error.cljs$core$IFn$_invoke$arity$variadic(["Attempt to find stale reference `",cljs.core.str.cljs$core$IFn$_invoke$arity$1(ref),"` -- this is a copy."].join(''),cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),val,new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"stale-reference","stale-reference",791234536)], null)], 0));
} else {
if((!((ref instanceof cljs.core.Symbol)))){
return emptyhead.util.logging.error.cljs$core$IFn$_invoke$arity$variadic(["Attempt to find invalid reference `",cljs.core.str.cljs$core$IFn$_invoke$arity$1(ref),"` -- invalid idea?"].join(''),cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),val,new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"invalid-reference","invalid-reference",450936464)], null)], 0));
} else {
return ref;
}
}
});
/**
* @interface
*/
emptyhead.idea.protocol.Idea = function(){};
var emptyhead$idea$protocol$Idea$reference$dyn_31615 = (function (idea){
var x__5350__auto__ = (((idea == null))?null:idea);
var m__5351__auto__ = (emptyhead.idea.protocol.reference[goog.typeOf(x__5350__auto__)]);
if((!((m__5351__auto__ == null)))){
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$1(idea) : m__5351__auto__.call(null, idea));
} else {
var m__5349__auto__ = (emptyhead.idea.protocol.reference["_"]);
if((!((m__5349__auto__ == null)))){
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$1(idea) : m__5349__auto__.call(null, idea));
} else {
throw cljs.core.missing_protocol("Idea.reference",idea);
}
}
});
/**
* Reference, i.e. symbol, for `idea`.
*/
emptyhead.idea.protocol.reference = (function emptyhead$idea$protocol$reference(idea){
if((((!((idea == null)))) && ((!((idea.emptyhead$idea$protocol$Idea$reference$arity$1 == null)))))){
return idea.emptyhead$idea$protocol$Idea$reference$arity$1(idea);
} else {
return emptyhead$idea$protocol$Idea$reference$dyn_31615(idea);
}
});
var emptyhead$idea$protocol$Idea$value$dyn_31616 = (function (idea){
var x__5350__auto__ = (((idea == null))?null:idea);
var m__5351__auto__ = (emptyhead.idea.protocol.value[goog.typeOf(x__5350__auto__)]);
if((!((m__5351__auto__ == null)))){
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$1(idea) : m__5351__auto__.call(null, idea));
} else {
var m__5349__auto__ = (emptyhead.idea.protocol.value["_"]);
if((!((m__5349__auto__ == null)))){
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$1 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$1(idea) : m__5349__auto__.call(null, idea));
} else {
throw cljs.core.missing_protocol("Idea.value",idea);
}
}
});
/**
* Value, i.e. map, of `idea`.
*/
emptyhead.idea.protocol.value = (function emptyhead$idea$protocol$value(idea){
if((((!((idea == null)))) && ((!((idea.emptyhead$idea$protocol$Idea$value$arity$1 == null)))))){
return idea.emptyhead$idea$protocol$Idea$value$arity$1(idea);
} else {
return emptyhead$idea$protocol$Idea$value$dyn_31616(idea);
}
});
(cljs.core.PersistentHashMap.prototype.emptyhead$idea$protocol$Idea$ = cljs.core.PROTOCOL_SENTINEL);
(cljs.core.PersistentHashMap.prototype.emptyhead$idea$protocol$Idea$reference$arity$1 = (function (idea){
var idea__$1 = this;
return emptyhead.idea.protocol.to_reference(idea__$1);
}));
(cljs.core.PersistentHashMap.prototype.emptyhead$idea$protocol$Idea$value$arity$1 = (function (idea){
var idea__$1 = this;
return idea__$1;
}));
(cljs.core.PersistentArrayMap.prototype.emptyhead$idea$protocol$Idea$ = cljs.core.PROTOCOL_SENTINEL);
(cljs.core.PersistentArrayMap.prototype.emptyhead$idea$protocol$Idea$reference$arity$1 = (function (idea){
var idea__$1 = this;
return emptyhead.idea.protocol.to_reference(idea__$1);
}));
(cljs.core.PersistentArrayMap.prototype.emptyhead$idea$protocol$Idea$value$arity$1 = (function (idea){
var idea__$1 = this;
return idea__$1;
}));
(cljs.core.Symbol.prototype.emptyhead$idea$protocol$Idea$ = cljs.core.PROTOCOL_SENTINEL);
(cljs.core.Symbol.prototype.emptyhead$idea$protocol$Idea$reference$arity$1 = (function (idea){
var idea__$1 = this;
return idea__$1;
}));
(cljs.core.Symbol.prototype.emptyhead$idea$protocol$Idea$value$arity$1 = (function (idea){
var idea__$1 = this;
return cljs.core.get.cljs$core$IFn$_invoke$arity$2(cljs.core.deref(emptyhead.idea.state.state),idea__$1);
}));
/**
* Make a copy of `idea`.
* Returns an object that is identical to the value of `idea`,
* but marked as not containing a reference to anything in the state.
*/
emptyhead.idea.protocol.copy = (function emptyhead$idea$protocol$copy(idea){
return cljs.core.assoc_in(emptyhead.idea.protocol.value(idea),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"_meta","_meta",937543236),new cljs.core.Keyword(null,"_stale-reference","_stale-reference",748081018)], null),true);
});
emptyhead.idea.protocol.non_copy = (function emptyhead$idea$protocol$non_copy(idea){
return cljs.core.assoc_in(emptyhead.idea.protocol.value(idea),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"_meta","_meta",937543236),new cljs.core.Keyword(null,"_stale-reference","_stale-reference",748081018)], null),false);
});
/**
* Takes a copied idea and 'uncopies' it, making its reference active again
* and updating what is in the game state.
*/
emptyhead.idea.protocol.uncopy_BANG_ = (function emptyhead$idea$protocol$uncopy_BANG_(copy_obj){
var idea = emptyhead.idea.protocol.non_copy(copy_obj);
return cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$4(emptyhead.idea.state.state,cljs.core.assoc,emptyhead.idea.protocol.to_reference(idea),idea);
});
/**
* Get the (now stale!) reference of a copied idea.
*/
emptyhead.idea.protocol.force_reference = (function emptyhead$idea$protocol$force_reference(copy_obj){
return emptyhead.idea.protocol.to_reference(emptyhead.idea.protocol.non_copy(copy_obj));
});
/**
* Execute `fun` on a copy of `idea` with optional additional `args`.
*/
emptyhead.idea.protocol.copy_fn = (function emptyhead$idea$protocol$copy_fn(var_args){
var args__5732__auto__ = [];
var len__5726__auto___31617 = arguments.length;
var i__5727__auto___31618 = (0);
while(true){
if((i__5727__auto___31618 < len__5726__auto___31617)){
args__5732__auto__.push((arguments[i__5727__auto___31618]));
var G__31619 = (i__5727__auto___31618 + (1));
i__5727__auto___31618 = G__31619;
continue;
} else {
}
break;
}
var argseq__5733__auto__ = ((((2) < args__5732__auto__.length))?(new cljs.core.IndexedSeq(args__5732__auto__.slice((2)),(0),null)):null);
return emptyhead.idea.protocol.copy_fn.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),argseq__5733__auto__);
});
(emptyhead.idea.protocol.copy_fn.cljs$core$IFn$_invoke$arity$variadic = (function (fun,idea,args){
return cljs.core.apply.cljs$core$IFn$_invoke$arity$3(fun,emptyhead.idea.protocol.copy(idea),args);
}));
(emptyhead.idea.protocol.copy_fn.cljs$lang$maxFixedArity = (2));
/** @this {Function} */
(emptyhead.idea.protocol.copy_fn.cljs$lang$applyTo = (function (seq31603){
var G__31604 = cljs.core.first(seq31603);
var seq31603__$1 = cljs.core.next(seq31603);
var G__31605 = cljs.core.first(seq31603__$1);
var seq31603__$2 = cljs.core.next(seq31603__$1);
var self__5711__auto__ = this;
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__31604,G__31605,seq31603__$2);
}));
/**
* Execute `fun` on the value of `idea` with optional additional `args`.
*/
emptyhead.idea.protocol.val_fn = (function emptyhead$idea$protocol$val_fn(var_args){
var args__5732__auto__ = [];
var len__5726__auto___31620 = arguments.length;
var i__5727__auto___31621 = (0);
while(true){
if((i__5727__auto___31621 < len__5726__auto___31620)){
args__5732__auto__.push((arguments[i__5727__auto___31621]));
var G__31622 = (i__5727__auto___31621 + (1));
i__5727__auto___31621 = G__31622;
continue;
} else {
}
break;
}
var argseq__5733__auto__ = ((((2) < args__5732__auto__.length))?(new cljs.core.IndexedSeq(args__5732__auto__.slice((2)),(0),null)):null);
return emptyhead.idea.protocol.val_fn.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),argseq__5733__auto__);
});
(emptyhead.idea.protocol.val_fn.cljs$core$IFn$_invoke$arity$variadic = (function (fun,idea,args){
return cljs.core.apply.cljs$core$IFn$_invoke$arity$3(fun,emptyhead.idea.protocol.value(idea),args);
}));
(emptyhead.idea.protocol.val_fn.cljs$lang$maxFixedArity = (2));
/** @this {Function} */
(emptyhead.idea.protocol.val_fn.cljs$lang$applyTo = (function (seq31606){
var G__31607 = cljs.core.first(seq31606);
var seq31606__$1 = cljs.core.next(seq31606);
var G__31608 = cljs.core.first(seq31606__$1);
var seq31606__$2 = cljs.core.next(seq31606__$1);
var self__5711__auto__ = this;
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__31607,G__31608,seq31606__$2);
}));
/**
* Execute `fun` on a reference to `idea` with optional additional `args`.
*/
emptyhead.idea.protocol.ref_fn = (function emptyhead$idea$protocol$ref_fn(var_args){
var args__5732__auto__ = [];
var len__5726__auto___31623 = arguments.length;
var i__5727__auto___31624 = (0);
while(true){
if((i__5727__auto___31624 < len__5726__auto___31623)){
args__5732__auto__.push((arguments[i__5727__auto___31624]));
var G__31625 = (i__5727__auto___31624 + (1));
i__5727__auto___31624 = G__31625;
continue;
} else {
}
break;
}
var argseq__5733__auto__ = ((((2) < args__5732__auto__.length))?(new cljs.core.IndexedSeq(args__5732__auto__.slice((2)),(0),null)):null);
return emptyhead.idea.protocol.ref_fn.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),argseq__5733__auto__);
});
(emptyhead.idea.protocol.ref_fn.cljs$core$IFn$_invoke$arity$variadic = (function (fun,idea,args){
return cljs.core.apply.cljs$core$IFn$_invoke$arity$3(fun,emptyhead.idea.protocol.reference(idea),args);
}));
(emptyhead.idea.protocol.ref_fn.cljs$lang$maxFixedArity = (2));
/** @this {Function} */
(emptyhead.idea.protocol.ref_fn.cljs$lang$applyTo = (function (seq31609){
var G__31610 = cljs.core.first(seq31609);
var seq31609__$1 = cljs.core.next(seq31609);
var G__31611 = cljs.core.first(seq31609__$1);
var seq31609__$2 = cljs.core.next(seq31609__$1);
var self__5711__auto__ = this;
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__31610,G__31611,seq31609__$2);
}));
/**
* Execute `fun` on a reference to `idea` with optional additional `args`.
* Unlike [[reference-fn]], this will work on a copy.
*/
emptyhead.idea.protocol.force_reference_fn = (function emptyhead$idea$protocol$force_reference_fn(var_args){
var args__5732__auto__ = [];
var len__5726__auto___31626 = arguments.length;
var i__5727__auto___31627 = (0);
while(true){
if((i__5727__auto___31627 < len__5726__auto___31626)){
args__5732__auto__.push((arguments[i__5727__auto___31627]));
var G__31628 = (i__5727__auto___31627 + (1));
i__5727__auto___31627 = G__31628;
continue;
} else {
}
break;
}
var argseq__5733__auto__ = ((((2) < args__5732__auto__.length))?(new cljs.core.IndexedSeq(args__5732__auto__.slice((2)),(0),null)):null);
return emptyhead.idea.protocol.force_reference_fn.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),argseq__5733__auto__);
});
(emptyhead.idea.protocol.force_reference_fn.cljs$core$IFn$_invoke$arity$variadic = (function (fun,idea,args){
return cljs.core.apply.cljs$core$IFn$_invoke$arity$3(fun,emptyhead.idea.protocol.force_reference(idea),args);
}));
(emptyhead.idea.protocol.force_reference_fn.cljs$lang$maxFixedArity = (2));
/** @this {Function} */
(emptyhead.idea.protocol.force_reference_fn.cljs$lang$applyTo = (function (seq31612){
var G__31613 = cljs.core.first(seq31612);
var seq31612__$1 = cljs.core.next(seq31612);
var G__31614 = cljs.core.first(seq31612__$1);
var seq31612__$2 = cljs.core.next(seq31612__$1);
var self__5711__auto__ = this;
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__31613,G__31614,seq31612__$2);
}));
//# sourceMappingURL=emptyhead.idea.protocol.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,11 @@
goog.provide('emptyhead.idea.state');
emptyhead.idea.state.empty_state = new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"_properties","_properties",-1501471594),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"_descriptions","_descriptions",-429995787),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"_properties","_properties",-1501471594),"Property-to-idea mapping.",new cljs.core.Keyword(null,"property","property",-1114278232),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"property_fns","property_fns",-843195850),cljs.core.PersistentArrayMap.EMPTY], null)], null);
if((typeof emptyhead !== 'undefined') && (typeof emptyhead.idea !== 'undefined') && (typeof emptyhead.idea.state !== 'undefined') && (typeof emptyhead.idea.state.state !== 'undefined')){
} else {
emptyhead.idea.state.state = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(emptyhead.idea.state.empty_state);
}
emptyhead.idea.state.reset_state_BANG_ = (function emptyhead$idea$state$reset_state_BANG_(){
return cljs.core.reset_BANG_(emptyhead.idea.state.state,emptyhead.idea.state.empty_state);
});
//# sourceMappingURL=emptyhead.idea.state.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["emptyhead/idea/state.cljs"],"mappings":";AAGA,mCAAA,2CAAA,oEAAA,mCAAA,uEAAA,2CAAA,oEAAA,4BAAA,8DAAA,mCAAA,qEAAA,7iBAAKA;AAQL,GAAA,QAAAC,sCAAAC,2CAAAC,iDAAAC;AAAA;AAAA,AAAA,AAASC,6BACP,AAACC,6CAAKN;;AAER,yCAAA,zCAAMO;AAAN,AACE,OAACC,sBAAOH,2BAAML","names":["emptyhead.idea.state/empty-state","js/emptyhead","js/emptyhead.idea","js/emptyhead.idea.state","js/emptyhead.idea.state.state","emptyhead.idea.state/state","cljs.core.atom","emptyhead.idea.state/reset-state!","cljs.core/reset!"],"sourcesContent":["(ns emptyhead.idea.state\n \"Implements the state object.\")\n\n(def empty-state\n {:_properties {}\n\n :_descriptions\n {:_properties \"Property-to-idea mapping.\"\n :property {}\n :property_fns {}}})\n\n(defonce state\n (atom empty-state))\n\n(defn reset-state! []\n (reset! state empty-state))\n"]}

View File

@@ -0,0 +1,113 @@
goog.provide('emptyhead.principle.crud');
/**
* Helper function to make principle object.
* You may want `register-principle!` instead.
*/
emptyhead.principle.crud.make_principle = (function emptyhead$principle$crud$make_principle(var_args){
var args__5732__auto__ = [];
var len__5726__auto___31667 = arguments.length;
var i__5727__auto___31668 = (0);
while(true){
if((i__5727__auto___31668 < len__5726__auto___31667)){
args__5732__auto__.push((arguments[i__5727__auto___31668]));
var G__31669 = (i__5727__auto___31668 + (1));
i__5727__auto___31668 = G__31669;
continue;
} else {
}
break;
}
var argseq__5733__auto__ = ((((1) < args__5732__auto__.length))?(new cljs.core.IndexedSeq(args__5732__auto__.slice((1)),(0),null)):null);
return emptyhead.principle.crud.make_principle.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__5733__auto__);
});
(emptyhead.principle.crud.make_principle.cljs$core$IFn$_invoke$arity$variadic = (function (operator,p__31661){
var map__31662 = p__31661;
var map__31662__$1 = cljs.core.__destructure_map(map__31662);
var data = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__31662__$1,new cljs.core.Keyword(null,"data","data",-232669377),cljs.core.PersistentArrayMap.EMPTY);
var ext_contract = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__31662__$1,new cljs.core.Keyword(null,"ext-contract","ext-contract",812214039),cljs.core.PersistentArrayMap.EMPTY);
var ext_stages = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__31662__$1,new cljs.core.Keyword(null,"ext-stages","ext-stages",680954732),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"principle","principle",-1390571781),operator], null)], null));
var transient$ = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__31662__$1,new cljs.core.Keyword(null,"transient","transient",-741416458),true);
return cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"operator","operator",-1860875338),new cljs.core.Keyword(null,"data","data",-232669377),new cljs.core.Keyword(null,"ext-contract","ext-contract",812214039),new cljs.core.Keyword(null,"ext-stages","ext-stages",680954732),new cljs.core.Keyword(null,"return","return",-1891502105),new cljs.core.Keyword(null,"transient","transient",-741416458)],[operator,data,ext_contract,ext_stages,cljs.core.PersistentArrayMap.EMPTY,(!(transient$ === false))]);
}));
(emptyhead.principle.crud.make_principle.cljs$lang$maxFixedArity = (1));
/** @this {Function} */
(emptyhead.principle.crud.make_principle.cljs$lang$applyTo = (function (seq31659){
var G__31660 = cljs.core.first(seq31659);
var seq31659__$1 = cljs.core.next(seq31659);
var self__5711__auto__ = this;
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__31660,seq31659__$1);
}));
/**
* Create a principle and register it in the state.
* Returns a reference to the created principle.
*/
emptyhead.principle.crud.register_principle_BANG_ = (function emptyhead$principle$crud$register_principle_BANG_(var_args){
var args__5732__auto__ = [];
var len__5726__auto___31670 = arguments.length;
var i__5727__auto___31671 = (0);
while(true){
if((i__5727__auto___31671 < len__5726__auto___31670)){
args__5732__auto__.push((arguments[i__5727__auto___31671]));
var G__31672 = (i__5727__auto___31671 + (1));
i__5727__auto___31671 = G__31672;
continue;
} else {
}
break;
}
var argseq__5733__auto__ = ((((1) < args__5732__auto__.length))?(new cljs.core.IndexedSeq(args__5732__auto__.slice((1)),(0),null)):null);
return emptyhead.principle.crud.register_principle_BANG_.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__5733__auto__);
});
(emptyhead.principle.crud.register_principle_BANG_.cljs$core$IFn$_invoke$arity$variadic = (function (operator,p__31665){
var map__31666 = p__31665;
var map__31666__$1 = cljs.core.__destructure_map(map__31666);
var args = map__31666__$1;
var data = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__31666__$1,new cljs.core.Keyword(null,"data","data",-232669377));
var ext_contract = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__31666__$1,new cljs.core.Keyword(null,"ext-contract","ext-contract",812214039));
var ext_stages = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__31666__$1,new cljs.core.Keyword(null,"ext-stages","ext-stages",680954732));
var transient$ = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__31666__$1,new cljs.core.Keyword(null,"transient","transient",-741416458));
return emptyhead.idea.crud.have_idea_BANG_.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.Keyword(null,"prefix","prefix",-265908465),["principle_",cljs.core.name(operator),"_"].join(''),new cljs.core.Keyword(null,"properties","properties",685819552),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"principle","principle",-1390571781)], null)], null),new cljs.core.Keyword(null,"data","data",-232669377),emptyhead.principle.crud.make_principle.cljs$core$IFn$_invoke$arity$variadic(operator,cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([args], 0))], 0));
}));
(emptyhead.principle.crud.register_principle_BANG_.cljs$lang$maxFixedArity = (1));
/** @this {Function} */
(emptyhead.principle.crud.register_principle_BANG_.cljs$lang$applyTo = (function (seq31663){
var G__31664 = cljs.core.first(seq31663);
var seq31663__$1 = cljs.core.next(seq31663);
var self__5711__auto__ = this;
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__31664,seq31663__$1);
}));
/**
* Get the extension contract of a `principle`.
* Returns the contract.
*/
emptyhead.principle.crud.contract = (function emptyhead$principle$crud$contract(principle){
return emptyhead.idea.protocol.val_fn(new cljs.core.Keyword(null,"ext-contract","ext-contract",812214039),principle);
});
/**
* Get the extension stages of a `principle`.
* Returns the list of stages.
*/
emptyhead.principle.crud.stages = (function emptyhead$principle$crud$stages(principle){
return emptyhead.idea.protocol.val_fn(new cljs.core.Keyword(null,"ext-stages","ext-stages",680954732),principle);
});
/**
* Get the operator id of a `principle`.
* Returns the operator keyword.
*/
emptyhead.principle.crud.operator = (function emptyhead$principle$crud$operator(principle){
return emptyhead.idea.protocol.val_fn(new cljs.core.Keyword(null,"operator","operator",-1860875338),principle);
});
//# sourceMappingURL=emptyhead.principle.crud.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["emptyhead/principle/crud.cljs"],"mappings":";AAQA,AAAA;;;;0CAAA,kDAAAA,5FAAMM;AAAN,AAAA,IAAAL,qBAAA;AAAA,AAAA,IAAAC,0BAAA,AAAA;AAAA,AAAA,IAAAC,wBAAA;;AAAA,AAAA,GAAA,CAAAA,wBAAAD;AAAA,AAAA,AAAAD,wBAAA,CAAA,UAAAE;;AAAA,eAAA,CAAAA,wBAAA;;;;AAAA;;;;AAAA,IAAAC,uBAAA,EAAA,CAAA,MAAA,AAAAH,4BAAA,AAAA,KAAAI,qBAAA,AAAAJ,yBAAA,KAAA,IAAA,OAAA;AAAA,AAAA,OAAAK,6EAAA,CAAA,UAAA,MAAAF;;;AAAA,AAAA,CAAA,+EAAA,oBAAAG,nGAAMD,0FAGHU;AAHH,AAAA,IAAAR,aAAAD;IAAAC,iBAAA,AAAAC,4BAAAD;WAAA,AAAAE,4CAAAF,eAAA,qDAAA,vHAGsBS;mBAHtB,AAAAP,4CAAAF,eAAA,oEAAA,9IAG2BU;iBAH3B,AAAAR,4CAAAF,eAAA,gEAAA,mFAAA,mFAAA,9SAGwCW,8WAEIH;iBAL5C,AAAAN,4CAAAF,eAAA,+DAAA,vIAGmDY;AAHnD,AAOE,OAAAC,uCAAA,CAAA,8DAAA,qDAAA,oEAAA,gEAAA,0DAAA,gEAAA,uCAAA,tCAAoBL,SACJC,KACQC,aACFC,8CAED,GAAK,AAAQC;;;AAZpC,CAAA,kEAAA,lEAAMd;;AAAN;AAAA,CAAA,4DAAA,WAAAK,vEAAML;AAAN,AAAA,IAAAM,WAAA,AAAAC,gBAAAF;IAAAA,eAAA,AAAAG,eAAAH;AAAA,AAAA,IAAAI,qBAAA;AAAA,AAAA,OAAAA,wDAAAH,SAAAD;;;AAAA,AAcA,AAAA;;;;oDAAA,4DAAAX,hHAAMsB;AAAN,AAAA,IAAArB,qBAAA;AAAA,AAAA,IAAAC,0BAAA,AAAA;AAAA,AAAA,IAAAC,wBAAA;;AAAA,AAAA,GAAA,CAAAA,wBAAAD;AAAA,AAAA,AAAAD,wBAAA,CAAA,UAAAE;;AAAA,eAAA,CAAAA,wBAAA;;;;AAAA;;;;AAAA,IAAAC,uBAAA,EAAA,CAAA,MAAA,AAAAH,4BAAA,AAAA,KAAAI,qBAAA,AAAAJ,yBAAA,KAAA,IAAA,OAAA;AAAA,AAAA,OAAAqB,uFAAA,CAAA,UAAA,MAAAlB;;;AAAA,AAAA,CAAA,yFAAA,oBAAAmB,7GAAMD,oGAGHN;AAHH,AAAA,IAAAQ,aAAAD;IAAAC,iBAAA,AAAAf,4BAAAe;WAAAA,PAImBG;WAJnB,AAAAjB,4CAAAc,eAAA,lEAGsBP;mBAHtB,AAAAP,4CAAAc,eAAA,1EAG2BN;iBAH3B,AAAAR,4CAAAc,eAAA,xEAGwCL;iBAHxC,AAAAT,4CAAAc,eAAA,xEAGmDJ;AAHnD,AAKI,kIAAA,8GAAA,gEAAA,mFAAA,mFAAA,gFAAA,/hBAACQ,oLACQ,CAAA,sCAAA,zBAAkB,AAACC,eAAKb,mYAE1B,AAACc,6EAAed,2DAASW;;;AARpC,CAAA,4EAAA,5EAAML;;AAAN;AAAA,CAAA,sEAAA,WAAAG,jFAAMH;AAAN,AAAA,IAAAI,WAAA,AAAAb,gBAAAY;IAAAA,eAAA,AAAAX,eAAAW;AAAA,AAAA,IAAAV,qBAAA;AAAA,AAAA,OAAAA,wDAAAW,SAAAD;;;AAAA,AAUA;;;;oCAAA,pCAAMM,gFAGHC;AAHH,AAIE,sCAAA,/BAACC,mGAA0BD;;AAE7B;;;;kCAAA,lCAAME,4EAGHF;AAHH,AAIE,sCAAA,/BAACC,+FAAwBD;;AAE3B;;;;oCAAA,pCAAMG,gFAGHH;AAHH,AAIE,sCAAA,/BAACC,6FAAsBD","names":["var_args","args__5732__auto__","len__5726__auto__","i__5727__auto__","argseq__5733__auto__","cljs.core/IndexedSeq","emptyhead.principle.crud/make-principle","p__31661","map__31662","cljs.core/--destructure-map","cljs.core.get","seq31659","G__31660","cljs.core/first","cljs.core/next","self__5711__auto__","operator","data","ext-contract","ext-stages","transient","cljs.core/PersistentHashMap","emptyhead.principle.crud/register-principle!","p__31665","map__31666","seq31663","G__31664","args","emptyhead.idea.crud.have_idea_BANG_","cljs.core/name","emptyhead.principle.crud.make_principle","emptyhead.principle.crud/contract","principle","emptyhead.idea.protocol/val-fn","emptyhead.principle.crud/stages","emptyhead.principle.crud/operator"],"sourcesContent":["(ns emptyhead.principle.crud\n \"Implements CRUD operations on principles.\n Since principles are ideas, 'missing' operations here are implemented in [[emptyhead.idea.crud]].\"\n (:require [emptyhead.idea.protocol :as prtc]\n [emptyhead.idea.crud :as idea]\n [emptyhead.idea.property :as prop]\n [emptyhead.contract.eval :as contract]))\n\n(defn make-principle\n \"Helper function to make principle object.\n You may want `register-principle!` instead.\"\n [operator & {:keys [data ext-contract ext-stages transient]\n :or {data {} ext-contract {}\n ext-stages [[:principle operator]]\n transient true}}]\n (hash-map :operator operator\n :data data\n :ext-contract ext-contract\n :ext-stages ext-stages\n :return {}\n :transient (not (false? transient))))\n\n(defn register-principle!\n \"Create a principle and register it in the state.\n Returns a reference to the created principle.\"\n [operator & {:keys [data ext-contract ext-stages transient]\n :as args}]\n (idea/have-idea!\n :prefix (str \"principle_\" (name operator) \"_\")\n :properties [[:principle]]\n :data (make-principle operator args)))\n\n(defn contract\n \"Get the extension contract of a `principle`.\n Returns the contract.\"\n [principle]\n (prtc/val-fn :ext-contract principle))\n\n(defn stages\n \"Get the extension stages of a `principle`.\n Returns the list of stages.\"\n [principle]\n (prtc/val-fn :ext-stages principle))\n\n(defn operator\n \"Get the operator id of a `principle`.\n Returns the operator keyword.\"\n [principle]\n (prtc/val-fn :operator principle))\n"]}

View File

@@ -0,0 +1,105 @@
goog.provide('emptyhead.util.logging');
emptyhead.util.logging.error = (function emptyhead$util$logging$error(var_args){
var args__5732__auto__ = [];
var len__5726__auto___31594 = arguments.length;
var i__5727__auto___31595 = (0);
while(true){
if((i__5727__auto___31595 < len__5726__auto___31594)){
args__5732__auto__.push((arguments[i__5727__auto___31595]));
var G__31596 = (i__5727__auto___31595 + (1));
i__5727__auto___31595 = G__31596;
continue;
} else {
}
break;
}
var argseq__5733__auto__ = ((((1) < args__5732__auto__.length))?(new cljs.core.IndexedSeq(args__5732__auto__.slice((1)),(0),null)):null);
return emptyhead.util.logging.error.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__5733__auto__);
});
(emptyhead.util.logging.error.cljs$core$IFn$_invoke$arity$variadic = (function (message,data){
throw cljs.core.ex_info.cljs$core$IFn$_invoke$arity$2(message,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"data","data",-232669377),data], null));
}));
(emptyhead.util.logging.error.cljs$lang$maxFixedArity = (1));
/** @this {Function} */
(emptyhead.util.logging.error.cljs$lang$applyTo = (function (seq31588){
var G__31589 = cljs.core.first(seq31588);
var seq31588__$1 = cljs.core.next(seq31588);
var self__5711__auto__ = this;
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__31589,seq31588__$1);
}));
emptyhead.util.logging.warn = (function emptyhead$util$logging$warn(var_args){
var args__5732__auto__ = [];
var len__5726__auto___31597 = arguments.length;
var i__5727__auto___31598 = (0);
while(true){
if((i__5727__auto___31598 < len__5726__auto___31597)){
args__5732__auto__.push((arguments[i__5727__auto___31598]));
var G__31599 = (i__5727__auto___31598 + (1));
i__5727__auto___31598 = G__31599;
continue;
} else {
}
break;
}
var argseq__5733__auto__ = ((((1) < args__5732__auto__.length))?(new cljs.core.IndexedSeq(args__5732__auto__.slice((1)),(0),null)):null);
return emptyhead.util.logging.warn.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__5733__auto__);
});
(emptyhead.util.logging.warn.cljs$core$IFn$_invoke$arity$variadic = (function (message,data){
return emptyhead.util.logging.error.cljs$core$IFn$_invoke$arity$variadic(message,cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([data], 0));
}));
(emptyhead.util.logging.warn.cljs$lang$maxFixedArity = (1));
/** @this {Function} */
(emptyhead.util.logging.warn.cljs$lang$applyTo = (function (seq31590){
var G__31591 = cljs.core.first(seq31590);
var seq31590__$1 = cljs.core.next(seq31590);
var self__5711__auto__ = this;
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__31591,seq31590__$1);
}));
emptyhead.util.logging.message = (function emptyhead$util$logging$message(var_args){
var args__5732__auto__ = [];
var len__5726__auto___31600 = arguments.length;
var i__5727__auto___31601 = (0);
while(true){
if((i__5727__auto___31601 < len__5726__auto___31600)){
args__5732__auto__.push((arguments[i__5727__auto___31601]));
var G__31602 = (i__5727__auto___31601 + (1));
i__5727__auto___31601 = G__31602;
continue;
} else {
}
break;
}
var argseq__5733__auto__ = ((((1) < args__5732__auto__.length))?(new cljs.core.IndexedSeq(args__5732__auto__.slice((1)),(0),null)):null);
return emptyhead.util.logging.message.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__5733__auto__);
});
(emptyhead.util.logging.message.cljs$core$IFn$_invoke$arity$variadic = (function (message,data){
return cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([message,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"data","data",-232669377),data], null)], 0));
}));
(emptyhead.util.logging.message.cljs$lang$maxFixedArity = (1));
/** @this {Function} */
(emptyhead.util.logging.message.cljs$lang$applyTo = (function (seq31592){
var G__31593 = cljs.core.first(seq31592);
var seq31592__$1 = cljs.core.next(seq31592);
var self__5711__auto__ = this;
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__31593,seq31592__$1);
}));
//# sourceMappingURL=emptyhead.util.logging.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["emptyhead/util/logging.cljs"],"mappings":";AAEA,AAAA,+BAAA,uCAAAA,tEAAMM;AAAN,AAAA,IAAAL,qBAAA;AAAA,AAAA,IAAAC,0BAAA,AAAA;AAAA,AAAA,IAAAC,wBAAA;;AAAA,AAAA,GAAA,CAAAA,wBAAAD;AAAA,AAAA,AAAAD,wBAAA,CAAA,UAAAE;;AAAA,eAAA,CAAAA,wBAAA;;;;AAAA;;;;AAAA,IAAAC,uBAAA,EAAA,CAAA,MAAA,AAAAH,4BAAA,AAAA,KAAAI,qBAAA,AAAAJ,yBAAA,KAAA,IAAA,OAAA;AAAA,AAAA,OAAAK,kEAAA,CAAA,UAAA,MAAAF;;;AAAA,AAAA,CAAA,oEAAA,pEAAME,+EAAOM,QAAUC;AAAvB,AACE,MAAO,wDAAA,2CAAA,nGAACC,gDAAQF,wGAAeC;;;AADjC,CAAA,uDAAA,vDAAMP;;AAAN;AAAA,CAAA,iDAAA,WAAAC,5DAAMD;AAAN,AAAA,IAAAE,WAAA,AAAAC,gBAAAF;IAAAA,eAAA,AAAAG,eAAAH;AAAA,AAAA,IAAAI,qBAAA;AAAA,AAAA,OAAAA,wDAAAH,SAAAD;;;AAAA,AAGA,AAAA,8BAAA,sCAAAP,pEAAMe;AAAN,AAAA,IAAAd,qBAAA;AAAA,AAAA,IAAAC,0BAAA,AAAA;AAAA,AAAA,IAAAC,wBAAA;;AAAA,AAAA,GAAA,CAAAA,wBAAAD;AAAA,AAAA,AAAAD,wBAAA,CAAA,UAAAE;;AAAA,eAAA,CAAAA,wBAAA;;;;AAAA;;;;AAAA,IAAAC,uBAAA,EAAA,CAAA,MAAA,AAAAH,4BAAA,AAAA,KAAAI,qBAAA,AAAAJ,yBAAA,KAAA,IAAA,OAAA;AAAA,AAAA,OAAAc,iEAAA,CAAA,UAAA,MAAAX;;;AAAA,AAAA,CAAA,mEAAA,nEAAMW,8EAAMH,QAAUC;AAAtB,AACE,OAACK,kEAAMN,0DAAQC;;;AADjB,CAAA,sDAAA,tDAAME;;AAAN;AAAA,CAAA,gDAAA,WAAAC,3DAAMD;AAAN,AAAA,IAAAE,WAAA,AAAAR,gBAAAO;IAAAA,eAAA,AAAAN,eAAAM;AAAA,AAAA,IAAAL,qBAAA;AAAA,AAAA,OAAAA,wDAAAM,SAAAD;;;AAAA,AAGA,AAAA,iCAAA,yCAAAhB,1EAAMmB;AAAN,AAAA,IAAAlB,qBAAA;AAAA,AAAA,IAAAC,0BAAA,AAAA;AAAA,AAAA,IAAAC,wBAAA;;AAAA,AAAA,GAAA,CAAAA,wBAAAD;AAAA,AAAA,AAAAD,wBAAA,CAAA,UAAAE;;AAAA,eAAA,CAAAA,wBAAA;;;;AAAA;;;;AAAA,IAAAC,uBAAA,EAAA,CAAA,MAAA,AAAAH,4BAAA,AAAA,KAAAI,qBAAA,AAAAJ,yBAAA,KAAA,IAAA,OAAA;AAAA,AAAA,OAAAkB,oEAAA,CAAA,UAAA,MAAAf;;;AAAA,AAAA,CAAA,sEAAA,tEAAMe,iFAASP,QAAUC;AAAzB,AACE,wHAAA,2CAAA,5JAACS,yGAAQV,wGAAeC;;;AAD1B,CAAA,yDAAA,zDAAMM;;AAAN;AAAA,CAAA,mDAAA,WAAAC,9DAAMD;AAAN,AAAA,IAAAE,WAAA,AAAAZ,gBAAAW;IAAAA,eAAA,AAAAV,eAAAU;AAAA,AAAA,IAAAT,qBAAA;AAAA,AAAA,OAAAA,wDAAAU,SAAAD;;;AAAA","names":["var_args","args__5732__auto__","len__5726__auto__","i__5727__auto__","argseq__5733__auto__","cljs.core/IndexedSeq","emptyhead.util.logging/error","seq31588","G__31589","cljs.core/first","cljs.core/next","self__5711__auto__","message","data","cljs.core.ex_info","emptyhead.util.logging/warn","seq31590","G__31591","emptyhead.util.logging.error","emptyhead.util.logging/message","seq31592","G__31593","cljs.core.println"],"sourcesContent":["(ns emptyhead.util.logging)\n\n(defn error [message & data]\n (throw (ex-info message {:data data})))\n\n(defn warn [message & data]\n (error message data))\n\n(defn message [message & data]\n (println message {:data data}))\n"]}

View File

@@ -0,0 +1,657 @@
goog.loadModule(function(exports) {
function peek(array) {
return array[array.length - 1];
}
function forEachRight(arr, f, opt_obj) {
const l = arr.length;
const arr2 = typeof arr === "string" ? arr.split("") : arr;
for (let i = l - 1; i >= 0; --i) {
if (i in arr2) {
f.call(opt_obj, arr2[i], i, arr);
}
}
}
function count(arr, f, opt_obj) {
let count = 0;
forEach(arr, function(element, index, arr) {
if (f.call(opt_obj, element, index, arr)) {
++count;
}
}, opt_obj);
return count;
}
function find(arr, f, opt_obj) {
const i = findIndex(arr, f, opt_obj);
return i < 0 ? null : typeof arr === "string" ? arr.charAt(i) : arr[i];
}
function findIndex(arr, f, opt_obj) {
const l = arr.length;
const arr2 = typeof arr === "string" ? arr.split("") : arr;
for (let i = 0; i < l; i++) {
if (i in arr2 && f.call(opt_obj, arr2[i], i, arr)) {
return i;
}
}
return -1;
}
function findRight(arr, f, opt_obj) {
const i = findIndexRight(arr, f, opt_obj);
return i < 0 ? null : typeof arr === "string" ? arr.charAt(i) : arr[i];
}
function findIndexRight(arr, f, opt_obj) {
const l = arr.length;
const arr2 = typeof arr === "string" ? arr.split("") : arr;
for (let i = l - 1; i >= 0; i--) {
if (i in arr2 && f.call(opt_obj, arr2[i], i, arr)) {
return i;
}
}
return -1;
}
function contains(arr, obj) {
return indexOf(arr, obj) >= 0;
}
function isEmpty(arr) {
return arr.length == 0;
}
function clear(arr) {
if (!Array.isArray(arr)) {
for (let i = arr.length - 1; i >= 0; i--) {
delete arr[i];
}
}
arr.length = 0;
}
function insert(arr, obj) {
if (!contains(arr, obj)) {
arr.push(obj);
}
}
function insertAt(arr, obj, opt_i) {
splice(arr, opt_i, 0, obj);
}
function insertArrayAt(arr, elementsToAdd, opt_i) {
goog.partial(splice, arr, opt_i, 0).apply(null, elementsToAdd);
}
function insertBefore(arr, obj, opt_obj2) {
let i;
if (arguments.length == 2 || (i = indexOf(arr, opt_obj2)) < 0) {
arr.push(obj);
} else {
insertAt(arr, obj, i);
}
}
function remove(arr, obj) {
const i = indexOf(arr, obj);
let rv;
if (rv = i >= 0) {
removeAt(arr, i);
}
return rv;
}
function removeLast(arr, obj) {
const i = lastIndexOf(arr, obj);
if (i >= 0) {
removeAt(arr, i);
return true;
}
return false;
}
function removeAt(arr, i) {
asserts.assert(arr.length != null);
return Array.prototype.splice.call(arr, i, 1).length == 1;
}
function removeIf(arr, f, opt_obj) {
const i = findIndex(arr, f, opt_obj);
if (i >= 0) {
removeAt(arr, i);
return true;
}
return false;
}
function removeAllIf(arr, f, opt_obj) {
let removedCount = 0;
forEachRight(arr, function(val, index) {
if (f.call(opt_obj, val, index, arr)) {
if (removeAt(arr, index)) {
removedCount++;
}
}
});
return removedCount;
}
function concat(var_args) {
return Array.prototype.concat.apply([], arguments);
}
function join(var_args) {
return Array.prototype.concat.apply([], arguments);
}
function toArray(object) {
const length = object.length;
if (length > 0) {
const rv = new Array(length);
for (let i = 0; i < length; i++) {
rv[i] = object[i];
}
return rv;
}
return [];
}
function extend(arr1, var_args) {
for (let i = 1; i < arguments.length; i++) {
const arr2 = arguments[i];
if (goog.isArrayLike(arr2)) {
const len1 = arr1.length || 0;
const len2 = arr2.length || 0;
arr1.length = len1 + len2;
for (let j = 0; j < len2; j++) {
arr1[len1 + j] = arr2[j];
}
} else {
arr1.push(arr2);
}
}
}
function splice(arr, index, howMany, var_args) {
asserts.assert(arr.length != null);
return Array.prototype.splice.apply(arr, slice(arguments, 1));
}
function slice(arr, start, opt_end) {
asserts.assert(arr.length != null);
if (arguments.length <= 2) {
return Array.prototype.slice.call(arr, start);
} else {
return Array.prototype.slice.call(arr, start, opt_end);
}
}
function removeDuplicates(arr, opt_rv, opt_hashFn) {
const returnArray = opt_rv || arr;
const defaultHashFn = function(item) {
return goog.isObject(item) ? "o" + goog.getUid(item) : (typeof item).charAt(0) + item;
};
const hashFn = opt_hashFn || defaultHashFn;
let cursorInsert = 0;
let cursorRead = 0;
const seen = {};
for (; cursorRead < arr.length;) {
const current = arr[cursorRead++];
const key = hashFn(current);
if (!Object.prototype.hasOwnProperty.call(seen, key)) {
seen[key] = true;
returnArray[cursorInsert++] = current;
}
}
returnArray.length = cursorInsert;
}
function binarySearch(arr, target, opt_compareFn) {
return binarySearch_(arr, opt_compareFn || defaultCompare, false, target);
}
function binarySelect(arr, evaluator, opt_obj) {
return binarySearch_(arr, evaluator, true, undefined, opt_obj);
}
function binarySearch_(arr, compareFn, isEvaluator, opt_target, opt_selfObj) {
let left = 0;
let right = arr.length;
let found;
for (; left < right;) {
const middle = left + (right - left >>> 1);
let compareResult;
if (isEvaluator) {
compareResult = compareFn.call(opt_selfObj, arr[middle], middle, arr);
} else {
compareResult = compareFn(opt_target, arr[middle]);
}
if (compareResult > 0) {
left = middle + 1;
} else {
right = middle;
found = !compareResult;
}
}
return found ? left : -left - 1;
}
function sort(arr, opt_compareFn) {
arr.sort(opt_compareFn || defaultCompare);
}
function stableSort(arr, opt_compareFn) {
function stableCompareFn(obj1, obj2) {
return valueCompareFn(obj1.value, obj2.value) || obj1.index - obj2.index;
}
const compArr = new Array(arr.length);
for (let i = 0; i < arr.length; i++) {
compArr[i] = {index:i, value:arr[i]};
}
const valueCompareFn = opt_compareFn || defaultCompare;
sort(compArr, stableCompareFn);
for (let i = 0; i < arr.length; i++) {
arr[i] = compArr[i].value;
}
}
function sortByKey(arr, keyFn, opt_compareFn) {
const keyCompareFn = opt_compareFn || defaultCompare;
sort(arr, function(a, b) {
return keyCompareFn(keyFn(a), keyFn(b));
});
}
function sortObjectsByKey(arr, key, opt_compareFn) {
sortByKey(arr, function(obj) {
return obj[key];
}, opt_compareFn);
}
function isSorted(arr, opt_compareFn, opt_strict) {
const compare = opt_compareFn || defaultCompare;
for (let i = 1; i < arr.length; i++) {
const compareResult = compare(arr[i - 1], arr[i]);
if (compareResult > 0 || compareResult == 0 && opt_strict) {
return false;
}
}
return true;
}
function equals(arr1, arr2, opt_equalsFn) {
if (!goog.isArrayLike(arr1) || !goog.isArrayLike(arr2) || arr1.length != arr2.length) {
return false;
}
const l = arr1.length;
const equalsFn = opt_equalsFn || defaultCompareEquality;
for (let i = 0; i < l; i++) {
if (!equalsFn(arr1[i], arr2[i])) {
return false;
}
}
return true;
}
function compare3(arr1, arr2, opt_compareFn) {
const compare = opt_compareFn || defaultCompare;
const l = Math.min(arr1.length, arr2.length);
for (let i = 0; i < l; i++) {
const result = compare(arr1[i], arr2[i]);
if (result != 0) {
return result;
}
}
return defaultCompare(arr1.length, arr2.length);
}
function defaultCompare(a, b) {
return a > b ? 1 : a < b ? -1 : 0;
}
function inverseDefaultCompare(a, b) {
return -defaultCompare(a, b);
}
function defaultCompareEquality(a, b) {
return a === b;
}
function binaryInsert(array, value, opt_compareFn) {
const index = binarySearch(array, value, opt_compareFn);
if (index < 0) {
insertAt(array, value, -(index + 1));
return true;
}
return false;
}
function binaryRemove(array, value, opt_compareFn) {
const index = binarySearch(array, value, opt_compareFn);
return index >= 0 ? removeAt(array, index) : false;
}
function bucket(array, sorter, opt_obj) {
const buckets = {};
for (let i = 0; i < array.length; i++) {
const value = array[i];
const key = sorter.call(opt_obj, value, i, array);
if (key !== undefined) {
const bucket = buckets[key] || (buckets[key] = []);
bucket.push(value);
}
}
return buckets;
}
function bucketToMap(array, sorter) {
const buckets = new Map();
for (let i = 0; i < array.length; i++) {
const value = array[i];
const key = sorter(value, i, array);
if (key !== undefined) {
let bucket = buckets.get(key);
if (!bucket) {
bucket = [];
buckets.set(key, bucket);
}
bucket.push(value);
}
}
return buckets;
}
function toObject(arr, keyFunc, opt_obj) {
const ret = {};
forEach(arr, function(element, index) {
ret[keyFunc.call(opt_obj, element, index, arr)] = element;
});
return ret;
}
function toMap(arr, keyFunc) {
const map = new Map();
for (let i = 0; i < arr.length; i++) {
const element = arr[i];
map.set(keyFunc(element, i, arr), element);
}
return map;
}
function range(startOrEnd, opt_end, opt_step) {
const array = [];
let start = 0;
let end = startOrEnd;
const step = opt_step || 1;
if (opt_end !== undefined) {
start = startOrEnd;
end = opt_end;
}
if (step * (end - start) < 0) {
return [];
}
if (step > 0) {
for (let i = start; i < end; i = i + step) {
array.push(i);
}
} else {
for (let i = start; i > end; i = i + step) {
array.push(i);
}
}
return array;
}
function repeat(value, n) {
const array = [];
for (let i = 0; i < n; i++) {
array[i] = value;
}
return array;
}
function flatten(var_args) {
const CHUNK_SIZE = 8192;
const result = [];
for (let i = 0; i < arguments.length; i++) {
const element = arguments[i];
if (Array.isArray(element)) {
for (let c = 0; c < element.length; c = c + CHUNK_SIZE) {
const chunk = slice(element, c, c + CHUNK_SIZE);
const recurseResult = flatten.apply(null, chunk);
for (let r = 0; r < recurseResult.length; r++) {
result.push(recurseResult[r]);
}
}
} else {
result.push(element);
}
}
return result;
}
function rotate(array, n) {
asserts.assert(array.length != null);
if (array.length) {
n = n % array.length;
if (n > 0) {
Array.prototype.unshift.apply(array, array.splice(-n, n));
} else if (n < 0) {
Array.prototype.push.apply(array, array.splice(0, -n));
}
}
return array;
}
function moveItem(arr, fromIndex, toIndex) {
asserts.assert(fromIndex >= 0 && fromIndex < arr.length);
asserts.assert(toIndex >= 0 && toIndex < arr.length);
const removedItems = Array.prototype.splice.call(arr, fromIndex, 1);
Array.prototype.splice.call(arr, toIndex, 0, removedItems[0]);
}
function zip(var_args) {
if (!arguments.length) {
return [];
}
const result = [];
let minLen = arguments[0].length;
for (let i = 1; i < arguments.length; i++) {
if (arguments[i].length < minLen) {
minLen = arguments[i].length;
}
}
for (let i = 0; i < minLen; i++) {
const value = [];
for (let j = 0; j < arguments.length; j++) {
value.push(arguments[j][i]);
}
result.push(value);
}
return result;
}
function shuffle(arr, opt_randFn) {
const randFn = opt_randFn || Math.random;
for (let i = arr.length - 1; i > 0; i--) {
const j = Math.floor(randFn() * (i + 1));
const tmp = arr[i];
arr[i] = arr[j];
arr[j] = tmp;
}
}
function copyByIndex(arr, index_arr) {
const result = [];
forEach(index_arr, function(index) {
result.push(arr[index]);
});
return result;
}
function concatMap(arr, f, opt_obj) {
return concat.apply([], map(arr, f, opt_obj));
}
"use strict";
goog.module("goog.array");
goog.module.declareLegacyNamespace();
const asserts = goog.require("goog.asserts");
goog.NATIVE_ARRAY_PROTOTYPES = goog.define("goog.NATIVE_ARRAY_PROTOTYPES", goog.TRUSTED_SITE);
const ASSUME_NATIVE_FUNCTIONS = goog.define("goog.array.ASSUME_NATIVE_FUNCTIONS", goog.FEATURESET_YEAR > 2012);
exports.ASSUME_NATIVE_FUNCTIONS = ASSUME_NATIVE_FUNCTIONS;
exports.peek = peek;
exports.last = peek;
const indexOf = goog.NATIVE_ARRAY_PROTOTYPES && (ASSUME_NATIVE_FUNCTIONS || Array.prototype.indexOf) ? function(arr, obj, opt_fromIndex) {
asserts.assert(arr.length != null);
return Array.prototype.indexOf.call(arr, obj, opt_fromIndex);
} : function(arr, obj, opt_fromIndex) {
const fromIndex = opt_fromIndex == null ? 0 : opt_fromIndex < 0 ? Math.max(0, arr.length + opt_fromIndex) : opt_fromIndex;
if (typeof arr === "string") {
if (typeof obj !== "string" || obj.length != 1) {
return -1;
}
return arr.indexOf(obj, fromIndex);
}
for (let i = fromIndex; i < arr.length; i++) {
if (i in arr && arr[i] === obj) {
return i;
}
}
return -1;
};
exports.indexOf = indexOf;
const lastIndexOf = goog.NATIVE_ARRAY_PROTOTYPES && (ASSUME_NATIVE_FUNCTIONS || Array.prototype.lastIndexOf) ? function(arr, obj, opt_fromIndex) {
asserts.assert(arr.length != null);
const fromIndex = opt_fromIndex == null ? arr.length - 1 : opt_fromIndex;
return Array.prototype.lastIndexOf.call(arr, obj, fromIndex);
} : function(arr, obj, opt_fromIndex) {
let fromIndex = opt_fromIndex == null ? arr.length - 1 : opt_fromIndex;
if (fromIndex < 0) {
fromIndex = Math.max(0, arr.length + fromIndex);
}
if (typeof arr === "string") {
if (typeof obj !== "string" || obj.length != 1) {
return -1;
}
return arr.lastIndexOf(obj, fromIndex);
}
for (let i = fromIndex; i >= 0; i--) {
if (i in arr && arr[i] === obj) {
return i;
}
}
return -1;
};
exports.lastIndexOf = lastIndexOf;
const forEach = goog.NATIVE_ARRAY_PROTOTYPES && (ASSUME_NATIVE_FUNCTIONS || Array.prototype.forEach) ? function(arr, f, opt_obj) {
asserts.assert(arr.length != null);
Array.prototype.forEach.call(arr, f, opt_obj);
} : function(arr, f, opt_obj) {
const l = arr.length;
const arr2 = typeof arr === "string" ? arr.split("") : arr;
for (let i = 0; i < l; i++) {
if (i in arr2) {
f.call(opt_obj, arr2[i], i, arr);
}
}
};
exports.forEach = forEach;
exports.forEachRight = forEachRight;
const filter = goog.NATIVE_ARRAY_PROTOTYPES && (ASSUME_NATIVE_FUNCTIONS || Array.prototype.filter) ? function(arr, f, opt_obj) {
asserts.assert(arr.length != null);
return Array.prototype.filter.call(arr, f, opt_obj);
} : function(arr, f, opt_obj) {
const l = arr.length;
const res = [];
let resLength = 0;
const arr2 = typeof arr === "string" ? arr.split("") : arr;
for (let i = 0; i < l; i++) {
if (i in arr2) {
const val = arr2[i];
if (f.call(opt_obj, val, i, arr)) {
res[resLength++] = val;
}
}
}
return res;
};
exports.filter = filter;
const map = goog.NATIVE_ARRAY_PROTOTYPES && (ASSUME_NATIVE_FUNCTIONS || Array.prototype.map) ? function(arr, f, opt_obj) {
asserts.assert(arr.length != null);
return Array.prototype.map.call(arr, f, opt_obj);
} : function(arr, f, opt_obj) {
const l = arr.length;
const res = new Array(l);
const arr2 = typeof arr === "string" ? arr.split("") : arr;
for (let i = 0; i < l; i++) {
if (i in arr2) {
res[i] = f.call(opt_obj, arr2[i], i, arr);
}
}
return res;
};
exports.map = map;
const reduce = goog.NATIVE_ARRAY_PROTOTYPES && (ASSUME_NATIVE_FUNCTIONS || Array.prototype.reduce) ? function(arr, f, val, opt_obj) {
asserts.assert(arr.length != null);
if (opt_obj) {
f = goog.bind(f, opt_obj);
}
return Array.prototype.reduce.call(arr, f, val);
} : function(arr, f, val, opt_obj) {
let rval = val;
forEach(arr, function(val, index) {
rval = f.call(opt_obj, rval, val, index, arr);
});
return rval;
};
exports.reduce = reduce;
const reduceRight = goog.NATIVE_ARRAY_PROTOTYPES && (ASSUME_NATIVE_FUNCTIONS || Array.prototype.reduceRight) ? function(arr, f, val, opt_obj) {
asserts.assert(arr.length != null);
asserts.assert(f != null);
if (opt_obj) {
f = goog.bind(f, opt_obj);
}
return Array.prototype.reduceRight.call(arr, f, val);
} : function(arr, f, val, opt_obj) {
let rval = val;
forEachRight(arr, function(val, index) {
rval = f.call(opt_obj, rval, val, index, arr);
});
return rval;
};
exports.reduceRight = reduceRight;
const some = goog.NATIVE_ARRAY_PROTOTYPES && (ASSUME_NATIVE_FUNCTIONS || Array.prototype.some) ? function(arr, f, opt_obj) {
asserts.assert(arr.length != null);
return Array.prototype.some.call(arr, f, opt_obj);
} : function(arr, f, opt_obj) {
const l = arr.length;
const arr2 = typeof arr === "string" ? arr.split("") : arr;
for (let i = 0; i < l; i++) {
if (i in arr2 && f.call(opt_obj, arr2[i], i, arr)) {
return true;
}
}
return false;
};
exports.some = some;
const every = goog.NATIVE_ARRAY_PROTOTYPES && (ASSUME_NATIVE_FUNCTIONS || Array.prototype.every) ? function(arr, f, opt_obj) {
asserts.assert(arr.length != null);
return Array.prototype.every.call(arr, f, opt_obj);
} : function(arr, f, opt_obj) {
const l = arr.length;
const arr2 = typeof arr === "string" ? arr.split("") : arr;
for (let i = 0; i < l; i++) {
if (i in arr2 && !f.call(opt_obj, arr2[i], i, arr)) {
return false;
}
}
return true;
};
exports.every = every;
exports.count = count;
exports.find = find;
exports.findIndex = findIndex;
exports.findRight = findRight;
exports.findIndexRight = findIndexRight;
exports.contains = contains;
exports.isEmpty = isEmpty;
exports.clear = clear;
exports.insert = insert;
exports.insertAt = insertAt;
exports.insertArrayAt = insertArrayAt;
exports.insertBefore = insertBefore;
exports.remove = remove;
exports.removeLast = removeLast;
exports.removeAt = removeAt;
exports.removeIf = removeIf;
exports.removeAllIf = removeAllIf;
exports.concat = concat;
exports.join = join;
exports.toArray = toArray;
const clone = toArray;
exports.clone = clone;
exports.extend = extend;
exports.splice = splice;
exports.slice = slice;
exports.removeDuplicates = removeDuplicates;
exports.binarySearch = binarySearch;
exports.binarySelect = binarySelect;
exports.sort = sort;
exports.stableSort = stableSort;
exports.sortByKey = sortByKey;
exports.sortObjectsByKey = sortObjectsByKey;
exports.isSorted = isSorted;
exports.equals = equals;
exports.compare3 = compare3;
exports.defaultCompare = defaultCompare;
exports.inverseDefaultCompare = inverseDefaultCompare;
exports.defaultCompareEquality = defaultCompareEquality;
exports.binaryInsert = binaryInsert;
exports.binaryRemove = binaryRemove;
exports.bucket = bucket;
exports.bucketToMap = bucketToMap;
exports.toObject = toObject;
exports.toMap = toMap;
exports.range = range;
exports.repeat = repeat;
exports.flatten = flatten;
exports.rotate = rotate;
exports.moveItem = moveItem;
exports.zip = zip;
exports.shuffle = shuffle;
exports.copyByIndex = copyByIndex;
exports.concatMap = concatMap;
return exports;
});
//# sourceMappingURL=goog.array.array.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,130 @@
goog.loadModule(function(exports) {
function AssertionError(messagePattern, messageArgs) {
DebugError.call(this, subs(messagePattern, messageArgs));
this.messagePattern = messagePattern;
}
function subs(pattern, subs) {
const splitParts = pattern.split("%s");
let returnString = "";
const subLast = splitParts.length - 1;
for (let i = 0; i < subLast; i++) {
const sub = i < subs.length ? subs[i] : "%s";
returnString = returnString + (splitParts[i] + sub);
}
return returnString + splitParts[subLast];
}
function doAssertFailure(defaultMessage, defaultArgs, givenMessage, givenArgs) {
let message = "Assertion failed";
let args;
if (givenMessage) {
message = message + (": " + givenMessage);
args = givenArgs;
} else if (defaultMessage) {
message = message + (": " + defaultMessage);
args = defaultArgs;
}
const e = new AssertionError("" + message, args || []);
errorHandler_(e);
}
function getType(value) {
if (value instanceof Function) {
return value.displayName || value.name || "unknown type name";
} else if (value instanceof Object) {
return value.constructor.displayName || value.constructor.name || Object.prototype.toString.call(value);
} else {
return value === null ? "null" : typeof value;
}
}
"use strict";
goog.module("goog.asserts");
goog.module.declareLegacyNamespace();
const DebugError = goog.require("goog.debug.Error");
const NodeType = goog.require("goog.dom.NodeType");
exports.ENABLE_ASSERTS = goog.define("goog.asserts.ENABLE_ASSERTS", goog.DEBUG);
goog.inherits(AssertionError, DebugError);
exports.AssertionError = AssertionError;
AssertionError.prototype.name = "AssertionError";
exports.DEFAULT_ERROR_HANDLER = function(e) {
throw e;
};
let errorHandler_ = exports.DEFAULT_ERROR_HANDLER;
exports.setErrorHandler = function(errorHandler) {
if (exports.ENABLE_ASSERTS) {
errorHandler_ = errorHandler;
}
};
exports.assert = function(condition, opt_message, var_args) {
if (exports.ENABLE_ASSERTS && !condition) {
doAssertFailure("", null, opt_message, Array.prototype.slice.call(arguments, 2));
}
return condition;
};
exports.assertExists = function(value, opt_message, var_args) {
if (exports.ENABLE_ASSERTS && value == null) {
doAssertFailure("Expected to exist: %s.", [value], opt_message, Array.prototype.slice.call(arguments, 2));
}
return value;
};
exports.fail = function(opt_message, var_args) {
if (exports.ENABLE_ASSERTS) {
errorHandler_(new AssertionError("Failure" + (opt_message ? ": " + opt_message : ""), Array.prototype.slice.call(arguments, 1)));
}
};
exports.assertNumber = function(value, opt_message, var_args) {
if (exports.ENABLE_ASSERTS && typeof value !== "number") {
doAssertFailure("Expected number but got %s: %s.", [goog.typeOf(value), value], opt_message, Array.prototype.slice.call(arguments, 2));
}
return value;
};
exports.assertString = function(value, opt_message, var_args) {
if (exports.ENABLE_ASSERTS && typeof value !== "string") {
doAssertFailure("Expected string but got %s: %s.", [goog.typeOf(value), value], opt_message, Array.prototype.slice.call(arguments, 2));
}
return value;
};
exports.assertFunction = function(value, opt_message, var_args) {
if (exports.ENABLE_ASSERTS && typeof value !== "function") {
doAssertFailure("Expected function but got %s: %s.", [goog.typeOf(value), value], opt_message, Array.prototype.slice.call(arguments, 2));
}
return value;
};
exports.assertObject = function(value, opt_message, var_args) {
if (exports.ENABLE_ASSERTS && !goog.isObject(value)) {
doAssertFailure("Expected object but got %s: %s.", [goog.typeOf(value), value], opt_message, Array.prototype.slice.call(arguments, 2));
}
return value;
};
exports.assertArray = function(value, opt_message, var_args) {
if (exports.ENABLE_ASSERTS && !Array.isArray(value)) {
doAssertFailure("Expected array but got %s: %s.", [goog.typeOf(value), value], opt_message, Array.prototype.slice.call(arguments, 2));
}
return value;
};
exports.assertBoolean = function(value, opt_message, var_args) {
if (exports.ENABLE_ASSERTS && typeof value !== "boolean") {
doAssertFailure("Expected boolean but got %s: %s.", [goog.typeOf(value), value], opt_message, Array.prototype.slice.call(arguments, 2));
}
return value;
};
exports.assertElement = function(value, opt_message, var_args) {
if (exports.ENABLE_ASSERTS && (!goog.isObject(value) || value.nodeType != NodeType.ELEMENT)) {
doAssertFailure("Expected Element but got %s: %s.", [goog.typeOf(value), value], opt_message, Array.prototype.slice.call(arguments, 2));
}
return value;
};
exports.assertInstanceof = function(value, type, opt_message, var_args) {
if (exports.ENABLE_ASSERTS && !(value instanceof type)) {
doAssertFailure("Expected instanceof %s but got %s.", [getType(type), getType(value)], opt_message, Array.prototype.slice.call(arguments, 3));
}
return value;
};
exports.assertFinite = function(value, opt_message, var_args) {
if (exports.ENABLE_ASSERTS && (typeof value != "number" || !isFinite(value))) {
doAssertFailure("Expected %s to be a finite number but it is not.", [value], opt_message, Array.prototype.slice.call(arguments, 2));
}
return value;
};
return exports;
});
//# sourceMappingURL=goog.asserts.asserts.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,86 @@
goog.loadModule(function(exports) {
"use strict";
goog.module("goog.asserts.dom");
goog.module.declareLegacyNamespace();
const TagName = goog.require("goog.dom.TagName");
const asserts = goog.require("goog.asserts");
const element = goog.require("goog.dom.element");
const assertIsElement = value => {
if (asserts.ENABLE_ASSERTS && !element.isElement(value)) {
asserts.fail(`Argument is not an Element; got: ${debugStringForType(value)}`);
}
return value;
};
const assertIsHtmlElement = value => {
if (asserts.ENABLE_ASSERTS && !element.isHtmlElement(value)) {
asserts.fail(`Argument is not an HTML Element; got: ${debugStringForType(value)}`);
}
return value;
};
const assertIsHtmlElementOfType = (value, tagName) => {
if (asserts.ENABLE_ASSERTS && !element.isHtmlElementOfType(value, tagName)) {
asserts.fail(`Argument is not an HTML Element with tag name ` + `${tagName.toString()}; got: ${debugStringForType(value)}`);
}
return value;
};
const assertIsHtmlAnchorElement = value => {
return assertIsHtmlElementOfType(value, TagName.A);
};
const assertIsHtmlButtonElement = value => {
return assertIsHtmlElementOfType(value, TagName.BUTTON);
};
const assertIsHtmlLinkElement = value => {
return assertIsHtmlElementOfType(value, TagName.LINK);
};
const assertIsHtmlImageElement = value => {
return assertIsHtmlElementOfType(value, TagName.IMG);
};
const assertIsHtmlAudioElement = value => {
return assertIsHtmlElementOfType(value, TagName.AUDIO);
};
const assertIsHtmlVideoElement = value => {
return assertIsHtmlElementOfType(value, TagName.VIDEO);
};
const assertIsHtmlInputElement = value => {
return assertIsHtmlElementOfType(value, TagName.INPUT);
};
const assertIsHtmlTextAreaElement = value => {
return assertIsHtmlElementOfType(value, TagName.TEXTAREA);
};
const assertIsHtmlCanvasElement = value => {
return assertIsHtmlElementOfType(value, TagName.CANVAS);
};
const assertIsHtmlEmbedElement = value => {
return assertIsHtmlElementOfType(value, TagName.EMBED);
};
const assertIsHtmlFormElement = value => {
return assertIsHtmlElementOfType(value, TagName.FORM);
};
const assertIsHtmlFrameElement = value => {
return assertIsHtmlElementOfType(value, TagName.FRAME);
};
const assertIsHtmlIFrameElement = value => {
return assertIsHtmlElementOfType(value, TagName.IFRAME);
};
const assertIsHtmlObjectElement = value => {
return assertIsHtmlElementOfType(value, TagName.OBJECT);
};
const assertIsHtmlScriptElement = value => {
return assertIsHtmlElementOfType(value, TagName.SCRIPT);
};
const debugStringForType = value => {
if (goog.isObject(value)) {
try {
return value.constructor.displayName || value.constructor.name || Object.prototype.toString.call(value);
} catch (e) {
return "\x3cobject could not be stringified\x3e";
}
} else {
return value === undefined ? "undefined" : value === null ? "null" : typeof value;
}
};
exports = {assertIsElement, assertIsHtmlElement, assertIsHtmlElementOfType, assertIsHtmlAnchorElement, assertIsHtmlButtonElement, assertIsHtmlLinkElement, assertIsHtmlImageElement, assertIsHtmlAudioElement, assertIsHtmlVideoElement, assertIsHtmlInputElement, assertIsHtmlTextAreaElement, assertIsHtmlCanvasElement, assertIsHtmlEmbedElement, assertIsHtmlFormElement, assertIsHtmlFrameElement, assertIsHtmlIFrameElement, assertIsHtmlObjectElement, assertIsHtmlScriptElement};
return exports;
});
//# sourceMappingURL=goog.asserts.dom.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,86 @@
goog.provide("goog.async.nextTick");
goog.require("goog.debug.entryPointRegistry");
goog.require("goog.dom");
goog.require("goog.dom.TagName");
goog.require("goog.functions");
goog.require("goog.labs.userAgent.browser");
goog.require("goog.labs.userAgent.engine");
goog.async.nextTick = function(callback, opt_context, opt_useSetImmediate) {
var cb = callback;
if (opt_context) {
cb = goog.bind(callback, opt_context);
}
cb = goog.async.nextTick.wrapCallback_(cb);
if (typeof goog.global.setImmediate === "function" && (opt_useSetImmediate || goog.async.nextTick.useSetImmediate_())) {
goog.global.setImmediate(cb);
return;
}
if (!goog.async.nextTick.nextTickImpl) {
goog.async.nextTick.nextTickImpl = goog.async.nextTick.getNextTickImpl_();
}
goog.async.nextTick.nextTickImpl(cb);
};
goog.async.nextTick.useSetImmediate_ = function() {
if (!goog.global.Window || !goog.global.Window.prototype) {
return true;
}
if (goog.labs.userAgent.browser.isEdge() || goog.global.Window.prototype.setImmediate != goog.global.setImmediate) {
return true;
}
return false;
};
goog.async.nextTick.nextTickImpl;
goog.async.nextTick.getNextTickImpl_ = function() {
var Channel = goog.global["MessageChannel"];
if (typeof Channel === "undefined" && typeof window !== "undefined" && window.postMessage && window.addEventListener && !goog.labs.userAgent.engine.isPresto()) {
Channel = function() {
var iframe = goog.dom.createElement(goog.dom.TagName.IFRAME);
iframe.style.display = "none";
document.documentElement.appendChild(iframe);
var win = iframe.contentWindow;
var doc = win.document;
doc.open();
doc.close();
var message = "callImmediate" + Math.random();
var origin = win.location.protocol == "file:" ? "*" : win.location.protocol + "//" + win.location.host;
var onmessage = goog.bind(function(e) {
if (origin != "*" && e.origin != origin || e.data != message) {
return;
}
this["port1"].onmessage();
}, this);
win.addEventListener("message", onmessage, false);
this["port1"] = {};
this["port2"] = {postMessage:function() {
win.postMessage(message, origin);
}};
};
}
if (typeof Channel !== "undefined" && !goog.labs.userAgent.browser.isIE()) {
var channel = new Channel();
var head = {};
var tail = head;
channel["port1"].onmessage = function() {
if (head.next !== undefined) {
head = head.next;
var cb = head.cb;
head.cb = null;
cb();
}
};
return function(cb) {
tail.next = {cb:cb};
tail = tail.next;
channel["port2"].postMessage(0);
};
}
return function(cb) {
goog.global.setTimeout(cb, 0);
};
};
goog.async.nextTick.wrapCallback_ = goog.functions.identity;
goog.debug.entryPointRegistry.register(function(transformer) {
goog.async.nextTick.wrapCallback_ = transformer;
});
//# sourceMappingURL=goog.async.nexttick.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,88 @@
goog.loadModule(function(exports) {
function getIterator(iterable) {
return iterable[goog.global.Symbol.iterator]();
}
function forEach(iterator, f) {
let result;
for (; !(result = iterator.next()).done;) {
f(result.value);
}
}
"use strict";
goog.module("goog.collections.iters");
goog.module.declareLegacyNamespace();
exports.getIterator = getIterator;
exports.forEach = forEach;
class MapIterator {
constructor(childIter, mapFn) {
this.childIterator_ = getIterator(childIter);
this.mapFn_ = mapFn;
}
[Symbol.iterator]() {
return this;
}
next() {
const childResult = this.childIterator_.next();
return {value:childResult.done ? undefined : this.mapFn_.call(undefined, childResult.value), done:childResult.done};
}
}
exports.map = function(iterable, f) {
return new MapIterator(iterable, f);
};
class FilterIterator {
constructor(childIter, filterFn) {
this.childIter_ = getIterator(childIter);
this.filterFn_ = filterFn;
}
[Symbol.iterator]() {
return this;
}
next() {
for (; true;) {
const childResult = this.childIter_.next();
if (childResult.done) {
return {done:true, value:undefined};
}
const passesFilter = this.filterFn_.call(undefined, childResult.value);
if (passesFilter) {
return childResult;
}
}
}
}
exports.filter = function(iterable, f) {
return new FilterIterator(iterable, f);
};
class ConcatIterator {
constructor(iterators) {
this.iterators_ = iterators;
this.iterIndex_ = 0;
}
[Symbol.iterator]() {
return this;
}
next() {
for (; this.iterIndex_ < this.iterators_.length;) {
const result = this.iterators_[this.iterIndex_].next();
if (!result.done) {
return result;
}
this.iterIndex_++;
}
return {done:true};
}
}
exports.concat = function(...iterables) {
return new ConcatIterator(iterables.map(getIterator));
};
exports.toArray = function(iterator) {
const arr = [];
forEach(iterator, e => {
return arr.push(e);
});
return arr;
};
return exports;
});
//# sourceMappingURL=goog.collections.iters.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,80 @@
goog.loadModule(function(exports) {
function setAll(map, entries) {
if (!entries) {
return;
}
for (const [k, v] of entries) {
map.set(k, v);
}
}
function hasValue(map, val, valueEqualityFn = defaultEqualityFn) {
for (const v of map.values()) {
if (valueEqualityFn(v, val)) {
return true;
}
}
return false;
}
function equals(map, otherMap, valueEqualityFn = defaultEqualityFn) {
if (map === otherMap) {
return true;
}
if (map.size !== otherMap.size) {
return false;
}
for (const key of map.keys()) {
if (!otherMap.has(key)) {
return false;
}
if (!valueEqualityFn(map.get(key), otherMap.get(key))) {
return false;
}
}
return true;
}
function transpose(map) {
const transposed = new Map();
for (const key of map.keys()) {
const val = map.get(key);
transposed.set(val, key);
}
return transposed;
}
function toObject(map) {
const obj = {};
for (const key of map.keys()) {
obj[key] = map.get(key);
}
return obj;
}
"use strict";
goog.module("goog.collections.maps");
goog.module.declareLegacyNamespace();
class MapLike {
constructor() {
this.size;
}
set(key, val) {
}
get(key) {
}
keys() {
}
values() {
}
has(key) {
}
}
exports.MapLike = MapLike;
exports.setAll = setAll;
exports.hasValue = hasValue;
const defaultEqualityFn = (a, b) => {
return a === b;
};
exports.equals = equals;
exports.transpose = transpose;
exports.toObject = toObject;
return exports;
});
//# sourceMappingURL=goog.collections.maps.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,367 @@
goog.provide("goog.debug");
goog.require("goog.array");
goog.require("goog.debug.errorcontext");
goog.debug.LOGGING_ENABLED = goog.define("goog.debug.LOGGING_ENABLED", goog.DEBUG);
goog.debug.FORCE_SLOPPY_STACKS = goog.define("goog.debug.FORCE_SLOPPY_STACKS", false);
goog.debug.CHECK_FOR_THROWN_EVENT = goog.define("goog.debug.CHECK_FOR_THROWN_EVENT", false);
goog.debug.catchErrors = function(logFunc, opt_cancel, opt_target) {
var target = opt_target || goog.global;
var oldErrorHandler = target.onerror;
var retVal = !!opt_cancel;
target.onerror = function(message, url, line, opt_col, opt_error) {
if (oldErrorHandler) {
oldErrorHandler(message, url, line, opt_col, opt_error);
}
logFunc({message:message, fileName:url, line:line, lineNumber:line, col:opt_col, error:opt_error});
return retVal;
};
};
goog.debug.expose = function(obj, opt_showFn) {
if (typeof obj == "undefined") {
return "undefined";
}
if (obj == null) {
return "NULL";
}
var str = [];
var x;
for (x in obj) {
if (!opt_showFn && typeof obj[x] === "function") {
continue;
}
var s = x + " \x3d ";
try {
s = s + obj[x];
} catch (e) {
s = s + ("*** " + e + " ***");
}
str.push(s);
}
return str.join("\n");
};
goog.debug.deepExpose = function(obj, opt_showFn) {
var str = [];
var uidsToCleanup = [];
var ancestorUids = {};
var helper = function(obj, space) {
var nestspace = space + " ";
var indentMultiline = function(str) {
return str.replace(/\n/g, "\n" + space);
};
try {
if (obj === undefined) {
str.push("undefined");
} else if (obj === null) {
str.push("NULL");
} else if (typeof obj === "string") {
str.push('"' + indentMultiline(obj) + '"');
} else if (typeof obj === "function") {
str.push(indentMultiline(String(obj)));
} else if (goog.isObject(obj)) {
if (!goog.hasUid(obj)) {
uidsToCleanup.push(obj);
}
var uid = goog.getUid(obj);
if (ancestorUids[uid]) {
str.push("*** reference loop detected (id\x3d" + uid + ") ***");
} else {
ancestorUids[uid] = true;
str.push("{");
var x;
for (x in obj) {
if (!opt_showFn && typeof obj[x] === "function") {
continue;
}
str.push("\n");
str.push(nestspace);
str.push(x + " \x3d ");
helper(obj[x], nestspace);
}
str.push("\n" + space + "}");
delete ancestorUids[uid];
}
} else {
str.push(obj);
}
} catch (e) {
str.push("*** " + e + " ***");
}
};
helper(obj, "");
var i = 0;
for (; i < uidsToCleanup.length; i++) {
goog.removeUid(uidsToCleanup[i]);
}
return str.join("");
};
goog.debug.exposeArray = function(arr) {
var str = [];
var i = 0;
for (; i < arr.length; i++) {
if (Array.isArray(arr[i])) {
str.push(goog.debug.exposeArray(arr[i]));
} else {
str.push(arr[i]);
}
}
return "[ " + str.join(", ") + " ]";
};
goog.debug.normalizeErrorObject = function(err) {
var href = goog.getObjectByName("window.location.href");
if (err == null) {
err = 'Unknown Error of type "null/undefined"';
}
if (typeof err === "string") {
return {"message":err, "name":"Unknown error", "lineNumber":"Not available", "fileName":href, "stack":"Not available"};
}
var lineNumber;
var fileName;
var threwError = false;
try {
lineNumber = err.lineNumber || err.line || "Not available";
} catch (e) {
lineNumber = "Not available";
threwError = true;
}
try {
fileName = err.fileName || err.filename || err.sourceURL || goog.global["$googDebugFname"] || href;
} catch (e) {
fileName = "Not available";
threwError = true;
}
var stack = goog.debug.serializeErrorStack_(err);
if (threwError || !err.lineNumber || !err.fileName || !err.stack || !err.message || !err.name) {
var message = err.message;
if (message == null) {
if (err.constructor && err.constructor instanceof Function) {
var ctorName = err.constructor.name ? err.constructor.name : goog.debug.getFunctionName(err.constructor);
message = 'Unknown Error of type "' + ctorName + '"';
if (goog.debug.CHECK_FOR_THROWN_EVENT && ctorName == "Event") {
try {
message = message + ' with Event.type "' + (err.type || "") + '"';
} catch (e) {
}
}
} else {
message = "Unknown Error of unknown type";
}
if (typeof err.toString === "function" && Object.prototype.toString !== err.toString) {
message = message + (": " + err.toString());
}
}
return {"message":message, "name":err.name || "UnknownError", "lineNumber":lineNumber, "fileName":fileName, "stack":stack || "Not available"};
}
err.stack = stack;
return {"message":err.message, "name":err.name, "lineNumber":err.lineNumber, "fileName":err.fileName, "stack":err.stack};
};
goog.debug.serializeErrorStack_ = function(e, seen) {
if (!seen) {
seen = {};
}
seen[goog.debug.serializeErrorAsKey_(e)] = true;
var stack = e["stack"] || "";
var cause = e.cause;
if (cause && !seen[goog.debug.serializeErrorAsKey_(cause)]) {
stack = stack + "\nCaused by: ";
if (!cause.stack || cause.stack.indexOf(cause.toString()) != 0) {
stack = stack + (typeof cause === "string" ? cause : cause.message + "\n");
}
stack = stack + goog.debug.serializeErrorStack_(cause, seen);
}
return stack;
};
goog.debug.serializeErrorAsKey_ = function(e) {
var keyPrefix = "";
if (typeof e.toString === "function") {
keyPrefix = "" + e;
}
return keyPrefix + e["stack"];
};
goog.debug.enhanceError = function(err, opt_message) {
var error;
if (!(err instanceof Error)) {
error = Error(err);
if (Error.captureStackTrace) {
Error.captureStackTrace(error, goog.debug.enhanceError);
}
} else {
error = err;
}
if (!error.stack) {
error.stack = goog.debug.getStacktrace(goog.debug.enhanceError);
}
if (opt_message) {
var x = 0;
for (; error["message" + x];) {
++x;
}
error["message" + x] = String(opt_message);
}
return error;
};
goog.debug.enhanceErrorWithContext = function(err, opt_context) {
var error = goog.debug.enhanceError(err);
if (opt_context) {
var key;
for (key in opt_context) {
goog.debug.errorcontext.addErrorContext(error, key, opt_context[key]);
}
}
return error;
};
goog.debug.getStacktraceSimple = function(opt_depth) {
if (!goog.debug.FORCE_SLOPPY_STACKS) {
var stack = goog.debug.getNativeStackTrace_(goog.debug.getStacktraceSimple);
if (stack) {
return stack;
}
}
var sb = [];
var fn = arguments.callee.caller;
var depth = 0;
for (; fn && (!opt_depth || depth < opt_depth);) {
sb.push(goog.debug.getFunctionName(fn));
sb.push("()\n");
try {
fn = fn.caller;
} catch (e) {
sb.push("[exception trying to get caller]\n");
break;
}
depth++;
if (depth >= goog.debug.MAX_STACK_DEPTH) {
sb.push("[...long stack...]");
break;
}
}
if (opt_depth && depth >= opt_depth) {
sb.push("[...reached max depth limit...]");
} else {
sb.push("[end]");
}
return sb.join("");
};
goog.debug.MAX_STACK_DEPTH = 50;
goog.debug.getNativeStackTrace_ = function(fn) {
var tempErr = new Error();
if (Error.captureStackTrace) {
Error.captureStackTrace(tempErr, fn);
return String(tempErr.stack);
} else {
try {
throw tempErr;
} catch (e) {
tempErr = e;
}
var stack = tempErr.stack;
if (stack) {
return String(stack);
}
}
return null;
};
goog.debug.getStacktrace = function(fn) {
var stack;
if (!goog.debug.FORCE_SLOPPY_STACKS) {
var contextFn = fn || goog.debug.getStacktrace;
stack = goog.debug.getNativeStackTrace_(contextFn);
}
if (!stack) {
stack = goog.debug.getStacktraceHelper_(fn || arguments.callee.caller, []);
}
return stack;
};
goog.debug.getStacktraceHelper_ = function(fn, visited) {
var sb = [];
if (goog.array.contains(visited, fn)) {
sb.push("[...circular reference...]");
} else if (fn && visited.length < goog.debug.MAX_STACK_DEPTH) {
sb.push(goog.debug.getFunctionName(fn) + "(");
var args = fn.arguments;
var i = 0;
for (; args && i < args.length; i++) {
if (i > 0) {
sb.push(", ");
}
var argDesc;
var arg = args[i];
switch(typeof arg) {
case "object":
argDesc = arg ? "object" : "null";
break;
case "string":
argDesc = arg;
break;
case "number":
argDesc = String(arg);
break;
case "boolean":
argDesc = arg ? "true" : "false";
break;
case "function":
argDesc = goog.debug.getFunctionName(arg);
argDesc = argDesc ? argDesc : "[fn]";
break;
case "undefined":
default:
argDesc = typeof arg;
break;
}
if (argDesc.length > 40) {
argDesc = argDesc.slice(0, 40) + "...";
}
sb.push(argDesc);
}
visited.push(fn);
sb.push(")\n");
try {
sb.push(goog.debug.getStacktraceHelper_(fn.caller, visited));
} catch (e) {
sb.push("[exception trying to get caller]\n");
}
} else if (fn) {
sb.push("[...long stack...]");
} else {
sb.push("[end]");
}
return sb.join("");
};
goog.debug.getFunctionName = function(fn) {
if (goog.debug.fnNameCache_[fn]) {
return goog.debug.fnNameCache_[fn];
}
var functionSource = String(fn);
if (!goog.debug.fnNameCache_[functionSource]) {
var matches = /function\s+([^\(]+)/m.exec(functionSource);
if (matches) {
var method = matches[1];
goog.debug.fnNameCache_[functionSource] = method;
} else {
goog.debug.fnNameCache_[functionSource] = "[Anonymous]";
}
}
return goog.debug.fnNameCache_[functionSource];
};
goog.debug.makeWhitespaceVisible = function(string) {
return string.replace(/ /g, "[_]").replace(/\f/g, "[f]").replace(/\n/g, "[n]\n").replace(/\r/g, "[r]").replace(/\t/g, "[t]");
};
goog.debug.runtimeType = function(value) {
if (value instanceof Function) {
return value.displayName || value.name || "unknown type name";
} else if (value instanceof Object) {
return value.constructor.displayName || value.constructor.name || Object.prototype.toString.call(value);
} else {
return value === null ? "null" : typeof value;
}
};
goog.debug.fnNameCache_ = {};
goog.debug.freezeInternal_ = goog.DEBUG && Object.freeze || function(arg) {
return arg;
};
goog.debug.freeze = function(arg) {
return {valueOf:function() {
return goog.debug.freezeInternal_(arg);
}}.valueOf();
};
//# sourceMappingURL=goog.debug.debug.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,42 @@
goog.provide("goog.debug.EntryPointMonitor");
goog.provide("goog.debug.entryPointRegistry");
goog.require("goog.asserts");
goog.debug.entryPointRegistry.EntryPointMonitor = function() {
};
goog.debug.entryPointRegistry.EntryPointMonitor.prototype.wrap;
goog.debug.entryPointRegistry.EntryPointMonitor.prototype.unwrap;
goog.debug.EntryPointMonitor = goog.debug.entryPointRegistry.EntryPointMonitor;
goog.debug.entryPointRegistry.refList_ = [];
goog.debug.entryPointRegistry.monitors_ = [];
goog.debug.entryPointRegistry.monitorsMayExist_ = false;
goog.debug.entryPointRegistry.register = function(callback) {
goog.debug.entryPointRegistry.refList_[goog.debug.entryPointRegistry.refList_.length] = callback;
if (goog.debug.entryPointRegistry.monitorsMayExist_) {
var monitors = goog.debug.entryPointRegistry.monitors_;
var i = 0;
for (; i < monitors.length; i++) {
callback(goog.bind(monitors[i].wrap, monitors[i]));
}
}
};
goog.debug.entryPointRegistry.monitorAll = function(monitor) {
goog.debug.entryPointRegistry.monitorsMayExist_ = true;
var transformer = goog.bind(monitor.wrap, monitor);
var i = 0;
for (; i < goog.debug.entryPointRegistry.refList_.length; i++) {
goog.debug.entryPointRegistry.refList_[i](transformer);
}
goog.debug.entryPointRegistry.monitors_.push(monitor);
};
goog.debug.entryPointRegistry.unmonitorAllIfPossible = function(monitor) {
var monitors = goog.debug.entryPointRegistry.monitors_;
goog.asserts.assert(monitor == monitors[monitors.length - 1], "Only the most recent monitor can be unwrapped.");
var transformer = goog.bind(monitor.unwrap, monitor);
var i = 0;
for (; i < goog.debug.entryPointRegistry.refList_.length; i++) {
goog.debug.entryPointRegistry.refList_[i](transformer);
}
monitors.length--;
};
//# sourceMappingURL=goog.debug.entrypointregistry.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,28 @@
goog.loadModule(function(exports) {
function DebugError(msg = undefined, cause = undefined) {
if (Error.captureStackTrace) {
Error.captureStackTrace(this, DebugError);
} else {
const stack = (new Error()).stack;
if (stack) {
this.stack = stack;
}
}
if (msg) {
this.message = String(msg);
}
if (cause !== undefined) {
this.cause = cause;
}
this.reportErrorToServer = true;
}
"use strict";
goog.module("goog.debug.Error");
goog.module.declareLegacyNamespace();
goog.inherits(DebugError, Error);
DebugError.prototype.name = "CustomError";
exports = DebugError;
return exports;
});
//# sourceMappingURL=goog.debug.error.js.map

View File

@@ -0,0 +1,9 @@
{
"version":3,
"file":"goog.debug.error.js",
"lineCount":27,
"mappings":"AAAA,IAAA,CAAA,UAAA,CAAA,QAAA,CAAA,OAAA,CAAA;AAiCAA,UAASA,WAAU,CAACC,GAAA,GAAMC,SAAP,EAAkBC,KAAA,GAAQD,SAA1B,CAAqC;AAEtD,QAAIE,KAAMC,CAAAA,iBAAV;AACED,WAAMC,CAAAA,iBAAN,CAAwB,IAAxB,EAA8BL,UAA9B,CAAA;AADF,UAEO;AACL,YAAMM,QAAoBA,CAAZ,IAAIF,KAAJ,EAAYE,EAAAA,KAA1B;AACA,UAAIA,KAAJ;AAEE,YAAKA,CAAAA,KAAL,GAAaA,KAAb;AAFF;AAFK;AAQP,QAAIL,GAAJ;AAEE,UAAKM,CAAAA,OAAL,GAAeC,MAAA,CAAOP,GAAP,CAAf;AAFF;AAKA,QAAIE,KAAJ,KAAcD,SAAd;AAEE,UAAKC,CAAAA,KAAL,GAAaA,KAAb;AAFF;AAYA,QAAKM,CAAAA,mBAAL,GAA2B,IAA3B;AA7BsD;AAjCxD,cAAA;AAcAC,MAAKC,CAAAA,MAAL,CAAY,kBAAZ,CAAA;AACAD,MAAKC,CAAAA,MAAOC,CAAAA,sBAAZ,EAAA;AAiDAF,MAAKG,CAAAA,QAAL,CAAcb,UAAd,EAA0BI,KAA1B,CAAA;AAIAJ,YAAWc,CAAAA,SAAUC,CAAAA,IAArB,GAA4B,aAA5B;AAGAC,SAAA,GAAUhB,UAAV;AAvEA,SAAA,OAAA;AAAA,CAAA,CAAA;;",
"sources":["goog/debug/error.js"],
"sourcesContent":["/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Provides a base class for custom Error objects such that the\n * stack is correctly maintained.\n *\n * You should never need to throw DebugError(msg) directly, Error(msg) is\n * sufficient.\n */\n\ngoog.module('goog.debug.Error');\ngoog.module.declareLegacyNamespace();\n\n\n\n/**\n * Base class for custom error objects.\n * @param {*=} msg The message associated with the error.\n * @param {{\n * message: (?|undefined),\n * name: (?|undefined),\n * lineNumber: (?|undefined),\n * fileName: (?|undefined),\n * stack: (?|undefined),\n * cause: (?|undefined),\n * }=} cause The original error object to chain with.\n * @constructor\n * @extends {Error}\n */\nfunction DebugError(msg = undefined, cause = undefined) {\n // Attempt to ensure there is a stack trace.\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, DebugError);\n } else {\n const stack = new Error().stack;\n if (stack) {\n /** @override @type {string} */\n this.stack = stack;\n }\n }\n\n if (msg) {\n /** @override @type {string} */\n this.message = String(msg);\n }\n\n if (cause !== undefined) {\n /** @type {?} */\n this.cause = cause;\n }\n\n /**\n * Whether to report this error to the server. Setting this to false will\n * cause the error reporter to not report the error back to the server,\n * which can be useful if the client knows that the error has already been\n * logged on the server.\n * @type {boolean}\n */\n this.reportErrorToServer = true;\n}\ngoog.inherits(DebugError, Error);\n\n\n/** @override @type {string} */\nDebugError.prototype.name = 'CustomError';\n\n\nexports = DebugError;\n"],
"names":["DebugError","msg","undefined","cause","Error","captureStackTrace","stack","message","String","reportErrorToServer","goog","module","declareLegacyNamespace","inherits","prototype","name","exports"]
}

View File

@@ -0,0 +1,13 @@
goog.provide("goog.debug.errorcontext");
goog.debug.errorcontext.addErrorContext = function(err, contextKey, contextValue) {
if (!err[goog.debug.errorcontext.CONTEXT_KEY_]) {
err[goog.debug.errorcontext.CONTEXT_KEY_] = {};
}
err[goog.debug.errorcontext.CONTEXT_KEY_][contextKey] = contextValue;
};
goog.debug.errorcontext.getErrorContext = function(err) {
return err[goog.debug.errorcontext.CONTEXT_KEY_] || {};
};
goog.debug.errorcontext.CONTEXT_KEY_ = "__closure__error__context__984382";
//# sourceMappingURL=goog.debug.errorcontext.js.map

View File

@@ -0,0 +1,9 @@
{
"version":3,
"file":"goog.debug.errorcontext.js",
"lineCount":12,
"mappings":"AAUAA,IAAKC,CAAAA,OAAL,CAAa,yBAAb,CAAA;AASAD,IAAKE,CAAAA,KAAMC,CAAAA,YAAaC,CAAAA,eAAxB,GAA0CC,QAAQ,CAC9CC,GAD8C,EACzCC,UADyC,EAC7BC,YAD6B,CACf;AAEjC,MAAI,CAACF,GAAA,CAAIN,IAAKE,CAAAA,KAAMC,CAAAA,YAAaM,CAAAA,YAA5B,CAAL;AACEH,OAAA,CAAIN,IAAKE,CAAAA,KAAMC,CAAAA,YAAaM,CAAAA,YAA5B,CAAA,GAA4C,EAA5C;AADF;AAGAH,KAAA,CAAIN,IAAKE,CAAAA,KAAMC,CAAAA,YAAaM,CAAAA,YAA5B,CAAA,CAA0CF,UAA1C,CAAA,GAAwDC,YAAxD;AALiC,CADnC;AAcAR,IAAKE,CAAAA,KAAMC,CAAAA,YAAaO,CAAAA,eAAxB,GAA0CC,QAAQ,CAACL,GAAD,CAAM;AAEtD,SAAOA,GAAA,CAAIN,IAAKE,CAAAA,KAAMC,CAAAA,YAAaM,CAAAA,YAA5B,CAAP,IAAoD,EAApD;AAFsD,CAAxD;AASAT,IAAKE,CAAAA,KAAMC,CAAAA,YAAaM,CAAAA,YAAxB,GAAuC,mCAAvC;;",
"sources":["goog/debug/errorcontext.js"],
"sourcesContent":["/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Provides methods dealing with context on error objects.\n */\n\ngoog.provide('goog.debug.errorcontext');\n\n\n/**\n * Adds key-value context to the error.\n * @param {!Error} err The error to add context to.\n * @param {string} contextKey Key for the context to be added.\n * @param {string} contextValue Value for the context to be added.\n */\ngoog.debug.errorcontext.addErrorContext = function(\n err, contextKey, contextValue) {\n 'use strict';\n if (!err[goog.debug.errorcontext.CONTEXT_KEY_]) {\n err[goog.debug.errorcontext.CONTEXT_KEY_] = {};\n }\n err[goog.debug.errorcontext.CONTEXT_KEY_][contextKey] = contextValue;\n};\n\n\n/**\n * @param {!Error} err The error to get context from.\n * @return {!Object<string, string>} The context of the provided error.\n */\ngoog.debug.errorcontext.getErrorContext = function(err) {\n 'use strict';\n return err[goog.debug.errorcontext.CONTEXT_KEY_] || {};\n};\n\n\n// TODO(user): convert this to a Symbol once goog.debug.ErrorReporter is\n// able to use ES6.\n/** @private @const {string} */\ngoog.debug.errorcontext.CONTEXT_KEY_ = '__closure__error__context__984382';\n"],
"names":["goog","provide","debug","errorcontext","addErrorContext","goog.debug.errorcontext.addErrorContext","err","contextKey","contextValue","CONTEXT_KEY_","getErrorContext","goog.debug.errorcontext.getErrorContext"]
}

View File

@@ -0,0 +1,38 @@
goog.provide("goog.dom.asserts");
goog.require("goog.asserts");
goog.dom.asserts.assertIsLocation = function(o) {
if (goog.asserts.ENABLE_ASSERTS) {
var win = goog.dom.asserts.getWindow_(o);
if (win) {
if (!o || !(o instanceof win.Location) && o instanceof win.Element) {
goog.asserts.fail("Argument is not a Location (or a non-Element mock); got: %s", goog.dom.asserts.debugStringForType_(o));
}
}
}
return o;
};
goog.dom.asserts.debugStringForType_ = function(value) {
if (goog.isObject(value)) {
try {
return value.constructor.displayName || value.constructor.name || Object.prototype.toString.call(value);
} catch (e) {
return "\x3cobject could not be stringified\x3e";
}
} else {
return value === undefined ? "undefined" : value === null ? "null" : typeof value;
}
};
goog.dom.asserts.getWindow_ = function(o) {
try {
var doc = o && o.ownerDocument;
var win = doc && (doc.defaultView || doc.parentWindow);
win = win || goog.global;
if (win.Element && win.Location) {
return win;
}
} catch (ex) {
}
return null;
};
//# sourceMappingURL=goog.dom.asserts.js.map

View File

@@ -0,0 +1,9 @@
{
"version":3,
"file":"goog.dom.asserts.js",
"lineCount":37,
"mappings":"AAMAA,IAAKC,CAAAA,OAAL,CAAa,kBAAb,CAAA;AAEAD,IAAKE,CAAAA,OAAL,CAAa,cAAb,CAAA;AA8CAF,IAAKG,CAAAA,GAAIC,CAAAA,OAAQC,CAAAA,gBAAjB,GAAoCC,QAAQ,CAACC,CAAD,CAAI;AAE9C,MAAIP,IAAKI,CAAAA,OAAQI,CAAAA,cAAjB,CAAiC;AAC/B,QAAIC,MAAMT,IAAKG,CAAAA,GAAIC,CAAAA,OAAQM,CAAAA,UAAjB,CAA4BH,CAA5B,CAAV;AACA,QAAIE,GAAJ;AACE,UAAI,CAACF,CAAL,IAAW,EAAEA,CAAF,YAAeE,GAAIE,CAAAA,QAAnB,CAAX,IAA2CJ,CAA3C,YAAwDE,GAAIG,CAAAA,OAA5D;AACEZ,YAAKI,CAAAA,OAAQS,CAAAA,IAAb,CACI,6DADJ,EAEIb,IAAKG,CAAAA,GAAIC,CAAAA,OAAQU,CAAAA,mBAAjB,CAAqCP,CAArC,CAFJ,CAAA;AADF;AADF;AAF+B;AAUjC,SAAiCA,CAAjC;AAZ8C,CAAhD;AAuBAP,IAAKG,CAAAA,GAAIC,CAAAA,OAAQU,CAAAA,mBAAjB,GAAuCC,QAAQ,CAACC,KAAD,CAAQ;AAErD,MAAIhB,IAAKiB,CAAAA,QAAL,CAAcD,KAAd,CAAJ;AACE,OAAI;AACF,aAAwCA,KAAME,CAAAA,WAAYC,CAAAA,WAA1D,IACIH,KAAME,CAAAA,WAAYE,CAAAA,IADtB,IAC8BC,MAAOC,CAAAA,SAAUC,CAAAA,QAASC,CAAAA,IAA1B,CAA+BR,KAA/B,CAD9B;AADE,KAGF,QAAOS,CAAP,CAAU;AACV,aAAO,yCAAP;AADU;AAJd;AAQE,WAAOT,KAAA,KAAUU,SAAV,GAAsB,WAAtB,GACsBV,KAAA,KAAU,IAAV,GAAiB,MAAjB,GAA0B,MAAOA,MAD9D;AARF;AAFqD,CAAvD;AAsBAhB,IAAKG,CAAAA,GAAIC,CAAAA,OAAQM,CAAAA,UAAjB,GAA8BiB,QAAQ,CAACpB,CAAD,CAAI;AAExC,KAAI;AACF,QAAIqB,MAAMrB,CAANqB,IAAWrB,CAAEsB,CAAAA,aAAjB;AAGA,QAAIpB,MACAmB,GADAnB,KAC+BmB,GAAIE,CAAAA,WAAL,IAAoBF,GAAIG,CAAAA,YADtDtB,CAAJ;AAEAA,OAAA,GAAMA,GAAN,IAAqCT,IAAKgC,CAAAA,MAA1C;AAGA,QAAIvB,GAAIG,CAAAA,OAAR,IAAmBH,GAAIE,CAAAA,QAAvB;AACE,aAAOF,GAAP;AADF;AATE,GAYF,QAAOwB,EAAP,CAAW;;AAEb,SAAO,IAAP;AAhBwC,CAA1C;;",
"sources":["goog/dom/asserts.js"],
"sourcesContent":["/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\ngoog.provide('goog.dom.asserts');\n\ngoog.require('goog.asserts');\n\n/**\n * @fileoverview Custom assertions to ensure that an element has the appropriate\n * type.\n *\n * Using a goog.dom.safe wrapper on an object on the incorrect type (via an\n * incorrect static type cast) can result in security bugs: For instance,\n * g.d.s.setAnchorHref ensures that the URL assigned to the .href attribute\n * satisfies the SafeUrl contract, i.e., is safe to dereference as a hyperlink.\n * However, the value assigned to a HTMLLinkElement's .href property requires\n * the stronger TrustedResourceUrl contract, since it can refer to a stylesheet.\n * Thus, using g.d.s.setAnchorHref on an (incorrectly statically typed) object\n * of type HTMLLinkElement can result in a security vulnerability.\n * Assertions of the correct run-time type help prevent such incorrect use.\n *\n * In some cases, code using the DOM API is tested using mock objects (e.g., a\n * plain object such as {'href': url} instead of an actual Location object).\n * To allow such mocking, the assertions permit objects of types that are not\n * relevant DOM API objects at all (for instance, not Element or Location).\n *\n * Note that instanceof checks don't work straightforwardly in older versions of\n * IE, or across frames (see,\n * http://stackoverflow.com/questions/384286/javascript-isdom-how-do-you-check-if-a-javascript-object-is-a-dom-object,\n * http://stackoverflow.com/questions/26248599/instanceof-htmlelement-in-iframe-is-not-element-or-object).\n *\n * Hence, these assertions may pass vacuously in such scenarios. The resulting\n * risk of security bugs is limited by the following factors:\n * - A bug can only arise in scenarios involving incorrect static typing (the\n * wrapper methods are statically typed to demand objects of the appropriate,\n * precise type).\n * - Typically, code is tested and exercised in multiple browsers.\n */\n\n/**\n * Asserts that a given object is a Location.\n *\n * To permit this assertion to pass in the context of tests where DOM APIs might\n * be mocked, also accepts any other type except for subtypes of {!Element}.\n * This is to ensure that, for instance, HTMLLinkElement is not being used in\n * place of a Location, since this could result in security bugs due to stronger\n * contracts required for assignments to the href property of the latter.\n *\n * @param {?Object} o The object whose type to assert.\n * @return {!Location}\n */\ngoog.dom.asserts.assertIsLocation = function(o) {\n 'use strict';\n if (goog.asserts.ENABLE_ASSERTS) {\n var win = goog.dom.asserts.getWindow_(o);\n if (win) {\n if (!o || (!(o instanceof win.Location) && o instanceof win.Element)) {\n goog.asserts.fail(\n 'Argument is not a Location (or a non-Element mock); got: %s',\n goog.dom.asserts.debugStringForType_(o));\n }\n }\n }\n return /** @type {!Location} */ (o);\n};\n\n\n/**\n * Returns a string representation of a value's type.\n *\n * @param {*} value An object, or primitive.\n * @return {string} The best display name for the value.\n * @private\n */\ngoog.dom.asserts.debugStringForType_ = function(value) {\n 'use strict';\n if (goog.isObject(value)) {\n try {\n return /** @type {string|undefined} */ (value.constructor.displayName) ||\n value.constructor.name || Object.prototype.toString.call(value);\n } catch (e) {\n return '<object could not be stringified>';\n }\n } else {\n return value === undefined ? 'undefined' :\n value === null ? 'null' : typeof value;\n }\n};\n\n/**\n * Gets window of element.\n * @param {?Object} o\n * @return {?Window}\n * @private\n * @suppress {strictMissingProperties} ownerDocument not defined on Object\n */\ngoog.dom.asserts.getWindow_ = function(o) {\n 'use strict';\n try {\n var doc = o && o.ownerDocument;\n // This can throw \u201cBlocked a frame with origin \"chrome-extension://...\" from\n // accessing a cross-origin frame\u201d in Chrome extension.\n var win =\n doc && /** @type {?Window} */ (doc.defaultView || doc.parentWindow);\n win = win || /** @type {!Window} */ (goog.global);\n // This can throw \u201cPermission denied to access property \"Element\" on\n // cross-origin object\u201d.\n if (win.Element && win.Location) {\n return win;\n }\n } catch (ex) {\n }\n return null;\n};\n"],
"names":["goog","provide","require","dom","asserts","assertIsLocation","goog.dom.asserts.assertIsLocation","o","ENABLE_ASSERTS","win","getWindow_","Location","Element","fail","debugStringForType_","goog.dom.asserts.debugStringForType_","value","isObject","constructor","displayName","name","Object","prototype","toString","call","e","undefined","goog.dom.asserts.getWindow_","doc","ownerDocument","defaultView","parentWindow","global","ex"]
}

View File

@@ -0,0 +1,19 @@
goog.provide("goog.dom.BrowserFeature");
goog.require("goog.userAgent");
goog.dom.BrowserFeature.ASSUME_NO_OFFSCREEN_CANVAS = goog.define("goog.dom.ASSUME_NO_OFFSCREEN_CANVAS", false);
goog.dom.BrowserFeature.ASSUME_OFFSCREEN_CANVAS = goog.define("goog.dom.ASSUME_OFFSCREEN_CANVAS", false);
goog.dom.BrowserFeature.detectOffscreenCanvas_ = function(contextName) {
try {
return Boolean((new self.OffscreenCanvas(0, 0)).getContext(contextName));
} catch (ex) {
}
return false;
};
goog.dom.BrowserFeature.OFFSCREEN_CANVAS_2D = !goog.dom.BrowserFeature.ASSUME_NO_OFFSCREEN_CANVAS && (goog.dom.BrowserFeature.ASSUME_OFFSCREEN_CANVAS || goog.dom.BrowserFeature.detectOffscreenCanvas_("2d"));
goog.dom.BrowserFeature.CAN_ADD_NAME_OR_TYPE_ATTRIBUTES = true;
goog.dom.BrowserFeature.CAN_USE_CHILDREN_ATTRIBUTE = true;
goog.dom.BrowserFeature.CAN_USE_INNER_TEXT = false;
goog.dom.BrowserFeature.CAN_USE_PARENT_ELEMENT_PROPERTY = goog.userAgent.IE || goog.userAgent.WEBKIT;
goog.dom.BrowserFeature.INNER_HTML_NEEDS_SCOPED_ELEMENT = goog.userAgent.IE;
//# sourceMappingURL=goog.dom.browserfeature.js.map

View File

@@ -0,0 +1,9 @@
{
"version":3,
"file":"goog.dom.browserfeature.js",
"lineCount":18,
"mappings":"AAWAA,IAAKC,CAAAA,OAAL,CAAa,yBAAb,CAAA;AAEAD,IAAKE,CAAAA,OAAL,CAAa,gBAAb,CAAA;AAOAF,IAAKG,CAAAA,GAAIC,CAAAA,cAAeC,CAAAA,0BAAxB,GACIL,IAAKM,CAAAA,MAAL,CAAY,qCAAZ,EAAmD,KAAnD,CADJ;AAQAN,IAAKG,CAAAA,GAAIC,CAAAA,cAAeG,CAAAA,uBAAxB,GACIP,IAAKM,CAAAA,MAAL,CAAY,kCAAZ,EAAgD,KAAhD,CADJ;AASAN,IAAKG,CAAAA,GAAIC,CAAAA,cAAeI,CAAAA,sBAAxB,GAAiDC,QAAQ,CAACC,WAAD,CAAc;AAIrE,KAAI;AACF,WAAOC,OAAA,CAAuCC,CAA/B,IAAIC,IAAKC,CAAAA,eAAT,CAAyB,CAAzB,EAA4B,CAA5B,CAA+BF,EAAAA,UAA/B,CAA0CF,WAA1C,CAAR,CAAP;AADE,GAEF,QAAOK,EAAP,CAAW;;AAEb,SAAO,KAAP;AARqE,CAAvE;AAeAf,IAAKG,CAAAA,GAAIC,CAAAA,cAAeY,CAAAA,mBAAxB,GACI,CAAChB,IAAKG,CAAAA,GAAIC,CAAAA,cAAeC,CAAAA,0BAD7B,KAEKL,IAAKG,CAAAA,GAAIC,CAAAA,cAAeG,CAAAA,uBAF7B,IAGKP,IAAKG,CAAAA,GAAIC,CAAAA,cAAeI,CAAAA,sBAAxB,CAA+C,IAA/C,CAHL;AAUAR,IAAKG,CAAAA,GAAIC,CAAAA,cAAea,CAAAA,+BAAxB,GAA0D,IAA1D;AAQAjB,IAAKG,CAAAA,GAAIC,CAAAA,cAAec,CAAAA,0BAAxB,GAAqD,IAArD;AAOAlB,IAAKG,CAAAA,GAAIC,CAAAA,cAAee,CAAAA,kBAAxB,GAA6C,KAA7C;AAOAnB,IAAKG,CAAAA,GAAIC,CAAAA,cAAegB,CAAAA,+BAAxB,GACIpB,IAAKqB,CAAAA,SAAUC,CAAAA,EADnB,IACyBtB,IAAKqB,CAAAA,SAAUE,CAAAA,MADxC;AASAvB,IAAKG,CAAAA,GAAIC,CAAAA,cAAeoB,CAAAA,+BAAxB,GAA0DxB,IAAKqB,CAAAA,SAAUC,CAAAA,EAAzE;;",
"sources":["goog/dom/browserfeature.js"],
"sourcesContent":["/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Browser capability checks for the dom package.\n */\n\n\ngoog.provide('goog.dom.BrowserFeature');\n\ngoog.require('goog.userAgent');\n\n\n/**\n * @define {boolean} Whether we know at compile time that the browser doesn't\n * support OffscreenCanvas.\n */\ngoog.dom.BrowserFeature.ASSUME_NO_OFFSCREEN_CANVAS =\n goog.define('goog.dom.ASSUME_NO_OFFSCREEN_CANVAS', false);\n\n/**\n * @define {boolean} Whether we know at compile time that the browser supports\n * all OffscreenCanvas contexts.\n */\n// TODO(user): Eventually this should default to \"FEATURESET_YEAR >= 202X\".\ngoog.dom.BrowserFeature.ASSUME_OFFSCREEN_CANVAS =\n goog.define('goog.dom.ASSUME_OFFSCREEN_CANVAS', false);\n\n/**\n * Detects if a particular OffscreenCanvas context is supported.\n * @param {string} contextName name of the context to test.\n * @return {boolean} Whether the browser supports this OffscreenCanvas context.\n * @private\n */\ngoog.dom.BrowserFeature.detectOffscreenCanvas_ = function(contextName) {\n 'use strict';\n // This code only gets removed because we forced @nosideeffects on\n // the functions. See: b/138802376\n try {\n return Boolean(new self.OffscreenCanvas(0, 0).getContext(contextName));\n } catch (ex) {\n }\n return false;\n};\n\n/**\n * Whether the browser supports OffscreenCanvas 2D context.\n * @const {boolean}\n */\ngoog.dom.BrowserFeature.OFFSCREEN_CANVAS_2D =\n !goog.dom.BrowserFeature.ASSUME_NO_OFFSCREEN_CANVAS &&\n (goog.dom.BrowserFeature.ASSUME_OFFSCREEN_CANVAS ||\n goog.dom.BrowserFeature.detectOffscreenCanvas_('2d'));\n\n/**\n * Whether attributes 'name' and 'type' can be added to an element after it's\n * created. False in Internet Explorer prior to version 9.\n * @const {boolean}\n */\ngoog.dom.BrowserFeature.CAN_ADD_NAME_OR_TYPE_ATTRIBUTES = true;\n\n/**\n * Whether we can use element.children to access an element's Element\n * children. Available since Gecko 1.9.1, IE 9. (IE<9 also includes comment\n * nodes in the collection.)\n * @const {boolean}\n */\ngoog.dom.BrowserFeature.CAN_USE_CHILDREN_ATTRIBUTE = true;\n\n/**\n * Opera, Safari 3, and Internet Explorer 9 all support innerText but they\n * include text nodes in script and style tags. Not document-mode-dependent.\n * @const {boolean}\n */\ngoog.dom.BrowserFeature.CAN_USE_INNER_TEXT = false;\n\n/**\n * MSIE, Opera, and Safari>=4 support element.parentElement to access an\n * element's parent if it is an Element.\n * @const {boolean}\n */\ngoog.dom.BrowserFeature.CAN_USE_PARENT_ELEMENT_PROPERTY =\n goog.userAgent.IE || goog.userAgent.WEBKIT;\n\n/**\n * Whether NoScope elements need a scoped element written before them in\n * innerHTML.\n * MSDN: http://msdn.microsoft.com/en-us/library/ms533897(VS.85).aspx#1\n * @const {boolean}\n */\ngoog.dom.BrowserFeature.INNER_HTML_NEEDS_SCOPED_ELEMENT = goog.userAgent.IE;\n"],
"names":["goog","provide","require","dom","BrowserFeature","ASSUME_NO_OFFSCREEN_CANVAS","define","ASSUME_OFFSCREEN_CANVAS","detectOffscreenCanvas_","goog.dom.BrowserFeature.detectOffscreenCanvas_","contextName","Boolean","getContext","self","OffscreenCanvas","ex","OFFSCREEN_CANVAS_2D","CAN_ADD_NAME_OR_TYPE_ATTRIBUTES","CAN_USE_CHILDREN_ATTRIBUTE","CAN_USE_INNER_TEXT","CAN_USE_PARENT_ELEMENT_PROPERTY","userAgent","IE","WEBKIT","INNER_HTML_NEEDS_SCOPED_ELEMENT"]
}

Some files were not shown because too many files have changed in this diff Show More