import "./cljs_env.js";
goog.provide('shadow.dom');
shadow.dom.transition_supported_QMARK_ = (((typeof window !== 'undefined'))?goog.style.transition.isSupported():null);

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

var shadow$dom$IElement$_to_dom$dyn_77551 = (function (this$){
var x__4521__auto__ = (((this$ == null))?null:this$);
var m__4522__auto__ = (shadow.dom._to_dom[goog.typeOf(x__4521__auto__)]);
if((!((m__4522__auto__ == null)))){
return (m__4522__auto__.cljs$core$IFn$_invoke$arity$1 ? m__4522__auto__.cljs$core$IFn$_invoke$arity$1(this$) : m__4522__auto__.call(null,this$));
} else {
var m__4519__auto__ = (shadow.dom._to_dom["_"]);
if((!((m__4519__auto__ == null)))){
return (m__4519__auto__.cljs$core$IFn$_invoke$arity$1 ? m__4519__auto__.cljs$core$IFn$_invoke$arity$1(this$) : m__4519__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_77551(this$);
}
});


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

var shadow$dom$SVGElement$_to_svg$dyn_77552 = (function (this$){
var x__4521__auto__ = (((this$ == null))?null:this$);
var m__4522__auto__ = (shadow.dom._to_svg[goog.typeOf(x__4521__auto__)]);
if((!((m__4522__auto__ == null)))){
return (m__4522__auto__.cljs$core$IFn$_invoke$arity$1 ? m__4522__auto__.cljs$core$IFn$_invoke$arity$1(this$) : m__4522__auto__.call(null,this$));
} else {
var m__4519__auto__ = (shadow.dom._to_svg["_"]);
if((!((m__4519__auto__ == null)))){
return (m__4519__auto__.cljs$core$IFn$_invoke$arity$1 ? m__4519__auto__.cljs$core$IFn$_invoke$arity$1(this$) : m__4519__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_77552(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__76720 = coll;
var G__76721 = (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__76720,G__76721) : shadow.dom.lazy_native_coll_seq.call(null,G__76720,G__76721));
})());
}),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__4223__auto__ = (self__.coll[n]);
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__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__4461__auto__,writer__4462__auto__,opt__4463__auto__){
return cljs.core._write(writer__4462__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__76776 = arguments.length;
switch (G__76776) {
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__76787 = arguments.length;
switch (G__76787) {
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__76799 = arguments.length;
switch (G__76799) {
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__76811 = arguments.length;
switch (G__76811) {
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__76825 = arguments.length;
switch (G__76825) {
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__76840 = arguments.length;
switch (G__76840) {
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__4223__auto__ = (!((typeof document !== 'undefined')));
if(or__4223__auto__){
return or__4223__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 (e76850){if((e76850 instanceof Object)){
var e = e76850;
return console.log("didnt support attachEvent",el,e);
} else {
throw e76850;

}
}}));
shadow.dom.dom_listen_remove = (cljs.core.truth_((function (){var or__4223__auto__ = (!((typeof document !== 'undefined')));
if(or__4223__auto__){
return or__4223__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__76861 = cljs.core.seq(shadow.dom.query.cljs$core$IFn$_invoke$arity$2(selector,root_el));
var chunk__76862 = null;
var count__76863 = (0);
var i__76864 = (0);
while(true){
if((i__76864 < count__76863)){
var el = chunk__76862.cljs$core$IIndexed$_nth$arity$2(null,i__76864);
var handler_77559__$1 = ((function (seq__76861,chunk__76862,count__76863,i__76864,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__76861,chunk__76862,count__76863,i__76864,el))
;
shadow.dom.dom_listen(el,cljs.core.name(ev),handler_77559__$1);


var G__77560 = seq__76861;
var G__77561 = chunk__76862;
var G__77562 = count__76863;
var G__77563 = (i__76864 + (1));
seq__76861 = G__77560;
chunk__76862 = G__77561;
count__76863 = G__77562;
i__76864 = G__77563;
continue;
} else {
var temp__5753__auto__ = cljs.core.seq(seq__76861);
if(temp__5753__auto__){
var seq__76861__$1 = temp__5753__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__76861__$1)){
var c__4649__auto__ = cljs.core.chunk_first(seq__76861__$1);
var G__77564 = cljs.core.chunk_rest(seq__76861__$1);
var G__77565 = c__4649__auto__;
var G__77566 = cljs.core.count(c__4649__auto__);
var G__77567 = (0);
seq__76861 = G__77564;
chunk__76862 = G__77565;
count__76863 = G__77566;
i__76864 = G__77567;
continue;
} else {
var el = cljs.core.first(seq__76861__$1);
var handler_77568__$1 = ((function (seq__76861,chunk__76862,count__76863,i__76864,el,seq__76861__$1,temp__5753__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__76861,chunk__76862,count__76863,i__76864,el,seq__76861__$1,temp__5753__auto__))
;
shadow.dom.dom_listen(el,cljs.core.name(ev),handler_77568__$1);


var G__77569 = cljs.core.next(seq__76861__$1);
var G__77570 = null;
var G__77571 = (0);
var G__77572 = (0);
seq__76861 = G__77569;
chunk__76862 = G__77570;
count__76863 = G__77571;
i__76864 = G__77572;
continue;
}
} else {
return null;
}
}
break;
}
});
shadow.dom.on = (function shadow$dom$on(var_args){
var G__76881 = arguments.length;
switch (G__76881) {
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__76902 = cljs.core.seq(events);
var chunk__76903 = null;
var count__76904 = (0);
var i__76905 = (0);
while(true){
if((i__76905 < count__76904)){
var vec__76935 = chunk__76903.cljs$core$IIndexed$_nth$arity$2(null,i__76905);
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__76935,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__76935,(1),null);
shadow.dom.on.cljs$core$IFn$_invoke$arity$3(el,k,v);


var G__77574 = seq__76902;
var G__77575 = chunk__76903;
var G__77576 = count__76904;
var G__77577 = (i__76905 + (1));
seq__76902 = G__77574;
chunk__76903 = G__77575;
count__76904 = G__77576;
i__76905 = G__77577;
continue;
} else {
var temp__5753__auto__ = cljs.core.seq(seq__76902);
if(temp__5753__auto__){
var seq__76902__$1 = temp__5753__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__76902__$1)){
var c__4649__auto__ = cljs.core.chunk_first(seq__76902__$1);
var G__77578 = cljs.core.chunk_rest(seq__76902__$1);
var G__77579 = c__4649__auto__;
var G__77580 = cljs.core.count(c__4649__auto__);
var G__77581 = (0);
seq__76902 = G__77578;
chunk__76903 = G__77579;
count__76904 = G__77580;
i__76905 = G__77581;
continue;
} else {
var vec__76940 = cljs.core.first(seq__76902__$1);
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__76940,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__76940,(1),null);
shadow.dom.on.cljs$core$IFn$_invoke$arity$3(el,k,v);


var G__77582 = cljs.core.next(seq__76902__$1);
var G__77583 = null;
var G__77584 = (0);
var G__77585 = (0);
seq__76902 = G__77582;
chunk__76903 = G__77583;
count__76904 = G__77584;
i__76905 = G__77585;
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__76945 = cljs.core.seq(styles);
var chunk__76946 = null;
var count__76947 = (0);
var i__76948 = (0);
while(true){
if((i__76948 < count__76947)){
var vec__76959 = chunk__76946.cljs$core$IIndexed$_nth$arity$2(null,i__76948);
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__76959,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__76959,(1),null);
goog.style.setStyle(dom,cljs.core.name(k),(((v == null))?"":v));


var G__77586 = seq__76945;
var G__77587 = chunk__76946;
var G__77588 = count__76947;
var G__77589 = (i__76948 + (1));
seq__76945 = G__77586;
chunk__76946 = G__77587;
count__76947 = G__77588;
i__76948 = G__77589;
continue;
} else {
var temp__5753__auto__ = cljs.core.seq(seq__76945);
if(temp__5753__auto__){
var seq__76945__$1 = temp__5753__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__76945__$1)){
var c__4649__auto__ = cljs.core.chunk_first(seq__76945__$1);
var G__77590 = cljs.core.chunk_rest(seq__76945__$1);
var G__77591 = c__4649__auto__;
var G__77592 = cljs.core.count(c__4649__auto__);
var G__77593 = (0);
seq__76945 = G__77590;
chunk__76946 = G__77591;
count__76947 = G__77592;
i__76948 = G__77593;
continue;
} else {
var vec__76979 = cljs.core.first(seq__76945__$1);
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__76979,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__76979,(1),null);
goog.style.setStyle(dom,cljs.core.name(k),(((v == null))?"":v));


var G__77594 = cljs.core.next(seq__76945__$1);
var G__77595 = null;
var G__77596 = (0);
var G__77597 = (0);
seq__76945 = G__77594;
chunk__76946 = G__77595;
count__76947 = G__77596;
i__76948 = G__77597;
continue;
}
} else {
return null;
}
}
break;
}
});
shadow.dom.set_attr_STAR_ = (function shadow$dom$set_attr_STAR_(el,key,value){
var G__77002_77598 = key;
var G__77002_77599__$1 = (((G__77002_77598 instanceof cljs.core.Keyword))?G__77002_77598.fqn:null);
switch (G__77002_77599__$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_77601 = cljs.core.name(key);
if(cljs.core.truth_((function (){var or__4223__auto__ = goog.string.startsWith(ks_77601,"data-");
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__auto__;
} else {
return goog.string.startsWith(ks_77601,"aria-");
}
})())){
el.setAttribute(ks_77601,value);
} else {
(el[ks_77601] = 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__77072){
var map__77073 = p__77072;
var map__77073__$1 = cljs.core.__destructure_map(map__77073);
var props = map__77073__$1;
var class$ = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__77073__$1,new cljs.core.Keyword(null,"class","class",-2030961996));
var tag_props = ({});
var vec__77079 = shadow.dom.parse_tag(tag_def);
var tag_name = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77079,(0),null);
var tag_id = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77079,(1),null);
var tag_classes = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77079,(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__77084 = goog.dom.createDom(tag_name,tag_props);
shadow.dom.set_attrs(G__77084,cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(props,new cljs.core.Keyword(null,"class","class",-2030961996)));

return G__77084;
});
shadow.dom.append = (function shadow$dom$append(var_args){
var G__77092 = arguments.length;
switch (G__77092) {
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__5753__auto__ = shadow.dom.dom_node(node);
if(cljs.core.truth_(temp__5753__auto__)){
var n = temp__5753__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__5753__auto__ = shadow.dom.dom_node(node);
if(cljs.core.truth_(temp__5753__auto__)){
var n = temp__5753__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__77106){
var vec__77107 = p__77106;
var seq__77108 = cljs.core.seq(vec__77107);
var first__77109 = cljs.core.first(seq__77108);
var seq__77108__$1 = cljs.core.next(seq__77108);
var nn = first__77109;
var first__77109__$1 = cljs.core.first(seq__77108__$1);
var seq__77108__$2 = cljs.core.next(seq__77108__$1);
var np = first__77109__$1;
var nc = seq__77108__$2;
var node = vec__77107;
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__77113 = nn;
var G__77114 = cljs.core.PersistentArrayMap.EMPTY;
return (create_fn.cljs$core$IFn$_invoke$arity$2 ? create_fn.cljs$core$IFn$_invoke$arity$2(G__77113,G__77114) : create_fn.call(null,G__77113,G__77114));
})(),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__77116 = nn;
var G__77117 = cljs.core.PersistentArrayMap.EMPTY;
return (create_fn.cljs$core$IFn$_invoke$arity$2 ? create_fn.cljs$core$IFn$_invoke$arity$2(G__77116,G__77117) : create_fn.call(null,G__77116,G__77117));
})(),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__77119 = shadow.dom.destructure_node(shadow.dom.create_dom_node,structure);
var node = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77119,(0),null);
var node_children = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77119,(1),null);
var seq__77123_77610 = cljs.core.seq(node_children);
var chunk__77124_77611 = null;
var count__77125_77612 = (0);
var i__77126_77613 = (0);
while(true){
if((i__77126_77613 < count__77125_77612)){
var child_struct_77614 = chunk__77124_77611.cljs$core$IIndexed$_nth$arity$2(null,i__77126_77613);
var children_77615 = shadow.dom.dom_node(child_struct_77614);
if(cljs.core.seq_QMARK_(children_77615)){
var seq__77151_77616 = cljs.core.seq(cljs.core.map.cljs$core$IFn$_invoke$arity$2(shadow.dom.dom_node,children_77615));
var chunk__77153_77617 = null;
var count__77154_77618 = (0);
var i__77155_77619 = (0);
while(true){
if((i__77155_77619 < count__77154_77618)){
var child_77620 = chunk__77153_77617.cljs$core$IIndexed$_nth$arity$2(null,i__77155_77619);
if(cljs.core.truth_(child_77620)){
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,child_77620);


var G__77621 = seq__77151_77616;
var G__77622 = chunk__77153_77617;
var G__77623 = count__77154_77618;
var G__77624 = (i__77155_77619 + (1));
seq__77151_77616 = G__77621;
chunk__77153_77617 = G__77622;
count__77154_77618 = G__77623;
i__77155_77619 = G__77624;
continue;
} else {
var G__77625 = seq__77151_77616;
var G__77626 = chunk__77153_77617;
var G__77627 = count__77154_77618;
var G__77628 = (i__77155_77619 + (1));
seq__77151_77616 = G__77625;
chunk__77153_77617 = G__77626;
count__77154_77618 = G__77627;
i__77155_77619 = G__77628;
continue;
}
} else {
var temp__5753__auto___77629 = cljs.core.seq(seq__77151_77616);
if(temp__5753__auto___77629){
var seq__77151_77630__$1 = temp__5753__auto___77629;
if(cljs.core.chunked_seq_QMARK_(seq__77151_77630__$1)){
var c__4649__auto___77631 = cljs.core.chunk_first(seq__77151_77630__$1);
var G__77632 = cljs.core.chunk_rest(seq__77151_77630__$1);
var G__77633 = c__4649__auto___77631;
var G__77634 = cljs.core.count(c__4649__auto___77631);
var G__77635 = (0);
seq__77151_77616 = G__77632;
chunk__77153_77617 = G__77633;
count__77154_77618 = G__77634;
i__77155_77619 = G__77635;
continue;
} else {
var child_77636 = cljs.core.first(seq__77151_77630__$1);
if(cljs.core.truth_(child_77636)){
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,child_77636);


var G__77637 = cljs.core.next(seq__77151_77630__$1);
var G__77638 = null;
var G__77639 = (0);
var G__77640 = (0);
seq__77151_77616 = G__77637;
chunk__77153_77617 = G__77638;
count__77154_77618 = G__77639;
i__77155_77619 = G__77640;
continue;
} else {
var G__77641 = cljs.core.next(seq__77151_77630__$1);
var G__77642 = null;
var G__77643 = (0);
var G__77644 = (0);
seq__77151_77616 = G__77641;
chunk__77153_77617 = G__77642;
count__77154_77618 = G__77643;
i__77155_77619 = G__77644;
continue;
}
}
} else {
}
}
break;
}
} else {
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,children_77615);
}


var G__77648 = seq__77123_77610;
var G__77649 = chunk__77124_77611;
var G__77650 = count__77125_77612;
var G__77651 = (i__77126_77613 + (1));
seq__77123_77610 = G__77648;
chunk__77124_77611 = G__77649;
count__77125_77612 = G__77650;
i__77126_77613 = G__77651;
continue;
} else {
var temp__5753__auto___77652 = cljs.core.seq(seq__77123_77610);
if(temp__5753__auto___77652){
var seq__77123_77653__$1 = temp__5753__auto___77652;
if(cljs.core.chunked_seq_QMARK_(seq__77123_77653__$1)){
var c__4649__auto___77654 = cljs.core.chunk_first(seq__77123_77653__$1);
var G__77655 = cljs.core.chunk_rest(seq__77123_77653__$1);
var G__77656 = c__4649__auto___77654;
var G__77657 = cljs.core.count(c__4649__auto___77654);
var G__77658 = (0);
seq__77123_77610 = G__77655;
chunk__77124_77611 = G__77656;
count__77125_77612 = G__77657;
i__77126_77613 = G__77658;
continue;
} else {
var child_struct_77659 = cljs.core.first(seq__77123_77653__$1);
var children_77660 = shadow.dom.dom_node(child_struct_77659);
if(cljs.core.seq_QMARK_(children_77660)){
var seq__77172_77661 = cljs.core.seq(cljs.core.map.cljs$core$IFn$_invoke$arity$2(shadow.dom.dom_node,children_77660));
var chunk__77174_77662 = null;
var count__77175_77663 = (0);
var i__77176_77664 = (0);
while(true){
if((i__77176_77664 < count__77175_77663)){
var child_77665 = chunk__77174_77662.cljs$core$IIndexed$_nth$arity$2(null,i__77176_77664);
if(cljs.core.truth_(child_77665)){
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,child_77665);


var G__77666 = seq__77172_77661;
var G__77667 = chunk__77174_77662;
var G__77668 = count__77175_77663;
var G__77669 = (i__77176_77664 + (1));
seq__77172_77661 = G__77666;
chunk__77174_77662 = G__77667;
count__77175_77663 = G__77668;
i__77176_77664 = G__77669;
continue;
} else {
var G__77670 = seq__77172_77661;
var G__77671 = chunk__77174_77662;
var G__77672 = count__77175_77663;
var G__77673 = (i__77176_77664 + (1));
seq__77172_77661 = G__77670;
chunk__77174_77662 = G__77671;
count__77175_77663 = G__77672;
i__77176_77664 = G__77673;
continue;
}
} else {
var temp__5753__auto___77674__$1 = cljs.core.seq(seq__77172_77661);
if(temp__5753__auto___77674__$1){
var seq__77172_77675__$1 = temp__5753__auto___77674__$1;
if(cljs.core.chunked_seq_QMARK_(seq__77172_77675__$1)){
var c__4649__auto___77676 = cljs.core.chunk_first(seq__77172_77675__$1);
var G__77677 = cljs.core.chunk_rest(seq__77172_77675__$1);
var G__77678 = c__4649__auto___77676;
var G__77679 = cljs.core.count(c__4649__auto___77676);
var G__77680 = (0);
seq__77172_77661 = G__77677;
chunk__77174_77662 = G__77678;
count__77175_77663 = G__77679;
i__77176_77664 = G__77680;
continue;
} else {
var child_77681 = cljs.core.first(seq__77172_77675__$1);
if(cljs.core.truth_(child_77681)){
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,child_77681);


var G__77682 = cljs.core.next(seq__77172_77675__$1);
var G__77683 = null;
var G__77684 = (0);
var G__77685 = (0);
seq__77172_77661 = G__77682;
chunk__77174_77662 = G__77683;
count__77175_77663 = G__77684;
i__77176_77664 = G__77685;
continue;
} else {
var G__77686 = cljs.core.next(seq__77172_77675__$1);
var G__77687 = null;
var G__77688 = (0);
var G__77689 = (0);
seq__77172_77661 = G__77686;
chunk__77174_77662 = G__77687;
count__77175_77663 = G__77688;
i__77176_77664 = G__77689;
continue;
}
}
} else {
}
}
break;
}
} else {
shadow.dom.append.cljs$core$IFn$_invoke$arity$2(node,children_77660);
}


var G__77690 = cljs.core.next(seq__77123_77653__$1);
var G__77691 = null;
var G__77692 = (0);
var G__77693 = (0);
seq__77123_77610 = G__77690;
chunk__77124_77611 = G__77691;
count__77125_77612 = G__77692;
i__77126_77613 = G__77693;
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__77201 = cljs.core.seq(node);
var chunk__77202 = null;
var count__77203 = (0);
var i__77204 = (0);
while(true){
if((i__77204 < count__77203)){
var n = chunk__77202.cljs$core$IIndexed$_nth$arity$2(null,i__77204);
(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__77706 = seq__77201;
var G__77707 = chunk__77202;
var G__77708 = count__77203;
var G__77709 = (i__77204 + (1));
seq__77201 = G__77706;
chunk__77202 = G__77707;
count__77203 = G__77708;
i__77204 = G__77709;
continue;
} else {
var temp__5753__auto__ = cljs.core.seq(seq__77201);
if(temp__5753__auto__){
var seq__77201__$1 = temp__5753__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__77201__$1)){
var c__4649__auto__ = cljs.core.chunk_first(seq__77201__$1);
var G__77710 = cljs.core.chunk_rest(seq__77201__$1);
var G__77711 = c__4649__auto__;
var G__77712 = cljs.core.count(c__4649__auto__);
var G__77713 = (0);
seq__77201 = G__77710;
chunk__77202 = G__77711;
count__77203 = G__77712;
i__77204 = G__77713;
continue;
} else {
var n = cljs.core.first(seq__77201__$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__77714 = cljs.core.next(seq__77201__$1);
var G__77715 = null;
var G__77716 = (0);
var G__77717 = (0);
seq__77201 = G__77714;
chunk__77202 = G__77715;
count__77203 = G__77716;
i__77204 = G__77717;
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__77214 = arguments.length;
switch (G__77214) {
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__77225 = arguments.length;
switch (G__77225) {
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__77241 = arguments.length;
switch (G__77241) {
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__4223__auto__ = shadow.dom.dom_node(el).getAttribute(cljs.core.name(key));
if(cljs.core.truth_(or__4223__auto__)){
return or__4223__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__4835__auto__ = [];
var len__4829__auto___77721 = arguments.length;
var i__4830__auto___77722 = (0);
while(true){
if((i__4830__auto___77722 < len__4829__auto___77721)){
args__4835__auto__.push((arguments[i__4830__auto___77722]));

var G__77723 = (i__4830__auto___77722 + (1));
i__4830__auto___77722 = G__77723;
continue;
} else {
}
break;
}

var argseq__4836__auto__ = ((((0) < args__4835__auto__.length))?(new cljs.core.IndexedSeq(args__4835__auto__.slice((0)),(0),null)):null);
return shadow.dom.fragment.cljs$core$IFn$_invoke$arity$variadic(argseq__4836__auto__);
});

(shadow.dom.fragment.cljs$core$IFn$_invoke$arity$variadic = (function (nodes){
var fragment = document.createDocumentFragment();
var seq__77277_77724 = cljs.core.seq(nodes);
var chunk__77278_77725 = null;
var count__77279_77726 = (0);
var i__77280_77727 = (0);
while(true){
if((i__77280_77727 < count__77279_77726)){
var node_77728 = chunk__77278_77725.cljs$core$IIndexed$_nth$arity$2(null,i__77280_77727);
fragment.appendChild(shadow.dom._to_dom(node_77728));


var G__77729 = seq__77277_77724;
var G__77730 = chunk__77278_77725;
var G__77731 = count__77279_77726;
var G__77732 = (i__77280_77727 + (1));
seq__77277_77724 = G__77729;
chunk__77278_77725 = G__77730;
count__77279_77726 = G__77731;
i__77280_77727 = G__77732;
continue;
} else {
var temp__5753__auto___77736 = cljs.core.seq(seq__77277_77724);
if(temp__5753__auto___77736){
var seq__77277_77737__$1 = temp__5753__auto___77736;
if(cljs.core.chunked_seq_QMARK_(seq__77277_77737__$1)){
var c__4649__auto___77740 = cljs.core.chunk_first(seq__77277_77737__$1);
var G__77741 = cljs.core.chunk_rest(seq__77277_77737__$1);
var G__77742 = c__4649__auto___77740;
var G__77743 = cljs.core.count(c__4649__auto___77740);
var G__77744 = (0);
seq__77277_77724 = G__77741;
chunk__77278_77725 = G__77742;
count__77279_77726 = G__77743;
i__77280_77727 = G__77744;
continue;
} else {
var node_77745 = cljs.core.first(seq__77277_77737__$1);
fragment.appendChild(shadow.dom._to_dom(node_77745));


var G__77746 = cljs.core.next(seq__77277_77737__$1);
var G__77747 = null;
var G__77748 = (0);
var G__77749 = (0);
seq__77277_77724 = G__77746;
chunk__77278_77725 = G__77747;
count__77279_77726 = G__77748;
i__77280_77727 = G__77749;
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 (seq77266){
var self__4817__auto__ = this;
return self__4817__auto__.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq(seq77266));
}));

/**
 * 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__77299_77751 = cljs.core.seq(scripts);
var chunk__77300_77752 = null;
var count__77301_77753 = (0);
var i__77302_77754 = (0);
while(true){
if((i__77302_77754 < count__77301_77753)){
var vec__77312_77755 = chunk__77300_77752.cljs$core$IIndexed$_nth$arity$2(null,i__77302_77754);
var script_tag_77756 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77312_77755,(0),null);
var script_body_77757 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77312_77755,(1),null);
eval(script_body_77757);


var G__77758 = seq__77299_77751;
var G__77759 = chunk__77300_77752;
var G__77760 = count__77301_77753;
var G__77761 = (i__77302_77754 + (1));
seq__77299_77751 = G__77758;
chunk__77300_77752 = G__77759;
count__77301_77753 = G__77760;
i__77302_77754 = G__77761;
continue;
} else {
var temp__5753__auto___77762 = cljs.core.seq(seq__77299_77751);
if(temp__5753__auto___77762){
var seq__77299_77763__$1 = temp__5753__auto___77762;
if(cljs.core.chunked_seq_QMARK_(seq__77299_77763__$1)){
var c__4649__auto___77764 = cljs.core.chunk_first(seq__77299_77763__$1);
var G__77765 = cljs.core.chunk_rest(seq__77299_77763__$1);
var G__77766 = c__4649__auto___77764;
var G__77767 = cljs.core.count(c__4649__auto___77764);
var G__77768 = (0);
seq__77299_77751 = G__77765;
chunk__77300_77752 = G__77766;
count__77301_77753 = G__77767;
i__77302_77754 = G__77768;
continue;
} else {
var vec__77315_77769 = cljs.core.first(seq__77299_77763__$1);
var script_tag_77770 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77315_77769,(0),null);
var script_body_77771 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77315_77769,(1),null);
eval(script_body_77771);


var G__77772 = cljs.core.next(seq__77299_77763__$1);
var G__77773 = null;
var G__77774 = (0);
var G__77775 = (0);
seq__77299_77751 = G__77772;
chunk__77300_77752 = G__77773;
count__77301_77753 = G__77774;
i__77302_77754 = G__77775;
continue;
}
} else {
}
}
break;
}

return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (s__$1,p__77318){
var vec__77319 = p__77318;
var script_tag = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77319,(0),null);
var script_body = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77319,(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__77323 = arguments.length;
switch (G__77323) {
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__77352 = cljs.core.seq(style_keys);
var chunk__77353 = null;
var count__77354 = (0);
var i__77355 = (0);
while(true){
if((i__77355 < count__77354)){
var it = chunk__77353.cljs$core$IIndexed$_nth$arity$2(null,i__77355);
shadow.dom.remove_style_STAR_(el__$1,it);


var G__77783 = seq__77352;
var G__77784 = chunk__77353;
var G__77785 = count__77354;
var G__77786 = (i__77355 + (1));
seq__77352 = G__77783;
chunk__77353 = G__77784;
count__77354 = G__77785;
i__77355 = G__77786;
continue;
} else {
var temp__5753__auto__ = cljs.core.seq(seq__77352);
if(temp__5753__auto__){
var seq__77352__$1 = temp__5753__auto__;
if(cljs.core.chunked_seq_QMARK_(seq__77352__$1)){
var c__4649__auto__ = cljs.core.chunk_first(seq__77352__$1);
var G__77787 = cljs.core.chunk_rest(seq__77352__$1);
var G__77788 = c__4649__auto__;
var G__77789 = cljs.core.count(c__4649__auto__);
var G__77790 = (0);
seq__77352 = G__77787;
chunk__77353 = G__77788;
count__77354 = G__77789;
i__77355 = G__77790;
continue;
} else {
var it = cljs.core.first(seq__77352__$1);
shadow.dom.remove_style_STAR_(el__$1,it);


var G__77791 = cljs.core.next(seq__77352__$1);
var G__77792 = null;
var G__77793 = (0);
var G__77794 = (0);
seq__77352 = G__77791;
chunk__77353 = G__77792;
count__77354 = G__77793;
i__77355 = G__77794;
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__4472__auto__,k__4473__auto__){
var self__ = this;
var this__4472__auto____$1 = this;
return this__4472__auto____$1.cljs$core$ILookup$_lookup$arity$3(null,k__4473__auto__,null);
}));

(shadow.dom.Coordinate.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__4474__auto__,k77371,else__4475__auto__){
var self__ = this;
var this__4474__auto____$1 = this;
var G__77383 = k77371;
var G__77383__$1 = (((G__77383 instanceof cljs.core.Keyword))?G__77383.fqn:null);
switch (G__77383__$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,k77371,else__4475__auto__);

}
}));

(shadow.dom.Coordinate.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = (function (this__4492__auto__,f__4493__auto__,init__4494__auto__){
var self__ = this;
var this__4492__auto____$1 = this;
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (ret__4495__auto__,p__77386){
var vec__77387 = p__77386;
var k__4496__auto__ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77387,(0),null);
var v__4497__auto__ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77387,(1),null);
return (f__4493__auto__.cljs$core$IFn$_invoke$arity$3 ? f__4493__auto__.cljs$core$IFn$_invoke$arity$3(ret__4495__auto__,k__4496__auto__,v__4497__auto__) : f__4493__auto__.call(null,ret__4495__auto__,k__4496__auto__,v__4497__auto__));
}),init__4494__auto__,this__4492__auto____$1);
}));

(shadow.dom.Coordinate.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__4487__auto__,writer__4488__auto__,opts__4489__auto__){
var self__ = this;
var this__4487__auto____$1 = this;
var pr_pair__4490__auto__ = (function (keyval__4491__auto__){
return cljs.core.pr_sequential_writer(writer__4488__auto__,cljs.core.pr_writer,""," ","",opts__4489__auto__,keyval__4491__auto__);
});
return cljs.core.pr_sequential_writer(writer__4488__auto__,pr_pair__4490__auto__,"#shadow.dom.Coordinate{",", ","}",opts__4489__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__77370){
var self__ = this;
var G__77370__$1 = this;
return (new cljs.core.RecordIter((0),G__77370__$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__4470__auto__){
var self__ = this;
var this__4470__auto____$1 = this;
return self__.__meta;
}));

(shadow.dom.Coordinate.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__4467__auto__){
var self__ = this;
var this__4467__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__4476__auto__){
var self__ = this;
var this__4476__auto____$1 = this;
return (2 + cljs.core.count(self__.__extmap));
}));

(shadow.dom.Coordinate.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__4468__auto__){
var self__ = this;
var this__4468__auto____$1 = this;
var h__4330__auto__ = self__.__hash;
if((!((h__4330__auto__ == null)))){
return h__4330__auto__;
} else {
var h__4330__auto____$1 = (function (coll__4469__auto__){
return (145542109 ^ cljs.core.hash_unordered_coll(coll__4469__auto__));
})(this__4468__auto____$1);
(self__.__hash = h__4330__auto____$1);

return h__4330__auto____$1;
}
}));

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

(shadow.dom.Coordinate.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__4482__auto__,k__4483__auto__){
var self__ = this;
var this__4482__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__4483__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__4482__auto____$1),self__.__meta),k__4483__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__4483__auto__)),null));
}
}));

(shadow.dom.Coordinate.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = (function (this__4479__auto__,k77371){
var self__ = this;
var this__4479__auto____$1 = this;
var G__77407 = k77371;
var G__77407__$1 = (((G__77407 instanceof cljs.core.Keyword))?G__77407.fqn:null);
switch (G__77407__$1) {
case "x":
case "y":
return true;

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

}
}));

(shadow.dom.Coordinate.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__4480__auto__,k__4481__auto__,G__77370){
var self__ = this;
var this__4480__auto____$1 = this;
var pred__77411 = cljs.core.keyword_identical_QMARK_;
var expr__77412 = k__4481__auto__;
if(cljs.core.truth_((pred__77411.cljs$core$IFn$_invoke$arity$2 ? pred__77411.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"x","x",2099068185),expr__77412) : pred__77411.call(null,new cljs.core.Keyword(null,"x","x",2099068185),expr__77412)))){
return (new shadow.dom.Coordinate(G__77370,self__.y,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_((pred__77411.cljs$core$IFn$_invoke$arity$2 ? pred__77411.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"y","y",-1757859776),expr__77412) : pred__77411.call(null,new cljs.core.Keyword(null,"y","y",-1757859776),expr__77412)))){
return (new shadow.dom.Coordinate(self__.x,G__77370,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__4481__auto__,G__77370),null));
}
}
}));

(shadow.dom.Coordinate.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__4485__auto__){
var self__ = this;
var this__4485__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__4471__auto__,G__77370){
var self__ = this;
var this__4471__auto____$1 = this;
return (new shadow.dom.Coordinate(self__.x,self__.y,G__77370,self__.__extmap,self__.__hash));
}));

(shadow.dom.Coordinate.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__4477__auto__,entry__4478__auto__){
var self__ = this;
var this__4477__auto____$1 = this;
if(cljs.core.vector_QMARK_(entry__4478__auto__)){
return this__4477__auto____$1.cljs$core$IAssociative$_assoc$arity$3(null,cljs.core._nth(entry__4478__auto__,(0)),cljs.core._nth(entry__4478__auto__,(1)));
} else {
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core._conj,this__4477__auto____$1,entry__4478__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__4516__auto__){
return (new cljs.core.List(null,"shadow.dom/Coordinate",null,(1),null));
}));

(shadow.dom.Coordinate.cljs$lang$ctorPrWriter = (function (this__4516__auto__,writer__4517__auto__){
return cljs.core._write(writer__4517__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__77377){
var extmap__4512__auto__ = (function (){var G__77420 = cljs.core.dissoc.cljs$core$IFn$_invoke$arity$variadic(G__77377,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__77377)){
return cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentArrayMap.EMPTY,G__77420);
} else {
return G__77420;
}
})();
return (new shadow.dom.Coordinate(new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(G__77377),new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__77377),null,cljs.core.not_empty(extmap__4512__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__4472__auto__,k__4473__auto__){
var self__ = this;
var this__4472__auto____$1 = this;
return this__4472__auto____$1.cljs$core$ILookup$_lookup$arity$3(null,k__4473__auto__,null);
}));

(shadow.dom.Size.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__4474__auto__,k77423,else__4475__auto__){
var self__ = this;
var this__4474__auto____$1 = this;
var G__77435 = k77423;
var G__77435__$1 = (((G__77435 instanceof cljs.core.Keyword))?G__77435.fqn:null);
switch (G__77435__$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,k77423,else__4475__auto__);

}
}));

(shadow.dom.Size.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = (function (this__4492__auto__,f__4493__auto__,init__4494__auto__){
var self__ = this;
var this__4492__auto____$1 = this;
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (ret__4495__auto__,p__77437){
var vec__77438 = p__77437;
var k__4496__auto__ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77438,(0),null);
var v__4497__auto__ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77438,(1),null);
return (f__4493__auto__.cljs$core$IFn$_invoke$arity$3 ? f__4493__auto__.cljs$core$IFn$_invoke$arity$3(ret__4495__auto__,k__4496__auto__,v__4497__auto__) : f__4493__auto__.call(null,ret__4495__auto__,k__4496__auto__,v__4497__auto__));
}),init__4494__auto__,this__4492__auto____$1);
}));

(shadow.dom.Size.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__4487__auto__,writer__4488__auto__,opts__4489__auto__){
var self__ = this;
var this__4487__auto____$1 = this;
var pr_pair__4490__auto__ = (function (keyval__4491__auto__){
return cljs.core.pr_sequential_writer(writer__4488__auto__,cljs.core.pr_writer,""," ","",opts__4489__auto__,keyval__4491__auto__);
});
return cljs.core.pr_sequential_writer(writer__4488__auto__,pr_pair__4490__auto__,"#shadow.dom.Size{",", ","}",opts__4489__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__77422){
var self__ = this;
var G__77422__$1 = this;
return (new cljs.core.RecordIter((0),G__77422__$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__4470__auto__){
var self__ = this;
var this__4470__auto____$1 = this;
return self__.__meta;
}));

(shadow.dom.Size.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__4467__auto__){
var self__ = this;
var this__4467__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__4476__auto__){
var self__ = this;
var this__4476__auto____$1 = this;
return (2 + cljs.core.count(self__.__extmap));
}));

(shadow.dom.Size.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__4468__auto__){
var self__ = this;
var this__4468__auto____$1 = this;
var h__4330__auto__ = self__.__hash;
if((!((h__4330__auto__ == null)))){
return h__4330__auto__;
} else {
var h__4330__auto____$1 = (function (coll__4469__auto__){
return (-1228019642 ^ cljs.core.hash_unordered_coll(coll__4469__auto__));
})(this__4468__auto____$1);
(self__.__hash = h__4330__auto____$1);

return h__4330__auto____$1;
}
}));

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

(shadow.dom.Size.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__4482__auto__,k__4483__auto__){
var self__ = this;
var this__4482__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__4483__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__4482__auto____$1),self__.__meta),k__4483__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__4483__auto__)),null));
}
}));

(shadow.dom.Size.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = (function (this__4479__auto__,k77423){
var self__ = this;
var this__4479__auto____$1 = this;
var G__77463 = k77423;
var G__77463__$1 = (((G__77463 instanceof cljs.core.Keyword))?G__77463.fqn:null);
switch (G__77463__$1) {
case "w":
case "h":
return true;

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

}
}));

(shadow.dom.Size.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__4480__auto__,k__4481__auto__,G__77422){
var self__ = this;
var this__4480__auto____$1 = this;
var pred__77464 = cljs.core.keyword_identical_QMARK_;
var expr__77465 = k__4481__auto__;
if(cljs.core.truth_((pred__77464.cljs$core$IFn$_invoke$arity$2 ? pred__77464.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"w","w",354169001),expr__77465) : pred__77464.call(null,new cljs.core.Keyword(null,"w","w",354169001),expr__77465)))){
return (new shadow.dom.Size(G__77422,self__.h,self__.__meta,self__.__extmap,null));
} else {
if(cljs.core.truth_((pred__77464.cljs$core$IFn$_invoke$arity$2 ? pred__77464.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"h","h",1109658740),expr__77465) : pred__77464.call(null,new cljs.core.Keyword(null,"h","h",1109658740),expr__77465)))){
return (new shadow.dom.Size(self__.w,G__77422,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__4481__auto__,G__77422),null));
}
}
}));

(shadow.dom.Size.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__4485__auto__){
var self__ = this;
var this__4485__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__4471__auto__,G__77422){
var self__ = this;
var this__4471__auto____$1 = this;
return (new shadow.dom.Size(self__.w,self__.h,G__77422,self__.__extmap,self__.__hash));
}));

(shadow.dom.Size.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__4477__auto__,entry__4478__auto__){
var self__ = this;
var this__4477__auto____$1 = this;
if(cljs.core.vector_QMARK_(entry__4478__auto__)){
return this__4477__auto____$1.cljs$core$IAssociative$_assoc$arity$3(null,cljs.core._nth(entry__4478__auto__,(0)),cljs.core._nth(entry__4478__auto__,(1)));
} else {
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core._conj,this__4477__auto____$1,entry__4478__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__4516__auto__){
return (new cljs.core.List(null,"shadow.dom/Size",null,(1),null));
}));

(shadow.dom.Size.cljs$lang$ctorPrWriter = (function (this__4516__auto__,writer__4517__auto__){
return cljs.core._write(writer__4517__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__77429){
var extmap__4512__auto__ = (function (){var G__77469 = cljs.core.dissoc.cljs$core$IFn$_invoke$arity$variadic(G__77429,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__77429)){
return cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentArrayMap.EMPTY,G__77469);
} else {
return G__77469;
}
})();
return (new shadow.dom.Size(new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__77429),new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__77429),null,cljs.core.not_empty(extmap__4512__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__4703__auto__ = opts;
var l__4704__auto__ = a__4703__auto__.length;
var i = (0);
var ret = cljs.core.PersistentVector.EMPTY;
while(true){
if((i < l__4704__auto__)){
var G__77823 = (i + (1));
var G__77824 = cljs.core.conj.cljs$core$IFn$_invoke$arity$2(ret,(opts[i]["value"]));
i = G__77823;
ret = G__77824;
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__77474){
var vec__77475 = p__77474;
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77475,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77475,(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__77479 = arguments.length;
switch (G__77479) {
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__5751__auto__ = shadow.dom.dom_node(ref).firstChild;
if(cljs.core.truth_(temp__5751__auto__)){
var child = temp__5751__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__77836 = ps;
var G__77837 = (i + (1));
el__$1 = G__77836;
i = G__77837;
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__77481 = shadow.dom.parse_tag(tag_def);
var tag_name = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77481,(0),null);
var tag_id = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77481,(1),null);
var tag_classes = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77481,(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__77484_77840 = cljs.core.seq(props);
var chunk__77485_77841 = null;
var count__77486_77842 = (0);
var i__77487_77843 = (0);
while(true){
if((i__77487_77843 < count__77486_77842)){
var vec__77494_77844 = chunk__77485_77841.cljs$core$IIndexed$_nth$arity$2(null,i__77487_77843);
var k_77845 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77494_77844,(0),null);
var v_77846 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77494_77844,(1),null);
el.setAttributeNS((function (){var temp__5753__auto__ = cljs.core.namespace(k_77845);
if(cljs.core.truth_(temp__5753__auto__)){
var ns = temp__5753__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_77845),v_77846);


var G__77847 = seq__77484_77840;
var G__77848 = chunk__77485_77841;
var G__77849 = count__77486_77842;
var G__77850 = (i__77487_77843 + (1));
seq__77484_77840 = G__77847;
chunk__77485_77841 = G__77848;
count__77486_77842 = G__77849;
i__77487_77843 = G__77850;
continue;
} else {
var temp__5753__auto___77852 = cljs.core.seq(seq__77484_77840);
if(temp__5753__auto___77852){
var seq__77484_77853__$1 = temp__5753__auto___77852;
if(cljs.core.chunked_seq_QMARK_(seq__77484_77853__$1)){
var c__4649__auto___77854 = cljs.core.chunk_first(seq__77484_77853__$1);
var G__77855 = cljs.core.chunk_rest(seq__77484_77853__$1);
var G__77856 = c__4649__auto___77854;
var G__77857 = cljs.core.count(c__4649__auto___77854);
var G__77858 = (0);
seq__77484_77840 = G__77855;
chunk__77485_77841 = G__77856;
count__77486_77842 = G__77857;
i__77487_77843 = G__77858;
continue;
} else {
var vec__77497_77863 = cljs.core.first(seq__77484_77853__$1);
var k_77864 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77497_77863,(0),null);
var v_77865 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77497_77863,(1),null);
el.setAttributeNS((function (){var temp__5753__auto____$1 = cljs.core.namespace(k_77864);
if(cljs.core.truth_(temp__5753__auto____$1)){
var ns = temp__5753__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_77864),v_77865);


var G__77866 = cljs.core.next(seq__77484_77853__$1);
var G__77867 = null;
var G__77868 = (0);
var G__77869 = (0);
seq__77484_77840 = G__77866;
chunk__77485_77841 = G__77867;
count__77486_77842 = G__77868;
i__77487_77843 = G__77869;
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__77501 = shadow.dom.destructure_node(shadow.dom.create_svg_node,structure);
var node = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77501,(0),null);
var node_children = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__77501,(1),null);
var seq__77504_77875 = cljs.core.seq(node_children);
var chunk__77506_77876 = null;
var count__77507_77877 = (0);
var i__77508_77878 = (0);
while(true){
if((i__77508_77878 < count__77507_77877)){
var child_struct_77879 = chunk__77506_77876.cljs$core$IIndexed$_nth$arity$2(null,i__77508_77878);
if((!((child_struct_77879 == null)))){
if(typeof child_struct_77879 === 'string'){
var text_77880 = (node["textContent"]);
(node["textContent"] = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(text_77880),child_struct_77879].join(''));
} else {
var children_77881 = shadow.dom.svg_node(child_struct_77879);
if(cljs.core.seq_QMARK_(children_77881)){
var seq__77522_77882 = cljs.core.seq(children_77881);
var chunk__77524_77883 = null;
var count__77525_77884 = (0);
var i__77526_77885 = (0);
while(true){
if((i__77526_77885 < count__77525_77884)){
var child_77909 = chunk__77524_77883.cljs$core$IIndexed$_nth$arity$2(null,i__77526_77885);
if(cljs.core.truth_(child_77909)){
node.appendChild(child_77909);


var G__77910 = seq__77522_77882;
var G__77911 = chunk__77524_77883;
var G__77912 = count__77525_77884;
var G__77913 = (i__77526_77885 + (1));
seq__77522_77882 = G__77910;
chunk__77524_77883 = G__77911;
count__77525_77884 = G__77912;
i__77526_77885 = G__77913;
continue;
} else {
var G__77914 = seq__77522_77882;
var G__77915 = chunk__77524_77883;
var G__77916 = count__77525_77884;
var G__77917 = (i__77526_77885 + (1));
seq__77522_77882 = G__77914;
chunk__77524_77883 = G__77915;
count__77525_77884 = G__77916;
i__77526_77885 = G__77917;
continue;
}
} else {
var temp__5753__auto___77918 = cljs.core.seq(seq__77522_77882);
if(temp__5753__auto___77918){
var seq__77522_77919__$1 = temp__5753__auto___77918;
if(cljs.core.chunked_seq_QMARK_(seq__77522_77919__$1)){
var c__4649__auto___77920 = cljs.core.chunk_first(seq__77522_77919__$1);
var G__77921 = cljs.core.chunk_rest(seq__77522_77919__$1);
var G__77922 = c__4649__auto___77920;
var G__77923 = cljs.core.count(c__4649__auto___77920);
var G__77924 = (0);
seq__77522_77882 = G__77921;
chunk__77524_77883 = G__77922;
count__77525_77884 = G__77923;
i__77526_77885 = G__77924;
continue;
} else {
var child_77925 = cljs.core.first(seq__77522_77919__$1);
if(cljs.core.truth_(child_77925)){
node.appendChild(child_77925);


var G__77926 = cljs.core.next(seq__77522_77919__$1);
var G__77927 = null;
var G__77928 = (0);
var G__77929 = (0);
seq__77522_77882 = G__77926;
chunk__77524_77883 = G__77927;
count__77525_77884 = G__77928;
i__77526_77885 = G__77929;
continue;
} else {
var G__77930 = cljs.core.next(seq__77522_77919__$1);
var G__77931 = null;
var G__77932 = (0);
var G__77933 = (0);
seq__77522_77882 = G__77930;
chunk__77524_77883 = G__77931;
count__77525_77884 = G__77932;
i__77526_77885 = G__77933;
continue;
}
}
} else {
}
}
break;
}
} else {
node.appendChild(children_77881);
}
}


var G__77934 = seq__77504_77875;
var G__77935 = chunk__77506_77876;
var G__77936 = count__77507_77877;
var G__77937 = (i__77508_77878 + (1));
seq__77504_77875 = G__77934;
chunk__77506_77876 = G__77935;
count__77507_77877 = G__77936;
i__77508_77878 = G__77937;
continue;
} else {
var G__77938 = seq__77504_77875;
var G__77939 = chunk__77506_77876;
var G__77940 = count__77507_77877;
var G__77941 = (i__77508_77878 + (1));
seq__77504_77875 = G__77938;
chunk__77506_77876 = G__77939;
count__77507_77877 = G__77940;
i__77508_77878 = G__77941;
continue;
}
} else {
var temp__5753__auto___77942 = cljs.core.seq(seq__77504_77875);
if(temp__5753__auto___77942){
var seq__77504_77943__$1 = temp__5753__auto___77942;
if(cljs.core.chunked_seq_QMARK_(seq__77504_77943__$1)){
var c__4649__auto___77944 = cljs.core.chunk_first(seq__77504_77943__$1);
var G__77945 = cljs.core.chunk_rest(seq__77504_77943__$1);
var G__77946 = c__4649__auto___77944;
var G__77947 = cljs.core.count(c__4649__auto___77944);
var G__77948 = (0);
seq__77504_77875 = G__77945;
chunk__77506_77876 = G__77946;
count__77507_77877 = G__77947;
i__77508_77878 = G__77948;
continue;
} else {
var child_struct_77949 = cljs.core.first(seq__77504_77943__$1);
if((!((child_struct_77949 == null)))){
if(typeof child_struct_77949 === 'string'){
var text_77954 = (node["textContent"]);
(node["textContent"] = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(text_77954),child_struct_77949].join(''));
} else {
var children_77955 = shadow.dom.svg_node(child_struct_77949);
if(cljs.core.seq_QMARK_(children_77955)){
var seq__77528_77956 = cljs.core.seq(children_77955);
var chunk__77530_77957 = null;
var count__77531_77958 = (0);
var i__77532_77959 = (0);
while(true){
if((i__77532_77959 < count__77531_77958)){
var child_77960 = chunk__77530_77957.cljs$core$IIndexed$_nth$arity$2(null,i__77532_77959);
if(cljs.core.truth_(child_77960)){
node.appendChild(child_77960);


var G__77961 = seq__77528_77956;
var G__77962 = chunk__77530_77957;
var G__77963 = count__77531_77958;
var G__77964 = (i__77532_77959 + (1));
seq__77528_77956 = G__77961;
chunk__77530_77957 = G__77962;
count__77531_77958 = G__77963;
i__77532_77959 = G__77964;
continue;
} else {
var G__77965 = seq__77528_77956;
var G__77966 = chunk__77530_77957;
var G__77967 = count__77531_77958;
var G__77968 = (i__77532_77959 + (1));
seq__77528_77956 = G__77965;
chunk__77530_77957 = G__77966;
count__77531_77958 = G__77967;
i__77532_77959 = G__77968;
continue;
}
} else {
var temp__5753__auto___77969__$1 = cljs.core.seq(seq__77528_77956);
if(temp__5753__auto___77969__$1){
var seq__77528_77970__$1 = temp__5753__auto___77969__$1;
if(cljs.core.chunked_seq_QMARK_(seq__77528_77970__$1)){
var c__4649__auto___77971 = cljs.core.chunk_first(seq__77528_77970__$1);
var G__77972 = cljs.core.chunk_rest(seq__77528_77970__$1);
var G__77973 = c__4649__auto___77971;
var G__77974 = cljs.core.count(c__4649__auto___77971);
var G__77975 = (0);
seq__77528_77956 = G__77972;
chunk__77530_77957 = G__77973;
count__77531_77958 = G__77974;
i__77532_77959 = G__77975;
continue;
} else {
var child_77976 = cljs.core.first(seq__77528_77970__$1);
if(cljs.core.truth_(child_77976)){
node.appendChild(child_77976);


var G__77977 = cljs.core.next(seq__77528_77970__$1);
var G__77978 = null;
var G__77979 = (0);
var G__77980 = (0);
seq__77528_77956 = G__77977;
chunk__77530_77957 = G__77978;
count__77531_77958 = G__77979;
i__77532_77959 = G__77980;
continue;
} else {
var G__77981 = cljs.core.next(seq__77528_77970__$1);
var G__77982 = null;
var G__77983 = (0);
var G__77984 = (0);
seq__77528_77956 = G__77981;
chunk__77530_77957 = G__77982;
count__77531_77958 = G__77983;
i__77532_77959 = G__77984;
continue;
}
}
} else {
}
}
break;
}
} else {
node.appendChild(children_77955);
}
}


var G__77985 = cljs.core.next(seq__77504_77943__$1);
var G__77986 = null;
var G__77987 = (0);
var G__77988 = (0);
seq__77504_77875 = G__77985;
chunk__77506_77876 = G__77986;
count__77507_77877 = G__77987;
i__77508_77878 = G__77988;
continue;
} else {
var G__77989 = cljs.core.next(seq__77504_77943__$1);
var G__77990 = null;
var G__77991 = (0);
var G__77992 = (0);
seq__77504_77875 = G__77989;
chunk__77506_77876 = G__77990;
count__77507_77877 = G__77991;
i__77508_77878 = G__77992;
continue;
}
}
} else {
}
}
break;
}

return node;
});
goog.object.set(shadow.dom.SVGElement,"string",true);

goog.object.set(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);
}));

goog.object.set(shadow.dom.SVGElement,"null",true);

goog.object.set(shadow.dom._to_svg,"null",(function (_){
return null;
}));
shadow.dom.svg = (function shadow$dom$svg(var_args){
var args__4835__auto__ = [];
var len__4829__auto___78004 = arguments.length;
var i__4830__auto___78009 = (0);
while(true){
if((i__4830__auto___78009 < len__4829__auto___78004)){
args__4835__auto__.push((arguments[i__4830__auto___78009]));

var G__78010 = (i__4830__auto___78009 + (1));
i__4830__auto___78009 = G__78010;
continue;
} else {
}
break;
}

var argseq__4836__auto__ = ((((1) < args__4835__auto__.length))?(new cljs.core.IndexedSeq(args__4835__auto__.slice((1)),(0),null)):null);
return shadow.dom.svg.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__4836__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 (seq77535){
var G__77536 = cljs.core.first(seq77535);
var seq77535__$1 = cljs.core.next(seq77535);
var self__4816__auto__ = this;
return self__4816__auto__.cljs$core$IFn$_invoke$arity$variadic(G__77536,seq77535__$1);
}));

/**
 * returns a channel for events on el
 * transform-fn should be a (fn [e el] some-val) where some-val will be put on the chan
 * once-or-cleanup handles the removal of the event handler
 * - true: remove after one event
 * - false: never removed
 * - chan: remove on msg/close
 */
shadow.dom.event_chan = (function shadow$dom$event_chan(var_args){
var G__77538 = arguments.length;
switch (G__77538) {
case 2:
return shadow.dom.event_chan.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

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

break;
case 4:
return shadow.dom.event_chan.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.event_chan.cljs$core$IFn$_invoke$arity$2 = (function (el,event){
return shadow.dom.event_chan.cljs$core$IFn$_invoke$arity$4(el,event,null,false);
}));

(shadow.dom.event_chan.cljs$core$IFn$_invoke$arity$3 = (function (el,event,xf){
return shadow.dom.event_chan.cljs$core$IFn$_invoke$arity$4(el,event,xf,false);
}));

(shadow.dom.event_chan.cljs$core$IFn$_invoke$arity$4 = (function (el,event,xf,once_or_cleanup){
var buf = cljs.core.async.sliding_buffer((1));
var chan = cljs.core.async.chan.cljs$core$IFn$_invoke$arity$2(buf,xf);
var event_fn = (function shadow$dom$event_fn(e){
cljs.core.async.put_BANG_.cljs$core$IFn$_invoke$arity$2(chan,e);

if(once_or_cleanup === true){
shadow.dom.remove_event_handler(el,event,shadow$dom$event_fn);

return cljs.core.async.close_BANG_(chan);
} else {
return null;
}
});
shadow.dom.dom_listen(shadow.dom.dom_node(el),cljs.core.name(event),event_fn);

if(cljs.core.truth_((function (){var and__4221__auto__ = once_or_cleanup;
if(cljs.core.truth_(and__4221__auto__)){
return (!(once_or_cleanup === true));
} else {
return and__4221__auto__;
}
})())){
var c__74231__auto___78023 = cljs.core.async.chan.cljs$core$IFn$_invoke$arity$1((1));
cljs.core.async.impl.dispatch.run((function (){
var f__74232__auto__ = (function (){var switch__74101__auto__ = (function (state_77543){
var state_val_77544 = (state_77543[(1)]);
if((state_val_77544 === (1))){
var state_77543__$1 = state_77543;
return cljs.core.async.impl.ioc_helpers.take_BANG_(state_77543__$1,(2),once_or_cleanup);
} else {
if((state_val_77544 === (2))){
var inst_77540 = (state_77543[(2)]);
var inst_77541 = shadow.dom.remove_event_handler(el,event,event_fn);
var state_77543__$1 = (function (){var statearr_77545 = state_77543;
(statearr_77545[(7)] = inst_77540);

return statearr_77545;
})();
return cljs.core.async.impl.ioc_helpers.return_chan(state_77543__$1,inst_77541);
} else {
return null;
}
}
});
return (function() {
var shadow$dom$state_machine__74102__auto__ = null;
var shadow$dom$state_machine__74102__auto____0 = (function (){
var statearr_77546 = [null,null,null,null,null,null,null,null];
(statearr_77546[(0)] = shadow$dom$state_machine__74102__auto__);

(statearr_77546[(1)] = (1));

return statearr_77546;
});
var shadow$dom$state_machine__74102__auto____1 = (function (state_77543){
while(true){
var ret_value__74103__auto__ = (function (){try{while(true){
var result__74104__auto__ = switch__74101__auto__(state_77543);
if(cljs.core.keyword_identical_QMARK_(result__74104__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__74104__auto__;
}
break;
}
}catch (e77547){var ex__74105__auto__ = e77547;
var statearr_77548_78027 = state_77543;
(statearr_77548_78027[(2)] = ex__74105__auto__);


if(cljs.core.seq((state_77543[(4)]))){
var statearr_77549_78028 = state_77543;
(statearr_77549_78028[(1)] = cljs.core.first((state_77543[(4)])));

} else {
throw ex__74105__auto__;
}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
}})();
if(cljs.core.keyword_identical_QMARK_(ret_value__74103__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__78029 = state_77543;
state_77543 = G__78029;
continue;
} else {
return ret_value__74103__auto__;
}
break;
}
});
shadow$dom$state_machine__74102__auto__ = function(state_77543){
switch(arguments.length){
case 0:
return shadow$dom$state_machine__74102__auto____0.call(this);
case 1:
return shadow$dom$state_machine__74102__auto____1.call(this,state_77543);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
shadow$dom$state_machine__74102__auto__.cljs$core$IFn$_invoke$arity$0 = shadow$dom$state_machine__74102__auto____0;
shadow$dom$state_machine__74102__auto__.cljs$core$IFn$_invoke$arity$1 = shadow$dom$state_machine__74102__auto____1;
return shadow$dom$state_machine__74102__auto__;
})()
})();
var state__74233__auto__ = (function (){var statearr_77550 = f__74232__auto__();
(statearr_77550[(6)] = c__74231__auto___78023);

return statearr_77550;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped(state__74233__auto__);
}));

} else {
}

return chan;
}));

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


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