yaml-admin-front 0.0.113 → 0.0.114

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1535,4 +1535,4 @@ rect.legend-mouseover-inactive,
1535
1535
 
1536
1536
  .apexcharts-disable-transitions * {
1537
1537
  transition: none !important;
1538
- }`;var d=((u=e.opts.chart)===null||u===void 0?void 0:u.nonce)||e.w.config.chart.nonce;d&&c.setAttribute("nonce",d),i?a.prepend(c):e.w.config.chart.injectStyleSheet!==!1&&l.head.appendChild(c)}var f=e.create(e.w.config.series,{});if(!f)return r(e);e.mount(f).then((function(){typeof e.w.config.chart.events.mounted=="function"&&e.w.config.chart.events.mounted(e,e.w),e.events.fireEvent("mounted",[e,e.w]),r(f)})).catch((function(h){n(h)}))}else n(new Error("Element not found"))}))}},{key:"create",value:function(e,r){var n=this,o=this.w;new yj(this).initModules();var a=this.w.globals;if(a.noData=!1,a.animationEnded=!1,!ne.elementExists(this.el)||(this.responsive.checkResponsiveConfig(r),o.config.xaxis.convertedCatToNumeric&&new Vf(o.config).convertCatToNumericXaxis(o.config,this.ctx),this.core.setupElements(),o.config.chart.type==="treemap"&&(o.config.grid.show=!1,o.config.yaxis[0].show=!1),a.svgWidth===0))return a.animationEnded=!0,null;var i=e;e.forEach((function(h,g){h.hidden&&(i=n.legend.legendHelpers.getSeriesAfterCollapsing({realIndex:g}))}));var l=$r.checkComboSeries(i,o.config.chart.type);a.comboCharts=l.comboCharts,a.comboBarCount=l.comboBarCount;var c=i.every((function(h){return h.data&&h.data.length===0}));(i.length===0||c&&a.collapsedSeries.length<1)&&this.series.handleNoData(),this.events.setupEventHandlers(),this.data.parseData(i),this.theme.init(),new Qu(this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),a.noData&&a.collapsedSeries.length!==a.series.length&&!o.config.legend.showForSingleSeries||this.legend.init(),this.series.hasAllSeriesEqualX(),a.axisCharts&&(this.core.coreCalculations(),o.config.xaxis.type!=="category"&&this.formatters.setLabelFormatters(),this.ctx.toolbar.minX=o.globals.minX,this.ctx.toolbar.maxX=o.globals.maxX),this.formatters.heatmapLabelFormatters(),new $r(this).getLargestMarkerSize(),this.dimensions.plotCoords();var u=this.core.xySettings();this.grid.createGridMask();var d=this.core.plotChartType(i,u),f=new pu(this);return f.bringForward(),o.config.dataLabels.background.enabled&&f.dataLabelsBackground(),this.core.shiftGraphPosition(),o.globals.dataPoints>50&&o.globals.dom.elWrap.classList.add("apexcharts-disable-transitions"),{elGraph:d,xyRatios:u,dimensions:{plot:{left:o.globals.translateX,top:o.globals.translateY,width:o.globals.gridWidth,height:o.globals.gridHeight}}}}},{key:"mount",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=this,o=n.w;return new Promise((function(a,i){if(n.el===null)return i(new Error("Not enough data to display or target element not found"));(r===null||o.globals.allSeriesCollapsed)&&n.series.handleNoData(),n.grid=new lY(n);var l,c,u=n.grid.drawGrid();if(n.annotations=new NAe(n),n.annotations.drawImageAnnos(),n.annotations.drawTextAnnos(),o.config.grid.position==="back"&&(u&&o.globals.dom.elGraphical.add(u.el),u!=null&&(l=u.elGridBorders)!==null&&l!==void 0&&l.node&&o.globals.dom.elGraphical.add(u.elGridBorders)),Array.isArray(r.elGraph))for(var d=0;d<r.elGraph.length;d++)o.globals.dom.elGraphical.add(r.elGraph[d]);else o.globals.dom.elGraphical.add(r.elGraph);o.config.grid.position==="front"&&(u&&o.globals.dom.elGraphical.add(u.el),u!=null&&(c=u.elGridBorders)!==null&&c!==void 0&&c.node&&o.globals.dom.elGraphical.add(u.elGridBorders)),o.config.xaxis.crosshairs.position==="front"&&n.crosshairs.drawXCrosshairs(),o.config.yaxis[0].crosshairs.position==="front"&&n.crosshairs.drawYCrosshairs(),o.config.chart.type!=="treemap"&&n.axes.drawAxis(o.config.chart.type,u);var f=new Yf(e.ctx,u),h=new oR(e.ctx,u);if(u!==null&&(f.xAxisLabelCorrections(u.xAxisTickWidth),h.setYAxisTextAlignments(),o.config.yaxis.map((function(y,m){o.globals.ignoreYAxisIndexes.indexOf(m)===-1&&h.yAxisTitleRotate(m,y.opposite)}))),n.annotations.drawAxesAnnotations(),!o.globals.noData){if(o.config.tooltip.enabled&&!o.globals.noData&&n.w.globals.tooltip.drawTooltip(r.xyRatios),o.globals.axisCharts&&(o.globals.isXNumeric||o.config.xaxis.convertedCatToNumeric||o.globals.isRangeBar))(o.config.chart.zoom.enabled||o.config.chart.selection&&o.config.chart.selection.enabled||o.config.chart.pan&&o.config.chart.pan.enabled)&&n.zoomPanSelection.init({xyRatios:r.xyRatios});else{var g=o.config.chart.toolbar.tools;["zoom","zoomin","zoomout","selection","pan","reset"].forEach((function(y){g[y]=!1}))}o.config.chart.toolbar.show&&!o.globals.allSeriesCollapsed&&n.toolbar.createToolbar()}o.globals.memory.methodsToExec.length>0&&o.globals.memory.methodsToExec.forEach((function(y){y.method(y.params,!1,y.context)})),o.globals.axisCharts||o.globals.noData||n.core.resizeNonAxisCharts(),a(n)}))}},{key:"destroy",value:function(){window.removeEventListener("resize",this.windowResizeHandler),(function(r,n){var o=iC.get(n);o&&(o.disconnect(),iC.delete(n))})(this.el.parentNode,this.parentResizeHandler);var e=this.w.config.chart.id;e&&Apex._chartInstances.forEach((function(r,n){r.id===ne.escapeString(e)&&Apex._chartInstances.splice(n,1)})),new bj(this.ctx).clear({isUpdating:!1})}},{key:"updateOptions",value:function(e){var r=this,n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],o=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],a=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],i=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],l=this.w;return l.globals.selection=void 0,this.lastUpdateOptions&&JSON.stringify(this.lastUpdateOptions)===JSON.stringify(e)?this:(e.series&&(this.data.resetParsingFlags(),this.series.resetSeries(!1,!0,!1),e.series.length&&e.series[0].data&&(e.series=e.series.map((function(c,u){return r.updateHelpers._extendSeries(c,u)}))),this.updateHelpers.revertDefaultAxisMinMax()),e.xaxis&&(e=this.updateHelpers.forceXAxisUpdate(e)),e.yaxis&&(e=this.updateHelpers.forceYAxisUpdate(e)),l.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),e.theme&&(e=this.theme.updateThemeOptions(e)),this.updateHelpers._updateOptions(e,n,o,a,i))}},{key:"updateSeries",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return this.data.resetParsingFlags(),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(e,r,n)}},{key:"appendSeries",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];this.data.resetParsingFlags();var o=this.w.config.series.slice();return o.push(e),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(o,r,n)}},{key:"appendData",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this;n.data.resetParsingFlags(),n.w.globals.dataChanged=!0,n.series.getPreviousPaths();for(var o=n.w.config.series.slice(),a=0;a<o.length;a++)if(e[a]!==null&&e[a]!==void 0)for(var i=0;i<e[a].data.length;i++)o[a].data.push(e[a].data[i]);return n.w.config.series=o,r&&(n.w.globals.initialSeries=ne.clone(n.w.config.series)),this.update()}},{key:"update",value:function(e){var r=this;return new Promise((function(n,o){if(r.lastUpdateOptions&&JSON.stringify(r.lastUpdateOptions)===JSON.stringify(e))return n(r);r.lastUpdateOptions=ne.clone(e),new bj(r.ctx).clear({isUpdating:!0});var a=r.create(r.w.config.series,e);if(!a)return n(r);r.mount(a).then((function(){typeof r.w.config.chart.events.updated=="function"&&r.w.config.chart.events.updated(r,r.w),r.events.fireEvent("updated",[r,r.w]),r.w.globals.isDirty=!0,n(r)})).catch((function(i){o(i)}))}))}},{key:"getSyncedCharts",value:function(){var e=this.getGroupedCharts(),r=[this];return e.length&&(r=[],e.forEach((function(n){r.push(n)}))),r}},{key:"getGroupedCharts",value:function(){var e=this;return Apex._chartInstances.filter((function(r){if(r.group)return!0})).map((function(r){return e.w.config.chart.group===r.group?r.chart:e}))}},{key:"toggleSeries",value:function(e){return this.series.toggleSeries(e)}},{key:"highlightSeriesOnLegendHover",value:function(e,r){return this.series.toggleSeriesOnHover(e,r)}},{key:"showSeries",value:function(e){this.series.showSeries(e)}},{key:"hideSeries",value:function(e){this.series.hideSeries(e)}},{key:"highlightSeries",value:function(e){this.series.highlightSeries(e)}},{key:"isSeriesHidden",value:function(e){this.series.isSeriesHidden(e)}},{key:"resetSeries",value:function(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.series.resetSeries(e,r)}},{key:"addEventListener",value:function(e,r){this.events.addEventListener(e,r)}},{key:"removeEventListener",value:function(e,r){this.events.removeEventListener(e,r)}},{key:"addXaxisAnnotation",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,o=this;n&&(o=n),o.annotations.addXaxisAnnotationExternal(e,r,o)}},{key:"addYaxisAnnotation",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,o=this;n&&(o=n),o.annotations.addYaxisAnnotationExternal(e,r,o)}},{key:"addPointAnnotation",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,o=this;n&&(o=n),o.annotations.addPointAnnotationExternal(e,r,o)}},{key:"clearAnnotations",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,r=this;e&&(r=e),r.annotations.clearAnnotations(r)}},{key:"removeAnnotation",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=this;r&&(n=r),n.annotations.removeAnnotation(n,e)}},{key:"getChartArea",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner")}},{key:"getSeriesTotalXRange",value:function(e,r){return this.coreUtils.getSeriesTotalsXRange(e,r)}},{key:"getHighestValueInSeries",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new rk(this.ctx).getMinYMaxY(e).highestY}},{key:"getLowestValueInSeries",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new rk(this.ctx).getMinYMaxY(e).lowestY}},{key:"getSeriesTotal",value:function(){return this.w.globals.seriesTotals}},{key:"toggleDataPointSelection",value:function(e,r){return this.updateHelpers.toggleDataPointSelection(e,r)}},{key:"zoomX",value:function(e,r){this.ctx.toolbar.zoomUpdateOptions(e,r)}},{key:"setLocale",value:function(e){this.localization.setCurrentLocaleValues(e)}},{key:"dataURI",value:function(e){return new af(this.ctx).dataURI(e)}},{key:"getSvgString",value:function(e){return new af(this.ctx).getSvgString(e)}},{key:"exportToCSV",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new af(this.ctx).exportToCSV(e)}},{key:"paper",value:function(){return this.w.globals.dom.Paper}},{key:"_parentResizeCallback",value:function(){this.w.globals.animationEnded&&this.w.config.chart.redrawOnParentResize&&this._windowResize()}},{key:"_windowResize",value:function(){var e=this;clearTimeout(this.w.globals.resizeTimer),this.w.globals.resizeTimer=window.setTimeout((function(){e.w.globals.resized=!0,e.w.globals.dataChanged=!1,e.ctx.update()}),150)}},{key:"_windowResizeHandler",value:function(){var e=this.w.config.chart.redrawOnWindowResize;typeof e=="function"&&(e=e()),e&&this._windowResize()}}],[{key:"getChartByID",value:function(e){var r=ne.escapeString(e);if(Apex._chartInstances){var n=Apex._chartInstances.filter((function(o){return o.id===r}))[0];return n&&n.chart}}},{key:"initOnLoad",value:function(){for(var e=document.querySelectorAll("[data-apexcharts]"),r=0;r<e.length;r++)new t(e[r],JSON.parse(e[r].getAttribute("data-options"))).render()}},{key:"exec",value:function(e,r){var n=this.getChartByID(e);if(n){n.w.globals.isExecCalled=!0;var o=null;if(n.publicMethods.indexOf(r)!==-1){for(var a=arguments.length,i=new Array(a>2?a-2:0),l=2;l<a;l++)i[l-2]=arguments[l];o=n[r].apply(n,i)}return o}}},{key:"merge",value:function(e,r){return ne.extend(e,r)}},{key:"getThemePalettes",value:function(){return{palette1:["#008FFB","#00E396","#FEB019","#FF4560","#775DD0"],palette2:["#3F51B5","#03A9F4","#4CAF50","#F9CE1D","#FF9800"],palette3:["#33B2DF","#546E7A","#D4526E","#13D8AA","#A5978B"],palette4:["#4ECDC4","#C7F464","#81D4FA","#FD6A6A","#546E7A"],palette5:["#2B908F","#F9A3A4","#90EE7E","#FA4443","#69D2E7"],palette6:["#449DD1","#F86624","#EA3546","#662E9B","#C5D86D"],palette7:["#D7263D","#1B998B","#2E294E","#F46036","#E2C044"],palette8:["#662E9B","#F86624","#F9C80E","#EA3546","#43BCCD"],palette9:["#5C4742","#A5978B","#8D5B4C","#5A2A27","#C4BBAF"],palette10:["#A300D6","#7D02EB","#5653FE","#2983FF","#00B1F2"]}}}]),t})();const mPe=Object.freeze(Object.defineProperty({__proto__:null,default:gPe},Symbol.toStringTag,{value:"Module"})),yPe=wY(mPe);var vj;function bPe(){return vj||(vj=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=S;var e=l(R),r=a(yPe),n=a(WB()),o=["type","width","height","series","options"];function a(C){return C&&C.__esModule?C:{default:C}}function i(C){var E,k;return typeof WeakMap!="function"?null:(E=new WeakMap,k=new WeakMap,(i=function(T){return T?k:E})(C))}function l(C,E){if(!E&&C&&C.__esModule)return C;if(C===null||f(C)!="object"&&typeof C!="function")return{default:C};if(E=i(E),E&&E.has(C))return E.get(C);var k,T,A={__proto__:null},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(k in C)k!=="default"&&{}.hasOwnProperty.call(C,k)&&((T=O?Object.getOwnPropertyDescriptor(C,k):null)&&(T.get||T.set)?Object.defineProperty(A,k,T):A[k]=C[k]);return A.default=C,E&&E.set(C,A),A}function c(){return(c=Object.assign?Object.assign.bind():function(C){for(var E=1;E<arguments.length;E++){var k,T=arguments[E];for(k in T)!{}.hasOwnProperty.call(T,k)||(C[k]=T[k])}return C}).apply(null,arguments)}function u(C,E){if(C==null)return{};var k,T=d(C,E);if(Object.getOwnPropertySymbols)for(var A=Object.getOwnPropertySymbols(C),O=0;O<A.length;O++)k=A[O],E.includes(k)||{}.propertyIsEnumerable.call(C,k)&&(T[k]=C[k]);return T}function d(C,E){if(C==null)return{};var k,T={};for(k in C)if({}.hasOwnProperty.call(C,k)){if(E.includes(k))continue;T[k]=C[k]}return T}function f(C){return(f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E})(C)}function h(C,E){var k,T=Object.keys(C);return Object.getOwnPropertySymbols&&(k=Object.getOwnPropertySymbols(C),E&&(k=k.filter(function(A){return Object.getOwnPropertyDescriptor(C,A).enumerable})),T.push.apply(T,k)),T}function g(C){for(var E=1;E<arguments.length;E++){var k=arguments[E]!=null?arguments[E]:{};E%2?h(Object(k),!0).forEach(function(T){y(C,T,k[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(k)):h(Object(k)).forEach(function(T){Object.defineProperty(C,T,Object.getOwnPropertyDescriptor(k,T))})}return C}function y(C,E,k){return(E=m(E))in C?Object.defineProperty(C,E,{value:k,enumerable:!0,configurable:!0,writable:!0}):C[E]=k,C}function m(C){return C=b(C,"string"),f(C)=="symbol"?C:C+""}function b(C,E){if(f(C)!="object"||!C)return C;var k=C[Symbol.toPrimitive];if(k===void 0)return(E==="string"?String:Number)(C);if(k=k.call(C,E),f(k)!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}function v(C,E){var k=g({},C);return E.forEach(function(T){delete k[T]}),k}function x(C,E){var k=2<arguments.length&&arguments[2]!==void 0?arguments[2]:new WeakSet;if(C!==E){if(f(C)!=="object"||C===null||f(E)!=="object"||E===null)return!1;if(!k.has(C)&&!k.has(E)){k.add(C),k.add(E);var T=Object.keys(C),A=Object.keys(E);if(T.length!==A.length)return!1;for(var O=0,M=T;O<M.length;O++){var I=M[O];if(!A.includes(I)||!x(C[I],E[I],k))return!1}}}return!0}function S(z){function E(H){return H&&f(H)==="object"&&!Array.isArray(H)}var I=z.type,k=I===void 0?"line":I,I=z.width,T=I===void 0?"100%":I,I=z.height,A=I===void 0?"auto":I,O=z.series,M=z.options,I=u(z,o),P=(0,e.useRef)(null),_=(0,e.useRef)(null),N=(0,e.useRef)(),D=((0,e.useEffect)(function(){N.current=M;var H=P.current;return _.current=new r.default(H,D()),_.current.render(),function(){_.current&&typeof _.current.destroy=="function"&&_.current.destroy()}},[]),(0,e.useEffect)(function(){var H=!x(_.current.w.config.series,O),W=!x(N.current,M)||A!==_.current.opts.chart.height||T!==_.current.opts.chart.width;(H||W)&&(!H||W?_.current.updateOptions(D()):_.current.updateSeries(O)),N.current=M},[M,O,A,T]),function(){return F(M,{chart:{type:k,height:A,width:T},series:O})}),F=function(H,W){var $=g({},H);return E(H)&&E(W)&&Object.keys(W).forEach(function(B){E(W[B])&&B in H?$[B]=F(H[B],W[B]):Object.assign($,y({},B,W[B]))}),$},z=v(I,Object.keys(S.propTypes));return e.default.createElement("div",c({ref:P},z))}S.propTypes={type:n.default.string.isRequired,series:n.default.array.isRequired,options:n.default.object.isRequired,width:n.default.oneOfType([n.default.string,n.default.number]),height:n.default.oneOfType([n.default.string,n.default.number])}})(W1)),W1}var vPe=bPe();const lC=tn(vPe),xPe=typeof lC=="object"?lC.default:lC,wPe=(t,e,r)=>({...t,chart:{...t?.chart,toolbar:{show:!0,tools:{download:!0,selection:!1,zoom:!1,zoomin:!1,zoomout:!1,pan:!1,reset:!1}},fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',animations:{enabled:!0,easing:"easeinout",speed:800,animateGradually:{enabled:!0,delay:150},dynamicAnimation:{enabled:!0,speed:350}},dropShadow:{enabled:!1}},grid:{...t?.grid,borderColor:"#f0f0f0",strokeDashArray:4,padding:{left:10,right:10}},stroke:{...t?.stroke,curve:e==="line"?"smooth":"straight",width:e==="line"?3:0},fill:{...t?.fill,type:e==="line"?"gradient":"solid",gradient:e==="line"?{shadeIntensity:.3,opacityFrom:1,opacityTo:1,stops:[0,90,100]}:void 0},dataLabels:{...t?.dataLabels,enabled:e==="bar",style:{fontSize:"11px",fontWeight:600,colors:["#fff"]},dropShadow:{enabled:!1}},plotOptions:{...t?.plotOptions,bar:{...t?.plotOptions?.bar,borderRadius:6,columnWidth:"60%",dataLabels:{position:"top"}}},xaxis:{...t?.xaxis,axisBorder:{show:!1},axisTicks:{show:!1},labels:{...t?.xaxis?.labels,style:{colors:"#64748b",fontSize:"12px",fontWeight:500}}},yaxis:{...t?.yaxis,max:r?.max,forceNiceScale:r?.type==="integer",decimalsInFloat:r?.type==="integer"?0:void 0,labels:{...t?.yaxis?.labels,formatter:o=>{if(r?.value_text)for(const a of r.value_text)try{if(new Function("value",`return ${a.if}`)(o))return a.text}catch(i){console.warn("Failed to evaluate value_text condition:",a.if,i)}return r?.type==="integer"?Math.floor(o).toString():o},style:{colors:"#64748b",fontSize:"12px",fontWeight:500}}},legend:{...t?.legend,position:"bottom",horizontalAlign:"center",fontSize:"13px",fontWeight:500,markers:{width:10,height:10,radius:10},itemMargin:{horizontal:12,vertical:8}},tooltip:{...t?.tooltip,theme:"light",style:{fontSize:"13px"},y:{formatter:o=>o?.toLocaleString()}}}),SPe=({component:t,custom:e,...r})=>{Ti(),mn();const[n,o]=R.useState(null),[a,i]=R.useState(!0);R.useEffect(()=>{i(!0);let c="";t.filter?.forEach(d=>{if(typeof d.value=="string"&&(d.value.includes("$lte ")||d.value.includes("$gte ")||d.value.includes("$lt ")||d.value.includes("$gt "))){const[f,h]=d.value.split(" ");c+=`${s.name}=${encodeURIComponent(f+" "+h)}&`}else if(d.value?.startsWith("$")){let f=localStorage.getItem(d.value.substring(1));f&&(c+=`${d.name}=${encodeURIComponent(f)}&`)}else c+=`${d.name}=null&`});const u=t.api||`/api/chart/${t.id}`;xi(`${u}?${c}`).then(d=>{o(d),i(!1)}).catch(()=>{i(!1)})},[t.id]);const l=R.useMemo(()=>n?.options?wPe(n.options,t?.type,t?.y):null,[n?.options,t?.type,t?.y]);return a?L.jsx(qr,{sx:{width:"100%",height:t.height||300},children:L.jsx(gA,{variant:"rectangular",width:"100%",height:"100%",sx:{borderRadius:2,bgcolor:"rgba(0,0,0,0.04)"}})}):L.jsx(qr,{sx:{width:"100%","& .apexcharts-canvas":{margin:"0 auto"}},children:n&&t&&l&&L.jsx(xPe,{height:t.height||300,options:l,series:n.series,type:t?.type})})},CPe=({component:t,custom:e,...r})=>{const{yml:n}=mn(),[o,a]=R.useState({}),i=R.useMemo(()=>{const g=Array.isArray(t.sort)?t.sort[0]:null;return g?.name?{field:g.name,order:g.desc?"DESC":"ASC"}:{field:"id",order:"DESC"}},[t.sort]);R.useEffect(()=>{const g={};t.filter&&t.filter.forEach(y=>{let m=y.value;if(m!=null)if(typeof y.value=="string"&&(y.value.includes("$lte ")||y.value.includes("$gte ")||y.value.includes("$lt ")||y.value.includes("$gt "))){const[b,v]=y.value.split(" ");g[y.name]=b+" "+v}else typeof y.value=="string"&&m.startsWith("$")&&(m=localStorage.getItem(m.substring(1))),g[y.name]=m}),a(g)},[t.filter]);const{data:l,total:c,isLoading:u,error:d}=Gk(t.entity,{pagination:{page:1,perPage:t.limit||10},sort:i,filter:o},{enabled:Object.keys(o).length>0||!t.filter}),f=R.useMemo(()=>({data:l,isLoading:u,total:c,page:1,perPage:t.limit||10,sort:i,filterValues:o,setSort:()=>{},setPage:()=>{},setPerPage:()=>{},setFilters:()=>{},resource:t.entity,selectedIds:[],onSelect:()=>{},onToggleItem:()=>{},onUnselectItems:()=>{}}),[l,u,c,i,o,t.entity,t.limit]);if(u)return L.jsx(qr,{sx:{width:"100%",height:t.height||300},children:L.jsx(gA,{variant:"rectangular",width:"100%",height:"100%",sx:{borderRadius:2,bgcolor:"rgba(0,0,0,0.04)"}})});if(d)return L.jsx(wt,{color:"error",children:"Error loading data"});if(!l||!n?.entity?.[t.entity])return null;const h=n.entity[t.entity];return L.jsx(lp,{value:t.entity,children:L.jsx(aT,{value:f,children:L.jsx(qr,{sx:{width:"100%",overflow:"auto"},children:L.jsx(sb,{bulkActionButtons:!1,rowClick:!1,empty:L.jsx(qr,{sx:{p:2},children:"No data"}),children:t.fields.map((g,y)=>{const m=typeof g=="string"?g:g.name,b=h.fields.find(v=>v.name===m);return b?du({field:b,isList:!0,crud_field:typeof g=="object"?g:{name:m}}):null})})})})})},cC=["linear-gradient(135deg, #667eea 0%, #764ba2 100%)","linear-gradient(135deg, #f093fb 0%, #f5576c 100%)","linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)","linear-gradient(135deg, #43e97b 0%, #38f9d7 100%)","linear-gradient(135deg, #fa709a 0%, #fee140 100%)","linear-gradient(135deg, #a8edea 0%, #fed6e3 100%)"],EPe=({components:t,custom:e,...r})=>{Ti(),mn();const n=Bn();return Wn(n.breakpoints.up("md")),L.jsx(qr,{sx:{minHeight:"100vh",padding:{xs:2,md:4}},children:L.jsx(Yg,{container:!0,spacing:3,children:t?.map((o,a)=>{console.log(`Dashboard Component [${a}] ${o.label}:`,o);const i=a%cC.length;return L.jsx(Yg,{item:!0,size:{xs:12,md:o.size||4},children:L.jsxs(Hn,{elevation:0,sx:{borderRadius:4,overflow:"hidden",transition:"all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1)",background:"#ffffff",border:"1px solid",borderColor:zn(n.palette.divider,.1),position:"relative","&:hover":{transform:"translateY(-8px)",boxShadow:"0 20px 40px -12px rgba(0,0,0,0.15)",borderColor:"transparent",zIndex:1}},children:[L.jsxs(qr,{sx:{px:3,py:2.5,display:"flex",alignItems:"center",gap:2,position:"relative",overflow:"hidden",borderBottom:`1px solid ${zn(n.palette.divider,.05)}`,"&::before":{content:'""',position:"absolute",top:0,left:0,width:"4px",height:"100%",background:cC[i]}},children:[o.icon&&L.jsx(qr,{sx:{width:42,height:42,borderRadius:"14px",display:"flex",alignItems:"center",justifyContent:"center",background:cC[i],boxShadow:"0 8px 16px -4px rgba(0,0,0,0.2)",color:"#fff",transition:"transform 0.3s ease",".MuiPaper-root:hover &":{transform:"scale(1.1) rotate(5deg)"}},children:L.jsx(ul,{icon:o.icon,width:22,height:22,style:{color:"#fff"}})}),L.jsx(wt,{variant:"subtitle1",sx:{fontWeight:700,color:"#2c3e50",letterSpacing:"0.5px"},children:o.label})]}),L.jsxs(Iu,{sx:{p:3},children:[o.component==="table"&&L.jsx(CPe,{component:o}),o.component==="chart"&&L.jsx(SPe,{component:o})]})]})},a)})})})},kPe=({custom:t,...e})=>{Ti();const r=mn();return L.jsx(EPe,{components:r?.front?.dashboard})},uC=async(t,e={})=>{e.headers||(e.headers=new Headers({Accept:"application/json"}));const r=localStorage.getItem("token");e.headers.set("x-access-token",r);try{return await iz(t,e)}catch(n){throw n.body&&n.body.message?(console.log("error.body.message",n.body.message),new op(n.body.message,n.status,n.body)):n}},TPe=()=>{const{yml:t}=mn();return L.jsx($A,{backgroundImage:t?.front?.appearance?.login?.background})},APe=({adminYaml:t,adminJson:e,i18nProvider:r,custom:n,theme:o,layout:a})=>{const[i,l]=R.useState(null),[c,u]=R.useState(null),d=Array.isArray(n?.customRoutes)?n.customRoutes:[],f=R.useMemo(()=>({...GF,login:h=>GF.login(h).then(g=>(n?.loginSuccess&&n.loginSuccess(g.member),g))}),[n]);return R.useEffect(()=>{(async()=>{try{const g=t&&xxe.parse(t)||e;l(g);const y=g["api-host"].uri,m={};Object.entries(g.entity).map(([b,v])=>{v.fields.map(x=>{x.private&&(m[b]={...m[b],[x.name]:x.private})})}),console.log("api_host",y),g.upload?.local?(console.log("upload.local",g.upload.local.base_url),u(KF(x1(y,uC),!0,m))):g.upload?.s3?(console.log("upload.s3",g.upload.s3.base_url),u(KF(x1(y,uC),!1,m))):(console.log("upload.none"),u(x1(y,uC))),uq(y)}catch(g){console.error("YAML file load error",g)}})()},[]),L.jsx(L.Fragment,{children:c&&L.jsx(E5,{initialYml:i,custom:n,width:"1250px",children:L.jsxs(dve,{loginPage:n?.layout?.Login||TPe,theme:{...$H,...o},dashboard:i?.front?.dashboard?kPe:void 0,layout:a||oSe,authProvider:f,i18nProvider:r,dataProvider:c,children:[i?.entity&&Object.keys(i.entity).map(h=>{const g=i.entity[h];return g.custom?L.jsx(Ag,{name:h,options:{label:g.label},icon:IconComponent},h):L.jsx(Ag,{name:h,options:{label:g.label},icon:L.jsx(ul,{icon:g?.icon,width:"1.25rem",height:"1.25rem"}),list:(y=>L.jsx(WTe,{...y,custom:n})),create:(y=>L.jsx(YTe,{...y,custom:n})),edit:(y=>L.jsx(GTe,{...y,custom:n})),show:(y=>L.jsx(JTe,{...y,custom:n}))},h)}),L.jsx(OC,{children:d.filter(h=>h?.path&&h?.element&&!h?.noLayout).map(h=>L.jsx(wg,{path:h.path,element:h.element},h.path))}),L.jsx(OC,{noLayout:!0,children:d.filter(h=>h?.path&&h?.element&&h?.noLayout).map(h=>L.jsx(wg,{path:h.path,element:h.element},h.path))})]})})})};exports.ActionPopup=pq;exports.AdminContext=sP;exports.AdminProvider=E5;exports.AppBar=EA;exports.EntityTreeView=A3;exports.Layout=PA;exports.Login=$A;exports.LoginForm=fV;exports.Logout=SA;exports.Menu=Lu;exports.UserMenu=tb;exports.YMLAdmin=APe;exports.defaultTheme=$H;exports.fetcher=xi;exports.postFetcher=Im;exports.uploadFile=dq;exports.uploadFileSecure=fq;exports.useAdminContext=mn;exports.useRedirect=ki;exports.useSidebarState=zi;exports.useTranslate=Ze;
1538
+ }`;var d=((u=e.opts.chart)===null||u===void 0?void 0:u.nonce)||e.w.config.chart.nonce;d&&c.setAttribute("nonce",d),i?a.prepend(c):e.w.config.chart.injectStyleSheet!==!1&&l.head.appendChild(c)}var f=e.create(e.w.config.series,{});if(!f)return r(e);e.mount(f).then((function(){typeof e.w.config.chart.events.mounted=="function"&&e.w.config.chart.events.mounted(e,e.w),e.events.fireEvent("mounted",[e,e.w]),r(f)})).catch((function(h){n(h)}))}else n(new Error("Element not found"))}))}},{key:"create",value:function(e,r){var n=this,o=this.w;new yj(this).initModules();var a=this.w.globals;if(a.noData=!1,a.animationEnded=!1,!ne.elementExists(this.el)||(this.responsive.checkResponsiveConfig(r),o.config.xaxis.convertedCatToNumeric&&new Vf(o.config).convertCatToNumericXaxis(o.config,this.ctx),this.core.setupElements(),o.config.chart.type==="treemap"&&(o.config.grid.show=!1,o.config.yaxis[0].show=!1),a.svgWidth===0))return a.animationEnded=!0,null;var i=e;e.forEach((function(h,g){h.hidden&&(i=n.legend.legendHelpers.getSeriesAfterCollapsing({realIndex:g}))}));var l=$r.checkComboSeries(i,o.config.chart.type);a.comboCharts=l.comboCharts,a.comboBarCount=l.comboBarCount;var c=i.every((function(h){return h.data&&h.data.length===0}));(i.length===0||c&&a.collapsedSeries.length<1)&&this.series.handleNoData(),this.events.setupEventHandlers(),this.data.parseData(i),this.theme.init(),new Qu(this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),a.noData&&a.collapsedSeries.length!==a.series.length&&!o.config.legend.showForSingleSeries||this.legend.init(),this.series.hasAllSeriesEqualX(),a.axisCharts&&(this.core.coreCalculations(),o.config.xaxis.type!=="category"&&this.formatters.setLabelFormatters(),this.ctx.toolbar.minX=o.globals.minX,this.ctx.toolbar.maxX=o.globals.maxX),this.formatters.heatmapLabelFormatters(),new $r(this).getLargestMarkerSize(),this.dimensions.plotCoords();var u=this.core.xySettings();this.grid.createGridMask();var d=this.core.plotChartType(i,u),f=new pu(this);return f.bringForward(),o.config.dataLabels.background.enabled&&f.dataLabelsBackground(),this.core.shiftGraphPosition(),o.globals.dataPoints>50&&o.globals.dom.elWrap.classList.add("apexcharts-disable-transitions"),{elGraph:d,xyRatios:u,dimensions:{plot:{left:o.globals.translateX,top:o.globals.translateY,width:o.globals.gridWidth,height:o.globals.gridHeight}}}}},{key:"mount",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=this,o=n.w;return new Promise((function(a,i){if(n.el===null)return i(new Error("Not enough data to display or target element not found"));(r===null||o.globals.allSeriesCollapsed)&&n.series.handleNoData(),n.grid=new lY(n);var l,c,u=n.grid.drawGrid();if(n.annotations=new NAe(n),n.annotations.drawImageAnnos(),n.annotations.drawTextAnnos(),o.config.grid.position==="back"&&(u&&o.globals.dom.elGraphical.add(u.el),u!=null&&(l=u.elGridBorders)!==null&&l!==void 0&&l.node&&o.globals.dom.elGraphical.add(u.elGridBorders)),Array.isArray(r.elGraph))for(var d=0;d<r.elGraph.length;d++)o.globals.dom.elGraphical.add(r.elGraph[d]);else o.globals.dom.elGraphical.add(r.elGraph);o.config.grid.position==="front"&&(u&&o.globals.dom.elGraphical.add(u.el),u!=null&&(c=u.elGridBorders)!==null&&c!==void 0&&c.node&&o.globals.dom.elGraphical.add(u.elGridBorders)),o.config.xaxis.crosshairs.position==="front"&&n.crosshairs.drawXCrosshairs(),o.config.yaxis[0].crosshairs.position==="front"&&n.crosshairs.drawYCrosshairs(),o.config.chart.type!=="treemap"&&n.axes.drawAxis(o.config.chart.type,u);var f=new Yf(e.ctx,u),h=new oR(e.ctx,u);if(u!==null&&(f.xAxisLabelCorrections(u.xAxisTickWidth),h.setYAxisTextAlignments(),o.config.yaxis.map((function(y,m){o.globals.ignoreYAxisIndexes.indexOf(m)===-1&&h.yAxisTitleRotate(m,y.opposite)}))),n.annotations.drawAxesAnnotations(),!o.globals.noData){if(o.config.tooltip.enabled&&!o.globals.noData&&n.w.globals.tooltip.drawTooltip(r.xyRatios),o.globals.axisCharts&&(o.globals.isXNumeric||o.config.xaxis.convertedCatToNumeric||o.globals.isRangeBar))(o.config.chart.zoom.enabled||o.config.chart.selection&&o.config.chart.selection.enabled||o.config.chart.pan&&o.config.chart.pan.enabled)&&n.zoomPanSelection.init({xyRatios:r.xyRatios});else{var g=o.config.chart.toolbar.tools;["zoom","zoomin","zoomout","selection","pan","reset"].forEach((function(y){g[y]=!1}))}o.config.chart.toolbar.show&&!o.globals.allSeriesCollapsed&&n.toolbar.createToolbar()}o.globals.memory.methodsToExec.length>0&&o.globals.memory.methodsToExec.forEach((function(y){y.method(y.params,!1,y.context)})),o.globals.axisCharts||o.globals.noData||n.core.resizeNonAxisCharts(),a(n)}))}},{key:"destroy",value:function(){window.removeEventListener("resize",this.windowResizeHandler),(function(r,n){var o=iC.get(n);o&&(o.disconnect(),iC.delete(n))})(this.el.parentNode,this.parentResizeHandler);var e=this.w.config.chart.id;e&&Apex._chartInstances.forEach((function(r,n){r.id===ne.escapeString(e)&&Apex._chartInstances.splice(n,1)})),new bj(this.ctx).clear({isUpdating:!1})}},{key:"updateOptions",value:function(e){var r=this,n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],o=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],a=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],i=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],l=this.w;return l.globals.selection=void 0,this.lastUpdateOptions&&JSON.stringify(this.lastUpdateOptions)===JSON.stringify(e)?this:(e.series&&(this.data.resetParsingFlags(),this.series.resetSeries(!1,!0,!1),e.series.length&&e.series[0].data&&(e.series=e.series.map((function(c,u){return r.updateHelpers._extendSeries(c,u)}))),this.updateHelpers.revertDefaultAxisMinMax()),e.xaxis&&(e=this.updateHelpers.forceXAxisUpdate(e)),e.yaxis&&(e=this.updateHelpers.forceYAxisUpdate(e)),l.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),e.theme&&(e=this.theme.updateThemeOptions(e)),this.updateHelpers._updateOptions(e,n,o,a,i))}},{key:"updateSeries",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return this.data.resetParsingFlags(),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(e,r,n)}},{key:"appendSeries",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];this.data.resetParsingFlags();var o=this.w.config.series.slice();return o.push(e),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(o,r,n)}},{key:"appendData",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this;n.data.resetParsingFlags(),n.w.globals.dataChanged=!0,n.series.getPreviousPaths();for(var o=n.w.config.series.slice(),a=0;a<o.length;a++)if(e[a]!==null&&e[a]!==void 0)for(var i=0;i<e[a].data.length;i++)o[a].data.push(e[a].data[i]);return n.w.config.series=o,r&&(n.w.globals.initialSeries=ne.clone(n.w.config.series)),this.update()}},{key:"update",value:function(e){var r=this;return new Promise((function(n,o){if(r.lastUpdateOptions&&JSON.stringify(r.lastUpdateOptions)===JSON.stringify(e))return n(r);r.lastUpdateOptions=ne.clone(e),new bj(r.ctx).clear({isUpdating:!0});var a=r.create(r.w.config.series,e);if(!a)return n(r);r.mount(a).then((function(){typeof r.w.config.chart.events.updated=="function"&&r.w.config.chart.events.updated(r,r.w),r.events.fireEvent("updated",[r,r.w]),r.w.globals.isDirty=!0,n(r)})).catch((function(i){o(i)}))}))}},{key:"getSyncedCharts",value:function(){var e=this.getGroupedCharts(),r=[this];return e.length&&(r=[],e.forEach((function(n){r.push(n)}))),r}},{key:"getGroupedCharts",value:function(){var e=this;return Apex._chartInstances.filter((function(r){if(r.group)return!0})).map((function(r){return e.w.config.chart.group===r.group?r.chart:e}))}},{key:"toggleSeries",value:function(e){return this.series.toggleSeries(e)}},{key:"highlightSeriesOnLegendHover",value:function(e,r){return this.series.toggleSeriesOnHover(e,r)}},{key:"showSeries",value:function(e){this.series.showSeries(e)}},{key:"hideSeries",value:function(e){this.series.hideSeries(e)}},{key:"highlightSeries",value:function(e){this.series.highlightSeries(e)}},{key:"isSeriesHidden",value:function(e){this.series.isSeriesHidden(e)}},{key:"resetSeries",value:function(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.series.resetSeries(e,r)}},{key:"addEventListener",value:function(e,r){this.events.addEventListener(e,r)}},{key:"removeEventListener",value:function(e,r){this.events.removeEventListener(e,r)}},{key:"addXaxisAnnotation",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,o=this;n&&(o=n),o.annotations.addXaxisAnnotationExternal(e,r,o)}},{key:"addYaxisAnnotation",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,o=this;n&&(o=n),o.annotations.addYaxisAnnotationExternal(e,r,o)}},{key:"addPointAnnotation",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,o=this;n&&(o=n),o.annotations.addPointAnnotationExternal(e,r,o)}},{key:"clearAnnotations",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,r=this;e&&(r=e),r.annotations.clearAnnotations(r)}},{key:"removeAnnotation",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=this;r&&(n=r),n.annotations.removeAnnotation(n,e)}},{key:"getChartArea",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner")}},{key:"getSeriesTotalXRange",value:function(e,r){return this.coreUtils.getSeriesTotalsXRange(e,r)}},{key:"getHighestValueInSeries",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new rk(this.ctx).getMinYMaxY(e).highestY}},{key:"getLowestValueInSeries",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new rk(this.ctx).getMinYMaxY(e).lowestY}},{key:"getSeriesTotal",value:function(){return this.w.globals.seriesTotals}},{key:"toggleDataPointSelection",value:function(e,r){return this.updateHelpers.toggleDataPointSelection(e,r)}},{key:"zoomX",value:function(e,r){this.ctx.toolbar.zoomUpdateOptions(e,r)}},{key:"setLocale",value:function(e){this.localization.setCurrentLocaleValues(e)}},{key:"dataURI",value:function(e){return new af(this.ctx).dataURI(e)}},{key:"getSvgString",value:function(e){return new af(this.ctx).getSvgString(e)}},{key:"exportToCSV",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new af(this.ctx).exportToCSV(e)}},{key:"paper",value:function(){return this.w.globals.dom.Paper}},{key:"_parentResizeCallback",value:function(){this.w.globals.animationEnded&&this.w.config.chart.redrawOnParentResize&&this._windowResize()}},{key:"_windowResize",value:function(){var e=this;clearTimeout(this.w.globals.resizeTimer),this.w.globals.resizeTimer=window.setTimeout((function(){e.w.globals.resized=!0,e.w.globals.dataChanged=!1,e.ctx.update()}),150)}},{key:"_windowResizeHandler",value:function(){var e=this.w.config.chart.redrawOnWindowResize;typeof e=="function"&&(e=e()),e&&this._windowResize()}}],[{key:"getChartByID",value:function(e){var r=ne.escapeString(e);if(Apex._chartInstances){var n=Apex._chartInstances.filter((function(o){return o.id===r}))[0];return n&&n.chart}}},{key:"initOnLoad",value:function(){for(var e=document.querySelectorAll("[data-apexcharts]"),r=0;r<e.length;r++)new t(e[r],JSON.parse(e[r].getAttribute("data-options"))).render()}},{key:"exec",value:function(e,r){var n=this.getChartByID(e);if(n){n.w.globals.isExecCalled=!0;var o=null;if(n.publicMethods.indexOf(r)!==-1){for(var a=arguments.length,i=new Array(a>2?a-2:0),l=2;l<a;l++)i[l-2]=arguments[l];o=n[r].apply(n,i)}return o}}},{key:"merge",value:function(e,r){return ne.extend(e,r)}},{key:"getThemePalettes",value:function(){return{palette1:["#008FFB","#00E396","#FEB019","#FF4560","#775DD0"],palette2:["#3F51B5","#03A9F4","#4CAF50","#F9CE1D","#FF9800"],palette3:["#33B2DF","#546E7A","#D4526E","#13D8AA","#A5978B"],palette4:["#4ECDC4","#C7F464","#81D4FA","#FD6A6A","#546E7A"],palette5:["#2B908F","#F9A3A4","#90EE7E","#FA4443","#69D2E7"],palette6:["#449DD1","#F86624","#EA3546","#662E9B","#C5D86D"],palette7:["#D7263D","#1B998B","#2E294E","#F46036","#E2C044"],palette8:["#662E9B","#F86624","#F9C80E","#EA3546","#43BCCD"],palette9:["#5C4742","#A5978B","#8D5B4C","#5A2A27","#C4BBAF"],palette10:["#A300D6","#7D02EB","#5653FE","#2983FF","#00B1F2"]}}}]),t})();const mPe=Object.freeze(Object.defineProperty({__proto__:null,default:gPe},Symbol.toStringTag,{value:"Module"})),yPe=wY(mPe);var vj;function bPe(){return vj||(vj=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=S;var e=l(R),r=a(yPe),n=a(WB()),o=["type","width","height","series","options"];function a(C){return C&&C.__esModule?C:{default:C}}function i(C){var E,k;return typeof WeakMap!="function"?null:(E=new WeakMap,k=new WeakMap,(i=function(T){return T?k:E})(C))}function l(C,E){if(!E&&C&&C.__esModule)return C;if(C===null||f(C)!="object"&&typeof C!="function")return{default:C};if(E=i(E),E&&E.has(C))return E.get(C);var k,T,A={__proto__:null},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(k in C)k!=="default"&&{}.hasOwnProperty.call(C,k)&&((T=O?Object.getOwnPropertyDescriptor(C,k):null)&&(T.get||T.set)?Object.defineProperty(A,k,T):A[k]=C[k]);return A.default=C,E&&E.set(C,A),A}function c(){return(c=Object.assign?Object.assign.bind():function(C){for(var E=1;E<arguments.length;E++){var k,T=arguments[E];for(k in T)!{}.hasOwnProperty.call(T,k)||(C[k]=T[k])}return C}).apply(null,arguments)}function u(C,E){if(C==null)return{};var k,T=d(C,E);if(Object.getOwnPropertySymbols)for(var A=Object.getOwnPropertySymbols(C),O=0;O<A.length;O++)k=A[O],E.includes(k)||{}.propertyIsEnumerable.call(C,k)&&(T[k]=C[k]);return T}function d(C,E){if(C==null)return{};var k,T={};for(k in C)if({}.hasOwnProperty.call(C,k)){if(E.includes(k))continue;T[k]=C[k]}return T}function f(C){return(f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E})(C)}function h(C,E){var k,T=Object.keys(C);return Object.getOwnPropertySymbols&&(k=Object.getOwnPropertySymbols(C),E&&(k=k.filter(function(A){return Object.getOwnPropertyDescriptor(C,A).enumerable})),T.push.apply(T,k)),T}function g(C){for(var E=1;E<arguments.length;E++){var k=arguments[E]!=null?arguments[E]:{};E%2?h(Object(k),!0).forEach(function(T){y(C,T,k[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(k)):h(Object(k)).forEach(function(T){Object.defineProperty(C,T,Object.getOwnPropertyDescriptor(k,T))})}return C}function y(C,E,k){return(E=m(E))in C?Object.defineProperty(C,E,{value:k,enumerable:!0,configurable:!0,writable:!0}):C[E]=k,C}function m(C){return C=b(C,"string"),f(C)=="symbol"?C:C+""}function b(C,E){if(f(C)!="object"||!C)return C;var k=C[Symbol.toPrimitive];if(k===void 0)return(E==="string"?String:Number)(C);if(k=k.call(C,E),f(k)!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}function v(C,E){var k=g({},C);return E.forEach(function(T){delete k[T]}),k}function x(C,E){var k=2<arguments.length&&arguments[2]!==void 0?arguments[2]:new WeakSet;if(C!==E){if(f(C)!=="object"||C===null||f(E)!=="object"||E===null)return!1;if(!k.has(C)&&!k.has(E)){k.add(C),k.add(E);var T=Object.keys(C),A=Object.keys(E);if(T.length!==A.length)return!1;for(var O=0,M=T;O<M.length;O++){var I=M[O];if(!A.includes(I)||!x(C[I],E[I],k))return!1}}}return!0}function S(z){function E(H){return H&&f(H)==="object"&&!Array.isArray(H)}var I=z.type,k=I===void 0?"line":I,I=z.width,T=I===void 0?"100%":I,I=z.height,A=I===void 0?"auto":I,O=z.series,M=z.options,I=u(z,o),P=(0,e.useRef)(null),_=(0,e.useRef)(null),N=(0,e.useRef)(),D=((0,e.useEffect)(function(){N.current=M;var H=P.current;return _.current=new r.default(H,D()),_.current.render(),function(){_.current&&typeof _.current.destroy=="function"&&_.current.destroy()}},[]),(0,e.useEffect)(function(){var H=!x(_.current.w.config.series,O),W=!x(N.current,M)||A!==_.current.opts.chart.height||T!==_.current.opts.chart.width;(H||W)&&(!H||W?_.current.updateOptions(D()):_.current.updateSeries(O)),N.current=M},[M,O,A,T]),function(){return F(M,{chart:{type:k,height:A,width:T},series:O})}),F=function(H,W){var $=g({},H);return E(H)&&E(W)&&Object.keys(W).forEach(function(B){E(W[B])&&B in H?$[B]=F(H[B],W[B]):Object.assign($,y({},B,W[B]))}),$},z=v(I,Object.keys(S.propTypes));return e.default.createElement("div",c({ref:P},z))}S.propTypes={type:n.default.string.isRequired,series:n.default.array.isRequired,options:n.default.object.isRequired,width:n.default.oneOfType([n.default.string,n.default.number]),height:n.default.oneOfType([n.default.string,n.default.number])}})(W1)),W1}var vPe=bPe();const lC=tn(vPe),xPe=typeof lC=="object"?lC.default:lC,wPe=(t,e,r)=>({...t,chart:{...t?.chart,toolbar:{show:!0,tools:{download:!0,selection:!1,zoom:!1,zoomin:!1,zoomout:!1,pan:!1,reset:!1}},fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',animations:{enabled:!0,easing:"easeinout",speed:800,animateGradually:{enabled:!0,delay:150},dynamicAnimation:{enabled:!0,speed:350}},dropShadow:{enabled:!1}},grid:{...t?.grid,borderColor:"#f0f0f0",strokeDashArray:4,padding:{left:10,right:10}},stroke:{...t?.stroke,curve:e==="line"?"smooth":"straight",width:e==="line"?3:0},fill:{...t?.fill,type:e==="line"?"gradient":"solid",gradient:e==="line"?{shadeIntensity:.3,opacityFrom:1,opacityTo:1,stops:[0,90,100]}:void 0},dataLabels:{...t?.dataLabels,enabled:e==="bar",style:{fontSize:"11px",fontWeight:600,colors:["#fff"]},dropShadow:{enabled:!1}},plotOptions:{...t?.plotOptions,bar:{...t?.plotOptions?.bar,borderRadius:6,columnWidth:"60%",dataLabels:{position:"top"}}},xaxis:{...t?.xaxis,axisBorder:{show:!1},axisTicks:{show:!1},labels:{...t?.xaxis?.labels,style:{colors:"#64748b",fontSize:"12px",fontWeight:500}}},yaxis:{...t?.yaxis,max:r?.max,forceNiceScale:r?.type==="integer",decimalsInFloat:r?.type==="integer"?0:void 0,labels:{...t?.yaxis?.labels,formatter:o=>{if(r?.value_text)for(const a of r.value_text)try{if(new Function("value",`return ${a.if}`)(o))return a.text}catch(i){console.warn("Failed to evaluate value_text condition:",a.if,i)}return r?.type==="integer"?Math.floor(o).toString():o},style:{colors:"#64748b",fontSize:"12px",fontWeight:500}}},legend:{...t?.legend,position:"bottom",horizontalAlign:"center",fontSize:"13px",fontWeight:500,markers:{width:10,height:10,radius:10},itemMargin:{horizontal:12,vertical:8}},tooltip:{...t?.tooltip,theme:"light",style:{fontSize:"13px"},y:{formatter:o=>o?.toLocaleString()}}}),SPe=({component:t,custom:e,...r})=>{Ti(),mn();const[n,o]=R.useState(null),[a,i]=R.useState(!0);R.useEffect(()=>{i(!0);let c="";t.filter?.forEach(d=>{if(typeof d.value=="string"&&(d.value.includes("$lte ")||d.value.includes("$gte ")||d.value.includes("$lt ")||d.value.includes("$gt "))){const[f,h]=d.value.split(" ");c+=`${s.name}=${encodeURIComponent(f+" "+h)}&`}else if(d.value?.startsWith("$")){let f=localStorage.getItem(d.value.substring(1));f&&(c+=`${d.name}=${encodeURIComponent(f)}&`)}else c+=`${d.name}=null&`});const u=t.api||`/api/chart/${t.id}`;xi(`${u}?${c}`).then(d=>{o(d),i(!1)}).catch(()=>{i(!1)})},[t.id]);const l=R.useMemo(()=>n?.options?wPe(n.options,t?.type,t?.y):null,[n?.options,t?.type,t?.y]);return a?L.jsx(qr,{sx:{width:"100%",height:t.height||300},children:L.jsx(gA,{variant:"rectangular",width:"100%",height:"100%",sx:{borderRadius:2,bgcolor:"rgba(0,0,0,0.04)"}})}):L.jsx(qr,{sx:{width:"100%","& .apexcharts-canvas":{margin:"0 auto"}},children:n&&t&&l&&L.jsx(xPe,{height:t.height||300,options:l,series:n.series,type:t?.type})})},CPe=({component:t,custom:e,...r})=>{const{yml:n}=mn(),[o,a]=R.useState({}),i=R.useMemo(()=>{const g=Array.isArray(t.sort)?t.sort[0]:null;return g?.name?{field:g.name,order:g.desc?"DESC":"ASC"}:{field:"id",order:"DESC"}},[t.sort]);R.useEffect(()=>{const g={};t.filter&&t.filter.forEach(y=>{let m=y.value;if(m!=null)if(typeof y.value=="string"&&(y.value.includes("$lte ")||y.value.includes("$gte ")||y.value.includes("$lt ")||y.value.includes("$gt "))){const[b,v]=y.value.split(" ");g[y.name]=b+" "+v}else typeof y.value=="string"&&m.startsWith("$")&&(m=localStorage.getItem(m.substring(1))),g[y.name]=m}),a(g)},[t.filter]);const{data:l,total:c,isLoading:u,error:d}=Gk(t.entity,{pagination:{page:1,perPage:t.limit||10},sort:i,filter:o},{enabled:Object.keys(o).length>0||!t.filter}),f=R.useMemo(()=>({data:l,isLoading:u,total:c,page:1,perPage:t.limit||10,sort:i,filterValues:o,setSort:()=>{},setPage:()=>{},setPerPage:()=>{},setFilters:()=>{},resource:t.entity,selectedIds:[],onSelect:()=>{},onToggleItem:()=>{},onUnselectItems:()=>{}}),[l,u,c,i,o,t.entity,t.limit]);if(u)return L.jsx(qr,{sx:{width:"100%",height:t.height||300},children:L.jsx(gA,{variant:"rectangular",width:"100%",height:"100%",sx:{borderRadius:2,bgcolor:"rgba(0,0,0,0.04)"}})});if(d)return L.jsx(wt,{color:"error",children:"Error loading data"});if(!l||!n?.entity?.[t.entity])return null;const h=n.entity[t.entity];return L.jsx(lp,{value:t.entity,children:L.jsx(aT,{value:f,children:L.jsx(qr,{sx:{width:"100%",overflow:"auto"},children:L.jsx(sb,{bulkActionButtons:!1,rowClick:!1,empty:L.jsx(qr,{sx:{p:2},children:"No data"}),children:t.fields.map((g,y)=>{const m=typeof g=="string"?g:g.name,b=h.fields.find(v=>v.name===m);return b?du({field:b,isList:!0,crud_field:typeof g=="object"?g:{name:m}}):null})})})})})},cC=["linear-gradient(135deg, #667eea 0%, #764ba2 100%)","linear-gradient(135deg, #f093fb 0%, #f5576c 100%)","linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)","linear-gradient(135deg, #43e97b 0%, #38f9d7 100%)","linear-gradient(135deg, #fa709a 0%, #fee140 100%)","linear-gradient(135deg, #a8edea 0%, #fed6e3 100%)"],EPe=({components:t,custom:e,...r})=>{Ti(),mn();const n=Bn();return Wn(n.breakpoints.up("md")),L.jsx(qr,{sx:{minHeight:"100vh",padding:{xs:2,md:4}},children:L.jsx(Yg,{container:!0,spacing:3,children:t?.map((o,a)=>{console.log(`Dashboard Component [${a}] ${o.label}:`,o);const i=a%cC.length;return L.jsx(Yg,{item:!0,size:{xs:12,md:o.size||4},children:L.jsxs(Hn,{elevation:0,sx:{borderRadius:4,overflow:"hidden",transition:"all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1)",background:"#ffffff",border:"1px solid",borderColor:zn(n.palette.divider,.1),position:"relative","&:hover":{transform:"translateY(-8px)",boxShadow:"0 20px 40px -12px rgba(0,0,0,0.15)",borderColor:"transparent",zIndex:1}},children:[L.jsxs(qr,{sx:{px:3,py:2.5,display:"flex",alignItems:"center",gap:2,position:"relative",overflow:"hidden",borderBottom:`1px solid ${zn(n.palette.divider,.05)}`,"&::before":{content:'""',position:"absolute",top:0,left:0,width:"4px",height:"100%",background:cC[i]}},children:[o.icon&&L.jsx(qr,{sx:{width:42,height:42,borderRadius:"14px",display:"flex",alignItems:"center",justifyContent:"center",background:cC[i],boxShadow:"0 8px 16px -4px rgba(0,0,0,0.2)",color:"#fff",transition:"transform 0.3s ease",".MuiPaper-root:hover &":{transform:"scale(1.1) rotate(5deg)"}},children:L.jsx(ul,{icon:o.icon,width:22,height:22,style:{color:"#fff"}})}),L.jsx(wt,{variant:"subtitle1",sx:{fontWeight:700,color:"#2c3e50",letterSpacing:"0.5px"},children:o.label})]}),L.jsxs(Iu,{sx:{p:3},children:[o.component==="table"&&L.jsx(CPe,{component:o}),o.component==="chart"&&L.jsx(SPe,{component:o})]})]})},a)})})})},kPe=({custom:t,...e})=>{Ti();const r=mn();return L.jsx(EPe,{components:r?.front?.dashboard})},uC=async(t,e={})=>{e.headers||(e.headers=new Headers({Accept:"application/json"}));const r=localStorage.getItem("token");e.headers.set("x-access-token",r);try{return await iz(t,e)}catch(n){throw n.body&&n.body.message?(console.log("error.body.message",n.body.message),new op(n.body.message,n.status,n.body)):n}},TPe=()=>{const{yml:t}=mn();return L.jsx($A,{backgroundImage:t?.front?.appearance?.login?.background})},APe=({adminYaml:t,adminJson:e,i18nProvider:r,custom:n,theme:o,layout:a})=>{const[i,l]=R.useState(null),[c,u]=R.useState(null),d=Array.isArray(n?.customRoutes)?n.customRoutes:[],f=R.useMemo(()=>({...GF,login:h=>GF.login(h).then(g=>(n?.loginSuccess&&n.loginSuccess(g.member),g))}),[n]);return R.useEffect(()=>{(async()=>{try{const g=t&&xxe.parse(t)||e;l(g);const y=g["api-host"].uri,m={};Object.entries(g.entity).map(([b,v])=>{v.fields.map(x=>{x.private&&(m[b]={...m[b],[x.name]:x.private})})}),console.log("client version","0.0.114"),console.log("api_host",y),g.upload?.local?(console.log("upload.local",g.upload.local.base_url),u(KF(x1(y,uC),!0,m))):g.upload?.s3?(console.log("upload.s3",g.upload.s3.base_url),u(KF(x1(y,uC),!1,m))):(console.log("upload.none"),u(x1(y,uC))),uq(y)}catch(g){console.error("YAML file load error",g)}})()},[]),L.jsx(L.Fragment,{children:c&&L.jsx(E5,{initialYml:i,custom:n,width:"1250px",children:L.jsxs(dve,{loginPage:n?.layout?.Login||TPe,theme:{...$H,...o},dashboard:i?.front?.dashboard?kPe:void 0,layout:a||oSe,authProvider:f,i18nProvider:r,dataProvider:c,children:[i?.entity&&Object.keys(i.entity).map(h=>{const g=i.entity[h];return g.custom?L.jsx(Ag,{name:h,options:{label:g.label},icon:IconComponent},h):L.jsx(Ag,{name:h,options:{label:g.label},icon:L.jsx(ul,{icon:g?.icon,width:"1.25rem",height:"1.25rem"}),list:(y=>L.jsx(WTe,{...y,custom:n})),create:(y=>L.jsx(YTe,{...y,custom:n})),edit:(y=>L.jsx(GTe,{...y,custom:n})),show:(y=>L.jsx(JTe,{...y,custom:n}))},h)}),L.jsx(OC,{children:d.filter(h=>h?.path&&h?.element&&!h?.noLayout).map(h=>L.jsx(wg,{path:h.path,element:h.element},h.path))}),L.jsx(OC,{noLayout:!0,children:d.filter(h=>h?.path&&h?.element&&h?.noLayout).map(h=>L.jsx(wg,{path:h.path,element:h.element},h.path))})]})})})};exports.ActionPopup=pq;exports.AdminContext=sP;exports.AdminProvider=E5;exports.AppBar=EA;exports.EntityTreeView=A3;exports.Layout=PA;exports.Login=$A;exports.LoginForm=fV;exports.Logout=SA;exports.Menu=Lu;exports.UserMenu=tb;exports.YMLAdmin=APe;exports.defaultTheme=$H;exports.fetcher=xi;exports.postFetcher=Im;exports.uploadFile=dq;exports.uploadFileSecure=fq;exports.useAdminContext=mn;exports.useRedirect=ki;exports.useSidebarState=zi;exports.useTranslate=Ze;
package/dist/index.es.js CHANGED
@@ -83131,7 +83131,7 @@ const xC = /* @__PURE__ */ un($Pe), zPe = typeof xC == "object" ? xC.default : x
83131
83131
  [x.name]: x.private
83132
83132
  });
83133
83133
  });
83134
- }), console.log("api_host", y), g.upload?.local ? (console.log("upload.local", g.upload.local.base_url), u(ij(M1(y, SC), !0, m))) : g.upload?.s3 ? (console.log("upload.s3", g.upload.s3.base_url), u(ij(M1(y, SC), !1, m))) : (console.log("upload.none"), u(M1(y, SC))), wq(y);
83134
+ }), console.log("client version", "0.0.114"), console.log("api_host", y), g.upload?.local ? (console.log("upload.local", g.upload.local.base_url), u(ij(M1(y, SC), !0, m))) : g.upload?.s3 ? (console.log("upload.s3", g.upload.s3.base_url), u(ij(M1(y, SC), !1, m))) : (console.log("upload.none"), u(M1(y, SC))), wq(y);
83135
83135
  } catch (g) {
83136
83136
  console.error("YAML file load error", g);
83137
83137
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yaml-admin-front",
3
- "version": "0.0.113",
3
+ "version": "0.0.114",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs.js",