shark-mvc
Version:
Shark-MVC is a small MVC framework born to make our small JS apps easier to build.
22 lines (20 loc) • 102 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("jquery"),require("mustache"),require("moment"),require("html2hscript")):"function"==typeof define&&define.amd?define("shark-mvc",["jquery","mustache","moment","html2hscript"],t):"object"==typeof exports?exports["shark-mvc"]=t(require("jquery"),require("mustache"),require("moment"),require("html2hscript")):e.SharkMVC=t(e.$,e.Mustache,e.Moment,e.html2hscript)}(window,(function(e,t,r,n){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=41)}([function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t){e.exports=function(e){return e&&"Widget"===e.type}},function(e,t){e.exports=r},function(e,t){e.exports="2"},function(e,t,r){var n=r(4);e.exports=function(e){return e&&"VirtualNode"===e.type&&e.version===n}},function(e,t){e.exports=function(e){return e&&"Thunk"===e.type}},function(e,t){e.exports=function(e){return e&&("function"==typeof e.hook&&!e.hasOwnProperty("hook")||"function"==typeof e.unhook&&!e.hasOwnProperty("unhook"))}},function(e,t,r){var n=r(4);e.exports=function(e){return e&&"VirtualText"===e.type&&e.version===n}},function(e,t,r){"use strict";r.r(t),r.d(t,"render",(function(){return I})),r.d(t,"hydrate",(function(){return H})),r.d(t,"createElement",(function(){return h})),r.d(t,"h",(function(){return h})),r.d(t,"Fragment",(function(){return g})),r.d(t,"createRef",(function(){return m})),r.d(t,"isValidElement",(function(){return o})),r.d(t,"Component",(function(){return y})),r.d(t,"cloneElement",(function(){return j})),r.d(t,"createContext",(function(){return F})),r.d(t,"toChildArray",(function(){return P})),r.d(t,"options",(function(){return n}));var n,o,a,i,s,l,c={},d=[],u=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function p(e,t){for(var r in t)e[r]=t[r];return e}function _(e){var t=e.parentNode;t&&t.removeChild(e)}function h(e,t,r){var n,o,a,i=arguments,s={};for(a in t)"key"==a?n=t[a]:"ref"==a?o=t[a]:s[a]=t[a];if(arguments.length>3)for(r=[r],a=3;a<arguments.length;a++)r.push(i[a]);if(null!=r&&(s.children=r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return f(e,s,n,o,null)}function f(e,t,r,o,a){var i={type:e,props:t,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==a?++n.__v:a};return null!=n.vnode&&n.vnode(i),i}function m(){return{current:null}}function g(e){return e.children}function y(e,t){this.props=e,this.context=t}function v(e,t){if(null==t)return e.__?v(e.__,e.__.__k.indexOf(e)+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?v(e):null}function b(e){var t,r;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return b(e)}}function w(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!O.__r++||s!==n.debounceRendering)&&((s=n.debounceRendering)||i)(O)}function O(){for(var e;O.__r=a.length;)e=a.sort((function(e,t){return e.__v.__b-t.__v.__b})),a=[],e.some((function(e){var t,r,n,o,a,i;e.__d&&(a=(o=(t=e).__v).__e,(i=t.__P)&&(r=[],(n=p({},o)).__v=o.__v+1,A(i,o,n,t.__n,void 0!==i.ownerSVGElement,null!=o.__h?[a]:null,r,null==a?v(o):a,o.__h),k(r,o),o.__e!=a&&b(o)))}))}function x(e,t,r,n,o,a,i,s,l,u){var p,_,h,m,y,b,w,O=n&&n.__k||d,x=O.length;for(r.__k=[],p=0;p<t.length;p++)if(null!=(m=r.__k[p]=null==(m=t[p])||"boolean"==typeof m?null:"string"==typeof m||"number"==typeof m||"bigint"==typeof m?f(null,m,null,null,m):Array.isArray(m)?f(g,{children:m},null,null,null):m.__b>0?f(m.type,m.props,m.key,null,m.__v):m)){if(m.__=r,m.__b=r.__b+1,null===(h=O[p])||h&&m.key==h.key&&m.type===h.type)O[p]=void 0;else for(_=0;_<x;_++){if((h=O[_])&&m.key==h.key&&m.type===h.type){O[_]=void 0;break}h=null}A(e,m,h=h||c,o,a,i,s,l,u),y=m.__e,(_=m.ref)&&h.ref!=_&&(w||(w=[]),h.ref&&w.push(h.ref,null,m),w.push(_,m.__c||y,m)),null!=y?(null==b&&(b=y),"function"==typeof m.type&&null!=m.__k&&m.__k===h.__k?m.__d=l=R(m,l,e):l=E(e,m,h,O,y,l),u||"option"!==r.type?"function"==typeof r.type&&(r.__d=l):e.value=""):l&&h.__e==l&&l.parentNode!=e&&(l=v(h))}for(r.__e=b,p=x;p--;)null!=O[p]&&("function"==typeof r.type&&null!=O[p].__e&&O[p].__e==r.__d&&(r.__d=v(n,p+1)),D(O[p],O[p]));if(w)for(p=0;p<w.length;p++)L(w[p],w[++p],w[++p])}function R(e,t,r){var n,o;for(n=0;n<e.__k.length;n++)(o=e.__k[n])&&(o.__=e,t="function"==typeof o.type?R(o,t,r):E(r,o,o,e.__k,o.__e,t));return t}function P(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){P(e,t)})):t.push(e)),t}function E(e,t,r,n,o,a){var i,s,l;if(void 0!==t.__d)i=t.__d,t.__d=void 0;else if(null==r||o!=a||null==o.parentNode)e:if(null==a||a.parentNode!==e)e.appendChild(o),i=null;else{for(s=a,l=0;(s=s.nextSibling)&&l<n.length;l+=2)if(s==o)break e;e.insertBefore(o,a),i=a}return void 0!==i?i:o.nextSibling}function C(e,t,r){"-"===t[0]?e.setProperty(t,r):e[t]=null==r?"":"number"!=typeof r||u.test(t)?r:r+"px"}function T(e,t,r,n,o){var a;e:if("style"===t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||C(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||C(e.style,t,r[t])}else if("o"===t[0]&&"n"===t[1])a=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=r,r?n||e.addEventListener(t,a?N:S,a):e.removeEventListener(t,a?N:S,a);else if("dangerouslySetInnerHTML"!==t){if(o)t=t.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null!=r&&(!1!==r||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,r):e.removeAttribute(t))}}function S(e){this.l[e.type+!1](n.event?n.event(e):e)}function N(e){this.l[e.type+!0](n.event?n.event(e):e)}function A(e,t,r,o,a,i,s,l,c){var d,u,_,h,f,m,v,b,w,O,R,P=t.type;if(void 0!==t.constructor)return null;null!=r.__h&&(c=r.__h,l=t.__e=r.__e,t.__h=null,i=[l]),(d=n.__b)&&d(t);try{e:if("function"==typeof P){if(b=t.props,w=(d=P.contextType)&&o[d.__c],O=d?w?w.props.value:d.__:o,r.__c?v=(u=t.__c=r.__c).__=u.__E:("prototype"in P&&P.prototype.render?t.__c=u=new P(b,O):(t.__c=u=new y(b,O),u.constructor=P,u.render=V),w&&w.sub(u),u.props=b,u.state||(u.state={}),u.context=O,u.__n=o,_=u.__d=!0,u.__h=[]),null==u.__s&&(u.__s=u.state),null!=P.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=p({},u.__s)),p(u.__s,P.getDerivedStateFromProps(b,u.__s))),h=u.props,f=u.state,_)null==P.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==P.getDerivedStateFromProps&&b!==h&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(b,O),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(b,u.__s,O)||t.__v===r.__v){u.props=b,u.state=u.__s,t.__v!==r.__v&&(u.__d=!1),u.__v=t,t.__e=r.__e,t.__k=r.__k,t.__k.forEach((function(e){e&&(e.__=t)})),u.__h.length&&s.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(b,u.__s,O),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(h,f,m)}))}u.context=O,u.props=b,u.state=u.__s,(d=n.__r)&&d(t),u.__d=!1,u.__v=t,u.__P=e,d=u.render(u.props,u.state,u.context),u.state=u.__s,null!=u.getChildContext&&(o=p(p({},o),u.getChildContext())),_||null==u.getSnapshotBeforeUpdate||(m=u.getSnapshotBeforeUpdate(h,f)),R=null!=d&&d.type===g&&null==d.key?d.props.children:d,x(e,Array.isArray(R)?R:[R],t,r,o,a,i,s,l,c),u.base=t.__e,t.__h=null,u.__h.length&&s.push(u),v&&(u.__E=u.__=null),u.__e=!1}else null==i&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=M(r.__e,t,r,o,a,i,s,c);(d=n.diffed)&&d(t)}catch(e){t.__v=null,(c||null!=i)&&(t.__e=l,t.__h=!!c,i[i.indexOf(l)]=null),n.__e(e,t,r)}}function k(e,t){n.__c&&n.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){n.__e(e,t.__v)}}))}function M(e,t,r,n,o,a,i,s){var l,u,p,h,f=r.props,m=t.props,g=t.type,y=0;if("svg"===g&&(o=!0),null!=a)for(;y<a.length;y++)if((l=a[y])&&(l===e||(g?l.localName==g:3==l.nodeType))){e=l,a[y]=null;break}if(null==e){if(null===g)return document.createTextNode(m);e=o?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,m.is&&m),a=null,s=!1}if(null===g)f===m||s&&e.data===m||(e.data=m);else{if(a=a&&d.slice.call(e.childNodes),u=(f=r.props||c).dangerouslySetInnerHTML,p=m.dangerouslySetInnerHTML,!s){if(null!=a)for(f={},h=0;h<e.attributes.length;h++)f[e.attributes[h].name]=e.attributes[h].value;(p||u)&&(p&&(u&&p.__html==u.__html||p.__html===e.innerHTML)||(e.innerHTML=p&&p.__html||""))}if(function(e,t,r,n,o){var a;for(a in r)"children"===a||"key"===a||a in t||T(e,a,null,r[a],n);for(a in t)o&&"function"!=typeof t[a]||"children"===a||"key"===a||"value"===a||"checked"===a||r[a]===t[a]||T(e,a,t[a],r[a],n)}(e,m,f,o,s),p)t.__k=[];else if(y=t.props.children,x(e,Array.isArray(y)?y:[y],t,r,n,o&&"foreignObject"!==g,a,i,e.firstChild,s),null!=a)for(y=a.length;y--;)null!=a[y]&&_(a[y]);s||("value"in m&&void 0!==(y=m.value)&&(y!==e.value||"progress"===g&&!y)&&T(e,"value",y,f.value,!1),"checked"in m&&void 0!==(y=m.checked)&&y!==e.checked&&T(e,"checked",y,f.checked,!1))}return e}function L(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){n.__e(e,r)}}function D(e,t,r){var o,a,i;if(n.unmount&&n.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||L(o,null,t)),r||"function"==typeof e.type||(r=null!=(a=e.__e)),e.__e=e.__d=void 0,null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){n.__e(e,t)}o.base=o.__P=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&D(o[i],t,r);null!=a&&_(a)}function V(e,t,r){return this.constructor(e,r)}function I(e,t,r){var o,a,i;n.__&&n.__(e,t),a=(o="function"==typeof r)?null:r&&r.__k||t.__k,i=[],A(t,e=(!o&&r||t).__k=h(g,null,[e]),a||c,c,void 0!==t.ownerSVGElement,!o&&r?[r]:a?null:t.firstChild?d.slice.call(t.childNodes):null,i,!o&&r?r:a?a.__e:t.firstChild,o),k(i,e)}function H(e,t){I(e,t,H)}function j(e,t,r){var n,o,a,i=arguments,s=p({},e.props);for(a in t)"key"==a?n=t[a]:"ref"==a?o=t[a]:s[a]=t[a];if(arguments.length>3)for(r=[r],a=3;a<arguments.length;a++)r.push(i[a]);return null!=r&&(s.children=r),f(e.type,s,n||e.key,o||e.ref,null)}function F(e,t){var r={__c:t="__cC"+l++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var r,n;return this.getChildContext||(r=[],(n={})[t]=this,this.getChildContext=function(){return n},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&r.some(w)},this.sub=function(e){r.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r.splice(r.indexOf(e),1),t&&t.call(e)}}),e.children}};return r.Provider.__=r.Consumer.contextType=r}n={__e:function(e,t){for(var r,n,o;t=t.__;)if((r=t.__c)&&!r.__)try{if((n=r.constructor)&&null!=n.getDerivedStateFromError&&(r.setState(n.getDerivedStateFromError(e)),o=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e),o=r.__d),o)return r.__E=r}catch(t){e=t}throw e},__v:0},o=function(e){return null!=e&&void 0===e.constructor},y.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=p({},this.state),"function"==typeof e&&(e=e(p({},r),this.props)),e&&p(r,e),null!=e&&this.__v&&(t&&this.__h.push(t),w(this))},y.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),w(this))},y.prototype.render=g,a=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,O.__r=0,l=0},function(e,t){var r=Array.isArray,n=Object.prototype.toString;e.exports=r||function(e){return"[object Array]"===n.call(e)}},function(e,t,r){!function(e,t){"use strict";var r,n={parseFragment:function(e){return(new DOMParser).parseFromString(e,"text/html").body},serialize:function(e){return e.innerHTML}},o=function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */!function(e){e.Text="#text",e.Comment="#comment"}(r||(r={}));var a=function(e){return e=e.replace(/\n|\t|\r|\0/g,"")},i=function(e,t){var r={key:t.toString()};if(!e)return r;for(var n=0;n<e.length;n++)r[e[n].name]="style"===e[n].name?e[n].value.split(";").reduce((function(e,t){if(t){for(var r=t.split(":"),n=r[0].trim().split(""),o=0;o<n.length;o++)"-"===n[o]&&(n[o+1]=n[o+1].toUpperCase(),n[o]=null);e[n.join("")]=r[1]}return e}),{}):e[n].value;return r},s=function(e,n,o){return e.nodeName===r.Text&&""!==e.nodeValue.trim()?e.nodeValue:l(e)?function(e,r,n){var o=n.get(e.nodeName.toLowerCase()),a=i(e.attributes,r),l=e.tagName.toLowerCase();if(0===e.childNodes.length)return o?t.h(o,a):t.h(l,a);for(var c=new Array,d=0;d<e.childNodes.length;d++)c.push(s(e.childNodes[d],d,n));return o?t.h(o,a,c):t.h(l,a,c)}(e,n,o):null},l=function(e){return void 0!==e.attributes};function c(e){var t=new Map;return{convert:function(r){if("string"!=typeof r)return null;r=a(r);var n=e.parseFragment(r);return n.childNodes.length>0?function(e,t){for(var r=new Array,n=0;n<e.childNodes.length;n++)r.push(s(e.childNodes[n],n,t));return r}(n,t).filter((function(e){return!!e})):null},registerComponent:function(e,r){t.set(e.toLowerCase(),r)}}}function d(e,r){if("string"!=typeof e)return null;e=a(e);var n,s,c=r.parseFragment(e);if(c.childNodes.length>0){var d=void 0;if(1===c.childNodes.length){var u=c.childNodes[0];l(u)&&(d=t.h(u.nodeName.toLowerCase(),(n={dangerouslySetInnerHTML:{__html:r.serialize(u)}},s=i(u.attributes,0),o({},n,s))))}else d=t.h("div",{dangerouslySetInnerHTML:{__html:e}});return d}return null}e.PreactHTMLConverter=function(){return c(n)},e.convertStatic=function(e){return d(e,n)},Object.defineProperty(e,"__esModule",{value:!0})}(t,r(9))},function(e,t){e.exports=n},function(e,t,r){var n=r(24);e.exports=n},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){var n=r(4);function o(e,t,r){this.type=Number(e),this.vNode=t,this.patch=r}o.NONE=0,o.VTEXT=1,o.VNODE=2,o.WIDGET=3,o.PROPS=4,o.ORDER=5,o.INSERT=6,o.REMOVE=7,o.THUNK=8,e.exports=o,o.prototype.version=n,o.prototype.type="VirtualPatch"},function(e,t,r){var n=r(5),o=r(8),a=r(2),i=r(6);function s(e,t){var r=e.vnode;if(r||(r=e.vnode=e.render(t)),!(n(r)||o(r)||a(r)))throw new Error("thunk did not return a valid node");return r}e.exports=function(e,t){var r=e,n=t;i(t)&&(n=s(t,e));i(e)&&(r=s(e,null));return{a:r,b:n}}},function(e,t,r){"use strict";e.exports=function(e){return"object"==typeof e&&null!==e}},function(e,t,r){(function(t){var n,o=void 0!==t?t:"undefined"!=typeof window?window:{},a=r(37);"undefined"!=typeof document?n=document:(n=o["__GLOBAL_DOCUMENT_CACHE@4"])||(n=o["__GLOBAL_DOCUMENT_CACHE@4"]=a),e.exports=n}).call(this,r(14))},function(e,t,r){var n=r(18),o=r(20),a=r(5),i=r(8),s=r(2),l=r(16);e.exports=function e(t,r){var c=r&&r.document||n,d=r?r.warn:null;if(t=l(t).a,s(t))return t.init();if(i(t))return c.createTextNode(t.text);if(!a(t))return d&&d("Item is not a valid virtual dom node",t),null;var u=null===t.namespace?c.createElement(t.tagName):c.createElementNS(t.namespace,t.tagName),p=t.properties;o(u,p);for(var _=t.children,h=0;h<_.length;h++){var f=e(_[h],r);f&&u.appendChild(f)}return u}},function(e,t,r){var n=r(17),o=r(7);function a(e,t,r,n){if(n){var a=n[t];if(o(a))a.unhook&&a.unhook(e,t,r);else if("attributes"===t)for(var i in a)e.removeAttribute(i);else if("style"===t)for(var s in a)e.style[s]="";else e[t]="string"==typeof a?"":null}}function i(e,t,r,o,a){var i=r?r[o]:void 0;if("attributes"!==o)if(i&&n(i)&&s(i)!==s(a))e[o]=a;else{n(e[o])||(e[o]={});var l="style"===o?"":void 0;for(var c in a){var d=a[c];e[o][c]=void 0===d?l:d}}else for(var u in a){var p=a[u];void 0===p?e.removeAttribute(u):e.setAttribute(u,p)}}function s(e){return Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__?e.__proto__:e.constructor?e.constructor.prototype:void 0}e.exports=function(e,t,r){for(var s in t){var l=t[s];void 0===l?a(e,s,l,r):o(l)?(a(e,s,l,r),l.hook&&l.hook(e,s,r?r[s]:void 0)):n(l)?i(e,t,r,s,l):e[s]=l}}},function(e,t,r){var n=r(34);e.exports=n},function(e,t,r){var n=r(36);e.exports=n},function(e,t,r){var n=r(19);e.exports=n},function(e,t,r){"use strict";var n=r(10),o=r(25),a=r(26),i=r(5),s=r(8),l=r(2),c=r(7),d=r(6),u=r(27),p=r(29),_=r(30);function h(e){return i(e)||s(e)||l(e)||d(e)}function f(e){try{return JSON.stringify(e,null," ")}catch(t){return String(e)}}e.exports=function(e,t,r){var i,s,l,d,m=[];!r&&(g=t,"string"==typeof g||n(g)||h(g))&&(r=t,s={});var g;i=u(e,s=s||t||{}),s.hasOwnProperty("key")&&(l=s.key,s.key=void 0);s.hasOwnProperty("namespace")&&(d=s.namespace,s.namespace=void 0);"INPUT"!==i||d||!s.hasOwnProperty("value")||void 0===s.value||c(s.value)||(s.value=p(s.value));(function(e){for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];if(c(r))continue;"ev-"===t.substr(0,3)&&(e[t]=_(r))}})(s),null!=r&&function e(t,r,o,i){if("string"==typeof t)r.push(new a(t));else if("number"==typeof t)r.push(new a(String(t)));else if(h(t))r.push(t);else{if(!n(t)){if(null==t)return;throw l={foreignObject:t,parentVnode:{tagName:o,properties:i}},(c=new Error).type="virtual-hyperscript.unexpected.virtual-element",c.message="Unexpected virtual child passed to h().\nExpected a VNode / Vthunk / VWidget / string but:\ngot:\n"+f(l.foreignObject)+".\nThe parent vnode is:\n"+f(l.parentVnode),c.foreignObject=l.foreignObject,c.parentVnode=l.parentVnode,c}for(var s=0;s<t.length;s++)e(t[s],r,o,i)}var l,c}(r,m,i,s);return new o(i,s,m,l,d)}},function(e,t,r){var n=r(4),o=r(5),a=r(2),i=r(6),s=r(7);e.exports=d;var l={},c=[];function d(e,t,r,n,d){this.tagName=e,this.properties=t||l,this.children=r||c,this.key=null!=n?String(n):void 0,this.namespace="string"==typeof d?d:null;var u,p=r&&r.length||0,_=0,h=!1,f=!1,m=!1;for(var g in t)if(t.hasOwnProperty(g)){var y=t[g];s(y)&&y.unhook&&(u||(u={}),u[g]=y)}for(var v=0;v<p;v++){var b=r[v];o(b)?(_+=b.count||0,!h&&b.hasWidgets&&(h=!0),!f&&b.hasThunks&&(f=!0),m||!b.hooks&&!b.descendantHooks||(m=!0)):!h&&a(b)?"function"==typeof b.destroy&&(h=!0):!f&&i(b)&&(f=!0)}this.count=p+_,this.hasWidgets=h,this.hasThunks=f,this.hooks=u,this.descendantHooks=m}d.prototype.version=n,d.prototype.type="VirtualNode"},function(e,t,r){var n=r(4);function o(e){this.text=String(e)}e.exports=o,o.prototype.version=n,o.prototype.type="VirtualText"},function(e,t,r){"use strict";var n=r(28),o=/([\.#]?[a-zA-Z0-9\u007F-\uFFFF_:-]+)/,a=/^\.|#/;e.exports=function(e,t){if(!e)return"DIV";var r,i,s,l,c=!t.hasOwnProperty("id"),d=n(e,o),u=null;a.test(d[1])&&(u="DIV");for(l=0;l<d.length;l++)(i=d[l])&&(s=i.charAt(0),u?"."===s?(r=r||[]).push(i.substring(1,i.length)):"#"===s&&c&&(t.id=i.substring(1,i.length)):u=i);r&&(t.className&&r.push(t.className),t.className=r.join(" "));return t.namespace?u:u.toUpperCase()}},function(e,t){var r,n,o;
/*!
* Cross-Browser Split 1.1.1
* Copyright 2007-2012 Steven Levithan <stevenlevithan.com>
* Available under the MIT License
* ECMAScript compliant, uniform cross-browser split method
*/
e.exports=(n=String.prototype.split,o=/()??/.exec("")[1]===r,function(e,t,a){if("[object RegExp]"!==Object.prototype.toString.call(t))return n.call(e,t,a);var i,s,l,c,d=[],u=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.extended?"x":"")+(t.sticky?"y":""),p=0;for(t=new RegExp(t.source,u+"g"),e+="",o||(i=new RegExp("^"+t.source+"$(?!\\s)",u)),a=a===r?-1>>>0:a>>>0;(s=t.exec(e))&&!((l=s.index+s[0].length)>p&&(d.push(e.slice(p,s.index)),!o&&s.length>1&&s[0].replace(i,(function(){for(var e=1;e<arguments.length-2;e++)arguments[e]===r&&(s[e]=r)})),s.length>1&&s.index<e.length&&Array.prototype.push.apply(d,s.slice(1)),c=s[0].length,p=l,d.length>=a));)t.lastIndex===s.index&&t.lastIndex++;return p===e.length?!c&&t.test("")||d.push(""):d.push(e.slice(p)),d.length>a?d.slice(0,a):d})},function(e,t,r){"use strict";function n(e){if(!(this instanceof n))return new n(e);this.value=e}e.exports=n,n.prototype.hook=function(e,t){e[t]!==this.value&&(e[t]=this.value)}},function(e,t,r){"use strict";var n=r(31);function o(e){if(!(this instanceof o))return new o(e);this.value=e}e.exports=o,o.prototype.hook=function(e,t){n(e)[t.substr(3)]=this.value},o.prototype.unhook=function(e,t){n(e)[t.substr(3)]=void 0}},function(e,t,r){"use strict";r(32)("ev-store","7");e.exports=function(e){var t=e["__EV_STORE_KEY@7"];t||(t=e["__EV_STORE_KEY@7"]={});return t}},function(e,t,r){"use strict";var n=r(33);e.exports=function(e,t,r){var o="__INDIVIDUAL_ONE_VERSION_"+e,a=n(o+"_ENFORCE_SINGLETON",t);if(a!==t)throw new Error("Can only have one copy of "+e+".\nYou already have version "+a+" installed.\nThis means you cannot install version "+t);return n(o,r)}},function(e,t,r){"use strict";(function(t){var r="undefined"!=typeof window?window:void 0!==t?t:{};e.exports=function(e,t){if(e in r)return r[e];return r[e]=t,t}}).call(this,r(14))},function(e,t,r){var n=r(10),o=r(15),a=r(5),i=r(8),s=r(2),l=r(6),c=r(16),d=r(35);function u(e,t){var r={a:e};return p(e,t,r,0),r}function p(e,t,r,n){if(e!==t){var c=r[n],u=!1;if(l(e)||l(t))h(e,t,r,n);else if(null==t)s(e)||(_(e,r,n),c=r[n]),c=g(c,new o(o.REMOVE,e,t));else if(a(t))if(a(e))if(e.tagName===t.tagName&&e.namespace===t.namespace&&e.key===t.key){var y=d(e.properties,t.properties);y&&(c=g(c,new o(o.PROPS,e,y))),c=function(e,t,r,n,i){for(var s=e.children,l=function(e,t){var r=m(t),n=r.keys,o=r.free;if(o.length===t.length)return{children:t,moves:null};var a=m(e),i=a.keys;if(a.free.length===e.length)return{children:t,moves:null};for(var s=[],l=0,c=o.length,d=0,u=0;u<e.length;u++){var p,_=e[u];_.key?n.hasOwnProperty(_.key)?(p=n[_.key],s.push(t[p])):(p=u-d++,s.push(null)):l<c?(p=o[l++],s.push(t[p])):(p=u-d++,s.push(null))}for(var h=l>=o.length?t.length:o[l],g=0;g<t.length;g++){var y=t[g];y.key?i.hasOwnProperty(y.key)||s.push(y):g>=h&&s.push(y)}for(var v,b=s.slice(),w=0,O=[],x=[],R=0;R<t.length;){var P=t[R];for(v=b[w];null===v&&b.length;)O.push(f(b,w,null)),v=b[w];v&&v.key===P.key?(w++,R++):P.key?(v&&v.key&&n[v.key]!==R+1?(O.push(f(b,w,v.key)),(v=b[w])&&v.key===P.key?w++:x.push({key:P.key,to:R})):x.push({key:P.key,to:R}),R++):v&&v.key&&O.push(f(b,w,v.key))}for(;w<b.length;)v=b[w],O.push(f(b,w,v&&v.key));if(O.length===d&&!x.length)return{children:s,moves:null};return{children:s,moves:{removes:O,inserts:x}}}(s,t.children),c=l.children,d=s.length,u=c.length,_=d>u?d:u,h=0;h<_;h++){var y=s[h],v=c[h];i+=1,y?p(y,v,r,i):v&&(n=g(n,new o(o.INSERT,null,v))),a(y)&&y.count&&(i+=y.count)}l.moves&&(n=g(n,new o(o.ORDER,e,l.moves)));return n}(e,t,r,c,n)}else c=g(c,new o(o.VNODE,e,t)),u=!0;else c=g(c,new o(o.VNODE,e,t)),u=!0;else i(t)?i(e)?e.text!==t.text&&(c=g(c,new o(o.VTEXT,e,t))):(c=g(c,new o(o.VTEXT,e,t)),u=!0):s(t)&&(s(e)||(u=!0),c=g(c,new o(o.WIDGET,e,t)));c&&(r[n]=c),u&&_(e,r,n)}}function _(e,t,r){!function e(t,r,n){if(a(t)){if(t.hooks&&(r[n]=g(r[n],new o(o.PROPS,t,function(e){var t={};for(var r in e)t[r]=void 0;return t}(t.hooks)))),t.descendantHooks||t.hasThunks)for(var i=t.children,s=i.length,c=0;c<s;c++){var d=i[c];e(d,r,n+=1),a(d)&&d.count&&(n+=d.count)}}else l(t)&&h(t,null,r,n)}(e,t,r),function e(t,r,n){if(s(t))"function"==typeof t.destroy&&(r[n]=g(r[n],new o(o.REMOVE,t,null)));else if(a(t)&&(t.hasWidgets||t.hasThunks))for(var i=t.children,c=i.length,d=0;d<c;d++){var u=i[d];e(u,r,n+=1),a(u)&&u.count&&(n+=u.count)}else l(t)&&h(t,null,r,n)}(e,t,r)}function h(e,t,r,n){var a=c(e,t),i=u(a.a,a.b);(function(e){for(var t in e)if("a"!==t)return!0;return!1})(i)&&(r[n]=new o(o.THUNK,null,i))}function f(e,t,r){return e.splice(t,1),{from:t,key:r}}function m(e){for(var t={},r=[],n=e.length,o=0;o<n;o++){var a=e[o];a.key?t[a.key]=o:r.push(o)}return{keys:t,free:r}}function g(e,t){return e?(n(e)?e.push(t):e=[e,t],e):t}e.exports=u},function(e,t,r){var n=r(17),o=r(7);function a(e){return Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__?e.__proto__:e.constructor?e.constructor.prototype:void 0}e.exports=function e(t,r){var i;for(var s in t){s in r||((i=i||{})[s]=void 0);var l=t[s],c=r[s];if(l!==c)if(n(l)&&n(c))if(a(c)!==a(l))(i=i||{})[s]=c;else if(o(c))(i=i||{})[s]=c;else{var d=e(l,c);d&&((i=i||{})[s]=d)}else(i=i||{})[s]=c}for(var u in r)u in t||((i=i||{})[u]=r[u]);return i}},function(e,t,r){var n=r(18),o=r(10),a=r(19),i=r(38),s=r(39);function l(e,t,r){var o=function(e){var t=[];for(var r in e)"a"!==r&&t.push(Number(r));return t}(t);if(0===o.length)return e;var a=i(e,t.a,o),s=e.ownerDocument;r.document||s===n||(r.document=s);for(var l=0;l<o.length;l++){var d=o[l];e=c(e,a[d],t[d],r)}return e}function c(e,t,r,n){if(!t)return e;var a;if(o(r))for(var i=0;i<r.length;i++)a=s(r[i],t,n),t===e&&(e=a);else a=s(r,t,n),t===e&&(e=a);return e}e.exports=function e(t,r,n){return(n=n||{}).patch=n.patch&&n.patch!==e?n.patch:l,n.render=n.render||a,n.patch(t,r,n)}},function(e,t){},function(e,t){var r={};function n(e,t,r){if(0===e.length)return!1;for(var n,o,a=0,i=e.length-1;a<=i;){if(o=e[n=(i+a)/2>>0],a===i)return o>=t&&o<=r;if(o<t)a=n+1;else{if(!(o>r))return!0;i=n-1}}return!1}function o(e,t){return e>t?1:-1}e.exports=function(e,t,a,i){return a&&0!==a.length?(a.sort(o),function e(t,o,a,i,s){if(i=i||{},t){n(a,s,s)&&(i[s]=t);var l=o.children;if(l)for(var c=t.childNodes,d=0;d<o.children.length;d++){s+=1;var u=l[d]||r,p=s+(u.count||0);n(a,s,p)&&e(c[d],u,a,i,s),s=p}}return i}(e,t,a,i,0)):{}}},function(e,t,r){var n=r(20),o=r(2),a=r(15),i=r(40);function s(e,t){"function"==typeof t.destroy&&o(t)&&t.destroy(e)}e.exports=function(e,t,r){var o=e.type,l=e.vNode,c=e.patch;switch(o){case a.REMOVE:return function(e,t){var r=e.parentNode;r&&r.removeChild(e);return s(e,t),null}(t,l);case a.INSERT:return function(e,t,r){var n=r.render(t,r);e&&e.appendChild(n);return e}(t,c,r);case a.VTEXT:return function(e,t,r,n){var o;if(3===e.nodeType)e.replaceData(0,e.length,r.text),o=e;else{var a=e.parentNode;o=n.render(r,n),a&&o!==e&&a.replaceChild(o,e)}return o}(t,0,c,r);case a.WIDGET:return function(e,t,r,n){var o,a=i(t,r);o=a?r.update(t,e)||e:n.render(r,n);var l=e.parentNode;l&&o!==e&&l.replaceChild(o,e);a||s(e,t);return o}(t,l,c,r);case a.VNODE:return function(e,t,r,n){var o=e.parentNode,a=n.render(r,n);o&&a!==e&&o.replaceChild(a,e);return a}(t,0,c,r);case a.ORDER:return function(e,t){for(var r,n,o,a=e.childNodes,i={},s=0;s<t.removes.length;s++)n=t.removes[s],r=a[n.from],n.key&&(i[n.key]=r),e.removeChild(r);for(var l=a.length,c=0;c<t.inserts.length;c++)o=t.inserts[c],r=i[o.key],e.insertBefore(r,o.to>=l++?null:a[o.to])}(t,c),t;case a.PROPS:return n(t,c,l.properties),t;case a.THUNK:return function(e,t){e&&t&&e!==t&&e.parentNode&&e.parentNode.replaceChild(t,e);return t}(t,r.patch(t,c,r));default:return t}}},function(e,t,r){var n=r(2);e.exports=function(e,t){if(n(e)&&n(t))return"name"in e&&"name"in t?e.id===t.id:e.init===t.init;return!1}},function(e,t,r){"use strict";r.r(t),r.d(t,"Component",(function(){return I})),r.d(t,"Controller",(function(){return H})),r.d(t,"Jaw",(function(){return c})),r.d(t,"ModelRenderer",(function(){return p})),r.d(t,"PreactRenderer",(function(){return B})),r.d(t,"RenderableJaw",(function(){return V})),r.d(t,"Shark",(function(){return D})),r.d(t,"SmartModel",(function(){return _})),r.d(t,"Utils",(function(){return s})),r.d(t,"View",(function(){return U})),r.d(t,"VirtualDOMRenderer",(function(){return E}));var n=r(1),o=r.n(n),a=r(0),i=r.n(a);class s{constructor(){this.__id="Utils"}static betterRandom(e,t){var r=parseFloat(e),n=Math.random();return!(t=parseFloat(t))&&e&&(r=0,t=parseFloat(e)),r||(r=0),t||(t=1),n*=t-r,n+=r}static betterRandomInt(e,t){return Math.round(s.betterRandom(e,t))}static camelToDashed(e){let t="";return e.split("").forEach((e,r)=>{e.toLowerCase()!==e&&(r>0&&(t+="-"),e=e.toLowerCase()),t+=e}),t}static computeHash(e){return(s.safeStringify(e)||"").split("").reduce((function(e,t){return(e=(e<<5)-e+t.charCodeAt(0))&e}),0)}static dashedToCamel(e){let t=e,r=0;for(;r>-1;)r=t.indexOf("-"),r>-1&&(t=t.substr(0,r)+t.substr(r+1,1).toUpperCase()+t.substr(r+2));return t}static extractDifferentProperties(e,t){var r={};for(var n in e)e[n]&&t[n]&&e[n]!==t[n]&&(r[n]=t[n]);return r}static flatten(e){var t={};for(var r in e)"function"!=typeof e[r]&&("object"==typeof e[r]?t[r]=s.flatten(e[r]):t[r]=e[r]);return t}static generateGUID(e="",t=""){return e+"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})).toUpperCase()+t}static getDeepProperty(e,t){if(e){for(var r=t.split("."),n=e,o=0;o<r.length-1;o++){var a=-1;if((i=r[o].indexOf("["))>-1&&(a=parseInt(r[o].substring(i+1,r[o].indexOf("]"))),r[o]=r[o].substr(0,i)),-1===a){if(!n[r[o]])break;n=n[r[o]]}else{if(!n[r[o]][a])break;n=n[r[o]][a]}}var i;a=-1;return(i=r[o].indexOf("["))>-1&&(a=parseInt(r[o].substring(i+1,r[o].indexOf("]"))),r[o]=r[o].substr(0,i)),-1===a?n[r[o]]:n[r[o]][a]}}static matchLists(e=[],t={},r={}){e.forEach(e=>{for(const r in e)if("Guid"===r.substr(-2)){const n=r.substr(0,r.length-2),o=t[n];o&&(e["__"+n]=s.safp(o,"guid",e[r]))}})}static matchProperties(e,t,r){var n={createMissingProperties:!1,exclude:[],matchEmptyParameters:!0,matchUndefinedParameters:!1};for(var o in i.a.extend(!0,n,r),Array.isArray(n.exclude)||(n.exclude=[]),t)0!==n.exclude.length&&-1!==n.exclude.indexOf(o)||void 0===e[o]&&!n.createMissingProperties||!(t[o]&&""!==t[o]||n.matchEmptyParameters)||void 0===t[o]&&!n.matchUndefinedParameters||(Array.isArray(t[o])?e[o]=t[o].map((function(e){return e})):"object"!=typeof t[o]&&"object"!=typeof e[o]||null===t[o]||null===e[o]?e[o]=t[o]:e[o]&&"Object"===e[o].constructor.name&&"Object"===t[o].constructor.name&&Object.keys(e[o]).length>0?s.matchProperties(e[o],t[o],r):e[o]&&"Object"===e[o].constructor.name&&"string"==typeof t[o]?e[o]=i.a.extend(!0,e[o],s.parseJSON(t[o],"object")):e[o]&&"Array"===e[o].constructor.name&&"string"==typeof t[o]?e[o]=s.parseJSON(t[o],"array"):e[o]=i.a.extend(!0,{},t[o]))}static moveCaretToEnd(e){setTimeout((function(){if("number"==typeof e.selectionStart)e.selectionStart=e.selectionEnd=e.value.length;else if(void 0!==e.createTextRange){e.focus();var t=e.createTextRange();t.collapse(!1),t.select()}}),10)}static parseJSON(e,t){if("string"==typeof e&&"array"===e.toLowerCase())return[];if(""===e||'""'===e)switch(t){case"array":return[];default:return{}}else if("string"==typeof e){let r;try{r=JSON.parse(e)}catch(n){console.error("Utisl.parseJSON",{error:n,data:e,expectedType:t}),r=null}if(null===r||""===r)switch(t){case"array":return[];case"object":return{};default:return r}else switch(t){case"array":return"function"==typeof r.splice?r:[];default:return r}}else{if(void 0!==e)return e;switch(t){case"array":return[];default:return{}}}}static replaceNullValue(e,t){if(e.push)for(var r=0;r<e.length;r++)s.replaceNullValue(e[r],t);else for(var n in e)void 0!==e[n]&&null!==e[n]||(e[n]=t)}static safeStringify(e){return JSON.stringify(e,(e,t)=>"__shguid"!==e&&"__"===e.substr(0,2)?"":t)}static safp(e,t,r,n){return s.searchArrayForProperty(e,t,r,n)}static searchArrayForProperty(e,t,r,n){if(e){switch(typeof n){case"undefined":n="first";break;case"boolean":n=n?"first":"all"}for(var o,a=[],i=(o=t.indexOf(".")>-1?t.split("."):[t]).length,s=e.length,l=0;l<s;l++){var c=e[l][o[0]];if(c)for(var d=1;d<i&&c[o[d]];d++)c=c[o[d]];if(c===r)switch(n){case"all":a.push(e[l]);break;case"first":return e[l];case"index":return l}}return a.length>0?a:null}console.error("Error, cant search on a null list.")}static setDeepProperty(e,t,r,n){var o=t.split(".");return e[o[n=n||0]]||(e[o[n]]={}),n<o.length-1?s.setDeepProperty(e[o[n]],t,r,n+1):e[o[n]]=r,e}static trace(e){try{AppData.consoleDebugActive&&console.debug(e)}catch(t){alert(e)}}static toCamelCase(e){return e.substr(0,1).toLowerCase()+e.substr(1)}static toTitleCase(e,t=!0){return e.substr(0,1).toUpperCase()+(t?e.substr(1).toLowerCase():e.substr(1))}static vibrate(e){e||(e=200);try{navigator.notification.vibrate(e)}catch(e){}}static zeroFill(e,t){var r=e.toString(),n=r.length;return n<t&&(r=(r="0000000000000000000000000000000000000000"+r).substr(40+n-t)),r}}class l{constructor(e,t){if(null!=e&&""!==e||(e=this.constructor.name.substr(0,1).toLowerCase()+this.constructor.name.substr(1)),"string"!=typeof e)throw new Error("Jaw id must be passed");Object.defineProperty(this,"className",{configurable:!1,enumerable:!0,value:e,writable:!1}),Object.defineProperty(this,"id",{configurable:!1,enumerable:!0,value:e,writable:!1}),this.isInitialized=!1,this.currentOpenOptions={},this.route=null,this.store={},this.__store={getLabel:function(){return function(e,t){return e.indexOf("{{")>-1&&(e=t(e)),t(D.labels.labels[e])}}},this.__activeComponents=[],this.__autoBoundProperties=[],this.__childTemplates={},this.__dynamicDataBindings={},this.__listeners={},this.__methods={},this.__viewBinds={};for(const e in t)this.addMethod(e,t[e])}addComponent(e){return void 0===e?(console.error("Jaw.addComponent: You can't pass this type of data (must be a component)"),this.__activeComponents):("string"==typeof e&&(e=D.__components[e]),this.__activeComponents.push(e),this.__activeComponents)}addComponents(e){return Array.isArray(e)?e.forEach(e=>{this.addComponent(e)},this):console.error("Jaw.addComponents: You can't pass this type of data (must be an array)"),this.__activeComponents}init(){this.trace("The init method for "+this.className+" has not been implemented.","info")}_extractComponentsValidMethodList(e,t,r){const n=[];return e.forEach(e=>{-1===t.indexOf(e.id)?(n.push(...this._extractValidMethodList(e)),t.push(e.id)):r.push("= NO "+e.id),e.__activeComponents.length>0&&n.push(...this._extractComponentsValidMethodList(e.__activeComponents,t,r))}),n}_extractValidMethodList(e){const t=[];for(var r in e)"function"==typeof e[r]&&r.indexOf("Handler")>-1&&t.push({handlerName:r,handlerHolder:e});if(e.__proto__ instanceof l){const r=e.__proto__;Object.getOwnPropertyNames(e.__proto__).forEach(n=>{"function"==typeof r[n]&&"constructor"!==n&&n.indexOf("Handler")>-1&&t.push({handlerName:n,handlerHolder:e})}),t.push(...this._extractValidMethodList(e.__proto__))}return t}_initComponents(e=null,t=[]){null===e&&(e=this.__activeComponents),e.forEach((function(e){-1===t.indexOf(e.id)&&("function"==typeof e.jawInit&&e.jawInit.call(e,{jaw:currJaw}),"function"!=typeof e.init||e.isInitialized||(e.init.call(e),e.isInitialized=!0),t.push(e.id),e.__activeComponents.length>0&&this._initComponents(e.__activeComponents,t))}),this)}__singleSet(e,t){this.__store[e]=t;const r=this;Object.defineProperty(this.store,e,{configurable:!0,enumerable:!0,get:()=>r.__store[e],set(t){const n=r.__store[e];r.__store[e]=t,D.settings.enableJawStoreAutoRender&&s.computeHash(t)!==s.computeHash(n)&&D.render()}})}}l.prototype.addMethod=function(e,t,r){var n={context:this,smartUnlisten:!0};i.a.extend(!0,n,r),this[e]=t.bind(n.context),this.__methods[e]=this.__methods[e]||{},this.__methods[e].name=e,this.__methods[e].settings=n},l.prototype.emit=function(e,t){return i()(this).trigger(e,t)},l.prototype.get=function(e){return arguments.length>1&&console.warn("WARNING!! The jaw.get() method has deprecated the 'forcedType' parameter, and now works only on jaw-local data"),this.__store[e]},l.prototype.on=function(e,t){return i()(this).on(e,t)},l.prototype.set=function(e,t,r,n){if(void 0===n&&(n=!1),void 0!==r&&(console.warn("WARNING!! The Jaw.prototype.set() method called with 'options' parameter setted."),"boolean"==typeof r&&(n=r)),Array.isArray(e))for(var o=e.length,a=0;a<o;a++){var s=e[a];""===s.name?(console.warn("WARNING!!! Ability of set a 'top level' property on a Jaw is deprecated and will be removed"),i.a.extend(!0,this.__store,s.value)):this.__singleSet(s.name,s.value)}else if("object"==typeof e)for(let t in e)this.__singleSet(t,e[t]);else"string"==typeof e?""===e?(console.warn("WARNING!!! Ability of set a 'top level' property on a Jaw is deprecated and will be removed"),i.a.extend(!0,this.__store,t)):this.__singleSet(e,t):console.error("Jaw.prototype.set: This kind of data could not be used.");D.trace({__store:this.__store,nameOrItems:e,value:t,options:r,requireRender:n,type:typeof e},D.TRACE_LOG),n&&D.render()},l.prototype.setRenderElements=function(e){console.warn("Jaw.prototype.setRenderElements: This method MUST NOT be used, replace it with 'set' method."),this.set(e,null,{},!0)},l.__getNodeDepth=function(e){let t=0;for(;"BODY"!=e.nodeName;)e=e.parentNode,t++;return t},l.prototype.smartListen2=function(e,t){const r=[];for(let e in this)"function"==typeof this[e]&&e.indexOf("Handler")>-1&&r.push({handlerName:e,handlerHolder:this});this.__activeComponents.forEach(e=>{for(let t in e)"function"==typeof e[t]&&t.indexOf("Handler")>-1&&r.push({handlerName:t,handlerHolder:e})}),r.forEach(e=>{let t,r=e.handlerName;t=r.lastIndexOf("_")>-1?r.substr(0,r.lastIndexOf("_")):r;let n=t,o="#"+n,a=!0,s=document.querySelector(o),c="singleNode";if(!s)if(o="."+n,s=document.querySelectorAll(o),0===s.length)D.__controllers[t]?c="manager":a=!1;else{c="multiNode";const t=[];s.forEach(e=>{t.push(l.__getNodeDepth(e))});const r=Math.min(...t);e.depthList=t,e.minDepth=r}if(e.targetType=c,a){let r=!1;"manager"===c&&(e.handlerHolder.__listeners[t]?e.handlerHolder.__listeners[t][eventName]?"component"===e.handlerHolder.type&&(r=!0):r=!0:(r=!0,e.handlerHolder.__listeners[t]={}),r&&(this.trace("Auto-listener assigned to the '"+D.__controllers[t].className+"' Controller for the '"+eventName+"' event.","log"),e.handlerHolder.__listeners[t][eventName]={handler:currHandler,target:"controller",type:"autoListener"},"component"===e.handlerHolder.type&&i()(D.__controllers[t]).off(eventName,e.handlerHolder[currHandler]),i()(D.__controllers[t]).on(eventName,e.handlerHolder[currHandler])))}},this),this.trace("Jaw.prototype.smartListen2: validMethodList",r,"log")},l.prototype.smartListen=function(e,t){void 0===t&&(t=!1);var r=this._extractValidMethodList(this);console.log("smartListen",{__validMethodList:this.__validMethodList,jaw:this});const n=[],o=[];r.push(...this._extractComponentsValidMethodList(this.__activeComponents,n,o)),console.log({processedComponentList:n,__activeComponents:this.__activeComponents,notProcessedComponentList:o,validMethodList:r}),this.trace("Jaw.prototype.smartListen: validMethodList",r,"log"),this.__validMethodList=r,r.forEach((function(r){var n,o=r.handlerName,a=!0;n=o.indexOf("_")>-1?o.substr(0,o.indexOf("_")):o;var s=r.handlerHolder.className+"_"+n,l="#"+s,c=o.substring(o.indexOf("_")+1,o.indexOf("Handler")),d=i()(l);if(e){var u=i()(e);t&&"#"+n===e?(this.trace(d,u,"log"),d=u):(0===(d=u.find(l)).length&&(l="#"+n,d=u.find(l)),0===d.length&&(l="."+s,d=u.find(l)),0===d.length&&(l="."+n,d=u.find(l)),d.selector!==u.selector&&0===d.closest(u).length&&(a=!1))}else 0===d.length&&(l="#"+n,d=i()(l)),0===d.length&&(l="."+s,d=i()(l)),0===d.length&&(l="."+n,d=i()(l));if(a){var p=!1;if(d.length>0){if(r.handlerHolder.__listeners||(r.handlerHolder.__listeners={}),r.handlerHolder.__listeners[l]?r.handlerHolder.__listeners[l][c]?"component"===r.handlerHolder.type&&(p=!0):p=!0:(p=!0,r.handlerHolder.__listeners[l]={}),p){this.trace("Auto-listener assigned to '"+l+"' item of the '"+r.handlerHolder.className+"' "+r.handlerHolder.type+" for the '"+c+"' event.","log");var _=function(e){e.data.handler.call(r.handlerHolder,e,this.dataset)};"component"===r.handlerHolder.type&&r.handlerHolder.__listeners[l][c]&&r.handlerHolder.__listeners[l][c].handler&&d.off(c,r.handlerHolder.__listeners[l][c].handler),r.handlerHolder.__listeners[l][c]={context:"jaw",handler:_,originalHandler:o,target:"DOM",type:"autoListener"},d.on(c,{handler:r.handlerHolder[o],handlerHolder:r.handlerHolder},_),r.handlerHolder.__methods||(r.handlerHolder.__methods={}),r.handlerHolder.__methods[o]&&r.handlerHolder.__methods[o].settings&&void 0!==r.handlerHolder.__methods[o].settings.smartUnlisten&&(r.handlerHolder.__listeners[l][c].smartUnlisten=r.handlerHolder.__methods[o].settings.smartUnlisten)}}else D.__controllers[n]&&(r.handlerHolder.__listeners[n]?r.handlerHolder.__listeners[n][c]?"component"===r.handlerHolder.type&&(p=!0):p=!0:(p=!0,r.handlerHolder.__listeners[n]={}),p&&(this.trace("Auto-listener assigned to the '"+D.__controllers[n].className+"' Controller for the '"+c+"' event.","log"),r.handlerHolder.__listeners[n][c]={handler:o,target:"controller",type:"autoListener"},"component"===r.handlerHolder.type&&i()(D.__controllers[n]).off(c,r.handlerHolder[o]),i()(D.__controllers[n]).on(c,r.handlerHolder[o])))}else this.trace("Auto-listener not assigned for the '"+c+"' event because of the container selector. The target: ",d,"log")}),this)},l.prototype.smartUnlisten=function(e){console.log("smartUnlisten",{__validMethodList:this.__validMethodList}),this.__validMethodList&&this.__validMethodList.forEach(e=>{for(var t in e.handlerHolder.__listeners){var r=e.handlerHolder.__listeners[t];for(var n in r){var o=r[n];if(!0===o.smartUnlisten||void 0===o.smartUnlisten){switch(o.target){case"DOM":i()(t).off(n,e.handlerHolder[o.handler]);break;case"controller":i()(D.__controllers[t]).off(n,e.handlerHolder[o.handler])}delete e.handlerHolder.__listeners[t][n]}}delete e.handlerHolder.__listeners[t]}})},l.prototype.trace=function(e,t){D&&D.trace&&D.trace(e,t)},l.prototype.updateDisplay=function(e,t){D.get(e,"appData");console.warn("UPDATE DISPLAY!!!!!!");var r=i()("body"),n="sh-model",o=r.find("[data-"+n+"]");if(0===o.length&&(n="sh-reference-model",o=r.find("[data-"+n+"]")),(o=r.find("[data-"+n+"='"+e+"']")).length>0){var a,s=(e=o.data(n)).indexOf("["),l=-1;s>-1&&(l=e.substring(s+1,e.indexOf("]")),e=e.substr(0,s)),(a=-1===l?D.getReferenceModel(e):D.getReferenceModel(e)[l]).__dirtyProperties.map((function(t){var r=o.find("[data-sh-prop^='"+t+"@']").add("[data-sh-model-prop^='"+t+"@']");if(r.length>0){var n=D.getTemplate("models."+e+"_"+t);if(""!==n){var s=i.a.extend({},D.__templateMap,jaw.__childTemplates),l=Mustache.render(n,this.__store,s);r.html(l)}else r.html(a[t])}})),a.__dirtyProperties=[],a.__isDirty=!1}};var c=l,d=r(3),u=r.n(d);var p=class{constructor(e){this.model=e,this.parseModelValues()}__parseModelValues(){for(let e in this.model)"function"!=typeof this.model[e]&&(this[e]=this.model[e])}parseModelValues(e){return this.__parseModelValues(e)}setModel(e){this.model=e}};var _=class{constructor(e,t,r){Object.defineProperties(this,{__shguid:{value:s.generateGUID(),writable:!1}}),r&&s.matchProperties(this,r,{createMissingProperties:!0,matchEmptyParameters:!0}),Object.defineProperties(this,{__clean:{value:e=>(this.__dirtyProperties=e?this.__dirtyProperties.filter(t=>-1===e.indexOf(t.property)):[],this.__isDirty=this.__dirtyProperties.length>0,this.__dirtyProperties),writable:!1},__export:{value:e=>{const t={};if(e&&e.hasOwnProperty("fields"))e.fields.forEach(e=>{this.hasOwnProperty(e)&&(t[e]=this[e])});else for(let e in this)"function"!=typeof this[e]&&"__"!==e.substr(0,2)&&"jQuery"!==e.substr(0,6)&&(t[e]=this[e]);return t},writable:!1},__import:{value:(e,t)=>{const r=Object.assign({createMissingProperties:!1,matchEmptyParameters:!0},t);return s.matchProperties(this,e,r)},writable:!1},__restore:{value:e=>{e||(this.__dirtyProperties.forEach((function(e){this.set(e.property,e.originalValue)}),this),this.__dirtyProperties=[],this.__isDirty=!1)},writable:!1},__setPropertyDirtiness:{value:(e,t)=>{const r=this.__dirtyProperties.findIndex(t=>t.property===e);if(-1===r)this.__dirtyProperties.push({property:e,originalValue:t.oldValue});else if(t.newValue===this.__dirtyProperties[r].originalValue)this.__dirtyProperties.splice(r,1);else if(Array.isArray(t.newValue)&&Array.isArray(this.__dirtyProperties[r].originalValue))try{s.computeHash(t.newValue)===s.computeHash(this.__dirtyProperties[r].originalValue)&&this.__dirtyProperties.splice(r,1)}catch(e){console.error(e)}},writable:!1},__toJSON:{value:e=>{"boolean"==typeof e||(e=!1);var t={};for(var r in this)"function"==typeof this[r]||"__"===r.substr(0,2)&&"__shguid"!==r&&!e||"jQuery"===r.substr(0,6)||(t[r]=this[r]);return t},writable:!1}}),Object.defineProperties(this,{__dirtyProperties:{value:[],writable:!0}}),this.__boundProperties=[],this.__isDirty=!1,this.__modelStructure=r,this.__renderer=new p(this)}addRenderer(e){this.__renderer=this.__=e,this.__renderer.setModel(this)}clean(e){return this.__clean(e)}emit(e,t){return i()(this).trigger(e,t)}export(e){return this.__export(e)}exportArrayField(e,t="JSON"){return this.__exportArrayField(e,t)}__exportArrayField(e,t="JSON"){const r=s.getDeepProperty(this,e);let n;switch(t){case"JSON":n=JSON.stringify(r)}return n}exportBooleanField(e,t="number"){return this.__exportBooleanField(e,t)}__exportBooleanField(e,t="number"){const r=s.getDeepProperty(this,e);let n;switch(t){case"number":n=!0===r?1:0;break;case"string":n=r.toString()}return n}exportDateField(e,t="ISO",r=!0){return this.__exportDateField(e,t,r)}__exportDateField(e,t="ISO",r=!0){const n=s.getDeepProperty(this,e);let o;const a=u()(n);return o=a.isValid()?r?a.utc().format("YYYY-MM-DD HH:mm:ss"):a.format("YYYY-MM-DD HH:mm:ss"):"0000-00-00 00:00:00",o}exportNumberField(e,t){return this.__exportNumberField(e,t)}__exportNumberField(e,t){const r=s.getDeepProperty(this,e);let n;return"number"==typeof r?n=r:"string"==typeof r&&(n=parseFloat(r)),n}exportObjectField(e,t="JSON"){return this.__exportObjectField(e,t)}__exportObjectField(e,t="JSON"){const r=s.getDeepProperty(this,e);let n;switch(t){case"JSON":n=JSON.stringify(r)}return n}import(e,t){return this.__import(e,t)}importBooleanField(e,t){return this.__importBooleanField(e,t)}__importBooleanField(e,t){if(void 0===t||null==t)return!1;let r,n=!1;return"number"==typeof t?(r=1===t,n=!0):"string"==typeof t?(r="false"!==t.toLowerCase()&&(1===parseInt(t)||"true"===t.toLowerCase()),n=!0):"boolean"==typeof t&&(r=t,n=!0),n&&s.setDeepProperty(this,e,r),n}importDateField(e,t,r=!0){return this.__importDateField(e,t,r)}__importDateField(e,t,r){if(void 0===t||null==t)return!1;let n;return n=r?u.a.utc(t).local():u()(t),s.setDeepProperty(this,e,n),n.isValid()}importNumberField(e,t,r){return this.__importNumberField(e,t,r)}__importNumberField(e,t,r){if(void 0===t||null==t)return!1;let n;return"number"==typeof t?n=t:"string"==typeof t&&(n=parseFloat(t)),isNaN(n)?void 0!==r&&"number"==typeof r&&(s.setDeepProperty(this,e,r),!0):(s.setDeepProperty(this,e,n),!0)}importField(e,t,r){if(r=Object.assign({acceptUndefined:!1,dataType:"auto",defaultValue:void 0,useUTC:!0},r),(void 0===t||null==t)&&!r.acceptUndefined)return!1;switch(r.dataType){case"auto":break;case"boolean":return this.importBooleanField(e,t);case"date":return this.importDateField(e,t,r.useUTC);case"number":return this.importNumberField(e,t,r.defaultValue)}return!0}isDirty(){return this.__isDirty}off(e,t){return i()(this).off(e,t)}on(e,t){return i()(this).on(e,t)}restore(e){this.__restore(e)}__singleSet(e,t,r){let n=s.getDeepProperty(this,e);const o=s.computeHash(n);let a=!0;switch(typeof n){case"number":D.trace("%cChiamato il metodo set e la propietà è di tipo "+typeof n,"font-size: 16px; color: red;",D.TRACE_LOG),t=parseFloat(t);break;case"object":if(Array.isArray(n)&&!Array.isArray(t)){let e=Array.from(n),r=e.indexOf(t);if(r>-1)e.splice(r,1);else{let r=e.indexOf(parseFloat(t));r>-1?e.splice(r,1):e.push(t)}t=e,D.trace(`%cChiamato il metodo set e la propietà è di tipo ${typeof e} ed è un array`,"font-size: 16px; color: red;",D.TRACE_LOG)}else D.activeFeatures.moment&&(n._isAMomentObject||n instanceof u.a)?(D.trace(`%cChiamato il metodo set e la propietà è di tipo ${typeof n} ed è un moment`,"font-size: 16px; color: red;",D.TRACE_LOG),t=u()(t)):D.trace("%cChiamato il metodo set e la propietà è di tipo "+typeof n,"font-size: 16px; color: red;",D.TRACE_LOG);if(Array.isArray(n)&&Array.isArray(t))try{a=o!==s.computeHash(t)}catch(e){console.error(e)}break;case"string":D.trace("%cChiamato il metodo set e la propietà è di tipo "+typeof n,"font-size: 16px; color: red;",D.TRACE_LOG),void 0!==t?"function"==typeof t.toString&&(t=t.toString()):t=""}var i={modelName:this.__modelName,newValue:t,oldValue:s.getDeepProperty(this,e),property:e};if(s.setDeepProperty(this,e,t),i.oldValue!==i.newValue&&a){this.__setPropertyDirtiness(e,i),this.__isDirty=this.__dirtyProperties.length>0,D.settings.enableSmartModelSetUpdatesView&&document.querySelectorAll(`[data-sh-prop="${e}"]`).forEach(e=>{