dothtml 4.8.5 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{jest.config.js → jest.config.ts} +19 -16
- package/lib/arg-callback-obj.d.ts +29 -0
- package/lib/built-in-components/nav-link.d.ts +8 -0
- package/lib/built-in-components/router.d.ts +57 -0
- package/lib/component.d.ts +73 -0
- package/lib/dot-component-legacy.d.ts +0 -0
- package/lib/dot-document.d.ts +0 -0
- package/lib/dot-util.d.ts +13 -0
- package/lib/dot.d.ts +5 -0
- package/lib/dothtml.d.ts +21 -0
- package/lib/dothtml.js +2 -0
- package/lib/dothtml.js.LICENSE.txt +1 -0
- package/lib/err.d.ts +2 -0
- package/lib/event-bus.d.ts +10 -0
- package/lib/i-dot.d.ts +674 -0
- package/lib/i-dotcss.d.ts +827 -0
- package/lib/node-polyfill.d.ts +2 -0
- package/lib/observable-array.d.ts +49 -0
- package/lib/style-builder.d.ts +3 -0
- package/package.json +11 -5
- package/readme.md +3 -2
- package/src/{arg-callback-obj.js → arg-callback-obj.ts} +18 -6
- package/src/built-in-components/nav-link.ts +21 -0
- package/src/built-in-components/router.ts +315 -0
- package/src/component.ts +369 -0
- package/src/dot-component-legacy.ts +79 -0
- package/src/dot-document.ts +0 -0
- package/src/dot-util.ts +33 -0
- package/src/dot.ts +1147 -0
- package/src/dothtml.ts +33 -0
- package/src/err.ts +22 -0
- package/src/event-bus.ts +39 -0
- package/src/i-dot.ts +787 -0
- package/src/i-dotcss.ts +918 -0
- package/src/node-polyfill.ts +11 -0
- package/src/{observable-array.js → observable-array.ts} +10 -5
- package/src/{style-builder.js → style-builder.ts} +219 -183
- package/tsconfig.json +99 -0
- package/unittests/advanced-bindings.test.ts +421 -0
- package/unittests/{array-evaluation.test.js → array-evaluation.test.ts} +1 -1
- package/unittests/{basic-functionality.test.js → basic-functionality.test.ts} +14 -10
- package/unittests/class-binding.test.ts +227 -0
- package/unittests/component-decorator.-.ts +14 -0
- package/unittests/components-data.test.ts +153 -0
- package/unittests/components.test.ts +257 -0
- package/unittests/computed.test.ts +35 -0
- package/unittests/{core.js → core.ts} +5 -2
- package/unittests/element-and-attribute-coverage.test.ts +472 -0
- package/unittests/hooks.test.ts +67 -0
- package/unittests/immutable-if.test.ts +19 -0
- package/unittests/input-bindings.test.ts +166 -0
- package/unittests/integration.test.ts +5 -0
- package/unittests/{iterations.test.js → iterations.test.ts} +5 -5
- package/unittests/logic.test.ts +18 -0
- package/unittests/refs.test.ts +36 -0
- package/unittests/routing.-.ts +56 -0
- package/unittests/{scopes.test.js → scopes.test.ts} +5 -5
- package/unittests/special-tags.test.ts +39 -0
- package/unittests/styles.test.ts +9 -0
- package/unittests/{testpage.js → testpage.ts} +2 -0
- package/unittests/{wait.test.js → wait.test.ts} +8 -5
- package/webpack.config.js +13 -1
- package/lib/dothtml.min.js +0 -1
- package/src/component.js +0 -305
- package/src/err.js +0 -20
- package/src/event-bus.js +0 -40
- package/src/index.js +0 -1453
- package/src/util.js +0 -13
- package/unittests/advanced-bindings.test.js +0 -386
- package/unittests/class-binding.test.js +0 -53
- package/unittests/components-data.test.js +0 -97
- package/unittests/components.test.js +0 -151
- package/unittests/computed.test.js +0 -36
- package/unittests/hooks.test.js +0 -57
- package/unittests/immutable-if.test.js +0 -15
- package/unittests/input-bindings.test.js +0 -155
- package/unittests/integration.test.js +0 -6
- package/unittests/logic.test.js +0 -18
- package/unittests/routing.-.js +0 -56
- package/unittests/special-tags.test.js +0 -32
package/lib/dothtml.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>ae});var r=function(e){var t=null;if(e){if("string"==typeof e)if(e.length>2&&e.indexOf("{}")==e.length-2)e=e.substring(0,e.length-2),t=[document.createElement("style")],document.head.appendChild(t[0]),t[0].innerHTML=e+"{}";else{var i=n[0];t=i&&i.parentNode&&i.querySelectorAll?function(e,t){for(var r=Array.from(t.querySelectorAll(e)),n=0;n<r.length;n++){var a=r[n];if(a.__dothtml_component){r.splice(n,1),n--;for(var i=a.querySelectorAll(e),o=0;o<i.length;o++){let e=i[o];r.splice(r.indexOf(e,n+1),1)}}}var s=Array.from(t.parentNode.querySelectorAll(e)),l=s.indexOf(t);return-1!=l&&r.unshift(s[l]),r}(e,i):document.querySelectorAll(e)}(e instanceof NodeList||e instanceof Array)&&(t=e),e instanceof Node&&(t=[e])}return r._lastBuilder=new a(t),r._lastBuilder};r.version="0.14.0",r._fxInterval=1e3/60,r._lastBuilder=null,r._floatRegex=new RegExp("[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?","g");var n=[];function a(e){this.currentCss="",this.target=e}r._Builder=a;var i=a.prototype;function o(){this.type=null,this.jsFriendlyProp=null}i.toString=r.prototype.toString=function(){return this.currentCss},i.hide=function(){if(this.target){var e=arguments[0]||{},t={};if(t.duration=e.duration||(isNaN(e)?0:e)||0,t.complete=e.complete||("function"==typeof arguments[1]?arguments[1]:"function"==typeof arguments[2]?arguments[2]:function(){}),t.hideStyle=e.hideStyle||"normal",t.animationStyle=e.animationStyle||("string"==typeof arguments[1]?arguments[1]:"ease"),t.duration>0)for(var n=0,a=0,i=this.target.length,o=0;o<this.target.length;o++){var s=this.target[o].style.width,l=this.target[o].style.height,u=this.target[o].style.opacity;""===u&&(u=1);var c=this.target[o].style.overflow;"fade"!=t.hideStyle&&(this.target[o].style.overflow="hidden",a+=2,function(e,o,s,l,u){r(o).width.animate(0,t.duration,t.animationStyle,(function(){r(o).display("none").width(s).overflow(u),++n>=a*i&&t.complete(e)})),r(o).height.animate(0,t.duration,t.animationStyle,(function(){r(o).display("none").height(l),++n>=a*i&&t.complete(e)}))}(this,this.target[o],s,l,c)),"shrink"!=t.hideStyle&&(a++,function(e,o,s){r(o).opacity.animate(0,t.duration,t.animationStyle,(function(){r(o).display("none").opacity(s),++n>=a*i&&t.complete(e)}))}(this,this.target[o],u))}else r(this.target).display("none"),t.complete(this)}return this},i.show=function(){if(this.target){var e=arguments[0]||{},t={};if(t.duration=e.duration||(isNaN(e)?0:e)||0,t.display=e.display||"block",t.opacity=e.opacity,t.width=e.width||null,t.height=e.height||null,t.complete=e.complete||("function"==typeof arguments[1]?arguments[1]:"function"==typeof arguments[2]?arguments[2]:function(){}),t.showStyle=e.showStyle||"normal",t.animationStyle=e.animationStyle||("string"==typeof arguments[1]?arguments[1]:"ease"),!(t.duration>0))return r(this.target).display(t.display);for(var n=0,a=this.target.length,i=0,o=0;o<this.target.length;o++){var s=t.opacity;if(void 0===t.opacity&&(s=parseFloat(this.target[o].style.opacity)||1),"fade"!=t.showStyle){i+=2;var l=t.width||this.target[o].style.width,u=t.height||this.target[o].style.height;r(this.target[o]).width(0),r(this.target[o]).height(0),r(this.target[o]).width.animate(l,t.duration,t.animationStyle,(function(){++n>=a*i&&t.complete()})),r(this.target[o]).height.animate(u,t.duration,t.animationStyle,(function(){++n>=a*i&&t.complete()}))}r(this.target[o]).opacity(0),r(this.target[o]).display(t.display),"grow"!=t.showStyle&&(i++,r(this.target[o]).opacity.animate(s,t.duration,t.animationStyle,(function(){++n==a*i&&t.complete()})))}}return this},i.fadeOut=function(e,t){return this.hide({duration:isNaN(e)?400:Number(e),hideStyle:"fade",complete:t})},i.fadeIn=function(e,t){return this.show({duration:isNaN(e)?400:Number(e),showStyle:"fade",complete:t})},r._Url=function(e){if(this.type="url",this.url=null,!e||0==e.length||1==e.length&&""==e[0]||"none"==e[0]||"initial"==e[0]||"inherit"==e[0])this.url=null;else{this.url=[];for(var t=0;t<e.length;t++)if(0===e[t].toLowerCase().indexOf("url")){var r=e[t].substring(indexOf("("),lastIndexOf(")")).trim();(r.indexOf('"')&&r.lastIndexOf('"')==r.length-1||r.indexOf("'")&&r.lastIndexOf("'")==r.length-1)&&(r=r.substring(1,ret.length-1)),this.url.push(r)}else this.url.push(e[t])}},r._Url.prototype.toString=function(){if(this.url){for(var e=[],t=0;t<this.url.length;t++)e.push('url("'+this.url[t]+'")');return e.join(", ")}return"none"},r._Color=function(e){if(this.type="color",this.r=0,this.g=0,this.b=0,this.a=1,1==e.length)if(""==(e=e[0])||"none"==e||"initial"==e||"inherit"==e);else if(isNaN(e))if("#"==e[0]){var t=e.split("#")[1];3==t.length?(this.r=Number("0x"+t[0]+t[0]),this.g=Number("0x"+t[1]+t[1]),this.b=Number("0x"+t[2]+t[2])):6==t.length&&(this.r=Number("0x"+t[0]+t[1]),this.g=Number("0x"+t[2]+t[3]),this.b=Number("0x"+t[4]+t[5]))}else if(0===e.toLowerCase().indexOf("rgb")){var r=e.split("(")[1];3!=(r=(r=r.split(")")[0]).split(",")).length&&4!=r.length||(this.r=Number(r[0]),this.g=Number(r[1]),this.b=Number(r[2]),this.a=Number(r[3]||1))}else{var n=0,a=0,i=0;switch(e.toLowerCase()){case"aliceblue":n=240,a=248,i=255;break;case"antiquewhite":n=250,a=235,i=215;break;case"aqua":n=0,a=255,i=255;break;case"aquamarine":n=127,a=255,i=212;break;case"azure":n=240,a=255,i=255;break;case"beige":n=245,a=245,i=220;break;case"bisque":n=255,a=228,i=196;break;case"black":n=0,a=0,i=0;break;case"blanchedalmond":n=255,a=235,i=205;break;case"blue":n=0,a=0,i=255;break;case"blueviolet":n=138,a=43,i=226;break;case"brown":n=165,a=42,i=42;break;case"burlywood":n=222,a=184,i=135;break;case"cadetblue":n=95,a=158,i=160;break;case"chartreuse":n=127,a=255,i=0;break;case"chocolate":n=210,a=105,i=30;break;case"coral":n=255,a=127,i=80;break;case"cornflowerblue":n=100,a=149,i=237;break;case"cornsilk":n=255,a=248,i=220;break;case"crimson":n=220,a=20,i=60;break;case"cyan":n=0,a=255,i=255;break;case"darkblue":n=0,a=0,i=139;break;case"darkcyan":n=0,a=139,i=139;break;case"darkgoldenrod":n=184,a=134,i=11;break;case"darkgray":case"darkgrey":n=169,a=169,i=169;break;case"darkgreen":n=0,a=100,i=0;break;case"darkkhaki":n=189,a=183,i=107;break;case"darkmagenta":n=139,a=0,i=139;break;case"darkolivegreen":n=85,a=107,i=47;break;case"darkorange":n=255,a=140,i=0;break;case"darkorchid":n=153,a=50,i=204;break;case"darkred":n=139,a=0,i=0;break;case"darksalmon":n=233,a=150,i=122;break;case"darkseagreen":n=143,a=188,i=143;break;case"darkslateblue":n=72,a=61,i=139;break;case"darkslategray":case"darkslategrey":n=47,a=79,i=79;break;case"darkturquoise":n=0,a=206,i=209;break;case"darkviolet":n=148,a=0,i=211;break;case"deeppink":n=255,a=20,i=147;break;case"deepskyblue":n=0,a=191,i=255;break;case"dimgray":case"dimgrey":n=105,a=105,i=105;break;case"dodgerblue":n=30,a=144,i=255;break;case"firebrick":n=178,a=34,i=34;break;case"floralwhite":n=255,a=250,i=240;break;case"forestgreen":n=34,a=139,i=34;break;case"fuchsia":n=255,a=0,i=255;break;case"gainsboro":n=220,a=220,i=220;break;case"ghostwhite":n=248,a=248,i=255;break;case"gold":n=255,a=215,i=0;break;case"goldenrod":n=218,a=165,i=32;break;case"gray":case"grey":n=128,a=128,i=128;break;case"green":n=0,a=128,i=0;break;case"greenyellow":n=173,a=255,i=47;break;case"honeydew":n=240,a=255,i=240;break;case"hotpink":n=255,a=105,i=180;break;case"indianred":n=205,a=92,i=92;break;case"indigo":n=75,a=0,i=130;break;case"ivory":n=255,a=255,i=240;break;case"khaki":n=240,a=230,i=140;break;case"lavender":n=230,a=230,i=250;break;case"lavenderblush":n=255,a=240,i=245;break;case"lawngreen":n=124,a=252,i=0;break;case"lemonchiffon":n=255,a=250,i=205;break;case"lightblue":n=173,a=216,i=230;break;case"lightcoral":n=240,a=128,i=128;break;case"lightcyan":n=224,a=255,i=255;break;case"lightgoldenrodyellow":n=250,a=250,i=210;break;case"lightgray":case"lightgrey":n=211,a=211,i=211;break;case"lightgreen":n=144,a=238,i=144;break;case"lightpink":n=255,a=182,i=193;break;case"lightsalmon":n=255,a=160,i=122;break;case"lightseagreen":n=32,a=178,i=170;break;case"lightskyblue":n=135,a=206,i=250;break;case"lightslategray":case"lightslategrey":n=119,a=136,i=153;break;case"lightsteelblue":n=176,a=196,i=222;break;case"lightyellow":n=255,a=255,i=224;break;case"lime":n=0,a=255,i=0;break;case"limegreen":n=50,a=205,i=50;break;case"linen":n=250,a=240,i=230;break;case"magenta":n=255,a=0,i=255;break;case"maroon":n=128,a=0,i=0;break;case"mediumaquamarine":n=102,a=205,i=170;break;case"mediumblue":n=0,a=0,i=205;break;case"mediumorchid":n=186,a=85,i=211;break;case"mediumpurple":n=147,a=112,i=219;break;case"mediumseagreen":n=60,a=179,i=113;break;case"mediumslateblue":n=123,a=104,i=238;break;case"mediumspringgreen":n=0,a=250,i=154;break;case"mediumturquoise":n=72,a=209,i=204;break;case"mediumvioletred":n=199,a=21,i=133;break;case"midnightblue":n=25,a=25,i=112;break;case"mintcream":n=245,a=255,i=250;break;case"mistyrose":n=255,a=228,i=225;break;case"moccasin":n=255,a=228,i=181;break;case"navajowhite":n=255,a=222,i=173;break;case"navy":n=0,a=0,i=128;break;case"oldlace":n=253,a=245,i=230;break;case"olive":n=128,a=128,i=0;break;case"olivedrab":n=107,a=142,i=35;break;case"orange":n=255,a=165,i=0;break;case"orangered":n=255,a=69,i=0;break;case"orchid":n=218,a=112,i=214;break;case"palegoldenrod":n=238,a=232,i=170;break;case"palegreen":n=152,a=251,i=152;break;case"paleturquoise":n=175,a=238,i=238;break;case"palevioletred":n=219,a=112,i=147;break;case"papayawhip":n=255,a=239,i=213;break;case"peachpuff":n=255,a=218,i=185;break;case"peru":n=205,a=133,i=63;break;case"pink":n=255,a=192,i=203;break;case"plum":n=221,a=160,i=221;break;case"powderblue":n=176,a=224,i=230;break;case"purple":n=128,a=0,i=128;break;case"rebeccapurple":n=102,a=51,i=153;break;case"red":n=255,a=0,i=0;break;case"rosybrown":n=188,a=143,i=143;break;case"royalblue":n=65,a=105,i=225;break;case"saddlebrown":n=139,a=69,i=19;break;case"salmon":n=250,a=128,i=114;break;case"sandybrown":n=244,a=164,i=96;break;case"seagreen":n=46,a=139,i=87;break;case"seashell":n=255,a=245,i=238;break;case"sienna":n=160,a=82,i=45;break;case"silver":n=192,a=192,i=192;break;case"skyblue":n=135,a=206,i=235;break;case"slateblue":n=106,a=90,i=205;break;case"slategray":case"slategrey":n=112,a=128,i=144;break;case"snow":n=255,a=250,i=250;break;case"springgreen":n=0,a=255,i=127;break;case"steelblue":n=70,a=130,i=180;break;case"tan":n=210,a=180,i=140;break;case"teal":n=0,a=128,i=128;break;case"thistle":n=216,a=191,i=216;break;case"tomato":n=255,a=99,i=71;break;case"turquoise":n=64,a=224,i=208;break;case"violet":n=238,a=130,i=238;break;case"wheat":n=245,a=222,i=179;break;case"white":n=255,a=255,i=255;break;case"whitesmoke":n=245,a=245,i=245;break;case"yellow":n=255,a=255,i=0;break;case"yellowgreen":n=154,a=205,i=50}this.r=n,this.g=a,this.b=i}else this.b=255&e,e>>=8,this.g=255&e,e>>=8,this.r=255&e;else 3!=e.length&&4!=e.length||(this.r=e[0],this.g=e[1],this.b=e[2],4==e.length&&(this.a=e[3]))},r._Color.prototype.toString=function(){var e=Math.round,t=Math.max,r=Math.min;return 1==this.a?"rgb("+r(255,t(0,e(this.r)))+", "+r(255,t(0,e(this.g)))+", "+r(255,t(0,e(this.b)))+")":"rgba("+r(255,t(0,e(this.r)))+", "+r(255,t(0,e(this.g)))+", "+r(255,t(0,e(this.b)))+", "+r(1,t(0,this.a))+")"},r._Length=function(e){e=e||"0px",isNaN(e)||(e=Math.round(e)+"px"),this.type="length",this.length=Number(e.match(r._floatRegex)[0]),this.units=e.split(r._floatRegex)[1]||"px"},r._Length.prototype.toString=function(){return this.length+this.units},r._Angle=function(e){e=e||"0deg",isNaN(e)||(e=Math.round(e)+"px"),this.type="angle",this.angle=Number(e.match(r._floatRegex)[0]),this.units=e.split(r._floatRegex)[1]||"deg"},r._Angle.prototype.toString=function(){return this.angle+this.units},r._Transform=function(e){if(this.type="transformation",this.transformations=[],""!=e&&"none"!=e&&"initial"!=e&&"inherit"!=e&&-1!=(""+e).indexOf("(")){var t=e.split(/\)\s*/);t.pop();for(var r=0;r<t.length;r++)t[r]+=")";Math.cos,Math.sin,Math.tan;for(var n=0;n<t.length;n++){var a=t[n].trim().split(/[\(\)]/),i=a[0],o=a[1].split(/\s*,\s*/);this[i]&&this[i].apply(this,o)}}},r._Transform.prototype.toString=function(){for(var e="",t=0;t<this.transformations.length;t++){var r=this.transformations[t];e+=r.transformation+"(";for(var n=0;n<r.args.length;n++)e+=r.args[n]+",";e=e.substring(0,e.length-1),e+=") "}return e.trim()},r._Transform.prototype._updateValue=function(e,t){this.transformations.push({transformation:e,args:t})},r._Transform.prototype.matrix3d=function(){var e=arguments;if(16!=e.length)throw"matrix3d requires 16 parameters.";return this.finalMatrix=r.matrixMultiply3D(e,this.finalMatrix),this._updateValue("matrix3d",args),this},r._Transform.prototype.matrix=function(){var e=arguments;if(6==e.length)this._updateValue("matrix",e);else{if(16!=e.length)throw"matrix requires 6 parameters.";this.matrix3d.apply(this,e)}return this},r._Transform.prototype.translate=function(){var e=arguments;if(1==e.length){var t=r.lengthToPx(e[0]);this._updateValue("translate",[new r._Length(t+"px")])}else if(2==e.length){t=r.lengthToPx(e[0]);var n=r.lengthToPx(e[1]);this._updateValue("translate",[new r._Length(t+"px"),new r._Length(n+"px")])}else{if(3!=e.length)throw"translate requires 1 or 2 parameters.";this.translate3d.apply(this,e)}return this},r._Transform.prototype.translate3d=function(){var e=arguments;if(3!=e.length)throw"translate3d requires 3 parameters.";var t=r.lengthToPx(e[0]),n=r.lengthToPx(e[1]),a=r.lengthToPx(e[2]);return this._updateValue("translate3d",[new r._Length(t+"px"),new r._Length(n+"px"),new r._Length(a+"px")]),this},r._Transform.prototype.translateX=function(){var e=arguments;if(1!=e.length)throw"translateX requires 1 parameter.";return this.translate(e[0],0),this},r._Transform.prototype.translateY=function(){var e=arguments;if(1!=e.length)throw"translateY requires 1 parameter.";return this.translate(0,e[0]),this},r._Transform.prototype.translateZ=function(){var e=arguments;if(1!=e.length)throw"translateZ requires 1 parameter.";return this.translate3d(0,0,e[0]),this},r._Transform.prototype.scale=function(){var e=arguments;if(2==e.length)this._updateValue("scale",e);else{if(3!=e.length)throw"scale requires 2 parameters.";this.scale3d.apply(this,e)}return this},r._Transform.prototype.scale3d=function(){var e=arguments;if(3!=e.length)throw"scale3d requires 3 parameters.";return this._updateValue("scale3d",e),this},r._Transform.prototype.scaleX=function(){var e=arguments;if(1!=e.length)throw"scaleX requires 1 parameter.";return this.scale(e[0],1),this},r._Transform.prototype.scaleY=function(){var e=arguments;if(1!=e.length)throw"scaleY requires 1 parameter.";return this.scale(1,e[0]),this},r._Transform.prototype.scaleZ=function(){var e=arguments;if(1!=e.length)throw"scaleZ requires 1 parameter.";return this.scale3d(1,1,e[0]),this},r._Transform.prototype.rotate=function(){var e=arguments;if(1!=e.length)throw"scaleZ requires 1 parameter.";var t=r.angleToDeg(e[0]);return this._updateValue("rotate",[new r._Angle(t+"deg")]),this},r._Transform.prototype.rotate3d=function(){var e=arguments;if(4!=e.length)throw"rotate3d requires 4 parameters.";var t=e[0],n=e[1],a=e[2],i=r.angleToDeg(e[3]);return this._updateValue("rotate3d",[t,n,a,new r._Angle(i+"deg")]),this},r._Transform.prototype.rotateX=function(){var e=arguments;if(1!=e.length)throw"rotateX requires 1 parameter.";var t=r.angleToDeg(e[0]);return this._updateValue("rotateX",[new r._Angle(t+"deg")]),this},r._Transform.prototype.rotateY=function(){var e=arguments;if(1!=e.length)throw"rotateY requires 1 parameter.";var t=r.angleToDeg(e[0]);return this._updateValue("rotateY",[new r._Angle(t+"deg")]),this},r._Transform.prototype.rotateZ=function(){return this.rotate.apply(this,arguments),this},r._Transform.prototype.skew=function(){var e=arguments;if(1==e.length){var t=r.angleToDeg(e[0]);this._updateValue("skew",[new r._Angle(t+"deg")])}else{if(2!=e.length)throw"skew requires 1 or 2 parameters.";t=r.angleToDeg(e[0]);var n=r.angleToDeg(e[1]);this._updateValue("skew",[new r._Angle(t+"deg"),new r._Angle(n+"deg")])}return this},r._Transform.prototype.skewX=function(){var e=arguments;if(1!=e.length)throw"skewX requires 1 parameter.";return this.skew.apply(this,e),this},r._Transform.prototype.skewY=function(){var e=arguments;if(1!=e.length)throw"skewY requires 1 parameter.";return this.skew.apply(this,[0,e[0]]),this},r._Transform.prototype.perspective=function(){var e=arguments;if(1!=e.length)throw"perspective requires 1 parameter.";var t=r.lengthToPx(e[0]);return this._updateValue("perspective",[new r._Length(t+"px")]),this},r._Complex=function(e){this.type="complex",this.parts=(" "+e+" ").split(r._floatRegex),this.numbers=e.match(r._floatRegex)},r._Complex.prototype.toString=function(){for(var e=this.parts[0],t=0;t<this.numbers.length;t++)e+=this.numbers[t]+this.parts[t+1];return e},r._Number=function(e){this.type="number",this.value=Number(e)},r._Number.prototype.toString=function(){return this.value},r._Unknown=function(e){this.type="unknown",this.value=e},r._Unknown.prototype.toString=function(){return this.value},o.prototype.toString=function(){if(r._lastBuilder.target){var e=null;if(r._lastBuilder.target.length>1){e=[];for(var t=0;t<r._lastBuilder.target.length;t++)e.push(r._lastBuilder.target[t].style[this.jsFriendlyProp])}else e=r._lastBuilder.target[0].style[this.jsFriendlyProp];return e}return null},o.prototype.val=function(){if(r._lastBuilder.target){var e=null;if(r._lastBuilder.target.length>1){e=null;for(var t=0;t<r._lastBuilder.target.length;t++)r._lastBuilder.target[0].style[this.jsFriendlyProp]?e.push(r._convertStyleIntoDotCssObject(r._lastBuilder.target[t].style[this.jsFriendlyProp],this.type)):e.push(null)}else e=r._lastBuilder.target[0].style[this.jsFriendlyProp]?r._convertStyleIntoDotCssObject(r._lastBuilder.target[0].style[this.jsFriendlyProp],this.type):null;return e}return null},o.prototype.animate=function(e,t,n,a){if(t=isNaN(t)?400:t||0,r._lastBuilder&&r._lastBuilder.target){!a&&n&&n.call&&n.apply&&(a=n,n=void 0);for(var i=0;i<r._lastBuilder.target.length;i++){var o,s=r._lastBuilder.target[i],l=null,u=null;if(u=r._convertStyleIntoDotCssObject(e,this.type),"transformation"==this.type&&(l=r._convertStyleIntoDotCssObject(s.style[this.jsFriendlyProp],this.type)),l||(l=r._convertStyleIntoDotCssObject(r._computedStyleOrActualStyle(s,this.jsFriendlyProp),this.type)),o=u.toString(),"length"==this.type){if(l.units!=u.units)if(0==l.length)l.units=u.units,l.length=0;else if(0==u.length)u.units=l.units,u.length=0;else{var c=r.lengthToPx(l.toString(),this.jsFriendlyProp,s),h=r.lengthToPx(u.toString(),this.jsFriendlyProp,s);l.length=c,l.units="px",u.length=h,u.units="px"}}else if("color"==this.type);else if("transformation"==this.type){for(var d="",p="",f=l.transformations.length-1,m=u.transformations.length-1;f>=0||m>=0;){var g="",b=null,_=null;if(f>=0&&m>=0&&l.transformations[f].transformation==u.transformations[m].transformation){var v=l.transformations[f],y=u.transformations[m];g=v.transformation,b=v.args,_=y.args,f--,m--}else if(f>=m){if(g=(v=l.transformations[f]).transformation,b=v.args,"matrix"==g)_=[1,0,0,1,0,0];else if("matrix3d"==g)_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];else{var w=-1==g.indexOf("scale")?0:1;_=[];for(var k=0;k<b.length;k++)_.push(isNaN(b[k])?isNaN(b[k].angle)?isNaN(b[k].length)?0:new r._Length(0):new r._Angle(0):w)}f--}else{if(g=(y=u.transformations[m]).transformation,_=y.args,"matrix"==g)b=[1,0,0,1,0,0];else if("matrix3d"==g)b=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];else for(w=-1==g.indexOf("scale")?0:1,b=[],k=0;k<_.length;k++)b.push(isNaN(_[k])?isNaN(_[k].angle)?isNaN(_[k].length)?0:new r._Length(0):new r._Angle(0):w);m--}if(d=") "+d,p=") "+p,-1!=g.indexOf("rotate")){var x=b[b.length-1].angle,N=_[_.length-1].angle,C=r.angleSubtract(N,x);b[b.length-1].angle=N-C}for(k=b.length-1;k>=0;k--)d=","+b[i]+d,p=","+_[i]+p;d=g+"("+d.substring(1),p=g+"("+p.substring(1)}l=r._convertStyleIntoDotCssObject(d,"transformation"),u=r._convertStyleIntoDotCssObject(p,"transformation")}else if("number"==l.type&&"number"==u.type);else{if("complex"!=l.type||"complex"!=u.type){console.warn("Couldn't animate "+this.jsFriendlyProp+". Not a recognizable length, color, or number.");continue}if(!r._compareComplexDataTypes(l,u)){console.warn("Couldn't animate "+this.jsFriendlyProp+". Value mismatch.");continue}}r._animate(s,this.jsFriendlyProp,l.type||this.type,l,u,o,r._fxInterval,t,n||"ease",a)}}return r._lastBuilder},o.prototype.apply=Function.apply,o.prototype.call=Function.call,r._animate=function(e,t,n,a,i,o,s,l,u,c,h){if(!h||e.style[t]==h)if(l-s>0){switch(n){case"color":var d=Math.round(r._numberStep(a.r,i.r,s,l,u)),p=Math.round(r._numberStep(a.g,i.g,s,l,u)),f=Math.round(r._numberStep(a.b,i.b,s,l,u)),m=r.formatNumberValue(r._numberStep(a.a,i.a,s,l,u));r(e)[t](d,p,f,m);break;case"length":r(e)[t](r.formatNumberValue(r._numberStep(a.length,i.length,s,l,u),a.units)+a.units);break;case"transformation":for(var g="",b=0;b<a.transformations.length;b++){var _=a.transformations[b],v=i.transformations[b];g+=_.transformation+"(";for(var y=0;y<_.args.length;y++){var w=_.args[y],k=v.args[y],x=isNaN(w)?w.length||w.angle||w.value||0:w,N=isNaN(k)?k.length||k.angle||k.value||0:k,C=isNaN(w)?w.units:"";g+=r.formatNumberValue(r._numberStep(x,N,s,l,u),C)+C+","}g=g.substring(0,g.length-1),g+=") "}r(e)[t](g);break;default:switch(a.type){case"number":r(e)[t](r.formatNumberValue(r._numberStep(a.value,i.value,s,l,u)));break;case"complex":var S="";for(b=0;b<a.numbers.length;b++)S+=a.parts[b],S+=r.formatNumberValue(r._numberStep(a.numbers[b],i.numbers[b],s,l,u));S+=a.parts[a.parts.length-1],r(e)[t](S);break;default:console.warn("Unexpected data type for animation.")}}var T=window.performance&&window.performance.now?window.performance.now():null,O=e.style[t],P=function(h){var d=T?window.performance.now()-T:r._fxInterval;r._animate(e,t,n,a,i,o,s+d,l,u,c,O)};window.requestAnimationFrame?window.requestAnimationFrame(P):window.setTimeout(P,r._fxInterval)}else r(e)[t](o),c&&c()},r._numberStep=function(e,t,r,n,a){switch(e=Number(e),t=Number(t),a){case"geometric":case"exponential":case"ease":return e+.5*(1-Math.cos(Math.PI*(r/n)))*(t-e);case"linear":default:return e+r/n*(t-e)}},r.formatNumberValue=function(e,t){switch(t){case"px":return Math.round(e);default:return Math.round(100*e)/100}};var s={color:"color|background-Color|border-Bottom-Color|border-Color|border-Left-Color|border-Right-Color|border-Top-Color|text-Decoration-Color|outline-Color|column-Rule-Color",length:"background-Size|border-Bottom-Left-Radius|border-Bottom-Right-Radius|border-Bottom-Width|border-Image-Width|border-Left-Width|border-Radius|border-Right-Width|border-Top-Left-Radius|border-Top-Right-Radius|border-Top-Width|border-Width|bottom|height|left|margin|margin-Bottom|margin-Left|margin-Right|margin-Top|max-Height|max-Width|min-Height|min-Width|padding|padding-Bottom|padding-Left|padding-Right|padding-Top|right|top|width|line-Height|font-Size",url:"background-Image|border-Image|list-Style-Image|content|image-Orientation",transformation:"transformation",misc:"opacity|background|background-Attachment|background-Blend-Mode|background-Position|background-Repeat|background-Clip|background-Origin|border|border-Bottom|border-Bottom-Style|border-Image-Outset|border-Image-Repeat|border-Image-Slice|border-Image-Source|border-Left|border-Left-Style|border-Right|border-Right-Style|border-Style|border-Top|border-Top-Style|box-Decoration-Break|box-Shadow|clear|clip|display|float|overflow|box|overflow-X|overflow-Y|position|visibility|vertical-Align|z-Index|align-Content|align-Items|align-Self|flex|flex-Basis|flex-Direction|flex-Flow|flex-Grow|flex-Shrink|flex-Wrap|grid|grid-Area|grid-Auto-Columns|grid-auto-Rows|grid-Column|grid-Column-End|grid-Column-Gap|grid-Column-Start|grid-Gap|grid-Row|grid-Row-End|grid-Row-Gap|grid-Row-Start|grid-Template|grid-Template-Areas|grid-Template-Columns|grid-Template-Rows|justify-Content|order|hanging-Punctuation|hyphens|letter-Spacing|line-Break|overflow-Wrap|tab-Size|text-Align|text-Align-Last|text-Combine-Upright|text-Indent|text-Justify|text-Transform|white-Space|word-Break|word-Spacing|word-Wrap|text-Decoration|text-Decoration-Line|text-Decoration-Style|text-Shadow|text-Underline-Position|font|font-Family|font-Feature-Settings|font-Kerning|font-Language-Override|font-Size-Adjust|font-Stretch|font-Style|font-Synthesis|font-Variant|font-Variant-Alternates|font-Variant-Caps|font-Variant-East-Asian|font-Variant-Ligatures|font-Variant-Numeric|font-Variant-Position|font-Weight|direction|text-Orientation|text-Combine-Upright|unicode-Bidi|user-Select|writing-Mode|border-Collapse|border-Spacing|caption-Side|empty-Cells|table-Layout|counter-Increment|counter-Reset|list-Style|list-Style-Position|list-Style-Type|animation|animation-Delay|animation-Direction|animation-Duration|animation-Fill-Mode|animation-Iteration-Count|animation-Name|animation-Play-State|animation-Timing-Function|backface-Visibility|perspective2d|perspective-Origin|transform-Origin|transform-Style|transition|transition-Property|transition-Duration|transition-Timing-Function|transition-Delay|box-Sizing|cursor|ime-Mode|nav-Down|nav-Index|nav-Left|nav-Right|nav-Up|outline|outline-Offset|outline-Style|outline-Width|resize|text-Overflow|break-After|break-Before|break-Inside|column-Count|column-Fill|column-Gap|column-Rule|column-Rule-Style|column-Rule-Width|column-Span|column-Width|columns|widows|orphans|page-Break-After|page-Break-Before|page-Break-Inside|marks|quotes|filter|image-Rendering|image-Resolution|object-Fit|object-Position|mask|mask-Type|mark|mark-After|mark-Before|phonemes|rest|rest-After|rest-Before|voice-Balance|voice-Duration|voice-Pitch|voice-Pitch-Range|voice-Rate|voice-Stress|voice-Volume|marquee-Direction|marquee-Play-Count|marquee-Speed|marquee-Style"},l=[{unit:"Em"},{unit:"Ex"},{unit:"Ch"},{unit:"Rem"},{unit:"Vw"},{unit:"Vh"},{unit:"Vmin"},{unit:"Vmax"},{unit:"%",jsName:"P"},{unit:"Cm"},{unit:"Mm"},{unit:"In"},{unit:"Px"},{unit:"Pt"},{unit:"Pc"}];for(var u in r.matrixMultiply3D=function(e,t){if(16!=e.length||16!=t.length)throw"3D matrices must be arrays of 16 length.";for(var r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0;n<4;n++)for(var a=0;a<4;a++)for(var i=0;i<4;i++)r[n+4*a]+=Number(e[n+4*i])*Number(t[i+4*a]);return r},r.angleToDeg=function(e){if(!isNaN(e))return Number(e);if(-1!=(e=e.trim()).indexOf("deg"))return r.formatNumberValue(Number(e.split("deg")[0]));if(-1!=e.indexOf("grad"))return r.formatNumberValue(.9*Number(e.split("grad")[0]));if(-1!=e.indexOf("rad"))return r.formatNumberValue(180*Number(e.split("rad")[0])/Math.PI);if(-1!=e.indexOf("turn"))return r.formatNumberValue(360*Number(e.split("turn")[0]));throw e+" does not have valid units for an angle."},r.lengthToPx=function(e,t,n){var a=Math.round,i=Number;if(!isNaN(e))return a(i(e));if((e=e.trim()).split,-1!=e.indexOf("px"))return a(i(e.split("px")[0]));if(-1!=e.indexOf("in"))return a(96*i(e.split("in")[0]));if(-1!=e.indexOf("pt"))return a(96*i(e.split("pt")[0])/72);if(-1!=e.indexOf("pc"))return a(16*i(e.split("pc")[0]));if(-1!=e.indexOf("cm"))return a(96*i(e.split("cm")[0])/2.54);if(-1!=e.indexOf("mm"))return a(96*i(e.split("mm")[0])/25.4);if(-1!=e.indexOf("q"))return a(96*i(e.split("q")[0])/101.6);if(-1!=e.indexOf("vw"))return a(.01*i(e.split("vw")[0])*Math.max(document.documentElement.clientWidth,window.innerWidth||0));if(-1!=e.indexOf("vh"))return a(.01*i(e.split("vh")[0])*Math.max(document.documentElement.clientHeight,window.innerHeight||0));if(-1!=e.indexOf("vmin"))return Math.min(r.lengthToPx(a(i(e.split("vmin")[0])))+"vw",a(i(e.split("vmin")[0]))+"vx");if(-1!=e.indexOf("vmax"))return Math.max(r.lengthToPx(a(i(e.split("vmin")[0])))+"vw",a(i(e.split("vmin")[0]))+"vx");if(-1!=e.indexOf("rem"))return a(i(e.split("rem")[0])*r.lengthToPx(r._computedStyleOrActualStyle(document.body,"fontSize")));if(t&&n){if(-1!=e.indexOf("em"))return a(i(e.split("em")[0])*r.lengthToPx(r._computedStyleOrActualStyle(n,"fontSize")));var o=null;switch(t){case"maxHeight":case"minHeight":case"top":case"bottom":case"height":if(!n.parentNode)throw"Cannot convert "+e+" "+t+" to px for an element that has no parent.";o=r.lengthToPx(r._computedStyleOrActualStyle(n.parentNode,"height"));break;case"maxHidth":case"minWidth":case"right":case"left":case"width":case"margin":case"marginTop":case"marginBottom":case"marginLeft":case"marginRight":case"padding":case"paddingTop":case"paddingBottom":case"paddingLeft":case"paddingRight":if(o=r.lengthToPx(r._computedStyleOrActualStyle(n.parentNode,"width")),!n.parentNode)throw"Cannot convert "+e+" "+t+" to px for an element that has no parent.";break;case"lineHeight":o=r.lengthToPx(r._computedStyleOrActualStyle(n,"fontSize"));break;case"fontSize":o=r.lengthToPx(r._computedStyleOrActualStyle(n,"height"));break;default:throw"Unable to convert the value "+e+" to px for "+t+"."}if(isNaN(o))throw"Convert the value "+e+" to px for "+t+" because the value it is relative to is not a number.";if(-1!=e.indexOf("%"))return a(.01*i(e.split("%")[0])*o);throw"The units of "+e+" are not recognized by dotcss."}throw e+" does not have valid units for an absolute length."},r._convertStyleIntoDotCssObject=function(e,t){return e instanceof Array||(e=[e]),"color"==t?new r._Color(e):"url"==t?new r._Url(e):"length"!=t||isNaN(e[0])&&(-1!=e[0].indexOf(" ")||e[0].replace(r._floatRegex,"")==e[0])?"transformation"==t?new r._Transform(e[0].toString()):""===e[0]||isNaN(e[0])&&(""+e[0]).replace(r._floatRegex,"")==e[0]?new r._Unknown(e[0]):isNaN(e[0])?new r._Complex(e[0]):new r._Number(e[0]):new r._Length(e[0])},r._compareComplexDataTypes=function(e,t){if("complex"!=e.type||"complex"!=t.type)return!1;if(e.numbers.length!=t.numbers.length)return!1;if(e.parts.length!=t.parts.length)return!1;for(var r=0;r<e.parts.length;r++)if(e.parts[r]!=t.parts[r])return!1;return!0},r._addPropFunctionToDotCssObject=function(e){r[e]=function(){var t=new a;return t[e].apply(t,arguments)}},r._makeFunction=function(e,t,n){if(i[t]=function(){if(0==arguments.length)return this;for(var a=[],i=0;i<arguments.length;i++)a.push(arguments[i]);var o=r._convertStyleIntoDotCssObject(a,n).toString(),s=e+":"+o+";";if(this.currentCss+=s,this.target)for(var l=0;l<this.target.length;l++){var u=this.target[l];"STYLE"==u.tagName?u.innerHTML=u.innerHTML.substring(0,u.innerHTML.length-1)+e+":"+o+";}":u.style[t]=o}return this},r._addPropFunctionToDotCssObject(t),"length"==n)for(var a=0;a<l.length;a++){var s=l[a];!function(e){i[t+(e.jsName||e.unit)]=function(){for(var r=0;r<arguments.length;r++)arguments[r]=arguments[r]+e.unit.toLowerCase();return i[t].apply(this,arguments)}}(s),r._addPropFunctionToDotCssObject(t+(s.jsName||s.unit))}for(var u in i[t].type=n,i[t].jsFriendlyProp=t,o.prototype)void 0===i[t][u]&&(i[t][u]=o.prototype[u])},r._makeTransformFunction=function(e){r[e]=function(){var t=new r._Transform;return t[e].apply(t,arguments)}},r._computedStyleOrActualStyle=function(e,t){return window.getComputedStyle(e)[t]||e.style[t]},r._modDeg=function(e){return e<0&&(e=360- -e%360),e%360},r.angleSubtract=function(e,t){e<0?e=360- -e%360:e%=360,t<0?t=360- -t%360:t%=360;var r=Math.abs(t-e)%360;return(r>180?360-r:r)*(e-t>=0&&e-t<=180||e-t<=-180&&e-t>=-360?1:-1)},r.url=function(e){return"url('"+e+"')"},r.rgb=function(e,t,r){return"rgb("+e+", "+t+", "+r+")"},r.rgba=function(e,t,r,n){return"rgba("+e+", "+t+", "+r+", "+n+")"},r.buildTransform=function(){return new r._Transform},r.scopeToEl=function(e){return n.unshift(e),this},r.unscope=function(){return n.shift(),this},s){let e=s[u].split("|");for(var c in e)r._makeFunction(e[c].toLowerCase(),e[c].replace(new RegExp("-","g"),""),u)}for(c=0;c<l.length;c++)r._makeTransformFunction(l[c]);const h=r;function d(e,t){if(e)for(var r=Object.keys(e),n=0;n<r.length;n++)t(r[n],e[r[n]])}function p(e){return e&&e.constructor&&e.call&&e.apply}function f(){this._callbacks={}}const m=f.prototype;m._checkAddEvent=function(e){var t=this._callbacks[e];return t||(this._callbacks[e]=t=[]),t},m.on=function(e,t){this._checkAddEvent(e).push(t)},m.off=function(e,t){for(var r=this._checkAddEvent(e),n=r.length-1;r>=0;n--)r[n]==t&&r.splice(n,1)},m.emit=function(e,t){d(this._checkAddEvent(e),(function(e,r){r(t)}))},m.flush=function(e){this._checkAddEvent(e).length=0};const g=new f,b=function(e,t){throw{A:"Can't append \""+(t=t||[])[0]+'".',CC:'The name "'+t[0]+'" conflicts with an existing DOThtml function.',CU:"Invalid usage: a component should at least have a name and a builder function.","C#":"Component '"+t[0]+"' must return exactly one child node.",F:'Element "'+t[0]+'" not found.',MC:"Can't mix static conditions with dynamic conditional rendering.",R:"Router must be passed a JSON object that contains an 'routes' array containing objects with a 'path', 'title', and 'component'.",S:"SVG is not supported by DOThtml.",XS:"Expected a string.",XF:"Expected a function."}[e]||"Unknown error."};function _(e,t){var r=this,n=[],a={itemadded:[],itemremoved:[],itemset:[]};function i(e){e in r||Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){return n[e]},set:function(t){n[e]!=t&&(n[e]=t,o({type:"itemset",index:e,item:t}))}})}function o(e){a[e.type].forEach((function(t){t.call(r,e)}))}this._dependencies=[],Object.defineProperty(r,"addEventListener",{configurable:!1,enumerable:!1,writable:!1,value:function(e,t){if(!((e=(""+e).toLowerCase())in a))throw new Error("Invalid event name.");if("function"!=typeof t)throw new Error("Invalid handler.");a[e].push(t)}}),Object.defineProperty(r,"removeEventListener",{configurable:!1,enumerable:!1,writable:!1,value:function(e,t){if(!((e=(""+e).toLowerCase())in a))throw new Error("Invalid event name.");if("function"!=typeof t)throw new Error("Invalid handler.");for(var r=a[e],n=r.length;--n>=0;)r[n]===t&&r.splice(n,1)}}),Object.defineProperty(r,"push",{configurable:!1,enumerable:!1,writable:!1,value:function(){for(var e,t=0,r=arguments.length;t<r;t++)e=n.length,n.push(arguments[t]),i(e),o({type:"itemadded",index:e,item:arguments[t]});return n.length}}),Object.defineProperty(r,"pop",{configurable:!1,enumerable:!1,writable:!1,value:function(){if(n.length>-1){var e=n.length-1,t=n.pop();return delete r[e],o({type:"itemremoved",index:e,item:t}),t}}}),Object.defineProperty(r,"unshift",{configurable:!1,enumerable:!1,writable:!1,value:function(){for(var e=0,t=arguments.length;e<t;e++)n.splice(e,0,arguments[e]),i(n.length-1),o({type:"itemadded",index:e,item:arguments[e]});return n.length}}),Object.defineProperty(r,"shift",{configurable:!1,enumerable:!1,writable:!1,value:function(){if(n.length>-1){var e=n.shift();return delete r[n.length],o({type:"itemremoved",index:0,item:e}),e}}}),Object.defineProperty(r,"splice",{configurable:!1,enumerable:!1,writable:!1,value:function(e,t){var a,s=[];e=null==e?0:e<0?n.length+e:e,t=null==t?n.length-e:t>0?t:0;for(var l=[];t--;)a=n.splice(e,1)[0],s.push(a),delete r[n.length],l.push({type:"itemremoved",index:e+s.length-1,item:a});for(var u=l.length-1;u>=0;u--)o(l[u]);u=2;for(var c=arguments.length;u<c;u++)n.splice(e,0,arguments[u]),i(n.length-1),o({type:"itemadded",index:e,item:arguments[u]}),e++;return s}}),Object.defineProperty(r,"length",{configurable:!1,enumerable:!1,get:function(){return n.length},set:function(e){var t=Number(e),a=n.length;if(!(t%1==0&&t>=0))throw new RangeError("Invalid array length");return t<a?r.splice(t):t>a&&r.push.apply(r,new Array(t-a)),n.length=t,e}}),Object.getOwnPropertyNames(Array.prototype).forEach((function(e){e in r||Object.defineProperty(r,e,{configurable:!1,enumerable:!1,writable:!1,value:Array.prototype[e]})})),e instanceof Array&&r.push.apply(r,e)}class v{constructor(e,t){this.el=e,this.f=t}}class y extends v{constructor(e,t,r){super(e,r),this.attr=t}updateContent(e){this.el.setAttribute(this.attr,this.f())}}class w extends v{constructor(e,t){super(e,t)}updateContent(e,t){e(this.el).empty().h(this.f(t))}}class k extends v{constructor(e,t){super(null,t),this.dotTarget=e}updateContent(){}}class x extends v{constructor(e,t,r,n){super(null,r),this.startNode=e,this.endNode=t,this.condition=n,this.lastValue=void 0}updateContent(e){if(this.lastValue!=!!this.condition())if(this.lastValue=!this.lastValue,this.lastValue)e._appendOrCreateDocument(this.f,this.endNode.parentNode,this.endNode);else do{var t=this.startNode.nextSibling;t&&t!=this.endNode&&t.parentNode.removeChild(t)}while(this.startNode.nextSibling&&this.startNode.nextSibling!=this.endNode)}}function N(){this.$el=null,this.$refs={},this.__handlers={}}var C,S,T;N.prototype.__addHandler=function(e,t){var r=this.__handlers[e];r||(r=this.__handlers[e]=[]),r.push(t)};var O=setTimeout;function P(e,t){var r=C.__currentArgCallback[C.__currentArgCallback.length-1];if(r)if(e instanceof _){var n=r.dotTarget;e.addEventListener("itemadded",(function(e){n._appendOrCreateDocument(r.f(e.item,e.index),void 0,e.index)})),e.addEventListener("itemset",(function(e){var t=n.__document,a=t.childNodes[e.index];t.removeChild(a),n._appendOrCreateDocument(r.f(e.item,e.index),void 0,e.index)})),e.addEventListener("itemremoved",(function(e){n.__document.removeChild(n.__document.childNodes[e.index])}))}else{var a=this.__propDependencies[t];a||(a=this.__propDependencies[t]=[]),a.push(r)}}function A(e,t){Object.defineProperty(t.prototype,e,{configurable:!1,enumerable:!1,get:function(){var t=this.__rawProps[e];return P.call(this,t,e),t},set:function(t){var r=t;t instanceof Array&&(r=new _(t)),this.__rawProps[e]=r;var n=this.__propDependencies[e],a=!1;for(let e=0;e<(n||[]).length;e++)n[e].updateContent(C,r),n[e]instanceof y&&"class"==n[e].attr&&(a=!0);return a&&this.$updateStyles(),r}})}var E={},D=null,L=setTimeout,j=function(e,t){return(e||"").toString(t)},R=function(e){var t=e?"string"==typeof e?document.querySelectorAll(e):e instanceof Element||e instanceof F?[e]:e instanceof NodeList||null!=e.length&&e[0]&&(e[0]instanceof Element||e[0]instanceof F)?e:[]:[],r=new U;return t.length>0&&(r.__document=t[0]),r};function I(e,t,r,n){e.addEventListener?e.addEventListener(t,r,n||!1):e.attachEvent("on"+t,r)}function B(e){H[e]=H[e+"E"]=function(t){return this.el(e,t)}}function M(e){H[e]=H[e+"A"]=function(t){return this.attr(e,t)}}R.css=h,R.bus=g,R.__currentArgCallback=[];var F=window.Node;F||((F=function(){}).prototype.ELEMENT_NODE=1,F.prototype.ATTRIBUTE_NODE=2,F.prototype.TEXT_NODE=3);var V="DOTHTML-DOCUMENT",q="DOTHTML-DEFER";function U(e,t){var r=this;r.__document=e,r.__if=null,r.__pendingCalls=[],r.__anonAttrFuncs={},r.__lastNode=e?e.lastChild:null,r.__classPrefix=t||0,r.__classedElements=[]}var H=U.prototype;function X(e){var t=null,r=e.__dothtml_component;if(r){var n=r.__prms.deleting;n&&n.apply(r),r.$el=null,t=r.__prms.deleted}e.parentNode&&e.parentNode.removeChild(e),t&&t.apply(r)}C=R,S=H,T=U,H.version="4.8.3",H._getNewDocument=function(){return document.createElement(V)},H._getAnInstance=function(){if(this.__document||this.__pendingCalls.length>0)return this;var e=new U(null,this.__classPrefix);return e.__if=this.__if,e},H._getLastChildOrNull=function(){return this.__document&&this.__document.lastChild?this.__document.lastChild:null},H.getLast=function(){return this._getLastChildOrNull()},H.toString=function(){return this.__document?this.__document.innerHTML:""},H._evalContent=function(e,t){if(null==e||null==e)return null;if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return(r=new U(this._getNewDocument(),this.__classPrefix)).__document.innerHTML=e,r.__document.childNodes;if(e instanceof F)return e;if("[object Array]"===Object.prototype.toString.call(e)){for(var r=new U(this._getNewDocument(),this.__classPrefix),n=0;n<e.length;n++)r._appendOrCreateDocument(e[n]);if(r.__document)return r.__document.childNodes}else{if(p(e))return this._evalContent(e(),t);if(e instanceof N)return this._evalContent(e.$el);if(e instanceof U){for(n=0;n<e.__pendingCalls.length;n++)t.push(e.__pendingCalls[n]);var a=this.__classPrefix;for(var n in e.__classedElements){var i=e.__classedElements[n];a?i.className="dot-"+j(a,16)+"-"+i.className:this.__classedElements.push(i)}if(e.__document)return e.__document.childNodes}}return null},H._appendOrCreateDocument=function(e,t,r){var n=this;if(t&&r&&isNaN(r)&&r.parentNode!=t)throw"beforeNode is not in parentEl.";t=t||(r&&isNaN(r)?r.parentNode:null)||n.__document||n._getNewDocument(),isNaN(r)||(r=t.childNodes[r]);var a=n.__document===t?n:new U(t,n.__classPrefix);a.__if=n.__if;var i,o=[],s=p(e);s&&R.__currentArgCallback.push(new w(t,e));try{i=a._evalContent(e,o)}finally{s&&R.__currentArgCallback.pop()}for(var l=0;l<o.length;l++){var u=o[l],c=(r?r.previousSibling||t:null)||t.lastChild||t;c&&"DOCUMENT"!=c.tagName?"attr"==u.type?p(u.params[0])?I(c,u.name,u.params[0],u.arg3):c.setAttribute(u.name,u.params[0]):"wait"==u.type&&u.callback():a.__pendingCalls.push(u)}if(null!=i)if(i instanceof NodeList)for(;i.length>0;)r?t.insertBefore(i[0],r):t.appendChild(i[0]);else r?t.insertBefore(i,r):t.appendChild(i);return a},H.el=function(e,t){var r=this,n=document.createElement(e),a=r.__document||r._getNewDocument();a.appendChild(n),t&&r._appendOrCreateDocument(t,n);var i=r.__document===a?r:new U(a,r.__classPrefix);if(t&&t instanceof U)for(var o in t.__classedElements)i.__classedElements.push(t.__classedElements[o]);return i},H.h=function(e){var t=this,r=t._getNewDocument();new U(r,t.__classPrefix)._appendOrCreateDocument(e);for(var n=t.__document||t._getNewDocument();r.childNodes.length>0;)n.appendChild(r.childNodes[0]);return t.__document===n?t:new U(n,t.__classPrefix)},H.t=function(e){var t=document.createTextNode(e),r=this.__document||this._getNewDocument();return r.appendChild(t),new U(r,this.__classPrefix)},H.attr=function(e,t,r){var n=this;if(p(t)&&(0!=e.indexOf("on")?(R.__anonAttrFuncs[J]=t,t="dot.__anonAttrFuncs["+J+++"](arguments[0]);"):e=e.substring(2)),!n.__document){var a=n._getAnInstance();return a.__pendingCalls.push({type:"attr",name:e,params:[t],arg3:r}),a}var i=n.__document.childNodes,o=i[i.length-1];if(o&&o.setAttribute)if(p(t))I(o,e,t,r);else{if("object"==typeof t&&!(t instanceof R.css._Builder)){var s=t,l=function(){var e="";return d(s,(function(t,r){(r=p(r)?r():r)&&(e+=" "+t)})),e.substring(1)};R.__currentArgCallback.push(new y(o,e,l)),t=l(),R.__currentArgCallback.pop()}var u=o.getAttribute(e);u?u+=" ":u="",o.setAttribute(e,u+(void 0===t?e:t))}return n},H._appendSetElement=function(e,t){var r=this;if(!e)return b("A",[e]),r;var n=document.getElementById(e);if(!n)return b("F",[e]),r;if(r.__document)for(t||(n.innerHTML="");r.__document.childNodes.length>0;)n.appendChild(r.__document.childNodes[0]);return r},H.iterate=function(e,t,r){var n=this,a=t,i=null;a instanceof U&&(i=a.__document.cloneNode(!0));for(var o=0;o<e;o++)p(t)&&(a=t(o,r)),i&&(a.__document=i.cloneNode(!0)),n=n._appendOrCreateDocument(a);return n},H.each=function(e,t,r){var n=this;if(p(e)){if(!r)return n.defer((function(r){r.each(e,t,!0)}));var a=e;R.__currentArgCallback.push(new k(n,t));try{e=a()}finally{R.__currentArgCallback.pop()}}if(e instanceof Array||e instanceof _)for(var i=0;i<e.length;i++)n=n._appendOrCreateDocument(t(e[i],i));else{var o=Object.keys(e);for(i=0;i<o.length;i++){var s=o[i];n=n._appendOrCreateDocument(t(e[s],s))}}return n},H.IF=H.if=function(e,t,r){var n=this._getAnInstance();if(p(e)){r||(r=n.__conditionalArray=[e]);var a=r.length-1;n=function(e,t,r,n){var a=document.createTextNode(""),i=document.createTextNode(""),o=new x(a,i,n,t);R.__currentArgCallback.push(o);var s=t();e=e._appendOrCreateDocument(a);for(var l=0;l<r.length;l++)r[l]();return o.lastValue=s,s&&(e=e._appendOrCreateDocument(n)),e=e._appendOrCreateDocument(i),R.__currentArgCallback.pop(),e}(n,(function(){for(var t=0;t<a;t++)if(r[t]())return!1;return!!e()}),r,t)}else e?(n=n._appendOrCreateDocument(p(t)?t():t)).__if=!0:n.__if=!1;return n},H.ELSEIF=H.elseif=function(e,t){if(p(e)){var r=this.__conditionalArray;return r||b("MC"),r.push(e),this.if(e,t,r)}return this.__if?this:this.if(e,t)},H.ELSE=H.else=function(e){var t=this.__conditionalArray;if(t){var r=function(){return!0};return t.push(r),this.if(r,e,t)}return this.__if?this:(this.__if=null,this._getAnInstance()._appendOrCreateDocument(e))},H.script=function(e){var t=this.getLast();return L((function(){e(t)}),0),this},H.wait=function(e,t){var r=this.el(q),n=r.__document.lastChild;return L((function(){r._appendOrCreateDocument(t,null,n),n.parentElement.removeChild(n)}),e),r},H.defer=function(e,t){p(e)||b("XF","defer");var r=this.el(q),n=r.__document.lastChild;return L((function(){e(R(n.parentElement)),n.parentElement.removeChild(n)}),t||0),r},H.empty=function(){if(this.__document){for(var e=[this.__document],t=!0,r=[];e.length>0;){var n=e.shift();if(n.childNodes.length>0)for(var a=0;a<n.childNodes.length;a++)e.push(n.childNodes[a]);!t&&r.push(n),t=!1}for(;r.length>0;)X(r.pop())}return this},H.remove=function(){this.empty(),X(this.__document)};var z=65536;H.resetScopeClass=function(){z=65536},H.scopeClass=function(e,t){1==arguments.length&&(t=e,e=null);var r=this;r.__classPrefix=e||z++;var n=r.h(t);return r.__classPrefix=0,n},H.bindTo=function(e,t){var r=this.getLast(),n=e[t],a=this.setVal(n);I(r,"change",(function(a){n=e[t]=R(r).getVal()}));try{Object.defineProperty(e,t,{enumerable:!0,get:function(){return n},set:function(e){n=e,R(r).setVal(e)}})}catch(e){}return a},R.component=function(e){for(var t=Object.keys(e),r=0;r<t.length;r++)try{t[r]}catch(e){throw t[r]+" is not a valid component field."}var n=e.builder;let a=e.name;if(a&&(C[a]||S[a]))b("CC",[a||"(un-named component)"]);else{a&&(E[a]=1);var i=function(){N.call(this),this.__rawProps={},this.__propDependencies={},this.__prms=e};(i.prototype=Object.create(N.prototype)).constructor=i,d(e.methods,(function(e,t){p(t)||b("XF"),i.prototype[e]=t})),d(e.events,(function(e,t){"string"!=typeof t&&b("XS");var r="on"+t[0].toUpperCase()+t.substring(1);i.prototype[r]=function(e){this.__addHandler(t,e)},i.prototype[t]=function(){var e=this.__handlers[t];if(e)for(var r=0;r<e.length;r++)e[r].apply(this,arguments)}})),d(e.props,(function(e,t){A("string"==typeof t?t:t.name,i)})),d(e.computed,(function(e,t){p(t)||b("XF"),i.prototype[e]=t,Object.defineProperty(i.prototype,e,{enumerable:!0,get:function(){return t.call(this)}})})),e.register&&e.register.apply(i.prototype);var o=void 0,s=e.style;if(s&&!p(s)){if(o=classPrefix++,s instanceof string);else{var l="";for(var u in s)l+=u+":"+str(s[u])+";";s=l}D?C(D).t("\r\n"+s):D=C("head").el("style",s)}i.prototype.$updateStyles=function(){this.$styleBuilder&&this.$styleBuilder()},n=function(){var t=new i;e.created&&e.created.apply(t,arguments);var r=e.builder.apply(t,arguments),n=(r=r instanceof T?r:C.h(r)).getLast();return(!n||n.parentNode.childNodes.length>1)&&b("C#",[a||"(un-named component)"]),(o||a)&&(r=(this instanceof T?this:C)._appendOrCreateDocument(C.scopeClass(o,r))),t.$el=t.$el||n,t.$el.__dothtml_component=t,p(s)&&(t.$styleBuilder=function(){C.css.scopeToEl(t.$el),s.apply(t,[C.css]),C.css.unscope()},t.$updateStyles()),e.built&&e.built.apply(t),e.ready&&O((function(){e.ready.apply(t)}),0),a?r:t},a&&(C[a]=S[a]=n)}return n},R.removeComponent=function(e){E[e]&&(delete E[e],delete C[e],delete S[e])};var W,$,Y=["a","aside","abbr","address","area","article","audio","b","bdi","bdo","blockquote","br","button","canvas","caption","cite","code","col","colgroup","content","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","i","iframe","img","input","ins","kbd","keygen","label","legend","li","main","map","mark","menu","menuitem","meter","nav","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rp","rt","ruby","s","samp","section","select","small","source","span","strong","svg","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","var","video","wbr"],G=["accept","accesskey","action","align","alink","alt","archive","autocomplete","autofocus","autoplay","autosave","axis","background","bgcolor","border","buffered","cellpadding","cellspacing","challenge","char","charoff","checked","cite","classid","clear","codebase","codetype","color","cols","colspan","compact","contenteditable","contextmenu","controls","coords","datetime","declare","default","dir","dirname","disabled","download","draggable","dropzone","enctype","face","font","fontface","fontfaceformat","fontfacename","fontfacesrc","fontfaceuri","fontspecification","for","foreignobject","form","formaction","frame","frameborder","headers","height","hidden","high","href","hreflang","hspace","icon","id","images","ismap","itemprop","keytype","kind","label","lang","list","longdesc","loop","low","manifest","marginheight","marginwidth","max","maxlength","media","metadata","method","min","missingglyph","multiple","muted","name","nohref","noresize","noshade","novalidate","nowrap","open","optimum","pattern","ping","placeholder","poster","preload","prompt","radiogroup","readonly","rel","required","rev","reversed","rows","rowspan","rules","sandbox","scope","scrolling","seamless","selected","shape","size","sizes","span","spellcheck","src","srcdoc","srclang","srcset","standby","start","step","summary","style","tabindex","target","title","type","usemap","valign","value","valuetype","width","wrap"],K=["Blur","Change","Click","Dblclick","Focus","Keydown","Keypress","Keyup","Load","Mousedown","Mouseenter","Mousemove","Mouseout","Mouseover","Mouseup","Reset","Scroll","Select","Submit","Unload"];for(W in Y)B(Y[W]);for(W in G)M(G[W]);for(W in K)M("on"+($=K[W])),M("on"+$.toLowerCase());H.acceptCharset=H["accept-charset"]=function(e){return this.attr("accept-charset",e)},H.dataA=R.dataA=function(e,t){return arguments.length<2?(t=e,e=void 0,this.attr("data",t)):this.attr("data-"+e,t)},H.data=R.data=function(){var e=this;return arguments.length>1||1==arguments.length&&"object"!=typeof arguments[0]&&e.__document&&e.__document.lastChild&&"OBJECT"==e.__document.lastChild.tagName?R.dataA.apply(e,arguments):R.dataE.apply(e,arguments)},H.cite=R.cite=function(e){var t=this;if(e&&"object"!=typeof e&&t.__document&&t.__document.lastChild){var r=t.__document.lastChild.tagName;if("BLOCKQUOTE"==r||"DEL"==r||"INS"==r||"Q"==r)return t.attr("cite",e)}return t.el("cite",e)},H.form=R.form=function(e){var t=this;if(e&&"object"!=typeof e&&t.__document&&t.__document.lastChild){var r=t.__document.lastChild.tagName;if("BUTTON"==r||"FIELDSET"==r||"INPUT"==r||"KEYGEN"==r||"LABEL"==r||"METER"==r||"OBJECT"==r||"OUTPUT"==r||"PROGRESS"==r||"SELECT"==r||"TEXTAREA"==r)return t.attr("form",e)}return t.el("form",e)},H.class=H.classA=function(e){var t=this.__classPrefix;if(t){var r="dot-"+j(t,16)+"-";if("string"==typeof e)e=r+e;else if("object"==typeof e){var n={};d(e,(function(e,t){n[r+e]=t})),e=n}}else{var a=this.getLast();a&&this.__classedElements.push(a)}return this.attr("class",e)},H.label=function(e){var t=this;return e&&"object"!=typeof e&&t.__document&&t.__document.lastChild&&"TRACK"==t.__document.lastChild.tagName?t.attr("label",e):t.el("label",e)},H.span=function(e){var t=this;if(e&&"object"!=typeof e&&t.__document&&t.__document.lastChild){var r=t.__document.lastChild.tagName;if("COL"==r||"COLGROUP"==r)return t.attr("span",e)}return t.el("span",e)},H.summary=function(e){var t=this;return e&&"object"!=typeof e&&t.__document&&t.__document.lastChild&&"TABLE"==t.__document.lastChild.tagName?t.attr("summary",e):t.el("summary",e)},H.setVal=function(e){var t=this.getLast()||this.__document;return t?(t.parentNode&&t.parentNode.tagName!=V&&(t=t.parentNode),Array.isArray&&Array.isArray(e)||!Array.isArray&&e.join?e=e.join(""):null==e&&(e=""),"checkbox"==t.type||"radio"==t.type?t.checked=!!e:"OPTION"==t.tagName?t.selected=!!e:t.value=e,this):this},H.getVal=function(){var e=this.__lastNode||this.__document;if(e&&1===e.nodeType)return"checkbox"==e.type||"radio"==e.type?!!e.checked:"OPTION"==e.tagName?!!e.selected:e.value},R.__document=null,R.__if=null,R.__pendingCalls=[],R.__anonAttrFuncs={};var J=0,Z=!1,Q={},ee=1,te=!1;function re(){!Z&&(Z=!0)&&(window.onpopstate=function(e){e.state&&(R.navigate(e.state.path,!0),document.title=e.state.pageTitle)})}for(var ne in R.component({name:"router",builder:function(e){var t=this;if(t.navId=0,t.currentRoute=null,t.currentParams=null,t.params=e,!e||!e.routes)return b("R"),R;for(var r=0;r<t.params.routes.length;r++){var n=t.params.routes[r];if(null===n.path||void 0===n.path)return b("R"),R;n.segments=n.path.split("/")}void 0===e.autoNavigate&&(e.autoNavigate=!0);var a=R.el("dothtml-router");return t.outlet=a.getLast(),t.id=ee++,Q[t.id]=t,t.outlet.dothtmlRouterId=t.id,a},ready:function(){if(re(),this.params.autoNavigate){te=!0;var e=this.navigate(window.location.pathname+(window.location.hash||""),!0);te=!1}history.pushState?history.replaceState({pageTitle:e.title||document.title,path:e.path},e||document.title,e.path):window.location.hash=e.path},methods:{navigate:function(e,t,r){var n=this;"string"!=typeof(e=e||"")&&(e+="");var a=e;-1!=e.indexOf("#")&&(a=e.split("#")[1]);var i=e.split("#"),o=[],s=i[0].split("?")[0].split("/");""===s[0]&&s.shift(),o.push(s);var l=i.length>1?i[1].split("/"):null;l&&""===l[0]&&l.shift(),l&&(s.length>1?o.push(l):o.unshift(l));var u=!1;navParams={cancel:function(){u=!0,navParams.wasCancelled=!0},element:n.element,httpResponse:null,isNew:!0,params:{},path:e,title:null};var c=null;for(var h in o){var d=o[h],p=!1;for(var f in n.params.routes){p=!0;for(var m=n.params.routes[f],g={},b=0,_=0,v=null;;){var y=m.segments[b]||null,w=d[_]||null;if(null===y&&null===w)break;if(null===y&&null!==w||null!==y&&null===w){p=!1;break}if(null===y&&"*"==v&&(y="*"),y==w||"+"==y||"*"==y)b++;else if(y.length>2&&"{"==y.charAt(0)&&"}"==y.charAt(y.length-1))b++,g[y.substring(1,y.length-1)]=w;else if("*"!=v){p=!1;break}_++,v=y}if(p){c=m,navParams.params=g;break}}if(p){if(d==s){if(!history.pushState&&te)return window.location.hash=e,void(window.location.pathname="/");break}if(d==l){e=a,navParams.path=e,history.pushState&&(window.location.hash="",history.replaceState({pageTitle:document.title,path:e},document.title,e));break}}}if(navParams.isNew=!!(r||n.currentRoute!=c||n.currentParams&&n.currentParams!=navParams.params&&JSON.stringify(n.currentParams)!==JSON.stringify(navParams.params)),n.params.onNavigateInit&&n.params.onNavigateInit(navParams),!navParams.isNew||u)return navParams;n.currentRoute=c,n.currentParams=navParams.params;var k=n.outlet;R(k).empty();var x,N,C,S,T=++n.navId;return 0==s.length||null==c||(navParams.title=c.title,"string"==typeof c.component?(x=c.component,N=function(e){var t=e.responseText;if(navParams.httpResponse=e,T!=n.navId)return navParams;if(n.params.onResponse&&n.params.onResponse(navParams),u&&returnnavParams,c.component.split("?")[0].split("#")[0].toLowerCase().indexOf(".js")==c.component.length-3)try{t=Function("var exports=null,module={},route=arguments[0];"+t+"\r\nreturn module.exports || exports;")(navParams)}catch(e){console.error(e)}R(k).h(t),n.params.onComplete&&n.params.onComplete(navParams)},C=function(e){navParams.httpResponse=e,n.params.onError&&n.params.onError(navParams)},(S=new XMLHttpRequest).onreadystatechange=function(){4==this.readyState&&(200==this.status?N&&N(this):C&&C(this))},S.open("GET",x,!0),S.send()):(R(k).h(c.component.call(R,navParams)),n.params.onComplete&&n.params.onComplete(navParams))),navParams}},deleting:function(){Q[this.id]}}),R.navigate=function(e,t,r){re();for(var n=Object.keys(Q),a={},i=document.title,o=0;o<n.length;o++){var s=n[o],l=Q[s];if(l){var u=l.navigate(e,t,r);u.isNew&&!u.wasCancelled&&(i=(a=u).title||i)}}try{a&&!t&&(history.pushState?history.pushState({pageTitle:i,path:a.path},i,a.path):window.location.hash=a.path)}catch(e){}return this},R.component({name:"navLink",builder:function(e,t){return R.a(e).href(t).onclick((function(e){e.preventDefault(),R.navigate(t)}))}}),H)void 0===R[ne]&&(R[ne]=H[ne]);const ae=R;module.exports=t})();
|
package/src/component.js
DELETED
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
import { eachK, isF } from "./util";
|
|
2
|
-
import ERR from "./err";
|
|
3
|
-
import ObservableArray from "./observable-array";
|
|
4
|
-
import { AttrArgCallback } from "./arg-callback-obj";
|
|
5
|
-
|
|
6
|
-
/** How it works:
|
|
7
|
-
*
|
|
8
|
-
* _C represents the prototype for all components.
|
|
9
|
-
* You create a component with dot.component().
|
|
10
|
-
* This creates a new class (CC), which acts as the prototype to that component.
|
|
11
|
-
* The prototype of CC is set to a new _C.
|
|
12
|
-
* Instantiating the component creates a new CC.
|
|
13
|
-
* This CC is the `this` for each method of the component.
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* */
|
|
17
|
-
|
|
18
|
-
/** How computed props work.
|
|
19
|
-
*
|
|
20
|
-
* If a computed property has a dependency on a regular property,
|
|
21
|
-
* assigning the computed property to an element will cause the regular property's getter to trigger, establishing the dependency.
|
|
22
|
-
* */
|
|
23
|
-
|
|
24
|
-
export function _C(){
|
|
25
|
-
this.$el = null;
|
|
26
|
-
this.$refs = {};
|
|
27
|
-
this.__handlers = {};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
_C.prototype.__addHandler = function(eventName, event){
|
|
31
|
-
var h = this.__handlers[eventName];
|
|
32
|
-
if(!h) h = this.__handlers[eventName] = [];
|
|
33
|
-
h.push(event);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
var dot, _p, _D;
|
|
37
|
-
|
|
38
|
-
var sT = setTimeout;
|
|
39
|
-
|
|
40
|
-
export function dotReady(d, p, _d){
|
|
41
|
-
dot = d;
|
|
42
|
-
_p = p;
|
|
43
|
-
_D = _d;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
function configureDependency(ret, name){
|
|
47
|
-
// TODO: verify that there is no memory leak!!
|
|
48
|
-
var cb = dot.__currentArgCallback[dot.__currentArgCallback.length-1];
|
|
49
|
-
if(cb){
|
|
50
|
-
// This means this getter is being used during the invocation of an arg callback.
|
|
51
|
-
// Add it to a collection so that when the value is set, the appropriate component will update.
|
|
52
|
-
|
|
53
|
-
if(ret instanceof ObservableArray){
|
|
54
|
-
var d = cb.dotTarget;
|
|
55
|
-
ret.addEventListener("itemadded", function(e) {
|
|
56
|
-
d._appendOrCreateDocument(cb.f(e.item, e.index), undefined, e.index);
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
ret.addEventListener("itemset", function(e) {
|
|
60
|
-
var p = d.__document;
|
|
61
|
-
var el = p.childNodes[e.index];
|
|
62
|
-
p.removeChild(el);
|
|
63
|
-
d._appendOrCreateDocument(cb.f(e.item, e.index), undefined, e.index);
|
|
64
|
-
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
ret.addEventListener("itemremoved", function(e) {
|
|
68
|
-
d.__document.removeChild(d.__document.childNodes[e.index]);
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
else{
|
|
72
|
-
var ar = this.__propDependencies[name];
|
|
73
|
-
if(!ar) ar = this.__propDependencies[name] = [];
|
|
74
|
-
ar.push(cb);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function createProp(name, CC){
|
|
80
|
-
var dependencies = [];
|
|
81
|
-
Object.defineProperty(CC.prototype, name, {
|
|
82
|
-
configurable: false,
|
|
83
|
-
enumerable: false,
|
|
84
|
-
get: function() {
|
|
85
|
-
var ret = this.__rawProps[name];
|
|
86
|
-
configureDependency.call(this, ret, name);
|
|
87
|
-
return ret;
|
|
88
|
-
},
|
|
89
|
-
set: function(value) {
|
|
90
|
-
// TODO: if this value is set, get the list of dependencies, and update them by calling their dot argument callbacks.
|
|
91
|
-
var propVal = value;
|
|
92
|
-
if(value instanceof Array){
|
|
93
|
-
propVal = new ObservableArray(value);
|
|
94
|
-
}
|
|
95
|
-
this.__rawProps[name] = propVal;
|
|
96
|
-
|
|
97
|
-
var ar = this.__propDependencies[name];
|
|
98
|
-
|
|
99
|
-
// // {f:contentCallback,startNode:startNode, endNode:endNode,condition:condition}
|
|
100
|
-
var updateStyles = false;
|
|
101
|
-
for(let i = 0; i < (ar||[]).length; i++){
|
|
102
|
-
ar[i].updateContent(dot, propVal);
|
|
103
|
-
|
|
104
|
-
if(ar[i] instanceof AttrArgCallback && ar[i].attr == "class"){
|
|
105
|
-
updateStyles = true;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if(updateStyles) this.$updateStyles();
|
|
110
|
-
|
|
111
|
-
return propVal;
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// TODO: ideally we'd like to remove this, and create scoped namespaces for all components.
|
|
117
|
-
// One option would be to have a global namespace where each item is only accessible by parent components who have registered to use it.
|
|
118
|
-
// Another option is to inject a custom reference to dot that inherits from the actual dot but also has sub-components in it.
|
|
119
|
-
var componentNames = {};
|
|
120
|
-
var componentStyleElement = null;
|
|
121
|
-
/**
|
|
122
|
-
* @param {object} prms - Params for the component builder.
|
|
123
|
-
* @param {string} prms.name - Name of the component (optional). If provided, dot and the vdbo will be extended.
|
|
124
|
-
* @param {Function} prms.registered - An optional function that gets called once per component after registering in the dot namespace, with the component class passed in as a parameter.
|
|
125
|
-
* @param {Function} prms.created - An optional function that gets called before the component is created, scoped to the new component object.
|
|
126
|
-
* @param {Function} prms.builder - A function returning DOThtml (required).
|
|
127
|
-
* @param {Array<string>} prms.events - An array of names that can be called as functions. The component will be extended by these names.
|
|
128
|
-
* @param {Array<Function>} prms.methods - An array of functions that can be called within the component.
|
|
129
|
-
* @param {Function} prms.style - An optional function that is called after builder that stylizes .
|
|
130
|
-
* @param {Function} prms.props - An optional function that is called after builder that stylizes .
|
|
131
|
-
* @param {Function} prms.computed - An optional function that is called after builder that stylizes .
|
|
132
|
-
* @param {Function} prms.ready - An optional function called after the element has been added. One parameter will be provided containing the added element.
|
|
133
|
-
* @param {Function} prms.deleting - An optional function called before the component is deleted.
|
|
134
|
-
* @param {Function} prms.deleted - An optional function called after the component is deleted.
|
|
135
|
-
*/
|
|
136
|
-
export function addComponent(prms){
|
|
137
|
-
|
|
138
|
-
// TODO: generalize this (for routes).
|
|
139
|
-
;;; var prmsKeys = Object.keys(prms);
|
|
140
|
-
;;; for(var i = 0; i < prmsKeys.length; i++) try{["name", "register", "created", "methods", "events", "props", "computed", "builder", "ready", "deleting", "deleted"][prmsKeys[i]];}catch(e){throw prmsKeys[i] + " is not a valid component field."}
|
|
141
|
-
|
|
142
|
-
// Setting this potentially allows automatic code completion to get the method signature from builder.
|
|
143
|
-
var comp = prms.builder;
|
|
144
|
-
|
|
145
|
-
let n = prms.name;
|
|
146
|
-
if(!n || (!dot[n] && !_p[n])) {
|
|
147
|
-
n && (componentNames[n] = 1);
|
|
148
|
-
var CC = function(){
|
|
149
|
-
_C.call(this);
|
|
150
|
-
this.__rawProps = {};
|
|
151
|
-
this.__propDependencies = {};
|
|
152
|
-
this.__prms = prms;
|
|
153
|
-
}
|
|
154
|
-
CC.prototype = Object.create(_C.prototype);
|
|
155
|
-
CC.prototype.constructor = CC;
|
|
156
|
-
|
|
157
|
-
eachK(prms.methods, function(k, v){
|
|
158
|
-
if(!isF(v)) ERR("XF");
|
|
159
|
-
CC.prototype[k] = v;
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
eachK(prms.events, function(k, v){
|
|
163
|
-
if(typeof v != "string") ERR("XS");
|
|
164
|
-
var handlerName = "on" + v[0].toUpperCase() + v.substring(1);
|
|
165
|
-
CC.prototype[handlerName] = function(cb){
|
|
166
|
-
this.__addHandler(v, cb);
|
|
167
|
-
}
|
|
168
|
-
CC.prototype[v] = function(){
|
|
169
|
-
var h = this.__handlers[v];
|
|
170
|
-
if(h){
|
|
171
|
-
for(var i = 0; i < h.length; i++){
|
|
172
|
-
h[i].apply(this, arguments);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
eachK(prms.props, function(k,v){
|
|
179
|
-
createProp(typeof v == "string" ? v : v.name, CC);
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
eachK(prms.computed, function(k, v){
|
|
183
|
-
isF(v) ? v : ERR("XF")
|
|
184
|
-
//createProp(k, CC);
|
|
185
|
-
CC.prototype[k] = v;
|
|
186
|
-
Object.defineProperty(CC.prototype, k, {
|
|
187
|
-
enumerable: true,
|
|
188
|
-
get: function(){
|
|
189
|
-
//configureDependency(v(), this, k);
|
|
190
|
-
return v.call(this);
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
prms.register && prms.register.apply(CC.prototype);
|
|
196
|
-
|
|
197
|
-
// Scoped classes and styles.
|
|
198
|
-
var classNumb = undefined;
|
|
199
|
-
var st = prms.style;
|
|
200
|
-
if(st && !isF(st)){
|
|
201
|
-
// This is the less-preferred method of using component styles.
|
|
202
|
-
// Might remove it.
|
|
203
|
-
|
|
204
|
-
classNumb = classPrefix++;
|
|
205
|
-
|
|
206
|
-
if(st instanceof string){
|
|
207
|
-
// TODO: need to parse?
|
|
208
|
-
// var cssParts = st.split("{");
|
|
209
|
-
// for(var i = 0; i < cssParts.length; i+=2){
|
|
210
|
-
|
|
211
|
-
// }
|
|
212
|
-
// st.split(".").join(".dot-" + str(classNumb,16) + "-");
|
|
213
|
-
}
|
|
214
|
-
else{
|
|
215
|
-
// Assume json object.
|
|
216
|
-
var result = "";
|
|
217
|
-
for(var k in st){
|
|
218
|
-
result += k + ":" + str(st[k]) + ";"
|
|
219
|
-
}
|
|
220
|
-
st = result;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
if(!componentStyleElement)
|
|
224
|
-
componentStyleElement = dot("head").el("style", st);
|
|
225
|
-
else
|
|
226
|
-
dot(componentStyleElement).t("\r\n" + st);
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
CC.prototype.$updateStyles = function(){
|
|
231
|
-
this.$styleBuilder && this.$styleBuilder();
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
// Adding the component to dot.
|
|
235
|
-
comp = function(){
|
|
236
|
-
var obj = new CC();
|
|
237
|
-
prms.created && prms.created.apply(obj, arguments);
|
|
238
|
-
|
|
239
|
-
// eachK(prms.computed, function(k, v){
|
|
240
|
-
// dot.__currentArgCallback.push({f:v})
|
|
241
|
-
// //obj[k] = function(){return v.call(obj)};
|
|
242
|
-
// //obj[k] = v.call(obj);
|
|
243
|
-
// v.call(obj);
|
|
244
|
-
// dot.__currentArgCallback.pop()
|
|
245
|
-
// });
|
|
246
|
-
|
|
247
|
-
var ret = prms.builder.apply(obj, arguments); // TODO: eventually want to only pass in the slot and leave all other stuff up to params.
|
|
248
|
-
|
|
249
|
-
// Add the events to ret.
|
|
250
|
-
|
|
251
|
-
// // TODO: this is kind of bad, because it duplicates the function for each instance rather than using prototypes.
|
|
252
|
-
// eachK(prms.events, function(k, v){
|
|
253
|
-
// if(typeof v != "string") ERR("XS");
|
|
254
|
-
// ret[v] = function(){obj[v].apply(obj, arguments); return ret;}
|
|
255
|
-
// });
|
|
256
|
-
|
|
257
|
-
ret = ret instanceof _D ? ret : dot.h(ret);
|
|
258
|
-
// ret = (this instanceof _D ? this : dot).h(ret);
|
|
259
|
-
|
|
260
|
-
var lst = ret.getLast();
|
|
261
|
-
(!lst || (lst.parentNode.childNodes.length > 1)) && ERR("C#", [n || "(un-named component)"]);
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
// Some weird ass logic to support legacy named components and the new syntax.
|
|
265
|
-
if(classNumb || n) ret = (this instanceof _D ? this : dot)._appendOrCreateDocument(dot.scopeClass(classNumb, ret));
|
|
266
|
-
obj.$el = obj.$el || lst;
|
|
267
|
-
obj.$el.__dothtml_component = obj;
|
|
268
|
-
|
|
269
|
-
if(isF(st)) {
|
|
270
|
-
// This will be the officially supported way to use dothtml.
|
|
271
|
-
obj.$styleBuilder = function(){
|
|
272
|
-
dot.css.scopeToEl(obj.$el)
|
|
273
|
-
st.apply(obj, [dot.css]);
|
|
274
|
-
dot.css.unscope();
|
|
275
|
-
}
|
|
276
|
-
obj.$updateStyles();
|
|
277
|
-
//styler();
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
prms.built && prms.built.apply(obj);
|
|
281
|
-
|
|
282
|
-
prms.ready && sT(function(){
|
|
283
|
-
prms.ready.apply(obj)
|
|
284
|
-
}, 0);
|
|
285
|
-
if (n) return ret; // Named components - used with inline syntax (legacy).
|
|
286
|
-
else return obj; // Unnamed components - used with modern component syntax.
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
n && (dot[n] = _p[n] = comp);
|
|
290
|
-
}
|
|
291
|
-
else ERR("CC", [n || "(un-named component)"]);
|
|
292
|
-
|
|
293
|
-
//_p[prms.name].prototype
|
|
294
|
-
|
|
295
|
-
//return function(){return comp.apply(dot, arguments)};
|
|
296
|
-
return comp;
|
|
297
|
-
};
|
|
298
|
-
|
|
299
|
-
export function removeComponent(name){
|
|
300
|
-
if(componentNames[name]){
|
|
301
|
-
delete componentNames[name];
|
|
302
|
-
delete dot[name];
|
|
303
|
-
delete _p[name];
|
|
304
|
-
}
|
|
305
|
-
}
|
package/src/err.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
var ERR = function(c){throw "DOThtml usage error code " + c + ". Use an unminified version for more information."};
|
|
2
|
-
;;;ERR = function(c, p){
|
|
3
|
-
p = p || [];
|
|
4
|
-
throw {
|
|
5
|
-
"A": "Can't append \"" + p[0] + "\".",
|
|
6
|
-
"CC": "The name \"" + p[0] + "\" conflicts with an existing DOThtml function.",
|
|
7
|
-
"CU": "Invalid usage: a component should at least have a name and a builder function.",
|
|
8
|
-
"C#": "Component '" + p[0] + "' must return exactly one child node.",
|
|
9
|
-
"F": "Element \"" + p[0] + "\" not found.",
|
|
10
|
-
"MC": "Can't mix static conditions with dynamic conditional rendering.",
|
|
11
|
-
"R": "Router must be passed a JSON object that contains an 'routes' array containing objects with a 'path', 'title', and 'component'.",
|
|
12
|
-
"S": "SVG is not supported by DOThtml.",
|
|
13
|
-
"XS": "Expected a string.",
|
|
14
|
-
"XF": "Expected a function.",
|
|
15
|
-
//"SF": "The style property of a component must be a string, a function that returns a string, or a JSON collection of those things."
|
|
16
|
-
}[c] || "Unknown error.";
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export default ERR;
|
package/src/event-bus.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { eachK, isF } from "./util";
|
|
2
|
-
|
|
3
|
-
function EventBus(){
|
|
4
|
-
this._callbacks = {};
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const _e = EventBus.prototype;
|
|
9
|
-
|
|
10
|
-
_e._checkAddEvent = function(event){
|
|
11
|
-
var e = this._callbacks[event];
|
|
12
|
-
if(!e) this._callbacks[event] = e = [];
|
|
13
|
-
return e;
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
_e.on = function(event, callback){
|
|
18
|
-
var e = this._checkAddEvent(event);
|
|
19
|
-
e.push(callback);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
_e.off = function(event, callback){
|
|
23
|
-
var e = this._checkAddEvent(event);
|
|
24
|
-
for(var i = e.length -1; e >=0; i--){
|
|
25
|
-
if(e[i] == callback) e.splice(i, 1);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
_e.emit = function(event, arg){
|
|
30
|
-
var e = this._checkAddEvent(event);
|
|
31
|
-
eachK(e, function(k, v){
|
|
32
|
-
v(arg);
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
_e.flush = function(event){
|
|
37
|
-
this._checkAddEvent(event).length = 0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export default new EventBus();
|