=v&&w.push(k)}),w.sort(function(g,B){return g.scheme_name>=B.scheme_name?g.scheme_name>B.scheme_name?1:0:-1}),w},A.generate=function(m,v,w,g,B){if(Math.abs(v)<1)return[];if(w=w===void 0?0:w,g=g===void 0?1:g,Math.abs(v)<2)return[m(w)];for(var y=Math.abs(v),C=w,k=[],U=(g-w)/(B?y:y-1);--y>=0;C+=U)k.push(m(C));return v<0&&k.reverse(),k};var p=function(m){return m>0?m<1?m:1:0};return A.rgbColor=function(m,v,w){return[m,v,w].map(function(g){return g=Number(Math.round(p(g)*255)).toString(16),g.length==1?"0"+g:g}).join("")},A.linearRgbColor=function(m,v,w){return[m,v,w].map(function(g){return g=p(g),g<=.0031308?g=12.92*g:g=1.055*Math.pow(g,.4166666666666667)-.055,g=Number(Math.round(g*255)).toString(16),g.length==1?"0"+g:g}).join("")},A.hsvColor=function(m,v,w){m*=6;var g=v===void 0?1:p(v),B=w===void 0?1:p(w),y=B*(1-g*Math.abs(m%2-1)),C=B*(1-g);switch(Math.floor(m)%6){case 0:return A.rgbColor(B,y,C);case 1:return A.rgbColor(y,B,C);case 2:return A.rgbColor(C,B,y);case 3:return A.rgbColor(C,y,B);case 4:return A.rgbColor(y,C,B);default:return A.rgbColor(B,C,y)}},A.register(A.Scheme.withColorFunction("rainbow","qualitative",A.hsvColor,!1,!0)),A}();e.ColorFunction,e.Palette,e.PalettesList,e.SchemeType,function(){var a=e.Scheme.fromPalettes("mpn65","qualitative",[["ff0029","377eb8","66a61e","984ea3","00d2d5","ff7f00","af8d00","7f80cd","b3e900","c42e60","a65628","f781bf","8dd3c7","bebada","fb8072","80b1d3","fdb462","fccde5","bc80bd","ffed6f","c4eaff","cf8c00","1b9e77","d95f02","e7298a","e6ab02","a6761d","0097ff","00d067","000000","252525","525252","737373","969696","bdbdbd","f43600","4ba93b","5779bb","927acc","97ee3f","bf3947","9f5b00","f48758","8caed6","f2b94f","eff26e","e43872","d9b100","9d7a00","698cff","d9d9d9","00d27e","d06800","009f82","c49200","cbe8ff","fecddf","c27eb6","8cd2ce","c4b8d9","f883b0","a49100","f48800","27d0df","a04a9b"]]);a.shrinkByTakingHead(!0),e.register(a)}(),function(){var a=e.rgbColor,s=function(l,A){for(var c=arguments.length-1,p=arguments[c];c>1;)p=p*l+arguments[--c];return p},n=function(l){var A=s(Math.abs(l),1,.278393,.230389,972e-6,.078108);return A*=A,A*=A,A=1-1/A,l<0?-A:A};e.register(e.Scheme.fromPalettes("tol","qualitative",[["4477aa"],["4477aa","cc6677"],["4477aa","ddcc77","cc6677"],["4477aa","117733","ddcc77","cc6677"],["332288","88ccee","117733","ddcc77","cc6677"],["332288","88ccee","117733","ddcc77","cc6677","aa4499"],["332288","88ccee","44aa99","117733","ddcc77","cc6677","aa4499"],["332288","88ccee","44aa99","117733","999933","ddcc77","cc6677","aa4499"],["332288","88ccee","44aa99","117733","999933","ddcc77","cc6677","882255","aa4499"],["332288","88ccee","44aa99","117733","999933","ddcc77","661100","cc6677","882255","aa4499"],["332288","6699cc","88ccee","44aa99","117733","999933","ddcc77","661100","cc6677","882255","aa4499"],["332288","6699cc","88ccee","44aa99","117733","999933","ddcc77","661100","cc6677","aa4466","882255","aa4499"]],12,12)),e.tolSequentialColor=function(l){return a(1-.392*(1+n((l-.869)/.255)),1.021-.456*(1+n((l-.527)/.376)),1-.493*(1+n((l-.272)/.309)))},e.register(e.Scheme.withColorFunction("tol-sq","sequential",e.tolSequentialColor,!0)),e.tolDivergingColor=function(l){var A=s(l,.572,1.524,-1.811)/s(l,1,-.291,.1574);return a(s(l,.235,-2.13,26.92,-65.5,63.5,-22.36),A*A,1/s(l,1.579,-4.03,12.92,-31.4,48.6,-23.36))},e.register(e.Scheme.withColorFunction("tol-dv","diverging",e.tolDivergingColor,!0)),e.tolRainbowColor=function(l){return a(s(l,.472,-.567,4.05)/s(l,1,8.72,-19.17,14.1),s(l,.108932,-1.22635,27.284,-98.577,163.3,-131.395,40.634),1/s(l,1.97,3.54,-68.5,243,-297,125))},e.register(e.Scheme.withColorFunction("tol-rainbow","qualitative",e.tolRainbowColor,!0))}(),function(){e.register(e.Scheme.fromPalettes("sol-base","sequential",[["002b36","073642","586e75","657b83","839496","93a1a1","eee8d5","fdf6e3"]],1,8)),e.register(e.Scheme.fromPalettes("sol-accent","qualitative",[["b58900","cb4b16","dc322f","d33682","6c71c4","268bd2","2aa198","859900"]]))}(),function(){var a={YlGn:{type:"sequential",cbf:42,3:["f7fcb9","addd8e","31a354"],4:["ffffcc","c2e699","78c679","238443"],5:["ffffcc","c2e699","78c679","31a354","006837"],6:["ffffcc","d9f0a3","addd8e","78c679","31a354","006837"],7:["ffffcc","d9f0a3","addd8e","78c679","41ab5d","238443","005a32"],8:["ffffe5","f7fcb9","d9f0a3","addd8e","78c679","41ab5d","238443","005a32"],9:["ffffe5","f7fcb9","d9f0a3","addd8e","78c679","41ab5d","238443","006837","004529"]},YlGnBu:{type:"sequential",cbf:42,3:["edf8b1","7fcdbb","2c7fb8"],4:["ffffcc","a1dab4","41b6c4","225ea8"],5:["ffffcc","a1dab4","41b6c4","2c7fb8","253494"],6:["ffffcc","c7e9b4","7fcdbb","41b6c4","2c7fb8","253494"],7:["ffffcc","c7e9b4","7fcdbb","41b6c4","1d91c0","225ea8","0c2c84"],8:["ffffd9","edf8b1","c7e9b4","7fcdbb","41b6c4","1d91c0","225ea8","0c2c84"],9:["ffffd9","edf8b1","c7e9b4","7fcdbb","41b6c4","1d91c0","225ea8","253494","081d58"]},GnBu:{type:"sequential",cbf:42,3:["e0f3db","a8ddb5","43a2ca"],4:["f0f9e8","bae4bc","7bccc4","2b8cbe"],5:["f0f9e8","bae4bc","7bccc4","43a2ca","0868ac"],6:["f0f9e8","ccebc5","a8ddb5","7bccc4","43a2ca","0868ac"],7:["f0f9e8","ccebc5","a8ddb5","7bccc4","4eb3d3","2b8cbe","08589e"],8:["f7fcf0","e0f3db","ccebc5","a8ddb5","7bccc4","4eb3d3","2b8cbe","08589e"],9:["f7fcf0","e0f3db","ccebc5","a8ddb5","7bccc4","4eb3d3","2b8cbe","0868ac","084081"]},BuGn:{type:"sequential",cbf:42,3:["e5f5f9","99d8c9","2ca25f"],4:["edf8fb","b2e2e2","66c2a4","238b45"],5:["edf8fb","b2e2e2","66c2a4","2ca25f","006d2c"],6:["edf8fb","ccece6","99d8c9","66c2a4","2ca25f","006d2c"],7:["edf8fb","ccece6","99d8c9","66c2a4","41ae76","238b45","005824"],8:["f7fcfd","e5f5f9","ccece6","99d8c9","66c2a4","41ae76","238b45","005824"],9:["f7fcfd","e5f5f9","ccece6","99d8c9","66c2a4","41ae76","238b45","006d2c","00441b"]},PuBuGn:{type:"sequential",cbf:42,3:["ece2f0","a6bddb","1c9099"],4:["f6eff7","bdc9e1","67a9cf","02818a"],5:["f6eff7","bdc9e1","67a9cf","1c9099","016c59"],6:["f6eff7","d0d1e6","a6bddb","67a9cf","1c9099","016c59"],7:["f6eff7","d0d1e6","a6bddb","67a9cf","3690c0","02818a","016450"],8:["fff7fb","ece2f0","d0d1e6","a6bddb","67a9cf","3690c0","02818a","016450"],9:["fff7fb","ece2f0","d0d1e6","a6bddb","67a9cf","3690c0","02818a","016c59","014636"]},PuBu:{type:"sequential",cbf:42,3:["ece7f2","a6bddb","2b8cbe"],4:["f1eef6","bdc9e1","74a9cf","0570b0"],5:["f1eef6","bdc9e1","74a9cf","2b8cbe","045a8d"],6:["f1eef6","d0d1e6","a6bddb","74a9cf","2b8cbe","045a8d"],7:["f1eef6","d0d1e6","a6bddb","74a9cf","3690c0","0570b0","034e7b"],8:["fff7fb","ece7f2","d0d1e6","a6bddb","74a9cf","3690c0","0570b0","034e7b"],9:["fff7fb","ece7f2","d0d1e6","a6bddb","74a9cf","3690c0","0570b0","045a8d","023858"]},BuPu:{type:"sequential",cbf:42,3:["e0ecf4","9ebcda","8856a7"],4:["edf8fb","b3cde3","8c96c6","88419d"],5:["edf8fb","b3cde3","8c96c6","8856a7","810f7c"],6:["edf8fb","bfd3e6","9ebcda","8c96c6","8856a7","810f7c"],7:["edf8fb","bfd3e6","9ebcda","8c96c6","8c6bb1","88419d","6e016b"],8:["f7fcfd","e0ecf4","bfd3e6","9ebcda","8c96c6","8c6bb1","88419d","6e016b"],9:["f7fcfd","e0ecf4","bfd3e6","9ebcda","8c96c6","8c6bb1","88419d","810f7c","4d004b"]},RdPu:{type:"sequential",cbf:42,3:["fde0dd","fa9fb5","c51b8a"],4:["feebe2","fbb4b9","f768a1","ae017e"],5:["feebe2","fbb4b9","f768a1","c51b8a","7a0177"],6:["feebe2","fcc5c0","fa9fb5","f768a1","c51b8a","7a0177"],7:["feebe2","fcc5c0","fa9fb5","f768a1","dd3497","ae017e","7a0177"],8:["fff7f3","fde0dd","fcc5c0","fa9fb5","f768a1","dd3497","ae017e","7a0177"],9:["fff7f3","fde0dd","fcc5c0","fa9fb5","f768a1","dd3497","ae017e","7a0177","49006a"]},PuRd:{type:"sequential",cbf:42,3:["e7e1ef","c994c7","dd1c77"],4:["f1eef6","d7b5d8","df65b0","ce1256"],5:["f1eef6","d7b5d8","df65b0","dd1c77","980043"],6:["f1eef6","d4b9da","c994c7","df65b0","dd1c77","980043"],7:["f1eef6","d4b9da","c994c7","df65b0","e7298a","ce1256","91003f"],8:["f7f4f9","e7e1ef","d4b9da","c994c7","df65b0","e7298a","ce1256","91003f"],9:["f7f4f9","e7e1ef","d4b9da","c994c7","df65b0","e7298a","ce1256","980043","67001f"]},OrRd:{type:"sequential",cbf:42,3:["fee8c8","fdbb84","e34a33"],4:["fef0d9","fdcc8a","fc8d59","d7301f"],5:["fef0d9","fdcc8a","fc8d59","e34a33","b30000"],6:["fef0d9","fdd49e","fdbb84","fc8d59","e34a33","b30000"],7:["fef0d9","fdd49e","fdbb84","fc8d59","ef6548","d7301f","990000"],8:["fff7ec","fee8c8","fdd49e","fdbb84","fc8d59","ef6548","d7301f","990000"],9:["fff7ec","fee8c8","fdd49e","fdbb84","fc8d59","ef6548","d7301f","b30000","7f0000"]},YlOrRd:{type:"sequential",cbf:42,3:["ffeda0","feb24c","f03b20"],4:["ffffb2","fecc5c","fd8d3c","e31a1c"],5:["ffffb2","fecc5c","fd8d3c","f03b20","bd0026"],6:["ffffb2","fed976","feb24c","fd8d3c","f03b20","bd0026"],7:["ffffb2","fed976","feb24c","fd8d3c","fc4e2a","e31a1c","b10026"],8:["ffffcc","ffeda0","fed976","feb24c","fd8d3c","fc4e2a","e31a1c","b10026"],9:["ffffcc","ffeda0","fed976","feb24c","fd8d3c","fc4e2a","e31a1c","bd0026","800026"]},YlOrBr:{type:"sequential",cbf:42,3:["fff7bc","fec44f","d95f0e"],4:["ffffd4","fed98e","fe9929","cc4c02"],5:["ffffd4","fed98e","fe9929","d95f0e","993404"],6:["ffffd4","fee391","fec44f","fe9929","d95f0e","993404"],7:["ffffd4","fee391","fec44f","fe9929","ec7014","cc4c02","8c2d04"],8:["ffffe5","fff7bc","fee391","fec44f","fe9929","ec7014","cc4c02","8c2d04"],9:["ffffe5","fff7bc","fee391","fec44f","fe9929","ec7014","cc4c02","993404","662506"]},Purples:{type:"sequential",cbf:42,3:["efedf5","bcbddc","756bb1"],4:["f2f0f7","cbc9e2","9e9ac8","6a51a3"],5:["f2f0f7","cbc9e2","9e9ac8","756bb1","54278f"],6:["f2f0f7","dadaeb","bcbddc","9e9ac8","756bb1","54278f"],7:["f2f0f7","dadaeb","bcbddc","9e9ac8","807dba","6a51a3","4a1486"],8:["fcfbfd","efedf5","dadaeb","bcbddc","9e9ac8","807dba","6a51a3","4a1486"],9:["fcfbfd","efedf5","dadaeb","bcbddc","9e9ac8","807dba","6a51a3","54278f","3f007d"]},Blues:{type:"sequential",cbf:42,3:["deebf7","9ecae1","3182bd"],4:["eff3ff","bdd7e7","6baed6","2171b5"],5:["eff3ff","bdd7e7","6baed6","3182bd","08519c"],6:["eff3ff","c6dbef","9ecae1","6baed6","3182bd","08519c"],7:["eff3ff","c6dbef","9ecae1","6baed6","4292c6","2171b5","084594"],8:["f7fbff","deebf7","c6dbef","9ecae1","6baed6","4292c6","2171b5","084594"],9:["f7fbff","deebf7","c6dbef","9ecae1","6baed6","4292c6","2171b5","08519c","08306b"]},Greens:{type:"sequential",cbf:42,3:["e5f5e0","a1d99b","31a354"],4:["edf8e9","bae4b3","74c476","238b45"],5:["edf8e9","bae4b3","74c476","31a354","006d2c"],6:["edf8e9","c7e9c0","a1d99b","74c476","31a354","006d2c"],7:["edf8e9","c7e9c0","a1d99b","74c476","41ab5d","238b45","005a32"],8:["f7fcf5","e5f5e0","c7e9c0","a1d99b","74c476","41ab5d","238b45","005a32"],9:["f7fcf5","e5f5e0","c7e9c0","a1d99b","74c476","41ab5d","238b45","006d2c","00441b"]},Oranges:{type:"sequential",cbf:42,3:["fee6ce","fdae6b","e6550d"],4:["feedde","fdbe85","fd8d3c","d94701"],5:["feedde","fdbe85","fd8d3c","e6550d","a63603"],6:["feedde","fdd0a2","fdae6b","fd8d3c","e6550d","a63603"],7:["feedde","fdd0a2","fdae6b","fd8d3c","f16913","d94801","8c2d04"],8:["fff5eb","fee6ce","fdd0a2","fdae6b","fd8d3c","f16913","d94801","8c2d04"],9:["fff5eb","fee6ce","fdd0a2","fdae6b","fd8d3c","f16913","d94801","a63603","7f2704"]},Reds:{type:"sequential",cbf:42,3:["fee0d2","fc9272","de2d26"],4:["fee5d9","fcae91","fb6a4a","cb181d"],5:["fee5d9","fcae91","fb6a4a","de2d26","a50f15"],6:["fee5d9","fcbba1","fc9272","fb6a4a","de2d26","a50f15"],7:["fee5d9","fcbba1","fc9272","fb6a4a","ef3b2c","cb181d","99000d"],8:["fff5f0","fee0d2","fcbba1","fc9272","fb6a4a","ef3b2c","cb181d","99000d"],9:["fff5f0","fee0d2","fcbba1","fc9272","fb6a4a","ef3b2c","cb181d","a50f15","67000d"]},Greys:{type:"sequential",cbf:42,3:["f0f0f0","bdbdbd","636363"],4:["f7f7f7","cccccc","969696","525252"],5:["f7f7f7","cccccc","969696","636363","252525"],6:["f7f7f7","d9d9d9","bdbdbd","969696","636363","252525"],7:["f7f7f7","d9d9d9","bdbdbd","969696","737373","525252","252525"],8:["ffffff","f0f0f0","d9d9d9","bdbdbd","969696","737373","525252","252525"],9:["ffffff","f0f0f0","d9d9d9","bdbdbd","969696","737373","525252","252525","000000"]},PuOr:{type:"diverging",cbf:42,3:["f1a340","f7f7f7","998ec3"],4:["e66101","fdb863","b2abd2","5e3c99"],5:["e66101","fdb863","f7f7f7","b2abd2","5e3c99"],6:["b35806","f1a340","fee0b6","d8daeb","998ec3","542788"],7:["b35806","f1a340","fee0b6","f7f7f7","d8daeb","998ec3","542788"],8:["b35806","e08214","fdb863","fee0b6","d8daeb","b2abd2","8073ac","542788"],9:["b35806","e08214","fdb863","fee0b6","f7f7f7","d8daeb","b2abd2","8073ac","542788"],10:["7f3b08","b35806","e08214","fdb863","fee0b6","d8daeb","b2abd2","8073ac","542788","2d004b"],11:["7f3b08","b35806","e08214","fdb863","fee0b6","f7f7f7","d8daeb","b2abd2","8073ac","542788","2d004b"]},BrBG:{type:"diverging",cbf:42,3:["d8b365","f5f5f5","5ab4ac"],4:["a6611a","dfc27d","80cdc1","018571"],5:["a6611a","dfc27d","f5f5f5","80cdc1","018571"],6:["8c510a","d8b365","f6e8c3","c7eae5","5ab4ac","01665e"],7:["8c510a","d8b365","f6e8c3","f5f5f5","c7eae5","5ab4ac","01665e"],8:["8c510a","bf812d","dfc27d","f6e8c3","c7eae5","80cdc1","35978f","01665e"],9:["8c510a","bf812d","dfc27d","f6e8c3","f5f5f5","c7eae5","80cdc1","35978f","01665e"],10:["543005","8c510a","bf812d","dfc27d","f6e8c3","c7eae5","80cdc1","35978f","01665e","003c30"],11:["543005","8c510a","bf812d","dfc27d","f6e8c3","f5f5f5","c7eae5","80cdc1","35978f","01665e","003c30"]},PRGn:{type:"diverging",cbf:42,3:["af8dc3","f7f7f7","7fbf7b"],4:["7b3294","c2a5cf","a6dba0","008837"],5:["7b3294","c2a5cf","f7f7f7","a6dba0","008837"],6:["762a83","af8dc3","e7d4e8","d9f0d3","7fbf7b","1b7837"],7:["762a83","af8dc3","e7d4e8","f7f7f7","d9f0d3","7fbf7b","1b7837"],8:["762a83","9970ab","c2a5cf","e7d4e8","d9f0d3","a6dba0","5aae61","1b7837"],9:["762a83","9970ab","c2a5cf","e7d4e8","f7f7f7","d9f0d3","a6dba0","5aae61","1b7837"],10:["40004b","762a83","9970ab","c2a5cf","e7d4e8","d9f0d3","a6dba0","5aae61","1b7837","00441b"],11:["40004b","762a83","9970ab","c2a5cf","e7d4e8","f7f7f7","d9f0d3","a6dba0","5aae61","1b7837","00441b"]},PiYG:{type:"diverging",cbf:42,3:["e9a3c9","f7f7f7","a1d76a"],4:["d01c8b","f1b6da","b8e186","4dac26"],5:["d01c8b","f1b6da","f7f7f7","b8e186","4dac26"],6:["c51b7d","e9a3c9","fde0ef","e6f5d0","a1d76a","4d9221"],7:["c51b7d","e9a3c9","fde0ef","f7f7f7","e6f5d0","a1d76a","4d9221"],8:["c51b7d","de77ae","f1b6da","fde0ef","e6f5d0","b8e186","7fbc41","4d9221"],9:["c51b7d","de77ae","f1b6da","fde0ef","f7f7f7","e6f5d0","b8e186","7fbc41","4d9221"],10:["8e0152","c51b7d","de77ae","f1b6da","fde0ef","e6f5d0","b8e186","7fbc41","4d9221","276419"],11:["8e0152","c51b7d","de77ae","f1b6da","fde0ef","f7f7f7","e6f5d0","b8e186","7fbc41","4d9221","276419"]},RdBu:{type:"diverging",cbf:42,3:["ef8a62","f7f7f7","67a9cf"],4:["ca0020","f4a582","92c5de","0571b0"],5:["ca0020","f4a582","f7f7f7","92c5de","0571b0"],6:["b2182b","ef8a62","fddbc7","d1e5f0","67a9cf","2166ac"],7:["b2182b","ef8a62","fddbc7","f7f7f7","d1e5f0","67a9cf","2166ac"],8:["b2182b","d6604d","f4a582","fddbc7","d1e5f0","92c5de","4393c3","2166ac"],9:["b2182b","d6604d","f4a582","fddbc7","f7f7f7","d1e5f0","92c5de","4393c3","2166ac"],10:["67001f","b2182b","d6604d","f4a582","fddbc7","d1e5f0","92c5de","4393c3","2166ac","053061"],11:["67001f","b2182b","d6604d","f4a582","fddbc7","f7f7f7","d1e5f0","92c5de","4393c3","2166ac","053061"]},RdGy:{type:"diverging",cbf:42,3:["ef8a62","ffffff","999999"],4:["ca0020","f4a582","bababa","404040"],5:["ca0020","f4a582","ffffff","bababa","404040"],6:["b2182b","ef8a62","fddbc7","e0e0e0","999999","4d4d4d"],7:["b2182b","ef8a62","fddbc7","ffffff","e0e0e0","999999","4d4d4d"],8:["b2182b","d6604d","f4a582","fddbc7","e0e0e0","bababa","878787","4d4d4d"],9:["b2182b","d6604d","f4a582","fddbc7","ffffff","e0e0e0","bababa","878787","4d4d4d"],10:["67001f","b2182b","d6604d","f4a582","fddbc7","e0e0e0","bababa","878787","4d4d4d","1a1a1a"],11:["67001f","b2182b","d6604d","f4a582","fddbc7","ffffff","e0e0e0","bababa","878787","4d4d4d","1a1a1a"]},RdYlBu:{type:"diverging",cbf:42,3:["fc8d59","ffffbf","91bfdb"],4:["d7191c","fdae61","abd9e9","2c7bb6"],5:["d7191c","fdae61","ffffbf","abd9e9","2c7bb6"],6:["d73027","fc8d59","fee090","e0f3f8","91bfdb","4575b4"],7:["d73027","fc8d59","fee090","ffffbf","e0f3f8","91bfdb","4575b4"],8:["d73027","f46d43","fdae61","fee090","e0f3f8","abd9e9","74add1","4575b4"],9:["d73027","f46d43","fdae61","fee090","ffffbf","e0f3f8","abd9e9","74add1","4575b4"],10:["a50026","d73027","f46d43","fdae61","fee090","e0f3f8","abd9e9","74add1","4575b4","313695"],11:["a50026","d73027","f46d43","fdae61","fee090","ffffbf","e0f3f8","abd9e9","74add1","4575b4","313695"]},Spectral:{type:"diverging",cbf:0,3:["fc8d59","ffffbf","99d594"],4:["d7191c","fdae61","abdda4","2b83ba"],5:["d7191c","fdae61","ffffbf","abdda4","2b83ba"],6:["d53e4f","fc8d59","fee08b","e6f598","99d594","3288bd"],7:["d53e4f","fc8d59","fee08b","ffffbf","e6f598","99d594","3288bd"],8:["d53e4f","f46d43","fdae61","fee08b","e6f598","abdda4","66c2a5","3288bd"],9:["d53e4f","f46d43","fdae61","fee08b","ffffbf","e6f598","abdda4","66c2a5","3288bd"],10:["9e0142","d53e4f","f46d43","fdae61","fee08b","e6f598","abdda4","66c2a5","3288bd","5e4fa2"],11:["9e0142","d53e4f","f46d43","fdae61","fee08b","ffffbf","e6f598","abdda4","66c2a5","3288bd","5e4fa2"]},RdYlGn:{type:"diverging",cbf:0,3:["fc8d59","ffffbf","91cf60"],4:["d7191c","fdae61","a6d96a","1a9641"],5:["d7191c","fdae61","ffffbf","a6d96a","1a9641"],6:["d73027","fc8d59","fee08b","d9ef8b","91cf60","1a9850"],7:["d73027","fc8d59","fee08b","ffffbf","d9ef8b","91cf60","1a9850"],8:["d73027","f46d43","fdae61","fee08b","d9ef8b","a6d96a","66bd63","1a9850"],9:["d73027","f46d43","fdae61","fee08b","ffffbf","d9ef8b","a6d96a","66bd63","1a9850"],10:["a50026","d73027","f46d43","fdae61","fee08b","d9ef8b","a6d96a","66bd63","1a9850","006837"],11:["a50026","d73027","f46d43","fdae61","fee08b","ffffbf","d9ef8b","a6d96a","66bd63","1a9850","006837"]},Accent:{type:"qualitative",cbf:0,3:["7fc97f","beaed4","fdc086"],4:["7fc97f","beaed4","fdc086","ffff99"],5:["7fc97f","beaed4","fdc086","ffff99","386cb0"],6:["7fc97f","beaed4","fdc086","ffff99","386cb0","f0027f"],7:["7fc97f","beaed4","fdc086","ffff99","386cb0","f0027f","bf5b17"],8:["7fc97f","beaed4","fdc086","ffff99","386cb0","f0027f","bf5b17","666666"]},Dark2:{type:"qualitative",cbf:3,3:["1b9e77","d95f02","7570b3"],4:["1b9e77","d95f02","7570b3","e7298a"],5:["1b9e77","d95f02","7570b3","e7298a","66a61e"],6:["1b9e77","d95f02","7570b3","e7298a","66a61e","e6ab02"],7:["1b9e77","d95f02","7570b3","e7298a","66a61e","e6ab02","a6761d"],8:["1b9e77","d95f02","7570b3","e7298a","66a61e","e6ab02","a6761d","666666"]},Paired:{type:"qualitative",cbf:4,3:["a6cee3","1f78b4","b2df8a"],4:["a6cee3","1f78b4","b2df8a","33a02c"],5:["a6cee3","1f78b4","b2df8a","33a02c","fb9a99"],6:["a6cee3","1f78b4","b2df8a","33a02c","fb9a99","e31a1c"],7:["a6cee3","1f78b4","b2df8a","33a02c","fb9a99","e31a1c","fdbf6f"],8:["a6cee3","1f78b4","b2df8a","33a02c","fb9a99","e31a1c","fdbf6f","ff7f00"],9:["a6cee3","1f78b4","b2df8a","33a02c","fb9a99","e31a1c","fdbf6f","ff7f00","cab2d6"],10:["a6cee3","1f78b4","b2df8a","33a02c","fb9a99","e31a1c","fdbf6f","ff7f00","cab2d6","6a3d9a"],11:["a6cee3","1f78b4","b2df8a","33a02c","fb9a99","e31a1c","fdbf6f","ff7f00","cab2d6","6a3d9a","ffff99"],12:["a6cee3","1f78b4","b2df8a","33a02c","fb9a99","e31a1c","fdbf6f","ff7f00","cab2d6","6a3d9a","ffff99","b15928"]},Pastel1:{type:"qualitative",cbf:0,3:["fbb4ae","b3cde3","ccebc5"],4:["fbb4ae","b3cde3","ccebc5","decbe4"],5:["fbb4ae","b3cde3","ccebc5","decbe4","fed9a6"],6:["fbb4ae","b3cde3","ccebc5","decbe4","fed9a6","ffffcc"],7:["fbb4ae","b3cde3","ccebc5","decbe4","fed9a6","ffffcc","e5d8bd"],8:["fbb4ae","b3cde3","ccebc5","decbe4","fed9a6","ffffcc","e5d8bd","fddaec"],9:["fbb4ae","b3cde3","ccebc5","decbe4","fed9a6","ffffcc","e5d8bd","fddaec","f2f2f2"]},Pastel2:{type:"qualitative",cbf:0,3:["b3e2cd","fdcdac","cbd5e8"],4:["b3e2cd","fdcdac","cbd5e8","f4cae4"],5:["b3e2cd","fdcdac","cbd5e8","f4cae4","e6f5c9"],6:["b3e2cd","fdcdac","cbd5e8","f4cae4","e6f5c9","fff2ae"],7:["b3e2cd","fdcdac","cbd5e8","f4cae4","e6f5c9","fff2ae","f1e2cc"],8:["b3e2cd","fdcdac","cbd5e8","f4cae4","e6f5c9","fff2ae","f1e2cc","cccccc"]},Set1:{type:"qualitative",cbf:0,3:["e41a1c","377eb8","4daf4a"],4:["e41a1c","377eb8","4daf4a","984ea3"],5:["e41a1c","377eb8","4daf4a","984ea3","ff7f00"],6:["e41a1c","377eb8","4daf4a","984ea3","ff7f00","ffff33"],7:["e41a1c","377eb8","4daf4a","984ea3","ff7f00","ffff33","a65628"],8:["e41a1c","377eb8","4daf4a","984ea3","ff7f00","ffff33","a65628","f781bf"],9:["e41a1c","377eb8","4daf4a","984ea3","ff7f00","ffff33","a65628","f781bf","999999"]},Set2:{type:"qualitative",cbf:3,3:["66c2a5","fc8d62","8da0cb"],4:["66c2a5","fc8d62","8da0cb","e78ac3"],5:["66c2a5","fc8d62","8da0cb","e78ac3","a6d854"],6:["66c2a5","fc8d62","8da0cb","e78ac3","a6d854","ffd92f"],7:["66c2a5","fc8d62","8da0cb","e78ac3","a6d854","ffd92f","e5c494"],8:["66c2a5","fc8d62","8da0cb","e78ac3","a6d854","ffd92f","e5c494","b3b3b3"]},Set3:{type:"qualitative",cbf:0,3:["8dd3c7","ffffb3","bebada"],4:["8dd3c7","ffffb3","bebada","fb8072"],5:["8dd3c7","ffffb3","bebada","fb8072","80b1d3"],6:["8dd3c7","ffffb3","bebada","fb8072","80b1d3","fdb462"],7:["8dd3c7","ffffb3","bebada","fb8072","80b1d3","fdb462","b3de69"],8:["8dd3c7","ffffb3","bebada","fb8072","80b1d3","fdb462","b3de69","fccde5"],9:["8dd3c7","ffffb3","bebada","fb8072","80b1d3","fdb462","b3de69","fccde5","d9d9d9"],10:["8dd3c7","ffffb3","bebada","fb8072","80b1d3","fdb462","b3de69","fccde5","d9d9d9","bc80bd"],11:["8dd3c7","ffffb3","bebada","fb8072","80b1d3","fdb462","b3de69","fccde5","d9d9d9","bc80bd","ccebc5"],12:["8dd3c7","ffffb3","bebada","fb8072","80b1d3","fdb462","b3de69","fccde5","d9d9d9","bc80bd","ccebc5","ffed6f"]}};for(var s in a){var n=a[s];n=e.Scheme.fromPalettes("cb-"+s,[n.type,"cb-"+n.type],n,12,n.cbf),e.register(n)}}(),t.exports&&(t.exports=e)}(Si)),Si.exports}GC();class zC extends Ma{constructor(){super(...arguments);xe(this,"data",{dashboard:[{name:"sales_growth_chart",type:"line"}],order:[{name:"gross_sale_by_day_chart",type:""},{name:"order_completion_time_chart",type:""},{name:"item_count_distribution_chart",type:""},{name:"gross_sale_by_hour_chart",type:""},{name:"order_value_distribution_chart",type:""},{name:"avg_order_gross_chart",type:""},{name:"avg_order_items_chart",type:""},{name:"order_chart",type:""}],revenue:[{name:"revenue_chart",type:"line"}],refund:[{name:"refund_chart",type:"line"}],subscription:[{name:"subscription_chart",type:"line"},{name:"retention_chart",type:"line"},{name:"daily_signups_chart",type:"line"}],product:[{name:"product_chart",type:"bar"}]});xe(this,"storageKey","chart-type");xe(this,"listeners",{})}beforeInit(){this.mergeWithStorage()}mergeWithStorage(){const a=ft.get(this.storageKey);this.data.dashboard=a.dashboard??this.data.dashboard,this.data.order=a.order??this.data.order,this.data.revenue=a.revenue??this.data.revenue,this.data.refund=a.refund??this.data.refund,this.data.subscription=a.subscription??this.data.subscription}addListener(a,s){this.listeners[a]=s}async onChange(a,s,n){const A=this.data[a].findIndex(c=>c.name===s);A!==-1?this.data[a][A].type=n:this.data[a].push({name:s,type:n}),this.syncStorage();for(let c in this.listeners)this.listeners[c](this.applicableFilters)}getChartType(a,s){const l=this.data[a].find(A=>A.name===s);return l?l.type:null}syncStorage(){ft.set(this.storageKey,this.applicableFilters.chartType)}removeListener(a){delete this.listeners[a]}get applicableFilters(){return{chartType:{dashboard:this.data.dashboard,order:this.data.order,revenue:this.data.revenue,refund:this.data.refund,subscription:this.data.subscription}}}}const qt=zC.init();function On(t){const e=Le(t[0]).format("MMMM D, YYYY"),a=Le(t[1]).format("MMMM D, YYYY");return e===a?`on ${e}.`:`between ${e} and ${a}.`}function Rn(t){const e=t.split("-");if(e.length===3){const[a,s,n]=e;return`${ba[parseInt(s)-1]} ${n}`}else if(e.length===2){const[a,s]=e;return`${ba[parseInt(s)-1]} ${a}`}else if(e.length===1){const[a]=e;return`${a}`}}function xs(t){return t.map(e=>Rn(e.group))}const _a=Ce.colors.report,jC={[_a.light_gray]:_a.cyan_blue,[_a.light_gray_cyan_blue]:_a.cyan_blue_dark,[_a.blue]:_a.royal_blue,[_a.royal_blue]:_a.dark_blue,[_a.medium_slate_blue]:_a.dark_purple,[_a.dark_cyan_blue_16]:_a.dark_cyan_blue_40,[_a.dark_cyan_blue_24]:_a.dark_cyan_blue_40,[_a.blue]:_a.blue_dark_mode,[_a.purple]:_a.purple_dark_mode};function Ua(t){return jC[t]}function za(t){const e=t<=31?6:7,a=Math.floor(t/e);return{splitNumber:e,interval:a}}const YC={class:"fct-gross-sale-vs-net-revenue-wrap"},qC={class:"fct-btn-group sm"},WC={__name:"SalesGrowthChart",props:{chartData:{type:Array,required:!0},reportFilter:{type:Object},loading:{type:Boolean,default:!0}},emits:["fetch-chart-data"],setup(t,{emit:e}){const a=t,s=L(null),n=L(null);L("daily");const l=L(qt.getChartType("order","sales_growth_chart")||"line"),A=Ce.colors.report,c=L(Ce.isDark()),p=j(()=>a.chartData.every(S=>S.orders===0)),m=j(()=>c.value?A.dark_cyan_blue_16:A.light_gray),v=j(()=>c.value?A.dark_cyan_blue_36:A.light_gray_cyan_blue),w=j(()=>[{title:u("Orders"),key:"orders",color:m.value,yAxisIndex:1},{title:u("Revenue"),key:"net_revenue",color:v.value,yAxisIndex:0}].map(({title:S,key:E,color:Q,yAxisIndex:D})=>U(S,l.value,a.chartData.map(M=>M[E]),Q,D)));ba.map(S=>S.slice(0,3));const g=j(()=>xs(a.chartData));let B=null;const y=()=>{B&&(B.dispose(),B=null),ve(()=>{s.value&&(B=St(s.value),k())})},C=j(()=>za(a.chartData.length)),k=()=>{if(!B)return;c.value=Ce.isDark();const S={title:{text:a.chartTitle??"",left:"center"},legend:{show:!0,top:"5%",icon:"circle",itemWidth:8,itemHeight:8,itemGap:30,textStyle:{color:c.value?"#ffffff":"#000000"}},tooltip:{trigger:"axis",backgroundColor:c.value?"#253241":"#ffffff",borderColor:c.value?"#2C3C4E":"#c0c4ca",borderWidth:1,textStyle:{color:c.value?"#ffffff":"#565865"},axisPointer:{type:"line",lineStyle:{type:"solid",width:2,color:c.value?A.dark_cyan_blue_16:A.light_gray_blue}},formatter:E=>{let Q=E[0].name;return E.forEach(D=>{const M=D.seriesIndex===1?`${Ve.scaled(D.value)}`:D.value,$=c.value?"#ffffff":"#565865";Q+=`
${D.marker}
${D.seriesName}
${M}
`}),Q}},xAxis:{type:"category",data:g.value,axisLabel:{color:c.value?"#ffffff":"#696778",fontSize:12,interval:C.value.interval},axisLine:{lineStyle:{type:"dashed",color:c.value?"#253241":"#D6DAE1"}}},yAxis:[{name:u("Revenue"),type:"value",position:"left",axisLabel:{color:c.value?"#ffffff":"#696778",fontSize:12,formatter:E=>`${Ve.scaledChart(E)}`},splitLine:{show:!0,lineStyle:{color:c.value?"#253241":"#D6DAE1",type:"dashed"}}},{name:u("Orders"),type:"value",position:"right",axisLabel:{color:c.value?"#ffffff":"#696778",fontSize:12},splitLine:{show:!1,lineStyle:{color:c.value?"#253241":"#D6DAE1",type:"dashed"}}}],series:w.value};B.setOption(S,{notMerge:!0,replaceMerge:["series"]})},U=(S,E,Q,D,M)=>({name:S,type:E,barMaxWidth:30,data:Q,smooth:!1,color:D,lineStyle:{width:3},areaStyle:{opacity:.3,color:D},symbol:"circle",showSymbol:!0,symbolSize:8,itemStyle:{color:D,borderRadius:[4,4,0,0]},yAxisIndex:M,emphasis:{scale:2,itemStyle:{color:Ua(D)},lineStyle:{color:D},areaStyle:{opacity:.3,color:D}},animation:!0,animationEasing:"cubicOut",animationDuration:800,animationDelay:0,barGap:"-100%",legendHoverLink:!1}),T=S=>{l.value!==S&&(l.value=S,qt.onChange("order","sales_growth_chart",S),k())};return we([()=>a.chartData,l],()=>{ve(k)},{deep:!0}),we(p,S=>{S||y()}),we(()=>a.loading,S=>{S||y()}),dt(()=>{window.removeEventListener("onFluentCartThemeChange",k,!1)}),Be(()=>{window.addEventListener("onFluentCartThemeChange",k),ve(y)}),(S,E)=>{const Q=b("el-skeleton");return d(),_("div",YC,[o(me,{id:"chartContainer",ref_key:"cardRef",ref:n},{default:i(()=>[o(be,{title:S.$t("Sales Growth"),border_bottom:""},Qt({_:2},[!p.value&&!t.loading?{name:"action",fn:i(()=>[r("div",qC,[o(Ms,{activeType:l.value,types:{bar:"BarChart",line:"LineChart"},onChange:T},null,8,["activeType"]),o(oa,{targetRef:s.value},null,8,["targetRef"])])]),key:"0"}:void 0]),1032,["title"]),o(pe,{class:"p-0"},{default:i(()=>[t.loading?(d(),F(Q,{key:0,animated:"",rows:5,class:"p-4"})):(d(),_(H,{key:1},[p.value?(d(),F(Xe,{key:1,icon:"Empty/ListView","has-dark":!0,text:f(u)("Currently there is no data!"),class:"fct-report-empty-state"},null,8,["text"])):(d(),_("div",{key:0,class:"fct-chart-wrap fct-gross-sale-vs-net-revenue-chart",ref_key:"chartRef",ref:s},null,512))],64))]),_:1})]),_:1},512)])}}},XC={class:"fct-gross-sale-vs-net-revenue-wrap"},JC={class:"fct-btn-group sm"},ZC={key:0,class:"fct-world-map-action-btns absolute top-5 right-5 flex flex-col gap-1 z-10"},eB={key:1,class:"fct-world-map-action-btns absolute top-[10px] right-[40px] flex flex-col gap-1 z-10"},Gc=.5,Ei=6,Il=1.2,tB={__name:"HeatMap",props:{data:{type:Array,required:!0}},setup(t){const e=t,a=Ce.colors,s=L(null),n=L(null),l=L(!1),A=L("world"),c=L(92),p=L(100);L(!1);let m=null,v=null,w=50;const g=L(1.2),B=L(),y=a.blue,C=j(()=>{const z=p.value-c.value,Z=e.data?e.data.length:0;return z<60||Z<15}),k=z=>{z=z.replace(/^#/,"");const Z=parseInt(z.substring(0,2),16),J=parseInt(z.substring(2,4),16),ne=parseInt(z.substring(4,6),16);return[Z,J,ne]},U=()=>Ce.isDark()?a.gray[50]:a.gray[600],T=k(y[500]),S=async()=>{const z=In.getUrl("world.geo.json"),J=await(await fetch(z)).json();vh("world",J)},E=z=>{if(!z||isNaN(z))return`rgba(${T.join(",")}, 0)`;const Z=Math.log(z+1)/Math.log(w+1);return`rgba(${T.join(",")}, ${Z})`},Q=z=>{A.value=z,G(),m&&(m.clear(),m.setOption(P()),z==="bar"&&D()),v&&l.value&&(v.clear(),v.setOption(P()),z==="bar"&&M())},D=()=>{m&&(m.off("dataZoom"),m.on("dataZoom",function(z){z.batch&&z.batch[0]?(c.value=z.batch[0].start||0,p.value=z.batch[0].end||100):(c.value=z.start||0,p.value=z.end||100),setTimeout(()=>{G()},100)}))},M=()=>{v&&(v.off("dataZoom"),v.on("dataZoom",function(z){z.batch&&z.batch[0]?(c.value=z.batch[0].start||0,p.value=z.batch[0].end||100):(c.value=z.start||0,p.value=z.end||100),setTimeout(()=>{v&&v.setOption(P())},100)}))},$=j(()=>(e.data||[]).map(z=>({...z,value:z.value||0,itemStyle:{color:E(z.value||0)},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}}}))),I=()=>({backgroundColor:Ce.isDark()?a.dark[700]:a.gray[25],tooltip:{trigger:"item",formatter:z=>u("%1$s%2$s Orders: %3$s",z.name,"
",z.value||0),borderRadius:8,backgroundColor:Ce.isDark()?"#38485a":"#ffffff",borderColor:Ce.isDark()?"#4a5a6b":"#c0c4ca",borderWidth:1,textStyle:{color:Ce.isDark()?"#ffffff":"#565865"}},visualMap:{min:0,max:w,left:l.value?"5%":"center",bottom:l.value?"center":"4%",text:[u("High"),u("Low")],orient:l.value?"vertical":"horizontal",calculable:!0,inRange:{color:[y[100],y[500]]},textStyle:{color:a.gray[800]}},series:[{name:"Orders",type:"map",map:"world",roam:B.value,zoom:g.value,label:{show:!1,emphasis:{show:!0,color:a.gray[1e3],fontWeight:"bold",textShadowColor:a.gray[50],textShadowBlur:3,textShadowOffsetX:0,textShadowOffsetY:0}},emphasis:{itemStyle:{areaColor:y[300],shadowBlur:10,shadowColor:a.gray[400]}},itemStyle:{borderColor:a.gray[200],borderWidth:.5},data:$.value}]}),V=j(()=>{const z=e.data.length,Z=p.value-c.value,J=Math.ceil(z*Z/100);let ne=0;return J>100?ne=9:J>50?ne=4:J>30?ne=2:J>20&&(ne=1),ne}),R=()=>{const z=C.value;return{backgroundColor:Ce.isDark()?a.dark[700]:a.gray[25],tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:function(Z){const J=Z[0];return`${J.name}
${u("Orders")}: ${J.value||0}`},backgroundColor:Ce.isDark()?"#38485a":"#ffffff",textStyle:{color:Ce.isDark()?a.gray[25]:a.system.mid},borderColor:Ce.isDark()?"#4a5a6b":"#c0c4ca",borderWidth:1},dataZoom:[{type:"inside",yAxisIndex:0,start:c.value,end:p.value},{type:"slider",yAxisIndex:0,start:c.value,end:p.value,width:25,top:10,right:10,textStyle:{color:U()},brushSelect:!1,showDetail:!1,disabled:!0}],grid:{left:z?"10px":"0%",right:"15%",top:"10%",bottom:"15%",containLabel:!0},yAxis:{type:"category",axisTick:{show:z},splitLine:{show:!1},axisLine:{show:z,lineStyle:{color:U()}},axisLabel:{show:z,interval:V.value,color:U(),fontSize:11},data:e.data.map(Z=>Z.name)},xAxis:{type:"value",axisLabel:{show:!0,color:U(),formatter:function(Z){return Z.toLocaleString()}},splitLine:{show:!0,lineStyle:{color:Ce.isDark()?a.gray[600]:a.gray[200]}}},series:[{type:"bar",large:!0,itemStyle:{color:new Ji(0,0,1,0,[{offset:0,color:y[400]},{offset:1,color:y[600]}]),borderRadius:[0,4,4,0]},emphasis:{itemStyle:{color:new Ji(0,0,1,0,[{offset:0,color:y[500]},{offset:1,color:y[700]}])}},data:e.data.map(Z=>Z.value),label:{show:z,formatter:"{c}",position:"right",color:U(),fontSize:10}}]}},P=()=>A.value==="bar"?R():I(),W=async()=>{await S(),s.value&&(m=St(s.value),m.setOption(P()),A.value==="bar"&&D(),m.on("georoam",()=>{const Z=m.getOption().series[0].zoom;if(Z!==g.value)if(ZEi){const J=Math.max(Il,Math.min(Ei,Z));m.setOption({series:[{zoom:J}]},!1),g.value=J}else g.value=Z}))},G=()=>{e.data&&e.data.length>0?w=Math.max(...e.data.map(z=>z.value||0)):w=1,m&&m.setOption(P(),{notMerge:!0})},te=()=>{g.value=Math.min(g.value+Gc,Ei),B.value=!0,m.setOption({series:[{zoom:g.value,roam:B.value}]})},ae=()=>{g.value=Math.max(g.value-Gc,Il),B.value=!0,m.setOption({series:[{zoom:g.value,roam:B.value}]})},q=()=>{A.value==="bar"?(c.value=92,p.value=100,m&&m.dispatchAction({type:"dataZoom",start:92,end:100})):(g.value=Il,B.value="move",m&&(m.clear(),m.setOption(P())))},ie=async()=>{l.value=!0,await ve(),v?v.clear():v=St(n.value),v.setOption(P()),A.value==="bar"&&M()},K=z=>{U(),m&&m.setOption(P())};return Be(()=>{window.addEventListener("onFluentCartThemeChange",K),B.value="move",ve(W)}),dt(()=>{window.removeEventListener("onFluentCartThemeChange",K),m&&(m.dispose(),m=null),v&&(v.dispose(),v=null)}),we(()=>e.data,()=>G(),{deep:!0}),we(C,()=>{A.value==="bar"&&ve(()=>{G()})}),(z,Z)=>(d(),_("div",XC,[o(me,{id:"chartContainer"},{default:i(()=>[o(be,{title:z.$t("Order Heat Map"),border_bottom:""},{action:i(()=>[r("div",JC,[o(Ms,{activeType:A.value,types:{world:"Globe",bar:"BarChart"},onChange:Q},null,8,["activeType"]),o(oa,{targetRef:s.value,size:"small"},null,8,["targetRef"])])]),_:1},8,["title"]),o(pe,{class:"p-0 pt-0 relative"},{default:i(()=>[A.value==="world"?(d(),_("div",ZC,[o(Ue,{tag:"button",size:"small",onClick:te},{default:i(()=>[o(Y,{name:"Plus"})]),_:1}),o(Ue,{tag:"button",size:"small",onClick:ae},{default:i(()=>[o(Y,{name:"Minus"})]),_:1}),o(Ue,{tag:"button",size:"small",onClick:q},{default:i(()=>[o(Y,{name:"Reload"})]),_:1}),o(Ue,{tag:"button",size:"small lg:hidden",onClick:ie},{default:i(()=>[o(Y,{name:"Eye"})]),_:1})])):x("",!0),A.value==="bar"?(d(),_("div",eB,[o(Ue,{tag:"button",size:"small",onClick:q},{default:i(()=>[o(Y,{name:"Reload"})]),_:1})])):x("",!0),r("div",{class:"fct-chart-wrap rounded-[0px] bg-transparent",ref_key:"chartRef",ref:s},null,512)]),_:1})]),_:1}),o(f(Ch),{modelValue:l.value,"onUpdate:modelValue":Z[0]||(Z[0]=J=>l.value=J),title:z.$t("Order Heat Map"),class:"country-heat-map-dialog"},{default:i(()=>[r("div",{class:"fct-chart-wrap",ref_key:"modalChartRef",ref:n},null,512)]),_:1},8,["modelValue","title"])]))}},aB=$e(tB,[["__scopeId","data-v-342ab7be"]]),sB={class:"fct-report-card"},nB={key:0,class:"fct-report-card-header"},oB={key:0,class:"flex items-center gap-2"},lB={class:"title"},rB={class:"actions"},iB={class:"fct-report-card-body flex h-full"},dB={class:"w-full"},ol={__name:"ReportCard",props:{cardOptions:{type:Object,default:()=>({heading:"",linkButtonText:"",linkButtonUrl:"",headingIcon:{type:Boolean,default:!1}})}},setup(t){return(e,a)=>{const s=b("router-link");return d(),_("div",sB,[t.cardOptions.heading||t.cardOptions.linkButtonText?(d(),_("div",nB,[t.cardOptions.heading?(d(),_("div",oB,[t.cardOptions.headingIcon?(d(),F(Ue,{key:0,size:"x-small",bg:"danger",soft:""},{default:i(()=>[o(Y,{name:"FailedCircle"})]),_:1})):x("",!0),r("h4",lB,h(t.cardOptions.heading),1)])):x("",!0),r("div",rB,[t.cardOptions.linkButtonText?(d(),F(s,{key:0,to:`/${t.cardOptions.linkButtonUrl}`,class:"link"},{default:i(()=>[O(h(e.$t(t.cardOptions.linkButtonText)),1)]),_:1},8,["to"])):x("",!0),na(e.$slots,"action")])])):x("",!0),r("div",iB,[r("div",dB,[na(e.$slots,"default")])])])}}},AB={key:0,class:"fct-report-sold-product-list has-scroll"},cB={class:"list-left-content"},uB={class:"list-title"},pB={class:"list-title-inner"},fB={class:"list-id"},mB={class:"list-right-content"},hB=["innerHTML"],_B={class:"list-price"},gB={__name:"RecentOrders",setup(t){const e=ka.data;return(a,s)=>{const n=b("router-link");return d(),F(ol,{class:"top-sold-products","card-options":{heading:f(u)("Recent Orders"),linkButtonText:f(u)("View All"),linkButtonUrl:"orders"}},{default:i(()=>{var l,A;return[((A=(l=f(e))==null?void 0:l.recentOrders)==null?void 0:A.length)>0?(d(),_("ul",AB,[(d(!0),_(H,null,ee(f(e).recentOrders,c=>(d(),_("li",{key:c.id},[o(n,{class:"no-underline",to:{name:"view_order",params:{order_id:c.id}}},{default:i(()=>[r("div",cB,[r("div",uB,[r("div",pB,h(c.customer_name)+" #"+h(f(Dt)(c.id)),1),r("div",fB,[o(Ea,{"date-time":c.created_at},null,8,["date-time"])])])]),r("div",mB,[r("div",{class:"list-value",innerHTML:f(Ve).scaled(c.total_amount)},null,8,hB),r("div",_B,h(f(Dt)(c.order_items_count))+" "+h(f(u)("Items")),1)])]),_:2},1032,["to"])]))),128))])):(d(),F(Xe,{key:1,icon:"Empty/ListView",text:f(u)("Currently there is no item!")},null,8,["text"]))]}),_:1},8,["card-options"])}}},vB={key:0},yB={key:1,class:"fc_dashboard_onboarding_wrap"},bB={class:"fc_dashboard_onboarding_title"},wB={class:"fc_dashboard_onboarding_lists"},CB=["href"],BB={class:"circle-shape"},kB={class:"fc_dashboard_onboarding_item__title"},xB={__name:"Onboarding",setup(t){const e=L(0),a=L(!1);vt().ctx;const s=L([]),n=L(!0);L(localStorage.getItem("started_content_collapse")==="true"||!1),j(()=>{const A=Object.keys(s.value).length;return A?Math.round(e.value/A*100):0});const l=Ur("dashboardTogglePageNotification");return Be(async()=>{a.value=!0,re.get("dashboard").then(A=>{var p;s.value=A.data.steps,e.value=A.data.completed,n.value=Object.keys(s.value).length!==e.value,a.value=!1;let c=((p=s.value.page_setup)==null?void 0:p.completed)||!1;l&&l(!c)}).catch(A=>{a.value=!1})}),(A,c)=>{const p=b("el-skeleton"),m=b("Check"),v=b("el-icon");return n.value?(d(),_("div",vB,[a.value?(d(),F(p,{key:0,rows:3,animated:""})):(d(),_("div",yB,[r("h3",bB,h(A.$t("Onboarding Checklist")),1),r("div",wB,[(d(!0),_(H,null,ee(s.value,(w,g)=>(d(),_("a",{key:g,href:w.url,class:oe([w.completed===!0?"active":"","fc_dashboard_onboarding_item"])},[r("span",BB,[w.completed===!0?(d(),F(v,{key:0},{default:i(()=>[o(m)]),_:1})):x("",!0)]),r("div",kB,h(w.title),1)],10,CB))),128))])]))])):x("",!0)}}},FB={class:"fct-dashboard-recent-activities-wrap"},SB={class:"fct-dashboard-recent-activities__header"},EB={class:"fct-dashboard-recent-activities__header_title"},UB={class:"fct-dashboard-recent-activities__header_desc"},$B={key:0,class:"fct-dashboard-recent-activities__body"},DB={key:0,class:"fct-dashboard-recent-activities__item has-icon"},QB={class:"content"},IB={class:"title"},TB=["onClick"],VB={class:"date"},MB=["innerHTML"],LB={class:"created_by"},OB={key:1,class:"fct-dashboard-recent-activities__empty"},RB={class:"fct-dashboard-recent-activities__empty_text"},HB={__name:"RecentActivity",props:{activities:{type:Array,default:()=>[]},showManageActivity:{type:Boolean,default:!1}},emits:["reload"],setup(t,{emit:e}){const a=ns();L(!1),L({});const s=L([{label:u("All"),value:"all"},{label:u("Today"),value:"today"},{label:u("Yesterday"),value:"yesterday"},{label:u("This Week"),value:"this_week"}]),n=L("all"),l=()=>{switch(n.value){case"all":return u("all");case"today":return u("today");case"yesterday":return u("yesterday");case"this_week":return u("this week");default:return n.value}},A=()=>{l(),ka.getRecentActivities({groupKey:n.value})},c={Order:"orders/view",Payment:"orders/view",Product:"products/view",Customer:"customers/view",Coupon:"coupons/view"},p=v=>{const g={Order:{name:"view_order",param:"order_id",permission:"orders/view"},Payment:{name:"view_order",param:"order_id",permission:"orders/view"},Product:{name:"view_product",param:"product_id",permission:"products/view"},Customer:{name:"view_customer",param:"customer_id",permission:"customers/view"},Coupon:{name:"view_coupon",param:"coupon_id",permission:"coupons/view"}}[v.module_name];g&&v.module_id&&m(v)?a.push({name:g.name,params:{[g.param]:v.module_id}}):console.warn("Invalid activity or module not supported:",v)},m=v=>{if(!v.module_name)return!0;const w=Me.get(c,Mt.capitalize(v.module_name));return w?Wo.has(w):!1};return Be(()=>{A()}),(v,w)=>{const g=b("el-radio-button"),B=b("el-radio-group");return d(),_("div",FB,[r("div",SB,[r("h4",EB,h(f(u)("Recent Activities")),1),r("p",UB,[n.value==="all"?(d(),_(H,{key:0},[O(h(f(u)("%s new activities",f(Dt)(f(ka).data.recentActivities.length))),1)],64)):(d(),_(H,{key:1},[O(h(f(u)("%1$s new activities %2$s",f(Dt)(f(ka).data.recentActivities.length),l())),1)],64))]),o(B,{class:"fct-dashboard-recent-activities__header_filter",modelValue:n.value,"onUpdate:modelValue":w[0]||(w[0]=y=>n.value=y),onChange:A,size:"large"},{default:i(()=>[(d(!0),_(H,null,ee(s.value,(y,C)=>(d(),F(g,{key:C,label:y.label,value:y.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),f(ka).data.recentActivities.length?(d(),_("div",$B,[(d(!0),_(H,null,ee(f(ka).data.recentActivities,(y,C)=>(d(),_(H,{key:C},[m(y)?(d(),_("div",DB,[w[1]||(w[1]=r("span",{class:"icon"},[r("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r("path",{d:"M12.8499 9.92029L13.5711 10.3529C13.6156 10.3795 13.6524 10.4172 13.678 10.4623C13.7036 10.5075 13.717 10.5584 13.717 10.6103C13.717 10.6621 13.7036 10.7131 13.678 10.7582C13.6524 10.8033 13.6156 10.841 13.5711 10.8677L8.30911 14.0249C8.21579 14.081 8.10897 14.1106 8.00011 14.1106C7.89124 14.1106 7.78443 14.081 7.69111 14.0249L2.42911 10.8677C2.38462 10.841 2.34779 10.8033 2.32222 10.7582C2.29664 10.7131 2.2832 10.6621 2.2832 10.6103C2.2832 10.5584 2.29664 10.5075 2.32222 10.4623C2.34779 10.4172 2.38462 10.3795 2.42911 10.3529L3.15031 9.92029L8.00011 12.8303L12.8499 9.92029ZM12.8499 7.10029L13.5711 7.53289C13.6156 7.55952 13.6524 7.59723 13.678 7.64235C13.7036 7.68746 13.717 7.73843 13.717 7.79029C13.717 7.84214 13.7036 7.89311 13.678 7.93822C13.6524 7.98334 13.6156 8.02105 13.5711 8.04769L8.00011 11.3903L2.42911 8.04769C2.38462 8.02105 2.34779 7.98334 2.32222 7.93822C2.29664 7.89311 2.2832 7.84214 2.2832 7.79029C2.2832 7.73843 2.29664 7.68746 2.32222 7.64235C2.34779 7.59723 2.38462 7.55952 2.42911 7.53289L3.15031 7.10029L8.00011 10.0103L12.8499 7.10029ZM8.30851 1.58569L13.5711 4.74289C13.6156 4.76952 13.6524 4.80724 13.678 4.85235C13.7036 4.89746 13.717 4.94843 13.717 5.00029C13.717 5.05214 13.7036 5.10311 13.678 5.14822C13.6524 5.19334 13.6156 5.23105 13.5711 5.25769L8.00011 8.60029L2.42911 5.25769C2.38462 5.23105 2.34779 5.19334 2.32222 5.14822C2.29664 5.10311 2.2832 5.05214 2.2832 5.00029C2.2832 4.94843 2.29664 4.89746 2.32222 4.85235C2.34779 4.80724 2.38462 4.76952 2.42911 4.74289L7.69111 1.58569C7.78443 1.52962 7.89124 1.5 8.00011 1.5C8.10897 1.5 8.21579 1.52962 8.30911 1.58569H8.30851ZM8.00011 2.79949L4.33231 5.00029L8.00011 7.20109L11.6679 5.00029L8.00011 2.79949Z",fill:"#335CFF"})])],-1)),r("div",QB,[r("h3",IB,[y.module_name!==""?(d(),_("span",{key:0,onClick:k=>p(y)},h(y.title||"--"),9,TB)):(d(),_(H,{key:1},[O(h(y.title),1)],64)),r("span",VB,[o(Ea,{"date-time":y.created_at},null,8,["date-time"])])]),r("p",{innerHTML:y.content,class:"description"},null,8,MB),r("span",LB,h(f(u)("By %s",y.created_by)),1)])])):x("",!0)],64))),128))])):(d(),_("div",OB,[r("div",RB,h(f(u)("No activity found.")),1)]))])}}},PB={class:"fc_dashboard_sidebar bg-white dark:bg-dark-700 p-5 rounded"},KB={__name:"SideBar",setup(t){return(e,a)=>(d(),_("div",PB,[o(wt,{permission:"is_super_admin"},{default:i(()=>[o(xB)]),_:1}),o(HB,{onReload:a[0]||(a[0]=()=>{})})]))}},NB={class:"fct-product-create"},GB={class:"fct-product-step"},zB={class:"fct-product-item-selector"},jB=["onClick"],YB={class:"fct-product-item-selector-content"},qB={class:"fct-bundle-product-condition"},WB={class:"condition-text"},XB={class:"dialog-footer"},Yr={__name:"AddProductModal",props:{customModal:String},emits:["process_custom","update:createProductModal"],setup(t,{emit:e}){const a=t,s=e,n=ns(),l=L({post_title:"",post_content:"",post_excerpt:"",post_date:new Date,post_status:"draft",detail:{fulfillment_type:"digital",variation_type:"simple",manage_stock:"0",manage_downloadable:"0",other_info:{use_pricing_table:"yes",group_pricing_by:"repeat_interval",active_editor:"wp-editor",sold_individually:"no"}}}),A=[{type:"physical",title:u("Physical Product"),icon:"Gift"},{type:"digital",title:u("Digital Product"),icon:"Code"}],c=L(!1),p=L(null),m=g=>{l.value.detail.fulfillment_type=g},v=()=>{c.value=!0,re.post("products",{...l.value}).then(g=>{if(X.success(g.message),a.customModal==="order_modal"){const B={id:g.data.product_variants.id,object_id:g.data.product_variants.post_id,variation_id:g.data.product_variants.id,item_name:g.data.product_variants.variation_title,item_price:g.data.product_variants.item_price,quantity:1,stock:100,object_type:g.data.product_details.fulfillment_type,item_total:g.data.product_variants.item_price,line_total:g.data.product_variants.item_price,tax_amount:0,discount_total:0};s("process_custom",B),s("update:createProductModal",!1)}else n.push({name:"product_edit",params:{product_id:g.data.ID}})}).catch(g=>{var B;g.status_code=="422"?X.validationErrors(g):X.error((B=g.data)==null?void 0:B.message)}).finally(()=>{c.value=!1})},w=g=>{g.stopPropagation(),g.preventDefault(),v()};return Be(()=>{ve(()=>{setTimeout(()=>{var g;(g=p.value)==null||g.focus()},10)})}),(g,B)=>{const y=b("el-input"),C=b("el-form-item"),k=b("el-checkbox"),U=b("el-form"),T=b("el-button");return d(),_("div",NB,[r("div",GB,[o(U,{"label-position":"top",model:l.value,"require-asterisk-position":"right"},{default:i(()=>[o(C,{label:l.value.detail.other_info.is_bundle_product==="yes"?f(u)("Bundle Title"):f(u)("Product Title"),required:""},{default:i(()=>[o(y,{type:"text",modelValue:l.value.post_title,"onUpdate:modelValue":B[0]||(B[0]=S=>l.value.post_title=S),placeholder:l.value.detail.other_info.is_bundle_product==="yes"?f(u)("Bundle Title"):f(u)("Product Title"),minlength:"3",maxlength:"200","show-word-limit":"",autofocus:"",ref_key:"fcProductTitle",ref:p,onKeydown:ms(w,["enter"])},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(C,null,{default:i(()=>[r("ul",zB,[(d(),_(H,null,ee(A,S=>r("li",{key:S.type,class:oe({active:S.type===l.value.detail.fulfillment_type}),onClick:E=>m(S.type)},[r("div",YB,[o(Y,{name:S.icon},null,8,["name"]),O(" "+h(S.title),1)]),B[2]||(B[2]=r("div",{class:"fct-product-item-selector-dot-wrap"},[r("span",{class:"fct-product-item-selector-dot"})],-1))],10,jB)),64))])]),_:1}),o(C,null,{default:i(()=>[r("div",qB,[o(k,{modelValue:l.value.detail.other_info.is_bundle_product,"onUpdate:modelValue":B[1]||(B[1]=S=>l.value.detail.other_info.is_bundle_product=S),"true-value":"yes","false-value":"no"},{default:i(()=>[O(h(f(u)("Add as a Bundle")),1)]),_:1},8,["modelValue"]),r("span",WB,h(f(u)("Combine multiple items into one package")),1)])]),_:1})]),_:1},8,["model"])]),r("div",XB,[o(T,{disabled:!l.value.post_title||c.value,loading:c.value,onClick:v,type:"primary"},{default:i(()=>[O(h(c.value?f(u)("Creating"):f(u)("Add Product")),1)]),_:1},8,["disabled","loading"])])])}}};class AA{constructor(e=new Date){this.date=e}getHours(){return this.date.getHours()}static greeting(){const e=new AA().getHours();if(e>=5&&e<12)return u("Good morning");if(e>=12&&e<17)return u("Good afternoon");if(e>=17&&e<21)return u("Good evening");{const a=[u("Step into the moonlight!"),u("Evening vibes!"),u("The night's still young!")];return a[Math.floor(Math.random()*a.length)]}}}const JB={class:"fct-current-user-info-wrap"},ZB={class:"fct-current-user-info-content"},e2={class:"image"},t2=["src","alt"],a2={class:"content"},s2={key:0,class:"fct-current-user-info-action"},n2={__name:"CurrentUserInfo",setup(t){const e=L(!1),a=L(Pe.get("me")),s=()=>Pe.get("shop.store_name"),n=Pe.get("total_products_count");return(l,A)=>{const c=b("el-button"),p=b("el-dialog");return d(),_("div",JB,[r("div",ZB,[r("div",e2,[r("img",{src:a.value.avatar,alt:a.value.full_name},null,8,t2)]),r("div",a2,[r("h4",null,h(f(AA).greeting())+" "+h(a.value.full_name)+" 👋🏻",1),r("p",null,h(f(u)("Welcome to %1$s",s())),1)])]),o(wt,{permission:"products/create"},{default:i(()=>[f(n)==0?(d(),_("div",s2,[o(c,{onClick:A[0]||(A[0]=m=>e.value=!0),type:"primary"},{default:i(()=>[O(h(f(u)("Add Product")),1)]),_:1})])):x("",!0)]),_:1}),o(p,{"append-to-body":!0,modelValue:e.value,"onUpdate:modelValue":A[1]||(A[1]=m=>e.value=m),onClose:A[2]||(A[2]=m=>e.value=!1),title:f(u)("Add New Product")},{default:i(()=>[o(Yr)]),_:1},8,["modelValue","title"])])}}};class o2{constructor(){xe(this,"operatorMap",{"!==":"matchNotEqual","!=":"matchNotEqual"});xe(this,"defaultMatcherMethod",null)}getMatchingMethod(e){return e==="=="||e==="==="?"matchEqual":this.operatorMap.hasOwnProperty(e)?this.operatorMap[e]:this.defaultMatcherMethod}defaultMatcher(e,a,s){}matchEqual(e,a,s){return s==="==="?e===a:e==a}matchNotEqual(e,a,s){return s==="!=="?e!==a:e!=a}matchContains(e,a,s){return a instanceof String||Array.isArray(a)?a.includes(e):typeof a=="object"?a.hasOwnProperty(e):!1}matchIn(e,a,s){return this.matchContains(e,a,s)}matchNotIn(e,a,s){return!this.matchContains(e,a,s)}}class l2{constructor(){xe(this,"modifierMap",{"+":"applyAddition","-":"applySubstruction"});xe(this,"defaultModifierMethod",null)}getModificationMethod(e){return e==="=="||e==="==="?"matchEqual":this.modifierMap.hasOwnProperty(e)?this.modifierMap[e]:this.defaultModifierMethod}applyAddition(e,a,s,n,l){return e+a}}class r2{constructor(e,a){xe(this,"value");xe(this,"operator");this.value=e,this.operator=a}setOperator(e){return this.operator=e,this}setValue(e){return this.value=e,this}static make(e,a){return new this(e,a)}build(){return{operator:this.operator,value:this.value instanceof Bd?this.value.setModifiers([]).build():this.value}}}class Bd{constructor(e,a){xe(this,"accessor");xe(this,"modifiers");this.accessor=e,this.modifiers=[],this.setModifiers(a)}setAccessor(e){return this.accessor=e,this}addModifier(e){return this.modifiers.push(e),this}setModifiers(e){return this.modifiers=Array.isArray(e)?e:this.modifiers,this}static make(e,a){return new this(e,a)}build(){let e=[];return Array.isArray(this.modifiers)&&this.modifiers.length>0&&(e=this.modifiers.map(a=>a instanceof r2?a.build():a)),e.length>0?{accessor:this.accessor,modifiers:e}:{accessor:this.accessor}}}class Vn{constructor(e,a,s,n,l){xe(this,"conditionType");xe(this,"conditions");xe(this,"key");xe(this,"operator");xe(this,"value");this.key=e,this.value=a,this.operator=s,this.conditions=[],this.conditionType=this.buildConditionType(n),this.setConditions(l)}static make(e,a,s,n){return new this(e,a,s,n)}setConditionType(e){return this.conditionType=this.buildConditionType(e),this}buildConditionType(e){return e==="or"||e==="|"?"or":"and"}setOperator(e){return this.operator=e,this}setKey(e){return this.key=e,this}setValue(e){return this.value=e,this}addCondition(e){return this.conditions.push(e),this}setConditions(e){return this.conditions=Array.isArray(e)||e instanceof Vn||typeof e=="function"?e:this.conditions,this}build(){if(Array.isArray(this.conditions)&&this.conditions.length>0){let s=[];return s=this.conditions.map(n=>n instanceof Vn?n.build.bind(n)():n),{condition_type:this.conditionType,conditions:s}}const e=this.key instanceof Bd?this.key.build():this.key,a=this.value instanceof Bd?this.value.build():this.value;return{key:e,operator:this.operator,value:a}}}class i2{constructor(e,a){xe(this,"data");xe(this,"conditions");xe(this,"stateKey");xe(this,"matcher");xe(this,"modifier");this.data=a,this.stateKey=e,this.matcher=new o2,this.modifier=new l2}match(e,a,s,n=!0){let l="",A=this.matcher.getMatchingMethod(a);return A!=null?l=A:l=Mt.camel("match"+a),l in this.matcher&&typeof this.matcher[l]=="function"?this.matcher[l](e,s,a,n):(console.error(`Method ${l} does not exist in Matcher Class`),n)}evaluate(e,a="and"){if(e instanceof Vn){const n=e.build.bind(e)();n.hasOwnProperty("conditions")?(e=n.conditions,a=n.condition_type):e=[n]}a=a==="or"?"or":"and";let s=a==="and";if(typeof e=="function")return e(this.stateKey,this.data);if(!Array.isArray(e))return!0;for(let n of e){let l=null;if(Array.isArray(Me.get(n,"conditions")))l=this.evaluate(n.conditions,Me.get(n,"condition_type","and"));else{if(n.key===null||n.key===void 0){s=!0;continue}l=this.applyCondition(n)}s=a==="and"?s&&l:s||l}return s}applyCondition(e){let a="",s=null;typeof e.key=="object"?a=Me.resolvePath(this.stateKey,Me.get(e,"key.accessor")):a=Me.resolvePath(this.stateKey,e.key);let n=Me.get(this.data,a);if(typeof e.value=="object"){const l=Me.resolvePath(this.stateKey,Me.get(e,"value.accessor"));s=Me.get(this.data,l)}else s=e.value;return n=this.applyModification(n,e.key.modifiers,this.stateKey),s=this.applyModification(s,e.value.modifiers,this.stateKey),this.match(n,e.operator,s)}applyModification(e,a,s){return Array.isArray(a)&&a.forEach(n=>{let l=n.operator,A="",c=this.modifier.getModificationMethod(l);if(c!=null?A=c:A=Mt.camel("apply"+l),A in this.modifier&&typeof this.modifier[A]=="function"){let p=n.value;typeof p=="object"&&p!==null&&(p=Me.getByPath(this.data,s,Me.get(p,"accessor"))),e=this.modifier[A](e,p,l,s,this.data)}else console.error(`Method ${A} does not exist in Modifier Class`)}),e}}class ff{constructor(){xe(this,"_conditionType","and");xe(this,"_conditions",null)}conditionType(e){return this._conditionType=e,this}conditions(e){return this._conditions=Array.isArray(e)||e instanceof Vn||typeof e=="function"?e:this._conditions,this}visibleIf(e){return this._conditions=e,this}buildConditions(e){return Array.isArray(e)&&e.length>0?e.map(a=>a instanceof Vn?a.build.bind(a)():a):e}}class mf{constructor(){xe(this,"_events",{})}event(e,a){return this._events[e]=a,this}}class ur{constructor(e=""){this._component="",this._affix=e}static component(e){const a=new ur;return a._component="Affix/"+e,a}static make(e=""){return new this(e)}build(){return this._component.length>0?{component:this._component}:this._affix}}class kd{constructor(e,a="input"){if(typeof e!="string"||e.length<1)throw new Error("Key is Required");this._key=e,this._type=a,this._class="",this._id="",this._name="",this._label="",this._value="",this._placeholder="",this._min="",this._max="",this._prefix="",this._hasPrefix=!1,this._hasSuffix=!1,this._suffix="",mn.install(this,ip),mn.install(this,mf),mn.install(this,ff),this._wrapperClass=""}static make(e,a="input"){return new this(e,a)}wrapperClass(e){return this._wrapperClass=e,this}type(e){return this._type=e,this}class(e){return this._class=e,this}id(e){return this._id=e,this}name(e){return this._name=e,this}label(e){return this._label=e,this}value(e){return this._value=e,this}placeholder(e){return this._placeholder=e,this}min(e){return this._min=e,this}max(e){return this._max=e,this}prefix(e){return this._hasPrefix=!0,this._prefix=e,this}suffix(e){this._hasSuffix=!0,this._suffix=e}onChange(e){return this._onChangeCallback=e,this}onKeyPress(e){return this._onKeyPressCallback=e,this}onKeyUp(e){return this._onKeyUpCallback=e,this}onKeyDown(e){return this._onKeyDownCallback=e,this}build(){return this._conditions,Array.isArray(this._conditions)&&this._conditions.length>0&&this._conditions.map(e=>e instanceof Vn?e.build.bind(e)():e),this._attributes=typeof this._attributes=="object"?this._attributes:{},this._attributes.min=this._min,this._attributes.max=this._max,this._attributes.placeholder=this._placeholder,this._attributes.type=this._type,{key:this._key,type:this._type,class:this._class,id:this._id,name:this._name??u(Mt.headline(this._key)),label:this._label??u(Mt.headline(this._key)),value:this._value,condition_type:this._conditionType,conditions:this.buildConditions(this._conditions),hasSuffix:this._hasSuffix,hasPrefix:this._hasPrefix,suffix:this._suffix instanceof ur?this._suffix.build():this._suffix,prefix:this._prefix instanceof ur?this._prefix.build():this._prefix,min:this._min,max:this._max,placeholder:this._placeholder,attributes:this._attributes,events:this._events,wrapperClass:this._wrapperClass}}}class xd{constructor(e){if(typeof e!="string"||e.length<1)throw new Error("Key is Required");this._type="section",this._key=e,this._schema=[],this._class="",this.disable_nesting=!0,mn.install(this,ip),mn.install(this,mf),mn.install(this,ff)}static make(e){return new this(e)}enableNesting(){return this.disable_nesting=!1,this}disableNesting(){return this.disable_nesting=!0,this}class(e){return this._class=e,this}get type(){return this._type}set type(e){if(typeof e=="string")this._type=e;else throw new TypeError("Type must be a string.")}get schema(){return this._schema}setSchema(e){return this._schema=e,this}build(){const e=uo.build(this.schema);return{key:this._key,type:this._type,class:this._class,schema:e,disable_nesting:this.disable_nesting,condition_type:this._conditionType,conditions:this.buildConditions(this._conditions),attributes:this._attributes}}}class zc{constructor(e,a){if(typeof e!="string"||e.length<1)throw new Error("Key is Required");mn.install(this,kd,{key:e}),mn.install(this,xd,{key:e}),this._component=a,this._key=e}static make(e,a=""){return new this(e,a)}component(e){return this._component=e,this}value(e){return this._value=e,this}build(){const e=uo.build(this.schema??{});return{type:this._type,class:this._class,id:this._id,name:this._name??u(Mt.headline(this._key)),label:this._label??u(Mt.headline(this._key)),value:this._value,condition_type:this._conditionType,conditions:this.buildConditions(this._conditions),hasSuffix:this._hasSuffix,hasPrefix:this._hasPrefix,suffix:this._suffix,prefix:this._prefix,placeholder:this._placeholder,attributes:this._attributes,onChange:this._onChangeCallback,onKeyUp:this._onKeyUpCallback,onKeyDown:this._onKeyDownCallback,type:this._type,class:this._class,schema:e,disable_nesting:this.disable_nesting,condition_type:this._conditionType,conditions:this.buildConditions(this._conditions),type:"custom",component:this._component,key:this._key}}}class uo{static build(e){return Array.isArray(e)?uo.buildFromArray(e):typeof e=="object"?uo.buildFromObject(e):e}static buildFromObject(e){let a={};return Object.keys(e).forEach((s,n)=>{const l=e[s];l instanceof kd||l instanceof xd||l instanceof zc?a[s]=l.build.bind(l)():a[s]=e[s]}),a}static buildFromArray(e){let a={};return Array.isArray(e)&&e.forEach(s=>{if(s instanceof kd||s instanceof xd||s instanceof zc){let n=s.build.bind(s)();a[n.key]=n}else a[s.key]=s}),a}}class d2 extends Ma{constructor(){super(...arguments);xe(this,"data",{schema:{},defaults:{},_originalDefaults:{},values:{},initialized:!1,hasChange:!1,validationErrors:{},onChangeCallback:[]});xe(this,"nestedFormLayouts",["section","tab","tab-pane","grid"]);xe(this,"ignorableFormLayouts",["grid"])}get hasChange(){return this.data.hasChange}setSchema(a){return this.data.schema=uo.build(a??{}),this.initForm(),this}setDefaults(a){return this.data.defaults=a||{},this.data._originalDefaults=JSON.parse(JSON.stringify(this.data.defaults)),this.initForm(),this}get schema(){return this.data.schema}get values(){return this.data.values}get isReady(){return this.data.initialized}initForm(){if(typeof this.data.schema!="object"||typeof this.data.defaults!="object")throw new Error("You need to set Schema and Defaults First");this.setValues(),this.data.initialized=!0}setValues(){this.data.values=this.ensureNestedDataProperties(this.data.schema,this.data.defaults)}getState(){return this.data.values}setValidationErrors(a){this.data.validationErrors=a||{}}hasValidationError(a){return(this.data.validationErrors??{}).hasOwnProperty(a)}getValidationError(a){return this.data.validationErrors[a]}ensureNestedDataProperties(a,s={}){return Object.keys(a).reduce((n,l)=>{const A=a[l];if(A.type==="html")return n;if(this.nestedFormLayouts.includes(A.type??""))if(A.disable_nesting===!0){const c=this.ensureNestedDataProperties(A.schema??{},s??{});n={...n,...c}}else n[l]=this.ensureNestedDataProperties(A.schema??{},s[l]??{});else n[l]=s[l]??A.value??"";return n},{})}isVisible(a,s){return a.hasOwnProperty("conditions")?new i2(s,this.values).evaluate(Me.get(a,"conditions"),Me.get(a,"condition_type","and")):!0}triggerChange(a){for(let s of this.data.onChangeCallback)s(a)}onDataChanged(a){this.data.onChangeCallback.push(a)}setValue(a,s){Me.set(this.data.values,a,s),this.data.hasChange=!0,this.triggerChange(this.data.values)}reset(a=!0){if(!this.data.schema||!this.data._originalDefaults)throw new Error("Form is not initialized");const s=a?this.data._originalDefaults:this.data.defaults;return this.data.values=this.ensureNestedDataProperties(this.data.schema,JSON.parse(JSON.stringify(s))),this.data.validationErrors={},this.data.hasChange=!1,this.data.initialized=!0,this}}function cA(){return d2.init()}const A2=["innerHTML"],Fd={__name:"FieldNote",props:{note:String},setup(t){return(e,a)=>(d(),_("div",{class:"form-note",innerHTML:t.note},null,8,A2))}},c2=Object.freeze(Object.defineProperty({__proto__:null,default:Fd},Symbol.toStringTag,{value:"Module"})),jc=Object.assign({name:"ValidationError"},{__name:"ValidationErrorNew",props:{errorKey:String,form:{type:Object,required:!0}},setup(t){return(e,a)=>t.form.hasValidationError(t.errorKey)?(d(),_("div",{key:0,class:oe(`fluent-cart-admin-validation-error-wrapper ${t.errorKey}`)},[(d(!0),_(H,null,ee(t.form.getValidationError(t.errorKey),(s,n)=>(d(),_("span",{class:"fluent-cart-admin-validation-error",key:s.toLowerCase().replace(/\s/g,"")},h(s),1))),128))],2)):x("",!0)}}),hf={__name:"Resolver",props:ss({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},label:{type:String},attribute:{type:Object},callback:{type:Function}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=hs(t,"modelValue"),a=Object.assign({"./Affix/Test.vue":()=>xt(()=>import("./chunks/Test.js?ver=1.3.20"),[],import.meta.url),"./Base/Inputs/Checkbox.vue":()=>xt(()=>Promise.resolve().then(()=>w2),void 0,import.meta.url),"./Base/Inputs/ColorPicker.vue":()=>xt(()=>Promise.resolve().then(()=>$2),void 0,import.meta.url),"./Base/Inputs/Date.vue":()=>xt(()=>Promise.resolve().then(()=>D2),void 0,import.meta.url),"./Base/Inputs/FieldNote.vue":()=>xt(()=>Promise.resolve().then(()=>c2),void 0,import.meta.url),"./Base/Inputs/Input.vue":()=>xt(()=>Promise.resolve().then(()=>x2),void 0,import.meta.url),"./Base/Inputs/Media.vue":()=>xt(()=>Promise.resolve().then(()=>nk),void 0,import.meta.url),"./Base/Inputs/RadioGroup.vue":()=>xt(()=>Promise.resolve().then(()=>B2),void 0,import.meta.url),"./Base/Inputs/RemoteSearchableSelect.vue":()=>xt(()=>Promise.resolve().then(()=>V2),void 0,import.meta.url),"./Base/Inputs/Select.vue":()=>xt(()=>Promise.resolve().then(()=>T2),void 0,import.meta.url),"./Base/Inputs/Switch.vue":()=>xt(()=>Promise.resolve().then(()=>b2),void 0,import.meta.url),"./Base/Inputs/Time.vue":()=>xt(()=>Promise.resolve().then(()=>Q2),void 0,import.meta.url),"./Base/Layouts/FormGrid.vue":()=>xt(()=>Promise.resolve().then(()=>u2),void 0,import.meta.url),"./Base/Layouts/FormSection.vue":()=>xt(()=>Promise.resolve().then(()=>_2),void 0,import.meta.url),"./Base/Layouts/FormTab.vue":()=>xt(()=>Promise.resolve().then(()=>g2),void 0,import.meta.url),"./Base/Layouts/FormTabPane.vue":()=>xt(()=>Promise.resolve().then(()=>v2),void 0,import.meta.url),"./Coupon/BuyProducts.vue":()=>xt(()=>import("./chunks/BuyProducts.js?ver=1.3.20"),[],import.meta.url),"./Coupon/Categories.vue":()=>xt(()=>import("./chunks/Categories.js?ver=1.3.20"),[],import.meta.url),"./Coupon/Code.vue":()=>xt(()=>import("./chunks/Code.js?ver=1.3.20"),[],import.meta.url),"./Coupon/GetProducts.vue":()=>xt(()=>import("./chunks/GetProducts.js?ver=1.3.20"),[],import.meta.url),"./Coupon/IncludeExclude/Categories.vue":()=>xt(()=>import("./chunks/Categories2.js?ver=1.3.20"),[],import.meta.url),"./Coupon/IncludeExclude/Product.vue":()=>xt(()=>import("./chunks/Product.js?ver=1.3.20"),[],import.meta.url),"./Coupon/Products.vue":()=>xt(()=>import("./chunks/Products.js?ver=1.3.20"),[],import.meta.url),"./ModuleSettings.vue":()=>xt(()=>import("./chunks/ModuleSettings.js?ver=1.3.20"),[],import.meta.url),"./PaymentView.vue":()=>xt(()=>import("./chunks/PaymentView.js?ver=1.3.20"),[],import.meta.url),"./StoreSettings/AddressComponent.vue":()=>xt(()=>import("./chunks/AddressComponent.js?ver=1.3.20"),[],import.meta.url),"./StoreSettings/CreatePageButton.vue":()=>xt(()=>import("./chunks/CreatePageButton.js?ver=1.3.20"),[],import.meta.url),"./StoreSettings/PageSelector.vue":()=>xt(()=>import("./chunks/PageSelector.js?ver=1.3.20"),[],import.meta.url),"./TurnstileSettings.vue":()=>xt(()=>import("./chunks/TurnstileSettings.js?ver=1.3.20"),[],import.meta.url)}),s=Qm(null);Be(()=>{n(l.name)});const n=async A=>{const c=`./${A}.vue`;a[c]?s.value=(await a[c]()).default:console.error(`Form Component ${c} not found`)},l=t;return(A,c)=>(d(),_(H,null,[(d(),F(Cs(s.value),Zt({name:t.name,field:t.field,fieldKey:t.fieldKey,value:t.value,variant:t.variant,nesting:t.nesting,statePath:t.statePath,form:t.form,attribute:t.attribute,label:t.label,callback:t.callback},{modelValue:e.value,"onUpdate:modelValue":c[0]||(c[0]=p=>e.value=p)}),null,16,["modelValue"])),na(A.$slots,"fieldNote"),na(A.$slots,"validationError")],64))}},uA={__name:"FormGrid",props:{field:{type:Object},value:{type:Object},statePath:{type:String},form:{type:Object,required:!0}},setup(t){return(e,a)=>{var s,n,l,A,c,p,m,v,w,g;return d(),_("div",{class:"gap-2 grid grid-cols-dynamic sm:grid-cols-sm-dynamic md:grid-cols-md-dynamic lg:grid-cols-lg--dynamic",style:ea({"--grid-columns":((s=t.field.columns)==null?void 0:s.default)??2,"--sm-grid-columns":((n=t.field.columns)==null?void 0:n.sm)??((l=t.field.columns)==null?void 0:l.default)??2,"--md-grid-columns":((A=t.field.columns)==null?void 0:A.sm)??((c=t.field.columns)==null?void 0:c.md)??((p=t.field.columns)==null?void 0:p.default)??2,"--lg-grid-columns":((m=t.field.columns)==null?void 0:m.lg)??((v=t.field.columns)==null?void 0:v.md)??((w=t.field.columns)==null?void 0:w.sm)??((g=t.field.columns)==null?void 0:g.default)??2})},[o(Xr,{form:t.form,schema:t.field.schema,value:t.value,statePath:t.statePath},null,8,["form","schema","value","statePath"])],4)}}},u2=Object.freeze(Object.defineProperty({__proto__:null,default:uA},Symbol.toStringTag,{value:"Module"})),p2={key:0,class:"fct-content-card-header"},f2={key:0,class:"title"},m2={key:1,class:"fct-content-card-action"},_f={__name:"ContentCard",props:["title","show_heading"],setup(t){return(e,a)=>(d(),_("div",{class:oe({"fct-content-card":t.show_heading!==!1})},[t.show_heading!==!1?(d(),_("div",p2,[t.title||e.$slots.title?(d(),_("div",f2,[na(e.$slots,"title",{},()=>[O(h(t.title),1)])])):x("",!0),e.$slots.action?(d(),_("div",m2,[na(e.$slots,"action")])):x("",!0)])):x("",!0),r("div",{class:oe({"fct-content-card-body":t.show_heading!==!1})},[na(e.$slots,"default")],2)],2))}},h2={class:"form-section"},gf={__name:"FormSection",props:{field:{type:Object},fieldKey:{type:String},value:{type:Object},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0}},setup(t){return(e,a)=>(d(),_("div",h2,[o(me,null,{default:i(()=>[t.field.show_title!==!1?(d(),F(be,{key:0,title:t.field.title,border_bottom:""},null,8,["title"])):x("",!0),o(pe,null,{default:i(()=>[o(uA,{form:t.form,field:t.field,statePath:t.statePath,value:t.value},null,8,["form","field","statePath","value"])]),_:1})]),_:1})]))}},_2=Object.freeze(Object.defineProperty({__proto__:null,default:gf},Symbol.toStringTag,{value:"Module"})),vf={__name:"FormTab",props:{field:{type:Object},value:{type:Object},statePath:{type:String},form:{type:Object,required:!0}},setup(t){const e=t,a=L(""),s=L([]),n=ns(),l=m=>{const v=m.props.name;A(v)},A=m=>{const v=new URL(window.location.href);v.hash=`#/settings/${m}`,window.history.replaceState(null,"",v.toString())},c=()=>{const v=window.location.hash.split("/").pop();s.value=Object.keys(e.field.schema);const w=s.value.find(g=>g===v);w?a.value=w:a.value=e.field.default_tab};let p;return Be(()=>{p=n.beforeEach((m,v,w)=>{w(),setTimeout(()=>{c()},200)}),c()}),dt(()=>{p&&p()}),(m,v)=>{const w=b("el-tabs");return d(),F(w,{modelValue:a.value,"onUpdate:modelValue":v[0]||(v[0]=g=>a.value=g),class:oe(["fct-tabs-button",{"hidden-switch":t.field.hide_tab_switch}]),onTabClick:l,type:"card"},{default:i(()=>[o(Xr,{form:t.form,schema:t.field.schema,value:t.value,"state-path":t.statePath},null,8,["form","schema","value","state-path"])]),_:1},8,["modelValue","class"])}}},g2=Object.freeze(Object.defineProperty({__proto__:null,default:vf},Symbol.toStringTag,{value:"Module"})),yf={__name:"FormTabPane",props:{fieldKey:{type:String},field:{type:Object},value:{type:Object},statePath:{type:String},form:{type:Object,required:!0}},setup(t){return(e,a)=>{const s=b("el-tab-pane");return d(),F(s,{label:t.field.title,name:t.fieldKey},{default:i(()=>[o(Xr,{form:t.form,schema:t.field.schema,value:t.value,statePath:t.statePath},null,8,["form","schema","value","statePath"])]),_:1},8,["label","name"])}}},v2=Object.freeze(Object.defineProperty({__proto__:null,default:yf},Symbol.toStringTag,{value:"Module"}));class pA{}xe(pA,"attributesBuilders",async(e,a,s)=>{if(e.attributes||(e.attributes={}),e.class&&(e.attributes.class=e.class),e.placeholder&&(e.attributes.placeholder=e.placeholder),typeof a!="function")return e.attributes??{};let n={};typeof e.events!="object"&&(n={}),n.hasOwnProperty("onChange")&&typeof n.onChange=="function"?n.onChange=(...l)=>{s.data.hasChange=!0,n.onChange(l)}:n.onChange=()=>{s.data.hasChange=!0};for(let l in e.events)n[l]=(...A)=>{a(e.events[l],A)};for(let l in e.attributes??{}){let A=e.attributes[l];typeof A=="function"&&await a(A,{})}return{...e.attributes??{},...n}});const y2={__name:"LayoutRenderer",props:{form:{type:Object,required:!0},field:{type:Object,required:!0},value:{type:Object,required:!0},statePath:{type:String,required:!0},fieldKey:{type:String,required:!0},fullStatePath:{type:String,required:!0}},setup(t){const e=t;vt().ctx;const a=(l,A)=>{if(typeof l=="function")return l({data:e.value,form:e.form,statePath:e.statePath,field:e.field,event:Array.isArray(A)&&A.length===1?A[0]:A})},s=L(!1),n=L({});return Be(async()=>{n.value=await pA.attributesBuilders(e.field,a,e.form),s.value=!0}),(l,A)=>(d(),_(H,null,[t.field.type==="grid"&&typeof t.field.schema<"u"?(d(),F(uA,Zt({key:0,class:t.field.wrapperClass,form:t.form,field:t.field,value:t.value,statePath:t.fullStatePath},n.value),null,16,["class","form","field","value","statePath"])):x("",!0),t.field.type==="tab"&&typeof t.field.schema<"u"?(d(),F(vf,Zt({key:1,form:t.form,field:t.field,value:t.value,statePath:t.fullStatePath},n.value),null,16,["form","field","value","statePath"])):x("",!0),t.field.type==="tab-pane"&&typeof t.field.schema<"u"&&typeof t.field.title<"u"?(d(),F(yf,Zt({key:2,form:t.form,field:t.field,value:t.value,fieldKey:t.fieldKey,statePath:t.fullStatePath},n.value),null,16,["form","field","value","fieldKey","statePath"])):x("",!0),t.field.type==="section"?(d(),F(gf,Zt({key:3,form:t.form,statePath:t.field.disable_nesting===!0?t.fullStatePath:t.fieldKey+".",field:t.field,"field-key":t.fieldKey,value:t.field.disable_nesting===!0?t.value:t.value[t.fieldKey],nesting:t.field.disable_nesting===!0},n.value),null,16,["form","statePath","field","field-key","value","nesting"])):x("",!0)],64))}},bf={__name:"Switch",props:ss({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=hs(t,"modelValue");return(a,s)=>{const n=b("el-switch");return d(),F(n,Zt({modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=l=>e.value=l),disabled:t.field.disabled},t.attribute),null,16,["modelValue","disabled"])}}},b2=Object.freeze(Object.defineProperty({__proto__:null,default:bf},Symbol.toStringTag,{value:"Module"})),wf={__name:"Checkbox",props:ss({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=hs(t,"modelValue");return(a,s)=>{const n=b("el-checkbox");return d(),F(n,Zt({modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=l=>e.value=l)},t.attribute,{"true-value":"yes","false-value":"no",disabled:t.field.disabled}),{default:i(()=>[O(h(t.label),1)]),_:1},16,["modelValue","disabled"])}}},w2=Object.freeze(Object.defineProperty({__proto__:null,default:wf},Symbol.toStringTag,{value:"Module"})),C2=["innerHTML"],Cf={__name:"RadioGroup",props:ss({field:{type:Object},statePath:{type:String},value:{required:!0},form:{type:Object},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=hs(t,"modelValue"),a=t,s=L([]),n=async(l="")=>{if(typeof a.field.options=="function")return s.value=await a.field.options({data:a.value,form:a.form,statePath:a.statePath,search:l});if(Array.isArray(a.field.options))return s.value=[...a.field.options]};return Be(async()=>{await n()}),(l,A)=>{const c=b("el-radio"),p=b("el-radio-group");return d(),F(p,Zt({modelValue:e.value,"onUpdate:modelValue":A[0]||(A[0]=m=>e.value=m)},t.attribute),{default:i(()=>[(d(!0),_(H,null,ee(t.field.options,(m,v)=>(d(),F(c,{key:v,value:m.value,class:oe(m.option_class)},{default:i(()=>[r("div",null,h(m.label),1),r("div",{innerHTML:m.note},null,8,C2)]),_:2},1032,["value","class"]))),128))]),_:1},16,["modelValue"])}}},B2=Object.freeze(Object.defineProperty({__proto__:null,default:Cf},Symbol.toStringTag,{value:"Module"})),k2=["innerHTML"],to={__name:"Input",props:ss({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=vt().ctx,a=hs(t,"modelValue"),s=t,n=L(),l=async()=>{typeof s.field.prefix=="function"?n.value=await s.callback(s.field.prefix):n.value=s.field.prefix};return Be(()=>{l()}),Im(()=>{l()}),j(()=>s.fieldKey==="amount"?s.form.data.values.type==="fixed"?Pe.shop.get("currency_sign"):"%":e.appVars.shop.currency_sign),(A,c)=>{var m;const p=b("el-input");return d(),F(p,Zt({modelValue:a.value,"onUpdate:modelValue":c[0]||(c[0]=v=>a.value=v)},t.attribute,{disabled:t.field.disabled}),Qt({_:2},[(m=t.field.prefix)!=null&&m.component?{name:"prefix",fn:i(()=>[o(hf,{form:t.form,name:t.field.prefix.component,field:t.field,value:t.value},null,8,["form","name","field","value"])]),key:"0"}:t.field.prefix?{name:"prefix",fn:i(()=>[r("div",{innerHTML:n.value},null,8,k2)]),key:"1"}:void 0]),1040,["modelValue","disabled"])}}},x2=Object.freeze(Object.defineProperty({__proto__:null,default:to},Symbol.toStringTag,{value:"Module"})),F2={class:"fct-color-picker-box"},S2={class:"fct-color-picker-trigger-wrap"},E2={key:0,class:"text-xs text-system-light"},U2={key:1,class:"fct-color-picker-action-wrap"},fA={__name:"ColorPicker",props:ss({field:{type:Object},statePath:{type:String},value:{required:!0},form:{type:Object},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=hs(t,"modelValue"),a=s=>{e.value=""};return(s,n)=>{const l=b("el-color-picker");return d(),_("div",F2,[r("div",S2,[o(l,Zt({modelValue:e.value,"onUpdate:modelValue":n[0]||(n[0]=A=>e.value=A)},t.attribute,{disabled:t.field.disabled,"popper-class":"fct-color-picker-popover"}),null,16,["modelValue","disabled"]),e.value?x("",!0):(d(),F(Y,{key:0,name:"ColorPicker",class:"fct-color-picker-icon w-4 h-4"}))]),e.value?x("",!0):(d(),_("span",E2,h(f(u)("Add...")),1)),e.value?(d(),_("div",U2,[r("span",null,h(e.value),1),o(Y,{name:"Cross",class:"fct-color-picker-action w-5 h-5",onClick:n[1]||(n[1]=A=>a(s.fieldKey))})])):x("",!0)])}}},$2=Object.freeze(Object.defineProperty({__proto__:null,default:fA},Symbol.toStringTag,{value:"Module"})),Bf={__name:"Date",props:ss({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=hs(t,"modelValue");return(a,s)=>{const n=b("el-date-picker");return d(),F(n,Zt({modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=l=>e.value=l)},t.attribute,{disabled:t.field.disabled}),null,16,["modelValue","disabled"])}}},D2=Object.freeze(Object.defineProperty({__proto__:null,default:Bf},Symbol.toStringTag,{value:"Module"})),kf={__name:"Time",props:ss({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=hs(t,"modelValue");return(a,s)=>{const n=b("el-time-select");return d(),F(n,Zt({modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=l=>e.value=l)},t.attribute,{disabled:t.field.disabled}),null,16,["modelValue","disabled"])}}},Q2=Object.freeze(Object.defineProperty({__proto__:null,default:kf},Symbol.toStringTag,{value:"Module"})),I2={key:0},xf={__name:"Select",props:ss({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=hs(t,"modelValue"),a=t,s=L([]),n=L(!1),l=async(c="")=>{n.value=!0,typeof a.field.options=="function"&&(s.value=await a.field.options({data:a.value,form:a.form,statePath:a.statePath,search:c})),Array.isArray(a.field.options)&&(s.value=[...a.field.options]),n.value=!1};Be(async()=>{await l()});const A=c=>typeof c.disabled=="function"?a.callback(c.disabled,{}):c.disabled;return(c,p)=>{const m=b("el-option"),v=b("el-select");return d(),F(v,Zt({modelValue:e.value,"onUpdate:modelValue":p[0]||(p[0]=w=>e.value=w)},t.attribute,{"remote-method":l,loading:n.value,filterable:t.field.filterable===!0,clearable:t.field.clearable===!0,disabled:t.field.disabled}),{default:i(()=>[(d(!0),_(H,null,ee(s.value,(w,g)=>(d(),F(m,{key:g,value:w.value,label:w.label,disabled:A(w)},{default:i(()=>[w.slot?(d(),_("span",I2,h(w.slot),1)):x("",!0)]),_:2},1032,["value","label","disabled"]))),128))]),_:1},16,["modelValue","loading","filterable","clearable","disabled"])}}},T2=Object.freeze(Object.defineProperty({__proto__:null,default:xf},Symbol.toStringTag,{value:"Module"})),Ff={__name:"RemoteSearchableSelect",props:ss({field:{type:Object},key:{type:String}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=hs(t,"modelValue"),a=t,s=L(!1),n=L(a.field.options||[]),l=A=>{if(a.field.search_only_on_type===!0){if(A.query.length===0)return}else if(A.query.length<1&&n.value.length>0)return;s.value=!0,re.get("forms/search_options",{search_by:A.query,search_for:A.key}).then(c=>{n.value=c.options,s.value=!1})};return(A,c)=>{const p=b("el-option"),m=b("el-select");return d(),F(m,{modelValue:e.value,"onUpdate:modelValue":c[0]||(c[0]=v=>e.value=v),filterable:"",remote:"",placeholder:t.field.placeholder??f(u)("Please enter a keyword"),"remote-method":v=>{l({query:v,key:t.field.remote_key})},loading:s.value,multiple:t.field.multiple},{default:i(()=>[(d(!0),_(H,null,ee(n.value,v=>(d(),F(p,{key:v.value,label:v.label,value:v.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","remote-method","loading","multiple"])}}},V2=Object.freeze(Object.defineProperty({__proto__:null,default:Ff},Symbol.toStringTag,{value:"Module"}));function go(t,e){e===void 0&&(e={});var a=e.insertAt;if(t&&typeof document<"u"){var s=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",a==="top"&&s.firstChild?s.insertBefore(n,s.firstChild):s.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}}go(".vel-fade-enter-active,.vel-fade-leave-active{-webkit-transition:all .3s ease;transition:all .3s ease}.vel-fade-enter-from,.vel-fade-leave-to{opacity:0}.vel-img-swiper{display:block;position:relative}.vel-modal{background:rgba(0,0,0,.5);bottom:0;left:0;margin:0;position:fixed;right:0;top:0;z-index:9998}.vel-img-wrapper{left:50%;margin:0;position:absolute;top:50%;-webkit-transform:translate(-50% -50%);transform:translate(-50% -50%);-webkit-transition:.3s linear;transition:.3s linear;will-change:transform opacity}.vel-img,.vel-img-wrapper{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vel-img{background-color:rgba(0,0,0,.7);-webkit-box-shadow:0 5px 20px 2px rgba(0,0,0,.7);box-shadow:0 5px 20px 2px rgba(0,0,0,.7);display:block;max-height:80vh;max-width:80vw;position:relative;-webkit-transition:-webkit-transform .3s ease-in-out;transition:-webkit-transform .3s ease-in-out;transition:transform .3s ease-in-out;transition:transform .3s ease-in-out,-webkit-transform .3s ease-in-out}@media (max-width:750px){.vel-img{max-height:95vh;max-width:85vw}}.vel-btns-wrapper{position:static}.vel-btns-wrapper .btn__close,.vel-btns-wrapper .btn__next,.vel-btns-wrapper .btn__prev{-webkit-tap-highlight-color:transparent;color:#fff;cursor:pointer;font-size:32px;opacity:.6;outline:none;position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-transition:.15s linear;transition:.15s linear;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vel-btns-wrapper .btn__close:hover,.vel-btns-wrapper .btn__next:hover,.vel-btns-wrapper .btn__prev:hover{opacity:1}.vel-btns-wrapper .btn__close.disable,.vel-btns-wrapper .btn__close.disable:hover,.vel-btns-wrapper .btn__next.disable,.vel-btns-wrapper .btn__next.disable:hover,.vel-btns-wrapper .btn__prev.disable,.vel-btns-wrapper .btn__prev.disable:hover{cursor:default;opacity:.2}.vel-btns-wrapper .btn__next{right:12px}.vel-btns-wrapper .btn__prev{left:12px}.vel-btns-wrapper .btn__close{right:10px;top:24px}@media (max-width:750px){.vel-btns-wrapper .btn__next,.vel-btns-wrapper .btn__prev{font-size:20px}.vel-btns-wrapper .btn__close{font-size:24px}.vel-btns-wrapper .btn__next{right:4px}.vel-btns-wrapper .btn__prev{left:4px}}.vel-modal.is-rtl .vel-btns-wrapper .btn__next{left:12px;right:auto}.vel-modal.is-rtl .vel-btns-wrapper .btn__prev{left:auto;right:12px}@media (max-width:750px){.vel-modal.is-rtl .vel-btns-wrapper .btn__next{left:4px;right:auto}.vel-modal.is-rtl .vel-btns-wrapper .btn__prev{left:auto;right:4px}}.vel-modal.is-rtl .vel-img-title{direction:rtl}");go('.vel-loading{left:50%;position:absolute;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.vel-loading .ring{display:inline-block;height:64px;width:64px}.vel-loading .ring:after{-webkit-animation:ring 1.2s linear infinite;animation:ring 1.2s linear infinite;border-color:hsla(0,0%,100%,.7) transparent;border-radius:50%;border-style:solid;border-width:5px;content:" ";display:block;height:46px;margin:1px;width:46px}@-webkit-keyframes ring{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes ring{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}');go(".vel-on-error{left:50%;position:absolute;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.vel-on-error .icon{color:#aaa;font-size:80px}");go(".vel-img-title{bottom:60px;color:#ccc;cursor:default;font-size:12px;left:50%;line-height:1;max-width:80%;opacity:.8;overflow:hidden;position:absolute;text-align:center;text-overflow:ellipsis;-webkit-transform:translate(-50%);transform:translate(-50%);-webkit-transition:opacity .15s;transition:opacity .15s;white-space:nowrap}.vel-img-title:hover{opacity:1}");go(".vel-icon{fill:currentColor;height:1em;overflow:hidden;vertical-align:-.15em;width:1em}");go(".vel-toolbar{border-radius:4px;bottom:8px;display:-webkit-box;display:-ms-flexbox;display:flex;left:50%;opacity:.9;overflow:hidden;padding:0;position:absolute;-webkit-transform:translate(-50%);transform:translate(-50%)}.vel-toolbar,.vel-toolbar .toolbar-btn{background-color:#2d2d2d;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vel-toolbar .toolbar-btn{-ms-flex-negative:0;-webkit-tap-highlight-color:transparent;color:#fff;cursor:pointer;flex-shrink:0;font-size:20px;outline:none;padding:6px 10px}.vel-toolbar .toolbar-btn:active,.vel-toolbar .toolbar-btn:hover{background-color:#3d3d3d}");const As="vel",ws=$s({name:"SvgIcon",props:{type:{type:String,default:""}},setup:t=>()=>o("svg",{class:`${As}-icon icon`,"aria-hidden":"true"},[o("use",{"xlink:href":`#icon-${t.type}`},null)])}),qr=typeof window<"u",ao=()=>{};let Sf=!1;if(qr)try{const t={};Object.defineProperty(t,"passive",{get(){Sf=!0}}),window.addEventListener("test-passive",ao,t)}catch{}const Yc=function(t,e,a){let s=arguments.length>3&&arguments[3]!==void 0&&arguments[3];qr&&t.addEventListener(e,a,!!Sf&&{capture:!1,passive:s})},qc=(t,e,a)=>{qr&&t.removeEventListener(e,a)},M2=t=>{t.preventDefault()},L2=Object.prototype.toString,mA=t=>e=>L2.call(e).slice(8,-1)===t,O2=t=>!!t&&mA("Object")(t),Wc=t=>!!t&&mA("String")(t);function R2(t){return t!=null}const H2=$s({name:"Toolbar",props:{zoomIn:{type:Function,default:ao},zoomOut:{type:Function,default:ao},rotateLeft:{type:Function,default:ao},rotateRight:{type:Function,default:ao},resize:{type:Function,default:ao},rotateDisabled:{type:Boolean,default:!1},zoomDisabled:{type:Boolean,default:!1}},setup:t=>()=>o("div",{class:`${As}-toolbar`},[!t.zoomDisabled&&o(H,null,[o("div",{role:"button","aria-label":"zoom in button",class:"toolbar-btn toolbar-btn__zoomin",onClick:t.zoomIn},[o(ws,{type:"zoomin"},null)]),o("div",{role:"button","aria-label":"zoom out button",class:"toolbar-btn toolbar-btn__zoomout",onClick:t.zoomOut},[o(ws,{type:"zoomout"},null)])]),o("div",{role:"button","aria-label":"resize image button",class:"toolbar-btn toolbar-btn__resize",onClick:t.resize},[o(ws,{type:"resize"},null)]),!t.rotateDisabled&&o(H,null,[o("div",{role:"button","aria-label":"image rotate left button",class:"toolbar-btn toolbar-btn__rotate",onClick:t.rotateLeft},[o(ws,{type:"rotate-left"},null)]),o("div",{role:"button","aria-label":"image rotate right button",class:"toolbar-btn toolbar-btn__rotate",onClick:t.rotateRight},[o(ws,{type:"rotate-right"},null)])])])}),P2=()=>o("div",{class:`${As}-loading`},[o("div",{class:"ring"},null)]),K2=()=>o("div",{class:`${As}-on-error`},[o("div",{class:"ring"},null),o(ws,{type:"img-broken"},null)]),N2=(t,e)=>{let{slots:a}=e;return o("div",{class:`${As}-img-title`},[a.default?a.default():""])},G2=$s({name:"DefaultIcons",setup:()=>()=>o("svg",{"aria-hidden":!0,style:"position: absolute; width: 0; height: 0; overflow: hidden; visibility: hidden;"},[o("symbol",{id:"icon-rotate-right",viewBox:"0 0 1024 1024"},[o("path",{d:"M275.199914 450.496179v20.031994c0.384-38.079988 12.543996-67.423979 36.479989-87.967973 22.431993-20.351994 49.215985-30.55999 80.319975-30.55999 32.06399 0 59.295981 10.175997 81.759974 30.55999 22.815993 20.543994 34.591989 49.887984 35.359989 87.967973v123.935961c-0.768 37.887988-12.543996 67.135979-35.359989 87.679973-22.431993 20.351994-49.695984 30.75199-81.759974 31.10399a120.255962 120.255962 0 0 1-72.991978-24.895992c-21.503993-15.839995-35.359989-38.751988-41.567987-68.735979h60.831981c9.247997 23.007993 27.167992 34.495989 53.759983 34.49599 37.535988-0.384 56.863982-21.407993 57.983982-63.071981v-38.751988c-28.095991 8.863997-54.303983 13.119996-78.623975 12.735996a91.263971 91.263971 0 0 1-68.447979-27.711991c-18.847994-18.303994-28.095991-47.231985-27.711991-86.847973z m62.55998 24.863992c7.103998 24.799992 25.215992 37.343988 54.271983 37.663989 27.103992-0.288 44.703986-11.327996 52.831984-33.11999 3.135999-8.383997 2.655999-29.599991-1.28-38.559988-8.607997-19.615994-25.791992-29.695991-51.551984-30.20799-28.383991 0.576-46.303986 12.639996-53.759983 36.159988a58.719982 58.719982 0 0 0-0.512 28.063991z m390.335878 115.711964v-116.895963c-1.12-41.311987-20.447994-62.335981-57.983981-63.07198-37.727988 0.768-56.959982 21.791993-57.695982 63.07198v116.895963c0.768 41.663987 19.999994 62.68798 57.695982 63.071981 37.535988-0.384 56.863982-21.407993 57.983981-63.071981z m-174.815945 3.391999v-123.935961c0.384-38.079988 12.543996-67.423979 36.479989-87.967973 22.431993-20.351994 49.215985-30.55999 80.319975-30.55999 32.06399 0 59.295981 10.175997 81.759974 30.55999 22.815993 20.543994 34.591989 49.887984 35.359989 87.967973v123.935961c-0.768 37.887988-12.543996 67.135979-35.359989 87.679973-22.431993 20.351994-49.695984 30.75199-81.759974 31.10399-31.10399-0.384-57.887982-10.751997-80.319975-31.10399-23.935993-20.543994-36.127989-49.791984-36.479989-87.679973z m282.559912-479.07185A509.887841 509.887841 0 0 0 511.99984 0.00032C229.215928 0.00032 0 229.216248 0 512.00016s229.215928 511.99984 511.99984 511.99984 511.99984-229.215928 511.99984-511.99984c0-3.743999-0.032-7.455998-0.128-11.167997-1.631999-11.295996-8.159997-27.103992-31.87199-27.103991-27.487991 0-31.67999 21.247993-32.03199 32.06399l0.032 4.127999a30.62399 30.62399 0 0 0 0.16 2.079999H959.9997c0 247.423923-200.575937 447.99986-447.99986 447.99986S63.99998 759.424083 63.99998 512.00016 264.575917 64.0003 511.99984 64.0003a446.079861 446.079861 0 0 1 277.439913 96.22397l-94.91197 91.679971c-25.439992 24.607992-17.439995 44.991986 17.887994 45.599986l188.031942 3.295999a64.31998 64.31998 0 0 0 65.055979-62.84798l3.295999-188.127942C969.407697 15.040315 949.311703 5.792318 923.871711 30.368311l-87.999972 85.023973z",fill:""},null)]),o("symbol",{id:"icon-rotate-left",viewBox:"0 0 1024 1024"},[o("path",{d:"M275.199914 450.496179v20.031994c0.384-38.079988 12.543996-67.423979 36.479989-87.967973 22.431993-20.351994 49.215985-30.55999 80.319975-30.55999 32.06399 0 59.295981 10.175997 81.759974 30.55999 22.815993 20.543994 34.591989 49.887984 35.359989 87.967973v123.935961c-0.768 37.887988-12.543996 67.135979-35.359989 87.679973-22.431993 20.351994-49.695984 30.75199-81.759974 31.10399a120.255962 120.255962 0 0 1-72.991978-24.895992c-21.503993-15.839995-35.359989-38.751988-41.567987-68.735979h60.831981c9.247997 23.007993 27.167992 34.495989 53.759983 34.49599 37.535988-0.384 56.863982-21.407993 57.983982-63.071981v-38.751988c-28.095991 8.863997-54.303983 13.119996-78.623975 12.735996a91.263971 91.263971 0 0 1-68.447979-27.711991c-18.847994-18.303994-28.095991-47.231985-27.711991-86.847973z m62.55998 24.863992c7.103998 24.799992 25.215992 37.343988 54.271983 37.663989 27.103992-0.288 44.703986-11.327996 52.831984-33.11999 3.135999-8.383997 2.655999-29.599991-1.28-38.559988-8.607997-19.615994-25.791992-29.695991-51.551984-30.20799-28.383991 0.576-46.303986 12.639996-53.759983 36.159988a58.719982 58.719982 0 0 0-0.512 28.063991z m390.335878 115.711964v-116.895963c-1.12-41.311987-20.447994-62.335981-57.983981-63.07198-37.727988 0.768-56.959982 21.791993-57.695982 63.07198v116.895963c0.768 41.663987 19.999994 62.68798 57.695982 63.071981 37.535988-0.384 56.863982-21.407993 57.983981-63.071981z m-174.815945 3.391999v-123.935961c0.384-38.079988 12.543996-67.423979 36.479989-87.967973 22.431993-20.351994 49.215985-30.55999 80.319975-30.55999 32.06399 0 59.295981 10.175997 81.759974 30.55999 22.815993 20.543994 34.591989 49.887984 35.359989 87.967973v123.935961c-0.768 37.887988-12.543996 67.135979-35.359989 87.679973-22.431993 20.351994-49.695984 30.75199-81.759974 31.10399-31.10399-0.384-57.887982-10.751997-80.319975-31.10399-23.935993-20.543994-36.127989-49.791984-36.479989-87.679973zM188.159941 115.392284A509.887841 509.887841 0 0 1 511.99984 0.00032c282.783912 0 511.99984 229.215928 511.99984 511.99984s-229.215928 511.99984-511.99984 511.99984S0 794.784072 0 512.00016c0-3.743999 0.032-7.455998 0.128-11.167997 1.631999-11.295996 8.159997-27.103992 31.87199-27.103991 27.487991 0 31.67999 21.247993 32.03199 32.06399L63.99998 509.920161a30.62399 30.62399 0 0 1-0.16 2.079999H63.99998c0 247.423923 200.575937 447.99986 447.99986 447.99986s447.99986-200.575937 447.99986-447.99986S759.423763 64.0003 511.99984 64.0003a446.079861 446.079861 0 0 0-277.439913 96.22397l94.91197 91.679971c25.439992 24.607992 17.439995 44.991986-17.887994 45.599986L123.551961 300.800226a64.31998 64.31998 0 0 1-65.055979-62.84798l-3.295999-188.127942C54.591983 15.040315 74.687977 5.792318 100.127969 30.368311l87.999972 85.023973z",fill:""},null)]),o("symbol",{id:"icon-resize",viewBox:"0 0 1024 1024"},[o("path",{d:"M456.036919 791.8108 270.553461 791.8108 460.818829 601.572038l-39.593763-39.567157L231.314785 751.915162l0.873903-183.953615c0-15.465227-12.515035-27.981285-27.981285-27.981285s-27.981285 12.515035-27.981285 27.981285l0 251.829516c0 8.3072 3.415796 14.975063 8.826016 19.564591 5.082762 5.192256 12.132318 8.416693 19.947308 8.416693l251.036453 0c15.46625 0 27.981285-12.514012 27.981285-27.981285C484.018204 804.325835 471.504192 791.8108 456.036919 791.8108zM838.945819 184.644347c-5.082762-5.191232-12.132318-8.416693-19.947308-8.416693L567.961034 176.227654c-15.46625 0-27.981285 12.515035-27.981285 27.981285 0 15.46625 12.514012 27.981285 27.981285 27.981285l185.483458 0L563.206754 422.427962l39.567157 39.567157 189.910281-189.910281-0.873903 183.953615c0 15.46625 12.514012 27.981285 27.981285 27.981285s27.981285-12.514012 27.981285-27.981285L847.772858 204.208938C847.771835 195.902762 844.356039 189.234899 838.945819 184.644347zM847.771835 64.303538 176.227142 64.303538c-61.809741 0-111.924115 50.115398-111.924115 111.924115l0 671.544693c0 61.809741 50.114374 111.924115 111.924115 111.924115l671.544693 0c61.809741 0 111.924115-50.114374 111.924115-111.924115l0-671.544693C959.69595 114.418936 909.581576 64.303538 847.771835 64.303538zM903.733381 847.772346c0 30.878265-25.056676 55.962569-55.962569 55.962569L176.227142 903.734916c-30.90487 0-55.962569-25.084305-55.962569-55.962569l0-671.544693c0-30.9325 25.056676-55.962569 55.962569-55.962569l671.544693 0c30.90487 0 55.962569 25.03007 55.962569 55.962569L903.734404 847.772346z"},null)]),o("symbol",{id:"icon-img-broken",viewBox:"0 0 1024 1024"},[o("path",{d:"M810.666667 128H213.333333c-46.933333 0-85.333333 38.4-85.333333 85.333333v597.333334c0 46.933333 38.4 85.333333 85.333333 85.333333h597.333334c46.933333 0 85.333333-38.4 85.333333-85.333333V213.333333c0-46.933333-38.4-85.333333-85.333333-85.333333z m0 682.666667H213.333333v-195.413334l42.24 42.24 170.666667-170.666666 170.666667 170.666666 170.666666-170.24L810.666667 530.346667V810.666667z m0-401.493334l-43.093334-43.093333-170.666666 171.093333-170.666667-170.666666-170.666667 170.666666-42.24-42.666666V213.333333h597.333334v195.84z"},null)]),o("symbol",{id:"icon-prev",viewBox:"0 0 1024 1024"},[o("path",{d:"M784.652701 955.6957 346.601985 517.644983c-2.822492-2.822492-2.822492-7.902977 0-11.289967l439.179713-439.179713c6.77398-6.77398 10.725469-16.370452 10.725469-25.966924L796.507166 36.692393c0-20.32194-16.370452-36.692393-36.692393-36.692393l-4.515987 0c-9.596472 0-19.192944 3.951488-25.966924 10.725469L250.072767 489.420066c-12.418964 12.418964-12.418964 32.740904 0 45.159868l477.565601 477.565601c7.338479 7.338479 17.499449 11.854465 28.224917 11.854465l0 0c22.015436 0 40.079383-18.063947 40.079383-40.079383l0 0C796.507166 973.759647 791.99118 963.598677 784.652701 955.6957z"},null)]),o("symbol",{id:"icon-next",viewBox:"0 0 1024 1024"},[o("path",{d:"M246.121279 955.6957l438.050717-438.050717c2.822492-2.822492 2.822492-7.902977 0-11.289967L244.992282 67.175303c-6.77398-6.77398-10.725469-16.370452-10.725469-25.966924L234.266814 36.692393C234.266814 16.370452 250.637266 0 270.959206 0l4.515987 0c9.596472 0 19.192944 3.951488 25.966924 10.725469l478.694598 478.694598c12.418964 12.418964 12.418964 32.740904 0 45.159868l-477.565601 477.565601c-7.338479 7.338479-17.499449 11.854465-28.224917 11.854465l0 0c-22.015436 0-40.079383-18.063947-40.079383-40.079383l0 0C234.266814 973.759647 238.7828 963.598677 246.121279 955.6957z"},null)]),o("symbol",{id:"icon-zoomin",viewBox:"0 0 1024 1024"},[o("path",{d:"M725.504 652.864c46.4-61.44 71.744-136.448 71.744-218.752C797.248 230.464 632.768 64 430.656 64S64 230.464 64 434.112C64 639.36 228.48 805.76 430.656 805.76c86.656 0 164.48-30.144 227.52-81.088L889.984 960 960 891.264l-234.496-238.4z m-294.848 67.456c-155.776 0-282.624-128.896-282.624-286.208s126.848-286.208 282.624-286.208 282.624 128.896 282.624 286.208-126.912 286.208-282.624 286.208z"},null),o("path",{d:"M235.712 369.92h390.72v127.104H235.712z"},null),o("path",{d:"M367.488 238.144h127.104v390.72H367.488z"},null)]),o("symbol",{id:"icon-close",viewBox:"0 0 1024 1024"},[o("path",{d:"M570.24 512l259.2 259.2-58.88 58.24L512 570.24l-261.12 261.12-58.24-58.24L453.76 512 194.56 252.8l58.24-58.24L512 453.76l261.12-261.12 58.24 58.24z"},null)]),o("symbol",{id:"icon-zoomout",viewBox:"0 0 1024 1024"},[o("path",{d:"M725.504 652.864c46.4-61.44 71.744-136.448 71.744-218.752C797.248 230.464 632.768 64 430.656 64S64 230.464 64 434.112C64 639.36 228.48 805.76 430.656 805.76c86.656 0 164.48-30.144 227.52-81.088L889.984 960 960 891.264l-234.496-238.4z m-294.848 67.456c-155.776 0-282.624-128.896-282.624-286.208s126.848-286.208 282.624-286.208 282.624 128.896 282.624 286.208-126.912 286.208-282.624 286.208z"},null),o("path",{d:"M235.712 369.92h390.72v127.104H235.712z"},null)])])}),Ko=qr?window:global;let Xc=Date.now();function z2(t){const e=Date.now(),a=Math.max(0,16-(e-Xc)),s=setTimeout(t,a);return Xc=e+a,s}function Ui(t){return(Ko.requestAnimationFrame||z2).call(Ko,t)}function Jc(t){(Ko.cancelAnimationFrame||Ko.clearTimeout).call(Ko,t)}function Zc(t,e){const a=t.clientX-e.clientX,s=t.clientY-e.clientY;return Math.sqrt(a*a+s*s)}function $i(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!Tm(t)}var Di=$s({name:"VueEasyLightbox",props:{imgs:{type:[Array,String],default:()=>""},visible:{type:Boolean,default:!1},index:{type:Number,default:0},scrollDisabled:{type:Boolean,default:!0},escDisabled:{type:Boolean,default:!1},moveDisabled:{type:Boolean,default:!1},titleDisabled:{type:Boolean,default:!1},maskClosable:{type:Boolean,default:!0},teleport:{type:[String,Object],default:null},swipeTolerance:{type:Number,default:50},loop:{type:Boolean,default:!1},rtl:{type:Boolean,default:!1},zoomScale:{type:Number,default:.12},maxZoom:{type:Number,default:3},minZoom:{type:Number,default:.1},rotateDisabled:{type:Boolean,default:!1},zoomDisabled:{type:Boolean,default:!1},pinchDisabled:{type:Boolean,default:!1},dblclickDisabled:{type:Boolean,default:!1}},emits:{hide:()=>!0,"on-error":t=>!0,"on-prev":(t,e)=>!0,"on-next":(t,e)=>!0,"on-prev-click":(t,e)=>!0,"on-next-click":(t,e)=>!0,"on-index-change":(t,e)=>!0,"on-rotate":t=>!0},setup(t,e){let{emit:a,slots:s}=e;const{imgRef:n,imgState:l,setImgSize:A}=(()=>{const ge=L(),ke=Mo({width:0,height:0,maxScale:1});return{imgRef:ge,imgState:ke,setImgSize:()=>{if(ge.value){const{width:Ie,height:Ae,naturalWidth:Te}=ge.value;ke.maxScale=Te/Ie,ke.width=Ie,ke.height=Ae}}}})(),c=L(t.index),p=L(""),m=Mo({scale:1,lastScale:1,rotateDeg:0,top:0,left:0,initX:0,initY:0,lastX:0,lastY:0,touches:[]}),v=Mo({loadError:!1,loading:!1,dragging:!1,gesturing:!1,wheeling:!1}),w=j(()=>{return ge=t.imgs,mA("Array")(ge)?t.imgs.map(ke=>typeof ke=="string"?{src:ke}:function(Ie){return O2(Ie)&&Wc(Ie.src)}(ke)?ke:void 0).filter(R2):Wc(t.imgs)?[{src:t.imgs}]:[];var ge}),g=j(()=>w.value[c.value]),B=j(()=>{var ge;return(ge=w.value[c.value])==null?void 0:ge.src}),y=j(()=>{var ge;return(ge=w.value[c.value])==null?void 0:ge.title}),C=j(()=>{var ge;return(ge=w.value[c.value])==null?void 0:ge.alt}),k=j(()=>({cursor:v.loadError?"default":t.moveDisabled?v.dragging?"grabbing":"grab":"move",top:`calc(50% + ${m.top}px)`,left:`calc(50% + ${m.left}px)`,transition:v.dragging||v.gesturing?"none":"",transform:`translate(-50%, -50%) scale(${m.scale}) rotate(${m.rotateDeg}deg)`})),U=()=>{a("hide")},T=()=>{m.scale=1,m.lastScale=1,m.rotateDeg=0,m.top=0,m.left=0,v.loadError=!1,v.dragging=!1,v.loading=!0},S=(ge,ke)=>{const Ie=c.value;T(),c.value=ge,w.value[c.value]===w.value[ge]&&ve(()=>{v.loading=!1}),t.visible&&Ie!==ge&&(ke&&ke(Ie,ge),a("on-index-change",Ie,ge))},E=()=>{const ge=c.value,ke=t.loop?(ge+1)%w.value.length:ge+1;!t.loop&&ke>w.value.length-1||S(ke,(Ie,Ae)=>{a("on-next",Ie,Ae),a("on-next-click",Ie,Ae)})},Q=()=>{const ge=c.value;let ke=ge-1;if(ge===0){if(!t.loop)return;ke=w.value.length-1}S(ke,(Ie,Ae)=>{a("on-prev",Ie,Ae),a("on-prev-click",Ie,Ae)})},D=ge=>{Math.abs(1-ge)<.05?ge=1:Math.abs(l.maxScale-ge)<.05&&(ge=l.maxScale),m.lastScale=m.scale,m.scale=ge},M=()=>{const ge=m.scale+t.zoomScale;ge{const ge=m.scale-t.zoomScale;ge>t.minZoom&&D(ge)},I=()=>{const ge=m.rotateDeg%360;a("on-rotate",Math.abs(ge<0?ge+360:ge))},V=()=>{m.rotateDeg-=90,I()},R=()=>{m.rotateDeg+=90,I()},P=()=>{m.scale=1,m.top=0,m.left=0},W=function(){let ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return!t.moveDisabled&&ge===0},{onMouseDown:G,onMouseMove:te,onMouseUp:ae}=((ge,ke,Ie)=>{let Ae,Te=!1;return{onMouseDown:Ye=>{ge.initX=ge.lastX=Ye.clientX,ge.initY=ge.lastY=Ye.clientY,ke.dragging=!0,Te=!1,Ye.stopPropagation()},onMouseUp:Ye=>{Ie(Ye.button)&&Jc(Ae),ke.dragging=!1,Te=!1},onMouseMove:Ye=>{if(ke.dragging)if(Ie(Ye.button)){if(Te)return;Te=!0,Ae=Ui(()=>{const{top:Kt,left:yt,lastY:Je,lastX:rt}=ge;ge.top=Kt-Je+Ye.clientY,ge.left=yt-rt+Ye.clientX,ge.lastX=Ye.clientX,ge.lastY=Ye.clientY,Te=!1})}else ge.lastX=Ye.clientX,ge.lastY=Ye.clientY;Ye.stopPropagation()}}})(m,v,W),{onTouchStart:q,onTouchMove:ie,onTouchEnd:K}=((ge,ke,Ie,Ae,Te)=>{let Ye,Kt=!1;return{onTouchStart:yt=>{const{touches:Je}=yt;Je.length>1&&Te()?(Ie.gesturing=!0,ke.touches=Je):(ke.initX=ke.lastX=Je[0].clientX,ke.initY=ke.lastY=Je[0].clientY,Ie.dragging=!0),yt.stopPropagation()},onTouchMove:yt=>{if(Kt)return;const{touches:Je}=yt,{lastX:rt,lastY:bt,left:ot,top:Ct,scale:Et}=ke;if(!Ie.gesturing&&Ie.dragging){if(!Je[0])return;const{clientX:Nt,clientY:st}=Je[0];Ae()?Ye=Ui(()=>{ke.lastX=Nt,ke.lastY=st,ke.top=Ct-bt+st,ke.left=ot-rt+Nt,Kt=!1}):(ke.lastX=Nt,ke.lastY=st)}else Ie.gesturing&&ke.touches.length>1&&Je.length>1&&Te()&&(Ye=Ui(()=>{const Nt=(Zc(ke.touches[0],ke.touches[1])-Zc(Je[0],Je[1]))/ge.width;ke.touches=Je;const st=Et-1.3*Nt;st>.5&&st<1.5*ge.maxScale&&(ke.scale=st),Kt=!1}))},onTouchEnd:()=>{Jc(Ye),Ie.dragging=!1,Ie.gesturing=!1,Kt=!1}}})(l,m,v,W,()=>!t.pinchDisabled),z=()=>{t.dblclickDisabled||(m.scale!==l.maxScale?(m.lastScale=m.scale,m.scale=l.maxScale):m.scale=m.lastScale)},Z=ge=>{v.loadError||v.gesturing||v.loading||v.dragging||v.wheeling||!t.scrollDisabled||t.zoomDisabled||(v.wheeling=!0,setTimeout(()=>{v.wheeling=!1},80),ge.deltaY<0?M():$())},J=ge=>{const ke=ge;t.visible&&(!t.escDisabled&&ke.key==="Escape"&&t.visible&&U(),ke.key==="ArrowLeft"&&(t.rtl?E():Q()),ke.key==="ArrowRight"&&(t.rtl?Q():E()))},ne=()=>{t.maskClosable&&U()},ye=()=>{A()},se=()=>{v.loading=!1},ue=ge=>{v.loading=!1,v.loadError=!0,a("on-error",ge)},ce=()=>{t.visible&&A()};we(()=>t.index,ge=>{ge<0||ge>=w.value.length||S(ge)}),we(()=>v.dragging,(ge,ke)=>{const Ie=!ge&&ke;if(!W()&&Ie){const Ae=m.lastX-m.initX,Te=m.lastY-m.initY,Ye=t.swipeTolerance;Math.abs(Ae)>Math.abs(Te)&&(Ae<-1*Ye?E():Ae>Ye&&Q())}}),we(()=>t.visible,ge=>{if(ge){T();const ke=w.value.length;if(ke===0)return c.value=0,v.loading=!1,void ve(()=>v.loadError=!0);c.value=t.index>=ke?ke-1:t.index<0?0:t.index,t.scrollDisabled&&Ee()}else t.scrollDisabled&&Fe()});const Ee=()=>{document&&(p.value=document.body.style.overflowY,document.body.style.overflowY="hidden")},Fe=()=>{document&&(document.body.style.overflowY=p.value)};Be(()=>{Yc(document,"keydown",J),Yc(window,"resize",ce)}),Bs(()=>{qc(document,"keydown",J),qc(window,"resize",ce),t.scrollDisabled&&Fe()});const Re=()=>v.loading?s.loading?s.loading({key:"loading"}):o(P2,{key:"img-loading"},null):v.loadError?s.onerror?s.onerror({key:"onerror"}):o(K2,{key:"img-on-error"},null):o("div",{class:`${As}-img-wrapper`,style:k.value,key:"img-wrapper"},[o("img",{alt:C.value,ref:n,draggable:"false",class:`${As}-img`,src:B.value,onMousedown:G,onMouseup:ae,onMousemove:te,onTouchstart:q,onTouchmove:ie,onTouchend:K,onLoad:ye,onDblclick:z,onDragstart:ge=>{ge.preventDefault()}},null)]),he=()=>{if(s["prev-btn"])return s["prev-btn"]({prev:Q});if(w.value.length<=1)return;const ge=!t.loop&&c.value<=0;return o("div",{role:"button","aria-label":"previous image button",class:"btn__prev "+(ge?"disable":""),onClick:Q},[t.rtl?o(ws,{type:"next"},null):o(ws,{type:"prev"},null)])},Ge=()=>{if(s["next-btn"])return s["next-btn"]({next:E});if(w.value.length<=1)return;const ge=!t.loop&&c.value>=w.value.length-1;return o("div",{role:"button","aria-label":"next image button",class:"btn__next "+(ge?"disable":""),onClick:E},[t.rtl?o(ws,{type:"prev"},null):o(ws,{type:"next"},null)])},ze=()=>{if(!(t.titleDisabled||v.loading||v.loadError))return s.title?s.title({currentImg:g.value}):y.value?o(N2,null,{default:()=>[y.value]}):void 0},qe=()=>{let ge;if(t.visible)return o("div",{onTouchmove:M2,class:[`${As}-modal`,t.rtl?"is-rtl":""],onClick:We(ne,["self"]),onWheel:Z},[o(G2,null,null),o(ro,{name:`${As}-fade`,mode:"out-in"},$i(ge=Re())?ge:{default:()=>[ge]}),o("img",{style:"display:none;",src:B.value,onError:ue,onLoad:se},null),o("div",{class:`${As}-btns-wrapper`},[he(),Ge(),ze(),s["close-btn"]?s["close-btn"]({close:U}):o("div",{role:"button","aria-label":"close image preview button",class:"btn__close",onClick:U},[o(ws,{type:"close"},null)]),s.toolbar?s.toolbar({toolbarMethods:{zoomIn:M,zoomOut:$,rotate:V,rotateLeft:V,rotateRight:R,resize:P},zoomIn:M,zoomOut:$,rotate:V,rotateLeft:V,rotateRight:R,resize:P}):o(H2,{zoomIn:M,zoomOut:$,resize:P,rotateLeft:V,rotateRight:R,rotateDisabled:t.rotateDisabled,zoomDisabled:t.zoomDisabled},null)])])};return()=>{let ge;if(t.teleport){let ke;return o($r,{to:t.teleport},{default:()=>[o(ro,{name:`${As}-fade`},$i(ke=qe())?ke:{default:()=>[ke]})]})}return o(ro,{name:`${As}-fade`},$i(ge=qe())?ge:{default:()=>[ge]})}}});const j2=Object.assign(Di,{install:t=>{t.component(Di.name,Di)}}),Y2={name:"Attachments",props:{multiple:Boolean,attachments:{type:[Array,Object],default:()=>[]},empty_text:String,isSingle:Boolean,title:String,type:String,icon:String,showList:{type:Boolean,default:!0},showDeleteButton:{type:Boolean,default:!0},previewImage:{type:Boolean,default:!0},mediaInputSize:{type:String},mediaInputBg:{type:String}},emits:["removeImage","mediaUploaded"],data(){return{visible:!1,imageIndex:0,lightboxData:[],images:L([])}},components:{MediaButton:Zu,VueEasyLightbox:j2,IconButton:Ue,Delete:Fn},computed:{showMediaButtonAsIcon:function(){return!this.multiple&&this.attachments.length===1}},mounted:function(){Array.isArray(this.attachments)&&this.attachments.length>0&&this.attachments.forEach(t=>{this.lightboxData.push(t.url),this.images.push({id:t.id,url:t.url,title:t.title})})},methods:{translate:u,removeImageEvent(t){this.$emit("removeImage",t)},onMediaSelected(t){this.images=t.map(e=>({id:e.id,title:e.title,url:e.url})),this.$emit("mediaUploaded",this.images)}},watch:{attachments:{handler:function(t,e){return this.lightboxData=[],Array.isArray(t)&&t.length>0&&t.map((a,s)=>{this.lightboxData.push(a.url)}),t},deep:!0}}},q2={class:"fct-attachments-wrap",style:{position:"relative"}},W2={class:"fct-attachment-img-wrap"},X2=["src","alt","onClick"],J2={class:"fct-attachments-button"};function Z2(t,e,a,s,n,l){const A=b("VueEasyLightbox"),c=b("MediaButton"),p=b("IconButton"),m=b("Delete");return d(),_(H,null,[o(A,{visible:n.visible,imgs:n.lightboxData,index:n.imageIndex,onHide:e[0]||(e[0]=()=>{this.visible=!1})},null,8,["visible","imgs","index"]),r("div",q2,[a.attachments?(d(),_("ul",{key:0,class:oe(`fct-attachments-list ${a.multiple?"is-multiple":"fct-single-attachment"} ${a.attachments.length>0?"is-single":""}`)},[a.showList===!0?(d(!0),_(H,{key:0},ee(a.attachments,(v,w)=>(d(),_("li",{key:w,class:oe([[a.mediaInputSize,a.mediaInputBg],"fct-attachment-item"])},[r("div",W2,[a.previewImage?(d(),_("img",{key:0,src:v.url,alt:v.title,onClick:()=>{this.imageIndex=w,this.visible=!0}},null,8,X2)):x("",!0),l.showMediaButtonAsIcon&&!a.multiple?(d(),F(p,{key:1,size:"x-small"},{default:i(()=>[o(c,{"icon-mode":!0,attachments:a.attachments,title:a.multiple?"":a.title,onOnMediaSelected:l.onMediaSelected,multiple:a.multiple,icon:a.icon},null,8,["attachments","title","onOnMediaSelected","multiple","icon"])]),_:1})):x("",!0)]),r("div",J2,[a.showDeleteButton?(d(),F(p,{key:0,tag:"button",bg:"danger",outline:"",size:"x-small",onClick:We(g=>l.removeImageEvent(w),["prevent"]),title:l.translate("Delete media")},{default:i(()=>[a.multiple?(d(),F(m,{key:0})):(d(),_(H,{key:1},[O(h(l.translate("Remove")),1)],64))]),_:2},1032,["onClick","title"])):x("",!0),l.showMediaButtonAsIcon&&a.multiple?(d(),F(p,{key:1,size:"x-small"},{default:i(()=>[o(c,{"icon-mode":!0,attachments:a.attachments,title:a.multiple?"":a.title,onOnMediaSelected:l.onMediaSelected,multiple:a.multiple,icon:a.icon},null,8,["attachments","title","onOnMediaSelected","multiple","icon"])]),_:1})):x("",!0)])],2))),128)):x("",!0),l.showMediaButtonAsIcon?x("",!0):(d(),_("li",{key:1,class:oe([a.mediaInputSize,a.mediaInputBg])},[o(c,{"icon-mode":!1,attachments:a.attachments,title:a.multiple?"":a.title,onOnMediaSelected:l.onMediaSelected,multiple:a.multiple,icon:a.icon},null,8,["attachments","title","onOnMediaSelected","multiple","icon"])],2))],2)):x("",!0),na(t.$slots,"default")])],64)}const ek=$e(Y2,[["render",Z2]]),tk={key:0},ak={key:0,class:"setting-label"},Wr={__name:"MediaInput",props:{modelValue:{default:""},showSupported:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1},icon:{type:String},title:{type:String},mediaInputSize:{type:String},mediaInputBg:{type:String},field:{type:Object}},emits:["update:modelValue"],setup(t,{emit:e}){const a=t,s=e,n=L();let l=L([]);const A=()=>{a.multiple?n.value=[]:n.value="",l=[],s("update:modelValue",n.value)},c=m=>{if(m.length)if(a.multiple){n.value=[],l=[];for(const v of m)n.value.push(v),l.push(v)}else n.value=m,l=m;s("update:modelValue",n.value)};we(()=>a.modelValue,m=>{Array.isArray(m)&&m.length>0?n.value=m:m&&typeof m=="string"&&m!==""?n.value=[m]:m&&typeof m=="object"?n.value=[m]:n.value=[],p()});const p=()=>{l.value=[],Object.values(n.value).forEach((m,v)=>{m!==void 0&&m!==""&&l.value.push(m)})};return Be(()=>{Array.isArray(a.modelValue)&&a.modelValue.length>0?n.value=a.modelValue:a.modelValue&&typeof a.modelValue=="string"&&a.modelValue!==""?n.value=[a.modelValue]:a.modelValue&&typeof a.modelValue=="object"?n.value=[a.modelValue]:n.value=[],p()}),(m,v)=>(d(),_(H,null,[o(ek,{attachments:f(l),onMediaUploaded:c,onRemoveImage:A,icon:t.icon,title:t.title,mediaInputSize:t.mediaInputSize,mediaInputBg:t.mediaInputBg},null,8,["attachments","icon","title","mediaInputSize","mediaInputBg"]),t.showSupported?(d(),_("div",tk,[t.field&&t.field.label?(d(),_("label",ak,h(t.field.label),1)):x("",!0),r("span",null,h(f(u)("%1$s Recommended width: %2$s pixels minimum.","HEIC, WEBP, SVG, PNG, or JPG.","512")),1)])):x("",!0)],64))}},sk={class:"setting-media-wrap"},Ef={__name:"Media",props:ss({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=hs(t,"modelValue");return(a,s)=>(d(),_("div",sk,[o(Wr,Zt({modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=n=>e.value=n),field:t.field,icon:"Upload"},t.attribute),null,16,["modelValue","field"])]))}},nk=Object.freeze(Object.defineProperty({__proto__:null,default:Ef},Symbol.toStringTag,{value:"Module"})),ok={__name:"InputRenderer",props:{form:{type:Object,required:!0},field:{type:Object,required:!0},value:{type:Object,required:!0},statePath:{type:String,required:!0},fieldKey:{type:String,required:!0},fullStatePath:{type:String,required:!0}},setup(t){const e=t;L(!1),vt().ctx;const a=m=>typeof m.label=="function"?m.label(e.value,e.statePath,e.form):m.label,s=(m,v)=>{if(typeof m=="function")return m({data:e.value,form:e.form,statePath:e.statePath,field:e.field,event:Array.isArray(v)&&v.length===1?v[0]:v})},n=L(!1);let l={};Be(async()=>{l=await pA.attributesBuilders(e.field,s,e.form),n.value=!0});const A={switch:bf,checkbox:wf,radio:Cf,input:to,text:to,email:to,number:to,textarea:to,color:fA,date:Bf,time:kf,select:xf,media:Ef,remote_select:Ff},c=j(()=>A[e.field.type]||null),p=j(()=>({modelValue:e.value[e.fieldKey],form:e.form,statePath:e.statePath,field:e.field,fieldKey:e.fieldKey,value:e.value[e.fieldKey],nesting:!1,label:a(e.field),attribute:l,callback:s}));return(m,v)=>t.field.type==="wp-editor"?(d(),F(js,{key:0,shortCodes:t.field.shortcodes.data,modelValue:e.value[e.fieldKey],onUpdate:v[0]||(v[0]=w=>{e.value[e.fieldKey]=w})},null,8,["shortCodes","modelValue"])):c.value&&n.value?(d(),F(Cs(c.value),Zt({key:1,onChange:v[1]||(v[1]=w=>{t.form.triggerChange(w)}),onInput:v[2]||(v[2]=w=>{t.form.triggerChange(t.value[t.fieldKey])}),modelValue:t.value[t.fieldKey],"onUpdate:modelValue":v[3]||(v[3]=w=>t.value[t.fieldKey]=w)},p.value),null,16,["modelValue"])):x("",!0)}},lk=["innerHTML"],rk={key:0},ik={key:0},Xr={__name:"FormRenderer",props:{form:{type:Object,required:!0},schema:{type:Object},value:{type:Object},statePath:{type:String}},setup(t){const e=t,a=e.statePath??"",s=["grid","section","tab","tab-pane"];L(!1),vt().ctx;const n=(A,c)=>{if(typeof A.label=="function"){let p=l(A)?a:c+".",m=l(A)?e.value:e.value[c];return A.label(m,p,e.form)}return A.label},l=A=>A.disable_nesting!==!1;return(A,c)=>(d(!0),_(H,null,ee(t.schema,(p,m)=>(d(),_(H,{key:m},[t.form.isVisible(p,t.statePath+m)?(d(),_(H,{key:0},[p.type==="html"?(d(),_("div",{key:0,class:oe(`setting-html-wrapper ${p.wrapperClass??""}`),innerHTML:p.value},null,10,lk)):(d(),_(H,{key:1},[p.component?(d(),_("div",{key:0,class:oe(p.wrapperClass??"")},[p.component&&p.label?(d(),F($t,{key:0,title:n(p,m),content:p.tooltip,class:"setting-label",placement:p.tooltip_placement},{default:i(()=>[p.labelOptional?(d(),_("span",rk,"("+h(p.labelOptional)+")",1)):x("",!0)]),_:2},1032,["title","content","placement"])):x("",!0),o(hf,{modelValue:t.value[m],"onUpdate:modelValue":v=>t.value[m]=v,name:p.component,form:t.form,statePath:l(p)?f(a):m+".",field:p,"field-key":m,value:l(p)?t.value:t.value[m],nesting:l(p)},{fieldNote:i(()=>[p.note&&p.hide_note!==!0?(d(),F(Fd,{key:0,note:p.note},null,8,["note"])):x("",!0)]),validationError:i(()=>[o(jc,{form:t.form,"error-key":f(a)+m},null,8,["form","error-key"])]),_:2},1032,["modelValue","onUpdate:modelValue","name","form","statePath","field","field-key","value","nesting"])],2)):x("",!0),s.includes(p.type)?(d(),F(y2,{key:1,form:t.form,field:p,value:t.value,"full-state-path":f(a),statePath:l(p)?f(a):m+".","field-key":m},null,8,["form","field","value","full-state-path","statePath","field-key"])):x("",!0),typeof p.type<"u"&&!s.includes(p.type)&&!["custom","component","html","hidden"].includes(p.type)?(d(),_("div",{key:2,class:oe(`setting-fields-inner ${p.wrapperClass??""}`)},[p.type!=="checkbox"&&!p.component&&p.label!==!1?(d(),F($t,{key:0,class:"setting-label",title:n(p,m),content:p.tooltip,placement:p.tooltip_placement},{default:i(()=>[p.labelOptional?(d(),_("span",ik,"("+h(p.labelOptional)+")",1)):x("",!0)]),_:2},1032,["title","content","placement"])):x("",!0),o(ok,{form:t.form,field:p,value:t.value,"full-state-path":f(a),"state-path":t.statePath,"field-key":m},null,8,["form","field","value","full-state-path","state-path","field-key"]),p.note&&!p.component?(d(),F(Fd,{key:1,note:p.note},null,8,["note"])):x("",!0),p.component?x("",!0):(d(),F(jc,{key:2,form:t.form,"error-key":f(a)+m},null,8,["form","error-key"]))],2)):x("",!0)],64))],64)):x("",!0)],64))),128))}},dk={key:0,class:"vue-form-wrap"},Ak={key:0,class:"form-section-save-action"},ck={key:0,class:"cmd block leading-none"},Jr={__name:"VueForm",props:{form:{type:Object,required:!0},schema:{type:Object},value:{type:Object},showSubmitButton:{type:Boolean,default:!1},submitButtonText:{type:String,default:"Save"},loading:{type:Boolean,default:!1}},emits:["onSubmit","onChange","onSubmitButtonClick"],setup(t,{expose:e,emit:a}){const s=t,n=a;Be(()=>{ve(()=>{l.registerCopyAction()})}),L({});const l=vt().ctx,A=()=>{n("onSubmitButtonClick")};return e({getState:()=>s.form.values}),(p,m)=>{const v=b("el-button");return t.form.isReady?(d(),_("div",dk,[o(Xr,{form:t.form,ref:"formRenderer",schema:t.form.schema,value:t.form.values},null,8,["form","schema","value"]),t.showSubmitButton?(d(),_("div",Ak,[o(v,{onClick:A,type:"primary",loading:t.loading},{default:i(()=>[t.loading?x("",!0):(d(),_("span",ck,"⌘s")),O(" "+h(t.loading?f(u)("Saving"):t.submitButtonText),1)]),_:1},8,["loading"])])):x("",!0)])):x("",!0)}}},uk={key:0},pk={__name:"DynamicFormLoader",props:["schema","values","submit_button_text","form_name","widget"],emits:["change"],setup(t,{expose:e,emit:a}){let s=cA();const n=a,l=t,A=()=>{const v=l.form_name,w={};return w[v]={...s.values},w},c=()=>{s.reset()},p=()=>{var v;return((v=l.widget)==null?void 0:v.reset_on_save)==!0},m=Ur("triggerChange");return Be(()=>{s.setSchema(l.schema).setDefaults(l.values).initForm(),s.onDataChanged(v=>{m==null||m(),n("change")})}),e({getState:A,resetForm:c,resetOnSave:p}),(v,w)=>f(s).isReady?(d(),_("div",uk,[o(Jr,{showSubmitButton:!1,submitButtonText:t.submit_button_text,form:f(s),onOnSubmitButtonClick:w[0]||(w[0]=()=>{f(s).values}),onOnChange:w[1]||(w[1]=g=>{}),"validation-errors":{}},null,8,["submitButtonText","form"])])):x("",!0)}},fk={__name:"EChart",props:{option:{type:Object,required:!0},height:{type:String,default:"400px"},width:{type:String,default:"100%"}},setup(t){const e=t,a=L(null);let s=null;const n=()=>{a.value&&(s=St(a.value),console.log(e.option),s.setOption(e.option))};we(()=>e.option,p=>{s&&p&&s.setOption(p,!0)},{deep:!0});const l=(p,m)=>{if(p==null||p==="")return m;const v=Number(p);return isNaN(v)?p:`${v}px`},A=j(()=>l(e.height,"400px")),c=j(()=>l(e.width,"100%"));return Be(()=>{n(),window.addEventListener("resize",()=>s==null?void 0:s.resize())}),Bs(()=>{window.removeEventListener("resize",()=>s==null?void 0:s.resize()),s==null||s.dispose()}),(p,m)=>(d(),_("div",{ref_key:"chartRef",ref:a,style:ea({width:c.value,height:A.value})},null,4))}},mk={__name:"VueTemplateLoader",props:{widget:{type:Object,required:!0},data:{required:!1}},setup(t){const e=s=>{var n,l;try{if(typeof s!="string")return null;const A=s.match(/]*)?>|/i);if(!A)return console.error("Dynamic component missing "),null;const c=A.index+A[0].length;let p=1,m=c,v=-1;for(;m0;){const y=s.indexOf("",m);if(C===-1)return console.error("Unclosed tag"),null;y!==-1&&y tag"),null;const w=s.substring(c,v).trim(),g=s.match(/