// Compiled by ClojureScript 1.10.520 {}
goog.provide('octet.util');
goog.require('cljs.core');
goog.require('clojure.string');
goog.require('octet.buffer');
var ret__4776__auto___27354 = octet.util.defalias = (function octet$util$defalias(_AMPERSAND_form,_AMPERSAND_env,sym,sym2){
return cljs.core.sequence.call(null,cljs.core.seq.call(null,cljs.core.concat.call(null,(new cljs.core.List(null,new cljs.core.Symbol(null,"do","do",1686842252,null),null,(1),null)),(new cljs.core.List(null,cljs.core.sequence.call(null,cljs.core.seq.call(null,cljs.core.concat.call(null,(new cljs.core.List(null,new cljs.core.Symbol(null,"def","def",597100991,null),null,(1),null)),(new cljs.core.List(null,sym,null,(1),null)),(new cljs.core.List(null,sym2,null,(1),null))))),null,(1),null)),(new cljs.core.List(null,cljs.core.sequence.call(null,cljs.core.seq.call(null,cljs.core.concat.call(null,(new cljs.core.List(null,new cljs.core.Symbol("cljs.core","alter-meta!","cljs.core/alter-meta!",574694262,null),null,(1),null)),(new cljs.core.List(null,cljs.core.sequence.call(null,cljs.core.seq.call(null,cljs.core.concat.call(null,(new cljs.core.List(null,new cljs.core.Symbol(null,"var","var",870848730,null),null,(1),null)),(new cljs.core.List(null,sym,null,(1),null))))),null,(1),null)),(new cljs.core.List(null,new cljs.core.Symbol("cljs.core","merge","cljs.core/merge",-822184067,null),null,(1),null)),(new cljs.core.List(null,cljs.core.sequence.call(null,cljs.core.seq.call(null,cljs.core.concat.call(null,(new cljs.core.List(null,new cljs.core.Symbol("cljs.core","dissoc","cljs.core/dissoc",-432349815,null),null,(1),null)),(new cljs.core.List(null,cljs.core.sequence.call(null,cljs.core.seq.call(null,cljs.core.concat.call(null,(new cljs.core.List(null,new cljs.core.Symbol("cljs.core","meta","cljs.core/meta",-748218346,null),null,(1),null)),(new cljs.core.List(null,cljs.core.sequence.call(null,cljs.core.seq.call(null,cljs.core.concat.call(null,(new cljs.core.List(null,new cljs.core.Symbol(null,"var","var",870848730,null),null,(1),null)),(new cljs.core.List(null,sym2,null,(1),null))))),null,(1),null))))),null,(1),null)),(new cljs.core.List(null,new cljs.core.Keyword(null,"name","name",1843675177),null,(1),null))))),null,(1),null))))),null,(1),null)))));
});
octet.util.defalias.cljs$lang$macro = true;

octet.util.assoc_ordered = (function octet$util$assoc_ordered(var_args){
var args__4736__auto__ = [];
var len__4730__auto___27359 = arguments.length;
var i__4731__auto___27360 = (0);
while(true){
if((i__4731__auto___27360 < len__4730__auto___27359)){
args__4736__auto__.push((arguments[i__4731__auto___27360]));

var G__27361 = (i__4731__auto___27360 + (1));
i__4731__auto___27360 = G__27361;
continue;
} else {
}
break;
}

var argseq__4737__auto__ = ((((3) < args__4736__auto__.length))?(new cljs.core.IndexedSeq(args__4736__auto__.slice((3)),(0),null)):null);
return octet.util.assoc_ordered.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),argseq__4737__auto__);
});

octet.util.assoc_ordered.cljs$core$IFn$_invoke$arity$variadic = (function (a_map,key,val,rest){
while(true){

var kvs = cljs.core.interleave.call(null,cljs.core.concat.call(null,cljs.core.keys.call(null,a_map),(new cljs.core.List(null,key,null,(1),null))),cljs.core.concat.call(null,cljs.core.vals.call(null,a_map),(new cljs.core.List(null,val,null,(1),null))));
var ret = cljs.core.apply.call(null,cljs.core.array_map,kvs);
if(cljs.core.truth_(rest)){
if(cljs.core.next.call(null,rest)){
var G__27362 = ret;
var G__27363 = cljs.core.first.call(null,rest);
var G__27364 = cljs.core.second.call(null,rest);
var G__27365 = cljs.core.nnext.call(null,rest);
a_map = G__27362;
key = G__27363;
val = G__27364;
rest = G__27365;
continue;
} else {
throw cljs.core.ex_info.call(null,"assoc-ordered expects even number of arguments after map/vector, found odd number",cljs.core.PersistentArrayMap.EMPTY);
}
} else {
return ret;
}
break;
}
});

octet.util.assoc_ordered.cljs$lang$maxFixedArity = (3);

/** @this {Function} */
octet.util.assoc_ordered.cljs$lang$applyTo = (function (seq27355){
var G__27356 = cljs.core.first.call(null,seq27355);
var seq27355__$1 = cljs.core.next.call(null,seq27355);
var G__27357 = cljs.core.first.call(null,seq27355__$1);
var seq27355__$2 = cljs.core.next.call(null,seq27355__$1);
var G__27358 = cljs.core.first.call(null,seq27355__$2);
var seq27355__$3 = cljs.core.next.call(null,seq27355__$2);
var self__4717__auto__ = this;
return self__4717__auto__.cljs$core$IFn$_invoke$arity$variadic(G__27356,G__27357,G__27358,seq27355__$3);
});

