Socket
Socket
Sign inDemoInstall

@pelagiccreatures/sargasso

Package Overview
Dependencies
2
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.1 to 2.0.2

.terserrc

2

dist/sargasso.iife.min.js

@@ -1,2 +0,2 @@

var SargassoModule=function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var s="object"==typeof t&&t&&t.Object===Object&&t,r=s,i="object"==typeof self&&self&&self.Object===Object&&self,n=r||i||Function("return this")(),o=n.Symbol;var a=function arrayMap$1(e,t){for(var s=-1,r=null==e?0:e.length,i=Array(r);++s<r;)i[s]=t(e[s],s,e);return i},c=Array.isArray,l=o,h=Object.prototype,u=h.hasOwnProperty,d=h.toString,p=l?l.toStringTag:void 0;var f=function getRawTag$1(e){var t=u.call(e,p),s=e[p];try{e[p]=void 0;var r=!0}catch(e){}var i=d.call(e);return r&&(t?e[p]=s:delete e[p]),i},b=Object.prototype.toString;var g=f,v=function objectToString$1(e){return b.call(e)},m=o?o.toStringTag:void 0;var y=function baseGetTag$5(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":m&&m in Object(e)?g(e):v(e)};var w=function isObjectLike$5(e){return null!=e&&"object"==typeof e},O=y,_=w;var j=function isSymbol$2(e){return"symbol"==typeof e||_(e)&&"[object Symbol]"==O(e)},x=a,S=c,E=j,A=o?o.prototype:void 0,C=A?A.toString:void 0;var k=function baseToString$1(e){if("string"==typeof e)return e;if(S(e))return x(e,baseToString$1)+"";if(E(e))return C?C.call(e):"";var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t},$=k;var D=function toString$4(e){return null==e?"":$(e)};var M=function baseSlice$1(e,t,s){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(s=s>i?i:s)<0&&(s+=i),i=t>s?0:s-t>>>0,t>>>=0;for(var n=Array(i);++r<i;)n[r]=e[r+t];return n};var R=function castSlice$1(e,t,s){var r=e.length;return s=void 0===s?r:s,!t&&s>=r?e:M(e,t,s)},F=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var L=function hasUnicode$2(e){return F.test(e)};var T=function asciiToArray$1(e){return e.split("")},z="[\\ud800-\\udfff]",P="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",H="\\ud83c[\\udffb-\\udfff]",W="[^\\ud800-\\udfff]",I="(?:\\ud83c[\\udde6-\\uddff]){2}",N="[\\ud800-\\udbff][\\udc00-\\udfff]",V="(?:"+P+"|"+H+")"+"?",q="[\\ufe0e\\ufe0f]?",U=q+V+("(?:\\u200d(?:"+[W,I,N].join("|")+")"+q+V+")*"),B="(?:"+[W+P+"?",P,I,N,z].join("|")+")",G=RegExp(H+"(?="+H+")|"+B+U,"g");var Q=T,Z=L,K=function unicodeToArray$1(e){return e.match(G)||[]};var J=R,Y=L,X=function stringToArray$1(e){return Z(e)?K(e):Q(e)},ee=D;var te=function createCaseFirst$1(e){return function(t){t=ee(t);var s=Y(t)?X(t):void 0,r=s?s[0]:t.charAt(0),i=s?J(s,1).join(""):t.slice(1);return r[e]()+i}}("toUpperCase"),se=D,re=te;var ie=function capitalize$1(e){return re(se(e).toLowerCase())};var ne=function arrayReduce$1(e,t,s,r){var i=-1,n=null==e?0:e.length;for(r&&n&&(s=e[++i]);++i<n;)s=t(s,e[i],i,e);return s};var oe=function basePropertyOf$1(e){return function(t){return null==e?void 0:e[t]}}({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),ae=D,ce=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,le=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var he=function deburr$1(e){return(e=ae(e))&&e.replace(ce,oe).replace(le,"")},ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var de=function asciiWords$1(e){return e.match(ue)||[]},pe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var fe=function hasUnicodeWord$1(e){return pe.test(e)},be="\\u2700-\\u27bf",ge="a-z\\xdf-\\xf6\\xf8-\\xff",ve="A-Z\\xc0-\\xd6\\xd8-\\xde",me="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ye="["+me+"]",we="\\d+",Oe="[\\u2700-\\u27bf]",_e="["+ge+"]",je="[^\\ud800-\\udfff"+me+we+be+ge+ve+"]",xe="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",Ee="["+ve+"]",Ae="(?:"+_e+"|"+je+")",Ce="(?:"+Ee+"|"+je+")",ke="(?:['’](?:d|ll|m|re|s|t|ve))?",$e="(?:['’](?:D|LL|M|RE|S|T|VE))?",De="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Me="[\\ufe0e\\ufe0f]?",Re=Me+De+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",xe,Se].join("|")+")"+Me+De+")*"),Fe="(?:"+[Oe,xe,Se].join("|")+")"+Re,Le=RegExp([Ee+"?"+_e+"+"+ke+"(?="+[ye,Ee,"$"].join("|")+")",Ce+"+"+$e+"(?="+[ye,Ee+Ae,"$"].join("|")+")",Ee+"?"+Ae+"+"+ke,Ee+"+"+$e,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",we,Fe].join("|"),"g");var Te=de,ze=fe,Pe=D,He=function unicodeWords$1(e){return e.match(Le)||[]};var We=ne,Ie=he,Ne=function words$1(e,t,s){return e=Pe(e),void 0===(t=s?void 0:t)?ze(e)?He(e):Te(e):e.match(t)||[]},Ve=RegExp("['’]","g");var qe=function createCompounder$2(e){return function(t){return We(Ne(Ie(t).replace(Ve,"")),e,"")}},Ue=ie,Be=qe((function(e,t,s){return t=t.toLowerCase(),e+(s?Ue(t):t)}));const Ge={},setValidator=(e,t)=>{Ge[e]=t};setValidator("isDefined",(e=>void 0!==e)),setValidator("isUnDefined",(e=>void 0===e)),setValidator("isNull",(e=>null===e)),setValidator("isElement",(e=>e&&(e instanceof Element||e instanceof Window))),setValidator("isEventTarget",(e=>e&&e instanceof EventTarget)),setValidator("isString",(e=>e&&("string"==typeof e||e instanceof String))),setValidator("isArray",(e=>e&&e instanceof Array)),setValidator("notEmpty",(e=>e instanceof Array?0!==e.length:""!==e)),setValidator("isEmpty",(e=>void 0===e||!e||(e instanceof Array?0===e.length:""===e))),setValidator("isObject",(e=>e&&e instanceof Object)),setValidator("isFunction",(e=>e&&"function"==typeof e));const validate=(e,t,s)=>{const r=s.map((e=>{if(e instanceof Array){return-1!==e.map((e=>Ge[e]&&Ge[e](t))).indexOf(!0)}return Ge[e]&&Ge[e](t)}));if(-1!==r.indexOf(!1))throw new Error("call to "+e+" invalid value: "+t+" "+s,0+r)},Qe=new WeakMap,isVisible=e=>(validate("isVisible element",e,["isDefined","isElement"]),!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),setMetaData=(e,t,s)=>{validate("setMetaData element",e,["isDefined","isElement"]),validate("setMetaData k",t,["isDefined","isString"]),validate("setMetaData v",s,[["isUnDefined","isNull","isString","isObject"]]);const r=Qe.get(e)||{};s?r[t]=s:delete r[t],Qe.set(e,r)},getMetaData=(e,t)=>{validate("getMetaData element",e,["isDefined","isElement"]),validate("getMetaData k",t,["isDefined","isString"]);const s=Qe.get(e)||{};return t?s[t]:s},on=function(e,t,s,r,i,n,o){"function"==typeof r&&(o=n,n=i,i=r,r=void 0),validate("on uid",e,["isDefined","notEmpty"]),validate("on container",t,["isDefined","isEventTarget"]),validate("on events",s,["isDefined","isString"]),validate("on fn",i,["isDefined","isFunction"]),validate("on selector",r,[["isEmpty","isString"]]);const a="on:"+e+"-"+s+"-"+r;if(getMetaData(t,a))return void console.error("Error: Sargasso utils.on: duplicate event handler specification. %o %s",t,a);const c={uid:e,events:s,selector:r||void 0,fn:n=>{o&&off(e,t,s,r),r?Array.from(t.querySelectorAll(r)).forEach((e=>{(n.target===e||e.contains(n.target))&&i(n,e)})):i(n)},options:n||!1};setMetaData(t,a,c),s.split(/[\s,]+/).forEach((e=>{t.addEventListener(e.trim(),c.fn,c.options)}))},off=function(e,t,s,r){validate("off uid",e,["isDefined","notEmpty"]),validate("off container",t,["isDefined","isEventTarget"]),validate("off events",s,["isDefined","isString"]),validate("off selector",r,[["isEmpty","isString"]]);const i="on:"+e+"-"+s+"-"+r,n=getMetaData(t,i);n&&(s.split(/[\s,]+/).forEach((e=>{t.removeEventListener(e.trim(),n.fn,n.options)})),setMetaData(t,i))},Ze={hasClass:(e,t)=>{validate("hasClass element",e,["isDefined","isElement"]),validate("hasClass cssClass",t,["isDefined","notEmpty","isString"]);return-1!==(e.className||"").split(/\s+/).indexOf(t)},addClass:(e,t)=>{validate("addClass element",e,["isDefined","isElement"]),validate("addClass addClasses",t,["isDefined","notEmpty",["isString","isArray"]]);const s=(e.className||"").split(/\s+/);Array.isArray(t)||(t=t.split(/[\s,]/)),t.forEach((e=>{e=e.trim(),-1===s.indexOf(e)&&s.push(e)})),e.className=s.join(" ")},removeClass:(e,t)=>{validate("removeClass element",e,["isDefined","isElement"]),validate("removeClass removeClasses",t,["isDefined","notEmpty",["isString","isArray"]]);const s=(e.className||"").split(/\s+/);Array.isArray(t)||(t=t.split(/[\s,]/)),t.forEach((e=>{e=e.trim(),-1!==s.indexOf(e)&&s.splice(s.indexOf(e),1)})),e.className=s.join(" ")},isVisible:isVisible,inViewPort:(e,t=window)=>{validate("inViewPort element",e,["isDefined","isElement"]);const s=e.getBoundingClientRect(),r=isVisible(e),i=s.bottom<0;let n;return n=t.self===window?s.top>(window.innerHeight||document.documentElement.clientHeight):s.top>t.clientHeight,r&&!n&&!i},setCSS:(e,t)=>{validate("css element",e,["isDefined","isElement"]),validate("css css",t,["isDefined",["isObject"]]);for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){const r=Be(s);e.style[r]=null!==t[s]?t[s]:null}},setMetaData:setMetaData,getMetaData:getMetaData,on:on,off:off,once:function(e,t,s,r,i,n){"function"==typeof r&&(n=i,i=r,r=void 0),on(e,t,s,r,i,n,!0)},offAll:function(e){validate("offAll container",e,["isDefined","isEventTarget"]);const t=Qe.get(e)||{},s=[];for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&e.match(/^on:/)&&s.push(e);s.forEach((s=>{off(t[s].uid,e,t[s].events,t[s].selector)}))}};var Ke=function isObject$4(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Je=n,Ye=/\s/;var Xe=function trimmedEndIndex$1(e){for(var t=e.length;t--&&Ye.test(e.charAt(t)););return t},et=/^\s+/;var tt=function baseTrim$1(e){return e?e.slice(0,Xe(e)+1).replace(et,""):e},st=Ke,rt=j,it=/^[-+]0x[0-9a-f]+$/i,nt=/^0b[01]+$/i,ot=/^0o[0-7]+$/i,at=parseInt;var ct=Ke,now=function(){return Je.Date.now()},lt=function toNumber$1(e){if("number"==typeof e)return e;if(rt(e))return NaN;if(st(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=st(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=tt(e);var s=nt.test(e);return s||ot.test(e)?at(e.slice(2),s?2:8):it.test(e)?NaN:+e},ht=Math.max,ut=Math.min;var dt=function debounce(e,t,s){var r,i,n,o,a,c,l=0,h=!1,u=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function invokeFunc(t){var s=r,n=i;return r=i=void 0,l=t,o=e.apply(n,s)}function leadingEdge(e){return l=e,a=setTimeout(timerExpired,t),h?invokeFunc(e):o}function shouldInvoke(e){var s=e-c;return void 0===c||s>=t||s<0||u&&e-l>=n}function timerExpired(){var e=now();if(shouldInvoke(e))return trailingEdge(e);a=setTimeout(timerExpired,function remainingWait(e){var s=t-(e-c);return u?ut(s,n-(e-l)):s}(e))}function trailingEdge(e){return a=void 0,d&&r?invokeFunc(e):(r=i=void 0,o)}function debounced(){var e=now(),s=shouldInvoke(e);if(r=arguments,i=this,c=e,s){if(void 0===a)return leadingEdge(c);if(u)return clearTimeout(a),a=setTimeout(timerExpired,t),invokeFunc(c)}return void 0===a&&(a=setTimeout(timerExpired,t)),o}return t=lt(t)||0,ct(s)&&(h=!!s.leading,n=(u="maxWait"in s)?ht(lt(s.maxWait)||0,t):n,d="trailing"in s?!!s.trailing:d),debounced.cancel=function cancel(){void 0!==a&&clearTimeout(a),l=0,r=c=i=a=void 0},debounced.flush=function flush(){return void 0===a?o:trailingEdge(now())},debounced};var pt=function listCacheClear$1(){this.__data__=[],this.size=0};var ft=function eq$2(e,t){return e===t||e!=e&&t!=t},bt=ft;var gt=function assocIndexOf$4(e,t){for(var s=e.length;s--;)if(bt(e[s][0],t))return s;return-1},vt=gt,mt=Array.prototype.splice;var yt=gt;var wt=gt;var Ot=gt;var _t=pt,jt=function listCacheDelete$1(e){var t=this.__data__,s=vt(t,e);return!(s<0)&&(s==t.length-1?t.pop():mt.call(t,s,1),--this.size,!0)},xt=function listCacheGet$1(e){var t=this.__data__,s=yt(t,e);return s<0?void 0:t[s][1]},St=function listCacheHas$1(e){return wt(this.__data__,e)>-1},Et=function listCacheSet$1(e,t){var s=this.__data__,r=Ot(s,e);return r<0?(++this.size,s.push([e,t])):s[r][1]=t,this};function ListCache$4(e){var t=-1,s=null==e?0:e.length;for(this.clear();++t<s;){var r=e[t];this.set(r[0],r[1])}}ListCache$4.prototype.clear=_t,ListCache$4.prototype.delete=jt,ListCache$4.prototype.get=xt,ListCache$4.prototype.has=St,ListCache$4.prototype.set=Et;var At=ListCache$4,Ct=At;var kt=function stackClear$1(){this.__data__=new Ct,this.size=0};var $t=function stackDelete$1(e){var t=this.__data__,s=t.delete(e);return this.size=t.size,s};var Dt=function stackGet$1(e){return this.__data__.get(e)};var Mt=function stackHas$1(e){return this.__data__.has(e)},Rt=y,Ft=Ke;var Lt,Tt=function isFunction$2(e){if(!Ft(e))return!1;var t=Rt(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},zt=n["__core-js_shared__"],Pt=(Lt=/[^.]+$/.exec(zt&&zt.keys&&zt.keys.IE_PROTO||""))?"Symbol(src)_1."+Lt:"";var Ht=function isMasked$1(e){return!!Pt&&Pt in e},Wt=Function.prototype.toString;var It=function toSource$2(e){if(null!=e){try{return Wt.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Nt=Tt,Vt=Ht,qt=Ke,Ut=It,Bt=/^\[object .+?Constructor\]$/,Gt=Function.prototype,Qt=Object.prototype,Zt=Gt.toString,Kt=Qt.hasOwnProperty,Jt=RegExp("^"+Zt.call(Kt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Yt=function baseIsNative$1(e){return!(!qt(e)||Vt(e))&&(Nt(e)?Jt:Bt).test(Ut(e))},Xt=function getValue$1(e,t){return null==e?void 0:e[t]};var es=function getNative$6(e,t){var s=Xt(e,t);return Yt(s)?s:void 0},ts=es(n,"Map"),ss=es(Object,"create"),rs=ss;var is=function hashClear$1(){this.__data__=rs?rs(null):{},this.size=0};var ns=function hashDelete$1(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},os=ss,as=Object.prototype.hasOwnProperty;var cs=function hashGet$1(e){var t=this.__data__;if(os){var s=t[e];return"__lodash_hash_undefined__"===s?void 0:s}return as.call(t,e)?t[e]:void 0},ls=ss,hs=Object.prototype.hasOwnProperty;var us=ss;var ds=is,ps=ns,fs=cs,bs=function hashHas$1(e){var t=this.__data__;return ls?void 0!==t[e]:hs.call(t,e)},gs=function hashSet$1(e,t){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=us&&void 0===t?"__lodash_hash_undefined__":t,this};function Hash$1(e){var t=-1,s=null==e?0:e.length;for(this.clear();++t<s;){var r=e[t];this.set(r[0],r[1])}}Hash$1.prototype.clear=ds,Hash$1.prototype.delete=ps,Hash$1.prototype.get=fs,Hash$1.prototype.has=bs,Hash$1.prototype.set=gs;var vs=Hash$1,ms=At,ys=ts;var ws=function isKeyable$1(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Os=function getMapData$4(e,t){var s=e.__data__;return ws(t)?s["string"==typeof t?"string":"hash"]:s.map},_s=Os;var js=Os;var xs=Os;var Ss=Os;var Es=function mapCacheClear$1(){this.size=0,this.__data__={hash:new vs,map:new(ys||ms),string:new vs}},As=function mapCacheDelete$1(e){var t=_s(this,e).delete(e);return this.size-=t?1:0,t},Cs=function mapCacheGet$1(e){return js(this,e).get(e)},ks=function mapCacheHas$1(e){return xs(this,e).has(e)},$s=function mapCacheSet$1(e,t){var s=Ss(this,e),r=s.size;return s.set(e,t),this.size+=s.size==r?0:1,this};function MapCache$2(e){var t=-1,s=null==e?0:e.length;for(this.clear();++t<s;){var r=e[t];this.set(r[0],r[1])}}MapCache$2.prototype.clear=Es,MapCache$2.prototype.delete=As,MapCache$2.prototype.get=Cs,MapCache$2.prototype.has=ks,MapCache$2.prototype.set=$s;var Ds=MapCache$2,Ms=At,Rs=ts,Fs=Ds;var Ls=At,Ts=kt,zs=$t,Ps=Dt,Hs=Mt,Ws=function stackSet$1(e,t){var s=this.__data__;if(s instanceof Ms){var r=s.__data__;if(!Rs||r.length<199)return r.push([e,t]),this.size=++s.size,this;s=this.__data__=new Fs(r)}return s.set(e,t),this.size=s.size,this};function Stack$1(e){var t=this.__data__=new Ls(e);this.size=t.size}Stack$1.prototype.clear=Ts,Stack$1.prototype.delete=zs,Stack$1.prototype.get=Ps,Stack$1.prototype.has=Hs,Stack$1.prototype.set=Ws;var Is=Stack$1;var Ns=Ds,Vs=function setCacheAdd$1(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},qs=function setCacheHas$1(e){return this.__data__.has(e)};function SetCache$1(e){var t=-1,s=null==e?0:e.length;for(this.__data__=new Ns;++t<s;)this.add(e[t])}SetCache$1.prototype.add=SetCache$1.prototype.push=Vs,SetCache$1.prototype.has=qs;var Us=SetCache$1,Bs=function arraySome$1(e,t){for(var s=-1,r=null==e?0:e.length;++s<r;)if(t(e[s],s,e))return!0;return!1},Gs=function cacheHas$1(e,t){return e.has(t)};var Qs=function equalArrays$2(e,t,s,r,i,n){var o=1&s,a=e.length,c=t.length;if(a!=c&&!(o&&c>a))return!1;var l=n.get(e),h=n.get(t);if(l&&h)return l==t&&h==e;var u=-1,d=!0,p=2&s?new Us:void 0;for(n.set(e,t),n.set(t,e);++u<a;){var f=e[u],b=t[u];if(r)var g=o?r(b,f,u,t,e,n):r(f,b,u,e,t,n);if(void 0!==g){if(g)continue;d=!1;break}if(p){if(!Bs(t,(function(e,t){if(!Gs(p,t)&&(f===e||i(f,e,s,r,n)))return p.push(t)}))){d=!1;break}}else if(f!==b&&!i(f,b,s,r,n)){d=!1;break}}return n.delete(e),n.delete(t),d};var Zs=function setToArray$1(e){var t=-1,s=Array(e.size);return e.forEach((function(e){s[++t]=e})),s},Ks=n.Uint8Array,Js=ft,Ys=Qs,Xs=function mapToArray$1(e){var t=-1,s=Array(e.size);return e.forEach((function(e,r){s[++t]=[r,e]})),s},er=Zs,tr=o?o.prototype:void 0,sr=tr?tr.valueOf:void 0;var rr=function equalByTag$1(e,t,s,r,i,n,o){switch(s){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!n(new Ks(e),new Ks(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Js(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=Xs;case"[object Set]":var c=1&r;if(a||(a=er),e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=2,o.set(e,t);var h=Ys(a(e),a(t),r,i,n,o);return o.delete(e),h;case"[object Symbol]":if(sr)return sr.call(e)==sr.call(t)}return!1};var ir=function arrayPush$1(e,t){for(var s=-1,r=t.length,i=e.length;++s<r;)e[i+s]=t[s];return e},nr=c;var or=function baseGetAllKeys$1(e,t,s){var r=t(e);return nr(e)?r:ir(r,s(e))};var ar=function arrayFilter$1(e,t){for(var s=-1,r=null==e?0:e.length,i=0,n=[];++s<r;){var o=e[s];t(o,s,e)&&(n[i++]=o)}return n},cr=function stubArray$1(){return[]},lr=Object.prototype.propertyIsEnumerable,hr=Object.getOwnPropertySymbols,ur=hr?function(e){return null==e?[]:(e=Object(e),ar(hr(e),(function(t){return lr.call(e,t)})))}:cr;var dr=function baseTimes$1(e,t){for(var s=-1,r=Array(e);++s<e;)r[s]=t(s);return r},pr=y,fr=w;var br=function baseIsArguments$1(e){return fr(e)&&"[object Arguments]"==pr(e)},gr=w,vr=Object.prototype,mr=vr.hasOwnProperty,yr=vr.propertyIsEnumerable,wr=br(function(){return arguments}())?br:function(e){return gr(e)&&mr.call(e,"callee")&&!yr.call(e,"callee")},Or=wr,_r={exports:{}};var jr=function stubFalse(){return!1};!function(e,t){var s=n,r=jr,i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?s.Buffer:void 0,c=(a?a.isBuffer:void 0)||r;e.exports=c}(_r,_r.exports);var xr=/^(?:0|[1-9]\d*)$/;var Sr=function isIndex$1(e,t){var s=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==s||"symbol"!=s&&xr.test(e))&&e>-1&&e%1==0&&e<t};var Er=function isLength$2(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Ar=y,Cr=Er,kr=w,$r={};$r["[object Float32Array]"]=$r["[object Float64Array]"]=$r["[object Int8Array]"]=$r["[object Int16Array]"]=$r["[object Int32Array]"]=$r["[object Uint8Array]"]=$r["[object Uint8ClampedArray]"]=$r["[object Uint16Array]"]=$r["[object Uint32Array]"]=!0,$r["[object Arguments]"]=$r["[object Array]"]=$r["[object ArrayBuffer]"]=$r["[object Boolean]"]=$r["[object DataView]"]=$r["[object Date]"]=$r["[object Error]"]=$r["[object Function]"]=$r["[object Map]"]=$r["[object Number]"]=$r["[object Object]"]=$r["[object RegExp]"]=$r["[object Set]"]=$r["[object String]"]=$r["[object WeakMap]"]=!1;var Dr=function baseIsTypedArray$1(e){return kr(e)&&Cr(e.length)&&!!$r[Ar(e)]};var Mr=function baseUnary$1(e){return function(t){return e(t)}},Rr={exports:{}};!function(e,t){var r=s,i=t&&!t.nodeType&&t,n=i&&e&&!e.nodeType&&e,o=n&&n.exports===i&&r.process,a=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a}(Rr,Rr.exports);var Fr=Dr,Lr=Mr,Tr=Rr.exports,zr=Tr&&Tr.isTypedArray,Pr=zr?Lr(zr):Fr,Hr=dr,Wr=Or,Ir=c,Nr=_r.exports,Vr=Sr,qr=Pr,Ur=Object.prototype.hasOwnProperty;var Br=function arrayLikeKeys$1(e,t){var s=Ir(e),r=!s&&Wr(e),i=!s&&!r&&Nr(e),n=!s&&!r&&!i&&qr(e),o=s||r||i||n,a=o?Hr(e.length,String):[],c=a.length;for(var l in e)!t&&!Ur.call(e,l)||o&&("length"==l||i&&("offset"==l||"parent"==l)||n&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Vr(l,c))||a.push(l);return a},Gr=Object.prototype;var Qr=function isPrototype$1(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Gr)};var Zr=function overArg$1(e,t){return function(s){return e(t(s))}}(Object.keys,Object),Kr=Qr,Jr=Zr,Yr=Object.prototype.hasOwnProperty;var Xr=Tt,ei=Er;var ti=Br,si=function baseKeys$1(e){if(!Kr(e))return Jr(e);var t=[];for(var s in Object(e))Yr.call(e,s)&&"constructor"!=s&&t.push(s);return t},ri=function isArrayLike$1(e){return null!=e&&ei(e.length)&&!Xr(e)};var ii=or,ni=ur,oi=function keys$1(e){return ri(e)?ti(e):si(e)};var ai=function getAllKeys$1(e){return ii(e,oi,ni)},ci=Object.prototype.hasOwnProperty;var li=function equalObjects$1(e,t,s,r,i,n){var o=1&s,a=ai(e),c=a.length;if(c!=ai(t).length&&!o)return!1;for(var l=c;l--;){var h=a[l];if(!(o?h in t:ci.call(t,h)))return!1}var u=n.get(e),d=n.get(t);if(u&&d)return u==t&&d==e;var p=!0;n.set(e,t),n.set(t,e);for(var f=o;++l<c;){var b=e[h=a[l]],g=t[h];if(r)var v=o?r(g,b,h,t,e,n):r(b,g,h,e,t,n);if(!(void 0===v?b===g||i(b,g,s,r,n):v)){p=!1;break}f||(f="constructor"==h)}if(p&&!f){var m=e.constructor,y=t.constructor;m==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof m&&m instanceof m&&"function"==typeof y&&y instanceof y||(p=!1)}return n.delete(e),n.delete(t),p},hi=es(n,"DataView"),ui=ts,di=es(n,"Promise"),pi=es(n,"Set"),fi=es(n,"WeakMap"),bi=y,gi=It,vi="[object Map]",mi="[object Promise]",yi="[object Set]",wi="[object WeakMap]",Oi="[object DataView]",_i=gi(hi),ji=gi(ui),xi=gi(di),Si=gi(pi),Ei=gi(fi),Ai=bi;(hi&&Ai(new hi(new ArrayBuffer(1)))!=Oi||ui&&Ai(new ui)!=vi||di&&Ai(di.resolve())!=mi||pi&&Ai(new pi)!=yi||fi&&Ai(new fi)!=wi)&&(Ai=function(e){var t=bi(e),s="[object Object]"==t?e.constructor:void 0,r=s?gi(s):"";if(r)switch(r){case _i:return Oi;case ji:return vi;case xi:return mi;case Si:return yi;case Ei:return wi}return t});var Ci=Is,ki=Qs,$i=rr,Di=li,Mi=Ai,Ri=c,Fi=_r.exports,Li=Pr,Ti="[object Arguments]",zi="[object Array]",Pi="[object Object]",Hi=Object.prototype.hasOwnProperty;var Wi=function baseIsEqualDeep$1(e,t,s,r,i,n){var o=Ri(e),a=Ri(t),c=o?zi:Mi(e),l=a?zi:Mi(t),h=(c=c==Ti?Pi:c)==Pi,u=(l=l==Ti?Pi:l)==Pi,d=c==l;if(d&&Fi(e)){if(!Fi(t))return!1;o=!0,h=!1}if(d&&!h)return n||(n=new Ci),o||Li(e)?ki(e,t,s,r,i,n):$i(e,t,c,s,r,i,n);if(!(1&s)){var p=h&&Hi.call(e,"__wrapped__"),f=u&&Hi.call(t,"__wrapped__");if(p||f){var b=p?e.value():e,g=f?t.value():t;return n||(n=new Ci),i(b,g,s,r,n)}}return!!d&&(n||(n=new Ci),Di(e,t,s,r,i,n))},Ii=w;var Ni=function baseIsEqual$1(e,t,s,r,i){return e===t||(null==e||null==t||!Ii(e)&&!Ii(t)?e!=e&&t!=t:Wi(e,t,s,r,baseIsEqual$1,i))},Vi=Ni;var qi=function isEqual(e,t){return Vi(e,t)};const Ui={},buildProxy=e=>({get(t,s){const r=Reflect.get(t,s);return r&&"object"==typeof r?new Proxy(r,buildProxy(e)):r},set:(t,s,r)=>(e.sync(s),Reflect.set(t,s,r)),deleteProperty:(t,s)=>(e.sync(s),Reflect.deleteProperty(t,s))});class ObservableObject{constructor(e,t={},s={}){if(this.id=e,Ui[this.id])throw new Error("ObservableObject "+e+" already exists.");this.bound={},this.data=new Proxy(t,buildProxy(this)),this.options=s,Ui[this.id]=this}destroy(){delete Ui[this.id],delete this.data,Object.keys(this.bound).forEach((e=>{Object.keys(this.bound[e]).forEach((t=>{this.unbind(t,e)}))}))}getBoundData(){return this.data}set(e,t){qi(this.get(e),t)||(this.data[e]=t)}get(e){return this.data[e]}delete(e){delete this.data[e]}syncAll(){Object.keys(this.data||{}).forEach((e=>{this.sync(e)}))}bind(e,t,s="*"){this.bound[s]||(this.bound[s]={}),this.bound[s][e]=t,Object.keys(this.data).forEach((e=>{t(this.id,e,this.get(e))}))}unbind(e,t="*"){this.bound[t]&&this.bound[t][e]&&delete this.bound[t][e]}sync(e){Object.keys(this.bound["*"]||{}).forEach((t=>{this.bound["*"][t](this.id,e,this.get(e))})),Object.keys(this.bound[e]||{}).forEach((t=>{this.bound[e][t](this.id,e,this.get(e))}))}}let Bi,Gi,Qi,Zi,Ki,Ji;class ObserverSubscriptionManager{constructor(e){this.options=e,this.observers=[],this.pendingAnimationFrame=void 0,this.frameQueue=[],this.sleeping=!0}subscribe(e){!this.observers.length&&this.sleeping&&this.wakeup(),this.observers.push(e)}unSubscribe(e){-1!==this.observers.indexOf(e)&&this.observers.splice(this.observers.indexOf(e),1),this.observers.length||this.sleep()}sleep(){this.sleeping=!0}wakeup(){this.sleeping=!1}notifyObservers(e,t){for(let s=0;s<this.observers.length;s++)this.observers[s][e]&&this.observers[s][e].apply(this.observers[s],t||[])}flushQueue(){this.pendingAnimationFrame&&(cancelAnimationFrame(this.pendingAnimationFrame),this.pendingAnimationFrame=void 0),this.frameQueue=[]}queueFrame(e){this.frameQueue.push(e.bind(this)),this.pendingAnimationFrame||(this.pendingAnimationFrame=requestAnimationFrame((()=>{this.processQueue()})))}processQueue(){this.pendingAnimationFrame=void 0;const e=this.frameQueue.slice(0);this.frameQueue=[];for(let t=0;t<e.length;t++)e[t]()}}class DOMWatcher extends ObserverSubscriptionManager{constructor(e={}){super(e),this.mutationHandler=dt(((e,t)=>{this.observeDOM(this.options.shadowDOM||document.body)}),25,{maxWait:100}),this.mutationObserver=new MutationObserver(this.mutationHandler,!1)}subscribe(e){super.subscribe(e),e.watchDOM(this.options.shadowDOM||document.body)}wakeup(){super.wakeup(),this.mutationObserver.observe(this.options.shadowDOM||document.body,{childList:!0,subtree:!0})}sleep(){super.sleep(),this.mutationObserver.disconnect()}observeDOM(e){this.notifyObservers("watchDOM",[e||this.options.shadowDOM||document.body])}}Bi=new DOMWatcher,Gi=new class ScrollWatcher extends ObserverSubscriptionManager{constructor(e={}){super(e),this.scrollElement=this.options.scrollElement||window,this.lastscroll=0,this.scrolling=!1}trigger(){this.scrolling||this.scrollLoop()}scrollLoop(){if(this.lastscroll!==this.scrollTop()){this.scrolling=!0,this.lastscroll=this.scrollTop(),this.watchScroll();const frame=()=>{this.scrollLoop()};this.queueFrame(frame)}else this.scrolling=!1}setOptions(e={}){this.sleep(),this.scrollElement=e.scrollElement||window,this.wakeup()}subscribe(e){super.subscribe(e),e.watchScroll()}wakeup(){super.wakeup(),Ze.on("theScrollWatcher",this.scrollElement,"scroll",(()=>{this.trigger()}))}sleep(){super.sleep(),Ze.off("theScrollWatcher",this.scrollElement,"scroll")}inViewPort(e){return Ze.inViewPort(e,this.scrollElement)}watchScroll(){this.notifyObservers("watchScroll")}scrollTop(e){if(this.scrollElement===window){if(void 0===e)return window.pageYOffset;window.scrollTo(0,e)}else{if(void 0===e)return this.scrollElement.scrollTop;this.scrollElement.scrollTop=e}}},Qi=new class ResizeWatcher extends ObserverSubscriptionManager{constructor(e){super(e),this.debounce=dt((()=>{this.watchResize()}),250)}subscribe(e){super.subscribe(e),e.watchResize()}wakeup(){super.wakeup(),window.addEventListener("resize",this.debounce,!1)}sleep(){super.sleep(),window.removeEventListener("resize",this.debounce)}watchResize(){this.notifyObservers("watchResize")}},Zi=new class OrientationWatcher extends ObserverSubscriptionManager{constructor(e){super(e),"onorientationchange"in window?Ze.addClass(document.body,"have-orientation"):Ze.addClass(document.body,"no-orientation"),this.debounce=dt((()=>{this.watchOrientation()}),250)}subscribe(e){super.subscribe(e),e.watchOrientation()}wakeup(){super.wakeup(),"onorientationchange"in window&&window.addEventListener("orientationchange",this.debounce,!1)}sleep(){super.sleep(),"onorientationchange"in window&&window.removeEventListener("orientationchange",this.debounce)}watchOrientation(){this.notifyObservers("watchOrientation")}},Ki=new class WorkerWatcher extends ObserverSubscriptionManager{constructor(e){super(e),this.workers={}}registerWorker(e,t){if(!this.workers[e]){let s=t,r=!1;if(!t.match(/^(http|\/)/i)){const e=new Blob([t],{type:"text/javascript"});s=URL.createObjectURL(e),r=!0}this.workers[e]={worker:new Worker(s),observers:[]},r&&URL.revokeObjectURL(s),this.workers[e].worker.onmessage=t=>{this.workerMessage(e,t)}}return this.workers[e].worker}subscribe(e,t){if(!this.workers[t])throw new Error("worker "+t+" does not exist");this.workers[t].observers.push(e),super.subscribe(e)}unSubscribe(e,t){if(!this.workers[t])throw new Error("worker "+t+" does not exist");const s=this.workers[t].observers;-1!==s.indexOf(e)&&s.splice(s.indexOf(e),1),s.length||(this.workers[t].worker.terminate(),delete this.workers[t]),super.unSubscribe(e)}workerMessage(e,t){this.workers[e].observers.forEach((s=>{s.workerMessage&&s.workerMessage(e,t)}))}wakeup(){super.wakeup()}sleep(){super.sleep()}},Ji=new class ObservableObjectWatcher extends ObserverSubscriptionManager{constructor(e){super(e),this.registeredObservableObjects={}}getObservable(e){return this.registeredObservableObjects[e]?this.registeredObservableObjects[e].observable:void 0}observableStart(e,t){const s=(e=>Ui[e])(e);if(s&&void 0!==t)throw new Error("ObservableObject "+e+" already exists, can't build.");return this.registeredObservableObjects[e]||(this.registeredObservableObjects[e]=s?{id:e,observable:s,observers:[],managed:!1}:{id:e,observable:new ObservableObject(e,t),observers:[],managed:!0},this.registeredObservableObjects[e].observable.bind(this.constructor.name,this.notify.bind(this))),this.registeredObservableObjects[e].observable}observableDestroy(e){if(!this.registeredObservableObjects[e])throw new Error("ObservableObject observableDestroy "+e+" does not exist");this.registeredObservableObjects[e].observable.unbind(this.constructor.name),this.registeredObservableObjects[e].observable.destroy(),delete this.registeredObservableObjects[e]}subscribe(e,t,s){this.registeredObservableObjects[t]||this.observableStart(t,s),this.registeredObservableObjects[t].observers.push(e),super.subscribe(e)}unSubscribe(e,t){if(!this.registeredObservableObjects[t])throw new Error("ObservableObject unSubscribe "+t+" does not exist");const s=this.registeredObservableObjects[t].observers;-1!==s.indexOf(e)&&s.splice(s.indexOf(e),1),!s.length&&this.registeredObservableObjects[t].managed&&this.observableDestroy(t),super.unSubscribe(e)}notify(e,t,s,r){if(!this.registeredObservableObjects[e])throw new Error("ObservableObject notify "+e+" does not exist");this.registeredObservableObjects[e].observers.forEach((i=>{i.observableChanged&&i.observableChanged(e,t,s,r)}))}};var Yi=qe((function(e,t,s){return e+(s?"-":"")+t.toLowerCase()}));let Xi=0;const en=[],tn="customElements"in window,sn={},registerSargassoClass=(e,t)=>{if(sn[e])throw new Error("Sargasso class "+e+" is already registered.");if(sn[e]=t,tn){const t=new Function("registeredClasses",`\n\t\t\treturn class ${e}Element extends HTMLElement {\n\t\t\t\tconstructor(element, options = {}) {\n\t\t\t\t\tsuper()\n\t\t\t\t\tthis.helperClass= '${e}'\n\t\t\t\t\tthis.helpers = []\n\t\t\t\t}\n\n\t\t\t\tconnectedCallback () {\n\t\t\t\t\tthis.helpers.push(new registeredClasses[this.helperClass](this,{isCustomElement:true}))\n\t\t\t\t\tif (this.hasAttributes()) {\n\t\t\t\t\t\tfor(let i = 0; i < this.attributes.length; i++) {\n\t\t\t\t\t\t\tif(this.attributes[i].name.match(/^sargasso-/)) {\n\t\t\t\t\t\t\t\tlet classname = this.attributes[i].name.replace(/^sargasso-/,'').split('-').map(word=> word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join('')\n\t\t\t\t\t\t\t\tif(!registeredClasses[classname]) {\n\t\t\t\t\t\t\t\t\tconsole.log('instantiate by attribute ' + this.attributes[i].name + ' > ' + classname + ' is not a sargasso class')\n\t\t\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.helpers.push(new registeredClasses[classname](this,{isCustomElement:true}))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.helpers.forEach((helper) => {\n\t\t\t\t\t\thelper.start()\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\tdisconnectedCallback () {\n\t\t\t\t\tthis.helpers.forEach((helper) => {\n\t\t\t\t\t\thelper.sleep()\n\t\t\t\t\t\thelper.destroy()\n\t\t\t\t \t})\n\t\t\t\t\tthis.helpers = [] // nuke the reference for trash collection\n\t\t\t\t}\n\t\t\t}`)(sn);customElements.define("sargasso-"+Yi(e),t)}},rn=["DOMChanged","didScroll","didResize","didBreakpoint","enterViewport","exitViewport","enterFullscreen","exitFullscreen","newPage","elementEvent","workerOnMessage","observableChanged"];class Sargasso{constructor(e,t={}){validate("Sargasso constructor element",e,["isDefined","isElement"]),validate("Sargasso constructor options",t,["isDefined",["isObject"]]),this.uid=++Xi,this.element=e,t.shadowDOM&&(this._shadowDOM=e.attachShadow({mode:"open"}),this._shadowRoot=document.createElement("div"),this._shadowDOM.append(this._shadowRoot),this._hostElement=this.element,this.element=this._shadowRoot),this.options=t,this._pendingAnimationFrame=void 0,this._frameQueue=[],this._isInViewport=!1,this._workers={},this._observables={},this._template=void 0,this._templateArgs={},this._started=!1,this.render=dt((()=>{this._render()}),100,{maxWait:250})}start(){const e=this.getMetaData("registeredResponsiveControllers")||[];e.push(this),this.setMetaData("registeredResponsiveControllers",e),this.setMetaData(this.constructor.name,this),en.push(this),this._shadowDOM&&(this._shadowDOMWatcher||(this._shadowDOMWatcher=new DOMWatcher({shadowDOM:this._shadowRoot})),this._shadowDOMWatcher.subscribe(this)),this.options.watchDOM&&Bi.subscribe(this),(this.options.watchScroll||this.options.watchViewport)&&Gi.subscribe(this),(this.options.watchResize||this.options.watchViewport)&&Qi.subscribe(this),(this.options.watchOrientation||this.options.watchViewport)&&Zi.subscribe(this),this.elementListener=e=>{e.detail&&e.detail.sargassoEvent&&-1!==rn.indexOf(e.detail.sargassoEvent)?this[e.detail.sargassoEvent].apply(this,e.detail.sargassoEventOptions||[]):this.elementEvent(e)},this.element.addEventListener("sargasso",this.elementListener),this._started=!0}sleep(){this._shadowDOM&&this._shadowDOMWatcher.unSubscribe(this),this.options.watchDOM&&Bi.unSubscribe(this),(this.options.watchScroll||this.options.watchViewport)&&Gi.unSubscribe(this),(this.options.watchResize||this.options.watchViewport)&&Qi.unSubscribe(this),(this.options.watchOrientation||this.options.watchViewport)&&Zi.unSubscribe(this),this.element.removeEventListener("sargasso",this.elementListener),Ze.offAll(this.element),this._started=!1}DOMChanged(e){}didScroll(){}didResize(){}didBreakpoint(){}enterViewport(){}exitViewport(){}enterFullscreen(){}exitFullscreen(){}newPage(e,t){}elementEvent(e){}workerOnMessage(e,t){}observableChanged(e,t,s){this.render()}setMetaData(e,t){Ze.setMetaData(this.element,e,t)}getMetaData(e){return Ze.getMetaData(this.element,e)}on(e,t,s,r){Ze.on(this.constructor.name+"-"+this.uid,this.element,e,t,s,r)}off(e,t){Ze.off(this.constructor.name+"-"+this.uid,this.element,e,t)}once(e,t,s,r){Ze.once(this.constructor.name+"-"+this.uid,this.element,e,t,s,r)}notifyAll(e,t){if(-1===rn.indexOf(e))throw new Error("invalid event name "+e);for(let s=0;s<en.length;s++){const r=en[s];r!==this&&r[e]&&r[e].apply(r,t)}}notifyElement(e,t,s){if(-1===rn.indexOf(t))throw new Error("invalid event name "+t);const r=this.getMetaData("registeredResponsiveControllers");if(r)for(let e=0;e<r.length;e++){const i=r[e];i!==this&&i[t]&&i[t].apply(i,s)}}queueFrame(e){this._frameQueue.push(e.bind(this)),this._pendingAnimationFrame||(this._pendingAnimationFrame=requestAnimationFrame((()=>{this._processQueue()})))}wantFullscreen(e){e?this.enterFullscreen():this.exitFullscreen()}hasClass(e){return Ze.hasClass(this.element,e)}addClass(e){Ze.addClass(this.element,e)}removeClass(e){Ze.removeClass(this.element,e)}setCSS(e){Ze.setCSS(this.element,e)}isVisible(){return Ze.isVisible(this.element)}workerStart(e,t){return this._workers[e]=Ki.registerWorker(e,t),Ki.subscribe(this,e),this._workers[e]}workerPostMessage(e,t){t.uid||(t.uid=this.uid),this._workers[e]&&this._workers[e].postMessage(t)}getObservable(e){return this._observables[e]}observableStart(e,t){return Ji.subscribe(this,e,t),this._observables[e]=Ji.getObservable(e),this._observables[e]}observableStop(e){this._observables[e]&&(Ji.unSubscribe(this,e),delete this._observables[e])}observableStopAll(){for(const e in this._observables)this.observableStop(e)}setTemplate(e){this._template=e}setRenderer(e){this.renderer=e}setTemplateArgs(e={}){this._templateArgs=e.constructor&&"ObservableObject"===e.constructor.name?e.data:e,this.render()}getTemplateArgs(){return JSON.parse(JSON.stringify(this._templateArgs||{}))}_render(){this._template&&this.renderer&&this.renderer(this._template(this.getTemplateArgs()),this.element)}_flushQueue(){this._pendingAnimationFrame&&(cancelAnimationFrame(this._pendingAnimationFrame),this._pendingAnimationFrame=void 0),this._frameQueue=[]}_processQueue(){this._pendingAnimationFrame=void 0;const e=this._frameQueue.slice(0);this._frameQueue=[];for(let t=0;t<e.length;t++)e[t]()}_stopWorker(e){this._workers[e]&&(Ki.unSubscribe(this,e),delete this._workers[e])}_stopAllWorkers(){for(const e in this._workers)this._stopWorker(e)}destroy(){this._stopAllWorkers(),this.observableStopAll(),this._flushQueue(),this._started&&this.sleep();const e=this.getMetaData("registeredResponsiveControllers");e&&-1!==e.indexOf(this)&&(e.splice(e.indexOf(this),1),this.setMetaData("registeredResponsiveControllers",e)),this.setMetaData(this.constructor.name,null),this.element=null,-1!==en.indexOf(this)&&en.splice(en.indexOf(this),1)}watchDOM(e){e===this._shadowRoot?Bi.observeDOM(this._shadowRoot):this.DOMChanged(e)}watchScroll(){this.options.watchViewport&&this.inViewport(),this.didScroll()}watchResize(){this.options.watchViewport&&this.inViewport(),this.didResize()}watchOrientation(){!window.orientation||90!==window.orientation&&-90!==window.orientation?this.wantFullscreen(!1):this.wantFullscreen(!0)}inViewport(){Gi.inViewPort(this.element)?this._isInViewport||(this.enterViewport(),this._isInViewport=!0):this._isInViewport&&(this.exitViewport(),this._isInViewport=!1)}workerMessage(e,t){t.data.uid===this.uid&&this.workerOnMessage(e,t.data)}nativeRequestFullScreen(){if(document.fullscreenElement){if(document.fullscreenElement===this.element)return;document.exitFullscreen()}this.element.requestFullscreen()}nativeExitFullScreen(){document.fullscreenElement&&document.fullscreenElement===this.element&&document.exitFullscreen()}}registerSargassoClass("Sargasso",Sargasso);class LazyInstantiate extends Sargasso{constructor(e,t={}){t.watchScroll=!0,t.watchResize=!0,t.watchDOM=!0,t.immortal=!0,super(e,t)}didResize(){super.didResize(),this.lazyHandler()}didScroll(){super.didScroll(),this.lazyHandler()}DOMChanged(e){super.DOMChanged(e),this.lazyHandler(e)}lazyHandler(e=document){const t=e.querySelectorAll("[data-lazy-sargasso-class]");for(let e=0;e<t.length;e++){const s=t[e];if(Gi.inViewPort(s)){const r=s.getAttribute("data-lazy-sargasso-class").split(/\s*,\s*/);for(let s=0;s<r.length;s++){new sn[r[s]](t[e]).start()}s.removeAttribute("data-lazy-sargasso-class")}}}}registerSargassoClass("LazyInstantiate",LazyInstantiate);class SargassoSupervisor extends Sargasso{constructor(e,t={}){super(e,{watchDOM:!0,mortal:!1}),this.lazy=new LazyInstantiate(e,t)}start(){this.lazy.start(),super.start()}instantiate(e){const t=e.getAttribute("data-sargasso-class").split(/\s*,\s*/);for(let s=0;s<t.length;s++)try{new sn[t[s]](e).start()}catch(e){console.log("error instantiating "+t[s],e,sn)}e.removeAttribute("data-sargasso-class")}newPage(){this.doIt()}DOMChanged(e){this.doIt(e)}doIt(e=document.body){e.getAttribute("data-sargasso-class")&&this.instantiate(e);const t=e.querySelectorAll("[data-sargasso-class]");for(const e of t)this.instantiate(e);const s=[];for(let e=0;e<en.length;e++)en[e].options.immortal||en[e].options.isCustomElement||document.body.contains(en[e].element)||s.push(en[e]);for(let e=0;e<s.length;e++)s[e].destroy()}}registerSargassoClass("SargassoSupervisor",SargassoSupervisor);var nn={},an=t&&t.__assign||function(){return an=Object.assign||function(e){for(var t,s=1,r=arguments.length;s<r;s++)for(var i in t=arguments[s])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},an.apply(this,arguments)};function stringifyAttribute(e,t){if(!t)return"";var s="; "+e;return!0===t?s:s+"="+t}function encode(e,t,s){return encodeURIComponent(e).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(t).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function stringifyAttributes(e){if("number"==typeof e.expires){var t=new Date;t.setMilliseconds(t.getMilliseconds()+864e5*e.expires),e.expires=t}return stringifyAttribute("Expires",e.expires?e.expires.toUTCString():"")+stringifyAttribute("Domain",e.domain)+stringifyAttribute("Path",e.path)+stringifyAttribute("Secure",e.secure)+stringifyAttribute("SameSite",e.sameSite)}(s)}nn.__esModule=!0;nn.encode=encode;function parse(e){for(var t={},s=e?e.split("; "):[],r=/(%[\dA-F]{2})+/gi,i=0;i<s.length;i++){var n=s[i].split("="),o=n.slice(1).join("=");'"'===o.charAt(0)&&(o=o.slice(1,-1));try{t[n[0].replace(r,decodeURIComponent)]=o.replace(r,decodeURIComponent)}catch(e){}}return t}nn.parse=parse;function getAll(){return parse(document.cookie)}nn.getAll=getAll;nn.get=function get(e){return getAll()[e]};function set(e,t,s){document.cookie=encode(e,t,an({path:"/"},s))}nn.set=set;nn.remove=function remove(e,t){set(e,"",an(an({},t),{expires:-1}))};const cn=[{className:"screen-xs",maxWidth:599},{className:"screen-sm",maxWidth:1023},{className:"screen-md",maxWidth:1439},{className:"screen-lg",maxWidth:1999},{className:"screen-xl",maxWidth:void 0}];class Breakpoints extends Sargasso{constructor(e,t={}){t.watchResize=!0,super(e,t),t.widths?this.options.widths=t.widths:this.options.widths=cn,this.scale=void 0,this.disabled=!1,this.forceScale=void 0,this.orientation=void 0,this.widths=[],this.classes=[]}start(){super.start();let e=".show-hide{display:none;}\n";this.widths.push(0);for(let t=0;t<this.options.widths.length;t++)this.options.widths[t].maxWidth&&this.widths.push(this.options.widths[t].maxWidth),this.classes.push(this.options.widths[t].className),e+="."+this.options.widths[t].className+" .hidden-"+this.options.widths[t].className+"{display:none;}\n",e+=".not-"+this.options.widths[t].className+" .hidden-not-"+this.options.widths[t].className+"{display:none;}\n",e+="."+this.options.widths[t].className+" .shown-"+this.options.widths[t].className+"{display:block;}\n",e+=".not-"+this.options.widths[t].className+" .shown-not-"+this.options.widths[t].className+"{display:block;}\n";const t=document.createElement("style");t.type="text/css",t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t),this.detectGeometry()}didResize(){super.didResize(),this.detectGeometry()}disableResponsive(e){Ze.addClass(document.body,"disable-responsive"),this.disabled=!0,this.forceScale=e,this.detectGeometry()}enableResponsive(){Ze.removeClass(document.body,"disable-responsive"),this.disabled=!1,this.forceScale="",this.detectGeometry()}detectGeometry(){let e=this.classes[this.widths.length-1];if(this.disabled)e=this.forceScale;else{const t=window.innerWidth;if(window.innerHeight>t){if("portrait"!==this.orientation){const frame=()=>{Ze.removeClass(document.body,"landscape"),Ze.addClass(document.body,"portrait")};this.queueFrame(frame),this.orientation="portrait"}}else if("landscape"!==this.orientation){const frame=()=>{Ze.removeClass(document.body,"portrait"),Ze.addClass(document.body,"landscape")};this.queueFrame(frame),this.orientation="landscape"}for(let s=0;s<this.widths.length-1;s++)if(t>=this.widths[s]&&t<this.widths[s+1]){e=this.classes[s];break}}let t=0;if(e!==this.scale){++t;const frame=()=>{for(let t=0;t<this.classes.length;t++)this.classes[t]!==e?(Ze.addClass(document.body,"not-"+this.classes[t]),Ze.removeClass(document.body,this.classes[t]),Ze.removeClass(document.body,"shown-"+this.classes[t]),Ze.removeClass(document.body,"hidden-"+this.classes[t])):Ze.removeClass(document.body,"not-"+this.classes[t]);Ze.addClass(document.body,e),Ze.addClass(document.body,"shown-"+e),Ze.addClass(document.body,"hidden-"+e),this.notifyAll("didBreakpoint",[e])};this.queueFrame(frame)}this.scale=e,t&&this.setHints()}setHints(){let e="";this.scale&&(e&&(e+=" "),e+=this.scale),e!==this.getCookie("responsive")&&this.setCookie("responsive",e)}getCookie(e){return nn.get(e)}setCookie(e,t,s){const r={path:"/",domain:this.options.cookieDomain||null,expires:s};nn.set(e,t,r)}deleteCookie(e){this.setCookie(e,null)}}registerSargassoClass("Breakpoints",Breakpoints);class HijaxLoader extends Sargasso{constructor(e,t={}){t.watchDOM=!0,t.immortal=!0,super(e,t),this.excludeRegex=new RegExp("^(//|http|javascript|mailto|#)","i"),this.currentPage=location.pathname+location.search,this.cachedMarkup={}}start(){const e=document.querySelectorAll("[data-hijax-skip-unchanged]");for(let t=0;t<e.length;t++){const s=e[t],r=s.getAttribute("id");this.cachedMarkup[r]=s.innerHTML}super.start(),window.addEventListener("popstate",(e=>{this.watchPopState(e)}),!1)}DOMChanged(e){super.DOMChanged(e),this.hijaxLinks(e)}watchPopState(e){location.pathname+location.search!==this.currentPage&&this.preFlight(location.pathname+location.search)}hijaxLinks(e){const t=e?e.getElementsByTagName("a"):this.element.getElementsByTagName("a");for(let e=0;e<t.length;e++){const s=t[e],r=s.getAttribute("href");!r||s.getAttribute("data-hijaxed")||s.getAttribute("target")||s.hasAttribute("data-no-hijax")||this.excludeRegex.exec(r)||(s.setAttribute("data-hijaxed",!0),s.addEventListener("click",(e=>{e.preventDefault(),this.setPage(r)}),!1))}}setPage(e,t){e===this.currentPage||t?this.preFlight(e):(history.pushState(null,null,e),this.watchPopState())}preFlight(e){if(!this.options.preFlight)return this.loadPage(e);this.options.preFlight(e,((t,s,r)=>{t&&(this.options.onError?this.options.onError("danger",t):alert("Error loading page: "+t)),s?this.currentPage=location.pathname+location.search:this.loadPage(r||e)}))}loadPage(e){this.queueFrame((()=>{Ze.addClass(document.body,"hijax-loading")})),this.options.onExitPage&&this.options.onExitPage();const t=new XMLHttpRequest;t.open("GET",e),t.setRequestHeader("Sargasso-Hijax",1),t.setRequestHeader("x-digitopia-hijax",1),this.options.onLoading&&(this.options.onLoading(),t.onreadystatechange=this.options.onLoading),t.onload=()=>{if(301===t.status||302===t.status||t.getResponseHeader("Sargasso-Location")){const e=t.getResponseHeader("Location")?t.getResponseHeader("Location"):t.getResponseHeader("Sargasso-Location");this.setPage(e)}else if(200===t.status){Gi.scrollTop(0),this.mergePage(t.responseText);const e=this.currentPage,frame=()=>{this.notifyAll("newPage",[e,location.pathname+location.search]),Ze.removeClass(document.body,"hijax-loading")};this.queueFrame(frame),this.currentPage=location.pathname+location.search}else{const e=t.getResponseHeader("Sargasso-Flash-Level")||"danger";let s=t.getResponseHeader("Sargasso-Flash-Message")||t.statusText;s||(s="Could not connect to server."),this.options.onError?this.options.onError(e,s):alert("Error loading page: "+s)}},t.send()}processScripts(e){Array.from(e).forEach((e=>{e.remove();const t=e.getAttribute("id");document.getElementById(t)||document.getElementsByTagName("head")[0].appendChild(e)}))}mergePage(e){const t=document.querySelectorAll("[data-ephemeral]");Array.from(t).forEach((e=>{e.remove()}));const s=e.split(/(<body[^>]*>|<\/body>)/gi),r=makeFragment(s[2]),i=document.querySelectorAll("[data-hijax]");for(let e=0;e<i.length;e++){const t=i[e],s=t.getAttribute("id"),n=r.getElementById(s);if(t.hasAttribute("data-hijax-skip-unchanged")){if(this.cachedMarkup[s]===n.innerHTML)continue;this.cachedMarkup[s]=n.innerHTML}const o=t.getAttribute("data-hijax-cache-key-selector");if(o&&n.querySelector(o)&&t.querySelector(o)&&t.querySelector(o).getAttribute("data-hijax-cache-key")===n.querySelector(o).getAttribute("data-hijax-cache-key"))continue;this.processScripts(n.querySelectorAll("script"));const frame=()=>{t.parentNode.replaceChild(n,t),this.options.onEnterPage&&this.options.onEnterPage(),this.hijaxLinks(n)};this.queueFrame(frame)}}}registerSargassoClass("HijaxLoader",HijaxLoader);const makeFragment=e=>{if(document.createRange&&document.createRange().createContextualFragment)return document.createRange().createContextualFragment(e);const t=document.createDocumentFragment(),s=document.createElement("div");return s.insertAdjacentHTML("afterBegin",e),t.appendChild(s),t};e.loadPageHandler=void 0;const ln={registerSargassoClass:registerSargassoClass,bootSargasso:(t={})=>{if(t.scrollElement&&Gi.setOptions(t),t.breakpoints){new Breakpoints(document.body,t.breakpoints).start()}if(t.hijax){const s=new HijaxLoader(document.body,t.hijax);s.start(),e.loadPageHandler=s.setPage.bind(s)}else e.loadPageHandler=e=>{document.location.href=e};new SargassoSupervisor(document.body,t).start(t)},elementTools:Ze,validate:validate,setValidator:setValidator},hn={theDOMWatcher:Bi,theScrollWatcher:Gi,theResizeWatcher:Qi,theOrientationWatcher:Zi,theWorkerWatcher:Ki,theObservableObjectWatcher:Ji};return e.ObservableObject=ObservableObject,e.Sargasso=Sargasso,e.services=hn,e.utils=ln,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
var SargassoModule=function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var s="object"==typeof t&&t&&t.Object===Object&&t,r=s,i="object"==typeof self&&self&&self.Object===Object&&self,n=r||i||Function("return this")(),o=n.Symbol;var a=function arrayMap$1(e,t){for(var s=-1,r=null==e?0:e.length,i=Array(r);++s<r;)i[s]=t(e[s],s,e);return i},c=Array.isArray,l=o,h=Object.prototype,u=h.hasOwnProperty,d=h.toString,p=l?l.toStringTag:void 0;var f=function getRawTag$1(e){var t=u.call(e,p),s=e[p];try{e[p]=void 0;var r=!0}catch(e){}var i=d.call(e);return r&&(t?e[p]=s:delete e[p]),i},b=Object.prototype.toString;var g=f,v=function objectToString$1(e){return b.call(e)},m=o?o.toStringTag:void 0;var y=function baseGetTag$5(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":m&&m in Object(e)?g(e):v(e)};var w=function isObjectLike$5(e){return null!=e&&"object"==typeof e},O=y,_=w;var j=function isSymbol$2(e){return"symbol"==typeof e||_(e)&&"[object Symbol]"==O(e)},x=a,S=c,E=j,A=o?o.prototype:void 0,C=A?A.toString:void 0;var k=function baseToString$1(e){if("string"==typeof e)return e;if(S(e))return x(e,baseToString$1)+"";if(E(e))return C?C.call(e):"";var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t},$=k;var D=function toString$4(e){return null==e?"":$(e)};var M=function baseSlice$1(e,t,s){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(s=s>i?i:s)<0&&(s+=i),i=t>s?0:s-t>>>0,t>>>=0;for(var n=Array(i);++r<i;)n[r]=e[r+t];return n};var R=function castSlice$1(e,t,s){var r=e.length;return s=void 0===s?r:s,!t&&s>=r?e:M(e,t,s)},F=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var L=function hasUnicode$2(e){return F.test(e)};var T=function asciiToArray$1(e){return e.split("")},z="[\\ud800-\\udfff]",P="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",H="\\ud83c[\\udffb-\\udfff]",W="[^\\ud800-\\udfff]",I="(?:\\ud83c[\\udde6-\\uddff]){2}",N="[\\ud800-\\udbff][\\udc00-\\udfff]",V="(?:"+P+"|"+H+")"+"?",q="[\\ufe0e\\ufe0f]?",U=q+V+("(?:\\u200d(?:"+[W,I,N].join("|")+")"+q+V+")*"),B="(?:"+[W+P+"?",P,I,N,z].join("|")+")",G=RegExp(H+"(?="+H+")|"+B+U,"g");var Q=T,Z=L,K=function unicodeToArray$1(e){return e.match(G)||[]};var J=R,Y=L,X=function stringToArray$1(e){return Z(e)?K(e):Q(e)},ee=D;var te=function createCaseFirst$1(e){return function(t){t=ee(t);var s=Y(t)?X(t):void 0,r=s?s[0]:t.charAt(0),i=s?J(s,1).join(""):t.slice(1);return r[e]()+i}}("toUpperCase"),se=D,re=te;var ie=function capitalize$1(e){return re(se(e).toLowerCase())};var ne=function arrayReduce$1(e,t,s,r){var i=-1,n=null==e?0:e.length;for(r&&n&&(s=e[++i]);++i<n;)s=t(s,e[i],i,e);return s};var oe=function basePropertyOf$1(e){return function(t){return null==e?void 0:e[t]}}({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),ae=D,ce=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,le=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var he=function deburr$1(e){return(e=ae(e))&&e.replace(ce,oe).replace(le,"")},ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var de=function asciiWords$1(e){return e.match(ue)||[]},pe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var fe=function hasUnicodeWord$1(e){return pe.test(e)},be="\\u2700-\\u27bf",ge="a-z\\xdf-\\xf6\\xf8-\\xff",ve="A-Z\\xc0-\\xd6\\xd8-\\xde",me="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ye="["+me+"]",we="\\d+",Oe="[\\u2700-\\u27bf]",_e="["+ge+"]",je="[^\\ud800-\\udfff"+me+we+be+ge+ve+"]",xe="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",Ee="["+ve+"]",Ae="(?:"+_e+"|"+je+")",Ce="(?:"+Ee+"|"+je+")",ke="(?:['’](?:d|ll|m|re|s|t|ve))?",$e="(?:['’](?:D|LL|M|RE|S|T|VE))?",De="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Me="[\\ufe0e\\ufe0f]?",Re=Me+De+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",xe,Se].join("|")+")"+Me+De+")*"),Fe="(?:"+[Oe,xe,Se].join("|")+")"+Re,Le=RegExp([Ee+"?"+_e+"+"+ke+"(?="+[ye,Ee,"$"].join("|")+")",Ce+"+"+$e+"(?="+[ye,Ee+Ae,"$"].join("|")+")",Ee+"?"+Ae+"+"+ke,Ee+"+"+$e,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",we,Fe].join("|"),"g");var Te=de,ze=fe,Pe=D,He=function unicodeWords$1(e){return e.match(Le)||[]};var We=ne,Ie=he,Ne=function words$1(e,t,s){return e=Pe(e),void 0===(t=s?void 0:t)?ze(e)?He(e):Te(e):e.match(t)||[]},Ve=RegExp("['’]","g");var qe=function createCompounder$2(e){return function(t){return We(Ne(Ie(t).replace(Ve,"")),e,"")}},Ue=ie,Be=qe((function(e,t,s){return t=t.toLowerCase(),e+(s?Ue(t):t)}));const Ge={},setValidator=(e,t)=>{Ge[e]=t};setValidator("isDefined",(e=>void 0!==e)),setValidator("isUnDefined",(e=>void 0===e)),setValidator("isNull",(e=>null===e)),setValidator("isElement",(e=>e&&(e instanceof Element||e instanceof Window))),setValidator("isEventTarget",(e=>e&&e instanceof EventTarget)),setValidator("isString",(e=>e&&("string"==typeof e||e instanceof String))),setValidator("isArray",(e=>e&&e instanceof Array)),setValidator("notEmpty",(e=>e instanceof Array?0!==e.length:""!==e)),setValidator("isEmpty",(e=>void 0===e||!e||(e instanceof Array?0===e.length:""===e))),setValidator("isObject",(e=>e&&e instanceof Object)),setValidator("isFunction",(e=>e&&"function"==typeof e));const validate=(e,t,s)=>{const r=s.map((e=>{if(e instanceof Array){return-1!==e.map((e=>Ge[e]&&Ge[e](t))).indexOf(!0)}return Ge[e]&&Ge[e](t)}));if(-1!==r.indexOf(!1))throw new Error("call to "+e+" invalid value: "+t+" "+s,0+r)},Qe=new WeakMap,isVisible=e=>(validate("isVisible element",e,["isDefined","isElement"]),!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),setMetaData=(e,t,s)=>{validate("setMetaData element",e,["isDefined","isElement"]),validate("setMetaData k",t,["isDefined","isString"]),validate("setMetaData v",s,[["isUnDefined","isNull","isString","isObject"]]);const r=Qe.get(e)||{};s?r[t]=s:delete r[t],Qe.set(e,r)},getMetaData=(e,t)=>{validate("getMetaData element",e,["isDefined","isElement"]),validate("getMetaData k",t,["isDefined","isString"]);const s=Qe.get(e)||{};return t?s[t]:s},on=function(e,t,s,r,i,n,o){"function"==typeof r&&(o=n,n=i,i=r,r=void 0),validate("on uid",e,["isDefined","notEmpty"]),validate("on container",t,["isDefined","isEventTarget"]),validate("on events",s,["isDefined","isString"]),validate("on fn",i,["isDefined","isFunction"]),validate("on selector",r,[["isEmpty","isString"]]);const a="on:"+e+"-"+s+"-"+r;if(getMetaData(t,a))return void console.error("Error: Sargasso utils.on: duplicate event handler specification. %o %s",t,a);const c={uid:e,events:s,selector:r||void 0,fn:n=>{o&&off(e,t,s,r),r?Array.from(t.querySelectorAll(r)).forEach((e=>{(n.target===e||e.contains(n.target))&&i(n,e)})):i(n)},options:n||!1};setMetaData(t,a,c),s.split(/[\s,]+/).forEach((e=>{t.addEventListener(e.trim(),c.fn,c.options)}))},off=function(e,t,s,r){validate("off uid",e,["isDefined","notEmpty"]),validate("off container",t,["isDefined","isEventTarget"]),validate("off events",s,["isDefined","isString"]),validate("off selector",r,[["isEmpty","isString"]]);const i="on:"+e+"-"+s+"-"+r,n=getMetaData(t,i);n&&(s.split(/[\s,]+/).forEach((e=>{t.removeEventListener(e.trim(),n.fn,n.options)})),setMetaData(t,i))},Ze={hasClass:(e,t)=>{validate("hasClass element",e,["isDefined","isElement"]),validate("hasClass cssClass",t,["isDefined","notEmpty","isString"]);return-1!==(e.className||"").split(/\s+/).indexOf(t)},addClass:(e,t)=>{validate("addClass element",e,["isDefined","isElement"]),validate("addClass addClasses",t,["isDefined","notEmpty",["isString","isArray"]]);const s=(e.className||"").split(/\s+/);Array.isArray(t)||(t=t.split(/[\s,]/)),t.forEach((e=>{e=e.trim(),-1===s.indexOf(e)&&s.push(e)})),e.className=s.join(" ")},removeClass:(e,t)=>{validate("removeClass element",e,["isDefined","isElement"]),validate("removeClass removeClasses",t,["isDefined","notEmpty",["isString","isArray"]]);const s=(e.className||"").split(/\s+/);Array.isArray(t)||(t=t.split(/[\s,]/)),t.forEach((e=>{e=e.trim(),-1!==s.indexOf(e)&&s.splice(s.indexOf(e),1)})),e.className=s.join(" ")},isVisible:isVisible,inViewPort:(e,t=window)=>{validate("inViewPort element",e,["isDefined","isElement"]);const s=e.getBoundingClientRect(),r=isVisible(e),i=s.bottom<0;let n;return n=t.self===window?s.top>(window.innerHeight||document.documentElement.clientHeight):s.top>t.clientHeight,r&&!n&&!i},setCSS:(e,t)=>{validate("css element",e,["isDefined","isElement"]),validate("css css",t,["isDefined",["isObject"]]);for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){const r=Be(s);e.style[r]=null!==t[s]?t[s]:null}},setMetaData:setMetaData,getMetaData:getMetaData,on:on,off:off,once:function(e,t,s,r,i,n){"function"==typeof r&&(n=i,i=r,r=void 0),on(e,t,s,r,i,n,!0)},offAll:function(e){validate("offAll container",e,["isDefined","isEventTarget"]);const t=Qe.get(e)||{},s=[];for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&e.match(/^on:/)&&s.push(e);s.forEach((s=>{off(t[s].uid,e,t[s].events,t[s].selector)}))}};var Ke=function isObject$4(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Je=n,Ye=/\s/;var Xe=function trimmedEndIndex$1(e){for(var t=e.length;t--&&Ye.test(e.charAt(t)););return t},et=/^\s+/;var tt=function baseTrim$1(e){return e?e.slice(0,Xe(e)+1).replace(et,""):e},st=Ke,rt=j,it=/^[-+]0x[0-9a-f]+$/i,nt=/^0b[01]+$/i,ot=/^0o[0-7]+$/i,at=parseInt;var ct=Ke,now=function(){return Je.Date.now()},lt=function toNumber$1(e){if("number"==typeof e)return e;if(rt(e))return NaN;if(st(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=st(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=tt(e);var s=nt.test(e);return s||ot.test(e)?at(e.slice(2),s?2:8):it.test(e)?NaN:+e},ht=Math.max,ut=Math.min;var dt=function debounce(e,t,s){var r,i,n,o,a,c,l=0,h=!1,u=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function invokeFunc(t){var s=r,n=i;return r=i=void 0,l=t,o=e.apply(n,s)}function leadingEdge(e){return l=e,a=setTimeout(timerExpired,t),h?invokeFunc(e):o}function shouldInvoke(e){var s=e-c;return void 0===c||s>=t||s<0||u&&e-l>=n}function timerExpired(){var e=now();if(shouldInvoke(e))return trailingEdge(e);a=setTimeout(timerExpired,function remainingWait(e){var s=t-(e-c);return u?ut(s,n-(e-l)):s}(e))}function trailingEdge(e){return a=void 0,d&&r?invokeFunc(e):(r=i=void 0,o)}function debounced(){var e=now(),s=shouldInvoke(e);if(r=arguments,i=this,c=e,s){if(void 0===a)return leadingEdge(c);if(u)return clearTimeout(a),a=setTimeout(timerExpired,t),invokeFunc(c)}return void 0===a&&(a=setTimeout(timerExpired,t)),o}return t=lt(t)||0,ct(s)&&(h=!!s.leading,n=(u="maxWait"in s)?ht(lt(s.maxWait)||0,t):n,d="trailing"in s?!!s.trailing:d),debounced.cancel=function cancel(){void 0!==a&&clearTimeout(a),l=0,r=c=i=a=void 0},debounced.flush=function flush(){return void 0===a?o:trailingEdge(now())},debounced};var pt=function listCacheClear$1(){this.__data__=[],this.size=0};var ft=function eq$2(e,t){return e===t||e!=e&&t!=t},bt=ft;var gt=function assocIndexOf$4(e,t){for(var s=e.length;s--;)if(bt(e[s][0],t))return s;return-1},vt=gt,mt=Array.prototype.splice;var yt=gt;var wt=gt;var Ot=gt;var _t=pt,jt=function listCacheDelete$1(e){var t=this.__data__,s=vt(t,e);return!(s<0)&&(s==t.length-1?t.pop():mt.call(t,s,1),--this.size,!0)},xt=function listCacheGet$1(e){var t=this.__data__,s=yt(t,e);return s<0?void 0:t[s][1]},St=function listCacheHas$1(e){return wt(this.__data__,e)>-1},Et=function listCacheSet$1(e,t){var s=this.__data__,r=Ot(s,e);return r<0?(++this.size,s.push([e,t])):s[r][1]=t,this};function ListCache$4(e){var t=-1,s=null==e?0:e.length;for(this.clear();++t<s;){var r=e[t];this.set(r[0],r[1])}}ListCache$4.prototype.clear=_t,ListCache$4.prototype.delete=jt,ListCache$4.prototype.get=xt,ListCache$4.prototype.has=St,ListCache$4.prototype.set=Et;var At=ListCache$4,Ct=At;var kt=function stackClear$1(){this.__data__=new Ct,this.size=0};var $t=function stackDelete$1(e){var t=this.__data__,s=t.delete(e);return this.size=t.size,s};var Dt=function stackGet$1(e){return this.__data__.get(e)};var Mt=function stackHas$1(e){return this.__data__.has(e)},Rt=y,Ft=Ke;var Lt,Tt=function isFunction$2(e){if(!Ft(e))return!1;var t=Rt(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},zt=n["__core-js_shared__"],Pt=(Lt=/[^.]+$/.exec(zt&&zt.keys&&zt.keys.IE_PROTO||""))?"Symbol(src)_1."+Lt:"";var Ht=function isMasked$1(e){return!!Pt&&Pt in e},Wt=Function.prototype.toString;var It=function toSource$2(e){if(null!=e){try{return Wt.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Nt=Tt,Vt=Ht,qt=Ke,Ut=It,Bt=/^\[object .+?Constructor\]$/,Gt=Function.prototype,Qt=Object.prototype,Zt=Gt.toString,Kt=Qt.hasOwnProperty,Jt=RegExp("^"+Zt.call(Kt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Yt=function baseIsNative$1(e){return!(!qt(e)||Vt(e))&&(Nt(e)?Jt:Bt).test(Ut(e))},Xt=function getValue$1(e,t){return null==e?void 0:e[t]};var es=function getNative$6(e,t){var s=Xt(e,t);return Yt(s)?s:void 0},ts=es(n,"Map"),ss=es(Object,"create"),rs=ss;var is=function hashClear$1(){this.__data__=rs?rs(null):{},this.size=0};var ns=function hashDelete$1(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},os=ss,as=Object.prototype.hasOwnProperty;var cs=function hashGet$1(e){var t=this.__data__;if(os){var s=t[e];return"__lodash_hash_undefined__"===s?void 0:s}return as.call(t,e)?t[e]:void 0},ls=ss,hs=Object.prototype.hasOwnProperty;var us=ss;var ds=is,ps=ns,fs=cs,bs=function hashHas$1(e){var t=this.__data__;return ls?void 0!==t[e]:hs.call(t,e)},gs=function hashSet$1(e,t){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=us&&void 0===t?"__lodash_hash_undefined__":t,this};function Hash$1(e){var t=-1,s=null==e?0:e.length;for(this.clear();++t<s;){var r=e[t];this.set(r[0],r[1])}}Hash$1.prototype.clear=ds,Hash$1.prototype.delete=ps,Hash$1.prototype.get=fs,Hash$1.prototype.has=bs,Hash$1.prototype.set=gs;var vs=Hash$1,ms=At,ys=ts;var ws=function isKeyable$1(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Os=function getMapData$4(e,t){var s=e.__data__;return ws(t)?s["string"==typeof t?"string":"hash"]:s.map},_s=Os;var js=Os;var xs=Os;var Ss=Os;var Es=function mapCacheClear$1(){this.size=0,this.__data__={hash:new vs,map:new(ys||ms),string:new vs}},As=function mapCacheDelete$1(e){var t=_s(this,e).delete(e);return this.size-=t?1:0,t},Cs=function mapCacheGet$1(e){return js(this,e).get(e)},ks=function mapCacheHas$1(e){return xs(this,e).has(e)},$s=function mapCacheSet$1(e,t){var s=Ss(this,e),r=s.size;return s.set(e,t),this.size+=s.size==r?0:1,this};function MapCache$2(e){var t=-1,s=null==e?0:e.length;for(this.clear();++t<s;){var r=e[t];this.set(r[0],r[1])}}MapCache$2.prototype.clear=Es,MapCache$2.prototype.delete=As,MapCache$2.prototype.get=Cs,MapCache$2.prototype.has=ks,MapCache$2.prototype.set=$s;var Ds=MapCache$2,Ms=At,Rs=ts,Fs=Ds;var Ls=At,Ts=kt,zs=$t,Ps=Dt,Hs=Mt,Ws=function stackSet$1(e,t){var s=this.__data__;if(s instanceof Ms){var r=s.__data__;if(!Rs||r.length<199)return r.push([e,t]),this.size=++s.size,this;s=this.__data__=new Fs(r)}return s.set(e,t),this.size=s.size,this};function Stack$1(e){var t=this.__data__=new Ls(e);this.size=t.size}Stack$1.prototype.clear=Ts,Stack$1.prototype.delete=zs,Stack$1.prototype.get=Ps,Stack$1.prototype.has=Hs,Stack$1.prototype.set=Ws;var Is=Stack$1;var Ns=Ds,Vs=function setCacheAdd$1(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},qs=function setCacheHas$1(e){return this.__data__.has(e)};function SetCache$1(e){var t=-1,s=null==e?0:e.length;for(this.__data__=new Ns;++t<s;)this.add(e[t])}SetCache$1.prototype.add=SetCache$1.prototype.push=Vs,SetCache$1.prototype.has=qs;var Us=SetCache$1,Bs=function arraySome$1(e,t){for(var s=-1,r=null==e?0:e.length;++s<r;)if(t(e[s],s,e))return!0;return!1},Gs=function cacheHas$1(e,t){return e.has(t)};var Qs=function equalArrays$2(e,t,s,r,i,n){var o=1&s,a=e.length,c=t.length;if(a!=c&&!(o&&c>a))return!1;var l=n.get(e),h=n.get(t);if(l&&h)return l==t&&h==e;var u=-1,d=!0,p=2&s?new Us:void 0;for(n.set(e,t),n.set(t,e);++u<a;){var f=e[u],b=t[u];if(r)var g=o?r(b,f,u,t,e,n):r(f,b,u,e,t,n);if(void 0!==g){if(g)continue;d=!1;break}if(p){if(!Bs(t,(function(e,t){if(!Gs(p,t)&&(f===e||i(f,e,s,r,n)))return p.push(t)}))){d=!1;break}}else if(f!==b&&!i(f,b,s,r,n)){d=!1;break}}return n.delete(e),n.delete(t),d};var Zs=function setToArray$1(e){var t=-1,s=Array(e.size);return e.forEach((function(e){s[++t]=e})),s},Ks=n.Uint8Array,Js=ft,Ys=Qs,Xs=function mapToArray$1(e){var t=-1,s=Array(e.size);return e.forEach((function(e,r){s[++t]=[r,e]})),s},er=Zs,tr=o?o.prototype:void 0,sr=tr?tr.valueOf:void 0;var rr=function equalByTag$1(e,t,s,r,i,n,o){switch(s){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!n(new Ks(e),new Ks(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Js(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=Xs;case"[object Set]":var c=1&r;if(a||(a=er),e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=2,o.set(e,t);var h=Ys(a(e),a(t),r,i,n,o);return o.delete(e),h;case"[object Symbol]":if(sr)return sr.call(e)==sr.call(t)}return!1};var ir=function arrayPush$1(e,t){for(var s=-1,r=t.length,i=e.length;++s<r;)e[i+s]=t[s];return e},nr=c;var or=function baseGetAllKeys$1(e,t,s){var r=t(e);return nr(e)?r:ir(r,s(e))};var ar=function arrayFilter$1(e,t){for(var s=-1,r=null==e?0:e.length,i=0,n=[];++s<r;){var o=e[s];t(o,s,e)&&(n[i++]=o)}return n},cr=function stubArray$1(){return[]},lr=Object.prototype.propertyIsEnumerable,hr=Object.getOwnPropertySymbols,ur=hr?function(e){return null==e?[]:(e=Object(e),ar(hr(e),(function(t){return lr.call(e,t)})))}:cr;var dr=function baseTimes$1(e,t){for(var s=-1,r=Array(e);++s<e;)r[s]=t(s);return r},pr=y,fr=w;var br=function baseIsArguments$1(e){return fr(e)&&"[object Arguments]"==pr(e)},gr=w,vr=Object.prototype,mr=vr.hasOwnProperty,yr=vr.propertyIsEnumerable,wr=br(function(){return arguments}())?br:function(e){return gr(e)&&mr.call(e,"callee")&&!yr.call(e,"callee")},Or=wr,_r={exports:{}};var jr=function stubFalse(){return!1};!function(e,t){var s=n,r=jr,i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?s.Buffer:void 0,c=(a?a.isBuffer:void 0)||r;e.exports=c}(_r,_r.exports);var xr=/^(?:0|[1-9]\d*)$/;var Sr=function isIndex$1(e,t){var s=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==s||"symbol"!=s&&xr.test(e))&&e>-1&&e%1==0&&e<t};var Er=function isLength$2(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Ar=y,Cr=Er,kr=w,$r={};$r["[object Float32Array]"]=$r["[object Float64Array]"]=$r["[object Int8Array]"]=$r["[object Int16Array]"]=$r["[object Int32Array]"]=$r["[object Uint8Array]"]=$r["[object Uint8ClampedArray]"]=$r["[object Uint16Array]"]=$r["[object Uint32Array]"]=!0,$r["[object Arguments]"]=$r["[object Array]"]=$r["[object ArrayBuffer]"]=$r["[object Boolean]"]=$r["[object DataView]"]=$r["[object Date]"]=$r["[object Error]"]=$r["[object Function]"]=$r["[object Map]"]=$r["[object Number]"]=$r["[object Object]"]=$r["[object RegExp]"]=$r["[object Set]"]=$r["[object String]"]=$r["[object WeakMap]"]=!1;var Dr=function baseIsTypedArray$1(e){return kr(e)&&Cr(e.length)&&!!$r[Ar(e)]};var Mr=function baseUnary$1(e){return function(t){return e(t)}},Rr={exports:{}};!function(e,t){var r=s,i=t&&!t.nodeType&&t,n=i&&e&&!e.nodeType&&e,o=n&&n.exports===i&&r.process,a=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a}(Rr,Rr.exports);var Fr=Dr,Lr=Mr,Tr=Rr.exports,zr=Tr&&Tr.isTypedArray,Pr=zr?Lr(zr):Fr,Hr=dr,Wr=Or,Ir=c,Nr=_r.exports,Vr=Sr,qr=Pr,Ur=Object.prototype.hasOwnProperty;var Br=function arrayLikeKeys$1(e,t){var s=Ir(e),r=!s&&Wr(e),i=!s&&!r&&Nr(e),n=!s&&!r&&!i&&qr(e),o=s||r||i||n,a=o?Hr(e.length,String):[],c=a.length;for(var l in e)!t&&!Ur.call(e,l)||o&&("length"==l||i&&("offset"==l||"parent"==l)||n&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Vr(l,c))||a.push(l);return a},Gr=Object.prototype;var Qr=function isPrototype$1(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Gr)};var Zr=function overArg$1(e,t){return function(s){return e(t(s))}}(Object.keys,Object),Kr=Qr,Jr=Zr,Yr=Object.prototype.hasOwnProperty;var Xr=Tt,ei=Er;var ti=Br,si=function baseKeys$1(e){if(!Kr(e))return Jr(e);var t=[];for(var s in Object(e))Yr.call(e,s)&&"constructor"!=s&&t.push(s);return t},ri=function isArrayLike$1(e){return null!=e&&ei(e.length)&&!Xr(e)};var ii=or,ni=ur,oi=function keys$1(e){return ri(e)?ti(e):si(e)};var ai=function getAllKeys$1(e){return ii(e,oi,ni)},ci=Object.prototype.hasOwnProperty;var li=function equalObjects$1(e,t,s,r,i,n){var o=1&s,a=ai(e),c=a.length;if(c!=ai(t).length&&!o)return!1;for(var l=c;l--;){var h=a[l];if(!(o?h in t:ci.call(t,h)))return!1}var u=n.get(e),d=n.get(t);if(u&&d)return u==t&&d==e;var p=!0;n.set(e,t),n.set(t,e);for(var f=o;++l<c;){var b=e[h=a[l]],g=t[h];if(r)var v=o?r(g,b,h,t,e,n):r(b,g,h,e,t,n);if(!(void 0===v?b===g||i(b,g,s,r,n):v)){p=!1;break}f||(f="constructor"==h)}if(p&&!f){var m=e.constructor,y=t.constructor;m==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof m&&m instanceof m&&"function"==typeof y&&y instanceof y||(p=!1)}return n.delete(e),n.delete(t),p},hi=es(n,"DataView"),ui=ts,di=es(n,"Promise"),pi=es(n,"Set"),fi=es(n,"WeakMap"),bi=y,gi=It,vi="[object Map]",mi="[object Promise]",yi="[object Set]",wi="[object WeakMap]",Oi="[object DataView]",_i=gi(hi),ji=gi(ui),xi=gi(di),Si=gi(pi),Ei=gi(fi),Ai=bi;(hi&&Ai(new hi(new ArrayBuffer(1)))!=Oi||ui&&Ai(new ui)!=vi||di&&Ai(di.resolve())!=mi||pi&&Ai(new pi)!=yi||fi&&Ai(new fi)!=wi)&&(Ai=function(e){var t=bi(e),s="[object Object]"==t?e.constructor:void 0,r=s?gi(s):"";if(r)switch(r){case _i:return Oi;case ji:return vi;case xi:return mi;case Si:return yi;case Ei:return wi}return t});var Ci=Is,ki=Qs,$i=rr,Di=li,Mi=Ai,Ri=c,Fi=_r.exports,Li=Pr,Ti="[object Arguments]",zi="[object Array]",Pi="[object Object]",Hi=Object.prototype.hasOwnProperty;var Wi=function baseIsEqualDeep$1(e,t,s,r,i,n){var o=Ri(e),a=Ri(t),c=o?zi:Mi(e),l=a?zi:Mi(t),h=(c=c==Ti?Pi:c)==Pi,u=(l=l==Ti?Pi:l)==Pi,d=c==l;if(d&&Fi(e)){if(!Fi(t))return!1;o=!0,h=!1}if(d&&!h)return n||(n=new Ci),o||Li(e)?ki(e,t,s,r,i,n):$i(e,t,c,s,r,i,n);if(!(1&s)){var p=h&&Hi.call(e,"__wrapped__"),f=u&&Hi.call(t,"__wrapped__");if(p||f){var b=p?e.value():e,g=f?t.value():t;return n||(n=new Ci),i(b,g,s,r,n)}}return!!d&&(n||(n=new Ci),Di(e,t,s,r,i,n))},Ii=w;var Ni=function baseIsEqual$1(e,t,s,r,i){return e===t||(null==e||null==t||!Ii(e)&&!Ii(t)?e!=e&&t!=t:Wi(e,t,s,r,baseIsEqual$1,i))},Vi=Ni;var qi=function isEqual(e,t){return Vi(e,t)};const Ui={},buildProxy=e=>({get(t,s){const r=Reflect.get(t,s);return r&&"object"==typeof r?new Proxy(r,buildProxy(e)):r},set:(t,s,r)=>(e.sync(s),Reflect.set(t,s,r)),deleteProperty:(t,s)=>(e.sync(s),Reflect.deleteProperty(t,s))});class ObservableObject{constructor(e,t={},s={}){if(this.id=e,Ui[this.id])throw new Error("ObservableObject "+e+" already exists.");this.bound={},this.data=new Proxy(t,buildProxy(this)),this.options=s,Ui[this.id]=this}destroy(){delete Ui[this.id],delete this.data,Object.keys(this.bound).forEach((e=>{Object.keys(this.bound[e]).forEach((t=>{this.unbind(t,e)}))}))}getBoundData(){return this.data}set(e,t){qi(this.get(e),t)||(this.data[e]=t)}get(e){return this.data[e]}delete(e){delete this.data[e]}syncAll(){Object.keys(this.data||{}).forEach((e=>{this.sync(e)}))}bind(e,t,s="*"){this.bound[s]||(this.bound[s]={}),this.bound[s][e]=t,Object.keys(this.data).forEach((e=>{t(this.id,e,this.get(e))}))}unbind(e,t="*"){this.bound[t]&&this.bound[t][e]&&delete this.bound[t][e]}sync(e){Object.keys(this.bound["*"]||{}).forEach((t=>{this.bound["*"][t](this.id,e,this.get(e))})),Object.keys(this.bound[e]||{}).forEach((t=>{this.bound[e][t](this.id,e,this.get(e))}))}}let Bi,Gi,Qi,Zi,Ki,Ji;class ObserverSubscriptionManager{constructor(e){this.options=e,this.observers=[],this.pendingAnimationFrame=void 0,this.frameQueue=[],this.sleeping=!0}subscribe(e){!this.observers.length&&this.sleeping&&this.wakeup(),this.observers.push(e)}unSubscribe(e){-1!==this.observers.indexOf(e)&&this.observers.splice(this.observers.indexOf(e),1),this.observers.length||this.sleep()}sleep(){this.sleeping=!0}wakeup(){this.sleeping=!1}notifyObservers(e,t){for(let s=0;s<this.observers.length;s++)this.observers[s][e]&&this.observers[s][e].apply(this.observers[s],t||[])}flushQueue(){this.pendingAnimationFrame&&(cancelAnimationFrame(this.pendingAnimationFrame),this.pendingAnimationFrame=void 0),this.frameQueue=[]}queueFrame(e){this.frameQueue.push(e.bind(this)),this.pendingAnimationFrame||(this.pendingAnimationFrame=requestAnimationFrame((()=>{this.processQueue()})))}processQueue(){this.pendingAnimationFrame=void 0;const e=this.frameQueue.slice(0);this.frameQueue=[];for(let t=0;t<e.length;t++)e[t]()}}class DOMWatcher extends ObserverSubscriptionManager{constructor(e={}){super(e),this.mutationHandler=dt(((e,t)=>{this.observeDOM(this.options.shadowDOM||document.body)}),25,{maxWait:100}),this.mutationObserver=new MutationObserver(this.mutationHandler,!1)}subscribe(e){super.subscribe(e),e.watchDOM(this.options.shadowDOM||document.body)}wakeup(){super.wakeup(),this.mutationObserver.observe(this.options.shadowDOM||document.body,{childList:!0,subtree:!0})}sleep(){super.sleep(),this.mutationObserver.disconnect()}observeDOM(e){this.notifyObservers("watchDOM",[e||this.options.shadowDOM||document.body])}}Bi=new DOMWatcher,Gi=new class ScrollWatcher extends ObserverSubscriptionManager{constructor(e={}){super(e),this.scrollElement=this.options.scrollElement||window,this.lastscroll=0,this.scrolling=!1}trigger(){this.scrolling||this.scrollLoop()}scrollLoop(){if(this.lastscroll!==this.scrollTop()){this.scrolling=!0,this.lastscroll=this.scrollTop(),this.watchScroll();const frame=()=>{this.scrollLoop()};this.queueFrame(frame)}else this.scrolling=!1}setOptions(e={}){this.sleep(),this.scrollElement=e.scrollElement||window,this.wakeup()}subscribe(e){super.subscribe(e),e.watchScroll()}wakeup(){super.wakeup(),Ze.on("theScrollWatcher",this.scrollElement,"scroll",(()=>{this.trigger()}))}sleep(){super.sleep(),Ze.off("theScrollWatcher",this.scrollElement,"scroll")}inViewPort(e){return Ze.inViewPort(e,this.scrollElement)}watchScroll(){this.notifyObservers("watchScroll")}scrollTop(e){if(this.scrollElement===window){if(void 0===e)return window.pageYOffset;window.scrollTo(0,e)}else{if(void 0===e)return this.scrollElement.scrollTop;this.scrollElement.scrollTop=e}}},Qi=new class ResizeWatcher extends ObserverSubscriptionManager{constructor(e){super(e),this.debounce=dt((()=>{this.watchResize()}),250)}subscribe(e){super.subscribe(e),e.watchResize()}wakeup(){super.wakeup(),window.addEventListener("resize",this.debounce,!1)}sleep(){super.sleep(),window.removeEventListener("resize",this.debounce)}watchResize(){this.notifyObservers("watchResize")}},Zi=new class OrientationWatcher extends ObserverSubscriptionManager{constructor(e){super(e),"onorientationchange"in window?Ze.addClass(document.body,"have-orientation"):Ze.addClass(document.body,"no-orientation"),this.debounce=dt((()=>{this.watchOrientation()}),250)}subscribe(e){super.subscribe(e),e.watchOrientation()}wakeup(){super.wakeup(),"onorientationchange"in window&&window.addEventListener("orientationchange",this.debounce,!1)}sleep(){super.sleep(),"onorientationchange"in window&&window.removeEventListener("orientationchange",this.debounce)}watchOrientation(){this.notifyObservers("watchOrientation")}},Ki=new class WorkerWatcher extends ObserverSubscriptionManager{constructor(e){super(e),this.workers={}}registerWorker(e,t){if(!this.workers[e]){let s=t,r=!1;if(!t.match(/^(http|\/)/i)){const e=new Blob([t],{type:"text/javascript"});s=URL.createObjectURL(e),r=!0}this.workers[e]={worker:new Worker(s),observers:[]},r&&URL.revokeObjectURL(s),this.workers[e].worker.onmessage=t=>{this.workerMessage(e,t)}}return this.workers[e].worker}subscribe(e,t){if(!this.workers[t])throw new Error("worker "+t+" does not exist");this.workers[t].observers.push(e),super.subscribe(e)}unSubscribe(e,t){if(!this.workers[t])throw new Error("worker "+t+" does not exist");const s=this.workers[t].observers;-1!==s.indexOf(e)&&s.splice(s.indexOf(e),1),s.length||(this.workers[t].worker.terminate(),delete this.workers[t]),super.unSubscribe(e)}workerMessage(e,t){this.workers[e].observers.forEach((s=>{s.workerMessage&&s.workerMessage(e,t)}))}wakeup(){super.wakeup()}sleep(){super.sleep()}},Ji=new class ObservableObjectWatcher extends ObserverSubscriptionManager{constructor(e){super(e),this.registeredObservableObjects={}}getObservable(e){return this.registeredObservableObjects[e]?this.registeredObservableObjects[e].observable:void 0}observableStart(e,t){const s=(e=>Ui[e])(e);if(s&&void 0!==t)throw new Error("ObservableObject "+e+" already exists, can't build.");return this.registeredObservableObjects[e]||(this.registeredObservableObjects[e]=s?{id:e,observable:s,observers:[],managed:!1}:{id:e,observable:new ObservableObject(e,t),observers:[],managed:!0},this.registeredObservableObjects[e].observable.bind(this.constructor.name,this.notify.bind(this))),this.registeredObservableObjects[e].observable}observableDestroy(e){if(!this.registeredObservableObjects[e])throw new Error("ObservableObject observableDestroy "+e+" does not exist");this.registeredObservableObjects[e].observable.unbind(this.constructor.name),this.registeredObservableObjects[e].observable.destroy(),delete this.registeredObservableObjects[e]}subscribe(e,t,s){this.registeredObservableObjects[t]||this.observableStart(t,s),this.registeredObservableObjects[t].observers.push(e),super.subscribe(e)}unSubscribe(e,t){if(!this.registeredObservableObjects[t])throw new Error("ObservableObject unSubscribe "+t+" does not exist");const s=this.registeredObservableObjects[t].observers;-1!==s.indexOf(e)&&s.splice(s.indexOf(e),1),!s.length&&this.registeredObservableObjects[t].managed&&this.observableDestroy(t),super.unSubscribe(e)}notify(e,t,s,r){if(!this.registeredObservableObjects[e])throw new Error("ObservableObject notify "+e+" does not exist");this.registeredObservableObjects[e].observers.forEach((i=>{i.observableChanged&&i.observableChanged(e,t,s,r)}))}};var Yi=qe((function(e,t,s){return e+(s?"-":"")+t.toLowerCase()}));let Xi=0;const en=[],tn="customElements"in window,sn={},registerSargassoClass=(e,t)=>{if(sn[e])throw new Error("Sargasso class "+e+" is already registered.");if(sn[e]=t,tn){const t=new Function("registeredClasses",`\n\t\t\treturn class ${e}Element extends HTMLElement {\n\t\t\t\tconstructor(element, options = {}) {\n\t\t\t\t\tsuper()\n\t\t\t\t\tthis.helperClass= '${e}'\n\t\t\t\t\tthis.helpers = []\n\t\t\t\t}\n\n\t\t\t\tconnectedCallback () {\n\t\t\t\t\tthis.helpers.push(new registeredClasses[this.helperClass](this,{isCustomElement:true}))\n\t\t\t\t\tif (this.hasAttributes()) {\n\t\t\t\t\t\tfor(let i = 0; i < this.attributes.length; i++) {\n\t\t\t\t\t\t\tif(this.attributes[i].name.match(/^sargasso-/)) {\n\t\t\t\t\t\t\t\tlet classname = this.attributes[i].name.replace(/^sargasso-/,'').split('-').map(word=> word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join('')\n\t\t\t\t\t\t\t\tif(!registeredClasses[classname]) {\n\t\t\t\t\t\t\t\t\tconsole.log('instantiate by attribute ' + this.attributes[i].name + ' > ' + classname + ' is not a sargasso class')\n\t\t\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.helpers.push(new registeredClasses[classname](this,{isCustomElement:true}))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.helpers.forEach((helper) => {\n\t\t\t\t\t\thelper.start()\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\tdisconnectedCallback () {\n\t\t\t\t\tthis.helpers.forEach((helper) => {\n\t\t\t\t\t\thelper.sleep()\n\t\t\t\t\t\thelper.destroy()\n\t\t\t\t \t})\n\t\t\t\t\tthis.helpers = [] // nuke the reference for trash collection\n\t\t\t\t}\n\t\t\t}`)(sn);customElements.define("sargasso-"+Yi(e),t)}},rn=["DOMChanged","didScroll","didResize","didBreakpoint","enterViewport","exitViewport","enterFullscreen","exitFullscreen","newPage","elementEvent","workerOnMessage","observableChanged"];class Sargasso{constructor(e,t={}){validate("Sargasso constructor element",e,["isDefined","isElement"]),validate("Sargasso constructor options",t,["isDefined",["isObject"]]),this.uid=++Xi,this.element=e,t.shadowDOM&&(this._shadowDOM=e.attachShadow({mode:"open"}),this._shadowRoot=document.createElement("div"),this._shadowDOM.append(this._shadowRoot),this._hostElement=this.element,this.element=this._shadowRoot),this.options=t,this._pendingAnimationFrame=void 0,this._frameQueue=[],this._isInViewport=!1,this._workers={},this._observables={},this._template=void 0,this._templateArgs={},this._started=!1,this.render=dt((()=>{this._render()}),100,{maxWait:250})}start(){const e=this.getMetaData("registeredResponsiveControllers")||[];e.push(this),this.setMetaData("registeredResponsiveControllers",e),this.setMetaData(this.constructor.name,this),en.push(this),this._shadowDOM&&(this._shadowDOMWatcher||(this._shadowDOMWatcher=new DOMWatcher({shadowDOM:this._shadowRoot})),this._shadowDOMWatcher.subscribe(this)),this.options.watchDOM&&Bi.subscribe(this),(this.options.watchScroll||this.options.watchViewport)&&Gi.subscribe(this),(this.options.watchResize||this.options.watchViewport)&&Qi.subscribe(this),(this.options.watchOrientation||this.options.watchViewport)&&Zi.subscribe(this),this.elementListener=e=>{e.detail&&e.detail.sargassoEvent&&-1!==rn.indexOf(e.detail.sargassoEvent)?this[e.detail.sargassoEvent].apply(this,e.detail.sargassoEventOptions||[]):this.elementEvent(e)},this.element.addEventListener("sargasso",this.elementListener),this._started=!0}sleep(){this._shadowDOM&&this._shadowDOMWatcher.unSubscribe(this),this.options.watchDOM&&Bi.unSubscribe(this),(this.options.watchScroll||this.options.watchViewport)&&Gi.unSubscribe(this),(this.options.watchResize||this.options.watchViewport)&&Qi.unSubscribe(this),(this.options.watchOrientation||this.options.watchViewport)&&Zi.unSubscribe(this),this.element.removeEventListener("sargasso",this.elementListener),Ze.offAll(this.element),this._started=!1}DOMChanged(e){}didScroll(){}didResize(){}didBreakpoint(){}enterViewport(){}exitViewport(){}enterFullscreen(){}exitFullscreen(){}newPage(e,t){}elementEvent(e){}workerOnMessage(e,t){}observableChanged(e,t,s){this.render()}setMetaData(e,t){Ze.setMetaData(this.element,e,t)}getMetaData(e){return Ze.getMetaData(this.element,e)}on(e,t,s,r){Ze.on(this.constructor.name+"-"+this.uid,this.element,e,t,s,r)}off(e,t){Ze.off(this.constructor.name+"-"+this.uid,this.element,e,t)}once(e,t,s,r){Ze.once(this.constructor.name+"-"+this.uid,this.element,e,t,s,r)}notifyAll(e,t){if(-1===rn.indexOf(e))throw new Error("invalid event name "+e);for(let s=0;s<en.length;s++){const r=en[s];r!==this&&r[e]&&r[e].apply(r,t)}}notifyElement(e,t,s){if(-1===rn.indexOf(t))throw new Error("invalid event name "+t);const r=this.getMetaData("registeredResponsiveControllers");if(r)for(let e=0;e<r.length;e++){const i=r[e];i!==this&&i[t]&&i[t].apply(i,s)}}queueFrame(e){this._frameQueue.push(e.bind(this)),this._pendingAnimationFrame||(this._pendingAnimationFrame=requestAnimationFrame((()=>{this._processQueue()})))}wantFullscreen(e){e?this.enterFullscreen():this.exitFullscreen()}hasClass(e){return Ze.hasClass(this.element,e)}addClass(e){Ze.addClass(this.element,e)}removeClass(e){Ze.removeClass(this.element,e)}setCSS(e){Ze.setCSS(this.element,e)}isVisible(){return Ze.isVisible(this.element)}workerStart(e,t){return this._workers[e]=Ki.registerWorker(e,t),Ki.subscribe(this,e),this._workers[e]}workerPostMessage(e,t){t.uid||(t.uid=this.uid),this._workers[e]&&this._workers[e].postMessage(t)}getObservable(e){return this._observables[e]}getObservableData(e){return this._observables[e].data}observableStart(e,t){return Ji.subscribe(this,e,t),this._observables[e]=Ji.getObservable(e),this._observables[e]}observableStop(e){this._observables[e]&&(Ji.unSubscribe(this,e),delete this._observables[e])}observableStopAll(){for(const e in this._observables)this.observableStop(e)}setTemplate(e){this._template=e}setRenderer(e){this.renderer=e}setTemplateArgs(e={}){this._templateArgs=e,this.render()}getTemplateArgs(){const e=this._templateArgs||{};return JSON.parse(JSON.stringify(e))}_render(){this._template&&this.renderer&&this.renderer(this._template(this.getTemplateArgs()),this.element)}_flushQueue(){this._pendingAnimationFrame&&(cancelAnimationFrame(this._pendingAnimationFrame),this._pendingAnimationFrame=void 0),this._frameQueue=[]}_processQueue(){this._pendingAnimationFrame=void 0;const e=this._frameQueue.slice(0);this._frameQueue=[];for(let t=0;t<e.length;t++)e[t]()}_stopWorker(e){this._workers[e]&&(Ki.unSubscribe(this,e),delete this._workers[e])}_stopAllWorkers(){for(const e in this._workers)this._stopWorker(e)}destroy(){this._stopAllWorkers(),this.observableStopAll(),this._flushQueue(),this._started&&this.sleep();const e=this.getMetaData("registeredResponsiveControllers");e&&-1!==e.indexOf(this)&&(e.splice(e.indexOf(this),1),this.setMetaData("registeredResponsiveControllers",e)),this.setMetaData(this.constructor.name,null),this.element=null,-1!==en.indexOf(this)&&en.splice(en.indexOf(this),1)}watchDOM(e){e===this._shadowRoot?Bi.observeDOM(this._shadowRoot):this.DOMChanged(e)}watchScroll(){this.options.watchViewport&&this.inViewport(),this.didScroll()}watchResize(){this.options.watchViewport&&this.inViewport(),this.didResize()}watchOrientation(){!window.orientation||90!==window.orientation&&-90!==window.orientation?this.wantFullscreen(!1):this.wantFullscreen(!0)}inViewport(){Gi.inViewPort(this.element)?this._isInViewport||(this.enterViewport(),this._isInViewport=!0):this._isInViewport&&(this.exitViewport(),this._isInViewport=!1)}workerMessage(e,t){t.data.uid===this.uid&&this.workerOnMessage(e,t.data)}nativeRequestFullScreen(){if(document.fullscreenElement){if(document.fullscreenElement===this.element)return;document.exitFullscreen()}this.element.requestFullscreen()}nativeExitFullScreen(){document.fullscreenElement&&document.fullscreenElement===this.element&&document.exitFullscreen()}}registerSargassoClass("Sargasso",Sargasso);class LazyInstantiate extends Sargasso{constructor(e,t={}){t.watchScroll=!0,t.watchResize=!0,t.watchDOM=!0,t.immortal=!0,super(e,t)}didResize(){super.didResize(),this.lazyHandler()}didScroll(){super.didScroll(),this.lazyHandler()}DOMChanged(e){super.DOMChanged(e),this.lazyHandler(e)}lazyHandler(e=document){const t=e.querySelectorAll("[data-lazy-sargasso-class]");for(let e=0;e<t.length;e++){const s=t[e];if(Gi.inViewPort(s)){const r=s.getAttribute("data-lazy-sargasso-class").split(/\s*,\s*/);for(let s=0;s<r.length;s++){new sn[r[s]](t[e]).start()}s.removeAttribute("data-lazy-sargasso-class")}}}}registerSargassoClass("LazyInstantiate",LazyInstantiate);class SargassoSupervisor extends Sargasso{constructor(e,t={}){super(e,{watchDOM:!0,mortal:!1}),this.lazy=new LazyInstantiate(e,t)}start(){this.lazy.start(),super.start()}instantiate(e){const t=e.getAttribute("data-sargasso-class").split(/\s*,\s*/);for(let s=0;s<t.length;s++)try{new sn[t[s]](e).start()}catch(e){console.log("error instantiating "+t[s],e,sn)}e.removeAttribute("data-sargasso-class")}newPage(){this.doIt()}DOMChanged(e){this.doIt(e)}doIt(e=document.body){e.getAttribute("data-sargasso-class")&&this.instantiate(e);const t=e.querySelectorAll("[data-sargasso-class]");for(const e of t)this.instantiate(e);const s=[];for(let e=0;e<en.length;e++)en[e].options.immortal||en[e].options.isCustomElement||document.body.contains(en[e].element)||s.push(en[e]);for(let e=0;e<s.length;e++)s[e].destroy()}}registerSargassoClass("SargassoSupervisor",SargassoSupervisor);var nn={},an=t&&t.__assign||function(){return an=Object.assign||function(e){for(var t,s=1,r=arguments.length;s<r;s++)for(var i in t=arguments[s])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},an.apply(this,arguments)};function stringifyAttribute(e,t){if(!t)return"";var s="; "+e;return!0===t?s:s+"="+t}function encode(e,t,s){return encodeURIComponent(e).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(t).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function stringifyAttributes(e){if("number"==typeof e.expires){var t=new Date;t.setMilliseconds(t.getMilliseconds()+864e5*e.expires),e.expires=t}return stringifyAttribute("Expires",e.expires?e.expires.toUTCString():"")+stringifyAttribute("Domain",e.domain)+stringifyAttribute("Path",e.path)+stringifyAttribute("Secure",e.secure)+stringifyAttribute("SameSite",e.sameSite)}(s)}nn.__esModule=!0;nn.encode=encode;function parse(e){for(var t={},s=e?e.split("; "):[],r=/(%[\dA-F]{2})+/gi,i=0;i<s.length;i++){var n=s[i].split("="),o=n.slice(1).join("=");'"'===o.charAt(0)&&(o=o.slice(1,-1));try{t[n[0].replace(r,decodeURIComponent)]=o.replace(r,decodeURIComponent)}catch(e){}}return t}nn.parse=parse;function getAll(){return parse(document.cookie)}nn.getAll=getAll;var cn=nn.get=function get(e){return getAll()[e]};function set(e,t,s){document.cookie=encode(e,t,an({path:"/"},s))}var ln=nn.set=set;nn.remove=function remove(e,t){set(e,"",an(an({},t),{expires:-1}))};const hn=[{className:"screen-xs",maxWidth:599},{className:"screen-sm",maxWidth:1023},{className:"screen-md",maxWidth:1439},{className:"screen-lg",maxWidth:1999},{className:"screen-xl",maxWidth:void 0}];class Breakpoints extends Sargasso{constructor(e,t={}){t.watchResize=!0,super(e,t),t.widths?this.options.widths=t.widths:this.options.widths=hn,this.scale=void 0,this.disabled=!1,this.forceScale=void 0,this.orientation=void 0,this.widths=[],this.classes=[]}start(){super.start();let e=".show-hide{display:none;}\n";this.widths.push(0);for(let t=0;t<this.options.widths.length;t++)this.options.widths[t].maxWidth&&this.widths.push(this.options.widths[t].maxWidth),this.classes.push(this.options.widths[t].className),e+="."+this.options.widths[t].className+" .hidden-"+this.options.widths[t].className+"{display:none;}\n",e+=".not-"+this.options.widths[t].className+" .hidden-not-"+this.options.widths[t].className+"{display:none;}\n",e+="."+this.options.widths[t].className+" .shown-"+this.options.widths[t].className+"{display:block;}\n",e+=".not-"+this.options.widths[t].className+" .shown-not-"+this.options.widths[t].className+"{display:block;}\n";const t=document.createElement("style");t.type="text/css",t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t),this.detectGeometry()}didResize(){super.didResize(),this.detectGeometry()}disableResponsive(e){Ze.addClass(document.body,"disable-responsive"),this.disabled=!0,this.forceScale=e,this.detectGeometry()}enableResponsive(){Ze.removeClass(document.body,"disable-responsive"),this.disabled=!1,this.forceScale="",this.detectGeometry()}detectGeometry(){let e=this.classes[this.widths.length-1];if(this.disabled)e=this.forceScale;else{const t=window.innerWidth;if(window.innerHeight>t){if("portrait"!==this.orientation){const frame=()=>{Ze.removeClass(document.body,"landscape"),Ze.addClass(document.body,"portrait")};this.queueFrame(frame),this.orientation="portrait"}}else if("landscape"!==this.orientation){const frame=()=>{Ze.removeClass(document.body,"portrait"),Ze.addClass(document.body,"landscape")};this.queueFrame(frame),this.orientation="landscape"}for(let s=0;s<this.widths.length-1;s++)if(t>=this.widths[s]&&t<this.widths[s+1]){e=this.classes[s];break}}let t=0;if(e!==this.scale){++t;const frame=()=>{for(let t=0;t<this.classes.length;t++)this.classes[t]!==e?(Ze.addClass(document.body,"not-"+this.classes[t]),Ze.removeClass(document.body,this.classes[t]),Ze.removeClass(document.body,"shown-"+this.classes[t]),Ze.removeClass(document.body,"hidden-"+this.classes[t])):Ze.removeClass(document.body,"not-"+this.classes[t]);Ze.addClass(document.body,e),Ze.addClass(document.body,"shown-"+e),Ze.addClass(document.body,"hidden-"+e),this.notifyAll("didBreakpoint",[e])};this.queueFrame(frame)}this.scale=e,t&&this.setHints()}setHints(){let e="";this.scale&&(e&&(e+=" "),e+=this.scale),e!==this.getCookie("responsive")&&this.setCookie("responsive",e)}getCookie(e){return cn(e)}setCookie(e,t,s){const r={path:"/",domain:this.options.cookieDomain||null,expires:s};ln(e,t,r)}deleteCookie(e){this.setCookie(e,null)}}registerSargassoClass("Breakpoints",Breakpoints);class HijaxLoader extends Sargasso{constructor(e,t={}){t.watchDOM=!0,t.immortal=!0,super(e,t),this.excludeRegex=new RegExp("^(//|http|javascript|mailto|#)","i"),this.currentPage=location.pathname+location.search,this.cachedMarkup={}}start(){const e=document.querySelectorAll("[data-hijax-skip-unchanged]");for(let t=0;t<e.length;t++){const s=e[t],r=s.getAttribute("id");this.cachedMarkup[r]=s.innerHTML}super.start(),window.addEventListener("popstate",(e=>{this.watchPopState(e)}),!1)}DOMChanged(e){super.DOMChanged(e),this.hijaxLinks(e)}watchPopState(e){location.pathname+location.search!==this.currentPage&&this.preFlight(location.pathname+location.search)}hijaxLinks(e){const t=e?e.getElementsByTagName("a"):this.element.getElementsByTagName("a");for(let e=0;e<t.length;e++){const s=t[e],r=s.getAttribute("href");!r||s.getAttribute("data-hijaxed")||s.getAttribute("target")||s.hasAttribute("data-no-hijax")||this.excludeRegex.exec(r)||(s.setAttribute("data-hijaxed",!0),s.addEventListener("click",(e=>{e.preventDefault(),this.setPage(r)}),!1))}}setPage(e,t){e===this.currentPage||t?this.preFlight(e):(history.pushState(null,null,e),this.watchPopState())}preFlight(e){if(!this.options.preFlight)return this.loadPage(e);this.options.preFlight(e,((t,s,r)=>{t&&(this.options.onError?this.options.onError("danger",t):alert("Error loading page: "+t)),s?this.currentPage=location.pathname+location.search:this.loadPage(r||e)}))}loadPage(e){this.queueFrame((()=>{Ze.addClass(document.body,"hijax-loading")})),this.options.onExitPage&&this.options.onExitPage();const t=new XMLHttpRequest;t.open("GET",e),t.setRequestHeader("Sargasso-Hijax",1),t.setRequestHeader("x-digitopia-hijax",1),this.options.onLoading&&(this.options.onLoading(),t.onreadystatechange=this.options.onLoading),t.onload=()=>{if(301===t.status||302===t.status||t.getResponseHeader("Sargasso-Location")){const e=t.getResponseHeader("Location")?t.getResponseHeader("Location"):t.getResponseHeader("Sargasso-Location");this.setPage(e)}else if(200===t.status){Gi.scrollTop(0),this.mergePage(t.responseText);const e=this.currentPage,frame=()=>{this.notifyAll("newPage",[e,location.pathname+location.search]),Ze.removeClass(document.body,"hijax-loading")};this.queueFrame(frame),this.currentPage=location.pathname+location.search}else{const e=t.getResponseHeader("Sargasso-Flash-Level")||"danger";let s=t.getResponseHeader("Sargasso-Flash-Message")||t.statusText;s||(s="Could not connect to server."),this.options.onError?this.options.onError(e,s):alert("Error loading page: "+s)}},t.send()}processScripts(e){Array.from(e).forEach((e=>{e.remove();const t=e.getAttribute("id");document.getElementById(t)||document.getElementsByTagName("head")[0].appendChild(e)}))}mergePage(e){const t=document.querySelectorAll("[data-ephemeral]");Array.from(t).forEach((e=>{e.remove()}));const s=e.split(/(<body[^>]*>|<\/body>)/gi),r=makeFragment(s[2]),i=document.querySelectorAll("[data-hijax]");for(let e=0;e<i.length;e++){const t=i[e],s=t.getAttribute("id"),n=r.getElementById(s);if(t.hasAttribute("data-hijax-skip-unchanged")){if(this.cachedMarkup[s]===n.innerHTML)continue;this.cachedMarkup[s]=n.innerHTML}const o=t.getAttribute("data-hijax-cache-key-selector");if(o&&n.querySelector(o)&&t.querySelector(o)&&t.querySelector(o).getAttribute("data-hijax-cache-key")===n.querySelector(o).getAttribute("data-hijax-cache-key"))continue;this.processScripts(n.querySelectorAll("script"));const frame=()=>{t.parentNode.replaceChild(n,t),this.options.onEnterPage&&this.options.onEnterPage(),this.hijaxLinks(n)};this.queueFrame(frame)}}}registerSargassoClass("HijaxLoader",HijaxLoader);const makeFragment=e=>{if(document.createRange&&document.createRange().createContextualFragment)return document.createRange().createContextualFragment(e);const t=document.createDocumentFragment(),s=document.createElement("div");return s.insertAdjacentHTML("afterBegin",e),t.appendChild(s),t};e.loadPageHandler=void 0;const un={registerSargassoClass:registerSargassoClass,bootSargasso:(t={})=>{if(t.scrollElement&&Gi.setOptions(t),t.breakpoints){new Breakpoints(document.body,t.breakpoints).start()}if(t.hijax){const s=new HijaxLoader(document.body,t.hijax);s.start(),e.loadPageHandler=s.setPage.bind(s)}else e.loadPageHandler=e=>{document.location.href=e};new SargassoSupervisor(document.body,t).start(t)},elementTools:Ze,validate:validate,setValidator:setValidator},dn={theDOMWatcher:Bi,theScrollWatcher:Gi,theResizeWatcher:Qi,theOrientationWatcher:Zi,theWorkerWatcher:Ki,theObservableObjectWatcher:Ji};return e.ObservableObject=ObservableObject,e.Sargasso=Sargasso,e.services=dn,e.utils=un,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
//# sourceMappingURL=sargasso.iife.min.js.map
{
"name": "@pelagiccreatures/sargasso",
"version": "2.0.1",
"version": "2.0.2",
"description": "Simple, Fast, Reactive, Supervised Javascript controllers for custom html elements.",

@@ -8,6 +8,6 @@ "type": "module",

"targets": {
"browser": {
"includeNodeModules": true
}
},
"browser": {
"includeNodeModules": true
}
},
"keywords": [

@@ -14,0 +14,0 @@ "javascript",

@@ -8,9 +8,9 @@ # [@pelagiccreatures/sargasso](https://www.npmjs.com/package/@pelagiccreatures/sargasso)

@license MIT
Made in Barbados 🇧🇧 Copyright © 2020-2021 Michael Rhodes
Made in Barbados 🇧🇧 Copyright © 2020-2022 Michael Rhodes
```
### Sargasso implements modern tools for:
* Web pages
* PWA (Progressive Web Apps)
* SPA (single-page applications)
* Web pages

@@ -48,7 +48,7 @@ ### Key features

We are trying to keep this project as forward looking so as to not burden this framework with lots of obsolete junk and polyfills so while it will probably not work on *every* ancient browser, it should work on any *reasonably* modern one. If you run into any problems, have questions, want to help or have any feedback let us know by opening a github issue.
We are trying to keep this project as forward looking so as to not burden this framework with lots of obsolete junk and polyfills so while it will probably not work on *every* ancient browser, it will work on any *reasonably* modern one. If you run into any problems, have questions, want to help or have any feedback let us know by opening a github issue.
### Usage Overview (Using CDN iife modules)
### Usage Overview (Using CDN es modules)
This simple example loads the framework using the CDN and defines a simple Sargasso element controller that says "Hi World!".
This simple example loads the framework using the CDN and defines a simple Sargasso element controller that says "Hello World!".

@@ -65,27 +65,33 @@ example/example1.html

<sargasso-my-class id="custom">Using a custom element</sargasso-my-class>
<!-- sargasso custom element tag is the class name in KebabCase -->
<sargasso-hello-world></sargasso-hello-world>
<div data-sargasso-class="MyClass" id="data-attribute">Using data attribute</div>
<!-- use javascript modules in browser -->
<script async src="https://unpkg.com/es-module-shims@0.13.1/dist/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"@pelagiccreatures/sargasso": "https://unpkg.com/@pelagiccreatures/sargasso/dist/sargasso.mjs"
}
}
</script>
<script type="module">
import { Sargasso, utils } from "@pelagiccreatures/sargasso"
<script src='https://cdn.jsdelivr.net/npm/@pelagiccreatures/sargasso/dist/sargasso.iife.js'></script>
<script defer>
window.onload = () => {
// define MyClass as a subclass of Sargasso
class MyClass extends SargassoModule.Sargasso {
start() {
// use an animation frame to set the element content
this.queueFrame(() => {
this.element.innerHTML = 'Hello World! (' + this.element.getAttribute('id') + ')'
})
super.start()
}
// define HelloWorld as a subclass of Sargasso, classname in CamelCase
class HelloWorld extends Sargasso {
start() {
// use an animation frame
this.queueFrame(() => {
this.element.innerHTML = 'Hello World!'
})
super.start()
}
}
// Register MyClass to the Sargasso framework
SargassoModule.utils.registerSargassoClass('MyClass', MyClass)
// Register HelloWorld class as a custom element
utils.registerSargassoClass('HelloWorld', HelloWorld)
// Start Sargasso
SargassoModule.utils.bootSargasso()
}
// Start Sargasso
utils.bootSargasso()
</script>

@@ -97,13 +103,4 @@ </body>

Sargasso element controllers are javascript Objects that are subclasses of the framework's Sargasso class. Custom behavior is defined by overriding various methods of the base class.
Sargasso custom element controllers are javascript Objects that are subclasses of the framework's Sargasso class. Custom behavior is defined by overriding public methods of the base class.
#### Using data-sargasso-class to specify Sargasso classname
Alternately, Sargasso watches the DOM for any elements tagged with the `data-sargasso-class` attribute which can be one classname or a list of classnames.
```html
<body data-sargasso-class="MyClass, MyOtherClass">This works in all browsers</body>
```
You can also defer the instantiation using the lazy method by tagging it with `data-lazy-sargasso-class` instead of `data-sargasso-class` which will only start up the controller when the element becomes visible in the viewport.
#### Custom Element tags to specify classname

@@ -123,2 +120,11 @@

#### Using data-sargasso-class to specify Sargasso classname
Alternately, Sargasso watches the DOM for any elements tagged with the `data-sargasso-class` attribute which can be one classname or a list of classnames.
```html
<body data-sargasso-class="MyClass, MyOtherClass">This works in all browsers</body>
```
You can also defer the instantiation using the lazy method by tagging it with `data-lazy-sargasso-class` instead of `data-sargasso-class` which will only start up the controller when the element becomes visible in the viewport.
### Sargasso Object Lifecycle

@@ -128,3 +134,3 @@

When a Sargasso element appears in the document, the framework supervisor will instantiate an object and call the `start()` method of the object. When removed from the DOM, 'sleep()' will be called allowing cleanup of any resources or handlers set up in start (note that event listeners created with 'this.on' and 'this.once' are automatically cleaned up.)
When a Sargasso element appears in the document, the framework supervisor will instantiate an object and call the `start()` method of the object. When removed from the DOM, 'sleep()' will be called allowing cleanup of any resources or event handlers set up in start (note that event listeners created with 'this.on' and 'this.once' are automatically cleaned up.)

@@ -131,0 +137,0 @@ ### Example with event handlers

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc