goog.provide('shadow.dom');
shadow.dom.transition_supported_QMARK_ = true;

/**
 * @interface
 */
shadow.dom.IElement = function(){};

var shadow$dom$IElement$_to_dom$dyn_23464 = (function (this$){
var x__5350__auto__ = (((this$ == null))?null:this$);
var m__5351__auto__ = (shadow.dom._to_dom[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__ = (shadow.dom._to_dom["_"]);
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("IElement.-to-dom",this$);
}
}
});
shadow.dom._to_dom = (function shadow$dom$_to_dom(this$){
if((((!((this$ == null)))) && ((!((this$.shadow$dom$IElement$_to_dom$arity$1 == null)))))){
return this$.shadow$dom$IElement$_to_dom$arity$1(this$);
} else {
return shadow$dom$IElement$_to_dom$dyn_23464(this$);
}
});


/**
 * @interface
 */
shadow.dom.SVGElement = function(){};

var shadow$dom$SVGElement$_to_svg$dyn_23473 = (function (this$){
var x__5350__auto__ = (((this$ == null))?null:this$);
var m__5351__auto__ = (shadow.dom._to_svg[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__ = (shadow.dom._to_svg["_"]);
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("SVGElement.-to-svg",this$);
}
}
});
shadow.dom._to_svg = (function shadow$dom$_to_svg(this$){
if((((!((this$ == null)))) && ((!((this$.shadow$dom$SVGElement$_to_svg$arity$1 == null)))))){
return this$.shadow$dom$SVGElement$_to_svg$arity$1(this$);
} else {
return shadow$dom$SVGElement$_to_svg$dyn_23473(this$);
}
});

shadow.dom.lazy_native_coll_seq = (function shadow$dom$lazy_native_coll_seq(coll,idx){
if((idx < coll.length)){
return (new cljs.core.LazySeq(null,(function (){
return cljs.core.cons((coll[idx]),(function (){var G__21744 = coll;
var G__21745 = (idx + (1));
return (shadow.dom.lazy_native_coll_seq.cljs$core$IFn$_invoke$arity$2 ? shadow.dom.lazy_native_coll_seq.cljs$core$IFn$_invoke$arity$2(G__21744,G__21745) : shadow.dom.lazy_native_coll_seq.call(null, G__21744,G__21745));
})());
}),null,null));
} else {
return null;
}
});

/**
* @constructor
 * @implements {cljs.core.IIndexed}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IDeref}
 * @implements {shadow.dom.IElement}
*/
shadow.dom.NativeColl = (function (coll){
this.coll = coll;
this.cljs$lang$protocol_mask$partition0$ = 8421394;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
(shadow.dom.NativeColl.prototype.cljs$core$IDeref$_deref$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return self__.coll;
}));

(shadow.dom.NativeColl.prototype.cljs$core$IIndexed$_nth$arity$2 = (function (this$,n){
var self__ = this;
var this$__$1 = this;
return (self__.coll[n]);
}));

(shadow.dom.NativeColl.prototype.cljs$core$IIndexed$_nth$arity$3 = (function (this$,n,not_found){
var self__ = this;
var this$__$1 = this;
var or__5002__auto__ = (self__.coll[n]);
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__auto__;
} else {
return not_found;
}
}));

(shadow.dom.NativeColl.prototype.cljs$core$ICounted$_count$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return self__.coll.length;
}));

(shadow.dom.NativeColl.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return shadow.dom.lazy_native_coll_seq(self__.coll,(0));
}));

(shadow.dom.NativeColl.prototype.shadow$dom$IElement$ = cljs.core.PROTOCOL_SENTINEL);

(shadow.dom.NativeColl.prototype.shadow$dom$IElement$_to_dom$arity$1 = (function (this$){
var self__ = this;
var this$__$1 = this;
return self__.coll;
}));

(shadow.dom.NativeColl.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"coll","coll",-1006698606,null)], null);
}));

(shadow.dom.NativeColl.cljs$lang$type = true);

(shadow.dom.NativeColl.cljs$lang$ctorStr = "shadow.dom/NativeColl");

(shadow.dom.NativeColl.cljs$lang$ctorPrWriter = (function (this__5287__auto__,writer__5288__auto__,opt__5289__auto__){
return cljs.core._write(writer__5288__auto__,"shadow.dom/NativeColl");
}));

/**
 * Positional factory function for shadow.dom/NativeColl.
 */
shadow.dom.__GT_NativeColl = (function shadow$dom$__GT_NativeColl(coll){
return (new shadow.dom.NativeColl(coll));
});

shadow.dom.native_coll = (function shadow$dom$native_coll(coll){
return (new shadow.dom.NativeColl(coll));
});
shadow.dom.dom_node = (function shadow$dom$dom_node(el){
if((el == null)){
return null;
} else {
if((((!((el == null))))?((((false) || ((cljs.core.PROTOCOL_SENTINEL === el.shadow$dom$IElement$))))?true:false):false)){
return el.shadow$dom$IElement$_to_dom$arity$1(null, );
} else {
if(typeof el === 'string'){
return document.createTextNode(el);
} else {
if(typeof el === 'number'){
return document.createTextNode(cljs.core.str.cljs$core$IFn$_invoke$arity$1(el));
} else {
return el;

}
}
}
}
});
shadow.dom.query_one = (function shadow$dom$query_one(var_args){
var G__21801 = arguments.length;
switch (G__21801) {
case 1:
return shadow.dom.query_one.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return shadow.dom.query_one.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('')));

}
});

(shadow.dom.query_one.cljs$core$IFn$_invoke$arity$1 = (function (sel){
return document.querySelector(sel);
}));

(shadow.dom.query_one.cljs$core$IFn$_invoke$arity$2 = (function (sel,root){
return shadow.dom.dom_node(root).querySelector(sel);
}));

(shadow.dom.query_one.cljs$lang$maxFixedArity = 2);

shadow.dom.query = (function shadow$dom$query(var_args){
var G__21810 = arguments.length;
switch (G__21810) {
case 1:
return shadow.dom.query.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return shadow.dom.query.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('')));

}
});

(shadow.dom.query.cljs$core$IFn$_invoke$arity$1 = (function (sel){
return (new shadow.dom.NativeColl(document.querySelectorAll(sel)));
}));

(shadow.dom.query.cljs$core$IFn$_invoke$arity$2 = (function (sel,root){
return (new shadow.dom.NativeColl(shadow.dom.dom_node(root).querySelectorAll(sel)));
}));

(shadow.dom.query.cljs$lang$maxFixedArity = 2);

shadow.dom.by_id = (function shadow$dom$by_id(var_args){
var G__21834 = arguments.length;
switch (G__21834) {
case 2:
return shadow.dom.by_id.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 1:
return shadow.dom.by_id.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('')));

}
});

(shadow.dom.by_id.cljs$core$IFn$_invoke$arity$2 = (function (id,el){
return shadow.dom.dom_node(el).getElementById(id);
}));

(shadow.dom.by_id.cljs$core$IFn$_invoke$arity$1 = (function (id){
return document.getElementById(id);
}));

(shadow.dom.by_id.cljs$lang$maxFixedArity = 2);

shadow.dom.build = shadow.dom.dom_node;
shadow.dom.ev_stop = (function shadow$dom$ev_stop(var_args){
var G__21852 = arguments.length;
switch (G__21852) {
case 1:
return shadow.dom.ev_stop.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return shadow.dom.ev_stop.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 4:
return shadow.dom.ev_stop.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('')));

}
});

(shadow.dom.ev_stop.cljs$core$IFn$_invoke$arity$1 = (function (e){
if(cljs.core.truth_(e.stopPropagation)){
e.stopPropagation();

e.preventDefault();
} else {
(e.cancelBubble = true);

(e.returnValue = false);
}

return e;
}));

(shadow.dom.ev_stop.cljs$core$IFn$_invoke$arity$2 = (function (e,el){
shadow.dom.ev_stop.cljs$core$IFn$_invoke$arity$1(e);

return el;
}));

(shadow.dom.ev_stop.cljs$core$IFn$_invoke$arity$4 = (function (e,el,scope,owner){
shadow.dom.ev_stop.cljs$core$IFn$_invoke$arity$1(e);

return el;
}));

(shadow.dom.ev_stop.cljs$lang$maxFixedArity = 4);

/**
 * check wether a parent node (or the document) contains the child
 */
shadow.dom.contains_QMARK_ = (function shadow$dom$contains_QMARK_(var_args){
var G__21872 = arguments.length;
switch (G__21872) {
case 1:
return shadow.dom.contains_QMARK_.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return shadow.dom.contains_QMARK_.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('')));

}
});

(shadow.dom.contains_QMARK_.cljs$core$IFn$_invoke$arity$1 = (function (el){
return goog.dom.contains(document,shadow.dom.dom_node(el));
}));

(shadow.dom.contains_QMARK_.cljs$core$IFn$_invoke$arity$2 = (function (parent,el){
return goog.dom.contains(shadow.dom.dom_node(parent),shadow.dom.dom_node(el));
}));

(shadow.dom.contains_QMARK_.cljs$lang$maxFixedArity = 2);

shadow.dom.add_class = (function shadow$dom$add_class(el,cls){
return goog.dom.classlist.add(shadow.dom.dom_node(el),cls);
});
shadow.dom.remove_class = (function shadow$dom$remove_class(el,cls){
return goog.dom.classlist.remove(shadow.dom.dom_node(el),cls);
});
shadow.dom.toggle_class = (function shadow$dom$toggle_class(var_args){
var G__21910 = arguments.length;
switch (G__21910) {
case 2:
return shadow.dom.toggle_class.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return shadow.dom.toggle_class.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('')));

}
});

(shadow.dom.toggle_class.cljs$core$IFn$_invoke$arity$2 = (function (el,cls){
return goog.dom.classlist.toggle(shadow.dom.dom_node(el),cls);
}));

(shadow.dom.toggle_class.cljs$core$IFn$_invoke$arity$3 = (function (el,cls,v){
if(cljs.core.truth_(v)){
return shadow.dom.add_class(el,cls);
} else {
return shadow.dom.remove_class(el,cls);
}
}));

(shadow.dom.toggle_class.cljs$lang$maxFixedArity = 3);

shadow.dom.dom_listen = (cljs.core.truth_((function (){var or__5002__auto__ = (!((typeof document !== 'undefined')));
if(or__5002__auto__){
return or__5002__auto__;
} else {
return document.addEventListener;
}
})())?(function shadow$dom$dom_listen_good(el,ev,handler){
return el.addEventListener(ev,handler,false);
}):(function shadow$dom$dom_listen_ie(el,ev,handler){
try{return el.attachEvent(["on",cljs.core.str.cljs$core$IFn$_invoke$arity$1(ev)].join(''),(function (e){
return (handler.cljs$core$IFn$_invoke$arity$2 ? handler.cljs$core$IFn$_invoke$arity$2(e,el) : handler.call(null, e,el));
}));
}catch (e21933){if((e21933 instanceof Object)){
var e = e21933;
return console.log("didnt support attachEvent",el,e);
} else {
throw e21933;

}
}}));
shadow.dom.dom_listen_remove = (cljs.core.truth_((function (){var or__5002__auto__ = (!((typeof document !== 'undefined')));
if(or__5002__auto__){
return or__5002__auto__;
} else {
return document.removeEventListener;
}
})())?(function shadow$dom$dom_listen_remove_good(el,ev,handler){
return el.removeEventListener(ev,handler,false);
}):(function shadow$dom$dom_listen_remove_ie(el,ev,handler){
return el.detachEvent(["on",cljs.core.str.cljs$core$IFn$_invoke$arity$1(ev)].join(''),handler);
}));
shadow.dom.on_query = (function shadow$dom$on_query(root_el,ev,selector,handler){
var seq__21951 = cljs.core.seq(shadow.dom.query.cljs$core$IFn$_invoke$arity$2(selector,root_el));
var chunk__21952 = null;
var count__21953 = (0);
var i__21954 = (0);
while(true){
if((i__21954 < count__21953)){
var el = chunk__21952.cljs$core$IIndexed$_nth$arity$2(null, i__21954);
var handler_23555__$1 = ((function (seq__21951,chunk__21952,count__21953,i__21954,el){
return (function (e){
return (handler.cljs$core$IFn$_invoke$arity$2 ? handler.cljs$core$IFn$_invoke$arity$2(e,el) : handler.call(null, e,el));
});})(seq__21951,chunk__21952,count__21953,i__21954,el))
;
shadow.dom.dom_listen(el,cljs.core.name(ev),handler_23555__$1);


var G__23558 = seq__21951;
var G__23559 = chunk__21952;
var G__23560 = count__21953;
var G__23561 = (i__21954 + (1));
seq__21951 = G__23558;
chunk__21952 = G__23559;
count__21953 = G__23560;
i__21954 = G__23561;
continue;
} else {
var temp__5804__auto__ = cljs.core.seq(seq__21951);
if(temp__5804__auto__){
var seq__21951__$1 = temp__5804__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__21951__$1)){
var c__5525__auto__ = cljs.core.chunk_first(seq__21951__$1);
var G__23565 = cljs.core.chunk_rest(seq__21951__$1);
var G__23566 = c__5525__auto__;
var G__23567 = cljs.core.count(c__5525__auto__);
var G__23568 = (0);
seq__21951 = G__23565;
chunk__21952 = G__23566;
count__21953 = G__23567;
i__21954 = G__23568;
continue;
} else {
var el = cljs.core.first(seq__21951__$1);
var handler_23569__$1 = ((function (seq__21951,chunk__21952,count__21953,i__21954,el,seq__21951__$1,temp__5804__auto__){
return (function (e){
return (handler.cljs$core$IFn$_invoke$arity$2 ? handler.cljs$core$IFn$_invoke$arity$2(e,el) : handler.call(null, e,el));
});})(seq__21951,chunk__21952,count__21953,i__21954,el,seq__21951__$1,temp__5804__auto__))
;
shadow.dom.dom_listen(el,cljs.core.name(ev),handler_23569__$1);


var G__23579 = cljs.core.next(seq__21951__$1);
var G__23580 = null;
var G__23581 = (0);
var G__23582 = (0);
seq__21951 = G__23579;
chunk__21952 = G__23580;
count__21953 = G__23581;
i__21954 = G__23582;
continue;
}
} else {
return null;
}
}
break;
}
});
shadow.dom.on = (function shadow$dom$on(var_args){
var G__21982 = arguments.length;
switch (G__21982) {
case 3:
return shadow.dom.on.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
case 4:
return shadow.dom.on.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('')));

}
});

(shadow.dom.on.cljs$core$IFn$_invoke$arity$3 = (function (el,ev,handler){
return shadow.dom.on.cljs$core$IFn$_invoke$arity$4(el,ev,handler,false);
}));

(shadow.dom.on.cljs$core$IFn$_invoke$arity$4 = (function (el,ev,handler,capture){
if(cljs.core.vector_QMARK_(ev)){
return shadow.dom.on_query(el,cljs.core.first(ev),cljs.core.second(ev),handler);
} else {
var handler__$1 = (function (e){
return (handler.cljs$core$IFn$_invoke$arity$2 ? handler.cljs$core$IFn$_invoke$arity$2(e,el) : handler.call(null, e,el));
});
return shadow.dom.dom_listen(shadow.dom.dom_node(el),cljs.core.name(ev),handler__$1);
}
}));

(shadow.dom.on.cljs$lang$maxFixedArity = 4);

shadow.dom.remove_event_handler = (function shadow$dom$remove_event_handler(el,ev,handler){
return shadow.dom.dom_listen_remove(shadow.dom.dom_node(el),cljs.core.name(ev),handler);
});
shadow.dom.add_event_listeners = (function shadow$dom$add_event_listeners(el,events){
var seq__21993 = cljs.core.seq(events);
var chunk__21994 = null;
var count__21995 = (0);
var i__21996 = (0);
while(true){
if((i__21996 < count__21995)){
var vec__22011 = chunk__21994.cljs$core$IIndexed$_nth$arity$2(null, i__21996);
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22011,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22011,(1),null);
shadow.dom.on.cljs$core$IFn$_invoke$arity$3(el,k,v);


var G__23625 = seq__21993;
var G__23626 = chunk__21994;
var G__23627 = count__21995;
var G__23628 = (i__21996 + (1));
seq__21993 = G__23625;
chunk__21994 = G__23626;
count__21995 = G__23627;
i__21996 = G__23628;
continue;
} else {
var temp__5804__auto__ = cljs.core.seq(seq__21993);
if(temp__5804__auto__){
var seq__21993__$1 = temp__5804__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__21993__$1)){
var c__5525__auto__ = cljs.core.chunk_first(seq__21993__$1);
var G__23635 = cljs.core.chunk_rest(seq__21993__$1);
var G__23636 = c__5525__auto__;
var G__23637 = cljs.core.count(c__5525__auto__);
var G__23638 = (0);
seq__21993 = G__23635;
chunk__21994 = G__23636;
count__21995 = G__23637;
i__21996 = G__23638;
continue;
} else {
var vec__22018 = cljs.core.first(seq__21993__$1);
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22018,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22018,(1),null);
shadow.dom.on.cljs$core$IFn$_invoke$arity$3(el,k,v);


var G__23641 = cljs.core.next(seq__21993__$1);
var G__23642 = null;
var G__23643 = (0);
var G__23644 = (0);
seq__21993 = G__23641;
chunk__21994 = G__23642;
count__21995 = G__23643;
i__21996 = G__23644;
continue;
}
} else {
return null;
}
}
break;
}
});
shadow.dom.set_style = (function shadow$dom$set_style(el,styles){
var dom = shadow.dom.dom_node(el);
var seq__22027 = cljs.core.seq(styles);
var chunk__22028 = null;
var count__22029 = (0);
var i__22030 = (0);
while(true){
if((i__22030 < count__22029)){
var vec__22069 = chunk__22028.cljs$core$IIndexed$_nth$arity$2(null, i__22030);
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22069,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22069,(1),null);
goog.style.setStyle(dom,cljs.core.name(k),(((v == null))?"":v));


var G__23656 = seq__22027;
var G__23657 = chunk__22028;
var G__23658 = count__22029;
var G__23659 = (i__22030 + (1));
seq__22027 = G__23656;
chunk__22028 = G__23657;
count__22029 = G__23658;
i__22030 = G__23659;
continue;
} else {
var temp__5804__auto__ = cljs.core.seq(seq__22027);
if(temp__5804__auto__){
var seq__22027__$1 = temp__5804__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__22027__$1)){
var c__5525__auto__ = cljs.core.chunk_first(seq__22027__$1);
var G__23663 = cljs.core.chunk_rest(seq__22027__$1);
var G__23664 = c__5525__auto__;
var G__23665 = cljs.core.count(c__5525__auto__);
var G__23666 = (0);
seq__22027 = G__23663;
chunk__22028 = G__23664;
count__22029 = G__23665;
i__22030 = G__23666;
continue;
} else {
var vec__22080 = cljs.core.first(seq__22027__$1);
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22080,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22080,(1),null);
goog.style.setStyle(dom,cljs.core.name(k),(((v == null))?"":v));


var G__23668 = cljs.core.next(seq__22027__$1);
var G__23669 = null;
var G__23670 = (0);
var G__23671 = (0);
seq__22027 = G__23668;
chunk__22028 = G__23669;
count__22029 = G__23670;
i__22030 = G__23671;
continue;
}
} else {
return null;
}
}
break;
}
});
shadow.dom.set_attr_STAR_ = (function shadow$dom$set_attr_STAR_(el,key,value){
var G__22106_23673 = key;
var G__22106_23674__$1 = (((G__22106_23673 instanceof cljs.core.Keyword))?G__22106_23673.fqn:null);
switch (G__22106_23674__$1) {
case "id":
(el.id = cljs.core.str.cljs$core$IFn$_invoke$arity$1(value));

break;
case "class":
(el.className = cljs.core.str.cljs$core$IFn$_invoke$arity$1(value));

break;
case "for":
(el.htmlFor = value);

break;
case "cellpadding":
el.setAttribute("cellPadding",value);

break;
case "cellspacing":
el.setAttribute("cellSpacing",value);

break;
case "colspan":
el.setAttribute("colSpan",value);

break;
case "frameborder":
el.setAttribute("frameBorder",value);

break;
case "height":
el.setAttribute("height",value);

break;
case "maxlength":
el.setAttribute("maxLength",value);

break;
case "role":
el.setAttribute("role",value);

break;
case "rowspan":
el.setAttribute("rowSpan",value);

break;
case "type":
el.setAttribute("type",value);

break;
case "usemap":
el.setAttribute("useMap",value);

break;
case "valign":
el.setAttribute("vAlign",value);

break;
case "width":
el.setAttribute("width",value);

break;
case "on":
shadow.dom.add_event_listeners(el,value);

break;
case "style":
if((value == null)){
} else {
if(typeof value === 'string'){
el.setAttribute("style",value);
} else {
if(cljs.core.map_QMARK_(value)){
shadow.dom.set_style(el,value);
} else {
goog.style.setStyle(el,value);

}
}
}

break;
default:
var ks_23684 = cljs.core.name(key);
if(cljs.core.truth_((function (){var or__5002__auto__ = goog.string.startsWith(ks_23684,"data-");
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__auto__;
} else {
return goog.string.startsWith(ks_23684,"aria-");
}
})())){
el.setAttribute(ks_23684,value);
} else {
(el[ks_23684] = value);
}

}

return el;
});
shadow.dom.set_attrs = (function shadow$dom$set_attrs(el,attrs){
return cljs.core.reduce_kv((function (el__$1,key,value){
shadow.dom.set_attr_STAR_(el__$1,key,value);

return el__$1;
}),shadow.dom.dom_node(el),attrs);
});
shadow.dom.set_attr = (function shadow$dom$set_attr(el,key,value){
return shadow.dom.set_attr_STAR_(shadow.dom.dom_node(el),key,value);
});
shadow.dom.has_class_QMARK_ = (function shadow$dom$has_class_QMARK_(el,cls){
return goog.dom.classlist.contains(shadow.dom.dom_node(el),cls);
});
shadow.dom.merge_class_string = (function shadow$dom$merge_class_string(current,extra_class){
if(cljs.core.seq(current)){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(current)," ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(extra_class)].join('');
} else {
return extra_class;
}
});
shadow.dom.parse_tag = (function shadow$dom$parse_tag(spec){
var spec__$1 = cljs.core.name(spec);
var fdot = spec__$1.indexOf(".");
var fhash = spec__$1.indexOf("#");
if(((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2((-1),fdot)) && (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2((-1),fhash)))){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [spec__$1,null,null], null);
} else {
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2((-1),fhash)){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [spec__$1.substring((0),fdot),null,clojure.string.replace(spec__$1.substring((fdot + (1))),/\./," ")], null);
} else {
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2((-1),fdot)){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [spec__$1.substring((0),fhash),spec__$1.substring((fhash + (1))),null], null);
} else {
if((fhash > fdot)){
throw ["cant have id after class?",spec__$1].join('');
} else {
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [spec__$1.substring((0),fhash),spec__$1.substring((fhash + (1)),fdot),clojure.string.replace(spec__$1.substring((fdot + (1))),/\./," ")], null);

}
}
}
}
});
shadow.dom.create_dom_node = (function shadow$dom$create_dom_node(tag_def,p__22160){
var map__22161 = p__22160;
var map__22161__$1 = cljs.core.__destructure_map(map__22161);
var props = map__22161__$1;
var class$ = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__22161__$1,new cljs.core.Keyword(null,"class","class",-2030961996));
var tag_props = ({});
var vec__22162 = shadow.dom.parse_tag(tag_def);
var tag_name = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22162,(0),null);
var tag_id = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22162,(1),null);
var tag_classes = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22162,(2),null);
if(cljs.core.truth_(tag_id)){
(tag_props["id"] = tag_id);
} else {
}

if(cljs.core.truth_(tag_classes)){
(tag_props["class"] = shadow.dom.merge_class_string(class$,tag_classes));
} else {
}

var G__22166 = goog.dom.createDom(tag_name,tag_props);
shadow.dom.set_attrs(G__22166,cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(props,new cljs.core.Keyword(null,"class","class",-2030961996)));

return G__22166;
});
shadow.dom.append = (function shadow$dom$append(var_args){
var G__22173 = arguments.length;
switch (G__22173) {
case 1:
return shadow.dom.append.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return shadow.dom.append.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('')));

}
});

(shadow.dom.append.cljs$core$IFn$_invoke$arity$1 = (function (node){
if(cljs.core.truth_(node)){
var temp__5804__auto__ = shadow.dom.dom_node(node);
if(cljs.core.truth_(temp__5804__auto__)){
var n = temp__5804__auto__;
document.body.appendChild(n);

return n;
} else {
return null;
}
} else {
return null;
}
}));

(shadow.dom.append.cljs$core$IFn$_invoke$arity$2 = (function (el,node){
if(cljs.core.truth_(node)){
var temp__5804__auto__ = shadow.dom.dom_node(node);
if(cljs.core.truth_(temp__5804__auto__)){
var n = temp__5804__auto__;
shadow.dom.dom_node(el).appendChild(n);

return n;
} else {
return null;
}
} else {
return null;
}
}));

(shadow.dom.append.cljs$lang$maxFixedArity = 2);

shadow.dom.destructure_node = (function shadow$dom$destructure_node(create_fn,p__22210){
var vec__22211 = p__22210;
var seq__22212 = cljs.core.seq(vec__22211);
var first__22213 = cljs.core.first(seq__22212);
var seq__22212__$1 = cljs.core.next(seq__22212);
var nn = first__22213;
var first__22213__$1 = cljs.core.first(seq__22212__$1);
var seq__22212__$2 = cljs.core.next(seq__22212__$1);
var np = first__22213__$1;
var nc = seq__22212__$2;
var node = vec__22211;
if((nn instanceof cljs.core.Keyword)){
} else {
throw cljs.core.ex_info.cljs$core$IFn$_invoke$arity$2("invalid dom node",new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"node","node",581201198),node], null));
}

if((((np == null)) && ((nc == null)))){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(function (){var G__22214 = nn;
var G__22215 = cljs.core.PersistentArrayMap.EMPTY;
return (create_fn.cljs$core$IFn$_invoke$arity$2 ? create_fn.cljs$core$IFn$_invoke$arity$2(G__22214,G__22215) : create_fn.call(null, G__22214,G__22215));
})(),cljs.core.List.EMPTY], null);
} else {
if(cljs.core.map_QMARK_(np)){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(create_fn.cljs$core$IFn$_invoke$arity$2 ? create_fn.cljs$core$IFn$_invoke$arity$2(nn,np) : create_fn.call(null, nn,np)),nc], null);
} else {
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(function (){var G__22219 = nn;
var G__22220 = cljs.core.PersistentArrayMap.EMPTY;
return (create_fn.cljs$core$IFn$_invoke$arity$2 ? create_fn.cljs$core$IFn$_invoke$arity$2(G__22219,G__22220) : create_fn.call(null, G__22219,G__22220));
})(),cljs.core.conj.cljs$core$IFn$_invoke$arity$2(nc,np)], null);

}
}
});
shadow.dom.make_dom_node = (function shadow$dom$make_dom_node(structure){
var vec__22224 = shadow.dom.destructure_node(shadow.dom.create_dom_node,structure);
var node = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22224,(0),null);
var node_children = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22224,(1),null);
var seq__22227_23755 = cljs.core.seq(node_children);
var chunk__22228_23756 = null;
var count__22229_23757 = (0);
var i__22230_23758 = (0);
while(true){
if((i__22230_23758 < count__22229_23757)){
var child_struct_23768 = chunk__22228_23756.cljs$core$IIndexed$_nth$arity$2(null, i__22230_23758);
var children_23770 = shadow.dom.dom_node(child_struct_23768);
if(cljs.core.seq_QMARK_(children_23770)){
var seq__22314_23772 = cljs.core.seq(cljs.core.map.cljs$core$IFn$_invoke$arity$2(shadow.dom.dom_node,children_23770));
var chunk__22316_23773 = null;
var count__22317_23774 = (0);
var i__22318_23775 = (0);
while(true){
if((i__22318_23775 < count__22317_23774)){
var child_23777 = chunk__22316_23773.cljs$core$IIndexed$_nth$arity$2(null, i__22318_23775);
if(cljs.core.truth_(child_23777)){
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,child_23777);


var G__23778 = seq__22314_23772;
var G__23779 = chunk__22316_23773;
var G__23780 = count__22317_23774;
var G__23781 = (i__22318_23775 + (1));
seq__22314_23772 = G__23778;
chunk__22316_23773 = G__23779;
count__22317_23774 = G__23780;
i__22318_23775 = G__23781;
continue;
} else {
var G__23782 = seq__22314_23772;
var G__23783 = chunk__22316_23773;
var G__23784 = count__22317_23774;
var G__23785 = (i__22318_23775 + (1));
seq__22314_23772 = G__23782;
chunk__22316_23773 = G__23783;
count__22317_23774 = G__23784;
i__22318_23775 = G__23785;
continue;
}
} else {
var temp__5804__auto___23787 = cljs.core.seq(seq__22314_23772);
if(temp__5804__auto___23787){
var seq__22314_23788__$1 = temp__5804__auto___23787;
if(cljs.core.chunked_seq_QMARK_(seq__22314_23788__$1)){
var c__5525__auto___23789 = cljs.core.chunk_first(seq__22314_23788__$1);
var G__23790 = cljs.core.chunk_rest(seq__22314_23788__$1);
var G__23791 = c__5525__auto___23789;
var G__23792 = cljs.core.count(c__5525__auto___23789);
var G__23793 = (0);
seq__22314_23772 = G__23790;
chunk__22316_23773 = G__23791;
count__22317_23774 = G__23792;
i__22318_23775 = G__23793;
continue;
} else {
var child_23794 = cljs.core.first(seq__22314_23788__$1);
if(cljs.core.truth_(child_23794)){
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,child_23794);


var G__23795 = cljs.core.next(seq__22314_23788__$1);
var G__23796 = null;
var G__23797 = (0);
var G__23798 = (0);
seq__22314_23772 = G__23795;
chunk__22316_23773 = G__23796;
count__22317_23774 = G__23797;
i__22318_23775 = G__23798;
continue;
} else {
var G__23803 = cljs.core.next(seq__22314_23788__$1);
var G__23804 = null;
var G__23805 = (0);
var G__23806 = (0);
seq__22314_23772 = G__23803;
chunk__22316_23773 = G__23804;
count__22317_23774 = G__23805;
i__22318_23775 = G__23806;
continue;
}
}
} else {
}
}
break;
}
} else {
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,children_23770);
}


var G__23808 = seq__22227_23755;
var G__23809 = chunk__22228_23756;
var G__23810 = count__22229_23757;
var G__23811 = (i__22230_23758 + (1));
seq__22227_23755 = G__23808;
chunk__22228_23756 = G__23809;
count__22229_23757 = G__23810;
i__22230_23758 = G__23811;
continue;
} else {
var temp__5804__auto___23812 = cljs.core.seq(seq__22227_23755);
if(temp__5804__auto___23812){
var seq__22227_23817__$1 = temp__5804__auto___23812;
if(cljs.core.chunked_seq_QMARK_(seq__22227_23817__$1)){
var c__5525__auto___23819 = cljs.core.chunk_first(seq__22227_23817__$1);
var G__23821 = cljs.core.chunk_rest(seq__22227_23817__$1);
var G__23822 = c__5525__auto___23819;
var G__23823 = cljs.core.count(c__5525__auto___23819);
var G__23824 = (0);
seq__22227_23755 = G__23821;
chunk__22228_23756 = G__23822;
count__22229_23757 = G__23823;
i__22230_23758 = G__23824;
continue;
} else {
var child_struct_23829 = cljs.core.first(seq__22227_23817__$1);
var children_23830 = shadow.dom.dom_node(child_struct_23829);
if(cljs.core.seq_QMARK_(children_23830)){
var seq__22329_23831 = cljs.core.seq(cljs.core.map.cljs$core$IFn$_invoke$arity$2(shadow.dom.dom_node,children_23830));
var chunk__22331_23832 = null;
var count__22332_23833 = (0);
var i__22333_23834 = (0);
while(true){
if((i__22333_23834 < count__22332_23833)){
var child_23837 = chunk__22331_23832.cljs$core$IIndexed$_nth$arity$2(null, i__22333_23834);
if(cljs.core.truth_(child_23837)){
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,child_23837);


var G__23839 = seq__22329_23831;
var G__23840 = chunk__22331_23832;
var G__23841 = count__22332_23833;
var G__23842 = (i__22333_23834 + (1));
seq__22329_23831 = G__23839;
chunk__22331_23832 = G__23840;
count__22332_23833 = G__23841;
i__22333_23834 = G__23842;
continue;
} else {
var G__23843 = seq__22329_23831;
var G__23844 = chunk__22331_23832;
var G__23845 = count__22332_23833;
var G__23846 = (i__22333_23834 + (1));
seq__22329_23831 = G__23843;
chunk__22331_23832 = G__23844;
count__22332_23833 = G__23845;
i__22333_23834 = G__23846;
continue;
}
} else {
var temp__5804__auto___23847__$1 = cljs.core.seq(seq__22329_23831);
if(temp__5804__auto___23847__$1){
var seq__22329_23848__$1 = temp__5804__auto___23847__$1;
if(cljs.core.chunked_seq_QMARK_(seq__22329_23848__$1)){
var c__5525__auto___23849 = cljs.core.chunk_first(seq__22329_23848__$1);
var G__23850 = cljs.core.chunk_rest(seq__22329_23848__$1);
var G__23851 = c__5525__auto___23849;
var G__23852 = cljs.core.count(c__5525__auto___23849);
var G__23853 = (0);
seq__22329_23831 = G__23850;
chunk__22331_23832 = G__23851;
count__22332_23833 = G__23852;
i__22333_23834 = G__23853;
continue;
} else {
var child_23856 = cljs.core.first(seq__22329_23848__$1);
if(cljs.core.truth_(child_23856)){
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,child_23856);


var G__23860 = cljs.core.next(seq__22329_23848__$1);
var G__23861 = null;
var G__23862 = (0);
var G__23863 = (0);
seq__22329_23831 = G__23860;
chunk__22331_23832 = G__23861;
count__22332_23833 = G__23862;
i__22333_23834 = G__23863;
continue;
} else {
var G__23866 = cljs.core.next(seq__22329_23848__$1);
var G__23867 = null;
var G__23868 = (0);
var G__23869 = (0);
seq__22329_23831 = G__23866;
chunk__22331_23832 = G__23867;
count__22332_23833 = G__23868;
i__22333_23834 = G__23869;
continue;
}
}
} else {
}
}
break;
}
} else {
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,children_23830);
}


var G__23871 = cljs.core.next(seq__22227_23817__$1);
var G__23872 = null;
var G__23873 = (0);
var G__23874 = (0);
seq__22227_23755 = G__23871;
chunk__22228_23756 = G__23872;
count__22229_23757 = G__23873;
i__22230_23758 = G__23874;
continue;
}
} else {
}
}
break;
}

return node;
});
(cljs.core.Keyword.prototype.shadow$dom$IElement$ = cljs.core.PROTOCOL_SENTINEL);

(cljs.core.Keyword.prototype.shadow$dom$IElement$_to_dom$arity$1 = (function (this$){
var this$__$1 = this;
return shadow.dom.make_dom_node(new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [this$__$1], null));
}));

(cljs.core.PersistentVector.prototype.shadow$dom$IElement$ = cljs.core.PROTOCOL_SENTINEL);

(cljs.core.PersistentVector.prototype.shadow$dom$IElement$_to_dom$arity$1 = (function (this$){
var this$__$1 = this;
return shadow.dom.make_dom_node(this$__$1);
}));

(cljs.core.LazySeq.prototype.shadow$dom$IElement$ = cljs.core.PROTOCOL_SENTINEL);

(cljs.core.LazySeq.prototype.shadow$dom$IElement$_to_dom$arity$1 = (function (this$){
var this$__$1 = this;
return cljs.core.map.cljs$core$IFn$_invoke$arity$2(shadow.dom._to_dom,this$__$1);
}));
if(cljs.core.truth_(((typeof HTMLElement) != 'undefined'))){
(HTMLElement.prototype.shadow$dom$IElement$ = cljs.core.PROTOCOL_SENTINEL);

(HTMLElement.prototype.shadow$dom$IElement$_to_dom$arity$1 = (function (this$){
var this$__$1 = this;
return this$__$1;
}));
} else {
}
if(cljs.core.truth_(((typeof DocumentFragment) != 'undefined'))){
(DocumentFragment.prototype.shadow$dom$IElement$ = cljs.core.PROTOCOL_SENTINEL);

(DocumentFragment.prototype.shadow$dom$IElement$_to_dom$arity$1 = (function (this$){
var this$__$1 = this;
return this$__$1;
}));
} else {
}
/**
 * clear node children
 */
shadow.dom.reset = (function shadow$dom$reset(node){
return goog.dom.removeChildren(shadow.dom.dom_node(node));
});
shadow.dom.remove = (function shadow$dom$remove(node){
if((((!((node == null))))?(((((node.cljs$lang$protocol_mask$partition0$ & (8388608))) || ((cljs.core.PROTOCOL_SENTINEL === node.cljs$core$ISeqable$))))?true:false):false)){
var seq__22376 = cljs.core.seq(node);
var chunk__22377 = null;
var count__22378 = (0);
var i__22379 = (0);
while(true){
if((i__22379 < count__22378)){
var n = chunk__22377.cljs$core$IIndexed$_nth$arity$2(null, i__22379);
(shadow.dom.remove.cljs$core$IFn$_invoke$arity$1 ? shadow.dom.remove.cljs$core$IFn$_invoke$arity$1(n) : shadow.dom.remove.call(null, n));


var G__23880 = seq__22376;
var G__23881 = chunk__22377;
var G__23882 = count__22378;
var G__23883 = (i__22379 + (1));
seq__22376 = G__23880;
chunk__22377 = G__23881;
count__22378 = G__23882;
i__22379 = G__23883;
continue;
} else {
var temp__5804__auto__ = cljs.core.seq(seq__22376);
if(temp__5804__auto__){
var seq__22376__$1 = temp__5804__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__22376__$1)){
var c__5525__auto__ = cljs.core.chunk_first(seq__22376__$1);
var G__23884 = cljs.core.chunk_rest(seq__22376__$1);
var G__23885 = c__5525__auto__;
var G__23886 = cljs.core.count(c__5525__auto__);
var G__23887 = (0);
seq__22376 = G__23884;
chunk__22377 = G__23885;
count__22378 = G__23886;
i__22379 = G__23887;
continue;
} else {
var n = cljs.core.first(seq__22376__$1);
(shadow.dom.remove.cljs$core$IFn$_invoke$arity$1 ? shadow.dom.remove.cljs$core$IFn$_invoke$arity$1(n) : shadow.dom.remove.call(null, n));


var G__23889 = cljs.core.next(seq__22376__$1);
var G__23890 = null;
var G__23891 = (0);
var G__23892 = (0);
seq__22376 = G__23889;
chunk__22377 = G__23890;
count__22378 = G__23891;
i__22379 = G__23892;
continue;
}
} else {
return null;
}
}
break;
}
} else {
return goog.dom.removeNode(node);
}
});
shadow.dom.replace_node = (function shadow$dom$replace_node(old,new$){
return goog.dom.replaceNode(shadow.dom.dom_node(new$),shadow.dom.dom_node(old));
});
shadow.dom.text = (function shadow$dom$text(var_args){
var G__22391 = arguments.length;
switch (G__22391) {
case 2:
return shadow.dom.text.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 1:
return shadow.dom.text.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('')));

}
});

(shadow.dom.text.cljs$core$IFn$_invoke$arity$2 = (function (el,new_text){
return (shadow.dom.dom_node(el).innerText = new_text);
}));

(shadow.dom.text.cljs$core$IFn$_invoke$arity$1 = (function (el){
return shadow.dom.dom_node(el).innerText;
}));

(shadow.dom.text.cljs$lang$maxFixedArity = 2);

shadow.dom.check = (function shadow$dom$check(var_args){
var G__22398 = arguments.length;
switch (G__22398) {
case 1:
return shadow.dom.check.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return shadow.dom.check.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('')));

}
});

(shadow.dom.check.cljs$core$IFn$_invoke$arity$1 = (function (el){
return shadow.dom.check.cljs$core$IFn$_invoke$arity$2(el,true);
}));

(shadow.dom.check.cljs$core$IFn$_invoke$arity$2 = (function (el,checked){
return (shadow.dom.dom_node(el).checked = checked);
}));

(shadow.dom.check.cljs$lang$maxFixedArity = 2);

shadow.dom.checked_QMARK_ = (function shadow$dom$checked_QMARK_(el){
return shadow.dom.dom_node(el).checked;
});
shadow.dom.form_elements = (function shadow$dom$form_elements(el){
return (new shadow.dom.NativeColl(shadow.dom.dom_node(el).elements));
});
shadow.dom.children = (function shadow$dom$children(el){
return (new shadow.dom.NativeColl(shadow.dom.dom_node(el).children));
});
shadow.dom.child_nodes = (function shadow$dom$child_nodes(el){
return (new shadow.dom.NativeColl(shadow.dom.dom_node(el).childNodes));
});
shadow.dom.attr = (function shadow$dom$attr(var_args){
var G__22419 = arguments.length;
switch (G__22419) {
case 2:
return shadow.dom.attr.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return shadow.dom.attr.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('')));

}
});

(shadow.dom.attr.cljs$core$IFn$_invoke$arity$2 = (function (el,key){
return shadow.dom.dom_node(el).getAttribute(cljs.core.name(key));
}));

(shadow.dom.attr.cljs$core$IFn$_invoke$arity$3 = (function (el,key,default$){
var or__5002__auto__ = shadow.dom.dom_node(el).getAttribute(cljs.core.name(key));
if(cljs.core.truth_(or__5002__auto__)){
return or__5002__auto__;
} else {
return default$;
}
}));

(shadow.dom.attr.cljs$lang$maxFixedArity = 3);

shadow.dom.del_attr = (function shadow$dom$del_attr(el,key){
return shadow.dom.dom_node(el).removeAttribute(cljs.core.name(key));
});
shadow.dom.data = (function shadow$dom$data(el,key){
return shadow.dom.dom_node(el).getAttribute(["data-",cljs.core.name(key)].join(''));
});
shadow.dom.set_data = (function shadow$dom$set_data(el,key,value){
return shadow.dom.dom_node(el).setAttribute(["data-",cljs.core.name(key)].join(''),cljs.core.str.cljs$core$IFn$_invoke$arity$1(value));
});
shadow.dom.set_html = (function shadow$dom$set_html(node,text){
return (shadow.dom.dom_node(node).innerHTML = text);
});
shadow.dom.get_html = (function shadow$dom$get_html(node){
return shadow.dom.dom_node(node).innerHTML;
});
shadow.dom.fragment = (function shadow$dom$fragment(var_args){
var args__5732__auto__ = [];
var len__5726__auto___23920 = arguments.length;
var i__5727__auto___23921 = (0);
while(true){
if((i__5727__auto___23921 < len__5726__auto___23920)){
args__5732__auto__.push((arguments[i__5727__auto___23921]));

var G__23922 = (i__5727__auto___23921 + (1));
i__5727__auto___23921 = G__23922;
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 shadow.dom.fragment.cljs$core$IFn$_invoke$arity$variadic(argseq__5733__auto__);
});

(shadow.dom.fragment.cljs$core$IFn$_invoke$arity$variadic = (function (nodes){
var fragment = document.createDocumentFragment();
var seq__22472_23923 = cljs.core.seq(nodes);
var chunk__22473_23924 = null;
var count__22474_23925 = (0);
var i__22475_23926 = (0);
while(true){
if((i__22475_23926 < count__22474_23925)){
var node_23927 = chunk__22473_23924.cljs$core$IIndexed$_nth$arity$2(null, i__22475_23926);
fragment.appendChild(shadow.dom._to_dom(node_23927));


var G__23928 = seq__22472_23923;
var G__23929 = chunk__22473_23924;
var G__23930 = count__22474_23925;
var G__23931 = (i__22475_23926 + (1));
seq__22472_23923 = G__23928;
chunk__22473_23924 = G__23929;
count__22474_23925 = G__23930;
i__22475_23926 = G__23931;
continue;
} else {
var temp__5804__auto___23932 = cljs.core.seq(seq__22472_23923);
if(temp__5804__auto___23932){
var seq__22472_23934__$1 = temp__5804__auto___23932;
if(cljs.core.chunked_seq_QMARK_(seq__22472_23934__$1)){
var c__5525__auto___23935 = cljs.core.chunk_first(seq__22472_23934__$1);
var G__23936 = cljs.core.chunk_rest(seq__22472_23934__$1);
var G__23937 = c__5525__auto___23935;
var G__23938 = cljs.core.count(c__5525__auto___23935);
var G__23939 = (0);
seq__22472_23923 = G__23936;
chunk__22473_23924 = G__23937;
count__22474_23925 = G__23938;
i__22475_23926 = G__23939;
continue;
} else {
var node_23940 = cljs.core.first(seq__22472_23934__$1);
fragment.appendChild(shadow.dom._to_dom(node_23940));


var G__23944 = cljs.core.next(seq__22472_23934__$1);
var G__23945 = null;
var G__23946 = (0);
var G__23947 = (0);
seq__22472_23923 = G__23944;
chunk__22473_23924 = G__23945;
count__22474_23925 = G__23946;
i__22475_23926 = G__23947;
continue;
}
} else {
}
}
break;
}

return (new shadow.dom.NativeColl(fragment));
}));

(shadow.dom.fragment.cljs$lang$maxFixedArity = (0));

/** @this {Function} */
(shadow.dom.fragment.cljs$lang$applyTo = (function (seq22453){
var self__5712__auto__ = this;
return self__5712__auto__.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq(seq22453));
}));

/**
 * given a html string, eval all <script> tags and return the html without the scripts
 * don't do this for everything, only content you trust.
 */
shadow.dom.eval_scripts = (function shadow$dom$eval_scripts(s){
var scripts = cljs.core.re_seq(/<script[^>]*?>(.+?)<\/script>/,s);
var seq__22533_23950 = cljs.core.seq(scripts);
var chunk__22534_23951 = null;
var count__22535_23952 = (0);
var i__22536_23953 = (0);
while(true){
if((i__22536_23953 < count__22535_23952)){
var vec__22571_23954 = chunk__22534_23951.cljs$core$IIndexed$_nth$arity$2(null, i__22536_23953);
var script_tag_23955 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22571_23954,(0),null);
var script_body_23956 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22571_23954,(1),null);
eval(script_body_23956);


var G__23958 = seq__22533_23950;
var G__23959 = chunk__22534_23951;
var G__23960 = count__22535_23952;
var G__23961 = (i__22536_23953 + (1));
seq__22533_23950 = G__23958;
chunk__22534_23951 = G__23959;
count__22535_23952 = G__23960;
i__22536_23953 = G__23961;
continue;
} else {
var temp__5804__auto___23962 = cljs.core.seq(seq__22533_23950);
if(temp__5804__auto___23962){
var seq__22533_23963__$1 = temp__5804__auto___23962;
if(cljs.core.chunked_seq_QMARK_(seq__22533_23963__$1)){
var c__5525__auto___23964 = cljs.core.chunk_first(seq__22533_23963__$1);
var G__23965 = cljs.core.chunk_rest(seq__22533_23963__$1);
var G__23966 = c__5525__auto___23964;
var G__23967 = cljs.core.count(c__5525__auto___23964);
var G__23968 = (0);
seq__22533_23950 = G__23965;
chunk__22534_23951 = G__23966;
count__22535_23952 = G__23967;
i__22536_23953 = G__23968;
continue;
} else {
var vec__22590_23969 = cljs.core.first(seq__22533_23963__$1);
var script_tag_23970 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22590_23969,(0),null);
var script_body_23971 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22590_23969,(1),null);
eval(script_body_23971);


var G__23972 = cljs.core.next(seq__22533_23963__$1);
var G__23973 = null;
var G__23974 = (0);
var G__23975 = (0);
seq__22533_23950 = G__23972;
chunk__22534_23951 = G__23973;
count__22535_23952 = G__23974;
i__22536_23953 = G__23975;
continue;
}
} else {
}
}
break;
}

return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (s__$1,p__22603){
var vec__22604 = p__22603;
var script_tag = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22604,(0),null);
var script_body = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22604,(1),null);
return clojure.string.replace(s__$1,script_tag,"");
}),s,scripts);
});
shadow.dom.str__GT_fragment = (function shadow$dom$str__GT_fragment(s){
var el = document.createElement("div");
(el.innerHTML = s);

return (new shadow.dom.NativeColl(goog.dom.childrenToNode_(document,el)));
});
shadow.dom.node_name = (function shadow$dom$node_name(el){
return shadow.dom.dom_node(el).nodeName;
});
shadow.dom.ancestor_by_class = (function shadow$dom$ancestor_by_class(el,cls){
return goog.dom.getAncestorByClass(shadow.dom.dom_node(el),cls);
});
shadow.dom.ancestor_by_tag = (function shadow$dom$ancestor_by_tag(var_args){
var G__22644 = arguments.length;
switch (G__22644) {
case 2:
return shadow.dom.ancestor_by_tag.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return shadow.dom.ancestor_by_tag.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('')));

}
});

(shadow.dom.ancestor_by_tag.cljs$core$IFn$_invoke$arity$2 = (function (el,tag){
return goog.dom.getAncestorByTagNameAndClass(shadow.dom.dom_node(el),cljs.core.name(tag));
}));

(shadow.dom.ancestor_by_tag.cljs$core$IFn$_invoke$arity$3 = (function (el,tag,cls){
return goog.dom.getAncestorByTagNameAndClass(shadow.dom.dom_node(el),cljs.core.name(tag),cljs.core.name(cls));
}));

(shadow.dom.ancestor_by_tag.cljs$lang$maxFixedArity = 3);

shadow.dom.get_value = (function shadow$dom$get_value(dom){
return goog.dom.forms.getValue(shadow.dom.dom_node(dom));
});
shadow.dom.set_value = (function shadow$dom$set_value(dom,value){
return goog.dom.forms.setValue(shadow.dom.dom_node(dom),value);
});
shadow.dom.px = (function shadow$dom$px(value){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1((value | (0))),"px"].join('');
});
shadow.dom.pct = (function shadow$dom$pct(value){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(value),"%"].join('');
});
shadow.dom.remove_style_STAR_ = (function shadow$dom$remove_style_STAR_(el,style){
return el.style.removeProperty(cljs.core.name(style));
});
shadow.dom.remove_style = (function shadow$dom$remove_style(el,style){
var el__$1 = shadow.dom.dom_node(el);
return shadow.dom.remove_style_STAR_(el__$1,style);
});
shadow.dom.remove_styles = (function shadow$dom$remove_styles(el,style_keys){
var el__$1 = shadow.dom.dom_node(el);
var seq__22708 = cljs.core.seq(style_keys);
var chunk__22709 = null;
var count__22710 = (0);
var i__22711 = (0);
while(true){
if((i__22711 < count__22710)){
var it = chunk__22709.cljs$core$IIndexed$_nth$arity$2(null, i__22711);
shadow.dom.remove_style_STAR_(el__$1,it);


var G__24011 = seq__22708;
var G__24012 = chunk__22709;
var G__24013 = count__22710;
var G__24014 = (i__22711 + (1));
seq__22708 = G__24011;
chunk__22709 = G__24012;
count__22710 = G__24013;
i__22711 = G__24014;
continue;
} else {
var temp__5804__auto__ = cljs.core.seq(seq__22708);
if(temp__5804__auto__){
var seq__22708__$1 = temp__5804__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__22708__$1)){
var c__5525__auto__ = cljs.core.chunk_first(seq__22708__$1);
var G__24015 = cljs.core.chunk_rest(seq__22708__$1);
var G__24016 = c__5525__auto__;
var G__24017 = cljs.core.count(c__5525__auto__);
var G__24018 = (0);
seq__22708 = G__24015;
chunk__22709 = G__24016;
count__22710 = G__24017;
i__22711 = G__24018;
continue;
} else {
var it = cljs.core.first(seq__22708__$1);
shadow.dom.remove_style_STAR_(el__$1,it);


var G__24019 = cljs.core.next(seq__22708__$1);
var G__24020 = null;
var G__24021 = (0);
var G__24022 = (0);
seq__22708 = G__24019;
chunk__22709 = G__24020;
count__22710 = G__24021;
i__22711 = G__24022;
continue;
}
} else {
return null;
}
}
break;
}
});

/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IKVReduce}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
shadow.dom.Coordinate = (function (x,y,__meta,__extmap,__hash){
this.x = x;
this.y = y;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2230716170;
this.cljs$lang$protocol_mask$partition1$ = 139264;
});
(shadow.dom.Coordinate.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__5300__auto__,k__5301__auto__){
var self__ = this;
var this__5300__auto____$1 = this;
return this__5300__auto____$1.cljs$core$ILookup$_lookup$arity$3(null, k__5301__auto__,null);
}));

(shadow.dom.Coordinate.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__5302__auto__,k22735,else__5303__auto__){
var self__ = this;
var this__5302__auto____$1 = this;
var G__22747 = k22735;
var G__22747__$1 = (((G__22747 instanceof cljs.core.Keyword))?G__22747.fqn:null);
switch (G__22747__$1) {
case "x":
return self__.x;

break;
case "y":
return self__.y;

break;
default:
return cljs.core.get.cljs$core$IFn$_invoke$arity$3(self__.__extmap,k22735,else__5303__auto__);

}
}));

(shadow.dom.Coordinate.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = (function (this__5320__auto__,f__5321__auto__,init__5322__auto__){
var self__ = this;
var this__5320__auto____$1 = this;
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (ret__5323__auto__,p__22748){
var vec__22749 = p__22748;
var k__5324__auto__ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22749,(0),null);
var v__5325__auto__ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22749,(1),null);
return (f__5321__auto__.cljs$core$IFn$_invoke$arity$3 ? f__5321__auto__.cljs$core$IFn$_invoke$arity$3(ret__5323__auto__,k__5324__auto__,v__5325__auto__) : f__5321__auto__.call(null, ret__5323__auto__,k__5324__auto__,v__5325__auto__));
}),init__5322__auto__,this__5320__auto____$1);
}));

(shadow.dom.Coordinate.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__5315__auto__,writer__5316__auto__,opts__5317__auto__){
var self__ = this;
var this__5315__auto____$1 = this;
var pr_pair__5318__auto__ = (function (keyval__5319__auto__){
return cljs.core.pr_sequential_writer(writer__5316__auto__,cljs.core.pr_writer,""," ","",opts__5317__auto__,keyval__5319__auto__);
});
return cljs.core.pr_sequential_writer(writer__5316__auto__,pr_pair__5318__auto__,"#shadow.dom.Coordinate{",", ","}",opts__5317__auto__,cljs.core.concat.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"x","x",2099068185),self__.x],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"y","y",-1757859776),self__.y],null))], null),self__.__extmap));
}));

(shadow.dom.Coordinate.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__22734){
var self__ = this;
var G__22734__$1 = this;
return (new cljs.core.RecordIter((0),G__22734__$1,2,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"x","x",2099068185),new cljs.core.Keyword(null,"y","y",-1757859776)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator(self__.__extmap):cljs.core.nil_iter())));
}));

(shadow.dom.Coordinate.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__5298__auto__){
var self__ = this;
var this__5298__auto____$1 = this;
return self__.__meta;
}));

(shadow.dom.Coordinate.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__5295__auto__){
var self__ = this;
var this__5295__auto____$1 = this;
return (new shadow.dom.Coordinate(self__.x,self__.y,self__.__meta,self__.__extmap,self__.__hash));
}));

(shadow.dom.Coordinate.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__5304__auto__){
var self__ = this;
var this__5304__auto____$1 = this;
return (2 + cljs.core.count(self__.__extmap));
}));

(shadow.dom.Coordinate.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__5296__auto__){
var self__ = this;
var this__5296__auto____$1 = this;
var h__5111__auto__ = self__.__hash;
if((!((h__5111__auto__ == null)))){
return h__5111__auto__;
} else {
var h__5111__auto____$1 = (function (coll__5297__auto__){
return (145542109 ^ cljs.core.hash_unordered_coll(coll__5297__auto__));
})(this__5296__auto____$1);
(self__.__hash = h__5111__auto____$1);

return h__5111__auto____$1;
}
}));

(shadow.dom.Coordinate.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this22736,other22737){
var self__ = this;
var this22736__$1 = this;
return (((!((other22737 == null)))) && ((((this22736__$1.constructor === other22737.constructor)) && (((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this22736__$1.x,other22737.x)) && (((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this22736__$1.y,other22737.y)) && (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this22736__$1.__extmap,other22737.__extmap)))))))));
}));

(shadow.dom.Coordinate.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__5310__auto__,k__5311__auto__){
var self__ = this;
var this__5310__auto____$1 = this;
if(cljs.core.contains_QMARK_(new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"y","y",-1757859776),null,new cljs.core.Keyword(null,"x","x",2099068185),null], null), null),k__5311__auto__)){
return cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(cljs.core._with_meta(cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentArrayMap.EMPTY,this__5310__auto____$1),self__.__meta),k__5311__auto__);
} else {
return (new shadow.dom.Coordinate(self__.x,self__.y,self__.__meta,cljs.core.not_empty(cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(self__.__extmap,k__5311__auto__)),null));
}
}));

(shadow.dom.Coordinate.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = (function (this__5307__auto__,k22735){
var self__ = this;
var this__5307__auto____$1 = this;
var G__22766 = k22735;
var G__22766__$1 = (((G__22766 instanceof cljs.core.Keyword))?G__22766.fqn:null);
switch (G__22766__$1) {
case "x":
case "y":
return true;

break;
default:
return cljs.core.contains_QMARK_(self__.__extmap,k22735);

}
}));

(shadow.dom.Coordinate.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__5308__auto__,k__5309__auto__,G__22734){
var self__ = this;
var this__5308__auto____$1 = this;
var pred__22767 = cljs.core.keyword_identical_QMARK_;
var expr__22768 = k__5309__auto__;
if(cljs.core.truth_((pred__22767.cljs$core$IFn$_invoke$arity$2 ? pred__22767.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"x","x",2099068185),expr__22768) : pred__22767.call(null, new cljs.core.Keyword(null,"x","x",2099068185),expr__22768)))){
return (new shadow.dom.Coordinate(G__22734,self__.y,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_((pred__22767.cljs$core$IFn$_invoke$arity$2 ? pred__22767.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"y","y",-1757859776),expr__22768) : pred__22767.call(null, new cljs.core.Keyword(null,"y","y",-1757859776),expr__22768)))){
return (new shadow.dom.Coordinate(self__.x,G__22734,self__.__meta,self__.__extmap,null));
} else {
return (new shadow.dom.Coordinate(self__.x,self__.y,self__.__meta,cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(self__.__extmap,k__5309__auto__,G__22734),null));
}
}
}));

(shadow.dom.Coordinate.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__5313__auto__){
var self__ = this;
var this__5313__auto____$1 = this;
return cljs.core.seq(cljs.core.concat.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.MapEntry(new cljs.core.Keyword(null,"x","x",2099068185),self__.x,null)),(new cljs.core.MapEntry(new cljs.core.Keyword(null,"y","y",-1757859776),self__.y,null))], null),self__.__extmap));
}));

(shadow.dom.Coordinate.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__5299__auto__,G__22734){
var self__ = this;
var this__5299__auto____$1 = this;
return (new shadow.dom.Coordinate(self__.x,self__.y,G__22734,self__.__extmap,self__.__hash));
}));

(shadow.dom.Coordinate.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__5305__auto__,entry__5306__auto__){
var self__ = this;
var this__5305__auto____$1 = this;
if(cljs.core.vector_QMARK_(entry__5306__auto__)){
return this__5305__auto____$1.cljs$core$IAssociative$_assoc$arity$3(null, cljs.core._nth(entry__5306__auto__,(0)),cljs.core._nth(entry__5306__auto__,(1)));
} else {
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core._conj,this__5305__auto____$1,entry__5306__auto__);
}
}));

(shadow.dom.Coordinate.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"x","x",-555367584,null),new cljs.core.Symbol(null,"y","y",-117328249,null)], null);
}));

(shadow.dom.Coordinate.cljs$lang$type = true);

(shadow.dom.Coordinate.cljs$lang$ctorPrSeq = (function (this__5346__auto__){
return (new cljs.core.List(null,"shadow.dom/Coordinate",null,(1),null));
}));

(shadow.dom.Coordinate.cljs$lang$ctorPrWriter = (function (this__5346__auto__,writer__5347__auto__){
return cljs.core._write(writer__5347__auto__,"shadow.dom/Coordinate");
}));

/**
 * Positional factory function for shadow.dom/Coordinate.
 */
shadow.dom.__GT_Coordinate = (function shadow$dom$__GT_Coordinate(x,y){
return (new shadow.dom.Coordinate(x,y,null,null,null));
});

/**
 * Factory function for shadow.dom/Coordinate, taking a map of keywords to field values.
 */
shadow.dom.map__GT_Coordinate = (function shadow$dom$map__GT_Coordinate(G__22741){
var extmap__5342__auto__ = (function (){var G__22777 = cljs.core.dissoc.cljs$core$IFn$_invoke$arity$variadic(G__22741,new cljs.core.Keyword(null,"x","x",2099068185),cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.Keyword(null,"y","y",-1757859776)], 0));
if(cljs.core.record_QMARK_(G__22741)){
return cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentArrayMap.EMPTY,G__22777);
} else {
return G__22777;
}
})();
return (new shadow.dom.Coordinate(new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(G__22741),new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__22741),null,cljs.core.not_empty(extmap__5342__auto__),null));
});

shadow.dom.get_position = (function shadow$dom$get_position(el){
var pos = goog.style.getPosition(shadow.dom.dom_node(el));
return shadow.dom.__GT_Coordinate(pos.x,pos.y);
});
shadow.dom.get_client_position = (function shadow$dom$get_client_position(el){
var pos = goog.style.getClientPosition(shadow.dom.dom_node(el));
return shadow.dom.__GT_Coordinate(pos.x,pos.y);
});
shadow.dom.get_page_offset = (function shadow$dom$get_page_offset(el){
var pos = goog.style.getPageOffset(shadow.dom.dom_node(el));
return shadow.dom.__GT_Coordinate(pos.x,pos.y);
});

/**
* @constructor
 * @implements {cljs.core.IRecord}
 * @implements {cljs.core.IKVReduce}
 * @implements {cljs.core.IEquiv}
 * @implements {cljs.core.IHash}
 * @implements {cljs.core.ICollection}
 * @implements {cljs.core.ICounted}
 * @implements {cljs.core.ISeqable}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.ICloneable}
 * @implements {cljs.core.IPrintWithWriter}
 * @implements {cljs.core.IIterable}
 * @implements {cljs.core.IWithMeta}
 * @implements {cljs.core.IAssociative}
 * @implements {cljs.core.IMap}
 * @implements {cljs.core.ILookup}
*/
shadow.dom.Size = (function (w,h,__meta,__extmap,__hash){
this.w = w;
this.h = h;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2230716170;
this.cljs$lang$protocol_mask$partition1$ = 139264;
});
(shadow.dom.Size.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__5300__auto__,k__5301__auto__){
var self__ = this;
var this__5300__auto____$1 = this;
return this__5300__auto____$1.cljs$core$ILookup$_lookup$arity$3(null, k__5301__auto__,null);
}));

(shadow.dom.Size.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__5302__auto__,k22791,else__5303__auto__){
var self__ = this;
var this__5302__auto____$1 = this;
var G__22812 = k22791;
var G__22812__$1 = (((G__22812 instanceof cljs.core.Keyword))?G__22812.fqn:null);
switch (G__22812__$1) {
case "w":
return self__.w;

break;
case "h":
return self__.h;

break;
default:
return cljs.core.get.cljs$core$IFn$_invoke$arity$3(self__.__extmap,k22791,else__5303__auto__);

}
}));

(shadow.dom.Size.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = (function (this__5320__auto__,f__5321__auto__,init__5322__auto__){
var self__ = this;
var this__5320__auto____$1 = this;
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (ret__5323__auto__,p__22819){
var vec__22821 = p__22819;
var k__5324__auto__ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22821,(0),null);
var v__5325__auto__ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22821,(1),null);
return (f__5321__auto__.cljs$core$IFn$_invoke$arity$3 ? f__5321__auto__.cljs$core$IFn$_invoke$arity$3(ret__5323__auto__,k__5324__auto__,v__5325__auto__) : f__5321__auto__.call(null, ret__5323__auto__,k__5324__auto__,v__5325__auto__));
}),init__5322__auto__,this__5320__auto____$1);
}));

(shadow.dom.Size.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__5315__auto__,writer__5316__auto__,opts__5317__auto__){
var self__ = this;
var this__5315__auto____$1 = this;
var pr_pair__5318__auto__ = (function (keyval__5319__auto__){
return cljs.core.pr_sequential_writer(writer__5316__auto__,cljs.core.pr_writer,""," ","",opts__5317__auto__,keyval__5319__auto__);
});
return cljs.core.pr_sequential_writer(writer__5316__auto__,pr_pair__5318__auto__,"#shadow.dom.Size{",", ","}",opts__5317__auto__,cljs.core.concat.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"w","w",354169001),self__.w],null)),(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"h","h",1109658740),self__.h],null))], null),self__.__extmap));
}));

(shadow.dom.Size.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__22790){
var self__ = this;
var G__22790__$1 = this;
return (new cljs.core.RecordIter((0),G__22790__$1,2,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"w","w",354169001),new cljs.core.Keyword(null,"h","h",1109658740)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator(self__.__extmap):cljs.core.nil_iter())));
}));

(shadow.dom.Size.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__5298__auto__){
var self__ = this;
var this__5298__auto____$1 = this;
return self__.__meta;
}));

(shadow.dom.Size.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__5295__auto__){
var self__ = this;
var this__5295__auto____$1 = this;
return (new shadow.dom.Size(self__.w,self__.h,self__.__meta,self__.__extmap,self__.__hash));
}));

(shadow.dom.Size.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__5304__auto__){
var self__ = this;
var this__5304__auto____$1 = this;
return (2 + cljs.core.count(self__.__extmap));
}));

(shadow.dom.Size.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__5296__auto__){
var self__ = this;
var this__5296__auto____$1 = this;
var h__5111__auto__ = self__.__hash;
if((!((h__5111__auto__ == null)))){
return h__5111__auto__;
} else {
var h__5111__auto____$1 = (function (coll__5297__auto__){
return (-1228019642 ^ cljs.core.hash_unordered_coll(coll__5297__auto__));
})(this__5296__auto____$1);
(self__.__hash = h__5111__auto____$1);

return h__5111__auto____$1;
}
}));

(shadow.dom.Size.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this22792,other22793){
var self__ = this;
var this22792__$1 = this;
return (((!((other22793 == null)))) && ((((this22792__$1.constructor === other22793.constructor)) && (((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this22792__$1.w,other22793.w)) && (((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this22792__$1.h,other22793.h)) && (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this22792__$1.__extmap,other22793.__extmap)))))))));
}));

(shadow.dom.Size.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__5310__auto__,k__5311__auto__){
var self__ = this;
var this__5310__auto____$1 = this;
if(cljs.core.contains_QMARK_(new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"w","w",354169001),null,new cljs.core.Keyword(null,"h","h",1109658740),null], null), null),k__5311__auto__)){
return cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(cljs.core._with_meta(cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentArrayMap.EMPTY,this__5310__auto____$1),self__.__meta),k__5311__auto__);
} else {
return (new shadow.dom.Size(self__.w,self__.h,self__.__meta,cljs.core.not_empty(cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(self__.__extmap,k__5311__auto__)),null));
}
}));

(shadow.dom.Size.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = (function (this__5307__auto__,k22791){
var self__ = this;
var this__5307__auto____$1 = this;
var G__22864 = k22791;
var G__22864__$1 = (((G__22864 instanceof cljs.core.Keyword))?G__22864.fqn:null);
switch (G__22864__$1) {
case "w":
case "h":
return true;

break;
default:
return cljs.core.contains_QMARK_(self__.__extmap,k22791);

}
}));

(shadow.dom.Size.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__5308__auto__,k__5309__auto__,G__22790){
var self__ = this;
var this__5308__auto____$1 = this;
var pred__22871 = cljs.core.keyword_identical_QMARK_;
var expr__22872 = k__5309__auto__;
if(cljs.core.truth_((pred__22871.cljs$core$IFn$_invoke$arity$2 ? pred__22871.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"w","w",354169001),expr__22872) : pred__22871.call(null, new cljs.core.Keyword(null,"w","w",354169001),expr__22872)))){
return (new shadow.dom.Size(G__22790,self__.h,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_((pred__22871.cljs$core$IFn$_invoke$arity$2 ? pred__22871.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"h","h",1109658740),expr__22872) : pred__22871.call(null, new cljs.core.Keyword(null,"h","h",1109658740),expr__22872)))){
return (new shadow.dom.Size(self__.w,G__22790,self__.__meta,self__.__extmap,null));
} else {
return (new shadow.dom.Size(self__.w,self__.h,self__.__meta,cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(self__.__extmap,k__5309__auto__,G__22790),null));
}
}
}));

(shadow.dom.Size.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__5313__auto__){
var self__ = this;
var this__5313__auto____$1 = this;
return cljs.core.seq(cljs.core.concat.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.MapEntry(new cljs.core.Keyword(null,"w","w",354169001),self__.w,null)),(new cljs.core.MapEntry(new cljs.core.Keyword(null,"h","h",1109658740),self__.h,null))], null),self__.__extmap));
}));

(shadow.dom.Size.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__5299__auto__,G__22790){
var self__ = this;
var this__5299__auto____$1 = this;
return (new shadow.dom.Size(self__.w,self__.h,G__22790,self__.__extmap,self__.__hash));
}));

(shadow.dom.Size.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__5305__auto__,entry__5306__auto__){
var self__ = this;
var this__5305__auto____$1 = this;
if(cljs.core.vector_QMARK_(entry__5306__auto__)){
return this__5305__auto____$1.cljs$core$IAssociative$_assoc$arity$3(null, cljs.core._nth(entry__5306__auto__,(0)),cljs.core._nth(entry__5306__auto__,(1)));
} else {
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core._conj,this__5305__auto____$1,entry__5306__auto__);
}
}));

(shadow.dom.Size.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"w","w",1994700528,null),new cljs.core.Symbol(null,"h","h",-1544777029,null)], null);
}));

(shadow.dom.Size.cljs$lang$type = true);

(shadow.dom.Size.cljs$lang$ctorPrSeq = (function (this__5346__auto__){
return (new cljs.core.List(null,"shadow.dom/Size",null,(1),null));
}));

(shadow.dom.Size.cljs$lang$ctorPrWriter = (function (this__5346__auto__,writer__5347__auto__){
return cljs.core._write(writer__5347__auto__,"shadow.dom/Size");
}));

/**
 * Positional factory function for shadow.dom/Size.
 */
shadow.dom.__GT_Size = (function shadow$dom$__GT_Size(w,h){
return (new shadow.dom.Size(w,h,null,null,null));
});

/**
 * Factory function for shadow.dom/Size, taking a map of keywords to field values.
 */
shadow.dom.map__GT_Size = (function shadow$dom$map__GT_Size(G__22794){
var extmap__5342__auto__ = (function (){var G__22904 = cljs.core.dissoc.cljs$core$IFn$_invoke$arity$variadic(G__22794,new cljs.core.Keyword(null,"w","w",354169001),cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.Keyword(null,"h","h",1109658740)], 0));
if(cljs.core.record_QMARK_(G__22794)){
return cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentArrayMap.EMPTY,G__22904);
} else {
return G__22904;
}
})();
return (new shadow.dom.Size(new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__22794),new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__22794),null,cljs.core.not_empty(extmap__5342__auto__),null));
});

shadow.dom.size__GT_clj = (function shadow$dom$size__GT_clj(size){
return (new shadow.dom.Size(size.width,size.height,null,null,null));
});
shadow.dom.get_size = (function shadow$dom$get_size(el){
return shadow.dom.size__GT_clj(goog.style.getSize(shadow.dom.dom_node(el)));
});
shadow.dom.get_height = (function shadow$dom$get_height(el){
return shadow.dom.get_size(el).h;
});
shadow.dom.get_viewport_size = (function shadow$dom$get_viewport_size(){
return shadow.dom.size__GT_clj(goog.dom.getViewportSize());
});
shadow.dom.first_child = (function shadow$dom$first_child(el){
return (shadow.dom.dom_node(el).children[(0)]);
});
shadow.dom.select_option_values = (function shadow$dom$select_option_values(el){
var native$ = shadow.dom.dom_node(el);
var opts = (native$["options"]);
var a__5590__auto__ = opts;
var l__5591__auto__ = a__5590__auto__.length;
var i = (0);
var ret = cljs.core.PersistentVector.EMPTY;
while(true){
if((i < l__5591__auto__)){
var G__24159 = (i + (1));
var G__24160 = cljs.core.conj.cljs$core$IFn$_invoke$arity$2(ret,(opts[i]["value"]));
i = G__24159;
ret = G__24160;
continue;
} else {
return ret;
}
break;
}
});
shadow.dom.build_url = (function shadow$dom$build_url(path,query_params){
if(cljs.core.empty_QMARK_(query_params)){
return path;
} else {
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(path),"?",clojure.string.join.cljs$core$IFn$_invoke$arity$2("&",cljs.core.map.cljs$core$IFn$_invoke$arity$2((function (p__22961){
var vec__22962 = p__22961;
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22962,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__22962,(1),null);
return [cljs.core.name(k),"=",cljs.core.str.cljs$core$IFn$_invoke$arity$1(encodeURIComponent(cljs.core.str.cljs$core$IFn$_invoke$arity$1(v)))].join('');
}),query_params))].join('');
}
});
shadow.dom.redirect = (function shadow$dom$redirect(var_args){
var G__22970 = arguments.length;
switch (G__22970) {
case 1:
return shadow.dom.redirect.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return shadow.dom.redirect.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('')));

}
});

(shadow.dom.redirect.cljs$core$IFn$_invoke$arity$1 = (function (path){
return shadow.dom.redirect.cljs$core$IFn$_invoke$arity$2(path,cljs.core.PersistentArrayMap.EMPTY);
}));

(shadow.dom.redirect.cljs$core$IFn$_invoke$arity$2 = (function (path,query_params){
return (document["location"]["href"] = shadow.dom.build_url(path,query_params));
}));

(shadow.dom.redirect.cljs$lang$maxFixedArity = 2);

shadow.dom.reload_BANG_ = (function shadow$dom$reload_BANG_(){
return (document.location.href = document.location.href);
});
shadow.dom.tag_name = (function shadow$dom$tag_name(el){
var dom = shadow.dom.dom_node(el);
return dom.tagName;
});
shadow.dom.insert_after = (function shadow$dom$insert_after(ref,new$){
var new_node = shadow.dom.dom_node(new$);
goog.dom.insertSiblingAfter(new_node,shadow.dom.dom_node(ref));

return new_node;
});
shadow.dom.insert_before = (function shadow$dom$insert_before(ref,new$){
var new_node = shadow.dom.dom_node(new$);
goog.dom.insertSiblingBefore(new_node,shadow.dom.dom_node(ref));

return new_node;
});
shadow.dom.insert_first = (function shadow$dom$insert_first(ref,new$){
var temp__5802__auto__ = shadow.dom.dom_node(ref).firstChild;
if(cljs.core.truth_(temp__5802__auto__)){
var child = temp__5802__auto__;
return shadow.dom.insert_before(child,new$);
} else {
return shadow.dom.append.cljs$core$IFn$_invoke$arity$2(ref,new$);
}
});
shadow.dom.index_of = (function shadow$dom$index_of(el){
var el__$1 = shadow.dom.dom_node(el);
var i = (0);
while(true){
var ps = el__$1.previousSibling;
if((ps == null)){
return i;
} else {
var G__24181 = ps;
var G__24182 = (i + (1));
el__$1 = G__24181;
i = G__24182;
continue;
}
break;
}
});
shadow.dom.get_parent = (function shadow$dom$get_parent(el){
return goog.dom.getParentElement(shadow.dom.dom_node(el));
});
shadow.dom.parents = (function shadow$dom$parents(el){
var parent = shadow.dom.get_parent(el);
if(cljs.core.truth_(parent)){
return cljs.core.cons(parent,(new cljs.core.LazySeq(null,(function (){
return (shadow.dom.parents.cljs$core$IFn$_invoke$arity$1 ? shadow.dom.parents.cljs$core$IFn$_invoke$arity$1(parent) : shadow.dom.parents.call(null, parent));
}),null,null)));
} else {
return null;
}
});
shadow.dom.matches = (function shadow$dom$matches(el,sel){
return shadow.dom.dom_node(el).matches(sel);
});
shadow.dom.get_next_sibling = (function shadow$dom$get_next_sibling(el){
return goog.dom.getNextElementSibling(shadow.dom.dom_node(el));
});
shadow.dom.get_previous_sibling = (function shadow$dom$get_previous_sibling(el){
return goog.dom.getPreviousElementSibling(shadow.dom.dom_node(el));
});
shadow.dom.xmlns = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(new cljs.core.PersistentArrayMap(null, 2, ["svg","http://www.w3.org/2000/svg","xlink","http://www.w3.org/1999/xlink"], null));
shadow.dom.create_svg_node = (function shadow$dom$create_svg_node(tag_def,props){
var vec__23058 = shadow.dom.parse_tag(tag_def);
var tag_name = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__23058,(0),null);
var tag_id = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__23058,(1),null);
var tag_classes = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__23058,(2),null);
var el = document.createElementNS("http://www.w3.org/2000/svg",tag_name);
if(cljs.core.truth_(tag_id)){
el.setAttribute("id",tag_id);
} else {
}

if(cljs.core.truth_(tag_classes)){
el.setAttribute("class",shadow.dom.merge_class_string(new cljs.core.Keyword(null,"class","class",-2030961996).cljs$core$IFn$_invoke$arity$1(props),tag_classes));
} else {
}

var seq__23072_24190 = cljs.core.seq(props);
var chunk__23073_24191 = null;
var count__23074_24192 = (0);
var i__23075_24193 = (0);
while(true){
if((i__23075_24193 < count__23074_24192)){
var vec__23108_24196 = chunk__23073_24191.cljs$core$IIndexed$_nth$arity$2(null, i__23075_24193);
var k_24197 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__23108_24196,(0),null);
var v_24198 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__23108_24196,(1),null);
el.setAttributeNS((function (){var temp__5804__auto__ = cljs.core.namespace(k_24197);
if(cljs.core.truth_(temp__5804__auto__)){
var ns = temp__5804__auto__;
return cljs.core.get.cljs$core$IFn$_invoke$arity$2(cljs.core.deref(shadow.dom.xmlns),ns);
} else {
return null;
}
})(),cljs.core.name(k_24197),v_24198);


var G__24201 = seq__23072_24190;
var G__24202 = chunk__23073_24191;
var G__24203 = count__23074_24192;
var G__24204 = (i__23075_24193 + (1));
seq__23072_24190 = G__24201;
chunk__23073_24191 = G__24202;
count__23074_24192 = G__24203;
i__23075_24193 = G__24204;
continue;
} else {
var temp__5804__auto___24205 = cljs.core.seq(seq__23072_24190);
if(temp__5804__auto___24205){
var seq__23072_24206__$1 = temp__5804__auto___24205;
if(cljs.core.chunked_seq_QMARK_(seq__23072_24206__$1)){
var c__5525__auto___24207 = cljs.core.chunk_first(seq__23072_24206__$1);
var G__24208 = cljs.core.chunk_rest(seq__23072_24206__$1);
var G__24209 = c__5525__auto___24207;
var G__24210 = cljs.core.count(c__5525__auto___24207);
var G__24211 = (0);
seq__23072_24190 = G__24208;
chunk__23073_24191 = G__24209;
count__23074_24192 = G__24210;
i__23075_24193 = G__24211;
continue;
} else {
var vec__23129_24212 = cljs.core.first(seq__23072_24206__$1);
var k_24213 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__23129_24212,(0),null);
var v_24214 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__23129_24212,(1),null);
el.setAttributeNS((function (){var temp__5804__auto____$1 = cljs.core.namespace(k_24213);
if(cljs.core.truth_(temp__5804__auto____$1)){
var ns = temp__5804__auto____$1;
return cljs.core.get.cljs$core$IFn$_invoke$arity$2(cljs.core.deref(shadow.dom.xmlns),ns);
} else {
return null;
}
})(),cljs.core.name(k_24213),v_24214);


var G__24216 = cljs.core.next(seq__23072_24206__$1);
var G__24217 = null;
var G__24218 = (0);
var G__24219 = (0);
seq__23072_24190 = G__24216;
chunk__23073_24191 = G__24217;
count__23074_24192 = G__24218;
i__23075_24193 = G__24219;
continue;
}
} else {
}
}
break;
}

return el;
});
shadow.dom.svg_node = (function shadow$dom$svg_node(el){
if((el == null)){
return null;
} else {
if((((!((el == null))))?((((false) || ((cljs.core.PROTOCOL_SENTINEL === el.shadow$dom$SVGElement$))))?true:false):false)){
return el.shadow$dom$SVGElement$_to_svg$arity$1(null, );
} else {
return el;

}
}
});
shadow.dom.make_svg_node = (function shadow$dom$make_svg_node(structure){
var vec__23155 = shadow.dom.destructure_node(shadow.dom.create_svg_node,structure);
var node = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__23155,(0),null);
var node_children = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__23155,(1),null);
var seq__23161_24221 = cljs.core.seq(node_children);
var chunk__23163_24222 = null;
var count__23164_24223 = (0);
var i__23165_24224 = (0);
while(true){
if((i__23165_24224 < count__23164_24223)){
var child_struct_24225 = chunk__23163_24222.cljs$core$IIndexed$_nth$arity$2(null, i__23165_24224);
if((!((child_struct_24225 == null)))){
if(typeof child_struct_24225 === 'string'){
var text_24226 = (node["textContent"]);
(node["textContent"] = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(text_24226),child_struct_24225].join(''));
} else {
var children_24229 = shadow.dom.svg_node(child_struct_24225);
if(cljs.core.seq_QMARK_(children_24229)){
var seq__23279_24230 = cljs.core.seq(children_24229);
var chunk__23281_24231 = null;
var count__23282_24232 = (0);
var i__23283_24233 = (0);
while(true){
if((i__23283_24233 < count__23282_24232)){
var child_24236 = chunk__23281_24231.cljs$core$IIndexed$_nth$arity$2(null, i__23283_24233);
if(cljs.core.truth_(child_24236)){
node.appendChild(child_24236);


var G__24237 = seq__23279_24230;
var G__24238 = chunk__23281_24231;
var G__24239 = count__23282_24232;
var G__24240 = (i__23283_24233 + (1));
seq__23279_24230 = G__24237;
chunk__23281_24231 = G__24238;
count__23282_24232 = G__24239;
i__23283_24233 = G__24240;
continue;
} else {
var G__24241 = seq__23279_24230;
var G__24242 = chunk__23281_24231;
var G__24243 = count__23282_24232;
var G__24244 = (i__23283_24233 + (1));
seq__23279_24230 = G__24241;
chunk__23281_24231 = G__24242;
count__23282_24232 = G__24243;
i__23283_24233 = G__24244;
continue;
}
} else {
var temp__5804__auto___24246 = cljs.core.seq(seq__23279_24230);
if(temp__5804__auto___24246){
var seq__23279_24249__$1 = temp__5804__auto___24246;
if(cljs.core.chunked_seq_QMARK_(seq__23279_24249__$1)){
var c__5525__auto___24250 = cljs.core.chunk_first(seq__23279_24249__$1);
var G__24252 = cljs.core.chunk_rest(seq__23279_24249__$1);
var G__24253 = c__5525__auto___24250;
var G__24254 = cljs.core.count(c__5525__auto___24250);
var G__24255 = (0);
seq__23279_24230 = G__24252;
chunk__23281_24231 = G__24253;
count__23282_24232 = G__24254;
i__23283_24233 = G__24255;
continue;
} else {
var child_24256 = cljs.core.first(seq__23279_24249__$1);
if(cljs.core.truth_(child_24256)){
node.appendChild(child_24256);


var G__24259 = cljs.core.next(seq__23279_24249__$1);
var G__24260 = null;
var G__24261 = (0);
var G__24262 = (0);
seq__23279_24230 = G__24259;
chunk__23281_24231 = G__24260;
count__23282_24232 = G__24261;
i__23283_24233 = G__24262;
continue;
} else {
var G__24263 = cljs.core.next(seq__23279_24249__$1);
var G__24264 = null;
var G__24265 = (0);
var G__24266 = (0);
seq__23279_24230 = G__24263;
chunk__23281_24231 = G__24264;
count__23282_24232 = G__24265;
i__23283_24233 = G__24266;
continue;
}
}
} else {
}
}
break;
}
} else {
node.appendChild(children_24229);
}
}


var G__24269 = seq__23161_24221;
var G__24270 = chunk__23163_24222;
var G__24271 = count__23164_24223;
var G__24272 = (i__23165_24224 + (1));
seq__23161_24221 = G__24269;
chunk__23163_24222 = G__24270;
count__23164_24223 = G__24271;
i__23165_24224 = G__24272;
continue;
} else {
var G__24279 = seq__23161_24221;
var G__24280 = chunk__23163_24222;
var G__24281 = count__23164_24223;
var G__24282 = (i__23165_24224 + (1));
seq__23161_24221 = G__24279;
chunk__23163_24222 = G__24280;
count__23164_24223 = G__24281;
i__23165_24224 = G__24282;
continue;
}
} else {
var temp__5804__auto___24283 = cljs.core.seq(seq__23161_24221);
if(temp__5804__auto___24283){
var seq__23161_24291__$1 = temp__5804__auto___24283;
if(cljs.core.chunked_seq_QMARK_(seq__23161_24291__$1)){
var c__5525__auto___24293 = cljs.core.chunk_first(seq__23161_24291__$1);
var G__24296 = cljs.core.chunk_rest(seq__23161_24291__$1);
var G__24297 = c__5525__auto___24293;
var G__24298 = cljs.core.count(c__5525__auto___24293);
var G__24299 = (0);
seq__23161_24221 = G__24296;
chunk__23163_24222 = G__24297;
count__23164_24223 = G__24298;
i__23165_24224 = G__24299;
continue;
} else {
var child_struct_24306 = cljs.core.first(seq__23161_24291__$1);
if((!((child_struct_24306 == null)))){
if(typeof child_struct_24306 === 'string'){
var text_24310 = (node["textContent"]);
(node["textContent"] = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(text_24310),child_struct_24306].join(''));
} else {
var children_24317 = shadow.dom.svg_node(child_struct_24306);
if(cljs.core.seq_QMARK_(children_24317)){
var seq__23333_24319 = cljs.core.seq(children_24317);
var chunk__23335_24320 = null;
var count__23336_24321 = (0);
var i__23337_24322 = (0);
while(true){
if((i__23337_24322 < count__23336_24321)){
var child_24328 = chunk__23335_24320.cljs$core$IIndexed$_nth$arity$2(null, i__23337_24322);
if(cljs.core.truth_(child_24328)){
node.appendChild(child_24328);


var G__24333 = seq__23333_24319;
var G__24334 = chunk__23335_24320;
var G__24335 = count__23336_24321;
var G__24336 = (i__23337_24322 + (1));
seq__23333_24319 = G__24333;
chunk__23335_24320 = G__24334;
count__23336_24321 = G__24335;
i__23337_24322 = G__24336;
continue;
} else {
var G__24337 = seq__23333_24319;
var G__24338 = chunk__23335_24320;
var G__24339 = count__23336_24321;
var G__24340 = (i__23337_24322 + (1));
seq__23333_24319 = G__24337;
chunk__23335_24320 = G__24338;
count__23336_24321 = G__24339;
i__23337_24322 = G__24340;
continue;
}
} else {
var temp__5804__auto___24343__$1 = cljs.core.seq(seq__23333_24319);
if(temp__5804__auto___24343__$1){
var seq__23333_24344__$1 = temp__5804__auto___24343__$1;
if(cljs.core.chunked_seq_QMARK_(seq__23333_24344__$1)){
var c__5525__auto___24347 = cljs.core.chunk_first(seq__23333_24344__$1);
var G__24348 = cljs.core.chunk_rest(seq__23333_24344__$1);
var G__24349 = c__5525__auto___24347;
var G__24350 = cljs.core.count(c__5525__auto___24347);
var G__24351 = (0);
seq__23333_24319 = G__24348;
chunk__23335_24320 = G__24349;
count__23336_24321 = G__24350;
i__23337_24322 = G__24351;
continue;
} else {
var child_24354 = cljs.core.first(seq__23333_24344__$1);
if(cljs.core.truth_(child_24354)){
node.appendChild(child_24354);


var G__24358 = cljs.core.next(seq__23333_24344__$1);
var G__24359 = null;
var G__24360 = (0);
var G__24361 = (0);
seq__23333_24319 = G__24358;
chunk__23335_24320 = G__24359;
count__23336_24321 = G__24360;
i__23337_24322 = G__24361;
continue;
} else {
var G__24367 = cljs.core.next(seq__23333_24344__$1);
var G__24368 = null;
var G__24369 = (0);
var G__24370 = (0);
seq__23333_24319 = G__24367;
chunk__23335_24320 = G__24368;
count__23336_24321 = G__24369;
i__23337_24322 = G__24370;
continue;
}
}
} else {
}
}
break;
}
} else {
node.appendChild(children_24317);
}
}


var G__24398 = cljs.core.next(seq__23161_24291__$1);
var G__24399 = null;
var G__24400 = (0);
var G__24401 = (0);
seq__23161_24221 = G__24398;
chunk__23163_24222 = G__24399;
count__23164_24223 = G__24400;
i__23165_24224 = G__24401;
continue;
} else {
var G__24402 = cljs.core.next(seq__23161_24291__$1);
var G__24403 = null;
var G__24404 = (0);
var G__24405 = (0);
seq__23161_24221 = G__24402;
chunk__23163_24222 = G__24403;
count__23164_24223 = G__24404;
i__23165_24224 = G__24405;
continue;
}
}
} else {
}
}
break;
}

return node;
});
(shadow.dom.SVGElement["string"] = true);

(shadow.dom._to_svg["string"] = (function (this$){
if((this$ instanceof cljs.core.Keyword)){
return shadow.dom.make_svg_node(new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [this$], null));
} else {
throw cljs.core.ex_info.cljs$core$IFn$_invoke$arity$2("strings cannot be in svgs",new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"this","this",-611633625),this$], null));
}
}));

(cljs.core.PersistentVector.prototype.shadow$dom$SVGElement$ = cljs.core.PROTOCOL_SENTINEL);

(cljs.core.PersistentVector.prototype.shadow$dom$SVGElement$_to_svg$arity$1 = (function (this$){
var this$__$1 = this;
return shadow.dom.make_svg_node(this$__$1);
}));

(cljs.core.LazySeq.prototype.shadow$dom$SVGElement$ = cljs.core.PROTOCOL_SENTINEL);

(cljs.core.LazySeq.prototype.shadow$dom$SVGElement$_to_svg$arity$1 = (function (this$){
var this$__$1 = this;
return cljs.core.map.cljs$core$IFn$_invoke$arity$2(shadow.dom._to_svg,this$__$1);
}));

(shadow.dom.SVGElement["null"] = true);

(shadow.dom._to_svg["null"] = (function (_){
return null;
}));
shadow.dom.svg = (function shadow$dom$svg(var_args){
var args__5732__auto__ = [];
var len__5726__auto___24443 = arguments.length;
var i__5727__auto___24445 = (0);
while(true){
if((i__5727__auto___24445 < len__5726__auto___24443)){
args__5732__auto__.push((arguments[i__5727__auto___24445]));

var G__24449 = (i__5727__auto___24445 + (1));
i__5727__auto___24445 = G__24449;
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 shadow.dom.svg.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__5733__auto__);
});

(shadow.dom.svg.cljs$core$IFn$_invoke$arity$variadic = (function (attrs,children){
return shadow.dom._to_svg(cljs.core.vec(cljs.core.concat.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"svg","svg",856789142),attrs], null),children)));
}));

(shadow.dom.svg.cljs$lang$maxFixedArity = (1));

/** @this {Function} */
(shadow.dom.svg.cljs$lang$applyTo = (function (seq23402){
var G__23403 = cljs.core.first(seq23402);
var seq23402__$1 = cljs.core.next(seq23402);
var self__5711__auto__ = this;
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__23403,seq23402__$1);
}));


//# sourceMappingURL=shadow.dom.js.map
