ywana-core8 0.0.5 → 0.0.9

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.
@@ -1,2 +1,2 @@
1
- import"material-design-icons-iconfont/dist/material-design-icons.css";import e from"deep-equal";var n=function(e,n,t,r){void 0===t&&(t=null);try{console.log("FETCH",e,n);var o={method:e,mode:"cors",headers:{Accept:"application/json","Content-Type":"application/json","x-access-token":r},body:t};return Promise.resolve(function(e,t){try{var r=Promise.resolve(fetch(n,o)).then(function(e){var n;function t(t){if(n)return t;throw e}var r=function(){if(e.ok)return Promise.resolve(e.json()).then(function(e){return n=1,e})}();return r&&r.then?r.then(t):t(r)})}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}(0,function(e){if(e instanceof Error)throw{error:e};return Promise.resolve(e.json()).then(function(e){throw{success:!1,message:e.message}})}))}catch(e){return Promise.reject(e)}},t=function(e,t){return{GET:function(r){var o=t?t.token():null;return n("GET",e+r,void 0,o)},POST:function(r,o){var i=t?t.token():null;return n("POST",e+r,o,i)},PUT:function(r,o){var i=t?t.token():null;return n("PUT",e+r,o,i)},PATCH:function(r,o){var i=t?t.token():null;return n("PATCH",e+r,o,i)},DELETE:function(r){var o=t?t.token():null;return n("DELETE",e+r,void 0,o)}}},r=process.env.REACT_APP_SESSION||window&&window.SESSION?window.SESSION:"YWANA-CORE6-SESSION",o={token:function(){return(sessionStorage.getItem(r)?JSON.parse(sessionStorage.getItem(r)):{}).token},me:function(){return(sessionStorage.getItem(r)?JSON.parse(sessionStorage.getItem(r)):{}).me},init:function(e,n){sessionStorage.setItem(r,JSON.stringify({token:e,me:n}))},refresh:function(e){var n=this.me();sessionStorage.setItem(r,JSON.stringify({token:e,me:n}))},isLoggedIn:function(){return!!sessionStorage.DSSession},logout:function(){sessionStorage.removeItem(r)}};function i(e){var n={exports:{}};return e(n,n.exports),n.exports}var a=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;function c(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var s=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var n={},t=0;t<10;t++)n["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(n).map(function(e){return n[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,n){for(var t,r,o=c(e),i=1;i<arguments.length;i++){for(var s in t=Object(arguments[i]))u.call(t,s)&&(o[s]=t[s]);if(a){r=a(t);for(var f=0;f<r.length;f++)l.call(t,r[f])&&(o[r[f]]=t[r[f]])}}return o},f=i(function(e,n){var t=60103,r=60106;n.Fragment=60107,n.StrictMode=60108,n.Profiler=60114;var o=60109,i=60110,a=60112;n.Suspense=60113;var u=60115,l=60116;if("function"==typeof Symbol&&Symbol.for){var c=Symbol.for;t=c("react.element"),r=c("react.portal"),n.Fragment=c("react.fragment"),n.StrictMode=c("react.strict_mode"),n.Profiler=c("react.profiler"),o=c("react.provider"),i=c("react.context"),a=c("react.forward_ref"),n.Suspense=c("react.suspense"),u=c("react.memo"),l=c("react.lazy")}var f="function"==typeof Symbol&&Symbol.iterator;function d(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,t=1;t<arguments.length;t++)n+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p={};function v(e,n,t){this.props=e,this.context=n,this.refs=p,this.updater=t||h}function m(){}function y(e,n,t){this.props=e,this.context=n,this.refs=p,this.updater=t||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,n){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(d(85));this.updater.enqueueSetState(this,e,n,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},m.prototype=v.prototype;var g=y.prototype=new m;g.constructor=y,s(g,v.prototype),g.isPureReactComponent=!0;var b={current:null},C=Object.prototype.hasOwnProperty,k={key:!0,ref:!0,__self:!0,__source:!0};function S(e,n,r){var o,i={},a=null,u=null;if(null!=n)for(o in void 0!==n.ref&&(u=n.ref),void 0!==n.key&&(a=""+n.key),n)C.call(n,o)&&!k.hasOwnProperty(o)&&(i[o]=n[o]);var l=arguments.length-2;if(1===l)i.children=r;else if(1<l){for(var c=Array(l),s=0;s<l;s++)c[s]=arguments[s+2];i.children=c}if(e&&e.defaultProps)for(o in l=e.defaultProps)void 0===i[o]&&(i[o]=l[o]);return{$$typeof:t,type:e,key:a,ref:u,props:i,_owner:b.current}}function _(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}var w=/\/+/g;function N(e,n){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var n={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return n[e]})}(""+e.key):n.toString(36)}function O(e,n,o,i,a){var u=typeof e;"undefined"!==u&&"boolean"!==u||(e=null);var l=!1;if(null===e)l=!0;else switch(u){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case t:case r:l=!0}}if(l)return a=a(l=e),e=""===i?"."+N(l,0):i,Array.isArray(a)?(o="",null!=e&&(o=e.replace(w,"$&/")+"/"),O(a,n,o,"",function(e){return e})):null!=a&&(_(a)&&(a=function(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}(a,o+(!a.key||l&&l.key===a.key?"":(""+a.key).replace(w,"$&/")+"/")+e)),n.push(a)),1;if(l=0,i=""===i?".":i+":",Array.isArray(e))for(var c=0;c<e.length;c++){var s=i+N(u=e[c],c);l+=O(u,n,o,s,a)}else if(s=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=f&&e[f]||e["@@iterator"])?e:null}(e),"function"==typeof s)for(e=s.call(e),c=0;!(u=e.next()).done;)l+=O(u=u.value,n,o,s=i+N(u,c++),a);else if("object"===u)throw n=""+e,Error(d(31,"[object Object]"===n?"object with keys {"+Object.keys(e).join(", ")+"}":n));return l}function P(e,n,t){if(null==e)return e;var r=[],o=0;return O(e,r,"","",function(e){return n.call(t,e,o++)}),r}function E(e){if(-1===e._status){var n=e._result;n=n(),e._status=0,e._result=n,n.then(function(n){0===e._status&&(n=n.default,e._status=1,e._result=n)},function(n){0===e._status&&(e._status=2,e._result=n)})}if(1===e._status)return e._result;throw e._result}var j={current:null};function R(){var e=j.current;if(null===e)throw Error(d(321));return e}var x={ReactCurrentDispatcher:j,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:b,IsSomeRendererActing:{current:!1},assign:s};n.Children={map:P,forEach:function(e,n,t){P(e,function(){n.apply(this,arguments)},t)},count:function(e){var n=0;return P(e,function(){n++}),n},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!_(e))throw Error(d(143));return e}},n.Component=v,n.PureComponent=y,n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=x,n.cloneElement=function(e,n,r){if(null==e)throw Error(d(267,e));var o=s({},e.props),i=e.key,a=e.ref,u=e._owner;if(null!=n){if(void 0!==n.ref&&(a=n.ref,u=b.current),void 0!==n.key&&(i=""+n.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in n)C.call(n,c)&&!k.hasOwnProperty(c)&&(o[c]=void 0===n[c]&&void 0!==l?l[c]:n[c])}var c=arguments.length-2;if(1===c)o.children=r;else if(1<c){l=Array(c);for(var f=0;f<c;f++)l[f]=arguments[f+2];o.children=l}return{$$typeof:t,type:e.type,key:i,ref:a,props:o,_owner:u}},n.createContext=function(e,n){return void 0===n&&(n=null),(e={$$typeof:i,_calculateChangedBits:n,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},n.createElement=S,n.createFactory=function(e){var n=S.bind(null,e);return n.type=e,n},n.createRef=function(){return{current:null}},n.forwardRef=function(e){return{$$typeof:a,render:e}},n.isValidElement=_,n.lazy=function(e){return{$$typeof:l,_payload:{_status:-1,_result:e},_init:E}},n.memo=function(e,n){return{$$typeof:u,type:e,compare:void 0===n?null:n}},n.useCallback=function(e,n){return R().useCallback(e,n)},n.useContext=function(e,n){return R().useContext(e,n)},n.useDebugValue=function(){},n.useEffect=function(e,n){return R().useEffect(e,n)},n.useImperativeHandle=function(e,n,t){return R().useImperativeHandle(e,n,t)},n.useLayoutEffect=function(e,n){return R().useLayoutEffect(e,n)},n.useMemo=function(e,n){return R().useMemo(e,n)},n.useReducer=function(e,n,t){return R().useReducer(e,n,t)},n.useRef=function(e){return R().useRef(e)},n.useState=function(e){return R().useState(e)},n.version="17.0.2"}),d=i(function(e,n){"production"!==process.env.NODE_ENV&&function(){var e=s,t=60103,r=60106;n.Fragment=60107,n.StrictMode=60108,n.Profiler=60114;var o=60109,i=60110,a=60112;n.Suspense=60113;var u=60120,l=60115,c=60116,f=60121,d=60122,h=60117,p=60129,v=60131;if("function"==typeof Symbol&&Symbol.for){var m=Symbol.for;t=m("react.element"),r=m("react.portal"),n.Fragment=m("react.fragment"),n.StrictMode=m("react.strict_mode"),n.Profiler=m("react.profiler"),o=m("react.provider"),i=m("react.context"),a=m("react.forward_ref"),n.Suspense=m("react.suspense"),u=m("react.suspense_list"),l=m("react.memo"),c=m("react.lazy"),f=m("react.block"),d=m("react.server.block"),h=m("react.fundamental"),m("react.scope"),m("react.opaque.id"),p=m("react.debug_trace_mode"),m("react.offscreen"),v=m("react.legacy_hidden")}var y="function"==typeof Symbol&&Symbol.iterator;function g(e){if(null===e||"object"!=typeof e)return null;var n=y&&e[y]||e["@@iterator"];return"function"==typeof n?n:null}var b={current:null},C={current:null},k={},S=null;function _(e){S=e}k.setExtraStackFrame=function(e){S=e},k.getCurrentStack=null,k.getStackAddendum=function(){var e="";S&&(e+=S);var n=k.getCurrentStack;return n&&(e+=n()||""),e};var w={ReactCurrentDispatcher:b,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:C,IsSomeRendererActing:{current:!1},assign:e};function N(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r<n;r++)t[r-1]=arguments[r];P("warn",e,t)}function O(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r<n;r++)t[r-1]=arguments[r];P("error",e,t)}function P(e,n,t){var r=w.ReactDebugCurrentFrame.getStackAddendum();""!==r&&(n+="%s",t=t.concat([r]));var o=t.map(function(e){return""+e});o.unshift("Warning: "+n),Function.prototype.apply.call(console[e],console,o)}w.ReactDebugCurrentFrame=k;var E={};function j(e,n){var t=e.constructor,r=t&&(t.displayName||t.name)||"ReactClass",o=r+"."+n;E[o]||(O("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",n,r),E[o]=!0)}var R={isMounted:function(e){return!1},enqueueForceUpdate:function(e,n,t){j(e,"forceUpdate")},enqueueReplaceState:function(e,n,t,r){j(e,"replaceState")},enqueueSetState:function(e,n,t,r){j(e,"setState")}},x={};function T(e,n,t){this.props=e,this.context=n,this.refs=x,this.updater=t||R}Object.freeze(x),T.prototype.isReactComponent={},T.prototype.setState=function(e,n){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,n,"setState")},T.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var A={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},I=function(e,n){Object.defineProperty(T.prototype,e,{get:function(){N("%s(...) is deprecated in plain JavaScript React classes. %s",n[0],n[1])}})};for(var $ in A)A.hasOwnProperty($)&&I($,A[$]);function D(){}function F(e,n,t){this.props=e,this.context=n,this.refs=x,this.updater=t||R}D.prototype=T.prototype;var L=F.prototype=new D;function B(e){return e.displayName||"Context"}function M(e){if(null==e)return null;if("number"==typeof e.tag&&O("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case n.Fragment:return"Fragment";case r:return"Portal";case n.Profiler:return"Profiler";case n.StrictMode:return"StrictMode";case n.Suspense:return"Suspense";case u:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case i:return B(e)+".Consumer";case o:return B(e._context)+".Provider";case a:return h=(d=e.render).displayName||d.name||"",e.displayName||(""!==h?"ForwardRef("+h+")":"ForwardRef");case l:return M(e.type);case f:return M(e._render);case c:var t=e._payload,s=e._init;try{return M(s(t))}catch(e){return null}}var d,h;return null}L.constructor=F,e(L,T.prototype),L.isPureReactComponent=!0;var U,z,q,Y=Object.prototype.hasOwnProperty,V={key:!0,ref:!0,__self:!0,__source:!0};function K(e){if(Y.call(e,"ref")){var n=Object.getOwnPropertyDescriptor(e,"ref").get;if(n&&n.isReactWarning)return!1}return void 0!==e.ref}function H(e){if(Y.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return void 0!==e.key}function W(e,n){var t=function(){U||(U=!0,O("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",n))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function J(e,n){var t=function(){z||(z=!0,O("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",n))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}function G(e){if("string"==typeof e.ref&&C.current&&e.__self&&C.current.stateNode!==e.__self){var n=M(C.current.type);q[n]||(O('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',n,e.ref),q[n]=!0)}}q={};var X=function(e,n,r,o,i,a,u){var l={$$typeof:t,type:e,key:n,ref:r,props:u,_owner:a,_store:{}};return Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(l,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(l,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l};function Q(e,n,t){var r,o={},i=null,a=null,u=null,l=null;if(null!=n)for(r in K(n)&&(a=n.ref,G(n)),H(n)&&(i=""+n.key),u=void 0===n.__self?null:n.__self,l=void 0===n.__source?null:n.__source,n)Y.call(n,r)&&!V.hasOwnProperty(r)&&(o[r]=n[r]);var c=arguments.length-2;if(1===c)o.children=t;else if(c>1){for(var s=Array(c),f=0;f<c;f++)s[f]=arguments[f+2];Object.freeze&&Object.freeze(s),o.children=s}if(e&&e.defaultProps){var d=e.defaultProps;for(r in d)void 0===o[r]&&(o[r]=d[r])}if(i||a){var h="function"==typeof e?e.displayName||e.name||"Unknown":e;i&&W(o,h),a&&J(o,h)}return X(e,i,a,u,l,C.current,o)}function Z(n,t,r){if(null==n)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+n+".");var o,i,a=e({},n.props),u=n.key,l=n.ref,c=n._self,s=n._source,f=n._owner;if(null!=t)for(o in K(t)&&(l=t.ref,f=C.current),H(t)&&(u=""+t.key),n.type&&n.type.defaultProps&&(i=n.type.defaultProps),t)Y.call(t,o)&&!V.hasOwnProperty(o)&&(a[o]=void 0===t[o]&&void 0!==i?i[o]:t[o]);var d=arguments.length-2;if(1===d)a.children=r;else if(d>1){for(var h=Array(d),p=0;p<d;p++)h[p]=arguments[p+2];a.children=h}return X(n.type,u,l,c,s,f,a)}function ee(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}var ne=!1,te=/\/+/g;function re(e){return e.replace(te,"$&/")}function oe(e,n){return"object"==typeof e&&null!==e&&null!=e.key?(t={"=":"=0",":":"=2"},"$"+(""+e.key).replace(/[=:]/g,function(e){return t[e]})):n.toString(36);var t}function ie(e,n,o,i,a){var u=typeof e;"undefined"!==u&&"boolean"!==u||(e=null);var l,c,s,f=!1;if(null===e)f=!0;else switch(u){case"string":case"number":f=!0;break;case"object":switch(e.$$typeof){case t:case r:f=!0}}if(f){var d=e,h=a(d),p=""===i?"."+oe(d,0):i;if(Array.isArray(h)){var v="";null!=p&&(v=re(p)+"/"),ie(h,n,v,"",function(e){return e})}else null!=h&&(ee(h)&&(l=h,c=o+(!h.key||d&&d.key===h.key?"":re(""+h.key)+"/")+p,h=X(l.type,c,l.ref,l._self,l._source,l._owner,l.props)),n.push(h));return 1}var m=0,y=""===i?".":i+":";if(Array.isArray(e))for(var b=0;b<e.length;b++)m+=ie(s=e[b],n,o,y+oe(s,b),a);else{var C=g(e);if("function"==typeof C){var k=e;C===k.entries&&(ne||N("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),ne=!0);for(var S,_=C.call(k),w=0;!(S=_.next()).done;)m+=ie(s=S.value,n,o,y+oe(s,w++),a)}else if("object"===u){var O=""+e;throw Error("Objects are not valid as a React child (found: "+("[object Object]"===O?"object with keys {"+Object.keys(e).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}}return m}function ae(e,n,t){if(null==e)return e;var r=[],o=0;return ie(e,r,"","",function(e){return n.call(t,e,o++)}),r}function ue(e){if(-1===e._status){var n=(0,e._result)(),t=e;t._status=0,t._result=n,n.then(function(n){if(0===e._status){var t=n.default;void 0===t&&O("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",n);var r=e;r._status=1,r._result=t}},function(n){if(0===e._status){var t=e;t._status=2,t._result=n}})}if(1===e._status)return e._result;throw e._result}function le(e){return"string"==typeof e||"function"==typeof e||e===n.Fragment||e===n.Profiler||e===p||e===n.StrictMode||e===n.Suspense||e===u||e===v||"object"==typeof e&&null!==e&&(e.$$typeof===c||e.$$typeof===l||e.$$typeof===o||e.$$typeof===i||e.$$typeof===a||e.$$typeof===h||e.$$typeof===f||e[0]===d)}function ce(){var e=b.current;if(null===e)throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");return e}var se,fe,de,he,pe,ve,me,ye=0;function ge(){}ge.__reactDisabledLog=!0;var be,Ce=w.ReactCurrentDispatcher;function ke(e,n,t){if(void 0===be)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);be=r&&r[1]||""}return"\n"+be+e}var Se,_e=!1,we="function"==typeof WeakMap?WeakMap:Map;function Ne(n,t){if(!n||_e)return"";var r,o=Se.get(n);if(void 0!==o)return o;_e=!0;var i,a=Error.prepareStackTrace;Error.prepareStackTrace=void 0,i=Ce.current,Ce.current=null,function(){if(0===ye){se=console.log,fe=console.info,de=console.warn,he=console.error,pe=console.group,ve=console.groupCollapsed,me=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ge,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}ye++}();try{if(t){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(u,[])}catch(e){r=e}Reflect.construct(n,[],u)}else{try{u.call()}catch(e){r=e}n.call(u.prototype)}}else{try{throw Error()}catch(e){r=e}n()}}catch(e){if(e&&r&&"string"==typeof e.stack){for(var l=e.stack.split("\n"),c=r.stack.split("\n"),s=l.length-1,f=c.length-1;s>=1&&f>=0&&l[s]!==c[f];)f--;for(;s>=1&&f>=0;s--,f--)if(l[s]!==c[f]){if(1!==s||1!==f)do{if(s--,--f<0||l[s]!==c[f]){var d="\n"+l[s].replace(" at new "," at ");return"function"==typeof n&&Se.set(n,d),d}}while(s>=1&&f>=0);break}}}finally{_e=!1,Ce.current=i,function(){if(0==--ye){var n={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:e({},n,{value:se}),info:e({},n,{value:fe}),warn:e({},n,{value:de}),error:e({},n,{value:he}),group:e({},n,{value:pe}),groupCollapsed:e({},n,{value:ve}),groupEnd:e({},n,{value:me})})}ye<0&&O("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=a}var h=n?n.displayName||n.name:"",p=h?ke(h):"";return"function"==typeof n&&Se.set(n,p),p}function Oe(e,n,t){return Ne(e,!1)}function Pe(e,t,r){if(null==e)return"";if("function"==typeof e)return Ne(e,function(e){var n=e.prototype;return!(!n||!n.isReactComponent)}(e));if("string"==typeof e)return ke(e);switch(e){case n.Suspense:return ke("Suspense");case u:return ke("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case a:return Oe(e.render);case l:return Pe(e.type,t,r);case f:return Oe(e._render);case c:var o=e._payload,i=e._init;try{return Pe(i(o),t,r)}catch(e){}}return""}Se=new we;var Ee,je={},Re=w.ReactDebugCurrentFrame;function xe(e){if(e){var n=e._owner,t=Pe(e.type,e._source,n?n.type:null);Re.setExtraStackFrame(t)}else Re.setExtraStackFrame(null)}function Te(e){if(e){var n=e._owner;_(Pe(e.type,e._source,n?n.type:null))}else _(null)}function Ae(){if(C.current){var e=M(C.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}function Ie(e){return null!=e&&void 0!==(n=e.__source)?"\n\nCheck your code at "+n.fileName.replace(/^.*[\\\/]/,"")+":"+n.lineNumber+".":"";var n}Ee=!1;var $e={};function De(e,n){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var t=function(e){var n=Ae();if(!n){var t="string"==typeof e?e:e.displayName||e.name;t&&(n="\n\nCheck the top-level render call using <"+t+">.")}return n}(n);if(!$e[t]){$e[t]=!0;var r="";e&&e._owner&&e._owner!==C.current&&(r=" It was passed a child from "+M(e._owner.type)+"."),Te(e),O('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,r),Te(null)}}}function Fe(e,n){if("object"==typeof e)if(Array.isArray(e))for(var t=0;t<e.length;t++){var r=e[t];ee(r)&&De(r,n)}else if(ee(e))e._store&&(e._store.validated=!0);else if(e){var o=g(e);if("function"==typeof o&&o!==e.entries)for(var i,a=o.call(e);!(i=a.next()).done;)ee(i.value)&&De(i.value,n)}}function Le(e){var n,t=e.type;if(null!=t&&"string"!=typeof t){if("function"==typeof t)n=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==a&&t.$$typeof!==l)return;n=t.propTypes}if(n){var r=M(t);!function(e,n,t,r,o){var i=Function.call.bind(Object.prototype.hasOwnProperty);for(var a in e)if(i(e,a)){var u=void 0;try{if("function"!=typeof e[a]){var l=Error((r||"React class")+": prop type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}u=e[a](n,a,r,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){u=e}!u||u instanceof Error||(xe(o),O("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",t,a,typeof u),xe(null)),u instanceof Error&&!(u.message in je)&&(je[u.message]=!0,xe(o),O("Failed %s type: %s",t,u.message),xe(null))}}(n,e.props,"prop",r,e)}else void 0===t.PropTypes||Ee||(Ee=!0,O("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",M(t)||"Unknown"));"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||O("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Be(e){for(var n=Object.keys(e.props),t=0;t<n.length;t++){var r=n[t];if("children"!==r&&"key"!==r){Te(e),O("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),Te(null);break}}null!==e.ref&&(Te(e),O("Invalid attribute `ref` supplied to `React.Fragment`."),Te(null))}function Me(e,r,o){var i=le(e);if(!i){var a="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var u,l=Ie(r);a+=l||Ae(),null===e?u="null":Array.isArray(e)?u="array":void 0!==e&&e.$$typeof===t?(u="<"+(M(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):u=typeof e,O("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",u,a)}var c=Q.apply(this,arguments);if(null==c)return c;if(i)for(var s=2;s<arguments.length;s++)Fe(arguments[s],e);return e===n.Fragment?Be(c):Le(c),c}var Ue=!1;try{var ze=Object.freeze({});new Map([[ze,null]]),new Set([ze])}catch(e){}var qe=Me,Ye={map:ae,forEach:function(e,n,t){ae(e,function(){n.apply(this,arguments)},t)},count:function(e){var n=0;return ae(e,function(){n++}),n},toArray:function(e){return ae(e,function(e){return e})||[]},only:function(e){if(!ee(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};n.Children=Ye,n.Component=T,n.PureComponent=F,n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=w,n.cloneElement=function(e,n,t){for(var r=Z.apply(this,arguments),o=2;o<arguments.length;o++)Fe(arguments[o],r.type);return Le(r),r},n.createContext=function(e,n){void 0===n?n=null:null!==n&&"function"!=typeof n&&O("createContext: Expected the optional second argument to be a function. Instead received: %s",n);var t={$$typeof:i,_calculateChangedBits:n,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null};t.Provider={$$typeof:o,_context:t};var r=!1,a=!1,u=!1,l={$$typeof:i,_context:t,_calculateChangedBits:t._calculateChangedBits};return Object.defineProperties(l,{Provider:{get:function(){return a||(a=!0,O("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),t.Provider},set:function(e){t.Provider=e}},_currentValue:{get:function(){return t._currentValue},set:function(e){t._currentValue=e}},_currentValue2:{get:function(){return t._currentValue2},set:function(e){t._currentValue2=e}},_threadCount:{get:function(){return t._threadCount},set:function(e){t._threadCount=e}},Consumer:{get:function(){return r||(r=!0,O("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),t.Consumer}},displayName:{get:function(){return t.displayName},set:function(e){u||(N("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",e),u=!0)}}}),t.Consumer=l,t._currentRenderer=null,t._currentRenderer2=null,t},n.createElement=qe,n.createFactory=function(e){var n=Me.bind(null,e);return n.type=e,Ue||(Ue=!0,N("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(n,"type",{enumerable:!1,get:function(){return N("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),n},n.createRef=function(){var e={current:null};return Object.seal(e),e},n.forwardRef=function(e){null!=e&&e.$$typeof===l?O("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?O("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&O("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null==e.defaultProps&&null==e.propTypes||O("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"));var n,t={$$typeof:a,render:e};return Object.defineProperty(t,"displayName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t,null==e.displayName&&(e.displayName=t)}}),t},n.isValidElement=ee,n.lazy=function(e){var n,t,r={$$typeof:c,_payload:{_status:-1,_result:e},_init:ue};return Object.defineProperties(r,{defaultProps:{configurable:!0,get:function(){return n},set:function(e){O("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=e,Object.defineProperty(r,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return t},set:function(e){O("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(r,"propTypes",{enumerable:!0})}}}),r},n.memo=function(e,n){le(e)||O("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e);var t,r={$$typeof:l,type:e,compare:void 0===n?null:n};return Object.defineProperty(r,"displayName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(n){t=n,null==e.displayName&&(e.displayName=n)}}),r},n.useCallback=function(e,n){return ce().useCallback(e,n)},n.useContext=function(e,n){var t=ce();if(void 0!==n&&O("useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",n,"number"==typeof n&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://reactjs.org/link/rules-of-hooks":""),void 0!==e._context){var r=e._context;r.Consumer===e?O("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&O("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return t.useContext(e,n)},n.useDebugValue=function(e,n){return ce().useDebugValue(e,n)},n.useEffect=function(e,n){return ce().useEffect(e,n)},n.useImperativeHandle=function(e,n,t){return ce().useImperativeHandle(e,n,t)},n.useLayoutEffect=function(e,n){return ce().useLayoutEffect(e,n)},n.useMemo=function(e,n){return ce().useMemo(e,n)},n.useReducer=function(e,n,t){return ce().useReducer(e,n,t)},n.useRef=function(e){return ce().useRef(e)},n.useState=function(e){return ce().useState(e)},n.version="17.0.2"}()}),p=i(function(e){e.exports="production"===process.env.NODE_ENV?f:d}),v=function(e){var n=e.size,t=e.clickable,r=e.action;return h("i",{className:"icon "+(void 0===n?"normal":n)+" "+(void 0!==t&&t?"clickable":"")+" material-icons",onClick:function(e){e.stopPropagation(),e.preventDefault(),r&&r()}},e.icon)},m=function(e){var n=e.label,t=e.icon,r=e.action,o=e.disabled,i=void 0!==o&&o,a=e.raised?"raised":e.outlined?"outlined":"normal";return i&&(a+=" disabled"),h("button",{className:"btn "+a,onClick:function(e){i||(e.stopPropagation(),e.preventDefault(),r&&r())}},t?h(v,{icon:t,size:"small"}):null,h("span",null,n))},y=React.createContext({}),g=function(e){var n=e.children,t=p.useContext(y);if(t){var r=t.dictionary,o=(void 0===r?{}:r)[n],i=o?o[t.lang]:n;return i?h("span",null,i):""}return n?h("span",null,n):""},b=function(e){var n=e.id,t=e.label,r=e.placeholder,o=e.value,i=e.onChange;function a(e){i&&i(n,e.target.checked)}var u=h(g,null,t);return console.log(t,o),!0===o?h("div",{className:"checkbox",key:n+"1"},h("input",{id:n,type:"checkbox",placeholder:r,checked:!0,value:o,onChange:a}),h("span",{class:"checkmark"}),h("label",{htmlFor:n},u)):h("div",{className:"checkbox",key:n+"0"},h("input",{id:n,type:"checkbox",placeholder:r,value:o,onChange:a}),h("span",{class:"checkmark"}),h("label",{htmlFor:n},u))},C=function(e){var n=e.id,t=e.icon,r=e.label,o=e.action,i=e.onSelect,a=e.outlined?"outlined":"normal";return e.selected&&(a+=" selected"),h("div",{className:"chip "+a,onClick:function(e){e.stopPropagation(),e.preventDefault(),i&&i(n)}},t?h(v,{icon:t,size:"small"}):null,h("main",null,h(g,null,r)),o?h("span",{className:"meta"},o):null)},k=function(e){return h("div",{className:"chips"},e.children)},S=function(e){var n=e.title,t=e.columns,r=void 0===t?1:t,o=e.children,i=e.outlined,a=e.onChange,u=p.useState([]),l=u[0],c=u[1],s=function(e){return null==e||""===e};p.useEffect(function(){var e=p.Children.toArray(o).filter(function(e){return null!==e&&""!==e}).map(function(e){var n=e.props,t=n.id,r=n.value,o=n.required,i=void 0!==o&&o,a=n.validation,u=!i||(a?a(r):!s(r));return{id:t,value:r,required:i,validation:a,valid:u}}).filter(function(e){return void 0!==e.id});c(e)},[]),p.useEffect(function(){if(a){var e=l.every(function(e){return!0===e.valid}),n=l.reduce(function(e,n){var t=n.value;return(t||!1===t)&&(e[n.id]=t),e},{});a(n,e)}},[l]);var f=function(e,n){var t=l.find(function(n){return n.id===e});if(t){var r=!t.required||(t.validation?t.validation(n):!s(n));Object.assign(t,{value:n,valid:r}),c(l.slice())}},d=p.Children.toArray(o).filter(function(e){return null!==e&&""!==e}).map(function(e){var n=e.props.span,t=void 0===n?1:n,r=p.cloneElement(e,{onChange:f,outlined:!!i});return h(_,{style:{gridColumn:"span "+t}},r)}),v={gridTemplateColumns:"repeat("+r+", 1fr)"};return h(p.Fragment,null,n?h("header",{className:"form-header"},h(g,{use:"headline6"},n)):"",h("form",{className:"form-grid",style:v},d))},_=function(e){return h("div",{className:"field-wrapper",style:e.style},e.children)},w=function(e){var n=e.caption?"caption":"",t=e.prominent?"prominent":"",r=e.dense?"dense":"",o=e.primary?"primary":"";o=e.secondary?"secondary":o;var i=e.icon?h(v,{icon:e.icon,clickable:e.clickable,action:e.action}):"";i=e.iconSrc?h("img",{className:"header-icon",src:e.iconSrc}):i;var a=e.img?{backgroundImage:"url("+e.img+")"}:{},u=h(g,null,e.title);return h("header",{className:"header "+n+" "+t+" "+r+" "+o+" "+e.className,style:a},i,e.title?h("label",null,u):null,h("span",{className:"actions"},e.children))};function N(){return N=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},N.apply(this,arguments)}var O=function(e){var n=e.items,t=void 0===n?[]:n,r=e.children,o=e.onSelect;function i(e){o&&o(e)}return e.groupBy?h(P,N({},e,{onSelect:i})):h("div",{className:"list"},h("ul",null,t.map(function(e){return h(E,{key:e.id,item:e,onSelect:i})})),r)},P=function(e){var n=e.items,t=e.children,r=e.onSelect,o=e.groupBy,i=(void 0===n?[]:n).reduce(function(e,n){var t=e.find(function(e){return e.name===n.content[o]});return t||e.push(t={name:n.content[o],items:[]}),t.items.push(n),e},[]);return h("div",{className:"list"},i.map(function(e){return h(p.Fragment,{key:e.name},h("header",{key:e.name+"-header"},h(g,null,e.name)),h("ul",{key:e.name+"-ul"},e.items.map(function(e){return h(E,{key:e.id,item:e,onSelect:r})})))}),t)},E=function(e){var n=e.item,t=e.onSelect,r=n.id,o=n.icon,i=n.line1,a=n.line2,u=n.meta;return h("li",{id:r,onClick:function(){t&&t(r)}},o?h(v,{icon:o,size:"small"}):null,h("main",null,h("div",{className:"primary-line"},h(g,null,i)),a?h("div",{className:"secondary-line"},h(g,null,a)):null),u?h("div",{className:"meta"},u):null)},j=p.createContext({}),R=function(e){return h("ul",null,e.children)},x=function(e){var n=e.icon,t=void 0===n?"more_vert":n,r=e.children,o=e.align,i=p.useState(!1),a=i[0],u=i[1];function l(){u(!a)}return h(j.Provider,{value:[a,u]},h("div",{className:"menu-icon"},h(v,{icon:t,clickable:!0,action:l}),a?h("menu",{className:""+o},r):null,a?h("div",{className:"overlay",onClick:l}):null))},T=function(e){var n=e.icon,t=e.label,r=e.meta,o=e.onSelect,i=p.useContext(j)[1];return h("li",{className:"menu-item",onClick:function(){o&&o(),i(!1)}},n?h(v,{icon:n}):null,h("label",null,t),r?h("div",{className:"meta"},r):null)},A=function(e){return h("li",null,"menuSeparator")},I=function(e){return h("div",{className:"circular-progress"},h(v,{icon:"refresh",size:"small"}))},$=function(e){var n=e.progress,t=e.max;return h("div",{className:"linear-progress"},h("progress",{value:void 0===n?0:n,max:void 0===t?100:t}))},D=function(e){var n=e.value;return h("div",{className:"property"},h("div",{className:"property-name"},e.name),h("div",{className:"property-value"},n))},F=function(e){var n=e.id,t=e.name,r=e.placeholder,o=e.value,i=e.onChange,a=h(g,null,e.label);return h("div",{className:"radio"},h("input",{id:n,name:t,type:"radio",placeholder:r,value:o,onClick:function(e){i&&i(n,e.target.value)}}),h("span",{class:"checkmark"}),h("label",{htmlFor:n},a))},L=function(e){var n=e.icon,t=e.title,r=void 0===t?"":t,o=e.canCollapse,i=void 0===o||o,a=e.open,u=void 0!==a&&a,l=e.actions,c=e.children,s=e.className,f=p.useState(u),d=f[0],m=f[1];return p.useEffect(function(){m(u)},[u]),h("section",{className:"section2 "+s},h(w,{icon:{icon:n},title:r},l,i?h(v,{icon:"expand_more",onIcon:"expand_less",clickable:!0,action:function(){m(!u)}}):""),d?h("main",null,c):"")},B=function(e){var n=e.selected,t=e.onChange,r=p.Children.map(e.children,function(e,r){return p.cloneElement(e,{selected:r===n,onSelect:function(){t&&t(r)}})});return h("div",{class:"tabs"},r,h("div",{class:"tab-filler"}))},M=function(e){var n=e.onSelect;return h("div",{className:"tab "+(e.selected?"selected":""),onClick:function(){n&&n()}},e.label,e.actions||null)},U=function(e){var n=e.selected,t=void 0===n?0:n,r=p.Children.toArray(e.children).filter(function(e,n){return n===t})[0];return h(p.Fragment,null,r)},z=function(e){var n=p.useContext(y),t=e.id,r=e.type,o=void 0===r?"text":r,i=e.label,a=e.placeholder,u=e.value,l=e.readOnly,c=void 0!==l&&l,s=e.onChange,f=e.onEnter,d=e.onClick,v=(i?"":"no-label")+" "+(e.outlined?"textfield-outlined":"textfield"),m=h(g,null,i);return h("div",{className:""+v,onClick:d},h("input",{id:t,type:o,placeholder:a,value:u,required:!0,onChange:function(e){e.stopPropagation(),e.preventDefault(),s&&s(t,e.target.value)},onKeyDown:function(e){13==(e.charCode?e.charCode:e.keyCode?e.keyCode:0)&&f()},onFocus:function(){n&&n.changeFocus({lose:function(){}})},readOnly:c}),h("span",{className:"bar"}),i?h("label",null,m):null)},q=function(e){var n=p.useContext(y),t=e.id,r=e.options,o=void 0===r?[]:r,i=e.value,a=e.onChange,u=p.useState(!1),l=u[0],c=u[1],s=p.useState(),f=s[0],d=s[1];function m(){n&&n.changeFocus({lose:function(){c(!1)}}),c(!l)}return p.useEffect(function(){if(Array.isArray(o)){var e=o.find(function(e){return e.value===i});e&&d(e.label)}},[i]),h("div",{className:"dropdown"},h(z,N({},e,{onClick:m,value:f})),h(v,{icon:"expand_more",clickable:!0,size:"small",action:m}),1==l?h("menu",null,h("ul",{onClick:function(e){var n=e.target.getAttribute("value"),r=o.find(function(e){return e.value===n});a&&a(t,n),d(r.label),c(!1)}},Array.isArray(o)?o.map(function(e){return h("li",{key:e.value,value:e.value},e.label)}):null)):null)},Y=function(e){var n=e.columns,t=void 0===n?[]:n,r=e.rows,o=void 0===r?[]:r,i=e.onRowSelection,a=e.onSort,u=e.editable,l=e.outlined,c=p.useState({})[0];function s(e,n){i&&i(e,n)}function f(e,n){a&&a(e,n)}return h("div",{className:"datatable8 "+(l?"outlined":"")},h("table",null,h("thead",null,h("tr",null,t.map(function(e){var n=e.sortable;return h("th",null,h(g,null,e.label),n?h(v,{icon:"arrow_up",size:"small",clickable:!0}):null)}))),h("tbody",null,function(e,n){void 0===n&&(n={});var t=Object.keys(n);if(!t.length)return e;var r=function(e,n,t){return t=null!==t?t:1,e===n?0:e>n?t:-1*t};return e.sort(function(e,o){for(var i=0,a=0;0===i&&a<t.length;){var u=t[a];u&&(i=r(e[u],o[u],n[u]),a++)}return i})}(o,c).map(function(e){return h(V,{key:e.id,row:e,columns:t,onSelect:s,onDrop:f,editable:u})}))))},V=function(e){var n,t=e.row,r=e.columns,o=void 0===r?[]:r,i=e.onSelect,a=e.editable,u=p.useState(!1),l=u[0],c=u[1],s=l?"expand_more":"expand_less";return h(p.Fragment,null,h("tr",{onClick:function(e){return i(t,e)}},o.map(function(e){return h(K,{row:t,column:e,cell:t[e.id],editable:a})}),t.info?h(v,{icon:s,clickable:!0,action:function(){return c(!l)}}):null),t.info&&l?h("tr",{className:"table-row-info"},(n=t.info)&&("[object Function]"===Object.prototype.toString.call(n)||"function"==typeof n||n instanceof Function)?t.info():t.info):null)},K=function(e){var n=e.row,t=e.column,r=e.cell,o=e.editable;return h("td",{className:t.id},function(e){var i=t.id,a=t.disabled,u=void 0!==a&&a,l=t.min,c=t.max,s=t.onChange,f=t.options;if(o&&s)switch(e){case"ICON":return h(v,{icon:r});case"BOOLEAN":case"Boolean":return h(b,{id:i,value:r,onChange:function(e,t){return s(n.id,e,t)},disabled:u});case"SELECTION":return h(q,{id:i,value:r,placeholder:"--Select--",options:f,onChange:function(e,t){return s(n.id,e,t)}});case"CHECK":return h(b,{id:i,value:r,onChange:function(e,t){return s(n.id,e,t)},disabled:n.disabled});case"CHECKABLE":return r&&r.value?h(b,{id:i,value:r.checked||!1,label:r.value,onChange:function(e,t){return s(n.id,e,r.value,t,r)}}):"";case"TEXTFIELD":return h(z,{id:i,value:r,onChange:function(e,t){return s(n.id,e,t)}});case"String":return h(J,{id:i,value:r,options:f,onChange:function(e,t){return s(n.id,e,t)}});case"Number":return h(z,{id:i,type:"number",value:r,min:l,max:c,onChange:function(e,t){return s(n.id,e,t)}});default:return r}else switch(e){case"ICON":return h(v,{icon:r});case"Boolean":return h(H,{id:i,value:r});case"String":return h(W,{id:i,value:r,options:f});default:return r}}(t.type))},H=function(e){var n=e.value;return h(v,{icon:!0===(void 0!==n&&n)?"check_box":"check_box_outline_blank"})},W=function(e){var n=e.value,t=e.options,r=t?t.find(function(e){return e.value===n}):null;return h("div",{className:"field-editor string-editor"},r?r.label:n)},J=function(e){var n=e.id,t=e.value,r=void 0===t?"":t,o=e.options,i=e.onChange;function a(e,n){i&&i(e,n)}return h("div",{className:"field-editor string-editor"},o?h(q,{outlined:!0,id:n,value:r,onChange:a,options:o}):h(z,{outlined:!0,id:n,value:r,onChange:a}))},G=function(e){var n=e.id,t=e.label,r=e.init,o=e.onChange,i=p.useRef(!1),a=p.useState(),u=a[0],l=a[1],c=p.useState(r),s=c[0],f=c[1];return p.useEffect(function(){i.current?o&&s&&o(n,s):i.current=!0},[s]),h("div",{className:"tokenField"},h("label",null,t),s.map(function(e,n){return h(X,{text:e,onDelete:function(){return function(e){var n=s.slice();n.splice(e,1),f(n)}(n)}})}),h("input",{type:"text",value:u,onChange:function(e){l(e.target.value)},onKeyDown:function(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();var n=s.concat(e.target.value);f(n),l("")}if(""===u&&s.length>0&&"Backspace"===e.key){var t=s.slice(0,-1);f(t)}}}))},X=function(e){var n=e.onDelete;return h("div",{className:"token"},h(g,{use:"caption",tag:"div"},e.text),h(v,{icon:"close",clickable:!0,action:n,size:"small"}))},Q=function(e){var n=e.nodes;return h("div",{className:"tree"},void 0===n?[]:n,e.children)},Z=function(e){var n=e.icon,t=void 0===n?"folder":n,r=e.label,o=e.open,i=e.children,a=e.actions;return h("details",{className:"tree-node",open:void 0!==o&&o},h("summary",{className:"tree-item"},t?h(v,{icon:t,size:"small",small:!0}):null,h("div",{className:"label"},r),h("div",{className:"actions"},a)),i)},ee=function(e){var n=e.id,t=e.icon,r=e.label,o=e.actions,i=e.onSelect;return h("div",{className:"tree-item final",onClick:function(){i&&i(n)}},h(v,{icon:void 0===t?"description":t,size:"small",small:!0}),h("div",{className:"label"},r),h("div",{className:"actions"},o))},ne=function(e){var n=e.logo,t=e.title,r=e.userLabel,o=void 0===r?"User":r,i=e.passwordLabel,a=void 0===i?"Password":i,u=e.loginLabel,l=void 0===u?"Log In":u,c=e.onOK,s=e.forgotLabel,f=void 0===s?"Forgot Password ?":s,d=e.onForgot,y=e.message,b=e.loading,C=p.useState(""),k=C[0],S=C[1],_=p.useState(""),w=_[0],N=_[1];function O(){return k&&k.length>0&&w&&w.length>0}function P(e){c&&O()&&c(k,e||w)}function E(e){return h(g,null,e)}return h("div",{className:"login-box"},h("header",null,n?h("img",{src:n}):"",h("div",{className:"title"},h(g,null,t))),h("main",null,h(z,{label:E(o),value:k,onChange:function(e,n){S(n)},onEnter:P,outlined:!0}),h(z,{label:E(a),value:w,onChange:function(e,n){N(n)},onEnter:P,type:"password",outlined:!0})),h("footer",null,d?h(m,{label:E(f),action:function(){d&&d(k)},disabled:!(k&&k.length>0)}):null,b?h("div",{className:"load-box"},h(v,{icon:"refresh"})):h(m,{label:E(l),action:P,disabled:!O(),raised:!0}),y?h("div",{className:"message"},h(g,null,y)):null))},te=function(e){var n=e.logo,t=e.title,r=e.children,o=e.onOK,i=e.onClose,a=p.useState({}),u=a[0],l=a[1],c=p.useState(),s=c[0],f=c[1];function d(){return u.password1&&u.password2}function v(e,n){var t,r=Object.assign({},u,((t={})[e]=n,t));l(r)}function y(){o&&d()&&(u.password1===u.password2?(f(null),o(u)):f("New Password and Confirm New Password do not match"))}return h("div",{className:"reset-password-box"},h("header",null,n?h("img",{src:n}):null,t?h("div",{className:"title"},h(g,null,t)):null,r),h("main",null,h(g,{use:"headline6"},"Change Password"),h(z,{id:"password1",outlined:!0,icon:"lock",type:"password",label:"New Password",lapse:100,onChange:v,onEnter:y}),h(z,{id:"password2",outlined:!0,icon:"lock",type:"password",label:"Confirm New Password",lapse:100,onChange:v,onEnter:y}),s?h("div",{className:"error"},s):null),h("footer",null,h(m,{label:"Close",action:function(){i&&i()}}),h(m,{label:"OK",raised:!0,disabled:!d(),action:y})))},re=function(e){var n=e.title,t=e.src,r=e.info,o=e.actions,i=void 0===o?[]:o,a=e.tools,u=void 0!==a&&a,l=e.onClose,c=p.useState(!1),s=c[0],f=c[1];function d(){f(!s)}var m=h(g,{use:"headline6"},n);return h("div",{className:"viewer"},h(w,{icon:{icon:"close",clickable:!0,action:l},title:m},s?"":h(v,{icon:"info",clickable:!0,action:d}),i),h("main",null,h("div",{className:"resizer"},h("picture",null,h("img",{src:t})))),h("aside",{className:s?"open":""},h(w,{title:"Detalles"},h(v,{icon:"close",clickable:!0,action:d})),h("main",null,r)),u?h("footer",null,h(v,{clickable:!0,icon:"zoom_out"}),h(v,{clickable:!0,icon:"zoom_out_map"}),h(v,{clickable:!0,icon:"zoom_in"})):null)},oe=function(e){return h("div",{className:"kanban"},e.children)},ie=function(e){var n=e.id,t=e.icon,r=e.title,o=e.subtitle,i=e.badge,a=e.children,u=e.minified,l=e.disabled,c=void 0!==l&&l,s=p.useState(void 0!==u&&u),f=s[0],d=s[1];function m(){d(!f)}return f?h("div",{className:"kanban-column "+n+" min"},h("main",null,r),h("footer",null,h(v,{icon:"toggle_off",onIcon:"toggle_on",clickable:!0,action:m}))):h("div",{className:"kanban-column "+n+" "+(c?"disabled":"")},h("header",null,h(v,{icon:t}),h("div",{className:"title"},h(g,{use:"headline6"},r),h(g,{className:"secondary-text",use:"body2"},o)),h("div",{className:"badge"},i)),h("main",null,a),h("footer",null,h(v,{icon:"toggle_off",onIcon:"toggle_on",clickable:!0,action:m})))},ae=function(e){return h("div",{className:"kanban-card "+e.color},e.children)},ue=p.createContext({}),le=function(e){var n=e.context,t=e.children,r=p.useState(void 0===n?{}:n);return h(ue.Provider,{value:[r[0],r[1]]},t)},ce=function(e){var n=e.layout,t=e.context;return h(le,{context:void 0===t?{}:t},h("article",{className:"page6 "+(void 0===n?"simple":n)},e.children))},se=function(e){var n=e.children,t=e.siteDictionary,r=p.useState(e.siteLang),o=r[0],i=r[1],a=p.useState(t),u=a[0],l=a[1],c=p.useState("max"),s=c[0],f=c[1],d=p.useState(!1),v=d[0],m=d[1],g=p.useState(null),b=g[0],C=g[1],k=p.useState(!1),S=k[0],_=k[1],w=p.useState(),N=w[0],O=w[1],P=p.useState(),E=P[0],j=P[1],R=p.useState(),x=R[0],T=R[1],A=p.useState(),I=A[0],$=A[1],D=p.useState(),F=D[0],L=D[1],B={lang:o,setLang:i,dictionary:u,setDictionary:l,focused:F,changeFocus:function(e){F&&F.lose(),L(e)},sideNav:s,setSideNav:f,showNav:v,setShowNav:m,info:b,openInfo:function(e){C(e)},closeInfo:function(){C(null)},console:S,toggleConsole:function(){_(!S)},breadcrumb:I,setBreadcrumb:$,page:N,goto:function(e){O(e)},dialog:E,openDialog:function(e){j(e)},closeDialog:function(){j(null)},preview:x,openPreview:function(e){T(e)},closePreview:function(){T(null)}};return h(y.Provider,{value:B},n)},fe=function(e){var n=e.logo,t=e.title,r=e.toolbar,o=e.children,i=e.init,a=e.min;return h(se,{siteLang:e.lang,siteDictionary:e.dictionary},h("div",{className:"site6"},h(de,{icon:e.icon}),h(he,null,r),h(ve,{logo:n,title:t,min:a},o),h(me,{init:i},o,h(ce,{id:"EMPTY"},"EMPTY")),h(pe,null),h(be,null),h(ye,null),h(ge,null)))},de=function(e){var n=e.icon;return h(w,{icon:void 0===n?"equalizer":n,title:e.title})},he=function(e){var n=e.children;return p.useContext(y),h("nav",null,n)},pe=function(){var e=p.useContext(y);return e.info?h("aside",null,e.info):""},ve=function(e){var n=e.children,t=e.min,r=p.useContext(y),o=r.showNav;p.useEffect(function(){t&&r.setSideNav("min")},[]);var i=n?p.Children.toArray(n).reduce(function(e,n){var t=n.props?n.props.section:"...";e[t]||(e[t]=[]);var r=n.props,o=r.title;return o&&e[t].push({id:r.id,icon:r.icon,title:o}),e},{}):{};return h("menu",{className:"min "+(o?"show":"")},h("main",null,Object.keys(i).map(function(e){return h(p.Fragment,{key:e},i[e].map(function(e){var n=e.id,t=e.icon;return h(v,{key:n,icon:void 0===t?"info":t,clickable:!0,checked:n===r.page,action:function(){return function(e){r.setShowNav(!1),r.goto(e)}(n)}})}),h("div",{className:"section-divider"}))})))},me=function(e){var n=e.children,t=e.init,r=p.useContext(y),o=r.page;return p.useEffect(function(){r.goto(t||"EMPTY")},[]),h("main",null,p.Children.toArray(n).filter(function(e){return!!e.props&&e.props.id===o}))},ye=function(){var e=p.useContext(y);return e.dialog?e.dialog:""},ge=function(){var e=p.useContext(y);return e.preview?h("div",{className:"site-preview"},e.preview):""},be=function(){return p.useContext(y).console?h("footer",{className:"site-console"},h(w,null,h(B,null,h(M,{label:"Console"}))),h("main",null)):""},Ce=function(e){var n=p.useContext(y),t=e.icon,r=e.title,o=void 0===r?"Dialog":r,i=e.children,a=e.actions;return h(p.Fragment,null,h("div",{className:"overlay"}),h("div",{className:"dialog",onClick:function(){n.closeDialog()}},h("div",{className:"dialog-panel",onClick:function(e){e.preventDefault(),e.stopPropagation()}},h("header",null,t?h(x,{icon:t}):null,h(g,null,o)),h("main",null,i),h("footer",null,a))))},ke={STRING:"String",NUMBER:"Number",DATE:"Date",BOOLEAN:"Boolean",ARRAY:"Array",ENTITY:"Object",FUNCTION:"Function",EMAIL:"String"},Se=Object.values(ke).reduce(function(e,n){return e["is"+n]=function(e){return toString.call(e)=="[object "+n+"]"},e},{}),_e=/*#__PURE__*/function(){function e(e){this._schema=e}var n=e.prototype;return n.checkType=function(n,t){var r=n.type,o=n.item,i=!0,a=!0;if(o){var u=new e(o);switch(r){case ke.ARRAY:i=Se["is"+r](t),a=t.every(function(e){return u.validate(e)});break;case ke.ENTITY:i=Se["is"+r](t),a=u.validate(t);break;case ke.NUMBER:i=Se["is"+r](t.value),a=!0;break;default:i=!0,a=!0}}return i&&a},n.validate=function(e){var n=this;return Object.entries(this._schema).filter(function(e){return!0===e[1].required}).every(function(t){var r=t[0];return void 0!==e[r]&&n.checkType(t[1],e[r])})},n.form=function(e){return Object.entries(this._schema).reduce(function(n,t){var r=t[0];return n[r]=Object.assign({},t[1],{value:e[r]}),n},{})},n.sections=function(e){var n=this.form(e),t=Object.values(n).reduce(function(e,n){var t=n.section||"";return e.hasOwnProperty(t)||(e[t]={title:t,fields:[]}),e[t].fields.push(n),e},{});return Object.values(t)},n.value=function(n){return Object.entries(this._schema).reduce(function(t,r){var o=r[0],i=r[1],a=i.item,u=n?n[o]:null;switch(i.type){case ke.STRING:case ke.NUMBER:case ke.BOOLEAN:t[o]=u||i.default;break;case ke.ENTITY:var l=new e(a);t[o]=l.value(u);break;case ke.ARRAY:if(a===ke.STRING)t[o]=u||[];else{var c=new e(a);t[o]=u?u.map(function(e){return c.value(e)}):[]}break;default:t[o]=i}return t},{})},e}(),we=/*#__PURE__*/function(){function e(e,n){this.type=e,this._type=new _e(e),this._value=n}var n=e.prototype;return n.isValid=function(){return this._type.validate(this._value)},n.value=function(){return this._type.value(this._value)},n.form=function(){return this._type.form(this._value)},n.sections=function(){return this._type.sections(this._value)},n.update=function(e){this._value=e},e}(),Ne=function(e){var n=e.columns,t=void 0===n?1:n,r=e.filter,o=e.onChange,i=e.content.form();console.log(i);var a=Object.keys(i).map(function(e){return i[e]}).filter(function(e){return!r||r(e)});return console.log(a),h(S,{className:"content-form",columns:t,outlined:!0,onChange:o},a.map(function(e){return h(Oe,N({key:e.id},e))}))},Oe=function(e){switch(e.type){case ke.BOOLEAN:return h(b,N({key:e.id},e));case ke.NUMBER:return h(Ee,N({key:e.id},e));default:return h(Pe,N({key:e.id},e))}},Pe=function(e){var n,t=e.id,r=e.type,o=e.label,i=e.options,a=e.textarea,u=e.required,l=void 0!==u&&u,c=e.value,s=e.onChange,f=e.outlined,d=((n={})[ke.NUMBER]="number",n[ke.DATE]="date",n)[r]||"text";return i?h(q,{key:t,id:t,label:o,value:c,onChange:s,options:"function"==typeof i?i():i,outlined:f}):h(z,{key:t,id:t,type:d,label:o,value:c,onChange:s,required:l,outlined:f,textarea:a})},Ee=function(e){var n=e.id,t=e.label,r=e.options,o=e.required,i=void 0!==o&&o,a=e.value,u=e.onChange,l=e.outlined;function c(e,n){u&&u(e,+n?+n:n)}return r?h(q,{key:n,id:n,label:t,value:a,onChange:c,options:r,outlined:l}):h(z,{key:n,id:n,type:"number",label:t,value:a,onChange:c,required:i,outlined:l})},je=function(e){var n=e.content,t=e.filter,r=e.onChange;function o(e,t){var o,i=Object.assign({},n.value(),((o={})[e]=t,o));r&&r(i)}var i=n.sections();return h("div",{className:"content-editor"},i.map(function(e){var r=e.title,i=e.fields;return h("section",{key:r},h("header",null,r),h("main",null,i.filter(function(e){return"id"!==e.id}).filter(function(e){return!t||t(e,n)}).map(function(e){return h(Te,{key:e.id,field:e,onChange:o})})))}))},Re=function(e){var n=e.content,t=e.filter,r=e.grouped,o=void 0!==r&&r,i=e.onChange,a=p.useState(0),u=a[0],l=a[1];function c(e,t){var r,o=Object.assign({},n.value(),((r={})[e]=t,r));i&&i(o)}var s=n.sections();return h("div",{className:"content-editor tabbed"},h(B,{selected:u,onChange:function(e){l(e)}},s.map(function(e){return h(M,{label:e.title})})),h(U,{selected:u},s.map(function(e){var r=e.fields;return h("section",{key:e.title},h("nav",null," "),h("main",null,o?function(e){var n=e.fields,t=(void 0===n?[]:n).reduce(function(e,n){var t=n.group||"",r=e[t]||{name:t,fields:[]};return r.fields.push(n),e[t]=r,e},{});return Object.values(t)}(e).map(function(e){return h(p.Fragment,null,e.name.length>0?h("div",{className:"group-caption"},e.name):null,e.fields.filter(function(e){return"id"!==e.id}).filter(function(e){return!t||t(e)}).map(function(e){return h(Te,{key:e.id,field:e,onChange:c,content:n})}))}):r.filter(function(e){return"id"!==e.id}).filter(function(e){return!t||t(e)}).map(function(e){return h(Te,{key:e.id,field:e,onChange:c,content:n})})))})))},xe=function(e){var n=e.content,t=e.onChange,r=n.value(),o=Object.values(n.type).filter(function(e){return e.type===ke.ARRAY}),i=p.useState(),a=i[0],u=i[1];function l(){}return h("div",{className:"content-editor treeded-editor"},h("menu",null,h("header",null,h(g,{use:"caption"},"Tree Editor")),h(Q,null,o.map(function(e,n){return h(Z,{icon:"folder",label:e.label,actions:[h(v,{small:!0,icon:"add",clickable:!0,action:l})]},r[e.id]?r[e.id].map(function(n,t){return h(ee,{icon:n.icon||"description",label:n.name||n.label,onSelect:function(){return function(e,n,t){var o=new we(t.item,n);u({index:e,item:o,node:t,value:r[t.id]})}(t,n,e)}})}):null)}))),h("div",null,a?h(Re,{content:a.item,onChange:function(e){var n,o=a.value.slice();o[a.index]=e;var i=Object.assign({},r,((n={})[a.node.id]=o,n));t&&t(i)}}):"select"))},Te=function(e){var n=e.field,t=e.onChange,r=e.content,o=e.outlined,i=void 0!==o&&o,a=n.id,u=n.type,l=n.item,c=n.label,s=n.editable,f=n.options;function d(e,n){t&&t(e,n)}return function(){var e=n.value?n.value:n.default;switch(u){case ke.ENTITY:return h(Ae,{field:n,value:e,onChange:d});case ke.STRING:return h(Ie,{outlined:i,field:n,value:e,onChange:d,content:r});case ke.BOOLEAN:return h(b,{outlined:!0,id:a,label:c,value:e,onChange:d});case ke.DATE:return h(z,{outlined:i,id:a,type:"date",label:c,value:e,onChange:d,disabled:s});case ke.NUMBER:return h($e,{outlined:i,field:n,value:e,onChange:d});case ke.ARRAY:return l===ke.STRING?f?h(Fe,{content:r,field:n,value:e,onChange:d}):h(De,{field:n,value:e,onChange:d}):h(Le,{field:n,value:e,onChange:d});default:return h("div",null,c)}}()},Ae=function(e){var n=e.field,t=e.value,r=e.onChange,o=n.id,i=n.label,a=new we(n.item,void 0===t?{}:t);function u(e,n){var t,i=Object.assign({},a.value(),((t={})[e]=n,t));r&&r(o,i)}var l=a.form(),c=Object.keys(l).map(function(e){return l[e]});return h("div",{className:"entity-editor"},h("header",null,h(g,{use:"caption"},i)),h("main",null,c.map(function(e){return h(Te,{key:e.id,field:e,onChange:u})})))},Ie=function(e){var n=e.field,t=e.value,r=void 0===t?"":t,o=e.onChange,i=e.outlined,a=n.id,u=n.label,l=n.options,c=n.editable;function s(e,n){o&&o(e,n)}return h("div",{className:"field-editor string-editor"},void 0===c||c?l?h(q,{outlined:i,id:a,label:u,value:r,onChange:s,options:"function"==typeof l?l(n,e.content):l}):h(z,{outlined:i,id:a,label:u,value:r,onChange:s}):h(z,{outlined:i,id:a,label:u,value:r,onChange:s,readOnly:!0}))},$e=function(e){var n=e.field,t=e.onChange,r=n.editable;return h("div",{className:"field-editor number-editor"},h(z,{outlined:!0,id:n.id,label:n.label,type:"NUMBER",value:e.value||n.default,max:n.max,min:n.min,onChange:function(e,n){t&&t(e,n)},disabled:!(void 0===r||r)}))},De=function(e){var n=e.field,t=e.value,r=e.onChange;return h("div",{className:"list-editor"},h(G,{id:n.id,label:n.label,init:void 0===t?[]:t,onChange:function(e,n){r&&r(e,n)}}))},Fe=function(e){var n=e.field,t=e.value,r=void 0===t?[]:t,o=e.content,i=e.onChange,a=n.id,u=n.options;return h("div",{className:"multiselection-editor"},h("label",null,n.label),("function"==typeof u?u(n,o):u).map(function(e){var n=r.includes(e.value);return h(b,{value:n,label:e.label,onChange:function(){return(t=r.indexOf(n=e.value))>=0?r.splice(t,1):r.push(n),void(i&&i(a,r));var n,t}})}))},Le=function(e){var n=e.field,t=e.value,r=void 0===t?[]:t,o=e.onChange,i=n.id,a=n.item,u=n.label,l=n.Feeder,c=n.Renderer,s=n.Adder,f=void 0===s||s,d=n.editable,p=void 0===d||d;function m(e){if(o){var n=r.concat(e);o(i,n)}}function y(e){if(o){var n=r.filter(function(n,t){return t!==e});o(i,n)}}function b(e,n,t){if(o){var a=r.slice();a[e][n]=t,o(i,a)}}var C=Object.values(a).map(function(e){return N({},e,{onChange:b})});C.push({id:"actions",label:"Actions"});var k=r.map(function(e,n){return N({},e,{id:n,actions:[h(v,{icon:"delete",clickable:!0,action:function(){return y(n)},small:!0})]})}),S={columns:C,rows:k};return h("div",{className:"collection-editor"},h("header",null,h(g,{use:"caption"},u),h("div",{className:"actions"},l?h(l,{onAdd:m}):null)),c?h(c,{field:n,value:r,onRemove:y,onChange:o}):h(Y,N({},S,{editable:p})),h("footer",null,f?h(Be,{item:a,onAdd:m}):null))},Be=function(e){var n=e.item,t=e.onAdd,r=p.useState(!1),o=r[0],i=r[1],a=p.useState({}),u=a[0],l=a[1];function c(){i(!o)}function s(e,n,r){if(t){var o,i=Object.assign({},u,((o={})[n]=r,o));l(i)}}var f=Object.values(n).map(function(e){return N({},e,{type:"String",onChange:s})});f.push({id:"actions",label:""});var d=[{actions:[h(v,{icon:"done",clickable:!0,action:function(){t&&t([u]),c()}}),h(v,{icon:"close",clickable:!0,action:c})]}];return d[0]=Object.assign({},u,d[0]),h("div",{className:"collection-adder"},o?h(Y,N({},{columns:f,rows:d},{editable:!0})):h(m,{icon:"add",label:"Add",action:c}))},Me=function(e){var n=e.label,t=e.type,r=e.validator,o=e.onOK,i=e.onActionClose,a=void 0===i||i,u=p.useContext(y),l=p.useState({}),c=l[0],s=l[1],f=p.useState(!1),d=f[0],v=f[1],b=p.useState([]),C=b[0],k=b[1];function S(e){"OK"===e&&o&&o(c),"CLOSE"!==e&&!0!==a||u.closeDialog()}var _=h(p.Fragment,null,h(m,{label:"CLOSE",action:function(){return S("CLOSE")}}),h(m,{label:"OK",action:function(){return S("OK")},disabled:!d,raised:!0})),w=h(g,{use:"headline6"},n),N=new we(t,c);return h(Ce,{title:w,open:!0,onAction:S,actions:_},h(Ne,{content:N,filter:function(e){return function(e){var n=e.required;return void 0!==n&&n}(e)||function(e){var n=e.creation;return void 0!==n&&n}(e)},onChange:function(e,n){if(s(e),r){var t=r(e),o=t.errors,i=void 0===o?[]:o;v(n&&t.validation),k(i)}else v(n)}}),C.map(function(e){return h(g,{use:"overline",tag:"div",className:"error"},e)}))},Ue=function(e){var n=e.label,t=e.type,r=e.value,o=void 0===r?{}:r,i=e.filter,a=e.validator,u=e.onOK,l=p.useContext(y),c=p.useState(o),s=c[0],f=c[1],d=p.useState(!1),v=d[0],b=d[1],C=p.useState([]),k=C[0],S=C[1];function _(e){"OK"===e&&u&&u(Object.assign({},o,s)),l.closeDialog()}var w=h(p.Fragment,null,h(m,{label:"CLOSE",action:function(){return _("CLOSE")}}),h("div",{className:"expand"}),h(m,{label:"OK",action:function(){return _("OK")},disabled:!v,raised:!0})),N=h(g,{use:"headline6"},n),O=new we(t,s);return h(Ce,{title:N,open:!0,onAction:_,actions:w},h(je,{content:O,onChange:function(e){if(f(e),a){var n=a(e),t=n.errors,r=void 0===t?[]:t;b(n.validation),S(r)}else b(!0)},filter:i}),k.map(function(e){return h(g,{use:"overline",tag:"div",className:"error"},e)}))};function ze(e,n){try{var t=e()}catch(e){return n(e)}return t&&t.then?t.then(void 0,n):t}var qe=t(window.API||process.env.REACT_APP_API,o),Ye=function(e){var n=p.useContext(y),t=e.id,r=void 0===t?"collection":t,o=e.icon,i=e.title,a=e.name,u=void 0===a?"Collection 1":a,l=e.schema,c=e.url,s=e.groupBy,f=e.editor,d=e.field,v=e.autosave,b=void 0!==v&&v,C=e.delay,k=void 0===C?1e3:C,S=e.actions,_=e.levels,N=p.useContext(ue),O=N[0],P=N[1],E=We(c,d);return p.useEffect(function(){try{return Promise.resolve(E.load()).then(function(){P(E)})}catch(e){return Promise.reject(e)}},[]),h(p.Fragment,null,h(w,{className:"collection-page",title:h(g,null,i)},h(m,{icon:"add",label:"Add",action:function(){n.openDialog(h(Ue,{label:"Crear "+u,type:l,onOK:function(e){try{return Promise.resolve(O.create(e)).then(function(){P(Object.assign({},O))})}catch(e){return Promise.reject(e)}}}))}}),h(m,{icon:"refresh",label:"Reload",action:function(){try{return Promise.resolve(O.load()).then(function(){P(Object.assign({},O))})}catch(e){return Promise.reject(e)}}}),S),h("menu",{className:"collection-page"},h(w,{title:h(g,null,"Lista de ",u)}),_?h(Ke,{levels:_}):h(Ve,{groupBy:s})),h("main",{key:r,className:"collection-page"},h(He,{icon:o,schema:l,layout:f,autosave:b,delay:k})))},Ve=function(e){var n=e.groupBy,t=p.useContext(ue),r=t[0],o=t[1],i=r.all,a=void 0===i?[]:i,u=a?a.map(function(e){return{id:e.id,line1:e.name,line2:e.description,content:e}}):[];return h(O,{items:u,onSelect:function(e){try{return r.clear(),o(Object.assign({},r)),Promise.resolve(r.select(e)).then(function(){o(Object.assign({},r))})}catch(e){return Promise.reject(e)}},groupBy:n})},Ke=function(e){var n=function(e){try{return o.clear(),i(Object.assign({},o)),Promise.resolve(o.select(e)).then(function(){i(Object.assign({},o))})}catch(e){return Promise.reject(e)}},t=e.levels,r=p.useContext(ue),o=r[0],i=r[1],a=o.all,u=function e(n,t){var r=function(e,n){return e.reduce(function(e,t){var r=e.find(function(e){return e.name===t[n]});return r||e.push(r={name:t[n],items:[],field:n}),r.items.push(t),e},[])}(t,n[0]);return n.length>1&&r.forEach(function(t){return t.nodes=e(n.slice(1),t.items)}),r}(t,void 0===a?[]:a);return h("main",null,h(Q,null,function e(t){return t.map(function(t){return h(Z,{key:t.name,icon:null,label:"boolean"==typeof t.name?t.field+" = "+t.name:t.name,open:!0},t.nodes?e(t.nodes):t.items.map(function(e){return h(ee,{key:e.id,id:e.id,label:e.name,onSelect:n},"item")}))})}(u)))},He=function(n){var t=function(){try{return console.log("saving....."),Promise.resolve(o.update(k)).then(function(){i(Object.assign({},o))})}catch(e){return Promise.reject(e)}},r=p.useContext(ue),o=r[0],i=r[1],a=o.selected,u=n.icon,l=n.schema,c=n.layout,s=n.autosave,f=void 0!==s&&s,d=n.delay,y=void 0===d?1e3:d,b=p.useRef(null),C=p.useState(a),k=C[0],S=C[1];function _(e){S(e)}function O(){return!e(k,a)}return p.useEffect(function(){S(a)},[a]),p.useEffect(function(){f&&(clearTimeout(b.current),b.current=setTimeout(function(){O()&&t()},y))},[k]),a&&k?h(p.Fragment,null,h(w,{icon:u,title:h(g,null,a.name)},h(v,{icon:"close",clickable:!0,action:function(){o.clear(),i(Object.assign({},o))}}),h(x,{align:"alignRight"},h(R,null,h(T,{label:"Eliminar",onSelect:function(){try{return Promise.resolve(o.remove(a.id)).then(function(){o.clear(),i(Object.assign({},o))})}catch(e){return Promise.reject(e)}}}))),!0===f?null:h(m,{icon:"save",label:"Guardar Cambios",raised:!0,disabled:!O(),action:t})),function(){var e=new we(l,k);switch(c){case"TABBED":return h(Re,N({},n,{content:e,onChange:_}));case"TREEDED":return h(xe,N({},n,{content:e,onChange:_}));default:return h(je,N({},n,{content:e,onChange:_}))}}()):null},We=function(e,n){var t=Je(e);return{all:[],selected:null,load:function(){try{var e=this,r=ze(function(){return Promise.resolve(t.all()).then(function(t){e.all=n?t[n]:t})},function(e){console.log(e)});return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},select:function(e){var n=this.all.find(function(n){return n.id===e});this.selected=n},clear:function(){this.selected=null},create:function(e){try{var n=this,r=ze(function(){return Promise.resolve(t.create(e)).then(function(){return Promise.resolve(n.load()).then(function(){})})},function(e){console.log("CREATE ERROR",e)});return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},update:function(e){try{var n=this,r=ze(function(){return Promise.resolve(t.update(e)).then(function(){return Promise.resolve(n.load()).then(function(){})})},function(e){console.log(e)});return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},patch:function(e,n){try{var r=this,o=ze(function(){return Promise.resolve(t.patch(e,n)).then(function(){return Promise.resolve(r.load()).then(function(){})})},function(e){console.log(e)});return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},updateProperty:function(e,n,r){try{var o=this,i=ze(function(){return Promise.resolve(t.updateProperty(e,n,r)).then(function(){return Promise.resolve(o.load()).then(function(){})})},function(e){console.log(e)});return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},remove:function(e){try{var n=this,r=ze(function(){return Promise.resolve(t.remove(e)).then(function(){return Promise.resolve(n.load()).then(function(){})})},function(e){console.log(e)});return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}}},Je=function(e){return{all:function(){return qe.GET(e)},find:function(n){return qe.GET(e+"/"+n)},create:function(n){var t=JSON.stringify(n);return qe.POST(e,t)},update:function(n){var t=JSON.stringify(n);return qe.PUT(e+"/"+n.id,t)},patch:function(n,t){var r=JSON.stringify(t);return qe.PATCH(e+"/"+n,r)},updateProperty:function(n,t,r){var o=JSON.stringify(r);return qe.PUT(e+"/"+n+"/"+t,o)},remove:function(n){return qe.DELETE(e+"/"+n)}}},Ge=function(e){return e&&("[object Function]"===Object.prototype.toString.call(e)||"function"==typeof e||e instanceof Function)};export{m as Button,b as CheckBox,C as Chip,k as Chips,I as CircularProgress,We as CollectionContext,Le as CollectionEditor,Ye as CollectionPage,we as Content,je as ContentEditor,Ne as ContentForm,Me as CreateContentDialog,Y as DataTable,Ce as Dialog,q as DropDown,Ue as EditContentDialog,Te as FieldEditor,S as Form,t as HTTPClient,w as Header,v as Icon,oe as Kanban,ae as KanbanCard,ie as KanbanColumn,$ as LinearProgress,O as List,De as ListEditor,ne as LoginBox,R as Menu,x as MenuIcon,T as MenuItem,A as MenuSeparator,ce as Page,ue as PageContext,le as PageProvider,D as Property,F as RadioButton,te as ResetPasswordBox,L as Section,o as Session,fe as Site,y as SiteContext,se as SiteProvider,U as Stack,ke as TYPES,M as Tab,Re as TabbedContentEditor,B as Tabs,g as Text,z as TextField,G as TokenField,Q as Tree,ee as TreeItem,Z as TreeNode,xe as TreededContentEditor,re as Viewer,Ge as isFunction};
1
+ import"material-design-icons-iconfont/dist/material-design-icons.css";import e,{useContext as n,useState as t,useEffect as i,Fragment as o,useRef as r,Children as l,useMemo as a}from"react";import c from"deep-equal";import u from"resumablejs";var s=function(e,n,t,i){void 0===t&&(t=null);try{console.log("FETCH",e,n);var o={method:e,mode:"cors",headers:{Accept:"application/json","Content-Type":"application/json","x-access-token":i},body:t};return Promise.resolve(function(e,t){try{var i=Promise.resolve(fetch(n,o)).then(function(e){var n;function t(t){if(n)return t;throw e}var i=function(){if(e.ok)return Promise.resolve(e.json()).then(function(e){return n=1,e})}();return i&&i.then?i.then(t):t(i)})}catch(e){return t(e)}return i&&i.then?i.then(void 0,t):i}(0,function(e){if(e instanceof Error)throw{error:e};return Promise.resolve(e.json()).then(function(e){throw{success:!1,message:e.message}})}))}catch(e){return Promise.reject(e)}},d=function(e,n){return{GET:function(t){var i=n?n.token():null;return s("GET",e+t,void 0,i)},POST:function(t,i){var o=n?n.token():null;return s("POST",e+t,i,o)},PUT:function(t,i){var o=n?n.token():null;return s("PUT",e+t,i,o)},PATCH:function(t,i){var o=n?n.token():null;return s("PATCH",e+t,i,o)},DELETE:function(t){var i=n?n.token():null;return s("DELETE",e+t,void 0,i)}}},f=process.env.REACT_APP_SESSION||window&&window.SESSION?window.SESSION:"YWANA-CORE6-SESSION",v={token:function(){return(sessionStorage.getItem(f)?JSON.parse(sessionStorage.getItem(f)):{}).token},me:function(){return(sessionStorage.getItem(f)?JSON.parse(sessionStorage.getItem(f)):{}).me},init:function(e,n){sessionStorage.setItem(f,JSON.stringify({token:e,me:n}))},refresh:function(e){var n=this.me();sessionStorage.setItem(f,JSON.stringify({token:e,me:n}))},isLoggedIn:function(){return!!sessionStorage.DSSession},logout:function(){sessionStorage.removeItem(f)}},m=function(e){var n=e.size,t=e.clickable,i=e.action;return h("i",{className:"icon "+(void 0===n?"normal":n)+" "+(void 0!==t&&t?"clickable":"")+" material-icons",onClick:function(e){e.stopPropagation(),e.preventDefault(),i&&i()}},e.icon)},p=function(e){var n=e.label,t=e.icon,i=e.action,o=e.disabled,r=void 0!==o&&o,l=e.raised?"raised":e.outlined?"outlined":"normal";return r&&(l+=" disabled"),h("button",{className:"btn "+l,onClick:function(e){r||(e.stopPropagation(),e.preventDefault(),i&&i())}},t?h(m,{icon:t,size:"small"}):null,h("span",null,n))},g=e.createContext({}),b=function(e){var t=e.children,i=n(g);if(i){var o=i.dictionary,r=(void 0===o?{}:o)[t],l=r?r[i.lang]:t;return l?h("span",null,l):""}return t?h("span",null,t):""},y=function(e){var n=e.id,t=e.label,i=e.placeholder,o=e.value,r=e.onChange;function l(e){r&&r(n,e.target.checked)}var a=h(b,null,t);return console.log(t,o),!0===o?h("div",{className:"checkbox",key:n+"1"},h("input",{id:n,type:"checkbox",placeholder:i,checked:!0,value:o,onChange:l}),h("span",{class:"checkmark"}),h("label",{htmlFor:n},a)):h("div",{className:"checkbox",key:n+"0"},h("input",{id:n,type:"checkbox",placeholder:i,value:o,onChange:l}),h("span",{class:"checkmark"}),h("label",{htmlFor:n},a))},N=function(e){var n=e.id,t=e.icon,i=e.label,o=e.action,r=e.onSelect,l=e.outlined?"outlined":"normal";return e.selected&&(l+=" selected"),h("div",{className:"chip "+l,onClick:function(e){e.stopPropagation(),e.preventDefault(),r&&r(n)}},t?h(m,{icon:t,size:"small"}):null,h("main",null,h(b,null,i)),o?h("span",{className:"meta"},o):null)},C=function(e){return h("div",{className:"chips"},e.children)},k=function(n){var r=n.title,l=n.columns,a=void 0===l?1:l,c=n.children,u=n.outlined,s=n.onChange,d=t([]),f=d[0],v=d[1],m=function(e){return null==e||""===e};i(function(){var n=e.Children.toArray(c).filter(function(e){return null!==e&&""!==e}).map(function(e){var n=e.props,t=n.id,i=n.value,o=n.required,r=void 0!==o&&o,l=n.validation,a=!r||(l?l(i):!m(i));return{id:t,value:i,required:r,validation:l,valid:a}}).filter(function(e){return void 0!==e.id});v(n)},[]),i(function(){if(s){var e=f.every(function(e){return!0===e.valid}),n=f.reduce(function(e,n){var t=n.value;return(t||!1===t)&&(e[n.id]=t),e},{});s(n,e)}},[f]);var p=function(e,n){var t=f.find(function(n){return n.id===e});if(t){var i=!t.required||(t.validation?t.validation(n):!m(n));Object.assign(t,{value:n,valid:i}),v(f.slice())}},g=e.Children.toArray(c).filter(function(e){return null!==e&&""!==e}).map(function(n){var t=n.props.span,i=void 0===t?1:t,o=e.cloneElement(n,{onChange:p,outlined:!!u});return h(O,{style:{gridColumn:"span "+i}},o)}),y={gridTemplateColumns:"repeat("+a+", 1fr)"};return h(o,null,r?h("header",{className:"form-header"},h(b,{use:"headline6"},r)):"",h("form",{className:"form-grid",style:y},g))},O=function(e){return h("div",{className:"field-wrapper",style:e.style},e.children)},P=function(e){var n=e.caption?"caption":"",t=e.prominent?"prominent":"",i=e.dense?"dense":"",o=e.primary?"primary":"";o=e.secondary?"secondary":o;var r=e.icon?h(m,{icon:e.icon,clickable:e.clickable,action:e.action}):"";r=e.iconSrc?h("img",{className:"header-icon",src:e.iconSrc}):r;var l=e.img?{backgroundImage:"url("+e.img+")"}:{},a=h(b,null,e.title);return h("header",{className:"header "+n+" "+t+" "+i+" "+o+" "+e.className,style:l},r,e.title?h("label",null,a):null,h("span",{className:"actions"},e.children))};function S(){return S=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},S.apply(this,arguments)}var E=function(e){var n=e.items,t=void 0===n?[]:n,i=e.children,o=e.onSelect;function r(e){o&&o(e)}return e.groupBy?h(w,S({},e,{onSelect:r})):h("div",{className:"list"},h("ul",null,t.map(function(e){return h(j,{key:e.id,item:e,onSelect:r})})),i)},w=function(e){var n=e.items,t=e.children,i=e.onSelect,r=e.groupBy,l=(void 0===n?[]:n).reduce(function(e,n){var t=e.find(function(e){return e.name===n.content[r]});return t||e.push(t={name:n.content[r],items:[]}),t.items.push(n),e},[]);return h("div",{className:"list"},l.map(function(e){return h(o,{key:e.name},h("header",{key:e.name+"-header"},h(b,null,e.name)),h("ul",{key:e.name+"-ul"},e.items.map(function(e){return h(j,{key:e.id,item:e,onSelect:i})})))}),t)},j=function(e){var n=e.item,t=e.onSelect,i=n.id,o=n.icon,r=n.line1,l=n.line2,a=n.meta;return h("li",{id:i,onClick:function(){t&&t(i)}},o?h(m,{icon:o,size:"small"}):null,h("main",null,h("div",{className:"primary-line"},h(b,null,r)),l?h("div",{className:"secondary-line"},h(b,null,l)):null),a?h("div",{className:"meta"},a):null)},A=e.createContext({}),T=function(e){return h("ul",null,e.children)},x=function(e){var n=e.icon,i=void 0===n?"more_vert":n,o=e.children,r=e.align,l=t(!1),a=l[0],c=l[1];function u(){c(!a)}return h(A.Provider,{value:[a,c]},h("div",{className:"menu-icon"},h(m,{icon:i,clickable:!0,action:u}),a?h("menu",{className:""+r},o):null,a?h("div",{className:"overlay",onClick:u}):null))},_=function(e){var t=e.icon,i=e.label,o=e.meta,r=e.onSelect,l=n(A)[1];return h("li",{className:"menu-item",onClick:function(){r&&r(),l(!1)}},t?h(m,{icon:t}):null,h("label",null,i),o?h("div",{className:"meta"},o):null)},D=function(e){return h("li",null,"menuSeparator")},I=function(e){return h("div",{className:"circular-progress"},h(m,{icon:"refresh",size:"small"}))},R=function(e){var n=e.progress,t=e.max;return h("div",{className:"linear-progress"},h("progress",{value:void 0===n?0:n,max:void 0===t?100:t}))},L=function(e){var n=e.value;return h("div",{className:"property"},h("div",{className:"property-name"},e.name),h("div",{className:"property-value"},n))},B=function(e){var n=e.id,t=e.name,i=e.placeholder,o=e.value,r=e.onChange,l=h(b,null,e.label);return h("div",{className:"radio"},h("input",{id:n,name:t,type:"radio",placeholder:i,value:o,onClick:function(e){r&&r(n,e.target.value)}}),h("span",{class:"checkmark"}),h("label",{htmlFor:n},l))},F=function(e){var n=e.icon,o=e.title,r=void 0===o?"":o,l=e.canCollapse,a=void 0===l||l,c=e.open,u=void 0!==c&&c,s=e.actions,d=e.children,f=e.className,v=t(u),p=v[0],g=v[1];return i(function(){g(u)},[u]),h("section",{className:"section2 "+f},h(P,{icon:{icon:n},title:r},s,a?h(m,{icon:"expand_more",onIcon:"expand_less",clickable:!0,action:function(){g(!u)}}):""),p?h("main",null,d):"")},z=function(n){var t=n.selected,i=n.onChange,o=e.Children.map(n.children,function(n,o){return e.cloneElement(n,{selected:o===t,onSelect:function(){i&&i(o)}})});return h("div",{class:"tabs"},o,h("div",{class:"tab-filler"}))},K=function(e){var n=e.onSelect;return h("div",{className:"tab "+(e.selected?"selected":""),onClick:function(){n&&n()}},e.label,e.actions||null)},U=function(n){var t=n.selected,i=void 0===t?0:t,r=e.Children.toArray(n.children).filter(function(e,n){return n===i})[0];return h(o,null,r)},Y=function(e){var t=n(g),i=e.id,o=e.type,r=void 0===o?"text":o,l=e.label,a=e.placeholder,c=e.value,u=e.readOnly,s=void 0!==u&&u,d=e.onChange,f=e.onEnter,v=e.onClick,m=(l?"":"no-label")+" "+(e.outlined?"textfield-outlined":"textfield"),p=h(b,null,l);return h("div",{className:""+m,onClick:v},h("input",{id:i,type:r,placeholder:a,value:c,required:!0,onChange:function(e){e.stopPropagation(),e.preventDefault(),d&&d(i,e.target.value)},onKeyDown:function(e){13==(e.charCode?e.charCode:e.keyCode?e.keyCode:0)&&f()},onFocus:function(){t&&t.changeFocus({lose:function(){}})},readOnly:s}),h("span",{className:"bar"}),l?h("label",null,p):null)},q=function(e){var o=n(g),r=e.id,l=e.options,a=void 0===l?[]:l,c=e.value,u=e.onChange,s=t(!1),d=s[0],f=s[1],v=t(),p=v[0],b=v[1];function y(){o&&o.changeFocus({lose:function(){f(!1)}}),f(!d)}return i(function(){if(Array.isArray(a)){var e=a.find(function(e){return e.value===c});e&&b(e.label)}},[c]),h("div",{className:"dropdown"},h(Y,S({},e,{onClick:y,value:p})),h(m,{icon:"expand_more",clickable:!0,size:"small",action:y}),1==d?h("menu",null,h("ul",{onClick:function(e){var n=e.target.getAttribute("value"),t=a.find(function(e){return e.value===n});u&&u(r,n),b(t.label),f(!1)}},Array.isArray(a)?a.map(function(e){return h("li",{key:e.value,value:e.value},e.label)}):null)):null)},M=function(e){var n=e.columns,i=void 0===n?[]:n,o=e.rows,r=void 0===o?[]:o,l=e.onRowSelection,a=e.onSort,c=e.editable,u=e.outlined,s=t({})[0];function d(e,n){l&&l(e,n)}function f(e,n){a&&a(e,n)}return h("div",{className:"datatable8 "+(u?"outlined":"")},h("table",null,h("thead",null,h("tr",null,i.map(function(e){var n=e.sortable;return h("th",null,h(b,null,e.label),n?h(m,{icon:"arrow_up",size:"small",clickable:!0}):null)}))),h("tbody",null,function(e,n){void 0===n&&(n={});var t=Object.keys(n);if(!t.length)return e;var i=function(e,n,t){return t=null!==t?t:1,e===n?0:e>n?t:-1*t};return e.sort(function(e,o){for(var r=0,l=0;0===r&&l<t.length;){var a=t[l];a&&(r=i(e[a],o[a],n[a]),l++)}return r})}(r,s).map(function(e){return h(G,{key:e.id,row:e,columns:i,onSelect:d,onDrop:f,editable:c})}))))},G=function(e){var n,i=e.row,r=e.columns,l=void 0===r?[]:r,a=e.onSelect,c=e.editable,u=t(!1),s=u[0],d=u[1],f=s?"expand_more":"expand_less";return h(o,null,h("tr",{onClick:function(e){return a(i,e)}},l.map(function(e){return h(J,{row:i,column:e,cell:i[e.id],editable:c})}),i.info?h(m,{icon:f,clickable:!0,action:function(){return d(!s)}}):null),i.info&&s?h("tr",{className:"table-row-info"},(n=i.info)&&("[object Function]"===Object.prototype.toString.call(n)||"function"==typeof n||n instanceof Function)?i.info():i.info):null)},J=function(e){var n=e.row,t=e.column,i=e.cell,o=e.editable;return h("td",{className:t.id},function(e){var r=t.id,l=t.disabled,a=void 0!==l&&l,c=t.min,u=t.max,s=t.onChange,d=t.options;if(o&&s)switch(e){case"ICON":return h(m,{icon:i});case"BOOLEAN":case"Boolean":return h(y,{id:r,value:i,onChange:function(e,t){return s(n.id,e,t)},disabled:a});case"SELECTION":return h(q,{id:r,value:i,placeholder:"--Select--",options:d,onChange:function(e,t){return s(n.id,e,t)}});case"CHECK":return h(y,{id:r,value:i,onChange:function(e,t){return s(n.id,e,t)},disabled:n.disabled});case"CHECKABLE":return i&&i.value?h(y,{id:r,value:i.checked||!1,label:i.value,onChange:function(e,t){return s(n.id,e,i.value,t,i)}}):"";case"TEXTFIELD":return h(Y,{id:r,value:i,onChange:function(e,t){return s(n.id,e,t)}});case"String":return h(W,{id:r,value:i,options:d,onChange:function(e,t){return s(n.id,e,t)}});case"Number":return h(Y,{id:r,type:"number",value:i,min:c,max:u,onChange:function(e,t){return s(n.id,e,t)}});default:return i}else switch(e){case"ICON":return h(m,{icon:i});case"Boolean":return h(H,{id:r,value:i});case"String":return h(V,{id:r,value:i,options:d});default:return i}}(t.type))},H=function(e){var n=e.value;return h(m,{icon:!0===(void 0!==n&&n)?"check_box":"check_box_outline_blank"})},V=function(e){var n=e.value,t=e.options,i=t?t.find(function(e){return e.value===n}):null;return h("div",{className:"field-editor string-editor"},i?i.label:n)},W=function(e){var n=e.id,t=e.value,i=void 0===t?"":t,o=e.options,r=e.onChange;function l(e,n){r&&r(e,n)}return h("div",{className:"field-editor string-editor"},o?h(q,{outlined:!0,id:n,value:i,onChange:l,options:o}):h(Y,{outlined:!0,id:n,value:i,onChange:l}))},X=function(e){var n=e.id,o=e.label,l=e.init,a=e.onChange,c=r(!1),u=t(),s=u[0],d=u[1],f=t(l),v=f[0],m=f[1];return i(function(){c.current?a&&v&&a(n,v):c.current=!0},[v]),h("div",{className:"tokenField"},h("label",null,o),v.map(function(e,n){return h(Q,{text:e,onDelete:function(){return function(e){var n=v.slice();n.splice(e,1),m(n)}(n)}})}),h("input",{type:"text",value:s,onChange:function(e){d(e.target.value)},onKeyDown:function(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();var n=v.concat(e.target.value);m(n),d("")}if(""===s&&v.length>0&&"Backspace"===e.key){var t=v.slice(0,-1);m(t)}}}))},Q=function(e){var n=e.onDelete;return h("div",{className:"token"},h(b,{use:"caption",tag:"div"},e.text),h(m,{icon:"close",clickable:!0,action:n,size:"small"}))},Z=function(e){var n=e.nodes;return h("div",{className:"tree"},void 0===n?[]:n,e.children)},$=function(e){var n=e.icon,t=void 0===n?"folder":n,i=e.label,o=e.open,r=e.children,l=e.actions;return h("details",{className:"tree-node",open:void 0!==o&&o},h("summary",{className:"tree-item"},t?h(m,{icon:t,size:"small",small:!0}):null,h("div",{className:"label"},i),h("div",{className:"actions"},l)),r)},ee=function(e){var n=e.id,t=e.icon,i=e.label,o=e.actions,r=e.onSelect;return h("div",{className:"tree-item final",onClick:function(){r&&r(n)}},h(m,{icon:void 0===t?"description":t,size:"small",small:!0}),h("div",{className:"label"},i),h("div",{className:"actions"},o))},ne=function(e){var n=e.logo,i=e.title,o=e.userLabel,r=void 0===o?"User":o,l=e.passwordLabel,a=void 0===l?"Password":l,c=e.loginLabel,u=void 0===c?"Log In":c,s=e.onOK,d=e.forgotLabel,f=void 0===d?"Forgot Password ?":d,v=e.onForgot,g=e.message,y=e.loading,N=t(""),C=N[0],k=N[1],O=t(""),P=O[0],S=O[1];function E(){return C&&C.length>0&&P&&P.length>0}function w(e){s&&E()&&s(C,e||P)}function j(e){return h(b,null,e)}return h("div",{className:"login-box"},h("header",null,n?h("img",{src:n}):"",h("div",{className:"title"},h(b,null,i))),h("main",null,h(Y,{label:j(r),value:C,onChange:function(e,n){k(n)},onEnter:w,outlined:!0}),h(Y,{label:j(a),value:P,onChange:function(e,n){S(n)},onEnter:w,type:"password",outlined:!0})),h("footer",null,v?h(p,{label:j(f),action:function(){v&&v(C)},disabled:!(C&&C.length>0)}):null,y?h("div",{className:"load-box"},h(m,{icon:"refresh"})):h(p,{label:j(u),action:w,disabled:!E(),raised:!0}),g?h("div",{className:"message"},h(b,null,g)):null))},te=function(e){var n=e.logo,i=e.title,o=e.children,r=e.onOK,l=e.onClose,a=t({}),c=a[0],u=a[1],s=t(),d=s[0],f=s[1];function v(){return c.password1&&c.password2}function m(e,n){var t,i=Object.assign({},c,((t={})[e]=n,t));u(i)}function g(){r&&v()&&(c.password1===c.password2?(f(null),r(c)):f("New Password and Confirm New Password do not match"))}return h("div",{className:"reset-password-box"},h("header",null,n?h("img",{src:n}):null,i?h("div",{className:"title"},h(b,null,i)):null,o),h("main",null,h(b,{use:"headline6"},"Change Password"),h(Y,{id:"password1",outlined:!0,icon:"lock",type:"password",label:"New Password",lapse:100,onChange:m,onEnter:g}),h(Y,{id:"password2",outlined:!0,icon:"lock",type:"password",label:"Confirm New Password",lapse:100,onChange:m,onEnter:g}),d?h("div",{className:"error"},d):null),h("footer",null,h(p,{label:"Close",action:function(){l&&l()}}),h(p,{label:"OK",raised:!0,disabled:!v(),action:g})))},ie=function(e){var n=e.title,i=e.src,o=e.info,r=e.actions,l=void 0===r?[]:r,a=e.tools,c=void 0!==a&&a,u=e.onClose,s=t(!1),d=s[0],f=s[1];function v(){f(!d)}var p=h(b,{use:"headline6"},n);return h("div",{className:"viewer"},h(P,{icon:{icon:"close",clickable:!0,action:u},title:p},d?"":h(m,{icon:"info",clickable:!0,action:v}),l),h("main",null,h("div",{className:"resizer"},h("picture",null,h("img",{src:i})))),h("aside",{className:d?"open":""},h(P,{title:"Detalles"},h(m,{icon:"close",clickable:!0,action:v})),h("main",null,o)),c?h("footer",null,h(m,{clickable:!0,icon:"zoom_out"}),h(m,{clickable:!0,icon:"zoom_out_map"}),h(m,{clickable:!0,icon:"zoom_in"})):null)},oe=function(e){return h("div",{className:"kanban"},e.children)},re=function(e){var n=e.id,i=e.icon,o=e.title,r=e.subtitle,l=e.badge,a=e.children,c=e.minified,u=e.disabled,s=void 0!==u&&u,d=t(void 0!==c&&c),f=d[0],v=d[1];function p(){v(!f)}return f?h("div",{className:"kanban-column "+n+" min"},h("main",null,o),h("footer",null,h(m,{icon:"toggle_off",onIcon:"toggle_on",clickable:!0,action:p}))):h("div",{className:"kanban-column "+n+" "+(s?"disabled":"")},h("header",null,h(m,{icon:i}),h("div",{className:"title"},h(b,{use:"headline6"},o),h(b,{className:"secondary-text",use:"body2"},r)),h("div",{className:"badge"},l)),h("main",null,a),h("footer",null,h(m,{icon:"toggle_off",onIcon:"toggle_on",clickable:!0,action:p})))},le=function(e){return h("div",{className:"kanban-card "+e.color},e.children)},ae=e.createContext({}),ce=function(e){var n=e.context,i=e.children,o=t(void 0===n?{}:n);return h(ae.Provider,{value:[o[0],o[1]]},i)},ue=function(e){var n=e.layout,t=e.context;return h(ce,{context:void 0===t?{}:t},h("article",{className:"page6 "+(void 0===n?"simple":n)},e.children))},se=function(e){var n=e.children,i=e.siteDictionary,o=t(e.siteLang),r=o[0],l=o[1],a=t(i),c=a[0],u=a[1],s=t("max"),d=s[0],f=s[1],v=t(!1),m=v[0],p=v[1],b=t(null),y=b[0],N=b[1],C=t(!1),k=C[0],O=C[1],P=t(),S=P[0],E=P[1],w=t(),j=w[0],A=w[1],T=t(),x=T[0],_=T[1],D=t(),I=D[0],R=D[1],L=t(),B=L[0],F=L[1],z={lang:r,setLang:l,dictionary:c,setDictionary:u,focused:B,changeFocus:function(e){B&&B.lose(),F(e)},sideNav:d,setSideNav:f,showNav:m,setShowNav:p,info:y,openInfo:function(e){N(e)},closeInfo:function(){N(null)},console:k,toggleConsole:function(){O(!k)},breadcrumb:I,setBreadcrumb:R,page:S,goto:function(e){E(e)},dialog:j,openDialog:function(e){A(e)},closeDialog:function(){A(null)},preview:x,openPreview:function(e){_(e)},closePreview:function(){_(null)}};return h(g.Provider,{value:z},n)},de=function(e){var n=e.logo,t=e.title,i=e.toolbar,o=e.children,r=e.init,l=e.min;return h(se,{siteLang:e.lang,siteDictionary:e.dictionary},h("div",{className:"site6"},h(he,{icon:e.icon}),h(fe,null,i),h(me,{logo:n,title:t,min:l},o),h(pe,{init:r},o,h(ue,{id:"EMPTY"},"EMPTY")),h(ve,null),h(ye,null),h(ge,null),h(be,null)))},he=function(e){var n=e.icon;return h(P,{icon:void 0===n?"equalizer":n,title:e.title})},fe=function(e){var t=e.children;return n(g),h("nav",null,t)},ve=function(){var e=n(g);return e.info?h("aside",null,e.info):""},me=function(e){var t=e.children,r=e.min,a=n(g),c=a.showNav;i(function(){r&&a.setSideNav("min")},[]);var u=t?l.toArray(t).reduce(function(e,n){var t=n.props?n.props.section:"...";e[t]||(e[t]=[]);var i=n.props,o=i.title;return o&&e[t].push({id:i.id,icon:i.icon,title:o}),e},{}):{};return h("menu",{className:"min "+(c?"show":"")},h("main",null,Object.keys(u).map(function(e){return h(o,{key:e},u[e].map(function(e){var n=e.id,t=e.icon;return h(m,{key:n,icon:void 0===t?"info":t,clickable:!0,checked:n===a.page,action:function(){return function(e){a.setShowNav(!1),a.goto(e)}(n)}})}),h("div",{className:"section-divider"}))})))},pe=function(t){var o=t.children,r=t.init,l=n(g),a=l.page;return i(function(){l.goto(r||"EMPTY")},[]),h("main",null,e.Children.toArray(o).filter(function(e){return!!e.props&&e.props.id===a}))},ge=function(){var e=n(g);return e.dialog?e.dialog:""},be=function(){var e=n(g);return e.preview?h("div",{className:"site-preview"},e.preview):""},ye=function(){return n(g).console?h("footer",{className:"site-console"},h(P,null,h(z,null,h(K,{label:"Console"}))),h("main",null)):""},Ne=function(e){var t=n(g),i=e.icon,r=e.title,l=void 0===r?"Dialog":r,a=e.children,c=e.actions;return h(o,null,h("div",{className:"overlay"}),h("div",{className:"dialog",onClick:function(){t.closeDialog()}},h("div",{className:"dialog-panel",onClick:function(e){e.preventDefault(),e.stopPropagation()}},h("header",null,i?h(x,{icon:i}):null,h(b,null,l)),h("main",null,a),h("footer",null,c))))},Ce={STRING:"String",NUMBER:"Number",DATE:"Date",BOOLEAN:"Boolean",ARRAY:"Array",ENTITY:"Object",FUNCTION:"Function",EMAIL:"String"},ke=Object.values(Ce).reduce(function(e,n){return e["is"+n]=function(e){return toString.call(e)=="[object "+n+"]"},e},{}),Oe=/*#__PURE__*/function(){function e(e){this._schema=e}var n=e.prototype;return n.checkType=function(n,t){var i=n.type,o=n.item,r=!0,l=!0;if(o){var a=new e(o);switch(i){case Ce.ARRAY:r=ke["is"+i](t),l=t.every(function(e){return a.validate(e)});break;case Ce.ENTITY:r=ke["is"+i](t),l=a.validate(t);break;case Ce.NUMBER:r=ke["is"+i](t.value),l=!0;break;default:r=!0,l=!0}}return r&&l},n.validate=function(e){var n=this;return Object.entries(this._schema).filter(function(e){return!0===e[1].required}).every(function(t){var i=t[0];return void 0!==e[i]&&n.checkType(t[1],e[i])})},n.form=function(e){return Object.entries(this._schema).reduce(function(n,t){var i=t[0];return n[i]=Object.assign({},t[1],{value:e[i]}),n},{})},n.sections=function(e){var n=this.form(e),t=Object.values(n).reduce(function(e,n){var t=n.section||"";return e.hasOwnProperty(t)||(e[t]={title:t,fields:[]}),e[t].fields.push(n),e},{});return Object.values(t)},n.value=function(n){return Object.entries(this._schema).reduce(function(t,i){var o=i[0],r=i[1],l=r.item,a=n?n[o]:null;switch(r.type){case Ce.STRING:case Ce.NUMBER:case Ce.BOOLEAN:t[o]=a||r.default;break;case Ce.ENTITY:var c=new e(l);t[o]=c.value(a);break;case Ce.ARRAY:if(l===Ce.STRING)t[o]=a||[];else{var u=new e(l);t[o]=a?a.map(function(e){return u.value(e)}):[]}break;default:t[o]=r}return t},{})},e}(),Pe=/*#__PURE__*/function(){function e(e,n){this.type=e,this._type=new Oe(e),this._value=n}var n=e.prototype;return n.isValid=function(){return this._type.validate(this._value)},n.value=function(){return this._type.value(this._value)},n.form=function(){return this._type.form(this._value)},n.sections=function(){return this._type.sections(this._value)},n.update=function(e){this._value=e},e}(),Se=function(e){var n=e.columns,t=void 0===n?1:n,i=e.filter,o=e.onChange,r=e.content.form();console.log(r);var l=Object.keys(r).map(function(e){return r[e]}).filter(function(e){return!i||i(e)});return console.log(l),h(k,{className:"content-form",columns:t,outlined:!0,onChange:o},l.map(function(e){return h(Ee,S({key:e.id},e))}))},Ee=function(e){switch(e.type){case Ce.BOOLEAN:return h(y,S({key:e.id},e));case Ce.NUMBER:return h(je,S({key:e.id},e));default:return h(we,S({key:e.id},e))}},we=function(e){var n,t=e.id,i=e.type,o=e.label,r=e.options,l=e.textarea,a=e.required,c=void 0!==a&&a,u=e.value,s=e.onChange,d=e.outlined,f=((n={})[Ce.NUMBER]="number",n[Ce.DATE]="date",n)[i]||"text";return r?h(q,{key:t,id:t,label:o,value:u,onChange:s,options:"function"==typeof r?r():r,outlined:d}):h(Y,{key:t,id:t,type:f,label:o,value:u,onChange:s,required:c,outlined:d,textarea:l})},je=function(e){var n=e.id,t=e.label,i=e.options,o=e.required,r=void 0!==o&&o,l=e.value,a=e.onChange,c=e.outlined;function u(e,n){a&&a(e,+n?+n:n)}return i?h(q,{key:n,id:n,label:t,value:l,onChange:u,options:i,outlined:c}):h(Y,{key:n,id:n,type:"number",label:t,value:l,onChange:u,required:r,outlined:c})},Ae=function(e){var n=e.content,t=e.filter,i=e.onChange;function o(e,t){var o,r=Object.assign({},n.value(),((o={})[e]=t,o));i&&i(r)}var r=n.sections();return h("div",{className:"content-editor"},r.map(function(e){var i=e.title,r=e.fields;return h("section",{key:i},h("header",null,i),h("main",null,r.filter(function(e){return"id"!==e.id}).filter(function(e){return!t||t(e,n)}).map(function(e){return h(_e,{key:e.id,field:e,onChange:o})})))}))},Te=function(e){var n=e.content,i=e.filter,r=e.grouped,l=void 0!==r&&r,a=e.onChange,c=t(0),u=c[0],s=c[1];function d(e,t){var i,o=Object.assign({},n.value(),((i={})[e]=t,i));a&&a(o)}var f=n.sections();return h("div",{className:"content-editor tabbed"},h(z,{selected:u,onChange:function(e){s(e)}},f.map(function(e){return h(K,{label:e.title})})),h(U,{selected:u},f.map(function(e){var t=e.fields;return h("section",{key:e.title},h("nav",null," "),h("main",null,l?function(e){var n=e.fields,t=(void 0===n?[]:n).reduce(function(e,n){var t=n.group||"",i=e[t]||{name:t,fields:[]};return i.fields.push(n),e[t]=i,e},{});return Object.values(t)}(e).map(function(e){return h(o,null,e.name.length>0?h("div",{className:"group-caption"},e.name):null,e.fields.filter(function(e){return"id"!==e.id}).filter(function(e){return!i||i(e)}).map(function(e){return h(_e,{key:e.id,field:e,onChange:d,content:n})}))}):t.filter(function(e){return"id"!==e.id}).filter(function(e){return!i||i(e)}).map(function(e){return h(_e,{key:e.id,field:e,onChange:d,content:n})})))})))},xe=function(e){var n=e.content,i=e.onChange,o=n.value(),r=Object.values(n.type).filter(function(e){return e.type===Ce.ARRAY}),l=t(),a=l[0],c=l[1];function u(){}return h("div",{className:"content-editor treeded-editor"},h("menu",null,h("header",null,h(b,{use:"caption"},"Tree Editor")),h(Z,null,r.map(function(e,n){return h($,{icon:"folder",label:e.label,actions:[h(m,{small:!0,icon:"add",clickable:!0,action:u})]},o[e.id]?o[e.id].map(function(n,t){return h(ee,{icon:n.icon||"description",label:n.name||n.label,onSelect:function(){return function(e,n,t){var i=new Pe(t.item,n);c({index:e,item:i,node:t,value:o[t.id]})}(t,n,e)}})}):null)}))),h("div",null,a?h(Te,{content:a.item,onChange:function(e){var n,t=a.value.slice();t[a.index]=e;var r=Object.assign({},o,((n={})[a.node.id]=t,n));i&&i(r)}}):"select"))},_e=function(e){var n=e.field,t=e.onChange,i=e.content,o=e.outlined,r=void 0!==o&&o,l=n.id,a=n.type,c=n.item,u=n.label,s=n.editable,d=n.options;function f(e,n){t&&t(e,n)}return function(){var e=n.value?n.value:n.default;switch(a){case Ce.ENTITY:return h(De,{field:n,value:e,onChange:f});case Ce.STRING:return h(Ie,{outlined:r,field:n,value:e,onChange:f,content:i});case Ce.BOOLEAN:return h(y,{outlined:!0,id:l,label:u,value:e,onChange:f});case Ce.DATE:return h(Y,{outlined:r,id:l,type:"date",label:u,value:e,onChange:f,disabled:s});case Ce.NUMBER:return h(Re,{outlined:r,field:n,value:e,onChange:f});case Ce.ARRAY:return c===Ce.STRING?d?h(Be,{content:i,field:n,value:e,onChange:f}):h(Le,{field:n,value:e,onChange:f}):h(Fe,{field:n,value:e,onChange:f});default:return h("div",null,u)}}()},De=function(e){var n=e.field,t=e.value,i=e.onChange,o=n.id,r=n.label,l=new Pe(n.item,void 0===t?{}:t);function a(e,n){var t,r=Object.assign({},l.value(),((t={})[e]=n,t));i&&i(o,r)}var c=l.form(),u=Object.keys(c).map(function(e){return c[e]});return h("div",{className:"entity-editor"},h("header",null,h(b,{use:"caption"},r)),h("main",null,u.map(function(e){return h(_e,{key:e.id,field:e,onChange:a})})))},Ie=function(e){var n=e.field,t=e.value,i=void 0===t?"":t,o=e.onChange,r=e.outlined,l=n.id,a=n.label,c=n.options,u=n.editable;function s(e,n){o&&o(e,n)}return h("div",{className:"field-editor string-editor"},void 0===u||u?c?h(q,{outlined:r,id:l,label:a,value:i,onChange:s,options:"function"==typeof c?c(n,e.content):c}):h(Y,{outlined:r,id:l,label:a,value:i,onChange:s}):h(Y,{outlined:r,id:l,label:a,value:i,onChange:s,readOnly:!0}))},Re=function(e){var n=e.field,t=e.onChange,i=n.editable;return h("div",{className:"field-editor number-editor"},h(Y,{outlined:!0,id:n.id,label:n.label,type:"NUMBER",value:e.value||n.default,max:n.max,min:n.min,onChange:function(e,n){t&&t(e,n)},disabled:!(void 0===i||i)}))},Le=function(e){var n=e.field,t=e.value,i=e.onChange;return h("div",{className:"list-editor"},h(X,{id:n.id,label:n.label,init:void 0===t?[]:t,onChange:function(e,n){i&&i(e,n)}}))},Be=function(e){var n=e.field,t=e.value,i=void 0===t?[]:t,o=e.content,r=e.onChange,l=n.id,a=n.options;return h("div",{className:"multiselection-editor"},h("label",null,n.label),("function"==typeof a?a(n,o):a).map(function(e){var n=i.includes(e.value);return h(y,{value:n,label:e.label,onChange:function(){return(t=i.indexOf(n=e.value))>=0?i.splice(t,1):i.push(n),void(r&&r(l,i));var n,t}})}))},Fe=function(e){var n=e.field,t=e.value,i=void 0===t?[]:t,o=e.onChange,r=n.id,l=n.item,a=n.label,c=n.Feeder,u=n.Renderer,s=n.Adder,d=void 0===s||s,f=n.editable,v=void 0===f||f;function p(e){if(o){var n=i.concat(e);o(r,n)}}function g(e){if(o){var n=i.filter(function(n,t){return t!==e});o(r,n)}}function y(e,n,t){if(o){var l=i.slice();l[e][n]=t,o(r,l)}}var N=Object.values(l).map(function(e){return S({},e,{onChange:y})});N.push({id:"actions",label:"Actions"});var C=i.map(function(e,n){return S({},e,{id:n,actions:[h(m,{icon:"delete",clickable:!0,action:function(){return g(n)},small:!0})]})}),k={columns:N,rows:C};return h("div",{className:"collection-editor"},h("header",null,h(b,{use:"caption"},a),h("div",{className:"actions"},c?h(c,{onAdd:p}):null)),u?h(u,{field:n,value:i,onRemove:g,onChange:o}):h(M,S({},k,{editable:v})),h("footer",null,d?h(ze,{item:l,onAdd:p}):null))},ze=function(e){var n=e.item,i=e.onAdd,o=t(!1),r=o[0],l=o[1],a=t({}),c=a[0],u=a[1];function s(){l(!r)}function d(e,n,t){if(i){var o,r=Object.assign({},c,((o={})[n]=t,o));u(r)}}var f=Object.values(n).map(function(e){return S({},e,{type:"String",onChange:d})});f.push({id:"actions",label:""});var v=[{actions:[h(m,{icon:"done",clickable:!0,action:function(){i&&i([c]),s()}}),h(m,{icon:"close",clickable:!0,action:s})]}];return v[0]=Object.assign({},c,v[0]),h("div",{className:"collection-adder"},r?h(M,S({},{columns:f,rows:v},{editable:!0})):h(p,{icon:"add",label:"Add",action:s}))},Ke=function(e){var i=e.label,r=e.type,l=e.validator,a=e.onOK,c=e.onActionClose,u=void 0===c||c,s=n(g),d=t({}),f=d[0],v=d[1],m=t(!1),y=m[0],N=m[1],C=t([]),k=C[0],O=C[1];function P(e){"OK"===e&&a&&a(f),"CLOSE"!==e&&!0!==u||s.closeDialog()}var S=h(o,null,h(p,{label:"CLOSE",action:function(){return P("CLOSE")}}),h(p,{label:"OK",action:function(){return P("OK")},disabled:!y,raised:!0})),E=h(b,{use:"headline6"},i),w=new Pe(r,f);return h(Ne,{title:E,open:!0,onAction:P,actions:S},h(Se,{content:w,filter:function(e){return function(e){var n=e.required;return void 0!==n&&n}(e)||function(e){var n=e.creation;return void 0!==n&&n}(e)},onChange:function(e,n){if(v(e),l){var t=l(e),i=t.errors,o=void 0===i?[]:i;N(n&&t.validation),O(o)}else N(n)}}),k.map(function(e){return h(b,{use:"overline",tag:"div",className:"error"},e)}))},Ue=function(e){var i=e.label,r=e.type,l=e.value,a=void 0===l?{}:l,c=e.filter,u=e.validator,s=e.onOK,d=n(g),f=t(a),v=f[0],m=f[1],y=t(!1),N=y[0],C=y[1],k=t([]),O=k[0],P=k[1];function S(e){"OK"===e&&s&&s(Object.assign({},a,v)),d.closeDialog()}var E=h(o,null,h(p,{label:"CLOSE",action:function(){return S("CLOSE")}}),h("div",{className:"expand"}),h(p,{label:"OK",action:function(){return S("OK")},disabled:!N,raised:!0})),w=h(b,{use:"headline6"},i),j=new Pe(r,v);return h(Ne,{title:w,open:!0,onAction:S,actions:E},h(Ae,{content:j,onChange:function(e){if(m(e),u){var n=u(e),t=n.errors,i=void 0===t?[]:t;C(n.validation),P(i)}else C(!0)},filter:c}),O.map(function(e){return h(b,{use:"overline",tag:"div",className:"error"},e)}))};function Ye(e,n){try{var t=e()}catch(e){return n(e)}return t&&t.then?t.then(void 0,n):t}var qe=d(window.API||process.env.REACT_APP_API,v),Me=function(e){var t=n(g),r=e.id,l=void 0===r?"collection":r,a=e.icon,c=e.title,u=e.name,s=void 0===u?"Collection 1":u,d=e.schema,f=e.url,v=e.groupBy,m=e.editor,y=e.field,N=e.autosave,C=void 0!==N&&N,k=e.delay,O=void 0===k?1e3:k,S=e.actions,E=e.levels,w=n(ae),j=w[0],A=w[1],T=Ve(f,y);return i(function(){try{return Promise.resolve(T.load()).then(function(){A(T)})}catch(e){return Promise.reject(e)}},[]),h(o,null,h(P,{className:"collection-page",title:h(b,null,c)},h(p,{icon:"add",label:"Add",action:function(){t.openDialog(h(Ue,{label:"Crear "+s,type:d,onOK:function(e){try{return Promise.resolve(j.create(e)).then(function(){A(Object.assign({},j))})}catch(e){return Promise.reject(e)}}}))}}),h(p,{icon:"refresh",label:"Reload",action:function(){try{return Promise.resolve(j.load()).then(function(){A(Object.assign({},j))})}catch(e){return Promise.reject(e)}}}),S),h("menu",{className:"collection-page"},h(P,{title:h(b,null,"Lista de ",s)}),E?h(Je,{levels:E}):h(Ge,{groupBy:v})),h("main",{key:l,className:"collection-page"},h(He,{icon:a,schema:d,layout:m,autosave:C,delay:O})))},Ge=function(e){var t=e.groupBy,i=n(ae),o=i[0],r=i[1],l=o.all,a=void 0===l?[]:l,c=a?a.map(function(e){return{id:e.id,line1:e.name,line2:e.description,content:e}}):[];return h(E,{items:c,onSelect:function(e){try{return o.clear(),r(Object.assign({},o)),Promise.resolve(o.select(e)).then(function(){r(Object.assign({},o))})}catch(e){return Promise.reject(e)}},groupBy:t})},Je=function(e){var t=function(e){try{return r.clear(),l(Object.assign({},r)),Promise.resolve(r.select(e)).then(function(){l(Object.assign({},r))})}catch(e){return Promise.reject(e)}},i=e.levels,o=n(ae),r=o[0],l=o[1],a=r.all,c=function e(n,t){var i=function(e,n){return e.reduce(function(e,t){var i=e.find(function(e){return e.name===t[n]});return i||e.push(i={name:t[n],items:[],field:n}),i.items.push(t),e},[])}(t,n[0]);return n.length>1&&i.forEach(function(t){return t.nodes=e(n.slice(1),t.items)}),i}(i,void 0===a?[]:a);return h("main",null,h(Z,null,function e(n){return n.map(function(n){return h($,{key:n.name,icon:null,label:"boolean"==typeof n.name?n.field+" = "+n.name:n.name,open:!0},n.nodes?e(n.nodes):n.items.map(function(e){return h(ee,{key:e.id,id:e.id,label:e.name,onSelect:t},"item")}))})}(c)))},He=function(e){var l=function(){try{return console.log("saving....."),Promise.resolve(u.update(w)).then(function(){s(Object.assign({},u))})}catch(e){return Promise.reject(e)}},a=n(ae),u=a[0],s=a[1],d=u.selected,f=e.icon,v=e.schema,g=e.layout,y=e.autosave,N=void 0!==y&&y,C=e.delay,k=void 0===C?1e3:C,O=r(null),E=t(d),w=E[0],j=E[1];function A(e){j(e)}function D(){return!c(w,d)}return i(function(){j(d)},[d]),i(function(){N&&(clearTimeout(O.current),O.current=setTimeout(function(){D()&&l()},k))},[w]),d&&w?h(o,null,h(P,{icon:f,title:h(b,null,d.name)},h(m,{icon:"close",clickable:!0,action:function(){u.clear(),s(Object.assign({},u))}}),h(x,{align:"alignRight"},h(T,null,h(_,{label:"Eliminar",onSelect:function(){try{return Promise.resolve(u.remove(d.id)).then(function(){u.clear(),s(Object.assign({},u))})}catch(e){return Promise.reject(e)}}}))),!0===N?null:h(p,{icon:"save",label:"Guardar Cambios",raised:!0,disabled:!D(),action:l})),function(){var n=new Pe(v,w);switch(g){case"TABBED":return h(Te,S({},e,{content:n,onChange:A}));case"TREEDED":return h(xe,S({},e,{content:n,onChange:A}));default:return h(Ae,S({},e,{content:n,onChange:A}))}}()):null},Ve=function(e,n){var t=We(e);return{all:[],selected:null,load:function(){try{var e=this,i=Ye(function(){return Promise.resolve(t.all()).then(function(t){e.all=n?t[n]:t})},function(e){console.log(e)});return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},select:function(e){var n=this.all.find(function(n){return n.id===e});this.selected=n},clear:function(){this.selected=null},create:function(e){try{var n=this,i=Ye(function(){return Promise.resolve(t.create(e)).then(function(){return Promise.resolve(n.load()).then(function(){})})},function(e){console.log("CREATE ERROR",e)});return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},update:function(e){try{var n=this,i=Ye(function(){return Promise.resolve(t.update(e)).then(function(){return Promise.resolve(n.load()).then(function(){})})},function(e){console.log(e)});return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},patch:function(e,n){try{var i=this,o=Ye(function(){return Promise.resolve(t.patch(e,n)).then(function(){return Promise.resolve(i.load()).then(function(){})})},function(e){console.log(e)});return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},updateProperty:function(e,n,i){try{var o=this,r=Ye(function(){return Promise.resolve(t.updateProperty(e,n,i)).then(function(){return Promise.resolve(o.load()).then(function(){})})},function(e){console.log(e)});return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},remove:function(e){try{var n=this,i=Ye(function(){return Promise.resolve(t.remove(e)).then(function(){return Promise.resolve(n.load()).then(function(){})})},function(e){console.log(e)});return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}}},We=function(e){return{all:function(){return qe.GET(e)},find:function(n){return qe.GET(e+"/"+n)},create:function(n){var t=JSON.stringify(n);return qe.POST(e,t)},update:function(n){var t=JSON.stringify(n);return qe.PUT(e+"/"+n.id,t)},patch:function(n,t){var i=JSON.stringify(t);return qe.PATCH(e+"/"+n,i)},updateProperty:function(n,t,i){var o=JSON.stringify(i);return qe.PUT(e+"/"+n+"/"+t,o)},remove:function(n){return qe.DELETE(e+"/"+n)}}},Xe=function(e){var n=r(),o=t(!1),l=o[0],a=o[1];i(function(){var t=e.resumable;t&&n&&t.assignDrop(n.current)},[]);var c=e.state,u=void 0===c?0:c,s=e.label,d=void 0===s?"Add file or drop file here...":s,f=e.error;return h("div",{className:"upload-area6 "+(!0===l?"drag-over":""),onDragOver:function(){a(!0)},onDragLeave:function(){a(!1)},ref:n},0===u?h(Qe,{resumable:e.resumable}):"",0===u?h("label",null,d):"",1===u?h(I,{size:"xlarge"}):"",2===u?h(m,{icon:"done_all"}):"",3===u?h(b,{use:"body1"},f):"",e.children)},Qe=function(e){var n=e.resumable,t=r();return i(function(){n&&t&&n.assignBrowse(t.current)},[]),h("div",{className:"upload-icon",ref:t},h(m,{icon:"folder_open",clickable:!0}))},Ze=function(e){var n=e.label,i=e.target,o=e.accept,r=e.className,l=e.onSuccess,c=e.onError,s=e.onComplete,d=a(function(){var e=new u({target:i,chunkSize:1048576,simultaneousUploads:1,testChunks:!1,throttleProgressCallbacks:1,fileType:o});return e.on("fileAdded",O),e.on("fileProgress",P),e.on("fileSuccess",S),e.on("fileError",E),e.on("complete",w),e},[]),f=t(0)[1],v=t(0),m=v[0],p=v[1],g=t(),b=g[0],y=g[1],N=t([]),C=N[0],k=N[1];function O(e){C.push(e),k(C),d.upload()}function P(e){var n=e.progress();f(n)}function S(e,n){p(2),l&&l(e,n)}function E(e,n){y(n),p(3),c&&c(e,n)}function w(){p(0),s&&s(C)}return h("div",{className:"uploader "+r},h(Xe,{resumable:d,state:m,label:n,error:b}))},$e=function(e){var n=e.file,t=e.state,i=e.progress,r=e.error,l=r?h(m,{icon:"image",className:"error"}):h(m,{icon:"image"});return 0!==t?h(o,null,h("div",{className:"upload-file"},l,h(b,{use:"body1",tag:"label"},n.fileName),1===t?h(R,{progress:i}):"",1===t?h(m,{icon:"close",clickable:!0}):"",2===t?h(m,{icon:"done"}):"",3===t?h(m,{icon:"error"}):""),r?h("div",{className:"error"},h(b,{use:"overline"},r)):""):""},en=function(e){var i=e.label,r=e.target,l=e.accept,a=e.onSuccess,c=e.onClose,u=e.onActionClose,s=void 0===u||u,d=n(g),f=t(),v=f[0],m=f[1],y=t([])[0];function N(e){"CLOSE"!==e&&!0!==s||(d.closeDialog(),c())}var C=h(o,null,h(p,{label:"CLOSE",action:function(){return N("CLOSE")}})),k=h(b,{use:"headline6"},i);return h(Ne,{title:k,open:!0,onAction:N,actions:C},v?h($e,{file:v}):h(Ze,{label:i,accept:l,target:r,onComplete:function(e){m(e[0]),a&&a(e[0])}}),y.map(function(e){return h(b,{use:"overline",tag:"div",className:"error"},e)}))},nn=function(e){return e&&("[object Function]"===Object.prototype.toString.call(e)||"function"==typeof e||e instanceof Function)};export{p as Button,y as CheckBox,N as Chip,C as Chips,I as CircularProgress,Ve as CollectionContext,Fe as CollectionEditor,Me as CollectionPage,Pe as Content,Ae as ContentEditor,Se as ContentForm,Ke as CreateContentDialog,M as DataTable,Ne as Dialog,q as DropDown,Ue as EditContentDialog,_e as FieldEditor,k as Form,d as HTTPClient,P as Header,m as Icon,oe as Kanban,le as KanbanCard,re as KanbanColumn,R as LinearProgress,E as List,Le as ListEditor,ne as LoginBox,T as Menu,x as MenuIcon,_ as MenuItem,D as MenuSeparator,ue as Page,ae as PageContext,ce as PageProvider,L as Property,B as RadioButton,te as ResetPasswordBox,F as Section,v as Session,de as Site,g as SiteContext,se as SiteProvider,U as Stack,Ce as TYPES,K as Tab,Te as TabbedContentEditor,z as Tabs,b as Text,Y as TextField,X as TokenField,Z as Tree,ee as TreeItem,$ as TreeNode,xe as TreededContentEditor,Xe as UploadArea,en as UploadDialog,$e as UploadFile,Ze as Uploader,ie as Viewer,nn as isFunction};
2
2
  //# sourceMappingURL=index.modern.js.map