tocco-devcon 3.11.0 → 3.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/changelog.md CHANGED
@@ -1,3 +1,8 @@
1
+ 3.11.1
2
+ - merge ModalDisplay and BlockingDisplay into OverlayDisplay
3
+ - show error id for actions
4
+ - fix clear number field via auto complete
5
+
1
6
  3.11.0
2
7
  - initial release for version 3.11
3
8
 
@@ -1 +1 @@
1
- "use strict";(self.webpackChunktocco_devcon=self.webpackChunktocco_devcon||[]).push([[26],{42026:(e,t,r)=>{r.r(t),r.d(t,{default:()=>a});var c,n=r(52536),o=(r(3268),r(86692)),i=r(80560),s=r(30392),p=r(67664),l=(0,i.cp)(s.c).withConfig({displayName:"StyledIcon"})(c||(c=(0,o.c)(["\n color: ",";\n"])),p.Il.color("loadingSpinner")),f=r(17624);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,c)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){(0,n.c)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const a=function(e){var t=e.size,r=e.style,c=e.icon;return(0,f.jsx)(l,O(O({},r),{},{style:{fontSize:t},spin:!0,icon:c||"circle-notch"}))}}}]);
1
+ "use strict";(self.webpackChunktocco_devcon=self.webpackChunktocco_devcon||[]).push([[26],{42026:(e,t,r)=>{r.r(t),r.d(t,{default:()=>a});var c,n=r(52536),o=(r(3268),r(86692)),i=r(76548),s=r(30392),p=r(67664),l=(0,i.cp)(s.c).withConfig({displayName:"StyledIcon"})(c||(c=(0,o.c)(["\n color: ",";\n"])),p.Il.color("loadingSpinner")),f=r(17624);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,c)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){(0,n.c)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const a=function(e){var t=e.size,r=e.style,c=e.icon;return(0,f.jsx)(l,O(O({},r),{},{style:{fontSize:t},spin:!0,icon:c||"circle-notch"}))}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunktocco_devcon=self.webpackChunktocco_devcon||[]).push([[32],{29032:(e,n,t)=>{t.r(n),t.d(n,{default:()=>pn});var r,i,a=t(96684),s=t(15888),o=t(31056),l=t(52328),c=t(67848),d=(t(3268),t(69624)),u=t(86692),g=t(80560),p=g.cp.input.withConfig({displayName:"StyledInput"})(r||(r=(0,u.c)(["\n && {\n ","\n }\n"])),o.cZ),h=g.cp.div.withConfig({displayName:"StyledInputWrapper"})(i||(i=(0,u.c)(["\n && {\n ","\n }\n"])),o.m4),f=t(17624);const x=function(e){var n=e.fragments,t=e.selectedFragments,r=e.disabled,i=e.setFragmentSelected;return(0,f.jsx)(f.Fragment,{children:n.map((function(e){return(0,f.jsxs)("div",{children:[(0,f.jsx)("input",{type:"checkbox",id:e.id,checked:t.includes(e.id),onChange:(n=e.id,function(e){i(n,e.target.checked)}),disabled:r}),(0,f.jsx)(o.Oi.Label,{for:e.id,children:e.label})]},e.id);var n}))})};const m=function(e){var n=e.version,t=e.modules,r=e.selectedModules,i=e.fragments,a=e.selectedFragments,s=e.ignoreErrors,l=e.running,c=e.disabled,u=e.executeDbRefactoring,g=e.loadModules,m=e.loadFragments,j=e.setSelectedModules,v=e.setFragmentSelected,b=e.setVersion,y=e.setIgnoreErrors;(0,d.useEffect)((function(){0===t.length&&g(),0===i.length&&m()}),[]);return(0,f.jsxs)("form",{onSubmit:function(e){e.preventDefault(),u()},children:[(0,f.jsx)(o._i,{label:"Modules (none selected => all)",hasValue:r.length>0,children:(0,f.jsx)(o.M1,{options:t,value:r,onChange:j,isMulti:!0,immutable:c})}),(0,f.jsx)(o._i,{label:"Fragments",fixLabel:!0,children:(0,f.jsx)(x,{fragments:i,selectedFragments:a,disabled:c,setFragmentSelected:v})}),(0,f.jsx)(o._i,{label:"Version",hasValue:n.length>0,children:(0,f.jsx)(h,{children:(0,f.jsx)(p,{value:n,onChange:function(e){var n=e.target.value.replaceAll(/[^\d\\.]/g,"");b(n)},disabled:c})})}),(0,f.jsx)(o._i,{label:"Ignore errors",fixLabel:!0,children:(0,f.jsx)("input",{type:"checkbox",checked:s,onChange:function(e){y(e.target.checked)},disabled:c})}),(0,f.jsx)(o.q,{type:"submit",label:"Execute",look:"raised",pending:l,disabled:c})]})};var j={loadModules:c.Az,loadFragments:c.At,setSelectedModules:c.st,setFragmentSelected:c.K0,setVersion:c.gF,setIgnoreErrors:c.gz,executeDbRefactoring:c.Ef};const v=(0,l.Ul)((function(e){var n=e.dbRefactoring,t=n.dbRefactoring,r=n.languageUpgrade;return{version:t.version,modules:t.modules,selectedModules:t.selectedModules,fragments:t.fragments,selectedFragments:t.selectedFragments,ignoreErrors:t.ignoreErrors,running:t.running,disabled:t.running||r.running}}),j)(m);const b=function(e){var n=e.language,t=e.running,r=e.disabled,i=e.executeLanguageUpgrade,a=e.setLanguage;return(0,f.jsxs)("form",{onSubmit:function(e){e.preventDefault(),i()},children:[(0,f.jsx)(o._i,{label:"Language",hasValue:n.length>0,children:(0,f.jsx)(h,{children:(0,f.jsx)(p,{value:n,onChange:function(e){a(e.target.value)},disabled:r})})}),(0,f.jsx)(o.q,{type:"submit",label:"Execute language upgrade",look:"raised",pending:t,disabled:r})]})};var y={setLanguage:c.yC,executeLanguageUpgrade:c.ec};const S=(0,l.Ul)((function(e){var n=e.dbRefactoring,t=n.dbRefactoring,r=n.languageUpgrade;return{language:r.language,running:r.running,disabled:r.running||t.running}}),y)(b);var k,C,w,N;const L=function(){return(0,f.jsxs)(f.Fragment,{children:[k||(k=(0,f.jsx)(o.Oi.H1,{children:"Database Refactoring"})),C||(C=(0,f.jsx)(v,{})),w||(w=(0,f.jsx)(o.Oi.H1,{children:"Language Upgrade"})),N||(N=(0,f.jsx)(S,{}))]})};var E,F,M,O,q,R,U,V=t(32920),D={ERROR:"#a00"},G=g.cp.div.withConfig({displayName:"StyledLogTable"})(E||(E=(0,u.c)(["\n display: grid;\n gap: 1px;\n"]))),A=g.cp.div.withConfig({displayName:"StyledLogEntry"})(F||(F=(0,u.c)(["\n display: grid;\n height: fit-content;\n grid-template-columns: repeat(3, 1fr);\n padding: 1em;\n ","\n"])),(function(e){return"border: 1px solid ".concat(D[e.level]||"#ddd",";")})),I=g.cp.span.withConfig({displayName:"StyledMessage"})(M||(M=(0,u.c)(["\n grid-column: 1 / 3;\n ","\n\n && {\n ","\n }\n"])),(function(e){return e.expandable&&"cursor: pointer;"}),(0,o.Gj)()),T=g.cp.span.withConfig({displayName:"StyledTime"})(O||(O=(0,u.c)(["\n grid-column-start: 3;\n text-align: right;\n\n && {\n ","\n }\n"])),(0,o.Gj)()),_=g.cp.div.withConfig({displayName:"StyledExceptionDetails"})(q||(q=(0,u.c)(["\n margin-top: 1em;\n"]))),z=g.cp.div.withConfig({displayName:"StyledDetailMessage"})(R||(R=(0,u.c)(["\n margin-bottom: 1em;\n\n && {\n ","\n }\n"])),(0,o.Gj)()),H=g.cp.div.withConfig({displayName:"StyledStackTrace"})(U||(U=(0,u.c)(["\n && {\n ","\n }\n"])),(0,o.Gj)()),P=function(e){return"".concat(e.declaringClass,".").concat(e.methodName,":").concat(e.lineNumber)};const X=function(e){var n=e.exception;return(0,f.jsxs)(_,{children:[(0,f.jsx)(z,{children:n.detailMessage}),(0,f.jsx)(H,{children:n.stackTrace.map((function(e,n){return(0,f.jsx)("div",{children:P(e)},n)}))})]})};const B=function(e){var n=e.entry,t=(0,d.useState)(!1),r=(0,V.c)(t,2),i=r[0],a=r[1];return(0,f.jsxs)(A,{level:n.level,children:[(0,f.jsx)(I,{onClick:function(){n.exception&&a(!i)},expandable:!!n.exception,children:n.message}),(0,f.jsx)(T,{children:new Date(n.timestamp).toLocaleString()}),i&&(0,f.jsx)(X,{exception:n.exception})]})};var Q;const J=function(e){var n=e.entries;return(0,f.jsx)(G,{children:n.length>0?n.map((function(e){return(0,f.jsx)(B,{entry:e},e.key)})):Q||(Q=(0,f.jsx)(o.Oi.Span,{children:"No entries so far."}))})};const W=(0,l.Ul)((function(e){return{entries:e.log.entries}}),{})(J);var K,Y;const Z=function(){return(0,f.jsxs)(f.Fragment,{children:[K||(K=(0,f.jsx)(o.Oi.H1,{children:"Log"})),Y||(Y=(0,f.jsx)(W,{}))]})};var $,ee,ne=t(47344),te=g.cp.div.withConfig({displayName:"StyledCheckEventGroup"})($||($=(0,u.c)(["\n margin: 1em 0;\n border: 1px solid #ddd;\n border-radius: 5px;\n padding: 1em;\n"]))),re=g.cp.div.withConfig({displayName:"StyledGroupHeading"})(ee||(ee=(0,u.c)(["\n margin-bottom: 1em;\n"])));function ie(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(!e)return;if("string"==typeof e)return ae(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ae(e,n)}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==t.return||t.return()}finally{if(o)throw a}}}}function ae(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}const se=function(e){var n=e.type,t=e.events,r=e.selection,i=e.setSelected,a=function(e,n){var t,r=ie(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(!n.has(i.id))return!1}}catch(e){r.e(e)}finally{r.f()}return!0}(t,r);return(0,f.jsxs)(te,{children:[(0,f.jsxs)(re,{children:[(0,f.jsx)("input",{type:"checkbox",id:"checkbox-"+n,checked:a,onChange:function(e){i(t.map((function(e){return e.id})),e.target.checked)}}),(0,f.jsx)(o.Oi.Label,{for:"checkbox-"+n,children:(0,f.jsxs)(o.Oi.B,{children:[n," (",t.length,")"]})})]}),t.map((function(e){return(0,f.jsxs)("div",{children:[(0,f.jsx)("input",{type:"checkbox",id:"checkbox-"+e.id,checked:r.has(e.id),onChange:(n=e.id,function(e){i([n],e.target.checked)})}),(0,f.jsx)(o.Oi.Label,{for:"checkbox-"+e.id,children:e.label})]},e.id);var n}))]})};const oe=function(e){var n=e.checkEvents,t=e.selection,r=e.setSelected,i=e.generateSql,a=e.generateChangelog;return(0,f.jsxs)("div",{children:[Object.keys(n).length>0&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(o.q,{look:"raised",onClick:i,disabled:0===t.size,children:["Generate SQL ",t.size>0&&"(".concat(t.size,")")]}),(0,f.jsxs)(o.q,{look:"raised",onClick:a,disabled:0===t.size,children:["Generate Changelog ",t.size>0&&"(".concat(t.size,")")]})]}),(0,f.jsx)("div",{children:Object.keys(n).sort((function(e,n){return e.localeCompare(n)})).map((function(e){return(0,f.jsx)(se,{type:e,events:n[e],selection:t,setSelected:r},e)}))})]})};var le={setSelected:ne.Si,generateSql:ne.eI,generateChangelog:ne.gv};const ce=(0,l.Ul)((function(e){return{checkEvents:e.modelValidation.checkEvents,selection:e.modelValidation.selection}}),le)(oe);var de,ue,ge,pe=g.cp.div.withConfig({displayName:"StyledProgressBar"})(de||(de=(0,u.c)(["\n width: 100%;\n border: 1px solid #ddd;\n height: 20px;\n position: relative;\n margin: 1em 0;\n"]))),he=g.cp.div.withConfig({displayName:"StyledInnerProgress"})(ue||(ue=(0,u.c)(["\n position: absolute;\n background-color: #ddd;\n height: 100%;\n width: ","%;\n"])),(function(e){return e.percentage})),fe=g.cp.div.withConfig({displayName:"StyledProgressText"})(ge||(ge=(0,u.c)(["\n position: absolute;\n top: 0;\n width: 100%;\n text-align: center;\n\n && {\n ","\n }\n"])),(0,o.Gj)()),xe=function(e){return e.result?e.result:e.running?e.total?"".concat(me(e),"%"):"Preparing...":"Not started"},me=function(e){return e.running&&e.total?Math.round(e.currentIndex/e.total*100):0};const je=function(e){var n=e.state;return(0,f.jsxs)(pe,{children:[(0,f.jsx)(he,{percentage:me(n)}),(0,f.jsx)(fe,{children:xe(n)})]})};const ve=function(e){var n=e.state,t=e.startValidation;return(0,f.jsxs)("div",{children:[(0,f.jsx)(o.q,{look:"raised",pending:n.running,disabled:n.running,onClick:t,children:"Execute"}),(0,f.jsx)(je,{state:n})]})};var be={startValidation:ne.cJ};const ye=(0,l.Ul)((function(e){return{state:e.modelValidation.state}}),be)(ve);var Se,ke,Ce;const we=function(){return(0,f.jsxs)(f.Fragment,{children:[Se||(Se=(0,f.jsx)(o.Oi.H1,{children:"Model Validation"})),ke||(ke=(0,f.jsx)(ye,{})),Ce||(Ce=(0,f.jsx)(ce,{}))]})};var Ne=t(86979);const Le=function(e){var n=e.active,t=e.elapsed,r=e.setActive,i=e.setElapsed;return(0,f.jsxs)("div",{children:[(0,f.jsx)(o._i,{label:"Active",fixLabel:!0,children:(0,f.jsx)("input",{type:"checkbox",checked:n,onChange:function(e){r(e.target.checked)}})}),(0,f.jsx)(o._i,{label:"Elapsed",hasValue:!!t,children:(0,f.jsx)(o.EH,{fromText:"from",toText:"to",type:"number",value:t,options:{postPointDigits:0,fixedDecimalScale:!0},events:{onChange:function(e){i(e)}}})})]})};var Ee={setActive:Ne.eu,setElapsed:Ne.Up};const Fe=(0,l.Ul)((function(e){return{active:e.sqlLog.active,elapsed:e.sqlLog.elapsed}}),Ee)(Le);var Me,Oe,qe,Re,Ue,Ve,De,Ge={ERROR:"#a00"},Ae=g.cp.div.withConfig({displayName:"StyledLogTable"})(Me||(Me=(0,u.c)(["\n display: grid;\n gap: 1px;\n"]))),Ie=g.cp.div.withConfig({displayName:"StyledLogEntry"})(Oe||(Oe=(0,u.c)(["\n display: grid;\n height: fit-content;\n grid-template-columns: repeat(3, 1fr);\n padding: 1em;\n ","\n"])),(function(e){return"border: 1px solid ".concat(Ge[e.level]||"#ddd",";")})),Te=g.cp.span.withConfig({displayName:"StyledStatementHeader"})(qe||(qe=(0,u.c)(["\n grid-column: 1 / 3;\n ","\n\n && {\n ","\n }\n"])),(function(e){return e.expandable&&"cursor: pointer;"}),(0,o.Gj)()),_e=g.cp.span.withConfig({displayName:"StyledStatement"})(Re||(Re=(0,u.c)(["\n grid-column: 1 / 3;\n margin-top: 1em;\n\n && {\n ","\n }\n"])),(0,o.Gj)()),ze=g.cp.span.withConfig({displayName:"StyledTime"})(Ue||(Ue=(0,u.c)(["\n grid-row-start: 1;\n grid-column-start: 3;\n text-align: right;\n\n && {\n ","\n }\n"])),(0,o.Gj)()),He=g.cp.span.withConfig({displayName:"StyledElapsedContainer"})(Ve||(Ve=(0,u.c)(["\n grid-column-start: 3;\n text-align: right;\n margin-top: 1em;\n\n && {\n ","\n }\n"])),(0,o.Gj)()),Pe=g.cp.span.withConfig({displayName:"StyledElapsed"})(De||(De=(0,u.c)(["\n background-color: ",";\n border-radius: 5px;\n padding: 0.5em;\n"])),(function(e){return(n=e.elapsed)>=1e3?"#f00":n>=500?"#ff8c00":n>=100?"#ff0":"#dedede";var n}));const Xe=function(e){var n=e.entry,t=(0,d.useState)(!1),r=(0,V.c)(t,2),i=r[0],a=r[1],s=n.sql.length>100,o=s?n.sql.substr(0,100)+"...":n.sql;return(0,f.jsxs)(Ie,{children:[(0,f.jsx)(Te,{expandable:s,onClick:function(){s&&a(!i)},children:o}),i&&(0,f.jsx)(_e,{children:n.sql}),(0,f.jsx)(ze,{children:new Date(n.timestamp.iMillis).toLocaleString()}),(0,f.jsx)(He,{children:(0,f.jsxs)(Pe,{elapsed:n.elapsed,children:[n.elapsed," ms"]})})]})};var Be;const Qe=function(e){var n=function(e,n){return n?e.filter((function(e){return!0===n.isRangeValue?(null===n.from||e.elapsed>=n.from)&&(null===n.to||e.elapsed<=n.to):e.elapsed>=n})):e}(e.entries,e.elapsed);return(0,f.jsx)(Ae,{children:n.length>0?n.map((function(e){return(0,f.jsx)(Xe,{entry:e},e.key)})):Be||(Be=(0,f.jsx)(o.Oi.Span,{children:"No entries so far."}))})};const Je=(0,l.Ul)((function(e){return{entries:e.sqlLog.entries,elapsed:e.sqlLog.elapsed}}),{})(Qe);var We,Ke,Ye;const Ze=function(){return(0,f.jsxs)(f.Fragment,{children:[We||(We=(0,f.jsx)(o.Oi.H1,{children:"SQL Log"})),Ke||(Ke=(0,f.jsx)(Fe,{})),Ye||(Ye=(0,f.jsx)(Je,{}))]})};var $e,en,nn,tn,rn,an,sn,on,ln,cn,dn=g.cp.div.withConfig({displayName:"StyledDevCon"})($e||($e=(0,u.c)(["\n && {\n background-color: ",";\n padding: ",";\n display: flex;\n flex-direction: column;\n flex: 1;\n overflow: auto;\n }\n"])),o.gn.color("paper"),o.aU.space(0)),un=g.cp.div.withConfig({displayName:"StyledNavigation"})(en||(en=(0,u.c)(["\n display: flex;\n"]))),gn=(0,g.cp)(o.mu).withConfig({displayName:"StyledRouterLink"})(nn||(nn=(0,u.c)(["\n padding: 1em;\n background-color: #ddd;\n border-radius: 5px;\n margin: 5px;\n"])));const pn=function(){return(0,f.jsxs)(dn,{children:[tn||(tn=(0,f.jsx)(s.c.Notifications,{})),rn||(rn=(0,f.jsx)(o.Oi.Span,{children:"Tocco Developer Console"})),an||(an=(0,f.jsxs)(un,{children:[(0,f.jsx)(gn,{to:"/log",children:"Log"}),(0,f.jsx)(gn,{to:"/modelvalidation",children:"Model Validation"}),(0,f.jsx)(gn,{to:"/dbrefactoring",children:"DB Refactoring"}),(0,f.jsx)(gn,{to:"/sqllog",children:"SQL Log"})]})),(0,f.jsxs)(a.Wk,{children:[(0,f.jsx)(a.kX,{path:"/",exact:!0,render:function(){return(0,f.jsx)(a.YJ,{to:{pathname:"/log"}})}}),(0,f.jsx)(a.kX,{path:"/log",exact:!0,render:function(){return sn||(sn=(0,f.jsx)(Z,{}))}}),(0,f.jsx)(a.kX,{path:"/dbrefactoring",exact:!0,render:function(){return on||(on=(0,f.jsx)(L,{}))}}),(0,f.jsx)(a.kX,{path:"/modelvalidation",exact:!0,render:function(){return ln||(ln=(0,f.jsx)(we,{}))}}),(0,f.jsx)(a.kX,{path:"/sqllog",exact:!0,render:function(){return cn||(cn=(0,f.jsx)(Ze,{}))}})]})]})}}}]);
1
+ "use strict";(self.webpackChunktocco_devcon=self.webpackChunktocco_devcon||[]).push([[32],{29032:(e,n,t)=>{t.r(n),t.d(n,{default:()=>pn});var r,i,a=t(96684),s=t(74220),o=t(60100),l=t(52328),c=t(67848),d=(t(3268),t(69624)),u=t(86692),g=t(76548),p=g.cp.input.withConfig({displayName:"StyledInput"})(r||(r=(0,u.c)(["\n && {\n ","\n }\n"])),o.cZ),h=g.cp.div.withConfig({displayName:"StyledInputWrapper"})(i||(i=(0,u.c)(["\n && {\n ","\n }\n"])),o.m4),f=t(17624);const x=function(e){var n=e.fragments,t=e.selectedFragments,r=e.disabled,i=e.setFragmentSelected;return(0,f.jsx)(f.Fragment,{children:n.map((function(e){return(0,f.jsxs)("div",{children:[(0,f.jsx)("input",{type:"checkbox",id:e.id,checked:t.includes(e.id),onChange:(n=e.id,function(e){i(n,e.target.checked)}),disabled:r}),(0,f.jsx)(o.Oi.Label,{for:e.id,children:e.label})]},e.id);var n}))})};const m=function(e){var n=e.version,t=e.modules,r=e.selectedModules,i=e.fragments,a=e.selectedFragments,s=e.ignoreErrors,l=e.running,c=e.disabled,u=e.executeDbRefactoring,g=e.loadModules,m=e.loadFragments,j=e.setSelectedModules,v=e.setFragmentSelected,b=e.setVersion,y=e.setIgnoreErrors;(0,d.useEffect)((function(){0===t.length&&g(),0===i.length&&m()}),[]);return(0,f.jsxs)("form",{onSubmit:function(e){e.preventDefault(),u()},children:[(0,f.jsx)(o._i,{label:"Modules (none selected => all)",hasValue:r.length>0,children:(0,f.jsx)(o.M1,{options:t,value:r,onChange:j,isMulti:!0,immutable:c})}),(0,f.jsx)(o._i,{label:"Fragments",fixLabel:!0,children:(0,f.jsx)(x,{fragments:i,selectedFragments:a,disabled:c,setFragmentSelected:v})}),(0,f.jsx)(o._i,{label:"Version",hasValue:n.length>0,children:(0,f.jsx)(h,{children:(0,f.jsx)(p,{value:n,onChange:function(e){var n=e.target.value.replaceAll(/[^\d\\.]/g,"");b(n)},disabled:c})})}),(0,f.jsx)(o._i,{label:"Ignore errors",fixLabel:!0,children:(0,f.jsx)("input",{type:"checkbox",checked:s,onChange:function(e){y(e.target.checked)},disabled:c})}),(0,f.jsx)(o.q,{type:"submit",label:"Execute",look:"raised",pending:l,disabled:c})]})};var j={loadModules:c.Az,loadFragments:c.At,setSelectedModules:c.st,setFragmentSelected:c.K0,setVersion:c.gF,setIgnoreErrors:c.gz,executeDbRefactoring:c.Ef};const v=(0,l.Ul)((function(e){var n=e.dbRefactoring,t=n.dbRefactoring,r=n.languageUpgrade;return{version:t.version,modules:t.modules,selectedModules:t.selectedModules,fragments:t.fragments,selectedFragments:t.selectedFragments,ignoreErrors:t.ignoreErrors,running:t.running,disabled:t.running||r.running}}),j)(m);const b=function(e){var n=e.language,t=e.running,r=e.disabled,i=e.executeLanguageUpgrade,a=e.setLanguage;return(0,f.jsxs)("form",{onSubmit:function(e){e.preventDefault(),i()},children:[(0,f.jsx)(o._i,{label:"Language",hasValue:n.length>0,children:(0,f.jsx)(h,{children:(0,f.jsx)(p,{value:n,onChange:function(e){a(e.target.value)},disabled:r})})}),(0,f.jsx)(o.q,{type:"submit",label:"Execute language upgrade",look:"raised",pending:t,disabled:r})]})};var y={setLanguage:c.yC,executeLanguageUpgrade:c.ec};const S=(0,l.Ul)((function(e){var n=e.dbRefactoring,t=n.dbRefactoring,r=n.languageUpgrade;return{language:r.language,running:r.running,disabled:r.running||t.running}}),y)(b);var k,C,w,N;const L=function(){return(0,f.jsxs)(f.Fragment,{children:[k||(k=(0,f.jsx)(o.Oi.H1,{children:"Database Refactoring"})),C||(C=(0,f.jsx)(v,{})),w||(w=(0,f.jsx)(o.Oi.H1,{children:"Language Upgrade"})),N||(N=(0,f.jsx)(S,{}))]})};var E,F,M,O,q,R,U,V=t(32920),D={ERROR:"#a00"},G=g.cp.div.withConfig({displayName:"StyledLogTable"})(E||(E=(0,u.c)(["\n display: grid;\n gap: 1px;\n"]))),A=g.cp.div.withConfig({displayName:"StyledLogEntry"})(F||(F=(0,u.c)(["\n display: grid;\n height: fit-content;\n grid-template-columns: repeat(3, 1fr);\n padding: 1em;\n ","\n"])),(function(e){return"border: 1px solid ".concat(D[e.level]||"#ddd",";")})),I=g.cp.span.withConfig({displayName:"StyledMessage"})(M||(M=(0,u.c)(["\n grid-column: 1 / 3;\n ","\n\n && {\n ","\n }\n"])),(function(e){return e.expandable&&"cursor: pointer;"}),(0,o.Gj)()),T=g.cp.span.withConfig({displayName:"StyledTime"})(O||(O=(0,u.c)(["\n grid-column-start: 3;\n text-align: right;\n\n && {\n ","\n }\n"])),(0,o.Gj)()),_=g.cp.div.withConfig({displayName:"StyledExceptionDetails"})(q||(q=(0,u.c)(["\n margin-top: 1em;\n"]))),z=g.cp.div.withConfig({displayName:"StyledDetailMessage"})(R||(R=(0,u.c)(["\n margin-bottom: 1em;\n\n && {\n ","\n }\n"])),(0,o.Gj)()),H=g.cp.div.withConfig({displayName:"StyledStackTrace"})(U||(U=(0,u.c)(["\n && {\n ","\n }\n"])),(0,o.Gj)()),P=function(e){return"".concat(e.declaringClass,".").concat(e.methodName,":").concat(e.lineNumber)};const X=function(e){var n=e.exception;return(0,f.jsxs)(_,{children:[(0,f.jsx)(z,{children:n.detailMessage}),(0,f.jsx)(H,{children:n.stackTrace.map((function(e,n){return(0,f.jsx)("div",{children:P(e)},n)}))})]})};const B=function(e){var n=e.entry,t=(0,d.useState)(!1),r=(0,V.c)(t,2),i=r[0],a=r[1];return(0,f.jsxs)(A,{level:n.level,children:[(0,f.jsx)(I,{onClick:function(){n.exception&&a(!i)},expandable:!!n.exception,children:n.message}),(0,f.jsx)(T,{children:new Date(n.timestamp).toLocaleString()}),i&&(0,f.jsx)(X,{exception:n.exception})]})};var Q;const J=function(e){var n=e.entries;return(0,f.jsx)(G,{children:n.length>0?n.map((function(e){return(0,f.jsx)(B,{entry:e},e.key)})):Q||(Q=(0,f.jsx)(o.Oi.Span,{children:"No entries so far."}))})};const W=(0,l.Ul)((function(e){return{entries:e.log.entries}}),{})(J);var K,Y;const Z=function(){return(0,f.jsxs)(f.Fragment,{children:[K||(K=(0,f.jsx)(o.Oi.H1,{children:"Log"})),Y||(Y=(0,f.jsx)(W,{}))]})};var $,ee,ne=t(47344),te=g.cp.div.withConfig({displayName:"StyledCheckEventGroup"})($||($=(0,u.c)(["\n margin: 1em 0;\n border: 1px solid #ddd;\n border-radius: 5px;\n padding: 1em;\n"]))),re=g.cp.div.withConfig({displayName:"StyledGroupHeading"})(ee||(ee=(0,u.c)(["\n margin-bottom: 1em;\n"])));function ie(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(!e)return;if("string"==typeof e)return ae(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ae(e,n)}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==t.return||t.return()}finally{if(o)throw a}}}}function ae(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}const se=function(e){var n=e.type,t=e.events,r=e.selection,i=e.setSelected,a=function(e,n){var t,r=ie(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(!n.has(i.id))return!1}}catch(e){r.e(e)}finally{r.f()}return!0}(t,r);return(0,f.jsxs)(te,{children:[(0,f.jsxs)(re,{children:[(0,f.jsx)("input",{type:"checkbox",id:"checkbox-"+n,checked:a,onChange:function(e){i(t.map((function(e){return e.id})),e.target.checked)}}),(0,f.jsx)(o.Oi.Label,{for:"checkbox-"+n,children:(0,f.jsxs)(o.Oi.B,{children:[n," (",t.length,")"]})})]}),t.map((function(e){return(0,f.jsxs)("div",{children:[(0,f.jsx)("input",{type:"checkbox",id:"checkbox-"+e.id,checked:r.has(e.id),onChange:(n=e.id,function(e){i([n],e.target.checked)})}),(0,f.jsx)(o.Oi.Label,{for:"checkbox-"+e.id,children:e.label})]},e.id);var n}))]})};const oe=function(e){var n=e.checkEvents,t=e.selection,r=e.setSelected,i=e.generateSql,a=e.generateChangelog;return(0,f.jsxs)("div",{children:[Object.keys(n).length>0&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(o.q,{look:"raised",onClick:i,disabled:0===t.size,children:["Generate SQL ",t.size>0&&"(".concat(t.size,")")]}),(0,f.jsxs)(o.q,{look:"raised",onClick:a,disabled:0===t.size,children:["Generate Changelog ",t.size>0&&"(".concat(t.size,")")]})]}),(0,f.jsx)("div",{children:Object.keys(n).sort((function(e,n){return e.localeCompare(n)})).map((function(e){return(0,f.jsx)(se,{type:e,events:n[e],selection:t,setSelected:r},e)}))})]})};var le={setSelected:ne.Si,generateSql:ne.eI,generateChangelog:ne.gv};const ce=(0,l.Ul)((function(e){return{checkEvents:e.modelValidation.checkEvents,selection:e.modelValidation.selection}}),le)(oe);var de,ue,ge,pe=g.cp.div.withConfig({displayName:"StyledProgressBar"})(de||(de=(0,u.c)(["\n width: 100%;\n border: 1px solid #ddd;\n height: 20px;\n position: relative;\n margin: 1em 0;\n"]))),he=g.cp.div.withConfig({displayName:"StyledInnerProgress"})(ue||(ue=(0,u.c)(["\n position: absolute;\n background-color: #ddd;\n height: 100%;\n width: ","%;\n"])),(function(e){return e.percentage})),fe=g.cp.div.withConfig({displayName:"StyledProgressText"})(ge||(ge=(0,u.c)(["\n position: absolute;\n top: 0;\n width: 100%;\n text-align: center;\n\n && {\n ","\n }\n"])),(0,o.Gj)()),xe=function(e){return e.result?e.result:e.running?e.total?"".concat(me(e),"%"):"Preparing...":"Not started"},me=function(e){return e.running&&e.total?Math.round(e.currentIndex/e.total*100):0};const je=function(e){var n=e.state;return(0,f.jsxs)(pe,{children:[(0,f.jsx)(he,{percentage:me(n)}),(0,f.jsx)(fe,{children:xe(n)})]})};const ve=function(e){var n=e.state,t=e.startValidation;return(0,f.jsxs)("div",{children:[(0,f.jsx)(o.q,{look:"raised",pending:n.running,disabled:n.running,onClick:t,children:"Execute"}),(0,f.jsx)(je,{state:n})]})};var be={startValidation:ne.cJ};const ye=(0,l.Ul)((function(e){return{state:e.modelValidation.state}}),be)(ve);var Se,ke,Ce;const we=function(){return(0,f.jsxs)(f.Fragment,{children:[Se||(Se=(0,f.jsx)(o.Oi.H1,{children:"Model Validation"})),ke||(ke=(0,f.jsx)(ye,{})),Ce||(Ce=(0,f.jsx)(ce,{}))]})};var Ne=t(86979);const Le=function(e){var n=e.active,t=e.elapsed,r=e.setActive,i=e.setElapsed;return(0,f.jsxs)("div",{children:[(0,f.jsx)(o._i,{label:"Active",fixLabel:!0,children:(0,f.jsx)("input",{type:"checkbox",checked:n,onChange:function(e){r(e.target.checked)}})}),(0,f.jsx)(o._i,{label:"Elapsed",hasValue:!!t,children:(0,f.jsx)(o.EH,{fromText:"from",toText:"to",type:"number",value:t,options:{postPointDigits:0,fixedDecimalScale:!0},events:{onChange:function(e){i(e)}}})})]})};var Ee={setActive:Ne.eu,setElapsed:Ne.Up};const Fe=(0,l.Ul)((function(e){return{active:e.sqlLog.active,elapsed:e.sqlLog.elapsed}}),Ee)(Le);var Me,Oe,qe,Re,Ue,Ve,De,Ge={ERROR:"#a00"},Ae=g.cp.div.withConfig({displayName:"StyledLogTable"})(Me||(Me=(0,u.c)(["\n display: grid;\n gap: 1px;\n"]))),Ie=g.cp.div.withConfig({displayName:"StyledLogEntry"})(Oe||(Oe=(0,u.c)(["\n display: grid;\n height: fit-content;\n grid-template-columns: repeat(3, 1fr);\n padding: 1em;\n ","\n"])),(function(e){return"border: 1px solid ".concat(Ge[e.level]||"#ddd",";")})),Te=g.cp.span.withConfig({displayName:"StyledStatementHeader"})(qe||(qe=(0,u.c)(["\n grid-column: 1 / 3;\n ","\n\n && {\n ","\n }\n"])),(function(e){return e.expandable&&"cursor: pointer;"}),(0,o.Gj)()),_e=g.cp.span.withConfig({displayName:"StyledStatement"})(Re||(Re=(0,u.c)(["\n grid-column: 1 / 3;\n margin-top: 1em;\n\n && {\n ","\n }\n"])),(0,o.Gj)()),ze=g.cp.span.withConfig({displayName:"StyledTime"})(Ue||(Ue=(0,u.c)(["\n grid-row-start: 1;\n grid-column-start: 3;\n text-align: right;\n\n && {\n ","\n }\n"])),(0,o.Gj)()),He=g.cp.span.withConfig({displayName:"StyledElapsedContainer"})(Ve||(Ve=(0,u.c)(["\n grid-column-start: 3;\n text-align: right;\n margin-top: 1em;\n\n && {\n ","\n }\n"])),(0,o.Gj)()),Pe=g.cp.span.withConfig({displayName:"StyledElapsed"})(De||(De=(0,u.c)(["\n background-color: ",";\n border-radius: 5px;\n padding: 0.5em;\n"])),(function(e){return(n=e.elapsed)>=1e3?"#f00":n>=500?"#ff8c00":n>=100?"#ff0":"#dedede";var n}));const Xe=function(e){var n=e.entry,t=(0,d.useState)(!1),r=(0,V.c)(t,2),i=r[0],a=r[1],s=n.sql.length>100,o=s?n.sql.substr(0,100)+"...":n.sql;return(0,f.jsxs)(Ie,{children:[(0,f.jsx)(Te,{expandable:s,onClick:function(){s&&a(!i)},children:o}),i&&(0,f.jsx)(_e,{children:n.sql}),(0,f.jsx)(ze,{children:new Date(n.timestamp.iMillis).toLocaleString()}),(0,f.jsx)(He,{children:(0,f.jsxs)(Pe,{elapsed:n.elapsed,children:[n.elapsed," ms"]})})]})};var Be;const Qe=function(e){var n=function(e,n){return n?e.filter((function(e){return!0===n.isRangeValue?(null===n.from||e.elapsed>=n.from)&&(null===n.to||e.elapsed<=n.to):e.elapsed>=n})):e}(e.entries,e.elapsed);return(0,f.jsx)(Ae,{children:n.length>0?n.map((function(e){return(0,f.jsx)(Xe,{entry:e},e.key)})):Be||(Be=(0,f.jsx)(o.Oi.Span,{children:"No entries so far."}))})};const Je=(0,l.Ul)((function(e){return{entries:e.sqlLog.entries,elapsed:e.sqlLog.elapsed}}),{})(Qe);var We,Ke,Ye;const Ze=function(){return(0,f.jsxs)(f.Fragment,{children:[We||(We=(0,f.jsx)(o.Oi.H1,{children:"SQL Log"})),Ke||(Ke=(0,f.jsx)(Fe,{})),Ye||(Ye=(0,f.jsx)(Je,{}))]})};var $e,en,nn,tn,rn,an,sn,on,ln,cn,dn=g.cp.div.withConfig({displayName:"StyledDevCon"})($e||($e=(0,u.c)(["\n && {\n background-color: ",";\n padding: ",";\n display: flex;\n flex-direction: column;\n flex: 1;\n overflow: auto;\n }\n"])),o.gn.color("paper"),o.aU.space(0)),un=g.cp.div.withConfig({displayName:"StyledNavigation"})(en||(en=(0,u.c)(["\n display: flex;\n"]))),gn=(0,g.cp)(o.mu).withConfig({displayName:"StyledRouterLink"})(nn||(nn=(0,u.c)(["\n padding: 1em;\n background-color: #ddd;\n border-radius: 5px;\n margin: 5px;\n"])));const pn=function(){return(0,f.jsxs)(dn,{children:[tn||(tn=(0,f.jsx)(s.c.Notifications,{})),rn||(rn=(0,f.jsx)(o.Oi.Span,{children:"Tocco Developer Console"})),an||(an=(0,f.jsxs)(un,{children:[(0,f.jsx)(gn,{to:"/log",children:"Log"}),(0,f.jsx)(gn,{to:"/modelvalidation",children:"Model Validation"}),(0,f.jsx)(gn,{to:"/dbrefactoring",children:"DB Refactoring"}),(0,f.jsx)(gn,{to:"/sqllog",children:"SQL Log"})]})),(0,f.jsxs)(a.Wk,{children:[(0,f.jsx)(a.kX,{path:"/",exact:!0,render:function(){return(0,f.jsx)(a.YJ,{to:{pathname:"/log"}})}}),(0,f.jsx)(a.kX,{path:"/log",exact:!0,render:function(){return sn||(sn=(0,f.jsx)(Z,{}))}}),(0,f.jsx)(a.kX,{path:"/dbrefactoring",exact:!0,render:function(){return on||(on=(0,f.jsx)(L,{}))}}),(0,f.jsx)(a.kX,{path:"/modelvalidation",exact:!0,render:function(){return ln||(ln=(0,f.jsx)(we,{}))}}),(0,f.jsx)(a.kX,{path:"/sqllog",exact:!0,render:function(){return cn||(cn=(0,f.jsx)(Ze,{}))}})]})]})}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunktocco_devcon=self.webpackChunktocco_devcon||[]).push([[784],{43976:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Me});var r=n(32920),o=n(86692),c=n(77331),a=n.n(c),i=(n(39336),n(60944)),u=n(67339),s=n(57152),l=n(89760),p=n(17904),f=n(73963),d=n(5640),m=n(52627),h=n(19448),g=n.n(h),k=n(14764),x=n.n(k),v=n(8940),w=n.n(v),_=n(36384),y=n.n(_),b=n(69624),M=n(80560),R=(n(79304),n(50416),n(77840),n(16848),n(97132),n(15536),n(12912),n(77984),n(71764),n(32384),n(62836),n(90800)),$=function(e){return R.c.executeRequest("rest/".concat(e))},j=function(e){return 200===e.status?e.json():null},q=n(92920),B=n(87088),I=n(19952),O=n(76184),z=n(62988),C=(n(54416),n(52488)),T=n.n(C),N=n(14240),E=n.n(N),S=["==","!=","<=",">=","<",">","~="],H=["true","false","null"],F=["string","long","serial","bool","boolean","double","float","time","timestamp","char","varchar","date","datetime"],A=["now_date","yesterday_date","tomorrow_date","today_date","now_start","yesterday_start","tomorrow_start","today_start","now","yesterday","tomorrow","today","currentUsername","currentUser","currentBu"],G=["in","dateadd","datetimeadd","duedate","birthdayin","fulltext","likeall","distance","inboundingbox"];function V(e,t,n){return t=(0,O.c)(t),(0,I.c)(e,U()?Reflect.construct(t,n||[],(0,O.c)(e).constructor):t.apply(e,n))}function U(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(U=function(){return!!e})()}const P=function(e){return function(t){function n(){var t;(0,B.c)(this,n),t=V(this,n);var r=[{token:"keyword.operator.conjunction",regex:/(\s*)(and|or|not)($|\s+)/,caseInsensitive:!0},{token:"support.class.relation",regex:/rel/,push:"model"},{token:"keyword.exists",regex:/exists\s*/,push:"exists",caseInsensitive:!0},{token:"keyword.count",regex:/count\s*/,push:"count",caseInsensitive:!0},{token:["keyword.function.nice_function","paren.lparen.function_arguments","text.function_arguments","paren.rparen","text.whitespace"],regex:"((?:".concat(G.join("|"),")\\s*)(\\()(.*?)(\\))($|\\s+)"),caseInsensitive:!0},{token:"keyword.other.chaining",regex:/\./},{token:"support.function.field",regex:/([a-z_]+)($|\s+)/,push:"comparison"}],o={start:e?[{token:"keyword.where",regex:/\s*/,next:"rootwhere",caseInsensitive:!0}]:[{token:"keyword.find",regex:/find($|\s+)/,push:"model",caseInsensitive:!0},{token:"keyword.where",regex:/where($|\s+)/,next:"rootwhere",caseInsensitive:!0}],model:[{token:"support.class.model",regex:/[A-Z][a-z_0-9]*\s*/,next:"pop"}],rootwhere:[{token:"keyword.order_by",regex:/order by($|\s+)/,next:"order",caseInsensitive:!0}].concat(r),comparison:[{token:"keyword.operator.comparison",regex:"(".concat(S.join("|"),")\\s*"),next:"value"}],value:[{token:"string",regex:/".*?"\s*/,next:"pop"},{token:"constant.numeric",regex:/\d+(.\d+)?\s*/,next:"pop"},{token:"constant.language.tocco_placeholder",regex:"\\:(".concat(A.join("|"),")\\s*"),next:"pop",caseInsensitive:!0},{token:"constant.language",regex:"(".concat(H.join("|"),")\\s*"),next:"pop",caseInsensitive:!0},{token:"support.type",regex:"(".concat(F.join("|"),"):\\s*"),caseInsensitive:!0}],exists:[{token:"paren.lparen",regex:/\(\s*/},{token:"support.class.relation",regex:/rel/,push:"model"},{token:"keyword.other.chaining",regex:/\./},{token:"keyword.where",regex:/where($|\s+)/,next:"existswhere",caseInsensitive:!0},{token:"paren.rparen",regex:/\)\s*/,next:"pop"}],existswhere:[].concat(r,[{token:"paren.rparen",regex:/\)\s*/,next:"pop"}]),count:[{token:"paren.lparen",regex:/\(\s*/},{token:"support.class.relation",regex:/rel/,push:"model"},{token:"keyword.other.chaining",regex:/\./},{token:"keyword.where",regex:/where($|\s+)/,next:"countwhere",caseInsensitive:!0},{token:"paren.rparen",regex:/\)\s*/,next:"comparison"}],countwhere:[].concat(r,[{token:"paren.rparen",regex:/\)\s*/,next:"comparison"}]),order:[{token:"support.class.relation",regex:/rel/,push:"model"},{token:"keyword.other.chaining",regex:/\./},{token:["support.function.field","keyword.direction","separator"],regex:/([a-z_]+\s*)(asc|desc)?($|,|\s+)/}]};return t.$rules=E()(t.$rules,o,(function(e,t){return T()(e)?e.concat(t):void 0})),t.normalizeRules(),t}return(0,z.c)(n,t),(0,q.c)(n)}(a().require("ace/mode/text_highlight_rules").TextHighlightRules)};function Z(e,t,n){return t=(0,O.c)(t),(0,I.c)(e,D()?Reflect.construct(t,n||[],(0,O.c)(e).constructor):t.apply(e,n))}function D(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(D=function(){return!!e})()}var J=function(e){function t(){var e;(0,B.c)(this,t);return(e=Z(this,t)).$rules={start:[{token:"constant.character.entity",regex:/&[^;]+;/},{token:"support.function",regex:"\\?(\\?|substring|cap_first|uncap_first|capitalize|chop_linebreak|date|time|datetime|ends_with|html|groups|index_of|j_string|js_string|json_string|last_index_of|length|lower_case|left_pad|right_pad|contains|matches|number|replace|rtf|url|split|starts_with|string|trim|upper_case|word_list|xhtml|xmlc|round|floor|ceilingiso_[a-z_]+first|last|seq_contains|seq_index_of|seq_last_index_of|reverse|size|sort|sort_by|chunkkeys|valueschildren|parent|root|ancestors|node_name|node_type|node_namespacebyte|double|float|int|long|short|number_to_date|number_to_time|number_to_datetime|eval|has_content|interpret|is_[a-z_]+|namespacenew)"},{token:"support.function.deprecated",regex:"\\?(default|exists|if_exists|web_safe)"},{token:"language.variable",regex:"\\.(?:data_model|error|globals|lang|locale|locals|main|namespace|node|current_node|now|output_encoding|template_name|url_escaping_charset|vars|version)"},{token:"constant.language",regex:"\\b(true|false)\\b"},{token:"keyword.operator",regex:"\\b(?:gt|gte|lt|lte|as|in|using)\\b"},{token:"entity.other.attribute-name",regex:"encoding|parse|locale|number_format|date_format|time_format|datetime_format|time_zone|url_escaping_charset|classic_compatible|strip_whitespace|strip_text|strict_syntax|ns_prefixes|attributes"},{token:"string",regex:/['"]/,next:"qstring"},{token:function(e){return e.match("^[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?$")?"constant.numeric":"variable"},regex:/[\w.+-]+/},{token:"keyword.operator",regex:"!|\\.|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^="},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],qstring:[{token:"constant.character.escape",regex:'\\\\[nrtvef\\\\"$]'},{token:"string",regex:/['"]/,next:"start"},{defaultToken:"string"}]},e}return(0,z.c)(t,e),(0,q.c)(t)}(a().require("ace/mode/text_highlight_rules").TextHighlightRules),K=function(e){function t(){var e;(0,B.c)(this,t),e=Z(this,t);var n=["query","queryCount"],r=[{token:"keyword.function",regex:"\\[@(".concat(n.join("|"),").*?]"),push:"tql-start"},{token:"comment",regex:"\\[#--",next:"ftl-dcomment"},{token:"string.interpolated",regex:"\\${",push:"ftl-start"},{token:"keyword.function",regex:"\\[/?#(assign|attempt|break|case|compress|default|elseif|else|escape|fallback|function|flush|ftl|global|if|import|include|list|local|lt|macro|nested|noescape|noparse|nt|recover|recurse|return|rt|setting|stop|switch|t|visit)",push:"ftl-start"},{token:"keyword.other",regex:"\\[/?@[a-zA-Z\\.]+",push:"ftl-start"}];for(var o in e.$rules)e.$rules[o].unshift.apply(e.$rules[o],r);e.embedRules(J,"ftl-",[{token:"keyword",regex:"/?\\]",next:"pop"},{token:"string.interpolated",regex:"}",next:"pop"}],["start"]),e.addRules({"ftl-dcomment":[{token:"comment",regex:"--\\]",next:"pop"},{defaultToken:"comment"}]});var c=[{token:"keyword.function",regex:"\\[/@(".concat(n.join("|"),")]"),next:"pop"}];e.embedRules(P(),"tql-",c,["start"]);var a={"tql-rootwhere":[{token:"keyword.function",regex:"\\[/@(".concat(n.join("|"),")]"),next:"pop"}],"tql-order":[{token:"keyword.function",regex:"\\[/@(".concat(n.join("|"),")]"),next:"pop"}]};return e.$rules=E()(e.$rules,a,(function(e,t){return T()(e)?e.concat(t):void 0})),e.normalizeRules(),e}return(0,z.c)(t,e),(0,q.c)(t)}(a().require("ace/mode/html_highlight_rules").HtmlHighlightRules),L=n(81016),Q=n(32612),W=a().require("ace/token_iterator").TokenIterator,X=function(e){return e?e.type.substring(e.type.lastIndexOf(".")+1):null},Y=function(e,t){return X(e.getCurrentToken())===t},ee=function(e){if(Y(e,"model")&&e.stepBackward(),(Y(e,"field")||Y(e,"relation"))&&e.stepBackward(),!Y(e,"chaining"))return null;if(e.stepBackward(),Y(e,"model")){var t=e.getCurrentToken();return e.stepBackward(),e.stepBackward(),t?t.value.trim():null}return null},te=function(e,t){for(;!Y(e,t);)if(!e.stepBackward())return!1;return!0},ne=function(e,t){return Y(e,"rparen")?1:t>0&&Y(e,"lparen")?(e.stepBackward(),-1):0},re=function(e){for(var t=0;e.getCurrentToken();){if(0===t&&Y(e,"where")){var n=e.stepBackward();return n?[n.value.trim()].concat((0,Q.c)(ce(e))):[]}if(Y(e,"order_by")){if(te(e,"find")){var r=e.stepForward();return r?r.value.trim():[]}return[]}if(t+=ne(e,t),!e.stepBackward())return null}return null},oe=function(e,t){for(var n=[],r=t(e);r;)Array.isArray(r)?r.forEach((function(e){return n.unshift(e)})):n.unshift(r),r=t(e);return n},ce=function(e){return oe(e,ee)},ae=function(e){return oe(e,re)},ie=1e3,ue=function(e,t,n){var r=function(e,t){if(t){var n=ae(e());return{baseModel:t,modelScope:(0,L.c)(n).slice(0)}}var r=ae(e()),o=(0,L.c)(r);return{baseModel:o[0],modelScope:o.slice(1)}}(e,n),o=r.baseModel,c=r.modelScope;if(o){var a=ce(e()),i=[].concat((0,Q.c)(c),(0,Q.c)(a)).map((function(e){return"rel".concat(e)}));(function(e){var t=(0,L.c)(e),n=t[0],r=t.slice(1);return $(function(e,t){var n=t.length>0?"/resolve?path="+t.join("."):"";return"entities/".concat(e,"/model").concat(n)}(n,r)).then(j).then((function(e){if(!e)return[];var t=e.fields||[],n=e.relations||[];return[].concat((0,Q.c)(t.map((function(e){return{label:(t=e,t.label?"".concat(t.fieldName," (").concat(t.label,")"):t.fieldName),value:e.fieldName,meta:e.type};var t}))),(0,Q.c)(n.map((function(e){return{label:(t=e,t.label?"".concat(t.relationName," (").concat(t.label,")"):t.relationName),value:e.relationName,meta:e.targetEntity};var t}))))}))})([o].concat((0,Q.c)(i))).then((function(e){var n=e.map((function(e){return{caption:e.label,value:e.value,meta:e.meta,score:ie}}));t(null,n)})).catch((function(e){return t(e)}))}},se=function(e,t){return t?"".concat(e," (").concat(t,")"):e},le=function(e){return $("entities").then(j).then((function(e){return e?e.entities:{}})).then((function(e){return e?Object.values(e):[]})).then((function(e){return e.map((function(e){return e.metaData}))})).then((function(t){var n=t.map((function(e){var t=e.modelName,n=e.label;return{caption:se(t,n),value:t,score:ie}}));e(null,n)})).catch((function(t){return e(t)}))},pe=function(){return G.map((function(e){return e.toUpperCase()})).map((function(e){return{caption:e,value:"".concat(e,"()"),meta:"function",score:970}}))};const fe=function(e){return{getCompletions:function(t,n,r,o,c){var a=function(){return new W(n,r.row,r.column)},i=a(),u=i.getCurrentToken(),s=i.stepBackward()?i.getCurrentToken():null;switch(X(u)){case"chaining":case"relation":case"separator":case"order_by":case"count":case"exists":case"field":case"function_arguments":ue(a,c,e);break;case"where":case"conjunction":ue(a,c,e),c(null,pe());break;case"nice_function":c(null,pe());break;case"find":le(c);break;case"type":case"tocco_placeholder":case"comparison":c(null,F.map((function(e){return{caption:e,value:"".concat(e,":"),meta:"type",score:980}}))),c(null,A.map((function(e){return{caption:e,value:":".concat(e),meta:"placeholder",score:990}})));break;case"model":ue(a,c,e),s&&"relation"!==X(s)&&le(c);break;case null:e&&ue(a,c,e),c(null,pe())}}}};function de(e,t,n){return t=(0,O.c)(t),(0,I.c)(e,me()?Reflect.construct(t,n||[],(0,O.c)(e).constructor):t.apply(e,n))}function me(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(me=function(){return!!e})()}var he=function(e){function t(){var e;return(0,B.c)(this,t),(e=de(this,t)).HighlightRules=K,e.completer=fe(),e}return(0,z.c)(t,e),(0,q.c)(t)}(a().require("ace/mode/ftl").Mode);function ge(e,t,n){return t=(0,O.c)(t),(0,I.c)(e,ke()?Reflect.construct(t,n||[],(0,O.c)(e).constructor):t.apply(e,n))}function ke(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ke=function(){return!!e})()}var xe,ve=function(e){function t(e){var n,r=e.implicitModelName;return(0,B.c)(this,t),(n=ge(this,t)).HighlightRules=P(r),n.completer=fe(r),n.snippedIdField=null,n}return(0,z.c)(t,e),(0,q.c)(t)}(a().require("ace/mode/text").Mode),we=n(17624),_e=M.cp.div.withConfig({displayName:"StyledEditor"})(xe||(xe=(0,o.c)(["\n width: 100%;\n z-index: 0; /* gutter lays over menu otherwise */\n"]))),ye={groovy:function(){return new u.Mode},html:function(){return new s.Mode},xml:function(){return new m.Mode},properties:function(){return new f.Mode},json:function(){return new l.Mode},htmlmixed:function(){return new he},freemarkermixed:function(){return new he},ftl:function(){return new he},tql:function(e){return new ve(e)},less:function(){return new p.Mode},drools:function(){return new i.Mode},text:function(){return new d.Mode}},be=function(e,t){var n=t.mode,o=t.theme,c=t.showGutter,a=t.editorOptions,i=void 0===a?{}:a;(function(e){return y()(e)?Promise.resolve(e):w()(e)?$("entities/2.0/".concat(e.entityModel,"/").concat(e.key,"?_paths=").concat(e.field)).then(j).then((function(e){return g()(e,["paths","entity_name","value"],null)})):Promise.resolve(null)})(t.implicitModel).then((function(e){return function(e,t){return g()(ye,e,e)(t)}(n,{implicitModelName:e})})).then((function(t){return e.getSession().setMode(t)})),e.setTheme("ace/theme/".concat(o)),Object.entries(i).forEach((function(t){var n=(0,r.c)(t,2),o=n[0],c=n[1];e.setOption(o,c)})),e.renderer.setShowGutter(c),e.resize()};const Me=function(e){var t=e.mode,n=e.theme,r=void 0===n?"textmate":n,o=e.value,c=e.onChange,i=e.showGutter,u=void 0===i||i,s=e.editorOptions,l=void 0===s?{}:s,p=e.implicitModel,f=e.autoFocusOnMount,d=void 0!==f&&f,m=e.id,h=(0,b.useRef)(null),g=(0,b.useRef)(null),k=(0,b.useMemo)((function(){return{mode:t,theme:r,showGutter:u,editorOptions:l,implicitModel:p,autoFocusOnMount:d}}),[t,r,u,l,p,d]);return(0,b.useEffect)((function(){var e=a().edit(h.current);return e.getSession().setValue(o||""),e.on("change",(function(){return c(e.getValue())})),be(e,k),g.current=e,k.autoFocusOnMount&&g.current.focus(),function(){return e.destroy()}}),[]),(0,b.useEffect)((function(){g.current&&be(g.current,k)}),[k]),(0,b.useEffect)((function(){g.current&&!x()(o)&&o!==g.current.getValue()&&g.current.getSession().setValue(o)}),[o]),(0,we.jsx)(_e,{id:m,ref:h})}}}]);
1
+ "use strict";(self.webpackChunktocco_devcon=self.webpackChunktocco_devcon||[]).push([[784],{43976:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Me});var r=n(32920),o=n(86692),c=n(77331),a=n.n(c),i=(n(39336),n(60944)),u=n(67339),s=n(57152),l=n(89760),p=n(17904),f=n(73963),d=n(5640),m=n(52627),h=n(19448),g=n.n(h),k=n(14764),x=n.n(k),v=n(8940),w=n.n(v),_=n(36384),y=n.n(_),b=n(69624),M=n(76548),R=(n(79304),n(50416),n(77840),n(16848),n(97132),n(15536),n(12912),n(77984),n(71764),n(32384),n(62836),n(90800)),$=function(e){return R.c.executeRequest("rest/".concat(e))},j=function(e){return 200===e.status?e.json():null},q=n(92920),B=n(87088),I=n(19952),O=n(76184),z=n(62988),C=(n(54416),n(52488)),T=n.n(C),N=n(14240),E=n.n(N),S=["==","!=","<=",">=","<",">","~="],H=["true","false","null"],F=["string","long","serial","bool","boolean","double","float","time","timestamp","char","varchar","date","datetime"],A=["now_date","yesterday_date","tomorrow_date","today_date","now_start","yesterday_start","tomorrow_start","today_start","now","yesterday","tomorrow","today","currentUsername","currentUser","currentBu"],G=["in","dateadd","datetimeadd","duedate","birthdayin","fulltext","likeall","distance","inboundingbox"];function V(e,t,n){return t=(0,O.c)(t),(0,I.c)(e,U()?Reflect.construct(t,n||[],(0,O.c)(e).constructor):t.apply(e,n))}function U(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(U=function(){return!!e})()}const P=function(e){return function(t){function n(){var t;(0,B.c)(this,n),t=V(this,n);var r=[{token:"keyword.operator.conjunction",regex:/(\s*)(and|or|not)($|\s+)/,caseInsensitive:!0},{token:"support.class.relation",regex:/rel/,push:"model"},{token:"keyword.exists",regex:/exists\s*/,push:"exists",caseInsensitive:!0},{token:"keyword.count",regex:/count\s*/,push:"count",caseInsensitive:!0},{token:["keyword.function.nice_function","paren.lparen.function_arguments","text.function_arguments","paren.rparen","text.whitespace"],regex:"((?:".concat(G.join("|"),")\\s*)(\\()(.*?)(\\))($|\\s+)"),caseInsensitive:!0},{token:"keyword.other.chaining",regex:/\./},{token:"support.function.field",regex:/([a-z_]+)($|\s+)/,push:"comparison"}],o={start:e?[{token:"keyword.where",regex:/\s*/,next:"rootwhere",caseInsensitive:!0}]:[{token:"keyword.find",regex:/find($|\s+)/,push:"model",caseInsensitive:!0},{token:"keyword.where",regex:/where($|\s+)/,next:"rootwhere",caseInsensitive:!0}],model:[{token:"support.class.model",regex:/[A-Z][a-z_0-9]*\s*/,next:"pop"}],rootwhere:[{token:"keyword.order_by",regex:/order by($|\s+)/,next:"order",caseInsensitive:!0}].concat(r),comparison:[{token:"keyword.operator.comparison",regex:"(".concat(S.join("|"),")\\s*"),next:"value"}],value:[{token:"string",regex:/".*?"\s*/,next:"pop"},{token:"constant.numeric",regex:/\d+(.\d+)?\s*/,next:"pop"},{token:"constant.language.tocco_placeholder",regex:"\\:(".concat(A.join("|"),")\\s*"),next:"pop",caseInsensitive:!0},{token:"constant.language",regex:"(".concat(H.join("|"),")\\s*"),next:"pop",caseInsensitive:!0},{token:"support.type",regex:"(".concat(F.join("|"),"):\\s*"),caseInsensitive:!0}],exists:[{token:"paren.lparen",regex:/\(\s*/},{token:"support.class.relation",regex:/rel/,push:"model"},{token:"keyword.other.chaining",regex:/\./},{token:"keyword.where",regex:/where($|\s+)/,next:"existswhere",caseInsensitive:!0},{token:"paren.rparen",regex:/\)\s*/,next:"pop"}],existswhere:[].concat(r,[{token:"paren.rparen",regex:/\)\s*/,next:"pop"}]),count:[{token:"paren.lparen",regex:/\(\s*/},{token:"support.class.relation",regex:/rel/,push:"model"},{token:"keyword.other.chaining",regex:/\./},{token:"keyword.where",regex:/where($|\s+)/,next:"countwhere",caseInsensitive:!0},{token:"paren.rparen",regex:/\)\s*/,next:"comparison"}],countwhere:[].concat(r,[{token:"paren.rparen",regex:/\)\s*/,next:"comparison"}]),order:[{token:"support.class.relation",regex:/rel/,push:"model"},{token:"keyword.other.chaining",regex:/\./},{token:["support.function.field","keyword.direction","separator"],regex:/([a-z_]+\s*)(asc|desc)?($|,|\s+)/}]};return t.$rules=E()(t.$rules,o,(function(e,t){return T()(e)?e.concat(t):void 0})),t.normalizeRules(),t}return(0,z.c)(n,t),(0,q.c)(n)}(a().require("ace/mode/text_highlight_rules").TextHighlightRules)};function Z(e,t,n){return t=(0,O.c)(t),(0,I.c)(e,D()?Reflect.construct(t,n||[],(0,O.c)(e).constructor):t.apply(e,n))}function D(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(D=function(){return!!e})()}var J=function(e){function t(){var e;(0,B.c)(this,t);return(e=Z(this,t)).$rules={start:[{token:"constant.character.entity",regex:/&[^;]+;/},{token:"support.function",regex:"\\?(\\?|substring|cap_first|uncap_first|capitalize|chop_linebreak|date|time|datetime|ends_with|html|groups|index_of|j_string|js_string|json_string|last_index_of|length|lower_case|left_pad|right_pad|contains|matches|number|replace|rtf|url|split|starts_with|string|trim|upper_case|word_list|xhtml|xmlc|round|floor|ceilingiso_[a-z_]+first|last|seq_contains|seq_index_of|seq_last_index_of|reverse|size|sort|sort_by|chunkkeys|valueschildren|parent|root|ancestors|node_name|node_type|node_namespacebyte|double|float|int|long|short|number_to_date|number_to_time|number_to_datetime|eval|has_content|interpret|is_[a-z_]+|namespacenew)"},{token:"support.function.deprecated",regex:"\\?(default|exists|if_exists|web_safe)"},{token:"language.variable",regex:"\\.(?:data_model|error|globals|lang|locale|locals|main|namespace|node|current_node|now|output_encoding|template_name|url_escaping_charset|vars|version)"},{token:"constant.language",regex:"\\b(true|false)\\b"},{token:"keyword.operator",regex:"\\b(?:gt|gte|lt|lte|as|in|using)\\b"},{token:"entity.other.attribute-name",regex:"encoding|parse|locale|number_format|date_format|time_format|datetime_format|time_zone|url_escaping_charset|classic_compatible|strip_whitespace|strip_text|strict_syntax|ns_prefixes|attributes"},{token:"string",regex:/['"]/,next:"qstring"},{token:function(e){return e.match("^[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?$")?"constant.numeric":"variable"},regex:/[\w.+-]+/},{token:"keyword.operator",regex:"!|\\.|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^="},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],qstring:[{token:"constant.character.escape",regex:'\\\\[nrtvef\\\\"$]'},{token:"string",regex:/['"]/,next:"start"},{defaultToken:"string"}]},e}return(0,z.c)(t,e),(0,q.c)(t)}(a().require("ace/mode/text_highlight_rules").TextHighlightRules),K=function(e){function t(){var e;(0,B.c)(this,t),e=Z(this,t);var n=["query","queryCount"],r=[{token:"keyword.function",regex:"\\[@(".concat(n.join("|"),").*?]"),push:"tql-start"},{token:"comment",regex:"\\[#--",next:"ftl-dcomment"},{token:"string.interpolated",regex:"\\${",push:"ftl-start"},{token:"keyword.function",regex:"\\[/?#(assign|attempt|break|case|compress|default|elseif|else|escape|fallback|function|flush|ftl|global|if|import|include|list|local|lt|macro|nested|noescape|noparse|nt|recover|recurse|return|rt|setting|stop|switch|t|visit)",push:"ftl-start"},{token:"keyword.other",regex:"\\[/?@[a-zA-Z\\.]+",push:"ftl-start"}];for(var o in e.$rules)e.$rules[o].unshift.apply(e.$rules[o],r);e.embedRules(J,"ftl-",[{token:"keyword",regex:"/?\\]",next:"pop"},{token:"string.interpolated",regex:"}",next:"pop"}],["start"]),e.addRules({"ftl-dcomment":[{token:"comment",regex:"--\\]",next:"pop"},{defaultToken:"comment"}]});var c=[{token:"keyword.function",regex:"\\[/@(".concat(n.join("|"),")]"),next:"pop"}];e.embedRules(P(),"tql-",c,["start"]);var a={"tql-rootwhere":[{token:"keyword.function",regex:"\\[/@(".concat(n.join("|"),")]"),next:"pop"}],"tql-order":[{token:"keyword.function",regex:"\\[/@(".concat(n.join("|"),")]"),next:"pop"}]};return e.$rules=E()(e.$rules,a,(function(e,t){return T()(e)?e.concat(t):void 0})),e.normalizeRules(),e}return(0,z.c)(t,e),(0,q.c)(t)}(a().require("ace/mode/html_highlight_rules").HtmlHighlightRules),L=n(81016),Q=n(32612),W=a().require("ace/token_iterator").TokenIterator,X=function(e){return e?e.type.substring(e.type.lastIndexOf(".")+1):null},Y=function(e,t){return X(e.getCurrentToken())===t},ee=function(e){if(Y(e,"model")&&e.stepBackward(),(Y(e,"field")||Y(e,"relation"))&&e.stepBackward(),!Y(e,"chaining"))return null;if(e.stepBackward(),Y(e,"model")){var t=e.getCurrentToken();return e.stepBackward(),e.stepBackward(),t?t.value.trim():null}return null},te=function(e,t){for(;!Y(e,t);)if(!e.stepBackward())return!1;return!0},ne=function(e,t){return Y(e,"rparen")?1:t>0&&Y(e,"lparen")?(e.stepBackward(),-1):0},re=function(e){for(var t=0;e.getCurrentToken();){if(0===t&&Y(e,"where")){var n=e.stepBackward();return n?[n.value.trim()].concat((0,Q.c)(ce(e))):[]}if(Y(e,"order_by")){if(te(e,"find")){var r=e.stepForward();return r?r.value.trim():[]}return[]}if(t+=ne(e,t),!e.stepBackward())return null}return null},oe=function(e,t){for(var n=[],r=t(e);r;)Array.isArray(r)?r.forEach((function(e){return n.unshift(e)})):n.unshift(r),r=t(e);return n},ce=function(e){return oe(e,ee)},ae=function(e){return oe(e,re)},ie=1e3,ue=function(e,t,n){var r=function(e,t){if(t){var n=ae(e());return{baseModel:t,modelScope:(0,L.c)(n).slice(0)}}var r=ae(e()),o=(0,L.c)(r);return{baseModel:o[0],modelScope:o.slice(1)}}(e,n),o=r.baseModel,c=r.modelScope;if(o){var a=ce(e()),i=[].concat((0,Q.c)(c),(0,Q.c)(a)).map((function(e){return"rel".concat(e)}));(function(e){var t=(0,L.c)(e),n=t[0],r=t.slice(1);return $(function(e,t){var n=t.length>0?"/resolve?path="+t.join("."):"";return"entities/".concat(e,"/model").concat(n)}(n,r)).then(j).then((function(e){if(!e)return[];var t=e.fields||[],n=e.relations||[];return[].concat((0,Q.c)(t.map((function(e){return{label:(t=e,t.label?"".concat(t.fieldName," (").concat(t.label,")"):t.fieldName),value:e.fieldName,meta:e.type};var t}))),(0,Q.c)(n.map((function(e){return{label:(t=e,t.label?"".concat(t.relationName," (").concat(t.label,")"):t.relationName),value:e.relationName,meta:e.targetEntity};var t}))))}))})([o].concat((0,Q.c)(i))).then((function(e){var n=e.map((function(e){return{caption:e.label,value:e.value,meta:e.meta,score:ie}}));t(null,n)})).catch((function(e){return t(e)}))}},se=function(e,t){return t?"".concat(e," (").concat(t,")"):e},le=function(e){return $("entities").then(j).then((function(e){return e?e.entities:{}})).then((function(e){return e?Object.values(e):[]})).then((function(e){return e.map((function(e){return e.metaData}))})).then((function(t){var n=t.map((function(e){var t=e.modelName,n=e.label;return{caption:se(t,n),value:t,score:ie}}));e(null,n)})).catch((function(t){return e(t)}))},pe=function(){return G.map((function(e){return e.toUpperCase()})).map((function(e){return{caption:e,value:"".concat(e,"()"),meta:"function",score:970}}))};const fe=function(e){return{getCompletions:function(t,n,r,o,c){var a=function(){return new W(n,r.row,r.column)},i=a(),u=i.getCurrentToken(),s=i.stepBackward()?i.getCurrentToken():null;switch(X(u)){case"chaining":case"relation":case"separator":case"order_by":case"count":case"exists":case"field":case"function_arguments":ue(a,c,e);break;case"where":case"conjunction":ue(a,c,e),c(null,pe());break;case"nice_function":c(null,pe());break;case"find":le(c);break;case"type":case"tocco_placeholder":case"comparison":c(null,F.map((function(e){return{caption:e,value:"".concat(e,":"),meta:"type",score:980}}))),c(null,A.map((function(e){return{caption:e,value:":".concat(e),meta:"placeholder",score:990}})));break;case"model":ue(a,c,e),s&&"relation"!==X(s)&&le(c);break;case null:e&&ue(a,c,e),c(null,pe())}}}};function de(e,t,n){return t=(0,O.c)(t),(0,I.c)(e,me()?Reflect.construct(t,n||[],(0,O.c)(e).constructor):t.apply(e,n))}function me(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(me=function(){return!!e})()}var he=function(e){function t(){var e;return(0,B.c)(this,t),(e=de(this,t)).HighlightRules=K,e.completer=fe(),e}return(0,z.c)(t,e),(0,q.c)(t)}(a().require("ace/mode/ftl").Mode);function ge(e,t,n){return t=(0,O.c)(t),(0,I.c)(e,ke()?Reflect.construct(t,n||[],(0,O.c)(e).constructor):t.apply(e,n))}function ke(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ke=function(){return!!e})()}var xe,ve=function(e){function t(e){var n,r=e.implicitModelName;return(0,B.c)(this,t),(n=ge(this,t)).HighlightRules=P(r),n.completer=fe(r),n.snippedIdField=null,n}return(0,z.c)(t,e),(0,q.c)(t)}(a().require("ace/mode/text").Mode),we=n(17624),_e=M.cp.div.withConfig({displayName:"StyledEditor"})(xe||(xe=(0,o.c)(["\n width: 100%;\n z-index: 0; /* gutter lays over menu otherwise */\n"]))),ye={groovy:function(){return new u.Mode},html:function(){return new s.Mode},xml:function(){return new m.Mode},properties:function(){return new f.Mode},json:function(){return new l.Mode},htmlmixed:function(){return new he},freemarkermixed:function(){return new he},ftl:function(){return new he},tql:function(e){return new ve(e)},less:function(){return new p.Mode},drools:function(){return new i.Mode},text:function(){return new d.Mode}},be=function(e,t){var n=t.mode,o=t.theme,c=t.showGutter,a=t.editorOptions,i=void 0===a?{}:a;(function(e){return y()(e)?Promise.resolve(e):w()(e)?$("entities/2.0/".concat(e.entityModel,"/").concat(e.key,"?_paths=").concat(e.field)).then(j).then((function(e){return g()(e,["paths","entity_name","value"],null)})):Promise.resolve(null)})(t.implicitModel).then((function(e){return function(e,t){return g()(ye,e,e)(t)}(n,{implicitModelName:e})})).then((function(t){return e.getSession().setMode(t)})),e.setTheme("ace/theme/".concat(o)),Object.entries(i).forEach((function(t){var n=(0,r.c)(t,2),o=n[0],c=n[1];e.setOption(o,c)})),e.renderer.setShowGutter(c),e.resize()};const Me=function(e){var t=e.mode,n=e.theme,r=void 0===n?"textmate":n,o=e.value,c=e.onChange,i=e.showGutter,u=void 0===i||i,s=e.editorOptions,l=void 0===s?{}:s,p=e.implicitModel,f=e.autoFocusOnMount,d=void 0!==f&&f,m=e.id,h=(0,b.useRef)(null),g=(0,b.useRef)(null),k=(0,b.useMemo)((function(){return{mode:t,theme:r,showGutter:u,editorOptions:l,implicitModel:p,autoFocusOnMount:d}}),[t,r,u,l,p,d]);return(0,b.useEffect)((function(){var e=a().edit(h.current);return e.getSession().setValue(o||""),e.on("change",(function(){return c(e.getValue())})),be(e,k),g.current=e,k.autoFocusOnMount&&g.current.focus(),function(){return e.destroy()}}),[]),(0,b.useEffect)((function(){g.current&&be(g.current,k)}),[k]),(0,b.useEffect)((function(){g.current&&!x()(o)&&o!==g.current.getValue()&&g.current.getSession().setValue(o)}),[o]),(0,we.jsx)(_e,{id:m,ref:h})}}}]);
@@ -3,4 +3,4 @@
3
3
  * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
4
4
  * For licensing, see LICENSE.md.
5
5
  */
6
- var o,a,d,l,u;o=e,a=function(e){return r=void 0,e?n(e):window.NEW_CKEDITOR?void t(NEW_CKEDITOR):n(new Error("Script loaded from editorUrl doesn't provide NEW_CKEDITOR namespace."))},l=document.head||document.getElementsByTagName("head")[0],u=document.createElement("script"),"function"==typeof a&&(d=a,a={}),a=a||{},d=d||function(){},u.type=a.type||"text/javascript",u.charset=a.charset||"utf8",u.async=!("async"in a)||!!a.async,u.src=o,a.attrs&&function(e,t){for(var n in t)e.setAttribute(n,t[n])}(u,a.attrs),a.text&&(u.text=String(a.text)),("onload"in u?i:c)(u,d),u.onload||i(u,d),l.appendChild(u)}))};var l=n(3268),u=function(){return u=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},u.apply(this,arguments)};function s(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;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))}var f=["activeEnterModeChange","activeFilterChange","afterCommandExec","afterInsertHtml","afterPaste","afterPasteFromWord","afterSetData","afterUndoImage","ariaEditorHelpLabel","ariaWidget","autogrow","beforeCommandExec","beforeDestroy","beforeGetData","beforeModeUnload","beforeSetMode","beforeUndoImage","blur","change","configLoaded","contentDirChanged","contentDom","contentDomInvalidated","contentDomUnload","contentPreview","customConfigLoaded","dataFiltered","dataReady","destroy","dialogHide","dialogShow","dirChanged","doubleclick","dragend","dragstart","drop","elementsPathUpdate","exportPdf","fileUploadRequest","fileUploadResponse","floatingSpaceLayout","focus","getData","getSnapshot","insertElement","insertHtml","insertText","instanceReady","key","langLoaded","loadSnapshot","loaded","lockSnapshot","maximize","menuShow","mode","notificationHide","notificationShow","notificationUpdate","paste","pasteFromWord","pluginsLoaded","readOnly","removeFormatCleanup","required","resize","save","saveSnapshot","selectionChange","setData","stylesRemove","stylesSet","template","toDataFormat","toHtml","uiSpace","unlockSnapshot","updateSnapshot","widgetDefinition"],p=["beforeLoad","namespaceLoaded"],y=s(s([],f,!0),p,!0),g="__CKE__";function m(e){var t=e.substr(0,1).toUpperCase()+e.substr(1);return"on".concat(t)}function h(e){return e.substr(2,1).toLowerCase()+e.substr(3)}var v=s(s([],f,!0),p,!0).reduce((function(e,t){var n;return u(u({},e),((n={})[t]=function(e){return"".concat(g).concat(e)}(t),n))}),{});function b(e){return e.split(/(?=[A-Z])/).join("-").toLowerCase()}function O(e,t,n){var r={display:"none",visibility:"hidden"};return"classic"===e?r:"ready"===t?null!=n?n:void 0:r}function k(e){var t=e.debug,n=e.editor,r=e.evtName,o=e.handler,a=e.listenerData,i=e.priority,c=t&&Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5),d=o;return t&&(d=function(e){console.log({operation:"invoke",editor:n.name,evtName:r,handlerId:c,data:e.data,listenerData:e.listenerData}),o(e)}),t&&console.log({operation:"register",editor:n.name,evtName:r,handlerId:c}),n.on(r,d,null,a,i),function(){t&&console.log({operation:"unregister",editor:n.name,evtName:r,handlerId:c}),n.removeListener(r,d)}}var S=a.useEffect,C=a.useReducer,E=a.useRef,w="https://cdn.ckeditor.com/4.22.1/standard-all/ckeditor.js",D={};function j(e,t){switch(t.type){case"init":return u(u({},e),{hookStatus:"init"});case"loading":return u(u({},e),{hookStatus:"loading"});case"unloaded":return{editor:t.payload,hookStatus:"unloaded"};case"loaded":return u(u({},e),{hookStatus:"loaded"});case"ready":return u(u({},e),{hookStatus:"ready"});case"destroyed":return{editor:void 0,hookStatus:"destroyed"};case"error":return{editor:void 0,hookStatus:"error"};default:return e}}var L=a.useEffect,P=a.useRef,x=a.useState;function T(e){var t=e.config,n=void 0===t?{}:t,r=e.debug,o=e.editorUrl,i=e.initData,c=e.name,l=e.readOnly,u=e.style,s=e.type,f=function(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}(e,["config","debug","editorUrl","initData","name","readOnly","style","type"]),T=x(null),U=T[0],R=T[1],_=P(f);n&&"boolean"==typeof l&&(n.readOnly=l);var I=function(e){var t=e.config,n=e.debug,r=e.dispatchEvent,o=e.subscribeTo,a=void 0===o?y:o,i=e.editorUrl,c=e.element,l=e.initContent,u=e.type,s=void 0===u?"classic":u,f=E(i||w),m=E(null!=a?a:y),h=E(n),b=E(r),O=E(l),L=E(t||D),P=E(s),x=C(j,{editor:void 0,hookStatus:"init"}),T=x[0],U=T.editor,R=T.hookStatus,_=x[1];return S((function(){return c&&!U&&(_({type:"loading"}),d(f.current,(function(e){var t;-1!==m.current.indexOf("namespaceLoaded")&&(null===(t=b.current)||void 0===t||t.call(b,{type:v.namespaceLoaded,payload:e}))})).then((function(e){var t,n="inline"===P.current,r=L.current.readOnly;-1!==m.current.indexOf("beforeLoad")&&(null===(t=b.current)||void 0===t||t.call(b,{type:v.beforeLoad,payload:e}));var o=e[n?"inline":"replace"](c,L.current);m.current.filter((function(e){return-1===p.indexOf(e)})).forEach((function(e){k({debug:h.current,editor:o,evtName:e,handler:function(t){var n;null===(n=b.current)||void 0===n||n.call(b,{type:"".concat(g).concat(e),payload:t})}})})),k({debug:h.current,editor:o,evtName:"loaded",handler:function(){_({type:"loaded"})},priority:-1}),k({debug:h.current,editor:o,evtName:"instanceReady",handler:function(e){var t=e.editor;_({type:"ready"}),n&&!r&&t.setReadOnly(!1),O.current&&t.setData(O.current,{noSnapshot:!0,callback:function(){t.resetUndo()}})},priority:-1}),k({debug:h.current,editor:o,evtName:"destroy",handler:function(){_({type:"destroyed"})},priority:-1}),_({type:"unloaded",payload:o})})).catch((function(e){console.error(e),_({type:"error"})}))),function(){U&&U.destroy()}}),[U,c]),{editor:U,status:null==U?void 0:U.status,error:"error"===R,loading:"loading"===R}}({config:n,dispatchEvent:function(e){var t=e.type,n=e.payload,r=m(t.substr(g.length)),o=_.current[r];o&&o(n)},debug:r,editorUrl:o,element:U,initContent:"string"==typeof i?i:void 0,subscribeTo:Object.keys(f).filter((function(e){return 0===e.indexOf("on")})).map(h),type:s}),N=I.editor,F=I.status;return L((function(){var e="inline"!==s&&N&&("loaded"===F||"ready"===F);return u&&e&&N.container.setStyles(u),function(){u&&e&&Object.keys(u).map(b).forEach((function(e){N.container.removeStyle(e)}))}}),[N,F,u,s]),L((function(){N&&"ready"===F&&"boolean"==typeof l&&N.setReadOnly(l)}),[N,F,l]),a.createElement("div",{id:null!=c?c:void 0,ref:R,style:O(null!=s?s:"classic",F,u)},"string"==typeof i?null:i)}var U=u({config:l.object,debug:l.bool,editorUrl:l.string,initData:l.node,name:l.string,readOnly:l.bool,style:l.object,type:l.oneOf(["classic","inline"])},y.reduce((function(e,t){var n;return u(u({},e),((n={})[m(t)]=l.func,n))}),{}));T.propTypes=U;var R,_=n(98168),I=n(8688),N=n(86692),F=n(80560),H=n(13356),K=F.cp.div.withConfig({displayName:"StyledHtmlEditor"})(R||(R=(0,N.c)(["\n && {\n .ck-editor {\n --ck-border-radius: 0.27rem;\n ","\n\n .ck.ck-list__item .ck-button.ck-fontsize-option .ck-button__label {\n line-height: 1;\n }\n\n .ck-editor__editable {\n min-height: 100px;\n }\n }\n }\n"])),(function(e){return(0,H.my)(e,"ckeditor")})),W=n(17624);function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}window.NEW_CKEDITOR_BASEPATH="".concat(n.p,"ckeditor4/");var B=function(e){switch(e){case"fr-CH":return"fr";case"it-CH":return"it";case"en-US":return"en";case"fr":case"en":case"it":case"de":return e;case"de-CH":return"de-ch";default:return"de"}},z=function(e){var t=e.id,r=e.value,a=e.onChange,i=e.contentLang,c=e.defaultLinkTarget,d=e.ckEditorConfig,l=(0,_.useIntl)().locale,u=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach((function(t){(0,o.c)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({language:B(l),contentsLanguage:i,entities:!1,allowedContent:!0,toolbar:[["Bold","Italic","Underline","Strike","RemoveFormat"],["Format","Font","FontSize","TextColor"],["NumberedList","BulletedList"],["Link","Unlink"],["Table","SpecialChar","Image"],["PasteText"],["Source"]],extraPlugins:["colorbutton","colordialog","dialogadvtab","font","codemirror"],removeButtons:[],removeDialogTabs:"",removePlugins:["elementspath"],codemirror:{mode:"htmlmixed",enableCodeFormatting:!0,autoFormatOnStart:!0},versionCheck:!1},d),s=function(e){try{var t=e.data.name,n=e.data.definition;if("link"===t)n.getContents("info").get("protocol").default="https://",n.getContents("target").get("linkTargetType").default=c||"notSet"}catch(e){I.c.logError("Could not set default link attributes.")}};return(0,W.jsx)(K,{id:t,children:(0,W.jsx)(T,{config:u,initData:r,onBeforeLoad:function(e){return e.on("dialogDefinition",s)},type:"classic",onChange:function(e){var t=e.editor.getData();a(t)},onKey:function(e){"source"===e.editor.mode&&setTimeout((function(){var t=e.editor.editable().getValue();a(t)}),0)},editorUrl:"".concat(n.p,"ckeditor4/ckeditor-new.js")})})};z.defaultProps={value:"",contentLang:"de"};const M=z}}]);
6
+ var o,a,d,l,u;o=e,a=function(e){return r=void 0,e?n(e):window.NEW_CKEDITOR?void t(NEW_CKEDITOR):n(new Error("Script loaded from editorUrl doesn't provide NEW_CKEDITOR namespace."))},l=document.head||document.getElementsByTagName("head")[0],u=document.createElement("script"),"function"==typeof a&&(d=a,a={}),a=a||{},d=d||function(){},u.type=a.type||"text/javascript",u.charset=a.charset||"utf8",u.async=!("async"in a)||!!a.async,u.src=o,a.attrs&&function(e,t){for(var n in t)e.setAttribute(n,t[n])}(u,a.attrs),a.text&&(u.text=String(a.text)),("onload"in u?i:c)(u,d),u.onload||i(u,d),l.appendChild(u)}))};var l=n(3268),u=function(){return u=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},u.apply(this,arguments)};function s(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;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))}var f=["activeEnterModeChange","activeFilterChange","afterCommandExec","afterInsertHtml","afterPaste","afterPasteFromWord","afterSetData","afterUndoImage","ariaEditorHelpLabel","ariaWidget","autogrow","beforeCommandExec","beforeDestroy","beforeGetData","beforeModeUnload","beforeSetMode","beforeUndoImage","blur","change","configLoaded","contentDirChanged","contentDom","contentDomInvalidated","contentDomUnload","contentPreview","customConfigLoaded","dataFiltered","dataReady","destroy","dialogHide","dialogShow","dirChanged","doubleclick","dragend","dragstart","drop","elementsPathUpdate","exportPdf","fileUploadRequest","fileUploadResponse","floatingSpaceLayout","focus","getData","getSnapshot","insertElement","insertHtml","insertText","instanceReady","key","langLoaded","loadSnapshot","loaded","lockSnapshot","maximize","menuShow","mode","notificationHide","notificationShow","notificationUpdate","paste","pasteFromWord","pluginsLoaded","readOnly","removeFormatCleanup","required","resize","save","saveSnapshot","selectionChange","setData","stylesRemove","stylesSet","template","toDataFormat","toHtml","uiSpace","unlockSnapshot","updateSnapshot","widgetDefinition"],p=["beforeLoad","namespaceLoaded"],y=s(s([],f,!0),p,!0),g="__CKE__";function m(e){var t=e.substr(0,1).toUpperCase()+e.substr(1);return"on".concat(t)}function h(e){return e.substr(2,1).toLowerCase()+e.substr(3)}var v=s(s([],f,!0),p,!0).reduce((function(e,t){var n;return u(u({},e),((n={})[t]=function(e){return"".concat(g).concat(e)}(t),n))}),{});function b(e){return e.split(/(?=[A-Z])/).join("-").toLowerCase()}function O(e,t,n){var r={display:"none",visibility:"hidden"};return"classic"===e?r:"ready"===t?null!=n?n:void 0:r}function k(e){var t=e.debug,n=e.editor,r=e.evtName,o=e.handler,a=e.listenerData,i=e.priority,c=t&&Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5),d=o;return t&&(d=function(e){console.log({operation:"invoke",editor:n.name,evtName:r,handlerId:c,data:e.data,listenerData:e.listenerData}),o(e)}),t&&console.log({operation:"register",editor:n.name,evtName:r,handlerId:c}),n.on(r,d,null,a,i),function(){t&&console.log({operation:"unregister",editor:n.name,evtName:r,handlerId:c}),n.removeListener(r,d)}}var S=a.useEffect,C=a.useReducer,E=a.useRef,w="https://cdn.ckeditor.com/4.22.1/standard-all/ckeditor.js",D={};function j(e,t){switch(t.type){case"init":return u(u({},e),{hookStatus:"init"});case"loading":return u(u({},e),{hookStatus:"loading"});case"unloaded":return{editor:t.payload,hookStatus:"unloaded"};case"loaded":return u(u({},e),{hookStatus:"loaded"});case"ready":return u(u({},e),{hookStatus:"ready"});case"destroyed":return{editor:void 0,hookStatus:"destroyed"};case"error":return{editor:void 0,hookStatus:"error"};default:return e}}var L=a.useEffect,P=a.useRef,x=a.useState;function T(e){var t=e.config,n=void 0===t?{}:t,r=e.debug,o=e.editorUrl,i=e.initData,c=e.name,l=e.readOnly,u=e.style,s=e.type,f=function(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}(e,["config","debug","editorUrl","initData","name","readOnly","style","type"]),T=x(null),U=T[0],R=T[1],_=P(f);n&&"boolean"==typeof l&&(n.readOnly=l);var I=function(e){var t=e.config,n=e.debug,r=e.dispatchEvent,o=e.subscribeTo,a=void 0===o?y:o,i=e.editorUrl,c=e.element,l=e.initContent,u=e.type,s=void 0===u?"classic":u,f=E(i||w),m=E(null!=a?a:y),h=E(n),b=E(r),O=E(l),L=E(t||D),P=E(s),x=C(j,{editor:void 0,hookStatus:"init"}),T=x[0],U=T.editor,R=T.hookStatus,_=x[1];return S((function(){return c&&!U&&(_({type:"loading"}),d(f.current,(function(e){var t;-1!==m.current.indexOf("namespaceLoaded")&&(null===(t=b.current)||void 0===t||t.call(b,{type:v.namespaceLoaded,payload:e}))})).then((function(e){var t,n="inline"===P.current,r=L.current.readOnly;-1!==m.current.indexOf("beforeLoad")&&(null===(t=b.current)||void 0===t||t.call(b,{type:v.beforeLoad,payload:e}));var o=e[n?"inline":"replace"](c,L.current);m.current.filter((function(e){return-1===p.indexOf(e)})).forEach((function(e){k({debug:h.current,editor:o,evtName:e,handler:function(t){var n;null===(n=b.current)||void 0===n||n.call(b,{type:"".concat(g).concat(e),payload:t})}})})),k({debug:h.current,editor:o,evtName:"loaded",handler:function(){_({type:"loaded"})},priority:-1}),k({debug:h.current,editor:o,evtName:"instanceReady",handler:function(e){var t=e.editor;_({type:"ready"}),n&&!r&&t.setReadOnly(!1),O.current&&t.setData(O.current,{noSnapshot:!0,callback:function(){t.resetUndo()}})},priority:-1}),k({debug:h.current,editor:o,evtName:"destroy",handler:function(){_({type:"destroyed"})},priority:-1}),_({type:"unloaded",payload:o})})).catch((function(e){console.error(e),_({type:"error"})}))),function(){U&&U.destroy()}}),[U,c]),{editor:U,status:null==U?void 0:U.status,error:"error"===R,loading:"loading"===R}}({config:n,dispatchEvent:function(e){var t=e.type,n=e.payload,r=m(t.substr(g.length)),o=_.current[r];o&&o(n)},debug:r,editorUrl:o,element:U,initContent:"string"==typeof i?i:void 0,subscribeTo:Object.keys(f).filter((function(e){return 0===e.indexOf("on")})).map(h),type:s}),N=I.editor,F=I.status;return L((function(){var e="inline"!==s&&N&&("loaded"===F||"ready"===F);return u&&e&&N.container.setStyles(u),function(){u&&e&&Object.keys(u).map(b).forEach((function(e){N.container.removeStyle(e)}))}}),[N,F,u,s]),L((function(){N&&"ready"===F&&"boolean"==typeof l&&N.setReadOnly(l)}),[N,F,l]),a.createElement("div",{id:null!=c?c:void 0,ref:R,style:O(null!=s?s:"classic",F,u)},"string"==typeof i?null:i)}var U=u({config:l.object,debug:l.bool,editorUrl:l.string,initData:l.node,name:l.string,readOnly:l.bool,style:l.object,type:l.oneOf(["classic","inline"])},y.reduce((function(e,t){var n;return u(u({},e),((n={})[m(t)]=l.func,n))}),{}));T.propTypes=U;var R,_=n(98168),I=n(8688),N=n(86692),F=n(76548),H=n(13356),K=F.cp.div.withConfig({displayName:"StyledHtmlEditor"})(R||(R=(0,N.c)(["\n && {\n .ck-editor {\n --ck-border-radius: 0.27rem;\n ","\n\n .ck.ck-list__item .ck-button.ck-fontsize-option .ck-button__label {\n line-height: 1;\n }\n\n .ck-editor__editable {\n min-height: 100px;\n }\n }\n }\n"])),(function(e){return(0,H.my)(e,"ckeditor")})),W=n(17624);function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}window.NEW_CKEDITOR_BASEPATH="".concat(n.p,"ckeditor4/");var B=function(e){switch(e){case"fr-CH":return"fr";case"it-CH":return"it";case"en-US":return"en";case"fr":case"en":case"it":case"de":return e;case"de-CH":return"de-ch";default:return"de"}},z=function(e){var t=e.id,r=e.value,a=e.onChange,i=e.contentLang,c=e.defaultLinkTarget,d=e.ckEditorConfig,l=(0,_.useIntl)().locale,u=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach((function(t){(0,o.c)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({language:B(l),contentsLanguage:i,entities:!1,allowedContent:!0,toolbar:[["Bold","Italic","Underline","Strike","RemoveFormat"],["Format","Font","FontSize","TextColor"],["NumberedList","BulletedList"],["Link","Unlink"],["Table","SpecialChar","Image"],["PasteText"],["Source"]],extraPlugins:["colorbutton","colordialog","dialogadvtab","font","codemirror"],removeButtons:[],removeDialogTabs:"",removePlugins:["elementspath"],codemirror:{mode:"htmlmixed",enableCodeFormatting:!0,autoFormatOnStart:!0},versionCheck:!1},d),s=function(e){try{var t=e.data.name,n=e.data.definition;if("link"===t)n.getContents("info").get("protocol").default="https://",n.getContents("target").get("linkTargetType").default=c||"notSet"}catch(e){I.c.logError("Could not set default link attributes.")}};return(0,W.jsx)(K,{id:t,children:(0,W.jsx)(T,{config:u,initData:r,onBeforeLoad:function(e){return e.on("dialogDefinition",s)},type:"classic",onChange:function(e){var t=e.editor.getData();a(t)},onKey:function(e){"source"===e.editor.mode&&setTimeout((function(){var t=e.editor.editable().getValue();a(t)}),0)},editorUrl:"".concat(n.p,"ckeditor4/ckeditor-new.js")})})};z.defaultProps={value:"",contentLang:"de"};const M=z}}]);