UNPKG

react-declarative

Version:

A React form builder which interacts with a JSON endpoint to generate nested 12-column grids with input fields and automatic state management in a declarative style. Endpoint is typed by TypeScript guards (IntelliSense available). This tool is based on ma

15 lines (13 loc) • 781 kB
import*as e from"react";import t,{createContext as n,useMemo as r,useContext as o,useState as i,useRef as a,useCallback as l,useEffect as c,useLayoutEffect as u,forwardRef as s,memo as d,Fragment as f,createElement as m,cloneElement as p,lazy as h,Suspense as v}from"react";import{useTheme as g,createTheme as b,ThemeProvider as y,alpha as w}from"@mui/material/styles";import{createMakeAndWithStyles as E,keyframes as x}from"tss-react";import C from"@mui/material/Box";import k from"@mui/material/CircularProgress";import S from"@mui/material/ListItemIcon";import L from"@mui/material/Typography";import N from"@mui/material/MenuItem";import I from"@mui/material/Divider";import M from"@mui/material/Menu";import*as R from"react-dom";import{flushSync as P}from"react-dom";import{v4 as A}from"uuid";import T from"@mui/material/Grid";import{Grid as D,alpha as j,Typography as O,Divider as F,useMediaQuery as _,Accordion as B,AccordionSummary as H,AccordionDetails as W,Paper as z,Box as V,debounce as Y,useTheme as U,lighten as q,Tooltip as $,darken as X,Button as G,List as K,ListItem as Q,ListItemIcon as J,TextField as Z,Avatar as ee,Grow as te,createTheme as ne,ThemeProvider as re}from"@mui/material";import oe from"@mui/material/Checkbox";import ie from"@mui/material/FormControlLabel";import ae from"@mui/material/FormGroup";import le from"@mui/material/Button";import ce from"@mui/material/Stack";import ue from"@mui/material/Autocomplete";import se from"@mui/material/TextField";import de from"@mui/material/Radio";import fe from"@mui/material/Paper";import me from"@mui/material/Modal";import pe from"@mui/material/InputAdornment";import he from"@mui/material/IconButton";import ve from"@mui/material/List";import ge from"@mui/material/ListItemButton";import be from"@mui/icons-material/ArrowDropUp";import ye from"@mui/icons-material/ArrowDropDown";import we from"@mui/icons-material/MoreVert";import Ee from"@mui/material/Fab";import xe from"@mui/material/LinearProgress";import Ce from"@mui/material/Backdrop";import ke from"@mui/material/ListItemText";import Se from"@mui/icons-material/Close";import Le from"@mui/icons-material/RadioButtonChecked";import Ne from"@mui/icons-material/RadioButtonUnchecked";import Ie from"@mui/material/Chip";import Me from"@mui/icons-material/CheckBox";import Re from"@mui/icons-material/CheckBoxOutlineBlank";import Pe from"@mui/material/RadioGroup";import Ae from"@mui/material/Rating";import Te from"dayjs";export{default as dayjs}from"dayjs";import De from"@mui/material/Popover";import je from"@mui/material/Toolbar";import Oe from"@mui/icons-material/KeyboardArrowLeft";import Fe from"@mui/icons-material/KeyboardArrowRight";import _e from"@mui/icons-material/CalendarTodayOutlined";import Be from"@mui/icons-material/ArrowForward";import He from"@mui/icons-material/AlarmOutlined";import We from"@mui/material/Switch";import ze from"@mui/material/Slider";import Ve from"@mui/material/ListItem";import Ye from"@mui/icons-material/Clear";import Ue from"@mui/material/ListSubheader";import qe from"@mui/icons-material/Search";import $e from"@mui/icons-material/ExpandMore";import Xe from"@mui/material/Tab";import Ge from"@mui/material/Tabs";import{createMemoryHistory as Ke,createBrowserHistory as Qe}from"history";import Je from"@mui/material/Dialog";import Ze from"@mui/material/DialogContent";import et from"@mui/material/DialogActions";import tt from"@mui/material/DialogTitle";import nt from"@mui/material/Badge";import rt from"@mui/icons-material/Fullscreen";import ot from"@mui/material/Table";import it from"@mui/material/TableBody";import at from"@mui/material/TableHead";import lt from"@mui/material/TableContainer";import ct from"@mui/material/TableRow";import ut from"@mui/material/TableCell";import st from"@mui/material/TablePagination";import dt from"@mui/material/PaginationItem";import ft from"@mui/material/Pagination";import mt from"@mui/icons-material/ArrowUpward";import pt from"@mui/icons-material/ArrowDownward";import ht from"@mui/material/Tooltip";import vt from"@mui/material/TableSortLabel";import gt from"@mui/icons-material/Add";import bt from"@mui/icons-material/CleaningServicesOutlined";import yt from"@mui/icons-material/Refresh";import wt from"@mui/icons-material/Sort";import Et from"@mui/icons-material/Settings";import xt from"@mui/material/Collapse";import Ct from"@mui/icons-material/ExpandLess";import kt from"@mui/icons-material/NotInterested";import St from"@mui/icons-material/FilterList";import{pathToRegexp as Lt,compile as Nt,match as It}from"path-to-regexp";import{red as Mt}from"@mui/material/colors";import Rt from"@mui/material/AppBar";import Pt from"@mui/material/CssBaseline";import At from"@mui/material/Drawer";import Tt from"@mui/icons-material/Menu";import Dt from"@mui/material/ButtonBase";import jt from"@mui/icons-material/OutlinedFlag";import Ot from"@mui/material/SwipeableDrawer";import Ft from"@mui/material/InputBase";import _t from"@mui/material/Breadcrumbs";import Bt from"@mui/material/Link";import Ht from"@mui/material/ButtonGroup";import Wt from"@mui/icons-material/Palette";import zt from"@mui/icons-material/Remove";import Vt from"@mui/material/Snackbar";import Yt from"@mui/icons-material/KeyboardArrowUp";import Ut from"@mui/material/Box/Box";import qt from"@mui/material/Alert";import $t from"@mui/icons-material/CloudUpload";import Xt from"@mui/icons-material/Delete";import Gt from"@mui/material/Step";import Kt from"@mui/material/StepLabel";import Qt from"@mui/material/Stepper";import*as Jt from"xlsx";import Zt from"dayjs/plugin/isToday";import en from"dayjs/plugin/localeData";import tn from"dayjs/locale/en-gb";import nn from"dayjs/plugin/utc";import rn from"@mui/icons-material/ArrowBackIos";import on from"@mui/icons-material/ArrowForwardIos";import an from"@mui/icons-material/Send";import ln from"@mui/icons-material/Stop";import cn from"@mui/icons-material/KeyboardVoice";import un from"@mui/icons-material/AttachFile";import sn from"@mui/icons-material/Folder";import dn from"@mui/icons-material/ContentCopy";import fn from"@mui/icons-material/AccessTime";import{fileTypeFromBlob as mn}from"file-type/core";import pn from"@mui/material/Avatar";import hn from"@mui/material/ListItemAvatar";import vn from"@mui/icons-material/CloudSync"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var gn=function(e,t){return gn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},gn(e,t)};function bn(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}gn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var yn=function(){return yn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},yn.apply(this,arguments)};function wn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function En(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function l(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}c((r=r.apply(e,t||[])).next())}))}function xn(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}function Cn(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function kn(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function Sn(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function Ln(e){return this instanceof Ln?(this.v=e,this):new Ln(e)}function Nn(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||l(e,t)}))})}function l(e,t){try{(n=o[e](t)).value instanceof Ln?Promise.resolve(n.value.v).then(c,u):s(i[0][2],n)}catch(e){s(i[0][3],e)}var n}function c(e){l("next",e)}function u(e){l("throw",e)}function s(e,t){e(t),i.shift(),i.length&&l(i[0][0],i[0][1])}}function In(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=Cn(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function Mn(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}globalThis.window||(globalThis.window=globalThis);var Rn,Pn=n(null),An=function(t){var n=t.children,o=t.apiRef,i=void 0===o?null:o,a=t.reloadSubject,l=void 0===a?null:a,c=t.changeSubject,u=void 0===c?null:c,s=t.updateSubject,d=void 0===s?null:s,f=r((function(){return{apiRef:i,reloadSubject:l,changeSubject:u,updateSubject:d}}),[i,l,u,d]);return e.createElement(Pn.Provider,{value:f},n)},Tn=E({useTheme:g}).makeStyles,Dn=function(t){var n=t.children,o=g(),i=r((function(){return b(o)}),[o]);return e.createElement(y,{theme:i},n)};!function(e){e.Layout="custom-layout",e.Switch="switch-field",e.YesNo="yesno-field",e.Line="line-field",e.File="file-field",e.Group="group-layout",e.Paper="paper-layout",e.Outline="outline-layout",e.Expansion="expansion-layout",e.Radio="radio-field",e.Checkbox="checkbox-field",e.Text="text-field",e.Date="date-field",e.Time="time-field",e.Progress="progress-field",e.Component="component-field",e.Slider="slider-field",e.Combo="combo-field",e.Choose="choose-field",e.Tree="tree-field",e.Dict="dict-field",e.Init="init-field",e.Phony="phony-field",e.Button="button-field",e.Icon="icon-field",e.Complete="complete-field",e.Items="items-field",e.Rating="rating-field",e.Typography="typography-field",e.Fragment="fragment-layout",e.Div="div-layout",e.Box="box-layout",e.Tabs="tabs-layout",e.Hero="hero-layout",e.Center="center-layout",e.Stretch="stretch-layout",e.Condition="condition-layout"}(Rn||(Rn={})),Object.entries(Rn).forEach((function(e){var t=kn(e,2),n=t[0],r=t[1];Rn[n]=Symbol.for(r)}));var jn=Rn,On=new Set([jn.Group,jn.Box,jn.Paper,jn.Outline,jn.Expansion,jn.Div,jn.Tabs,jn.Hero,jn.Fragment,jn.Center,jn.Stretch,jn.Condition,jn.Layout]),Fn=function(e){return On.has(e)},_n=function(e){var t=e.type;return e.name&&!On.has(t)},Bn=function(e){return"object"==typeof e&&null!==e&&Object.getPrototypeOf(e)===Object.prototype},Hn=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(Array.isArray(e[n])?t[n]=e[n].slice(0):Bn(e[n])?t[n]=Hn(e[n]):t[n]=e[n]);return t},Wn=function(e,t,n){var r=(Array.isArray(t)?t:t.split(".").filter((function(e){return e}))).flatMap((function(e){return"string"==typeof e?e.split("."):e})),o=r.slice(0,r.length-1).reduce((function(e,t){return e&&e[t]}),e),i=kn(r.reverse(),1)[0];try{return o[i]=n,!0}catch(e){return!1}},zn=function(e,t){return(Array.isArray(t)?t:t.split(".").filter((function(e){return e}))).flatMap((function(e){return"string"==typeof e?e.split("."):e})).reduce((function(e,t){return e&&e[t]}),e)},Vn=function(e,t){if(e===t)return!0;if(Bn(e)&&Bn(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Vn(e[n],t[n]))return!1;return!0}return!1};var Yn,Un=function(){function e(){var e=this;this._events={},this.getListeners=function(t){return e._events[t]||[]},this.subscribe=function(t,n){!e._events[t]&&(e._events[t]=[]),e._events[t].push(n)},this.unsubscribe=function(t,n){!e._events[t]&&(e._events[t]=[]),e._events[t]=e._events[t].filter((function(e){return n!==e}))},this.unsubscribeAll=function(){e._events={}},this.once=function(t,n){var r=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return En(e,void 0,void 0,(function(){return xn(this,(function(e){switch(e.label){case 0:return[4,n.apply(void 0,Sn([],kn(o),!1))];case 1:return e.sent(),this.unsubscribe(t,r),[2]}}))}))};return e.subscribe(t,r),function(){e.unsubscribe(t,r)}},this.emit=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return En(e,void 0,void 0,(function(){var e,r;return xn(this,(function(o){switch(o.label){case 0:e=Sn([],kn(this._events&&this._events[t]||[]),!1),r=0,o.label=1;case 1:return r===e.length?[3,4]:[4,e[r].apply(e,Sn([],kn(n),!1))];case 2:o.sent(),o.label=3;case 3:return r++,[3,1];case 4:return[2]}}))}))}}return Object.defineProperty(e.prototype,"hasListeners",{get:function(){return e=this._events,!(0===Object.getOwnPropertySymbols(e).length&&0===Object.getOwnPropertyNames(e).length);var e},enumerable:!1,configurable:!0}),e}(),qn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return e}:1===e.length?e[0]:e.reduce((function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e(t.apply(void 0,Sn([],kn(n),!1)))}}))},$n=function(e){return void 0===e&&(e=1e3),new Promise((function(t){return setTimeout((function(){return t()}),e)}))},Xn=Symbol("cancelable-canceled"),Gn=function(e){var t,n=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new Promise((function(r,o){var i=!1;t&&t(),t=function(){i=!0,r(Xn)};var a=e.apply(void 0,Sn([],kn(n),!1));a.then((function(e){i||r(e)})),a.catch((function(e){i||o(e)}))}))};return n.cancel=function(){t&&t()},n},Kn=function(e){var t=Promise.resolve(),n=void 0,r=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];var a=!1,l=function(){a=!0};return n=n?qn(n,l):l,t=t.then((function(){return En(void 0,void 0,void 0,(function(){return xn(this,(function(t){switch(t.label){case 0:return a?[3,2]:[4,e.apply(void 0,Sn([],kn(o),!1))];case 1:return[2,t.sent()];case 2:return[2,Xn]}}))}))})).finally((function(){r.clear(),n=void 0})),t};return r.clear=function(){t=Promise.resolve(),n=void 0},r.cancel=function(){t=Promise.resolve(),n&&n(),n=void 0},r},Qn=function(e){return requestAnimationFrame(e)},Jn=function(e){return cancelAnimationFrame(e)},Zn=function(e,t){var n;void 0===t&&(t=1e3);var r=null,o=t?setTimeout:Qn,i=t?clearTimeout:Jn,a=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];null!==n&&i(n);var c=function(){r=null,n=null,e.apply(void 0,Sn([],kn(a),!1))};r=c,n=o(c,t)};return a.clear=function(){null!==n&&i(n),n=null,r=null},a.flush=function(){null!==n&&i(n),r&&r(),n=null,r=null},a.pending=function(){return!!r},a},er=Symbol("observer-subscribe"),tr=Symbol("observer-connect"),nr=Symbol("observer-disconnect"),rr=Symbol("observer-connect-listen"),or=Symbol("observer-disconnect-listen"),ir=function(){function e(t){var n=this;this.dispose=t,this.broadcast=new Un,this._isShared=!1,this._subscribe=function(e,t){n.broadcast.subscribe(er,t),e[rr]((function(){n.broadcast.emit(tr)})),e[or]((function(){n.hasListeners||n.broadcast.emit(nr)}))},this._unsubscribe=function(e){n.broadcast.unsubscribe(er,e)},this.tryDispose=function(){n.hasListeners||n._isShared||(n.dispose(),n.broadcast.emit(nr))},this.map=function(t){var r,o=new e(qn((function(){return n.tryDispose()}),(function(){return r()}))),i=function(e){var n=t(e);o.emit(n)};return n._subscribe(o,i),r=function(){return n._unsubscribe(i)},o},this.flatMap=function(t){var r,o=new e(qn((function(){return n.tryDispose()}),(function(){return r()}))),i=function(e){var n=t(e);Array.isArray(n)?n.forEach((function(e){o.emit(e)})):o.emit(n)};return n._subscribe(o,i),r=function(){return n._unsubscribe(i)},o},this.operator=function(e){return e(n)},this.reduce=function(t,r){var o,i=r,a=new e(qn((function(){return n.tryDispose()}),(function(){return o()}))),l=function(e){var n=t(i,e);i=n,a.emit(n)};return n._subscribe(a,l),o=function(){return n._unsubscribe(l)},a},this.split=function(){var t,r=new e(qn((function(){return n.tryDispose()}),(function(){return t()}))),o=function(e){Array.isArray(e)?e.flat(Number.POSITIVE_INFINITY).forEach((function(e){r.emit(e)})):r.emit(e)};return n._subscribe(r,o),t=function(){return n._unsubscribe(o)},r},this.mapAsync=function(t,r){var o,i=new e(qn((function(){return n.tryDispose()}),(function(){return o()}))),a=Kn(t),l=function(e){return En(n,void 0,void 0,(function(){var t,n;return xn(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,a(e)];case 1:return(t=o.sent())!==Xn&&i.emit(t),[3,3];case 2:if(n=o.sent(),!r)throw n;return r(n),[3,3];case 3:return[2]}}))}))};return n._subscribe(i,l),o=qn((function(){return n._unsubscribe(l)}),(function(){return a.clear()})),i},this.filter=function(t){var r,o=new e(qn((function(){return n.tryDispose()}),(function(){return r()}))),i=function(e){t(e)&&o.emit(e)};return n._subscribe(o,i),r=function(){return n._unsubscribe(i)},o},this.tap=function(t){var r,o=new e(qn((function(){return n.tryDispose()}),(function(){return r()}))),i=function(e){t(e),o.emit(e)};return n._subscribe(o,i),r=function(){return n._unsubscribe(i)},o},this.debounce=function(t){var r,o=new e(qn((function(){return n.tryDispose()}),(function(){return r()}))),i=Zn((function(e){o.emit(e)}),t);return n._subscribe(o,i),r=qn((function(){return i.clear()}),(function(){return n._unsubscribe(i)})),o},this.delay=function(t){var r,o=new e(qn((function(){return n.tryDispose()}),(function(){return r()}))),i=!1,a=Kn((function(e){return En(n,void 0,void 0,(function(){return xn(this,(function(n){switch(n.label){case 0:return[4,$n(t)];case 1:return n.sent(),i?[3,3]:[4,o.emit(e)];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))}));return n._subscribe(o,a),r=qn((function(){return a.clear()}),(function(){return n._unsubscribe(a)}),(function(){i=!0})),o},this.emit=function(e){return En(n,void 0,void 0,(function(){return xn(this,(function(t){switch(t.label){case 0:return[4,this.broadcast.emit(er,e)];case 1:return t.sent(),[2]}}))}))},this.connect=function(e){return n.broadcast.subscribe(er,e),n.broadcast.emit(tr),qn((function(){return n.tryDispose()}),(function(){return n._unsubscribe(e)}))},this.once=function(e){var t;return t=n.connect((function(n){e(n),t()}))},this.share=function(){return n._isShared=!0,n},this.repeat=function(t){var r,o;void 0===t&&(t=1e3);var i=new e(qn((function(){return n.tryDispose()}),(function(){return r()}),(function(){return void 0!==o&&clearTimeout(o)}))),a=function(e){void 0!==o&&clearTimeout(o),i.emit(e),n.hasListeners&&(o=setTimeout(a,t,e))};return n._subscribe(i,a),r=function(){return n._unsubscribe(a)},i},this.merge=function(t){var r,o=new e(qn((function(){return n.tryDispose()}),(function(){return r()}))),i=function(e){o.emit(e)};n._subscribe(o,i);var a=function(){};return o[rr]((function(){a=t.connect(i)||function(){}})),r=qn((function(){return n._unsubscribe(i)}),(function(){return a()})),o},this.unsubscribe=function(){n.broadcast.unsubscribeAll(),n.broadcast.emit(nr),n.dispose()},this.toPromise=function(){return new Promise((function(e){n.once((function(t){return e(t)}))}))},this.toIteratorContext=function(){var e=n,t=!1;return{iterate:function(){return Nn(this,arguments,(function(){return xn(this,(function(n){switch(n.label){case 0:return t?[3,4]:[4,Ln(e.toPromise())];case 1:return[4,Ln(n.sent())];case 2:return[4,n.sent()];case 3:return n.sent(),[3,0];case 4:return[2]}}))}))},done:function(){t=!0}}}}return Object.defineProperty(e.prototype,"isShared",{get:function(){return this._isShared},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasListeners",{get:function(){return!!this.broadcast.getListeners(er).length},enumerable:!1,configurable:!0}),e.prototype[rr]=function(e){this.broadcast.once(tr,e)},e.prototype[or]=function(e){this.broadcast.once(nr,e)},e}(),ar=Symbol("react-declarative-subject"),lr=function(){function e(){var e=this;this._emitter=new Un,this.map=function(t){var n,r=new ir((function(){return n()}));return n=e.subscribe(r.emit),r.map(t)},this.flatMap=function(t){var n,r=new ir((function(){return n()}));return n=e.subscribe(r.emit),r.flatMap(t)},this.reduce=function(t,n){var r,o=new ir((function(){return r()}));return r=e.subscribe(o.emit),o.reduce(t,n)},this.mapAsync=function(t,n){var r,o=new ir((function(){return r()}));return r=e.subscribe(o.emit),o.mapAsync(t,n)},this.filter=function(t){var n,r=new ir((function(){return n()}));return n=e.subscribe(r.emit),r.filter(t)},this.tap=function(t){var n,r=new ir((function(){return n()}));return n=e.subscribe(r.emit),r.tap(t)},this.operator=function(t){var n,r=new ir((function(){return n()}));return n=e.subscribe(r.emit),r.operator(t)},this.split=function(){var t,n=new ir((function(){return t()}));return t=e.subscribe(n.emit),n.split()},this.debounce=function(t){var n,r=new ir((function(){return n()}));return n=e.subscribe(r.emit),r.debounce(t)},this.delay=function(t){var n,r=new ir((function(){return n()}));return n=e.subscribe(r.emit),r.delay(t)},this.repeat=function(t){var n,r=new ir((function(){return n()}));return n=e.subscribe(r.emit),r.repeat(t)},this.merge=function(t){var n,r=new ir((function(){return n()}));return n=e.subscribe(r.emit),r.merge(t)},this.subscribe=function(t){return e._emitter.subscribe(ar,t),function(){e._emitter.unsubscribe(ar,t)}},this.unsubscribeAll=function(){e._emitter.unsubscribeAll()},this.once=function(t){return e._emitter.once(ar,t)},this.toPromise=function(){return e.toObserver().toPromise()},this.toIteratorContext=function(){return e.toObserver().toIteratorContext()},this.next=this.next.bind(this),this.toObserver=this.toObserver.bind(this),this.toIteratorContext=this.toIteratorContext.bind(this)}return e.prototype.next=function(e){return En(this,void 0,void 0,(function(){return xn(this,(function(t){switch(t.label){case 0:return[4,this._emitter.emit(ar,e)];case 1:return t.sent(),[2]}}))}))},e.prototype.toObserver=function(){var e,t=new ir((function(){return e()}));return e=this.subscribe(t.emit),t},e}(),cr=function(e){var t,n=0,r=new ir((function(){void 0!==t&&clearTimeout(t)})),o=function(){r.emit(n),n++,t=setTimeout(o,e)};return r[rr]((function(){o()})),r},ur=function(e,t){var n=!1,r=new ir((function(){n=!0}));return r[rr]((function(){En(void 0,void 0,void 0,(function(){var o,i;return xn(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,e()];case 1:return o=a.sent(),n||r.emit(o),[3,3];case 2:if(i=a.sent(),!t)throw i;return t(i),[3,3];case 3:return[2]}}))}))})),r},sr=function(e){var t,n=new ir((function(){void 0!==t&&clearTimeout(t)})),r=function(){t=void 0,n.emit()};return n[rr]((function(){setTimeout(r,e)})),n},dr=function(e){var t=new ir((function(){}));return t[rr]((function(){Array.isArray(e)?e.flat(Number.POSITIVE_INFINITY).forEach((function(e){t.emit(e)})):t.emit(e)})),t},fr=function(e){var t=new ir((function(){document.removeEventListener(e,t.emit)}));if("document"in globalThis){t[rr]((function(){document.addEventListener(e,t.emit)}))}return t},mr=function(e){return{tap:function(t){return e().tap(t)},debounce:function(t){return e().debounce(t)},delay:function(t){return e().delay(t)},repeat:function(t){return e().repeat(t)},filter:function(t){return e().filter(t)},map:function(t){return e().map(t)},flatMap:function(t){return e().flatMap(t)},operator:function(t){return e().operator(t)},reduce:function(t,n){return e().reduce(t,n)},mapAsync:function(t,n){return e().mapAsync(t,n)},merge:function(t){return e().merge(t)},split:function(){return e().split()},connect:function(t){return e().connect(t)},once:function(t){return e().once(t)},unsubscribe:function(){return e().unsubscribe()},share:function(){return e().share()},toPromise:function(){return e().toPromise()},toIteratorContext:function(){return e().toIteratorContext()}}},pr=function(){function e(){}var t;return t=e,e.merge=function(e){var t=(new lr).toObserver();return e.forEach((function(e){e&&(t=t.merge(e))})),t},e.join=function(e,t){var n=void 0===t?{}:t,r=n.race,o=void 0!==r&&r,i=n.buffer,a=void 0===i?[]:i,l=function(){},c=new ir((function(){return l()}));e=e.filter((function(e){return!!e})),a=Sn([],kn(new Array(e.length)),!1).map((function(e,t){return a[t]}));var u=[],s=function(){a.every((function(e){return void 0!==e}))&&(c.emit(Sn([],kn(a),!1)),!o&&a.fill(void 0))};return c[rr]((function(){e.forEach((function(e,t){if(e){var n=e.connect((function(e){a[t]=e,s()}));u.push((function(){return n()}))}})),l=qn.apply(void 0,Sn([],kn(u),!1))})),c},e.unicast=function(e){return yn(yn({},mr(e)),{isUnicasted:!0})},e.multicast=function(e){var t;return yn(yn({},mr((function(){return t||(t=e())[or]((function(){t=void 0})),t}))),{getRef:function(){return t},isMulticasted:!0})},e.createHot=function(e){var t,n=new ir((function(){return t()}));return t=e(n.emit)||function(){},n},e.createCold=function(e){var t=function(){},n=new ir((function(){return t()}));return n[rr]((function(){t=e(n.emit)||function(){}})),n},e.create=t.createCold,e.pipe=function(e,t){var n=function(){},r=new ir((function(){return n()}));return r[rr]((function(){var o=new lr,i=e.connect(o.next),a=t(o,r.emit)||function(){};n=qn((function(){return a()}),(function(){return i()}))})),r},e.fromInterval=cr,e.fromPromise=ur,e.fromDelay=sr,e.fromArray=dr,e.fromEvent=fr,e.fromValue=function(e){var t=new ir((function(){}));return t[rr]((function(){"function"==typeof e?t.emit(e()):t.emit(e)})),t},e.fromSubject=function(e){var t,n=new ir((function(){return t()}));return t=e.subscribe(n.emit),n},e.fromBehaviorSubject=function(e){var t,n=new ir((function(){return t()}));return n[rr]((function(){e.data&&n.emit(e.data)})),t=e.subscribe(n.emit),n},e}(),hr=pr.create((function(e){return document.addEventListener("mousemove",e),function(){return document.removeEventListener("mousemove",e)}})),vr=pr.create((function(e){return document.addEventListener("touchmove",e),function(){return document.removeEventListener("touchmove",e)}})),gr=pr.create((function(e){return document.addEventListener("scroll",e),function(){return document.removeEventListener("scroll",e)}})),br=pr.unicast((function(){var e=0;return pr.merge([hr,vr,gr]).filter((function(){return 20===e||(e+=1,!1)})).tap((function(){e=0})).share()})),yr=function(e){return br.connect(e)},wr=pr.unicast((function(){return pr.create((function(e){return pr.fromEvent("keydown").connect((function(t){"Tab"===t.code&&e()}))})).share()})),Er=pr.unicast((function(){return pr.create((function(e){return document.addEventListener("touchstart",e,{passive:!1}),document.addEventListener("mousedown",e),function(){document.removeEventListener("touchstart",e),document.removeEventListener("mousedown",e)}})).share()})),xr=function(e){var r=n(e||null);return[function(e){var n=e.children,o=e.payload;return t.createElement(r.Provider,{value:o},n)},function(){return o(r)}]},Cr=kn(xr(),2),kr=Cr[0],Sr=Cr[1],Lr=n(null),Nr={},Ir=function(t){var n=t.children,r=t.payload,o=void 0===r?Nr:r;return e.createElement(Lr.Provider,{value:o},n)},Mr=function(){return o(Lr)},Rr=((Yn={})[jn.Checkbox]=!1,Yn[jn.Radio]=null,Yn[jn.Text]="",Yn[jn.Switch]=!1,Yn[jn.Progress]=1,Yn[jn.Slider]=0,Yn[jn.Combo]=null,Yn[jn.Items]=null,Yn[jn.Rating]=3,Yn[jn.Typography]="",Yn[jn.Date]="",Yn[jn.Time]="",Yn[jn.File]=null,Yn[jn.Choose]=null,Yn[jn.Component]=null,Yn[jn.Complete]="",Yn[jn.Init]=null,Yn[jn.YesNo]=null,Yn[jn.Dict]=null,Yn[jn.Tree]=null,Yn),Pr=function(e){var t=Rr[e];return void 0===t?void console.warn("react-declarative One initialValue unknown type ".concat(String(e))):t},Ar=function(e){void 0===e&&(e=[]);var t=[],n=function(e){return void 0===e&&(e=[]),null==e?void 0:e.forEach((function(e){var r=e.fields||[],o=e.child?[e.child]:[];n(Sn(Sn([],kn(r),!1),kn(o),!1)),t.push(e)}))};return n(e),t},Tr=function(e){for(var t,n,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];if(!r.length)return e;var i=r.shift();if(Bn(e)&&Bn(i))for(var a in i)Array.isArray(i[a])?e[a]=i[a].slice(0):Bn(i[a])?(e[a]||Object.assign(e,((t={})[a]={},t)),Tr(e[a],i[a])):Object.assign(e,((n={})[a]=i[a],n));return Tr.apply(void 0,Sn([e],kn(r),!1))},Dr=function(e,t){var n=(Array.isArray(t)?t:t.split(".").filter((function(e){return e}))).flatMap((function(e){return"string"==typeof e?e.split("."):e}));n.slice(0,n.length-1).reduce((function(e,t){return e[t]=e[t]?e[t]:{}}),e)},jr=function(e){var t=kn(i(e),2),n=t[0],r=t[1],o=a(n),c=l((function(e){var t;t="function"==typeof e?e(o.current):e,o.current=t,r(t)}),[]);return[o,c]},Or=Symbol("empty-value"),Fr=function(e){var t=a(Or);return t.current===Or&&(t.current=function(e){return"function"==typeof e?e():e}(e)),t.current},_r=function(e){var t=Fr((function(){return new lr}));return c((function(){var n=void 0;return e&&(n=e.subscribe(t.next)),n}),[e]),t},Br="one-resolve",Hr=function(e){return e},Wr=function(e,t,n){var r={};return e&&Ar(e).filter((function(e){return!n||!e.features||e.features.some((function(e){return n.includes(e)}))})).filter((function(e){return e.type!==jn.Phony})).filter((function(e){return e.type!==jn.Button})).filter((function(e){return e.type!==jn.Icon})).forEach((function(e){if(_n(e)){if(Dr(r,e.name),"function"==typeof e.hidden?e.hidden(t):e.hidden)return;void 0===e.defaultValue?Wn(r,e.name,zn(r,e.name)||Pr(e.type)):"function"==typeof e.defaultValue?Wn(r,e.name,e.defaultValue(t)):Wn(r,e.name,e.defaultValue)}})),r},zr=function(e){var t=e.handler,n=e.fallback,r=e.fields,i=e.features,s=e.payload,d=e.change,f=e.loadStart,m=e.loadEnd,p=e.incomingTransform,h=void 0===p?Hr:p,v=kn(jr(null),2),g=v[0],b=v[1],y=o(Pn),w=y.apiRef,E=y.changeSubject,x=y.reloadSubject,C=y.updateSubject,k=a(!0),S=a(!1),L=_r(E),N=_r(x),I=_r(C);c((function(){var e,o=function(){return En(void 0,void 0,void 0,(function(){var e,o,a,l,c,u,p;return xn(this,(function(v){switch(v.label){case 0:return S.current?[2]:[3,1];case 1:if("function"!=typeof t)return[3,9];e=!0,f&&f(Br),v.label=2;case 2:return v.trys.push([2,6,7,8]),(o=t(s))instanceof Promise?(a=Tr,l=[{},Wr(r,s,i)],c=Hn,[4,o]):[3,4];case 3:return p=a.apply(void 0,l.concat([c.apply(void 0,[v.sent()])])),d(p,!0),k.current&&b(h(p,s)),[3,5];case 4:p=Tr({},Wr(r,s,i),Hn(o)),d(p,!0),k.current&&b(h(p,s)),v.label=5;case 5:return[3,8];case 6:if(u=v.sent(),e=!1,!n)throw u;return n(u),[3,8];case 7:return m&&m(e,Br),S.current=!0,[7];case 8:return[3,10];case 9:t&&!Vn(g.current,t)&&(p=Tr({},Wr(r,s,i),Hn(t)),k.current&&b(h(p,s))),v.label=10;case 10:return[2]}}))}))};o(),e={reload:o,change:function(e,t){void 0===t&&(t=!1),b(h(e,s)),d(e,t)},getData:function(){return yn({},g.current||{})}},"function"==typeof w?w(e):w&&(w.current=e),N.unsubscribeAll(),N.subscribe(e.reload),L.unsubscribeAll(),L.subscribe((function(t){t&&t!==g.current&&e.change(t,!0)})),I.unsubscribeAll(),I.subscribe((function(t){t&&t!==g.current&&e.change(t,!1)}))}),[t]),u((function(){return function(){k.current=!1}}),[]);var M=l((function(){return g.current}),[]);return[g.current,b,M]},Vr=function(e){var t=a(e);return t.current=e,t},Yr=n(null),Ur=function(t){var n=t.children,o=wn(t,["children"]),i=a({}),c=a(!1),u=o.fields,s=void 0===u?[]:u,d=o.features,f=o.change,m=void 0===f?function(){return null}:f,p=o.fallback,h=void 0===p?function(){return null}:p,v=o.handler,g=void 0===v?function(){return{}}:v,b=o.payload,y=o.loadStart,w=o.loadEnd,E=o.incomingTransform,x=kn(zr({handler:g,fallback:h,fields:s,features:d,payload:b,change:m,loadStart:y,loadEnd:w,incomingTransform:E}),3),C=x[0],k=x[1],S=x[2],L=Vr(C),N=l((function(e,t){var n=i.current,r=L.current;k(e),Object.entries(t).forEach((function(e){var t=kn(e,2),r=t[0],o=t[1];n[r]=o})),Object.values(n).some((function(e){return e}))?c.current=!0:(e!==r||c.current)&&(c.current=!1,m(e,!1))}),[]),I=l((function(e){return N(Hn(yn(yn({},L.current),e)),{})}),[]),M=r((function(){return{object:C,setObject:N,changeObject:I,getObjectRef:S}}),[C]);return e.createElement(Yr.Provider,{value:M},!!C&&n)},qr=function(){return o(Yr)},$r=function(){},Xr=function(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=!1);var o=a(!0),i=a(n);return c((function(){return o.current?(o.current=!1,$r):i.current?$r:e()||$r}),t),r((function(){return{resetWatcher:function(){o.current=!0},beginWatch:function(){o.current=!1,i.current=!1},stopWatch:function(){i.current=!0}}}),[])},Gr=function(e){var t=Fr((function(){return new lr}));return Xr((function(){t.next(e)}),[e]),t},Kr=function(){return A()},Qr=Kr(),Jr=function(e){void 0===e&&(e=0);var t=kn(i(Qr),2),n=t[0],r=t[1],o=l((function(){return r(Kr())}),[]);return c((function(){var t;return e&&(t=setTimeout((function(){t=void 0,o()}),e)),function(){void 0!==t&&clearTimeout(t)}}),[n,e,o]),{reloadTrigger:n,doReload:o}},Zr=function(t){var n=t.reloadSubject,r=t.loading,o=t.disabled,l=t.children,s=t.fallback,d=t.Loader,f=void 0===d?function(){return null}:d,m=t.Error,p=void 0===m?function(){return null}:m,h=t.onLoadStart,v=t.onLoadEnd,g=t.payload,b=t.deps,y=void 0===b?[]:b,w=t.throwError,E=void 0!==w&&w,x=kn(i(""),2),C=x[0],k=x[1],S=kn(i(o),2),L=S[0],N=S[1],I=Gr(o);c((function(){return I.subscribe((function(e){e||N(!1)}))}),[]);var M=Jr(),R=M.reloadTrigger,A=M.doReload,T=_r(n);c((function(){return T.subscribe((function(){A()}))}),[]);var D=a(null),j=kn(i(!1),2),O=j[0],F=j[1],_=kn(i(!1),2),B=_[0],H=_[1],W=a(!0),z=r||O;return u((function(){return function(){W.current=!1}}),[]),c((function(){if(!L){D.current&&D.current.cancel();var e=Gn((function(){return En(void 0,void 0,void 0,(function(){var e,t,n;return xn(this,(function(r){switch(r.label){case 0:e=!0,h&&h(),r.label=1;case 1:return r.trys.push([1,5,6,7]),(t=l(g))instanceof Promise?[4,t]:[3,3];case 2:return[2,r.sent()||null];case 3:return[2,t||null];case 4:return[3,7];case 5:throw n=r.sent(),e=!1,n;case 6:return v&&v(e),[7];case 7:return[2]}}))}))}));D.current=e;En(void 0,void 0,void 0,(function(){var t,n,r;return xn(this,(function(o){switch(o.label){case 0:t=!1,W.current&&F(!0),W.current&&H(!1),o.label=1;case 1:return o.trys.push([1,3,4,5]),[4,e()];case 2:return(n=o.sent())===Xn?(t=!0,[2]):(D.current=null,W.current&&queueMicrotask((function(){return P((function(){k(n)}))})),[3,5]);case 3:if(r=o.sent(),W.current&&H(!0),E)throw r;return s&&s(r),[3,5];case 4:return t||W.current&&F(!1),[7];case 5:return[2]}}))}))}}),Sn(Sn([g,L],kn(y),!1),[R],!1)),z?e.createElement(f,{payload:g}):B?e.createElement(p,{payload:g}):e.createElement(e.Fragment,null,C)},eo=function(){function e(e){var t=this;this.target=e,this._status="pending",e.then((function(){return t._status="fulfilled"})),e.catch((function(){return t._status="rejected"}))}return Object.defineProperty(e.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),e}(),to=function(e){var t=void 0,n=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return"pending"!==(null==t?void 0:t.status)&&(t=new eo(e.apply(void 0,Sn([],kn(n),!1)))),null==t?void 0:t.target};return n.clear=function(){t=void 0},n.getStatus=function(){return(null==t?void 0:t.status)||"ready"},n},no=function(e,t){void 0===t&&(t=[]);var n=a(e);return n.current=e,l((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.current.apply(n,Sn([],kn(e),!1))}),t)},ro=function(e,t){var n=void 0===t?{}:t,o=n.onLoadStart,l=n.onLoadEnd,c=n.fallback,s=n.throwError,d=kn(i(!1),2),f=d[0],m=d[1],p=kn(i(!1),2),h=p[0],v=p[1],g=a(!0),b=no(e);u((function(){return function(){g.current=!1}}),[]);var y=r((function(){return to((function(e){return En(void 0,void 0,void 0,(function(){var t,n,r;return xn(this,(function(i){switch(i.label){case 0:t=function(){return En(void 0,void 0,void 0,(function(){var t,n,r;return xn(this,(function(i){switch(i.label){case 0:t=!0,o&&o(),i.label=1;case 1:return i.trys.push([1,5,6,7]),(n=b(e))instanceof Promise?[4,n]:[3,3];case 2:return[2,i.sent()||null];case 3:return[2,n||null];case 4:return[3,7];case 5:throw r=i.sent(),t=!1,r;case 6:return l&&l(t),[7];case 7:return[2]}}))}))},g.current&&m(!0),g.current&&v(!1),n=!1,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,t()];case 2:return[2,i.sent()];case 3:if(r=i.sent(),g.current&&v(!0),s)throw r;return c&&c(r),[3,5];case 4:return n||g.current&&m(!1),[7];case 5:return[2,null]}}))}))}))}),[]);return{loading:f,error:h,execute:y}},oo=function(e){var t=Fr(e),n=a(t),r=l((function(e){var t;t="function"==typeof e?e(n.current):e,n.current=t}),[]);return[n,r]},io={name:"",menu:function(){return null},menuItems:[],onValueChange:function(){return null}},ao=Tn()({container:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch",maxHeight:"45vh",overflowY:"auto",overflowX:"hidden"},content:{flex:1,display:"flex",flexDirection:"column",justifyContent:"stretch"},loader:{position:"absolute",top:0,left:0,right:0,bottom:0,height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"}}),lo=function(t){var n=t.requestSubject,o=ao().classes,a=kn(i(null),2),u=a[0],s=a[1],d=kn(i(0),2),f=d[0],m=d[1],p=kn(oo(io),2),h=p[0],v=p[1],g=kn(oo(0),2),b=g[0],y=g[1],w=qr(),E=w.object,x=w.changeObject,C=Mr(),R=l((function(){m((function(e){return e+1}))}),[]),P=l((function(){m((function(e){return Math.max(e-1,0)}))}),[]),A=ro((function(e){return En(void 0,void 0,void 0,(function(){return xn(this,(function(t){switch(t.label){case 0:return[4,h.current.menu(h.current.name,e,T.current,C,h.current.onValueChange,x)];case 1:return t.sent(),s(null),[2]}}))}))}),{onLoadStart:R,onLoadEnd:P}).execute,T=Vr(E),D=r((function(){return h.current.menuItems.map((function(e){var t=e.isDisabled,n=void 0===t?function(){return!1}:t,r=e.isVisible,o=void 0===r?function(){return!0}:r,i=wn(e,["isDisabled","isVisible"]);return yn(yn({},i),{isDisabled:function(){return n(T.current,C)},isVisible:function(){return o(T.current,C)}})}))}),[h.current.menuItems]),j=Vr(D);return c((function(){return n.subscribe(Kn((function(e){var t=e.event,n=e.menuItems,r=e.menu,o=e.name,i=e.onValueChange;return En(void 0,void 0,void 0,(function(){var e;return xn(this,(function(a){switch(a.label){case 0:return[4,$n(350)];case 1:return a.sent(),y((function(e){return e+1})),v({name:o,menuItems:n,onValueChange:i,menu:r}),e=document.elementFromPoint(t.clientX,t.clientY),s(e||t.target),[2]}}))}))})))}),[]),e.createElement(M,{key:b.current,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},anchorEl:u,open:!!u,onClose:function(){return s(null)},MenuListProps:{disablePadding:!0}},e.createElement("div",{className:o.container},0!==f&&e.createElement("div",{className:o.loader},e.createElement(k,{size:14})),e.createElement("div",{className:o.content},j.current.map((function(t,n){var r=t.label,o=void 0===r?"unknown-label":r,i=t.action,a=void 0===i?"unknown-action":i,l=t.divider,c=t.onClick,u=t.icon,d=t.isDisabled,f=void 0===d?function(){return!1}:d,m=t.isVisible,p=void 0===m?function(){return!0}:m;return e.createElement(Zr,{Loader:function(){return l?null:e.createElement(N,{sx:{visibility:"hidden",minWidth:225}},!!u&&e.createElement(S,null,e.createElement(u,null)),e.createElement(L,{variant:"inherit"},o))},onLoadStart:R,onLoadEnd:P,key:"".concat(b.current,"-").concat(n),payload:C},(function(t){return En(void 0,void 0,void 0,(function(){var n;return xn(this,(function(r){switch(r.label){case 0:return[4,$n(0)];case 1:return r.sent(),[4,f(t)];case 2:return n=r.sent(),[4,p(t)];case 3:return r.sent()?l?[2,e.createElement(I,{orientation:"horizontal"})]:[2,e.createElement(N,{disabled:n,onClick:function(){if(c)return c(T.current,t,h.current.onValueChange,x),void s(null);A(a)},sx:{minWidth:225}},!!u&&e.createElement(S,null,e.createElement(u,null)),e.createElement(L,{variant:"inherit"},o))]:[2,null]}}))}))}))})))))},co=n(null),uo=function(t){var n=t.children,o=_r(),i=r((function(){return{createContextMenu:function(e){var t=e.menuItems,n=void 0===t?[]:t,r=e.onValueChange,i=void 0===r?function(){return null}:r,a=e.menu,l=e.name;return function(e){return En(void 0,void 0,void 0,(function(){return xn(this,(function(t){switch(t.label){case 0:return n?(e.preventDefault(),e.stopPropagation(),(null==n?void 0:n.length)?[4,o.next({name:l,menu:a,event:e,menuItems:n,onValueChange:i})]:[2]):[2];case 1:return[2,t.sent()]}}))}))}},requestSubject:o}}),[]);return e.createElement(co.Provider,{value:i},n,e.createElement(lo,{requestSubject:o}))},so=function(){return o(co)};var fo=function(e){var t=!1,n=null,r=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return t||(t=!0,n=e.apply(void 0,Sn([],kn(r),!1))),n};return r.clear=function(){t=!1},r},mo=function(){return!0},po=function(e,t){var n=e.compute,r=e.type,o=e.readTransform,i=e.name,a=e.object,l=e.payload,c=e.config;if(n&&c.WITH_SYNC_COMPUTE){var u=t?n(a,l):Pr(r);return!(u instanceof Promise)&&u}return!(n||!i)&&(o(zn(a,i),i,a,l)||Pr(r))},ho=function(e,t){var n=void 0===t?{}:t,r=n.allowedErrors,o=n.fallback,i=n.defaultValue,a=void 0===i?null:i;return function(){for(var t,n,i=[],l=0;l<arguments.length;l++)i[l]=arguments[l];try{var c=e.apply(void 0,Sn([],kn(i),!1));return c instanceof Promise?function(e,t){var n=t.fallback,r=t.defaultValue;return En(void 0,void 0,void 0,(function(){var t;return xn(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e];case 1:return[2,o.sent()];case 2:return t=o.sent(),n&&n(t),[2,r];case 3:return[2]}}))}))}(c,{fallback:o,defaultValue:a}):c}catch(e){if(o&&o(e),r){try{for(var u=Cn(r),s=u.next();!s.done;s=u.next()){if(e instanceof s.value)return a}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}throw e}return a}}},vo=function(){return!1},go=function(){return!0},bo=function(){return null},yo=function(){return null},wo=function(){return!1},Eo=function(e,t,n){var r="".concat(t,"(").concat(e||"unknown",")");return function(e){console.error("react-declarative ".concat(r," ").concat(n," exception"),e)}},xo=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=[];return e.forEach((function(e){if(e)if("string"==typeof e)n.push(e);else if(Array.isArray(e)){if(e.length){var t=xo.apply(void 0,Sn([],kn(e),!1));t&&n.push(t)}}else"object"==typeof e&&(e.toString!==Object.prototype.toString?n.push(e.toString()):Object.entries(e).filter((function(e){var t=kn(e,2);return t[0],!!t[1]})).forEach((function(e){var t=kn(e,1)[0];return n.push(t)})))})),n.join(" ")},Co="12",ko=function(e){return Number(e)},So=Tn()({root:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch"},container:{flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch",width:"100%","& > *":{flex:1}}}),Lo=function(t,n){var o=t.className,i=t.style,a=t.sx,l=t.columns,c=void 0===l?"":l,u=t.phoneColumns,s=void 0===u?"":u,d=t.tabletColumns,f=void 0===d?"":d,m=t.desktopColumns,p=void 0===m?"":m,h=t.fieldRightMargin,v=void 0===h?"1":h,g=t.fieldBottomMargin,b=void 0===g?"2":g,y=t.children,w=t.onClick,E=t.onFocus,x=t.onContextMenu,k=wn(t,["className","style","sx","columns","phoneColumns","tabletColumns","desktopColumns","fieldRightMargin","fieldBottomMargin","children","onClick","onFocus","onContextMenu"]),S=So().classes,L=r((function(){return{xs:ko(s||c||Co),sm:ko(f||c||Co),md:ko(f||c||Co),lg:ko(p||c||Co),xl:ko(p||c||Co),mr:ko(v),mb:ko(b)}}),[]),N=L.xs,I=L.sm,M=L.md,R=L.lg,P=L.xl,A=L.mr,D=L.mb;return e.createElement(T,yn({},k,{ref:n,item:!0,className:xo(o,S.root),style:i,onFocus:E,onClick:w,xs:N,sm:I,md:M,lg:R,xl:P,sx:a,onContextMenu:x}),e.createElement(C,{className:S.container,mr:A,mb:D},y))};Lo.displayName="Item";var No=s(Lo),Io=function(t,n){var o=t.className,i=t.style,a=t.children,l=t.onFocus,c=t.onClick,u=t.isBaselineAlign,s=t.columnsOverride,d=t.sx,f=t.onContextMenu,m=wn(t,["className","style","children","onFocus","onClick","isBaselineAlign","columnsOverride","sx","onContextMenu"]),p=r((function(){return s&&Number(s)}),[]);return e.createElement(D,yn({},m,{ref:n,container:!0,alignItems:u?"flex-end":"flex-start",className:o,style:i,onClick:c,onFocus:l,columns:p,onContextMenu:f,sx:d}),a)};Io.displayName="Container";var Mo=s(Io),Ro=Tn()({root:{position:"relative","& > *":{width:"100%"}}}),Po=function(t,n){var r=t.className,o=void 0===r?"":r,i=t.columns,a=void 0===i?"":i,l=t.phoneColumns,c=void 0===l?"":l,u=t.tabletColumns,s=void 0===u?"":u,d=t.desktopColumns,f=void 0===d?"":d,m=t.children,p=t.isItem,h=t.isBaselineAlign,v=t.style,g=t.columnsOverride,b=t.sx,y=t.fieldRightMargin,w=void 0===y?"1":y,E=t.fieldBottomMargin,x=void 0===E?"2":E,C=t.onClick,k=t.onFocus,S=t.onContextMenu,L=wn(t,["className","columns","phoneColumns","tabletColumns","desktopColumns","children","isItem","isBaselineAlign","style","columnsOverride","sx","fieldRightMargin","fieldBottomMargin","onClick","onFocus","onContextMenu"]),N=Ro().classes;return p?e.createElement(No,yn({},L,{ref:n,className:xo(N.root,o),style:v,columns:a,phoneColumns:c,tabletColumns:s,desktopColumns:f,fieldRightMargin:w,fieldBottomMargin:x,onFocus:k,onClick:C,onContextMenu:S,sx:b}),m):e.createElement(Mo,yn({},L,{ref:n,className:xo(N.root,o),isBaselineAlign:h,columnsOverride:g,style:v,onFocus:k,onContextMenu:S,onClick:C,sx:b}),m)};Po.displayName="Group";var Ao=s(Po),To=function(e){if(e){if(e.includes(".")){var t=e.split(".");e=kn(t.reverse(),1)[0]}var n=kn(e.split("_")),r=n[0],o=n.slice(1);return Sn(["".concat(r.charAt(0).toUpperCase()).concat(r.slice(1))],kn(o),!1).join(" ")}},Do={WITH_DIRTY_CLICK_LISTENER:!0,WITH_MOBILE_READONLY_FALLBACK:!0,WITH_WAIT_FOR_MOVE_LISTENER:!0,WITH_WAIT_FOR_TAB_LISTENER:!0,WITH_WAIT_FOR_TOUCH_LISTENER:!0,WITH_DISMOUNT_LISTENER:!0,WITH_SYNC_COMPUTE:!1,CUSTOM_FIELD_DEBOUNCE:800,FIELD_BLUR_DEBOUNCE:100},jo=function(){var e=this;this._config=Do,this.getRef=function(){return e._config},this.setValue=function(t){Object.assign(e._config,Do,t)}},Oo=Symbol("get-reference"),Fo=function(){function e(){}var t;return t=Oo,e.instance=new jo,e[t]=e.instance.getRef,e.setValue=e.instance.setValue,e}(),_o={display:"flex",alignItems:"stretch",justifyContent:"stretch"},Bo=Tn()((function(e){var t,n,r;return{root:yn(yn({},_o),{"& > *":yn(yn({},_o),{flexGrow:1}),"& > * > *":{flexGrow:1},pointerEvents:"all"}),hidden:{display:"none !important"},fieldReadonly:{"& > *":{pointerEvents:"none !important"}},phoneHidden:(t={},t[e.breakpoints.only("xs")]={display:"none !important"},t),tabletHidden:(n={},n[e.breakpoints.between("sm","lg")]={display:"none !important"},n),desktopHidden:(r={},r[e.breakpoints.up("lg")]={display:"none !important"},r)}})),Ho=function(e){return console.log({v:e})},Wo=function(){return null},zo=function(){return null},Vo=function(e){return e},Yo=function(){},Uo=function(){return null},qo=function(){return null},$o=function(e){return e},Xo=function(e){return e};function Go(t,n){var o=this;void 0===n&&(n={withApplyQueue:!1,skipDirtyClickListener:!1,skipClickListener:!1,skipFocusReadonly:!1,skipFocusBlurCall:!1,skipDebounce:!1,defaultProps:{}});var a=d(t),s=Fo[Oo](),f=function(d){var f,m,p,h,v,g,b,y=d.className,w=void 0===y?"":y,E=d.sx,x=d.columns,C=void 0===x?"":x,k=d.phoneColumns,S=void 0===k?"":k,L=d.tabletColumns,N=void 0===L?"":L,I=d.desktopColumns,M=void 0===I?"":I,R=d.phoneHidden,P=void 0!==R&&R,A=d.tabletHidden,T=void 0!==A&&A,D=d.desktopHidden,j=void 0!==D&&D,O=d.isDisabled,F=d.isVisible,_=d.isInvalid,B=d.isIncorrect,H=d.isReadonly,W=d.readTransform,z=void 0===W?$o:W,V=d.writeTransform,Y=void 0===V?Xo:V,U=d.change,q=void 0===U?Ho:U,$=d.fallback,X=void 0===$?Wo:$,G=d.ready,K=void 0===G?zo:G,Q=d.compute,J=d.shouldRecompute,Z=d.click,ee=void 0===Z?Yo:Z,te=d.map,ne=void 0===te?Vo:te,re=d.object,oe=d.name,ie=void 0===oe?"":oe,ae=d.title,le=void 0===ae?To(ie)||void 0