ywana-core8 0.0.4 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("material-design-icons-iconfont/dist/material-design-icons.css"),require("deep-equal")):"function"==typeof define&&define.amd?define(["exports","material-design-icons-iconfont/dist/material-design-icons.css","deep-equal"],n):n((e||self).ywanaCore8={},0,e.deepEqual)}(this,function(e,n,t){function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=/*#__PURE__*/r(t),i=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)}},a=function(e,n){return{GET:function(t){var r=n?n.token():null;return i("GET",e+t,void 0,r)},POST:function(t,r){var o=n?n.token():null;return i("POST",e+t,r,o)},PUT:function(t,r){var o=n?n.token():null;return i("PUT",e+t,r,o)},PATCH:function(t,r){var o=n?n.token():null;return i("PATCH",e+t,r,o)},DELETE:function(t){var r=n?n.token():null;return i("DELETE",e+t,void 0,r)}}},u=process.env.REACT_APP_SESSION||window&&window.SESSION?window.SESSION:"YWANA-CORE6-SESSION",l={token:function(){return(sessionStorage.getItem(u)?JSON.parse(sessionStorage.getItem(u)):{}).token},me:function(){return(sessionStorage.getItem(u)?JSON.parse(sessionStorage.getItem(u)):{}).me},init:function(e,n){sessionStorage.setItem(u,JSON.stringify({token:e,me:n}))},refresh:function(e){var n=this.me();sessionStorage.setItem(u,JSON.stringify({token:e,me:n}))},isLoggedIn:function(){return!!sessionStorage.DSSession},logout:function(){sessionStorage.removeItem(u)}};function c(e){var n={exports:{}};return e(n,n.exports),n.exports}var s=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable;function p(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var v=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=p(e),i=1;i<arguments.length;i++){for(var a in t=Object(arguments[i]))f.call(t,a)&&(o[a]=t[a]);if(s){r=s(t);for(var u=0;u<r.length;u++)d.call(t,r[u])&&(o[r[u]]=t[r[u]])}}return o},m=c(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 s="function"==typeof Symbol&&Symbol.iterator;function f(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 d={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h={};function p(e,n,t){this.props=e,this.context=n,this.refs=h,this.updater=t||d}function m(){}function y(e,n,t){this.props=e,this.context=n,this.refs=h,this.updater=t||d}p.prototype.isReactComponent={},p.prototype.setState=function(e,n){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(f(85));this.updater.enqueueSetState(this,e,n,"setState")},p.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},m.prototype=p.prototype;var g=y.prototype=new m;g.constructor=y,v(g,p.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 w(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}var _=/\/+/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(_,"$&/")+"/"),O(a,n,o,"",function(e){return e})):null!=a&&(w(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(_,"$&/")+"/")+e)),n.push(a)),1;if(l=0,i=""===i?".":i+":",Array.isArray(e))for(var c=0;c<e.length;c++){var d=i+N(u=e[c],c);l+=O(u,n,o,d,a)}else if(d=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=s&&e[s]||e["@@iterator"])?e:null}(e),"function"==typeof d)for(e=d.call(e),c=0;!(u=e.next()).done;)l+=O(u=u.value,n,o,d=i+N(u,c++),a);else if("object"===u)throw n=""+e,Error(f(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(f(321));return e}var x={ReactCurrentDispatcher:j,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:b,IsSomeRendererActing:{current:!1},assign:v};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(!w(e))throw Error(f(143));return e}},n.Component=p,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(f(267,e));var o=v({},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 s=0;s<c;s++)l[s]=arguments[s+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=w,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"}),y=c(function(e,n){"production"!==process.env.NODE_ENV&&function(){var e=v,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,s=60121,f=60122,d=60117,h=60129,p=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"),s=m("react.block"),f=m("react.server.block"),d=m("react.fundamental"),m("react.scope"),m("react.opaque.id"),h=m("react.debug_trace_mode"),m("react.offscreen"),p=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 w(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 _={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=_.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)}_.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)."]},D=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 I in A)A.hasOwnProperty(I)&&D(I,A[I]);function F(){}function $(e,n,t){this.props=e,this.context=n,this.refs=x,this.updater=t||R}F.prototype=T.prototype;var L=$.prototype=new F;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 s:return M(e._render);case c:var t=e._payload,f=e._init;try{return M(f(t))}catch(e){return null}}var d,h;return null}L.constructor=$,e(L,T.prototype),L.isPureReactComponent=!0;var U,q,z,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(){q||(q=!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);z[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),z[n]=!0)}}z={};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,w=C.call(k),_=0;!(S=w.next()).done;)m+=ie(s=S.value,n,o,y+oe(s,_++),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===h||e===n.StrictMode||e===n.Suspense||e===u||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===c||e.$$typeof===l||e.$$typeof===o||e.$$typeof===i||e.$$typeof===a||e.$$typeof===d||e.$$typeof===s||e[0]===f)}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=_.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,we=!1,_e="function"==typeof WeakMap?WeakMap:Map;function Ne(n,t){if(!n||we)return"";var r,o=Se.get(n);if(void 0!==o)return o;we=!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{we=!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 s: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 _e;var Ee,je={},Re=_.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;w(Pe(e.type,e._source,n?n.type:null))}else w(null)}function Ae(){if(C.current){var e=M(C.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}function De(e){return null!=e&&void 0!==(n=e.__source)?"\n\nCheck your code at "+n.fileName.replace(/^.*[\\\/]/,"")+":"+n.lineNumber+".":"";var n}Ee=!1;var Ie={};function Fe(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(!Ie[t]){Ie[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 $e(e,n){if("object"==typeof e)if(Array.isArray(e))for(var t=0;t<e.length;t++){var r=e[t];ee(r)&&Fe(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)&&Fe(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=De(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++)$e(arguments[s],e);return e===n.Fragment?Be(c):Le(c),c}var Ue=!1;try{var qe=Object.freeze({});new Map([[qe,null]]),new Set([qe])}catch(e){}var ze=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=$,n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_,n.cloneElement=function(e,n,t){for(var r=Z.apply(this,arguments),o=2;o<arguments.length;o++)$e(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=ze,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"}()}),g=c(function(e){e.exports="production"===process.env.NODE_ENV?m:y}),b=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)},C=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(b,{icon:t,size:"small"}):null,h("span",null,n))},k=React.createContext({}),S=function(e){var n=e.children,t=g.useContext(k);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):""},w=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(S,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))},_=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=g.useState([]),l=u[0],c=u[1],s=function(e){return null==e||""===e};g.useEffect(function(){var e=g.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)},[]),g.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=g.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=g.cloneElement(e,{onChange:f,outlined:!!i});return h(N,{style:{gridColumn:"span "+t}},r)}),p={gridTemplateColumns:"repeat("+r+", 1fr)"};return h(g.Fragment,null,n?h("header",{className:"form-header"},h(S,{use:"headline6"},n)):"",h("form",{className:"form-grid",style:p},d))},N=function(e){return h("div",{className:"field-wrapper",style:e.style},e.children)},O=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(b,{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(S,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 P(){return P=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},P.apply(this,arguments)}var E=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(j,P({},e,{onSelect:i})):h("div",{className:"list"},h("ul",null,t.map(function(e){return h(R,{key:e.id,item:e,onSelect:i})})),r)},j=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(g.Fragment,{key:e.name},h("header",{key:e.name+"-header"},h(S,null,e.name)),h("ul",{key:e.name+"-ul"},e.items.map(function(e){return h(R,{key:e.id,item:e,onSelect:r})})))}),t)},R=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(b,{icon:o,size:"small"}):null,h("main",null,h("div",{className:"primary-line"},h(S,null,i)),a?h("div",{className:"secondary-line"},h(S,null,a)):null),u?h("div",{className:"meta"},u):null)},x=g.createContext({}),T=function(e){return h("ul",null,e.children)},A=function(e){var n=e.icon,t=void 0===n?"more_vert":n,r=e.children,o=e.align,i=g.useState(!1),a=i[0],u=i[1];function l(){u(!a)}return h(x.Provider,{value:[a,u]},h("div",{className:"menu-icon"},h(b,{icon:t,clickable:!0,action:l}),a?h("menu",{className:""+o},r):null,a?h("div",{className:"overlay",onClick:l}):null))},D=function(e){var n=e.icon,t=e.label,r=e.meta,o=e.onSelect,i=g.useContext(x)[1];return h("li",{className:"menu-item",onClick:function(){o&&o(),i(!1)}},n?h(b,{icon:n}):null,h("label",null,t),r?h("div",{className:"meta"},r):null)},I=function(e){var n=e.selected,t=e.onChange,r=g.Children.map(e.children,function(e,r){return g.cloneElement(e,{selected:r===n,onSelect:function(){t&&t(r)}})});return h("div",{class:"tabs"},r,h("div",{class:"tab-filler"}))},F=function(e){var n=e.onSelect;return h("div",{className:"tab "+(e.selected?"selected":""),onClick:function(){n&&n()}},e.label,e.actions||null)},$=function(e){var n=e.selected,t=void 0===n?0:n,r=g.Children.toArray(e.children).filter(function(e,n){return n===t})[0];return h(g.Fragment,null,r)},L=function(e){var n=g.useContext(k),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,p=(i?"":"no-label")+" "+(e.outlined?"textfield-outlined":"textfield"),v=h(S,null,i);return h("div",{className:""+p,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,v):null)},B=function(e){var n=g.useContext(k),t=e.id,r=e.options,o=void 0===r?[]:r,i=e.value,a=e.onChange,u=g.useState(!1),l=u[0],c=u[1],s=g.useState(),f=s[0],d=s[1];function p(){n&&n.changeFocus({lose:function(){c(!1)}}),c(!l)}return g.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(L,P({},e,{onClick:p,value:f})),h(b,{icon:"expand_more",clickable:!0,size:"small",action:p}),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)},M=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=g.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(S,null,e.label),n?h(b,{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(U,{key:e.id,row:e,columns:t,onSelect:s,onDrop:f,editable:u})}))))},U=function(e){var n,t=e.row,r=e.columns,o=void 0===r?[]:r,i=e.onSelect,a=e.editable,u=g.useState(!1),l=u[0],c=u[1],s=l?"expand_more":"expand_less";return h(g.Fragment,null,h("tr",{onClick:function(e){return i(t,e)}},o.map(function(e){return h(q,{row:t,column:e,cell:t[e.id],editable:a})}),t.info?h(b,{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)},q=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(b,{icon:r});case"BOOLEAN":case"Boolean":return h(w,{id:i,value:r,onChange:function(e,t){return s(n.id,e,t)},disabled:u});case"SELECTION":return h(B,{id:i,value:r,placeholder:"--Select--",options:f,onChange:function(e,t){return s(n.id,e,t)}});case"CHECK":return h(w,{id:i,value:r,onChange:function(e,t){return s(n.id,e,t)},disabled:n.disabled});case"CHECKABLE":return r&&r.value?h(w,{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(L,{id:i,value:r,onChange:function(e,t){return s(n.id,e,t)}});case"String":return h(V,{id:i,value:r,options:f,onChange:function(e,t){return s(n.id,e,t)}});case"Number":return h(L,{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(b,{icon:r});case"Boolean":return h(z,{id:i,value:r});case"String":return h(Y,{id:i,value:r,options:f});default:return r}}(t.type))},z=function(e){var n=e.value;return h(b,{icon:!0===(void 0!==n&&n)?"check_box":"check_box_outline_blank"})},Y=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)},V=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(B,{outlined:!0,id:n,value:r,onChange:a,options:o}):h(L,{outlined:!0,id:n,value:r,onChange:a}))},K=function(e){var n=e.id,t=e.label,r=e.init,o=e.onChange,i=g.useRef(!1),a=g.useState(),u=a[0],l=a[1],c=g.useState(r),s=c[0],f=c[1];return g.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(H,{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)}}}))},H=function(e){var n=e.onDelete;return h("div",{className:"token"},h(S,{use:"caption",tag:"div"},e.text),h(b,{icon:"close",clickable:!0,action:n,size:"small"}))},W=function(e){var n=e.nodes;return h("div",{className:"tree"},void 0===n?[]:n,e.children)},J=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(b,{icon:t,size:"small",small:!0}):null,h("div",{className:"label"},r),h("div",{className:"actions"},a)),i)},G=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(b,{icon:void 0===t?"description":t,size:"small",small:!0}),h("div",{className:"label"},r),h("div",{className:"actions"},o))},X=g.createContext({}),Q=function(e){var n=e.context,t=e.children,r=g.useState(void 0===n?{}:n);return h(X.Provider,{value:[r[0],r[1]]},t)},Z=function(e){var n=e.layout,t=e.context;return h(Q,{context:void 0===t?{}:t},h("article",{className:"page6 "+(void 0===n?"simple":n)},e.children))},ee=function(e){var n=e.children,t=e.siteDictionary,r=g.useState(e.siteLang),o=r[0],i=r[1],a=g.useState(t),u=a[0],l=a[1],c=g.useState("max"),s=c[0],f=c[1],d=g.useState(!1),p=d[0],v=d[1],m=g.useState(null),y=m[0],b=m[1],C=g.useState(!1),S=C[0],w=C[1],_=g.useState(),N=_[0],O=_[1],P=g.useState(),E=P[0],j=P[1],R=g.useState(),x=R[0],T=R[1],A=g.useState(),D=A[0],I=A[1],F=g.useState(),$=F[0],L=F[1],B={lang:o,setLang:i,dictionary:u,setDictionary:l,focused:$,changeFocus:function(e){$&&$.lose(),L(e)},sideNav:s,setSideNav:f,showNav:p,setShowNav:v,info:y,openInfo:function(e){b(e)},closeInfo:function(){b(null)},console:S,toggleConsole:function(){w(!S)},breadcrumb:D,setBreadcrumb:I,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(k.Provider,{value:B},n)},ne=function(e){var n=e.icon;return h(O,{icon:void 0===n?"equalizer":n,title:e.title})},te=function(e){var n=e.children;return g.useContext(k),h("nav",null,n)},re=function(){var e=g.useContext(k);return e.info?h("aside",null,e.info):""},oe=function(e){var n=e.children,t=e.min,r=g.useContext(k),o=r.showNav;g.useEffect(function(){t&&r.setSideNav("min")},[]);var i=n?g.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(g.Fragment,{key:e},i[e].map(function(e){var n=e.id,t=e.icon;return h(b,{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"}))})))},ie=function(e){var n=e.children,t=e.init,r=g.useContext(k),o=r.page;return g.useEffect(function(){r.goto(t||"EMPTY")},[]),h("main",null,g.Children.toArray(n).filter(function(e){return!!e.props&&e.props.id===o}))},ae=function(){var e=g.useContext(k);return e.dialog?e.dialog:""},ue=function(){var e=g.useContext(k);return e.preview?h("div",{className:"site-preview"},e.preview):""},le=function(){return g.useContext(k).console?h("footer",{className:"site-console"},h(O,null,h(I,null,h(F,{label:"Console"}))),h("main",null)):""},ce=function(e){var n=g.useContext(k),t=e.icon,r=e.title,o=void 0===r?"Dialog":r,i=e.children,a=e.actions;return h(g.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(A,{icon:t}):null,h(S,null,o)),h("main",null,i),h("footer",null,a))))},se={STRING:"String",NUMBER:"Number",DATE:"Date",BOOLEAN:"Boolean",ARRAY:"Array",ENTITY:"Object",FUNCTION:"Function",EMAIL:"String"},fe=Object.values(se).reduce(function(e,n){return e["is"+n]=function(e){return toString.call(e)=="[object "+n+"]"},e},{}),de=/*#__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 se.ARRAY:i=fe["is"+r](t),a=t.every(function(e){return u.validate(e)});break;case se.ENTITY:i=fe["is"+r](t),a=u.validate(t);break;case se.NUMBER:i=fe["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 se.STRING:case se.NUMBER:case se.BOOLEAN:t[o]=u||i.default;break;case se.ENTITY:var l=new e(a);t[o]=l.value(u);break;case se.ARRAY:if(a===se.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}(),he=/*#__PURE__*/function(){function e(e,n){this.type=e,this._type=new de(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}(),pe=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(_,{className:"content-form",columns:t,outlined:!0,onChange:o},a.map(function(e){return h(ve,P({key:e.id},e))}))},ve=function(e){switch(e.type){case se.BOOLEAN:return h(w,P({key:e.id},e));case se.NUMBER:return h(ye,P({key:e.id},e));default:return h(me,P({key:e.id},e))}},me=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={})[se.NUMBER]="number",n[se.DATE]="date",n)[r]||"text";return i?h(B,{key:t,id:t,label:o,value:c,onChange:s,options:"function"==typeof i?i():i,outlined:f}):h(L,{key:t,id:t,type:d,label:o,value:c,onChange:s,required:l,outlined:f,textarea:a})},ye=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(B,{key:n,id:n,label:t,value:a,onChange:c,options:r,outlined:l}):h(L,{key:n,id:n,type:"number",label:t,value:a,onChange:c,required:i,outlined:l})},ge=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(ke,{key:e.id,field:e,onChange:o})})))}))},be=function(e){var n=e.content,t=e.filter,r=e.grouped,o=void 0!==r&&r,i=e.onChange,a=g.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(I,{selected:u,onChange:function(e){l(e)}},s.map(function(e){return h(F,{label:e.title})})),h($,{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(g.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(ke,{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(ke,{key:e.id,field:e,onChange:c,content:n})})))})))},Ce=function(e){var n=e.content,t=e.onChange,r=n.value(),o=Object.values(n.type).filter(function(e){return e.type===se.ARRAY}),i=g.useState(),a=i[0],u=i[1];function l(){}return h("div",{className:"content-editor treeded-editor"},h("menu",null,h("header",null,h(S,{use:"caption"},"Tree Editor")),h(W,null,o.map(function(e,n){return h(J,{icon:"folder",label:e.label,actions:[h(b,{small:!0,icon:"add",clickable:!0,action:l})]},r[e.id]?r[e.id].map(function(n,t){return h(G,{icon:n.icon||"description",label:n.name||n.label,onSelect:function(){return function(e,n,t){var o=new he(t.item,n);u({index:e,item:o,node:t,value:r[t.id]})}(t,n,e)}})}):null)}))),h("div",null,a?h(be,{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"))},ke=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 se.ENTITY:return h(Se,{field:n,value:e,onChange:d});case se.STRING:return h(we,{outlined:i,field:n,value:e,onChange:d,content:r});case se.BOOLEAN:return h(w,{outlined:!0,id:a,label:c,value:e,onChange:d});case se.DATE:return h(L,{outlined:i,id:a,type:"date",label:c,value:e,onChange:d,disabled:s});case se.NUMBER:return h(_e,{outlined:i,field:n,value:e,onChange:d});case se.ARRAY:return l===se.STRING?f?h(Oe,{content:r,field:n,value:e,onChange:d}):h(Ne,{field:n,value:e,onChange:d}):h(Pe,{field:n,value:e,onChange:d});default:return h("div",null,c)}}()},Se=function(e){var n=e.field,t=e.value,r=e.onChange,o=n.id,i=n.label,a=new he(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(S,{use:"caption"},i)),h("main",null,c.map(function(e){return h(ke,{key:e.id,field:e,onChange:u})})))},we=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(B,{outlined:i,id:a,label:u,value:r,onChange:s,options:"function"==typeof l?l(n,e.content):l}):h(L,{outlined:i,id:a,label:u,value:r,onChange:s}):h(L,{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(L,{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)}))},Ne=function(e){var n=e.field,t=e.value,r=e.onChange;return h("div",{className:"list-editor"},h(K,{id:n.id,label:n.label,init:void 0===t?[]:t,onChange:function(e,n){r&&r(e,n)}}))},Oe=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(w,{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}})}))},Pe=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 v(e){if(o){var n=r.concat(e);o(i,n)}}function m(e){if(o){var n=r.filter(function(n,t){return t!==e});o(i,n)}}function y(e,n,t){if(o){var a=r.slice();a[e][n]=t,o(i,a)}}var g=Object.values(a).map(function(e){return P({},e,{onChange:y})});g.push({id:"actions",label:"Actions"});var C=r.map(function(e,n){return P({},e,{id:n,actions:[h(b,{icon:"delete",clickable:!0,action:function(){return m(n)},small:!0})]})}),k={columns:g,rows:C};return h("div",{className:"collection-editor"},h("header",null,h(S,{use:"caption"},u),h("div",{className:"actions"},l?h(l,{onAdd:v}):null)),c?h(c,{field:n,value:r,onRemove:m,onChange:o}):h(M,P({},k,{editable:p})),h("footer",null,f?h(Ee,{item:a,onAdd:v}):null))},Ee=function(e){var n=e.item,t=e.onAdd,r=g.useState(!1),o=r[0],i=r[1],a=g.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 P({},e,{type:"String",onChange:s})});f.push({id:"actions",label:""});var d=[{actions:[h(b,{icon:"done",clickable:!0,action:function(){t&&t([u]),c()}}),h(b,{icon:"close",clickable:!0,action:c})]}];return d[0]=Object.assign({},u,d[0]),h("div",{className:"collection-adder"},o?h(M,P({},{columns:f,rows:d},{editable:!0})):h(C,{icon:"add",label:"Add",action:c}))},je=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=g.useContext(k),c=g.useState(o),s=c[0],f=c[1],d=g.useState(!1),p=d[0],v=d[1],m=g.useState([]),y=m[0],b=m[1];function w(e){"OK"===e&&u&&u(Object.assign({},o,s)),l.closeDialog()}var _=h(g.Fragment,null,h(C,{label:"CLOSE",action:function(){return w("CLOSE")}}),h("div",{className:"expand"}),h(C,{label:"OK",action:function(){return w("OK")},disabled:!p,raised:!0})),N=h(S,{use:"headline6"},n),O=new he(t,s);return h(ce,{title:N,open:!0,onAction:w,actions:_},h(ge,{content:O,onChange:function(e){if(f(e),a){var n=a(e),t=n.errors,r=void 0===t?[]:t;v(n.validation),b(r)}else v(!0)},filter:i}),y.map(function(e){return h(S,{use:"overline",tag:"div",className:"error"},e)}))};function Re(e,n){try{var t=e()}catch(e){return n(e)}return t&&t.then?t.then(void 0,n):t}var xe=a(window.API||process.env.REACT_APP_API,l),Te=function(e){var n=e.groupBy,t=g.useContext(X),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(E,{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})},Ae=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=g.useContext(X),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(W,null,function e(t){return t.map(function(t){return h(J,{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(G,{key:e.id,id:e.id,label:e.name,onSelect:n},"item")}))})}(u)))},De=function(e){var n=function(){try{return console.log("saving....."),Promise.resolve(r.update(y)).then(function(){i(Object.assign({},r))})}catch(e){return Promise.reject(e)}},t=g.useContext(X),r=t[0],i=t[1],a=r.selected,u=e.icon,l=e.schema,c=e.layout,s=e.autosave,f=void 0!==s&&s,d=e.delay,p=void 0===d?1e3:d,v=g.useRef(null),m=g.useState(a),y=m[0],k=m[1];function w(e){k(e)}function _(){return!o.default(y,a)}return g.useEffect(function(){k(a)},[a]),g.useEffect(function(){f&&(clearTimeout(v.current),v.current=setTimeout(function(){_()&&n()},p))},[y]),a&&y?h(g.Fragment,null,h(O,{icon:u,title:h(S,null,a.name)},h(b,{icon:"close",clickable:!0,action:function(){r.clear(),i(Object.assign({},r))}}),h(A,{align:"alignRight"},h(T,null,h(D,{label:"Eliminar",onSelect:function(){try{return Promise.resolve(r.remove(a.id)).then(function(){r.clear(),i(Object.assign({},r))})}catch(e){return Promise.reject(e)}}}))),!0===f?null:h(C,{icon:"save",label:"Guardar Cambios",raised:!0,disabled:!_(),action:n})),function(){var n=new he(l,y);switch(c){case"TABBED":return h(be,P({},e,{content:n,onChange:w}));case"TREEDED":return h(Ce,P({},e,{content:n,onChange:w}));default:return h(ge,P({},e,{content:n,onChange:w}))}}()):null},Ie=function(e,n){var t=Fe(e);return{all:[],selected:null,load:function(){try{var e=this,r=Re(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=Re(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=Re(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=Re(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=Re(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=Re(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)}}}},Fe=function(e){return{all:function(){return xe.GET(e)},find:function(n){return xe.GET(e+"/"+n)},create:function(n){var t=JSON.stringify(n);return xe.POST(e,t)},update:function(n){var t=JSON.stringify(n);return xe.PUT(e+"/"+n.id,t)},patch:function(n,t){var r=JSON.stringify(t);return xe.PATCH(e+"/"+n,r)},updateProperty:function(n,t,r){var o=JSON.stringify(r);return xe.PUT(e+"/"+n+"/"+t,o)},remove:function(n){return xe.DELETE(e+"/"+n)}}};e.Button=C,e.CheckBox=w,e.Chip=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(b,{icon:t,size:"small"}):null,h("main",null,h(S,null,r)),o?h("span",{className:"meta"},o):null)},e.Chips=function(e){return h("div",{className:"chips"},e.children)},e.CircularProgress=function(e){return h("div",{className:"circular-progress"},h(b,{icon:"refresh",size:"small"}))},e.CollectionContext=Ie,e.CollectionEditor=Pe,e.CollectionPage=function(e){var n=g.useContext(k),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,p=e.autosave,v=void 0!==p&&p,m=e.delay,y=void 0===m?1e3:m,b=e.actions,w=e.levels,_=g.useContext(X),N=_[0],P=_[1],E=Ie(c,d);return g.useEffect(function(){try{return Promise.resolve(E.load()).then(function(){P(E)})}catch(e){return Promise.reject(e)}},[]),h(g.Fragment,null,h(O,{className:"collection-page",title:h(S,null,i)},h(C,{icon:"add",label:"Add",action:function(){n.openDialog(h(je,{label:"Crear "+u,type:l,onOK:function(e){try{return Promise.resolve(N.create(e)).then(function(){P(Object.assign({},N))})}catch(e){return Promise.reject(e)}}}))}}),h(C,{icon:"refresh",label:"Reload",action:function(){try{return Promise.resolve(N.load()).then(function(){P(Object.assign({},N))})}catch(e){return Promise.reject(e)}}}),b),h("menu",{className:"collection-page"},h(O,{title:h(S,null,"Lista de ",u)}),w?h(Ae,{levels:w}):h(Te,{groupBy:s})),h("main",{key:r,className:"collection-page"},h(De,{icon:o,schema:l,layout:f,autosave:v,delay:y})))},e.Content=he,e.ContentEditor=ge,e.ContentForm=pe,e.CreateContentDialog=function(e){var n=e.label,t=e.type,r=e.validator,o=e.onOK,i=e.onActionClose,a=void 0===i||i,u=g.useContext(k),l=g.useState({}),c=l[0],s=l[1],f=g.useState(!1),d=f[0],p=f[1],v=g.useState([]),m=v[0],y=v[1];function b(e){"OK"===e&&o&&o(c),"CLOSE"!==e&&!0!==a||u.closeDialog()}var w=h(g.Fragment,null,h(C,{label:"CLOSE",action:function(){return b("CLOSE")}}),h(C,{label:"OK",action:function(){return b("OK")},disabled:!d,raised:!0})),_=h(S,{use:"headline6"},n),N=new he(t,c);return h(ce,{title:_,open:!0,onAction:b,actions:w},h(pe,{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;p(n&&t.validation),y(i)}else p(n)}}),m.map(function(e){return h(S,{use:"overline",tag:"div",className:"error"},e)}))},e.DataTable=M,e.Dialog=ce,e.DropDown=B,e.EditContentDialog=je,e.FieldEditor=ke,e.Form=_,e.HTTPClient=a,e.Header=O,e.Icon=b,e.Kanban=function(e){return h("div",{className:"kanban"},e.children)},e.KanbanCard=function(e){return h("div",{className:"kanban-card "+e.color},e.children)},e.KanbanColumn=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=g.useState(void 0!==u&&u),f=s[0],d=s[1];function p(){d(!f)}return f?h("div",{className:"kanban-column "+n+" min"},h("main",null,r),h("footer",null,h(b,{icon:"toggle_off",onIcon:"toggle_on",clickable:!0,action:p}))):h("div",{className:"kanban-column "+n+" "+(c?"disabled":"")},h("header",null,h(b,{icon:t}),h("div",{className:"title"},h(S,{use:"headline6"},r),h(S,{className:"secondary-text",use:"body2"},o)),h("div",{className:"badge"},i)),h("main",null,a),h("footer",null,h(b,{icon:"toggle_off",onIcon:"toggle_on",clickable:!0,action:p})))},e.LinearProgress=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}))},e.List=E,e.ListEditor=Ne,e.LoginBox=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,p=e.message,v=e.loading,m=g.useState(""),y=m[0],k=m[1],w=g.useState(""),_=w[0],N=w[1];function O(){return y&&y.length>0&&_&&_.length>0}function P(e){c&&O()&&c(y,e||_)}function E(e){return h(S,null,e)}return h("div",{className:"login-box"},h("header",null,n?h("img",{src:n}):"",h("div",{className:"title"},h(S,null,t))),h("main",null,h(L,{label:E(o),value:y,onChange:function(e,n){k(n)},onEnter:P,outlined:!0}),h(L,{label:E(a),value:_,onChange:function(e,n){N(n)},onEnter:P,type:"password",outlined:!0})),h("footer",null,d?h(C,{label:E(f),action:function(){d&&d(y)},disabled:!(y&&y.length>0)}):null,v?h("div",{className:"load-box"},h(b,{icon:"refresh"})):h(C,{label:E(l),action:P,disabled:!O(),raised:!0}),p?h("div",{className:"message"},h(S,null,p)):null))},e.Menu=T,e.MenuIcon=A,e.MenuItem=D,e.MenuSeparator=function(e){return h("li",null,"menuSeparator")},e.Page=Z,e.PageContext=X,e.PageProvider=Q,e.Property=function(e){var n=e.value;return h("div",{className:"property"},h("div",{className:"property-name"},e.name),h("div",{className:"property-value"},n))},e.RadioButton=function(e){var n=e.id,t=e.name,r=e.placeholder,o=e.value,i=e.onChange,a=h(S,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))},e.ResetPasswordBox=function(e){var n=e.logo,t=e.title,r=e.children,o=e.onOK,i=e.onClose,a=g.useState({}),u=a[0],l=a[1],c=g.useState(),s=c[0],f=c[1];function d(){return u.password1&&u.password2}function p(e,n){var t,r=Object.assign({},u,((t={})[e]=n,t));l(r)}function v(){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(S,null,t)):null,r),h("main",null,h(S,{use:"headline6"},"Change Password"),h(L,{id:"password1",outlined:!0,icon:"lock",type:"password",label:"New Password",lapse:100,onChange:p,onEnter:v}),h(L,{id:"password2",outlined:!0,icon:"lock",type:"password",label:"Confirm New Password",lapse:100,onChange:p,onEnter:v}),s?h("div",{className:"error"},s):null),h("footer",null,h(C,{label:"Close",action:function(){i&&i()}}),h(C,{label:"OK",raised:!0,disabled:!d(),action:v})))},e.Section=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=g.useState(u),d=f[0],p=f[1];return g.useEffect(function(){p(u)},[u]),h("section",{className:"section2 "+s},h(O,{icon:{icon:n},title:r},l,i?h(b,{icon:"expand_more",onIcon:"expand_less",clickable:!0,action:function(){p(!u)}}):""),d?h("main",null,c):"")},e.Session=l,e.Site=function(e){var n=e.logo,t=e.title,r=e.toolbar,o=e.children,i=e.init,a=e.min;return h(ee,{siteLang:e.lang,siteDictionary:e.dictionary},h("div",{className:"site6"},h(ne,{icon:e.icon}),h(te,null,r),h(oe,{logo:n,title:t,min:a},o),h(ie,{init:i},o,h(Z,{id:"EMPTY"},"EMPTY")),h(re,null),h(le,null),h(ae,null),h(ue,null)))},e.SiteProvider=ee,e.Stack=$,e.TYPES=se,e.Tab=F,e.TabbedContentEditor=be,e.Tabs=I,e.Text=S,e.TextField=L,e.TokenField=K,e.Tree=W,e.TreeItem=G,e.TreeNode=J,e.TreededContentEditor=Ce,e.Viewer=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=g.useState(!1),s=c[0],f=c[1];function d(){f(!s)}var p=h(S,{use:"headline6"},n);return h("div",{className:"viewer"},h(O,{icon:{icon:"close",clickable:!0,action:l},title:p},s?"":h(b,{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(O,{title:"Detalles"},h(b,{icon:"close",clickable:!0,action:d})),h("main",null,r)),u?h("footer",null,h(b,{clickable:!0,icon:"zoom_out"}),h(b,{clickable:!0,icon:"zoom_out_map"}),h(b,{clickable:!0,icon:"zoom_in"})):null)},e.isFunction=function(e){return e&&("[object Function]"===Object.prototype.toString.call(e)||"function"==typeof e||e instanceof Function)}});
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("material-design-icons-iconfont/dist/material-design-icons.css"),require("react"),require("deep-equal"),require("resumablejs")):"function"==typeof define&&define.amd?define(["exports","material-design-icons-iconfont/dist/material-design-icons.css","react","deep-equal","resumablejs"],n):n((e||self).ywanaCore8={},0,e.react,e.deepEqual,e.resumablejs)}(this,function(e,n,t,i,o){function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=/*#__PURE__*/r(t),l=/*#__PURE__*/r(i),u=/*#__PURE__*/r(o),c=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)}},s=function(e,n){return{GET:function(t){var i=n?n.token():null;return c("GET",e+t,void 0,i)},POST:function(t,i){var o=n?n.token():null;return c("POST",e+t,i,o)},PUT:function(t,i){var o=n?n.token():null;return c("PUT",e+t,i,o)},PATCH:function(t,i){var o=n?n.token():null;return c("PATCH",e+t,i,o)},DELETE:function(t){var i=n?n.token():null;return c("DELETE",e+t,void 0,i)}}},d=process.env.REACT_APP_SESSION||window&&window.SESSION?window.SESSION:"YWANA-CORE6-SESSION",f={token:function(){return(sessionStorage.getItem(d)?JSON.parse(sessionStorage.getItem(d)):{}).token},me:function(){return(sessionStorage.getItem(d)?JSON.parse(sessionStorage.getItem(d)):{}).me},init:function(e,n){sessionStorage.setItem(d,JSON.stringify({token:e,me:n}))},refresh:function(e){var n=this.me();sessionStorage.setItem(d,JSON.stringify({token:e,me:n}))},isLoggedIn:function(){return!!sessionStorage.DSSession},logout:function(){sessionStorage.removeItem(d)}},v=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)},m=function(e){var n=e.label,t=e.icon,i=e.action,o=e.disabled,r=void 0!==o&&o,a=e.raised?"raised":e.outlined?"outlined":"normal";return r&&(a+=" disabled"),h("button",{className:"btn "+a,onClick:function(e){r||(e.stopPropagation(),e.preventDefault(),i&&i())}},t?h(v,{icon:t,size:"small"}):null,h("span",null,n))},p=a.default.createContext({}),g=function(e){var n=e.children,i=t.useContext(p);if(i){var o=i.dictionary,r=(void 0===o?{}:o)[n],a=r?r[i.lang]:n;return a?h("span",null,a):""}return n?h("span",null,n):""},b=function(e){var n=e.id,t=e.label,i=e.placeholder,o=e.value,r=e.onChange;function a(e){r&&r(n,e.target.checked)}var l=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:i,checked:!0,value:o,onChange:a}),h("span",{class:"checkmark"}),h("label",{htmlFor:n},l)):h("div",{className:"checkbox",key:n+"0"},h("input",{id:n,type:"checkbox",placeholder:i,value:o,onChange:a}),h("span",{class:"checkmark"}),h("label",{htmlFor:n},l))},C=function(e){var n=e.title,i=e.columns,o=void 0===i?1:i,r=e.children,l=e.outlined,u=e.onChange,c=t.useState([]),s=c[0],d=c[1],f=function(e){return null==e||""===e};t.useEffect(function(){var e=a.default.Children.toArray(r).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,a=n.validation,l=!r||(a?a(i):!f(i));return{id:t,value:i,required:r,validation:a,valid:l}}).filter(function(e){return void 0!==e.id});d(e)},[]),t.useEffect(function(){if(u){var e=s.every(function(e){return!0===e.valid}),n=s.reduce(function(e,n){var t=n.value;return(t||!1===t)&&(e[n.id]=t),e},{});u(n,e)}},[s]);var v=function(e,n){var t=s.find(function(n){return n.id===e});if(t){var i=!t.required||(t.validation?t.validation(n):!f(n));Object.assign(t,{value:n,valid:i}),d(s.slice())}},m=a.default.Children.toArray(r).filter(function(e){return null!==e&&""!==e}).map(function(e){var n=e.props.span,t=void 0===n?1:n,i=a.default.cloneElement(e,{onChange:v,outlined:!!l});return h(y,{style:{gridColumn:"span "+t}},i)}),p={gridTemplateColumns:"repeat("+o+", 1fr)"};return h(t.Fragment,null,n?h("header",{className:"form-header"},h(g,{use:"headline6"},n)):"",h("form",{className:"form-grid",style:p},m))},y=function(e){return h("div",{className:"field-wrapper",style:e.style},e.children)},N=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(v,{icon:e.icon,clickable:e.clickable,action:e.action}):"";r=e.iconSrc?h("img",{className:"header-icon",src:e.iconSrc}):r;var a=e.img?{backgroundImage:"url("+e.img+")"}:{},l=h(g,null,e.title);return h("header",{className:"header "+n+" "+t+" "+i+" "+o+" "+e.className,style:a},r,e.title?h("label",null,l):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 k=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(E,S({},e,{onSelect:r})):h("div",{className:"list"},h("ul",null,t.map(function(e){return h(P,{key:e.id,item:e,onSelect:r})})),i)},E=function(e){var n=e.items,i=e.children,o=e.onSelect,r=e.groupBy,a=(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"},a.map(function(e){return h(t.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(P,{key:e.id,item:e,onSelect:o})})))}),i)},P=function(e){var n=e.item,t=e.onSelect,i=n.id,o=n.icon,r=n.line1,a=n.line2,l=n.meta;return h("li",{id:i,onClick:function(){t&&t(i)}},o?h(v,{icon:o,size:"small"}):null,h("main",null,h("div",{className:"primary-line"},h(g,null,r)),a?h("div",{className:"secondary-line"},h(g,null,a)):null),l?h("div",{className:"meta"},l):null)},O=a.default.createContext({}),w=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,a=t.useState(!1),l=a[0],u=a[1];function c(){u(!l)}return h(O.Provider,{value:[l,u]},h("div",{className:"menu-icon"},h(v,{icon:i,clickable:!0,action:c}),l?h("menu",{className:""+r},o):null,l?h("div",{className:"overlay",onClick:c}):null))},T=function(e){var n=e.icon,i=e.label,o=e.meta,r=e.onSelect,a=t.useContext(O)[1];return h("li",{className:"menu-item",onClick:function(){r&&r(),a(!1)}},n?h(v,{icon:n}):null,h("label",null,i),o?h("div",{className:"meta"},o):null)},j=function(e){return h("div",{className:"circular-progress"},h(v,{icon:"refresh",size:"small"}))},A=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.selected,t=e.onChange,i=a.default.Children.map(e.children,function(e,i){return a.default.cloneElement(e,{selected:i===n,onSelect:function(){t&&t(i)}})});return h("div",{class:"tabs"},i,h("div",{class:"tab-filler"}))},R=function(e){var n=e.onSelect;return h("div",{className:"tab "+(e.selected?"selected":""),onClick:function(){n&&n()}},e.label,e.actions||null)},I=function(e){var n=e.selected,i=void 0===n?0:n,o=a.default.Children.toArray(e.children).filter(function(e,n){return n===i})[0];return h(t.Fragment,null,o)},_=function(e){var n=t.useContext(p),i=e.id,o=e.type,r=void 0===o?"text":o,a=e.label,l=e.placeholder,u=e.value,c=e.readOnly,s=void 0!==c&&c,d=e.onChange,f=e.onEnter,v=e.onClick,m=(a?"":"no-label")+" "+(e.outlined?"textfield-outlined":"textfield"),b=h(g,null,a);return h("div",{className:""+m,onClick:v},h("input",{id:i,type:r,placeholder:l,value:u,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(){n&&n.changeFocus({lose:function(){}})},readOnly:s}),h("span",{className:"bar"}),a?h("label",null,b):null)},F=function(e){var n=t.useContext(p),i=e.id,o=e.options,r=void 0===o?[]:o,a=e.value,l=e.onChange,u=t.useState(!1),c=u[0],s=u[1],d=t.useState(),f=d[0],m=d[1];function g(){n&&n.changeFocus({lose:function(){s(!1)}}),s(!c)}return t.useEffect(function(){if(Array.isArray(r)){var e=r.find(function(e){return e.value===a});e&&m(e.label)}},[a]),h("div",{className:"dropdown"},h(_,S({},e,{onClick:g,value:f})),h(v,{icon:"expand_more",clickable:!0,size:"small",action:g}),1==c?h("menu",null,h("ul",{onClick:function(e){var n=e.target.getAttribute("value"),t=r.find(function(e){return e.value===n});l&&l(i,n),m(t.label),s(!1)}},Array.isArray(r)?r.map(function(e){return h("li",{key:e.value,value:e.value},e.label)}):null)):null)},L=function(e){var n=e.columns,i=void 0===n?[]:n,o=e.rows,r=void 0===o?[]:o,a=e.onRowSelection,l=e.onSort,u=e.editable,c=e.outlined,s=t.useState({})[0];function d(e,n){a&&a(e,n)}function f(e,n){l&&l(e,n)}return h("div",{className:"datatable8 "+(c?"outlined":"")},h("table",null,h("thead",null,h("tr",null,i.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 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,a=0;0===r&&a<t.length;){var l=t[a];l&&(r=i(e[l],o[l],n[l]),a++)}return r})}(r,s).map(function(e){return h(B,{key:e.id,row:e,columns:i,onSelect:d,onDrop:f,editable:u})}))))},B=function(e){var n,i=e.row,o=e.columns,r=void 0===o?[]:o,a=e.onSelect,l=e.editable,u=t.useState(!1),c=u[0],s=u[1],d=c?"expand_more":"expand_less";return h(t.Fragment,null,h("tr",{onClick:function(e){return a(i,e)}},r.map(function(e){return h(K,{row:i,column:e,cell:i[e.id],editable:l})}),i.info?h(v,{icon:d,clickable:!0,action:function(){return s(!c)}}):null),i.info&&c?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)},K=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,a=t.disabled,l=void 0!==a&&a,u=t.min,c=t.max,s=t.onChange,d=t.options;if(o&&s)switch(e){case"ICON":return h(v,{icon:i});case"BOOLEAN":case"Boolean":return h(b,{id:r,value:i,onChange:function(e,t){return s(n.id,e,t)},disabled:l});case"SELECTION":return h(F,{id:r,value:i,placeholder:"--Select--",options:d,onChange:function(e,t){return s(n.id,e,t)}});case"CHECK":return h(b,{id:r,value:i,onChange:function(e,t){return s(n.id,e,t)},disabled:n.disabled});case"CHECKABLE":return i&&i.value?h(b,{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(_,{id:r,value:i,onChange:function(e,t){return s(n.id,e,t)}});case"String":return h(z,{id:r,value:i,options:d,onChange:function(e,t){return s(n.id,e,t)}});case"Number":return h(_,{id:r,type:"number",value:i,min:u,max:c,onChange:function(e,t){return s(n.id,e,t)}});default:return i}else switch(e){case"ICON":return h(v,{icon:i});case"Boolean":return h(q,{id:r,value:i});case"String":return h(U,{id:r,value:i,options:d});default:return i}}(t.type))},q=function(e){var n=e.value;return h(v,{icon:!0===(void 0!==n&&n)?"check_box":"check_box_outline_blank"})},U=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)},z=function(e){var n=e.id,t=e.value,i=void 0===t?"":t,o=e.options,r=e.onChange;function a(e,n){r&&r(e,n)}return h("div",{className:"field-editor string-editor"},o?h(F,{outlined:!0,id:n,value:i,onChange:a,options:o}):h(_,{outlined:!0,id:n,value:i,onChange:a}))},M=function(e){var n=e.id,i=e.label,o=e.init,r=e.onChange,a=t.useRef(!1),l=t.useState(),u=l[0],c=l[1],s=t.useState(o),d=s[0],f=s[1];return t.useEffect(function(){a.current?r&&d&&r(n,d):a.current=!0},[d]),h("div",{className:"tokenField"},h("label",null,i),d.map(function(e,n){return h(Y,{text:e,onDelete:function(){return function(e){var n=d.slice();n.splice(e,1),f(n)}(n)}})}),h("input",{type:"text",value:u,onChange:function(e){c(e.target.value)},onKeyDown:function(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();var n=d.concat(e.target.value);f(n),c("")}if(""===u&&d.length>0&&"Backspace"===e.key){var t=d.slice(0,-1);f(t)}}}))},Y=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"}))},G=function(e){var n=e.nodes;return h("div",{className:"tree"},void 0===n?[]:n,e.children)},H=function(e){var n=e.icon,t=void 0===n?"folder":n,i=e.label,o=e.open,r=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"},i),h("div",{className:"actions"},a)),r)},J=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(v,{icon:void 0===t?"description":t,size:"small",small:!0}),h("div",{className:"label"},i),h("div",{className:"actions"},o))},V=a.default.createContext({}),W=function(e){var n=e.context,i=e.children,o=t.useState(void 0===n?{}:n);return h(V.Provider,{value:[o[0],o[1]]},i)},X=function(e){var n=e.layout,t=e.context;return h(W,{context:void 0===t?{}:t},h("article",{className:"page6 "+(void 0===n?"simple":n)},e.children))},Q=function(e){var n=e.children,i=e.siteDictionary,o=t.useState(e.siteLang),r=o[0],a=o[1],l=t.useState(i),u=l[0],c=l[1],s=t.useState("max"),d=s[0],f=s[1],v=t.useState(!1),m=v[0],g=v[1],b=t.useState(null),C=b[0],y=b[1],N=t.useState(!1),S=N[0],k=N[1],E=t.useState(),P=E[0],O=E[1],w=t.useState(),x=w[0],T=w[1],j=t.useState(),A=j[0],D=j[1],R=t.useState(),I=R[0],_=R[1],F=t.useState(),L=F[0],B=F[1],K={lang:r,setLang:a,dictionary:u,setDictionary:c,focused:L,changeFocus:function(e){L&&L.lose(),B(e)},sideNav:d,setSideNav:f,showNav:m,setShowNav:g,info:C,openInfo:function(e){y(e)},closeInfo:function(){y(null)},console:S,toggleConsole:function(){k(!S)},breadcrumb:I,setBreadcrumb:_,page:P,goto:function(e){O(e)},dialog:x,openDialog:function(e){T(e)},closeDialog:function(){T(null)},preview:A,openPreview:function(e){D(e)},closePreview:function(){D(null)}};return h(p.Provider,{value:K},n)},Z=function(e){var n=e.icon;return h(N,{icon:void 0===n?"equalizer":n,title:e.title})},$=function(e){var n=e.children;return t.useContext(p),h("nav",null,n)},ee=function(){var e=t.useContext(p);return e.info?h("aside",null,e.info):""},ne=function(e){var n=e.children,i=e.min,o=t.useContext(p),r=o.showNav;t.useEffect(function(){i&&o.setSideNav("min")},[]);var a=n?t.Children.toArray(n).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 "+(r?"show":"")},h("main",null,Object.keys(a).map(function(e){return h(t.Fragment,{key:e},a[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===o.page,action:function(){return function(e){o.setShowNav(!1),o.goto(e)}(n)}})}),h("div",{className:"section-divider"}))})))},te=function(e){var n=e.children,i=e.init,o=t.useContext(p),r=o.page;return t.useEffect(function(){o.goto(i||"EMPTY")},[]),h("main",null,a.default.Children.toArray(n).filter(function(e){return!!e.props&&e.props.id===r}))},ie=function(){var e=t.useContext(p);return e.dialog?e.dialog:""},oe=function(){var e=t.useContext(p);return e.preview?h("div",{className:"site-preview"},e.preview):""},re=function(){return t.useContext(p).console?h("footer",{className:"site-console"},h(N,null,h(D,null,h(R,{label:"Console"}))),h("main",null)):""},ae=function(e){var n=t.useContext(p),i=e.icon,o=e.title,r=void 0===o?"Dialog":o,a=e.children,l=e.actions;return h(t.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,i?h(x,{icon:i}):null,h(g,null,r)),h("main",null,a),h("footer",null,l))))},le={STRING:"String",NUMBER:"Number",DATE:"Date",BOOLEAN:"Boolean",ARRAY:"Array",ENTITY:"Object",FUNCTION:"Function",EMAIL:"String"},ue=Object.values(le).reduce(function(e,n){return e["is"+n]=function(e){return toString.call(e)=="[object "+n+"]"},e},{}),ce=/*#__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,a=!0;if(o){var l=new e(o);switch(i){case le.ARRAY:r=ue["is"+i](t),a=t.every(function(e){return l.validate(e)});break;case le.ENTITY:r=ue["is"+i](t),a=l.validate(t);break;case le.NUMBER:r=ue["is"+i](t.value),a=!0;break;default:r=!0,a=!0}}return r&&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 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],a=r.item,l=n?n[o]:null;switch(r.type){case le.STRING:case le.NUMBER:case le.BOOLEAN:t[o]=l||r.default;break;case le.ENTITY:var u=new e(a);t[o]=u.value(l);break;case le.ARRAY:if(a===le.STRING)t[o]=l||[];else{var c=new e(a);t[o]=l?l.map(function(e){return c.value(e)}):[]}break;default:t[o]=r}return t},{})},e}(),se=/*#__PURE__*/function(){function e(e,n){this.type=e,this._type=new ce(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}(),de=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 a=Object.keys(r).map(function(e){return r[e]}).filter(function(e){return!i||i(e)});return console.log(a),h(C,{className:"content-form",columns:t,outlined:!0,onChange:o},a.map(function(e){return h(he,S({key:e.id},e))}))},he=function(e){switch(e.type){case le.BOOLEAN:return h(b,S({key:e.id},e));case le.NUMBER:return h(ve,S({key:e.id},e));default:return h(fe,S({key:e.id},e))}},fe=function(e){var n,t=e.id,i=e.type,o=e.label,r=e.options,a=e.textarea,l=e.required,u=void 0!==l&&l,c=e.value,s=e.onChange,d=e.outlined,f=((n={})[le.NUMBER]="number",n[le.DATE]="date",n)[i]||"text";return r?h(F,{key:t,id:t,label:o,value:c,onChange:s,options:"function"==typeof r?r():r,outlined:d}):h(_,{key:t,id:t,type:f,label:o,value:c,onChange:s,required:u,outlined:d,textarea:a})},ve=function(e){var n=e.id,t=e.label,i=e.options,o=e.required,r=void 0!==o&&o,a=e.value,l=e.onChange,u=e.outlined;function c(e,n){l&&l(e,+n?+n:n)}return i?h(F,{key:n,id:n,label:t,value:a,onChange:c,options:i,outlined:u}):h(_,{key:n,id:n,type:"number",label:t,value:a,onChange:c,required:r,outlined:u})},me=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(be,{key:e.id,field:e,onChange:o})})))}))},pe=function(e){var n=e.content,i=e.filter,o=e.grouped,r=void 0!==o&&o,a=e.onChange,l=t.useState(0),u=l[0],c=l[1];function s(e,t){var i,o=Object.assign({},n.value(),((i={})[e]=t,i));a&&a(o)}var d=n.sections();return h("div",{className:"content-editor tabbed"},h(D,{selected:u,onChange:function(e){c(e)}},d.map(function(e){return h(R,{label:e.title})})),h(I,{selected:u},d.map(function(e){var o=e.fields;return h("section",{key:e.title},h("nav",null," "),h("main",null,r?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(t.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!i||i(e)}).map(function(e){return h(be,{key:e.id,field:e,onChange:s,content:n})}))}):o.filter(function(e){return"id"!==e.id}).filter(function(e){return!i||i(e)}).map(function(e){return h(be,{key:e.id,field:e,onChange:s,content:n})})))})))},ge=function(e){var n=e.content,i=e.onChange,o=n.value(),r=Object.values(n.type).filter(function(e){return e.type===le.ARRAY}),a=t.useState(),l=a[0],u=a[1];function c(){}return h("div",{className:"content-editor treeded-editor"},h("menu",null,h("header",null,h(g,{use:"caption"},"Tree Editor")),h(G,null,r.map(function(e,n){return h(H,{icon:"folder",label:e.label,actions:[h(v,{small:!0,icon:"add",clickable:!0,action:c})]},o[e.id]?o[e.id].map(function(n,t){return h(J,{icon:n.icon||"description",label:n.name||n.label,onSelect:function(){return function(e,n,t){var i=new se(t.item,n);u({index:e,item:i,node:t,value:o[t.id]})}(t,n,e)}})}):null)}))),h("div",null,l?h(pe,{content:l.item,onChange:function(e){var n,t=l.value.slice();t[l.index]=e;var r=Object.assign({},o,((n={})[l.node.id]=t,n));i&&i(r)}}):"select"))},be=function(e){var n=e.field,t=e.onChange,i=e.content,o=e.outlined,r=void 0!==o&&o,a=n.id,l=n.type,u=n.item,c=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(l){case le.ENTITY:return h(Ce,{field:n,value:e,onChange:f});case le.STRING:return h(ye,{outlined:r,field:n,value:e,onChange:f,content:i});case le.BOOLEAN:return h(b,{outlined:!0,id:a,label:c,value:e,onChange:f});case le.DATE:return h(_,{outlined:r,id:a,type:"date",label:c,value:e,onChange:f,disabled:s});case le.NUMBER:return h(Ne,{outlined:r,field:n,value:e,onChange:f});case le.ARRAY:return u===le.STRING?d?h(ke,{content:i,field:n,value:e,onChange:f}):h(Se,{field:n,value:e,onChange:f}):h(Ee,{field:n,value:e,onChange:f});default:return h("div",null,c)}}()},Ce=function(e){var n=e.field,t=e.value,i=e.onChange,o=n.id,r=n.label,a=new se(n.item,void 0===t?{}:t);function l(e,n){var t,r=Object.assign({},a.value(),((t={})[e]=n,t));i&&i(o,r)}var u=a.form(),c=Object.keys(u).map(function(e){return u[e]});return h("div",{className:"entity-editor"},h("header",null,h(g,{use:"caption"},r)),h("main",null,c.map(function(e){return h(be,{key:e.id,field:e,onChange:l})})))},ye=function(e){var n=e.field,t=e.value,i=void 0===t?"":t,o=e.onChange,r=e.outlined,a=n.id,l=n.label,u=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?u?h(F,{outlined:r,id:a,label:l,value:i,onChange:s,options:"function"==typeof u?u(n,e.content):u}):h(_,{outlined:r,id:a,label:l,value:i,onChange:s}):h(_,{outlined:r,id:a,label:l,value:i,onChange:s,readOnly:!0}))},Ne=function(e){var n=e.field,t=e.onChange,i=n.editable;return h("div",{className:"field-editor number-editor"},h(_,{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)}))},Se=function(e){var n=e.field,t=e.value,i=e.onChange;return h("div",{className:"list-editor"},h(M,{id:n.id,label:n.label,init:void 0===t?[]:t,onChange:function(e,n){i&&i(e,n)}}))},ke=function(e){var n=e.field,t=e.value,i=void 0===t?[]:t,o=e.content,r=e.onChange,a=n.id,l=n.options;return h("div",{className:"multiselection-editor"},h("label",null,n.label),("function"==typeof l?l(n,o):l).map(function(e){var n=i.includes(e.value);return h(b,{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(a,i));var n,t}})}))},Ee=function(e){var n=e.field,t=e.value,i=void 0===t?[]:t,o=e.onChange,r=n.id,a=n.item,l=n.label,u=n.Feeder,c=n.Renderer,s=n.Adder,d=void 0===s||s,f=n.editable,m=void 0===f||f;function p(e){if(o){var n=i.concat(e);o(r,n)}}function b(e){if(o){var n=i.filter(function(n,t){return t!==e});o(r,n)}}function C(e,n,t){if(o){var a=i.slice();a[e][n]=t,o(r,a)}}var y=Object.values(a).map(function(e){return S({},e,{onChange:C})});y.push({id:"actions",label:"Actions"});var N=i.map(function(e,n){return S({},e,{id:n,actions:[h(v,{icon:"delete",clickable:!0,action:function(){return b(n)},small:!0})]})}),k={columns:y,rows:N};return h("div",{className:"collection-editor"},h("header",null,h(g,{use:"caption"},l),h("div",{className:"actions"},u?h(u,{onAdd:p}):null)),c?h(c,{field:n,value:i,onRemove:b,onChange:o}):h(L,S({},k,{editable:m})),h("footer",null,d?h(Pe,{item:a,onAdd:p}):null))},Pe=function(e){var n=e.item,i=e.onAdd,o=t.useState(!1),r=o[0],a=o[1],l=t.useState({}),u=l[0],c=l[1];function s(){a(!r)}function d(e,n,t){if(i){var o,r=Object.assign({},u,((o={})[n]=t,o));c(r)}}var f=Object.values(n).map(function(e){return S({},e,{type:"String",onChange:d})});f.push({id:"actions",label:""});var p=[{actions:[h(v,{icon:"done",clickable:!0,action:function(){i&&i([u]),s()}}),h(v,{icon:"close",clickable:!0,action:s})]}];return p[0]=Object.assign({},u,p[0]),h("div",{className:"collection-adder"},r?h(L,S({},{columns:f,rows:p},{editable:!0})):h(m,{icon:"add",label:"Add",action:s}))},Oe=function(e){var n=e.label,i=e.type,o=e.value,r=void 0===o?{}:o,a=e.filter,l=e.validator,u=e.onOK,c=t.useContext(p),s=t.useState(r),d=s[0],f=s[1],v=t.useState(!1),b=v[0],C=v[1],y=t.useState([]),N=y[0],S=y[1];function k(e){"OK"===e&&u&&u(Object.assign({},r,d)),c.closeDialog()}var E=h(t.Fragment,null,h(m,{label:"CLOSE",action:function(){return k("CLOSE")}}),h("div",{className:"expand"}),h(m,{label:"OK",action:function(){return k("OK")},disabled:!b,raised:!0})),P=h(g,{use:"headline6"},n),O=new se(i,d);return h(ae,{title:P,open:!0,onAction:k,actions:E},h(me,{content:O,onChange:function(e){if(f(e),l){var n=l(e),t=n.errors,i=void 0===t?[]:t;C(n.validation),S(i)}else C(!0)},filter:a}),N.map(function(e){return h(g,{use:"overline",tag:"div",className:"error"},e)}))};function we(e,n){try{var t=e()}catch(e){return n(e)}return t&&t.then?t.then(void 0,n):t}var xe=s(window.API||process.env.REACT_APP_API,f),Te=function(e){var n=e.groupBy,i=t.useContext(V),o=i[0],r=i[1],a=o.all,l=void 0===a?[]:a,u=l?l.map(function(e){return{id:e.id,line1:e.name,line2:e.description,content:e}}):[];return h(k,{items:u,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:n})},je=function(e){var n=function(e){try{return r.clear(),a(Object.assign({},r)),Promise.resolve(r.select(e)).then(function(){a(Object.assign({},r))})}catch(e){return Promise.reject(e)}},i=e.levels,o=t.useContext(V),r=o[0],a=o[1],l=r.all,u=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===l?[]:l);return h("main",null,h(G,null,function e(t){return t.map(function(t){return h(H,{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(J,{key:e.id,id:e.id,label:e.name,onSelect:n},"item")}))})}(u)))},Ae=function(e){var n=function(){try{return console.log("saving....."),Promise.resolve(o.update(k)).then(function(){r(Object.assign({},o))})}catch(e){return Promise.reject(e)}},i=t.useContext(V),o=i[0],r=i[1],a=o.selected,u=e.icon,c=e.schema,s=e.layout,d=e.autosave,f=void 0!==d&&d,p=e.delay,b=void 0===p?1e3:p,C=t.useRef(null),y=t.useState(a),k=y[0],E=y[1];function P(e){E(e)}function O(){return!l.default(k,a)}return t.useEffect(function(){E(a)},[a]),t.useEffect(function(){f&&(clearTimeout(C.current),C.current=setTimeout(function(){O()&&n()},b))},[k]),a&&k?h(t.Fragment,null,h(N,{icon:u,title:h(g,null,a.name)},h(v,{icon:"close",clickable:!0,action:function(){o.clear(),r(Object.assign({},o))}}),h(x,{align:"alignRight"},h(w,null,h(T,{label:"Eliminar",onSelect:function(){try{return Promise.resolve(o.remove(a.id)).then(function(){o.clear(),r(Object.assign({},o))})}catch(e){return Promise.reject(e)}}}))),!0===f?null:h(m,{icon:"save",label:"Guardar Cambios",raised:!0,disabled:!O(),action:n})),function(){var n=new se(c,k);switch(s){case"TABBED":return h(pe,S({},e,{content:n,onChange:P}));case"TREEDED":return h(ge,S({},e,{content:n,onChange:P}));default:return h(me,S({},e,{content:n,onChange:P}))}}()):null},De=function(e,n){var t=Re(e);return{all:[],selected:null,load:function(){try{var e=this,i=we(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=we(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=we(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=we(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=we(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=we(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)}}}},Re=function(e){return{all:function(){return xe.GET(e)},find:function(n){return xe.GET(e+"/"+n)},create:function(n){var t=JSON.stringify(n);return xe.POST(e,t)},update:function(n){var t=JSON.stringify(n);return xe.PUT(e+"/"+n.id,t)},patch:function(n,t){var i=JSON.stringify(t);return xe.PATCH(e+"/"+n,i)},updateProperty:function(n,t,i){var o=JSON.stringify(i);return xe.PUT(e+"/"+n+"/"+t,o)},remove:function(n){return xe.DELETE(e+"/"+n)}}},Ie=function(e){var n=t.useRef(),i=t.useState(!1),o=i[0],r=i[1];t.useEffect(function(){var t=e.resumable;t&&n&&t.assignDrop(n.current)},[]);var a=e.state,l=void 0===a?0:a,u=e.label,c=void 0===u?"Add file or drop file here...":u,s=e.error;return h("div",{className:"upload-area6 "+(!0===o?"drag-over":""),onDragOver:function(){r(!0)},onDragLeave:function(){r(!1)},ref:n},0===l?h(_e,{resumable:e.resumable}):"",0===l?h("label",null,c):"",1===l?h(j,{size:"xlarge"}):"",2===l?h(v,{icon:"done_all"}):"",3===l?h(g,{use:"body1"},s):"",e.children)},_e=function(e){var n=e.resumable,i=t.useRef();return t.useEffect(function(){n&&i&&n.assignBrowse(i.current)},[]),h("div",{className:"upload-icon",ref:i},h(v,{icon:"folder_open",clickable:!0}))},Fe=function(e){var n=e.label,i=e.target,o=e.accept,r=e.className,a=e.onSuccess,l=e.onError,c=e.onComplete,s=t.useMemo(function(){var e=new u.default({target:i,chunkSize:1048576,simultaneousUploads:1,testChunks:!1,throttleProgressCallbacks:1,fileType:o});return e.on("fileAdded",S),e.on("fileProgress",k),e.on("fileSuccess",E),e.on("fileError",P),e.on("complete",O),e},[]),d=t.useState(0)[1],f=t.useState(0),v=f[0],m=f[1],p=t.useState(),g=p[0],b=p[1],C=t.useState([]),y=C[0],N=C[1];function S(e){y.push(e),N(y),s.upload()}function k(e){var n=e.progress();d(n)}function E(e,n){m(2),a&&a(e,n)}function P(e,n){b(n),m(3),l&&l(e,n)}function O(){m(0),c&&c(y)}return h("div",{className:"uploader "+r},h(Ie,{resumable:s,state:v,label:n,error:g}))},Le=function(e){var n=e.file,i=e.state,o=e.progress,r=e.error,a=r?h(v,{icon:"image",className:"error"}):h(v,{icon:"image"});return 0!==i?h(t.Fragment,null,h("div",{className:"upload-file"},a,h(g,{use:"body1",tag:"label"},n.fileName),1===i?h(A,{progress:o}):"",1===i?h(v,{icon:"close",clickable:!0}):"",2===i?h(v,{icon:"done"}):"",3===i?h(v,{icon:"error"}):""),r?h("div",{className:"error"},h(g,{use:"overline"},r)):""):""};e.Button=m,e.CheckBox=b,e.Chip=function(e){var n=e.id,t=e.icon,i=e.label,o=e.action,r=e.onSelect,a=e.outlined?"outlined":"normal";return e.selected&&(a+=" selected"),h("div",{className:"chip "+a,onClick:function(e){e.stopPropagation(),e.preventDefault(),r&&r(n)}},t?h(v,{icon:t,size:"small"}):null,h("main",null,h(g,null,i)),o?h("span",{className:"meta"},o):null)},e.Chips=function(e){return h("div",{className:"chips"},e.children)},e.CircularProgress=j,e.CollectionContext=De,e.CollectionEditor=Ee,e.CollectionPage=function(e){var n=t.useContext(p),i=e.id,o=void 0===i?"collection":i,r=e.icon,a=e.title,l=e.name,u=void 0===l?"Collection 1":l,c=e.schema,s=e.url,d=e.groupBy,f=e.editor,v=e.field,b=e.autosave,C=void 0!==b&&b,y=e.delay,S=void 0===y?1e3:y,k=e.actions,E=e.levels,P=t.useContext(V),O=P[0],w=P[1],x=De(s,v);return t.useEffect(function(){try{return Promise.resolve(x.load()).then(function(){w(x)})}catch(e){return Promise.reject(e)}},[]),h(t.Fragment,null,h(N,{className:"collection-page",title:h(g,null,a)},h(m,{icon:"add",label:"Add",action:function(){n.openDialog(h(Oe,{label:"Crear "+u,type:c,onOK:function(e){try{return Promise.resolve(O.create(e)).then(function(){w(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(){w(Object.assign({},O))})}catch(e){return Promise.reject(e)}}}),k),h("menu",{className:"collection-page"},h(N,{title:h(g,null,"Lista de ",u)}),E?h(je,{levels:E}):h(Te,{groupBy:d})),h("main",{key:o,className:"collection-page"},h(Ae,{icon:r,schema:c,layout:f,autosave:C,delay:S})))},e.Content=se,e.ContentEditor=me,e.ContentForm=de,e.CreateContentDialog=function(e){var n=e.label,i=e.type,o=e.validator,r=e.onOK,a=e.onActionClose,l=void 0===a||a,u=t.useContext(p),c=t.useState({}),s=c[0],d=c[1],f=t.useState(!1),v=f[0],b=f[1],C=t.useState([]),y=C[0],N=C[1];function S(e){"OK"===e&&r&&r(s),"CLOSE"!==e&&!0!==l||u.closeDialog()}var k=h(t.Fragment,null,h(m,{label:"CLOSE",action:function(){return S("CLOSE")}}),h(m,{label:"OK",action:function(){return S("OK")},disabled:!v,raised:!0})),E=h(g,{use:"headline6"},n),P=new se(i,s);return h(ae,{title:E,open:!0,onAction:S,actions:k},h(de,{content:P,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(d(e),o){var t=o(e),i=t.errors,r=void 0===i?[]:i;b(n&&t.validation),N(r)}else b(n)}}),y.map(function(e){return h(g,{use:"overline",tag:"div",className:"error"},e)}))},e.DataTable=L,e.Dialog=ae,e.DropDown=F,e.EditContentDialog=Oe,e.FieldEditor=be,e.Form=C,e.HTTPClient=s,e.Header=N,e.Icon=v,e.Kanban=function(e){return h("div",{className:"kanban"},e.children)},e.KanbanCard=function(e){return h("div",{className:"kanban-card "+e.color},e.children)},e.KanbanColumn=function(e){var n=e.id,i=e.icon,o=e.title,r=e.subtitle,a=e.badge,l=e.children,u=e.minified,c=e.disabled,s=void 0!==c&&c,d=t.useState(void 0!==u&&u),f=d[0],m=d[1];function p(){m(!f)}return f?h("div",{className:"kanban-column "+n+" min"},h("main",null,o),h("footer",null,h(v,{icon:"toggle_off",onIcon:"toggle_on",clickable:!0,action:p}))):h("div",{className:"kanban-column "+n+" "+(s?"disabled":"")},h("header",null,h(v,{icon:i}),h("div",{className:"title"},h(g,{use:"headline6"},o),h(g,{className:"secondary-text",use:"body2"},r)),h("div",{className:"badge"},a)),h("main",null,l),h("footer",null,h(v,{icon:"toggle_off",onIcon:"toggle_on",clickable:!0,action:p})))},e.LinearProgress=A,e.List=k,e.ListEditor=Se,e.LoginBox=function(e){var n=e.logo,i=e.title,o=e.userLabel,r=void 0===o?"User":o,a=e.passwordLabel,l=void 0===a?"Password":a,u=e.loginLabel,c=void 0===u?"Log In":u,s=e.onOK,d=e.forgotLabel,f=void 0===d?"Forgot Password ?":d,p=e.onForgot,b=e.message,C=e.loading,y=t.useState(""),N=y[0],S=y[1],k=t.useState(""),E=k[0],P=k[1];function O(){return N&&N.length>0&&E&&E.length>0}function w(e){s&&O()&&s(N,e||E)}function x(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,i))),h("main",null,h(_,{label:x(r),value:N,onChange:function(e,n){S(n)},onEnter:w,outlined:!0}),h(_,{label:x(l),value:E,onChange:function(e,n){P(n)},onEnter:w,type:"password",outlined:!0})),h("footer",null,p?h(m,{label:x(f),action:function(){p&&p(N)},disabled:!(N&&N.length>0)}):null,C?h("div",{className:"load-box"},h(v,{icon:"refresh"})):h(m,{label:x(c),action:w,disabled:!O(),raised:!0}),b?h("div",{className:"message"},h(g,null,b)):null))},e.Menu=w,e.MenuIcon=x,e.MenuItem=T,e.MenuSeparator=function(e){return h("li",null,"menuSeparator")},e.Page=X,e.PageContext=V,e.PageProvider=W,e.Property=function(e){var n=e.value;return h("div",{className:"property"},h("div",{className:"property-name"},e.name),h("div",{className:"property-value"},n))},e.RadioButton=function(e){var n=e.id,t=e.name,i=e.placeholder,o=e.value,r=e.onChange,a=h(g,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},a))},e.ResetPasswordBox=function(e){var n=e.logo,i=e.title,o=e.children,r=e.onOK,a=e.onClose,l=t.useState({}),u=l[0],c=l[1],s=t.useState(),d=s[0],f=s[1];function v(){return u.password1&&u.password2}function p(e,n){var t,i=Object.assign({},u,((t={})[e]=n,t));c(i)}function b(){r&&v()&&(u.password1===u.password2?(f(null),r(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,i?h("div",{className:"title"},h(g,null,i)):null,o),h("main",null,h(g,{use:"headline6"},"Change Password"),h(_,{id:"password1",outlined:!0,icon:"lock",type:"password",label:"New Password",lapse:100,onChange:p,onEnter:b}),h(_,{id:"password2",outlined:!0,icon:"lock",type:"password",label:"Confirm New Password",lapse:100,onChange:p,onEnter:b}),d?h("div",{className:"error"},d):null),h("footer",null,h(m,{label:"Close",action:function(){a&&a()}}),h(m,{label:"OK",raised:!0,disabled:!v(),action:b})))},e.Section=function(e){var n=e.icon,i=e.title,o=void 0===i?"":i,r=e.canCollapse,a=void 0===r||r,l=e.open,u=void 0!==l&&l,c=e.actions,s=e.children,d=e.className,f=t.useState(u),m=f[0],p=f[1];return t.useEffect(function(){p(u)},[u]),h("section",{className:"section2 "+d},h(N,{icon:{icon:n},title:o},c,a?h(v,{icon:"expand_more",onIcon:"expand_less",clickable:!0,action:function(){p(!u)}}):""),m?h("main",null,s):"")},e.Session=f,e.Site=function(e){var n=e.logo,t=e.title,i=e.toolbar,o=e.children,r=e.init,a=e.min;return h(Q,{siteLang:e.lang,siteDictionary:e.dictionary},h("div",{className:"site6"},h(Z,{icon:e.icon}),h($,null,i),h(ne,{logo:n,title:t,min:a},o),h(te,{init:r},o,h(X,{id:"EMPTY"},"EMPTY")),h(ee,null),h(re,null),h(ie,null),h(oe,null)))},e.SiteContext=p,e.SiteProvider=Q,e.Stack=I,e.TYPES=le,e.Tab=R,e.TabbedContentEditor=pe,e.Tabs=D,e.Text=g,e.TextField=_,e.TokenField=M,e.Tree=G,e.TreeItem=J,e.TreeNode=H,e.TreededContentEditor=ge,e.UploadArea=Ie,e.UploadDialog=function(e){var n=e.label,i=e.target,o=e.accept,r=e.onSuccess,a=e.onClose,l=e.onActionClose,u=void 0===l||l,c=t.useContext(p),s=t.useState(),d=s[0],f=s[1],v=t.useState([])[0];function b(e){"CLOSE"!==e&&!0!==u||(c.closeDialog(),a())}var C=h(t.Fragment,null,h(m,{label:"CLOSE",action:function(){return b("CLOSE")}})),y=h(g,{use:"headline6"},n);return h(ae,{title:y,open:!0,onAction:b,actions:C},d?h(Le,{file:d}):h(Fe,{label:n,accept:o,target:i,onComplete:function(e){f(e[0]),r&&r(e[0])}}),v.map(function(e){return h(g,{use:"overline",tag:"div",className:"error"},e)}))},e.UploadFile=Le,e.Uploader=Fe,e.Viewer=function(e){var n=e.title,i=e.src,o=e.info,r=e.actions,a=void 0===r?[]:r,l=e.tools,u=void 0!==l&&l,c=e.onClose,s=t.useState(!1),d=s[0],f=s[1];function m(){f(!d)}var p=h(g,{use:"headline6"},n);return h("div",{className:"viewer"},h(N,{icon:{icon:"close",clickable:!0,action:c},title:p},d?"":h(v,{icon:"info",clickable:!0,action:m}),a),h("main",null,h("div",{className:"resizer"},h("picture",null,h("img",{src:i})))),h("aside",{className:d?"open":""},h(N,{title:"Detalles"},h(v,{icon:"close",clickable:!0,action:m})),h("main",null,o)),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)},e.isFunction=function(e){return e&&("[object Function]"===Object.prototype.toString.call(e)||"function"==typeof e||e instanceof Function)}});
2
2
  //# sourceMappingURL=index.umd.js.map