@redapollos/storm-form 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/storm-form.es.js +2 -2
- package/dist/storm-form.umd.cjs +5 -5
- package/package.json +1 -1
package/dist/storm-form.es.js
CHANGED
|
@@ -6,8 +6,8 @@ import G from "axios";
|
|
|
6
6
|
import de from "dayjs";
|
|
7
7
|
const xt = {}, _t = "https://storm-api.azurewebsites.net";
|
|
8
8
|
function Tt() {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
if (!(typeof process > "u" || !process.env))
|
|
10
|
+
return process.env.STORM_FORM_API_URL || process.env.NEXT_PUBLIC_STORM_FORM_API_URL;
|
|
11
11
|
}
|
|
12
12
|
function It() {
|
|
13
13
|
return xt?.VITE_WEBAPI_URL;
|
package/dist/storm-form.umd.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(s,g){typeof exports=="object"&&typeof module<"u"?module.exports=g(require("react/jsx-runtime"),require("react"),require("antd"),require("axios"),require("dayjs")):typeof define=="function"&&define.amd?define(["react/jsx-runtime","react","antd","axios","dayjs"],g):(s=typeof globalThis<"u"?globalThis:s||self,s.StormForm=g(s.jsxRuntime,s.React,s.antd,s.axios,s.dayjs))})(this,(function(s,g,l,j,X){"use strict";function Ue(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const P=Ue(g),Ke={},Ye="https://storm-api.azurewebsites.net";function Je(){
|
|
2
|
-
`):e.response.data:e.request?"network error":"error"}function J(e){var t=e===!0||e===void 0;const r=typeof window<"u"&&typeof localStorage<"u";let n=r?localStorage.getItem("token"):null;const a=r?localStorage.getItem("appKey"):"";return t&&n?{AppKey:a,"Content-Type":"application/json"}:{AppKey:a,"Content-Type":"application/json"}}const Ze={getSystemList:Qe};function Qe(e){return x.getData(`/api/system/list/${e}`,!0)}const Xe=({slug:e,value:t,label:r,opts:n,isRequired:a,values:i,error:c,errors:d,placeholder:p})=>{const[f,h]=g.useState([]),[b,v]=g.useState(!1);if(!e)throw Error("ListInput property: slug required");return!t&&i&&i[e]&&(t=i[e]),!c&&d&&d[e]&&(c=d[e]),g.useEffect(()=>{if(n.listSource==="static list")h(n.listOptions),v(!0);else if(n.listSource.indexOf("list_")>-1){let y=n.listSource.split("_")[1];Ze.getSystemList(y).then(F=>{let k=F.items.map(u=>({label:u.label,value:u.value}));h(k),v(!0)}).catch(()=>{})}},[n.listSource]),s.jsxs(s.Fragment,{children:[n.fieldStyle==="select"&&s.jsx(l.Form.Item,{label:r,name:e,initialValue:t,rules:[{required:a,message:"Required"}],children:s.jsxs(l.Select,{showSearch:!0,optionFilterProp:"children",filterOption:(y,F)=>F.children&&F.children.toLowerCase().indexOf(y.toLowerCase())>=0,children:[s.jsx(l.Select.Option,{value:"",children:p}),f.map((y,F)=>s.jsx(l.Select.Option,{children:y.label},y.value))]})}),b&&n.fieldStyle==="checkboxes"&&s.jsx(l.Form.Item,{label:r,name:e,initialValue:t,rules:[{required:a,message:"Required"}],children:s.jsx(l.Checkbox.Group,{children:s.jsx(l.Space,{direction:"vertical",children:f.map((y,F)=>s.jsx(l.Checkbox,{value:y.value,children:y.label},y.value))})})}),b&&n.fieldStyle==="radios"&&s.jsx(l.Form.Item,{label:r,name:e,initialValue:t,className:"column-vertical",rules:[{required:a,message:"Required"}],children:s.jsx(l.Radio.Group,{options:f})})]})},pe=e=>{let{slug:t,value:r,label:n,opts:a,type:i,isRequired:c,error:d,className:p,placeholder:f}=e;if(!t)throw Error("NumberInput property: slug required");return s.jsx(l.Form.Item,{validateStatus:d?"error":"",name:t,help:d||"",label:n,className:p,initialValue:r,rules:[{required:c,message:"Required"}],children:s.jsx(l.InputNumber,{min:a.minNumber||0,max:a.maxNumber||9999999999,placeholder:f,formatter:h=>i==="currency"?`$ ${h}`:h,parser:h=>h.replace("$","")})})};function re(e){let{slug:t,value:r,fieldType:n,label:a,disableDates:i,showTime:c,disabled:d,isRequired:p}=e;if(!t)throw Error("DatePickerInput property: slug required");return s.jsxs(l.Form.Item,{label:a,children:[n===9&&s.jsx(l.Form.Item,{name:t,initialValue:r,children:s.jsx(l.TimePicker,{name:t,use12Hours:!0,rules:[{required:o.isRequired,message:"Required"}]})}),n!==9&&s.jsx(l.Form.Item,{name:t,initialValue:r,help:Intl.DateTimeFormat().resolvedOptions().timeZone,rules:[{required:o.isRequired,message:"Required"}],children:s.jsx(l.DatePicker,{name:t,disabled:d,disabledDate:i,showToday:!1,use12Hours:!0,showTime:c?{use12Hours:!0,format:"HH:mm a"}:!1,format:c?"MM-DD-YYYY h:mm a":"MM-DD-YYYY"})})]})}const Re=e=>{let{slug:t,value:r,label:n,opts:a,error:i,className:c}=e;if(!t)throw Error("YesNoInput property: slug required");const d=[{label:"Yes",value:!0},{label:"No",value:!1}];return s.jsxs(l.Form.Item,{validateStatus:i?"error":"",name:t,help:i||"",label:n,className:c,initialValue:r,children:[a.fieldStyle==="switch"&&s.jsx(l.Form.Item,{name:t,initialValue:r,children:s.jsx(l.Switch,{})}),a.fieldStyle==="radio"&&s.jsx(l.Form.Item,{name:t,initialValue:r,rules:[{required:o.isRequired,message:"Required"}],children:s.jsx(l.Radio.Group,{options:d})})]})};function et(e){let{slug:t,value:r,label:n,debug:a,className:i}=e;return a?s.jsx(l.Form.Item,{name:t,label:n,className:i,children:s.jsx(l.Input,{value:r})}):s.jsx(l.Form.Item,{label:n,className:i,children:r})}const tt=e=>{let{slug:t,value:r,label:n,className:a}=e;if(!t)throw Error("OptInInput property: slug required");return s.jsx(l.Form.Item,{name:t,initialValue:r,valuePropName:"checked",className:a,label:n,rules:[{validator:async(i,c)=>{if(!c)return Promise.reject(new Error("Required"))}}],children:s.jsx(l.Checkbox,{children:"I Agree"})})},be=g.createContext({});function ye(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=ye(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function rt(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=ye(e))&&(n&&(n+=" "),n+=t);return n}const nt={aliceblue:"9ehhb",antiquewhite:"9sgk7",aqua:"1ekf",aquamarine:"4zsno",azure:"9eiv3",beige:"9lhp8",bisque:"9zg04",black:"0",blanchedalmond:"9zhe5",blue:"73",blueviolet:"5e31e",brown:"6g016",burlywood:"8ouiv",cadetblue:"3qba8",chartreuse:"4zshs",chocolate:"87k0u",coral:"9yvyo",cornflowerblue:"3xael",cornsilk:"9zjz0",crimson:"8l4xo",cyan:"1ekf",darkblue:"3v",darkcyan:"rkb",darkgoldenrod:"776yz",darkgray:"6mbhl",darkgreen:"jr4",darkgrey:"6mbhl",darkkhaki:"7ehkb",darkmagenta:"5f91n",darkolivegreen:"3bzfz",darkorange:"9yygw",darkorchid:"5z6x8",darkred:"5f8xs",darksalmon:"9441m",darkseagreen:"5lwgf",darkslateblue:"2th1n",darkslategray:"1ugcv",darkslategrey:"1ugcv",darkturquoise:"14up",darkviolet:"5rw7n",deeppink:"9yavn",deepskyblue:"11xb",dimgray:"442g9",dimgrey:"442g9",dodgerblue:"16xof",firebrick:"6y7tu",floralwhite:"9zkds",forestgreen:"1cisi",fuchsia:"9y70f",gainsboro:"8m8kc",ghostwhite:"9pq0v",goldenrod:"8j4f4",gold:"9zda8",gray:"50i2o",green:"pa8",greenyellow:"6senj",grey:"50i2o",honeydew:"9eiuo",hotpink:"9yrp0",indianred:"80gnw",indigo:"2xcoy",ivory:"9zldc",khaki:"9edu4",lavenderblush:"9ziet",lavender:"90c8q",lawngreen:"4vk74",lemonchiffon:"9zkct",lightblue:"6s73a",lightcoral:"9dtog",lightcyan:"8s1rz",lightgoldenrodyellow:"9sjiq",lightgray:"89jo3",lightgreen:"5nkwg",lightgrey:"89jo3",lightpink:"9z6wx",lightsalmon:"9z2ii",lightseagreen:"19xgq",lightskyblue:"5arju",lightslategray:"4nwk9",lightslategrey:"4nwk9",lightsteelblue:"6wau6",lightyellow:"9zlcw",lime:"1edc",limegreen:"1zcxe",linen:"9shk6",magenta:"9y70f",maroon:"4zsow",mediumaquamarine:"40eju",mediumblue:"5p",mediumorchid:"79qkz",mediumpurple:"5r3rv",mediumseagreen:"2d9ip",mediumslateblue:"4tcku",mediumspringgreen:"1di2",mediumturquoise:"2uabw",mediumvioletred:"7rn9h",midnightblue:"z980",mintcream:"9ljp6",mistyrose:"9zg0x",moccasin:"9zfzp",navajowhite:"9zest",navy:"3k",oldlace:"9wq92",olive:"50hz4",olivedrab:"472ub",orange:"9z3eo",orangered:"9ykg0",orchid:"8iu3a",palegoldenrod:"9bl4a",palegreen:"5yw0o",paleturquoise:"6v4ku",palevioletred:"8k8lv",papayawhip:"9zi6t",peachpuff:"9ze0p",peru:"80oqn",pink:"9z8wb",plum:"8nba5",powderblue:"6wgdi",purple:"4zssg",rebeccapurple:"3zk49",red:"9y6tc",rosybrown:"7cv4f",royalblue:"2jvtt",saddlebrown:"5fmkz",salmon:"9rvci",sandybrown:"9jn1c",seagreen:"1tdnb",seashell:"9zje6",sienna:"6973h",silver:"7ir40",skyblue:"5arjf",slateblue:"45e4t",slategray:"4e100",slategrey:"4e100",snow:"9zke2",springgreen:"1egv",steelblue:"2r1kk",tan:"87yx8",teal:"pds",thistle:"8ggk8",tomato:"9yqfb",turquoise:"2j4r4",violet:"9b10u",wheat:"9ld4j",white:"9zldr",whitesmoke:"9lhpx",yellow:"9zl6o",yellowgreen:"61fzm"},q=Math.round;function ne(e,t){const r=e.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],n=r.map(a=>parseFloat(a));for(let a=0;a<3;a+=1)n[a]=t(n[a]||0,r[a]||"",a);return r[3]?n[3]=r[3].includes("%")?n[3]/100:n[3]:n[3]=1,n}const Se=(e,t,r)=>r===0?e:e/100;function W(e,t){const r=t||255;return e>r?r:e<0?0:e}class U{isValid=!0;r=0;g=0;b=0;a=1;_h;_hsl_s;_hsv_s;_l;_v;_max;_min;_brightness;constructor(t){function r(n){return n[0]in t&&n[1]in t&&n[2]in t}if(t)if(typeof t=="string"){let a=function(i){return n.startsWith(i)};const n=t.trim();if(/^#?[A-F\d]{3,8}$/i.test(n))this.fromHexString(n);else if(a("rgb"))this.fromRgbString(n);else if(a("hsl"))this.fromHslString(n);else if(a("hsv")||a("hsb"))this.fromHsvString(n);else{const i=nt[n.toLowerCase()];i&&this.fromHexString(parseInt(i,36).toString(16).padStart(6,"0"))}}else if(t instanceof U)this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this._h=t._h,this._hsl_s=t._hsl_s,this._hsv_s=t._hsv_s,this._l=t._l,this._v=t._v;else if(r("rgb"))this.r=W(t.r),this.g=W(t.g),this.b=W(t.b),this.a=typeof t.a=="number"?W(t.a,1):1;else if(r("hsl"))this.fromHsl(t);else if(r("hsv"))this.fromHsv(t);else throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(t))}setR(t){return this._sc("r",t)}setG(t){return this._sc("g",t)}setB(t){return this._sc("b",t)}setA(t){return this._sc("a",t,1)}setHue(t){const r=this.toHsv();return r.h=t,this._c(r)}getLuminance(){function t(i){const c=i/255;return c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4)}const r=t(this.r),n=t(this.g),a=t(this.b);return .2126*r+.7152*n+.0722*a}getHue(){if(typeof this._h>"u"){const t=this.getMax()-this.getMin();t===0?this._h=0:this._h=q(60*(this.r===this.getMax()?(this.g-this.b)/t+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/t+2:(this.r-this.g)/t+4))}return this._h}getSaturation(){return this.getHSVSaturation()}getHSVSaturation(){if(typeof this._hsv_s>"u"){const t=this.getMax()-this.getMin();t===0?this._hsv_s=0:this._hsv_s=t/this.getMax()}return this._hsv_s}getHSLSaturation(){if(typeof this._hsl_s>"u"){const t=this.getMax()-this.getMin();if(t===0)this._hsl_s=0;else{const r=this.getLightness();this._hsl_s=t/255/(1-Math.abs(2*r-1))}}return this._hsl_s}getLightness(){return typeof this._l>"u"&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return typeof this._v>"u"&&(this._v=this.getMax()/255),this._v}getBrightness(){return typeof this._brightness>"u"&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(t=10){const r=this.getHue(),n=this.getSaturation();let a=this.getLightness()-t/100;return a<0&&(a=0),this._c({h:r,s:n,l:a,a:this.a})}lighten(t=10){const r=this.getHue(),n=this.getSaturation();let a=this.getLightness()+t/100;return a>1&&(a=1),this._c({h:r,s:n,l:a,a:this.a})}mix(t,r=50){const n=this._c(t),a=r/100,i=d=>(n[d]-this[d])*a+this[d],c={r:q(i("r")),g:q(i("g")),b:q(i("b")),a:q(i("a")*100)/100};return this._c(c)}tint(t=10){return this.mix({r:255,g:255,b:255,a:1},t)}shade(t=10){return this.mix({r:0,g:0,b:0,a:1},t)}onBackground(t){const r=this._c(t),n=this.a+r.a*(1-this.a),a=i=>q((this[i]*this.a+r[i]*r.a*(1-this.a))/n);return this._c({r:a("r"),g:a("g"),b:a("b"),a:n})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(t){return this.r===t.r&&this.g===t.g&&this.b===t.b&&this.a===t.a}clone(){return this._c(this)}toHexString(){let t="#";const r=(this.r||0).toString(16);t+=r.length===2?r:"0"+r;const n=(this.g||0).toString(16);t+=n.length===2?n:"0"+n;const a=(this.b||0).toString(16);if(t+=a.length===2?a:"0"+a,typeof this.a=="number"&&this.a>=0&&this.a<1){const i=q(this.a*255).toString(16);t+=i.length===2?i:"0"+i}return t}toHsl(){return{h:this.getHue(),s:this.getHSLSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const t=this.getHue(),r=q(this.getHSLSaturation()*100),n=q(this.getLightness()*100);return this.a!==1?`hsla(${t},${r}%,${n}%,${this.a})`:`hsl(${t},${r}%,${n}%)`}toHsv(){return{h:this.getHue(),s:this.getHSVSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a!==1?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(t,r,n){const a=this.clone();return a[t]=W(r,n),a}_c(t){return new this.constructor(t)}getMax(){return typeof this._max>"u"&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return typeof this._min>"u"&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(t){const r=t.replace("#","");function n(a,i){return parseInt(r[a]+r[i||a],16)}r.length<6?(this.r=n(0),this.g=n(1),this.b=n(2),this.a=r[3]?n(3)/255:1):(this.r=n(0,1),this.g=n(2,3),this.b=n(4,5),this.a=r[6]?n(6,7)/255:1)}fromHsl({h:t,s:r,l:n,a}){const i=(t%360+360)%360;if(this._h=i,this._hsl_s=r,this._l=n,this.a=typeof a=="number"?a:1,r<=0){const y=q(n*255);this.r=y,this.g=y,this.b=y;return}let c=0,d=0,p=0;const f=i/60,h=(1-Math.abs(2*n-1))*r,b=h*(1-Math.abs(f%2-1));f>=0&&f<1?(c=h,d=b):f>=1&&f<2?(c=b,d=h):f>=2&&f<3?(d=h,p=b):f>=3&&f<4?(d=b,p=h):f>=4&&f<5?(c=b,p=h):f>=5&&f<6&&(c=h,p=b);const v=n-h/2;this.r=q((c+v)*255),this.g=q((d+v)*255),this.b=q((p+v)*255)}fromHsv({h:t,s:r,v:n,a}){const i=(t%360+360)%360;this._h=i,this._hsv_s=r,this._v=n,this.a=typeof a=="number"?a:1;const c=q(n*255);if(this.r=c,this.g=c,this.b=c,r<=0)return;const d=i/60,p=Math.floor(d),f=d-p,h=q(n*(1-r)*255),b=q(n*(1-r*f)*255),v=q(n*(1-r*(1-f))*255);switch(p){case 0:this.g=v,this.b=h;break;case 1:this.r=b,this.b=h;break;case 2:this.r=h,this.b=v;break;case 3:this.r=h,this.g=b;break;case 4:this.r=v,this.g=h;break;default:this.g=h,this.b=b;break}}fromHsvString(t){const r=ne(t,Se);this.fromHsv({h:r[0],s:r[1],v:r[2],a:r[3]})}fromHslString(t){const r=ne(t,Se);this.fromHsl({h:r[0],s:r[1],l:r[2],a:r[3]})}fromRgbString(t){const r=ne(t,(n,a)=>a.includes("%")?q(n/100*255):n);this.r=r[0],this.g=r[1],this.b=r[2],this.a=r[3]}}const R=2,we=.16,st=.05,at=.05,ot=.15,ve=5,Te=4,it=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function _e(e,t,r){let n;return Math.round(e.h)>=60&&Math.round(e.h)<=240?n=r?Math.round(e.h)-R*t:Math.round(e.h)+R*t:n=r?Math.round(e.h)+R*t:Math.round(e.h)-R*t,n<0?n+=360:n>=360&&(n-=360),n}function Ie(e,t,r){if(e.h===0&&e.s===0)return e.s;let n;return r?n=e.s-we*t:t===Te?n=e.s+we:n=e.s+st*t,n>1&&(n=1),r&&t===ve&&n>.1&&(n=.1),n<.06&&(n=.06),Math.round(n*100)/100}function xe(e,t,r){let n;return r?n=e.v+at*t:n=e.v-ot*t,n=Math.max(0,Math.min(1,n)),Math.round(n*100)/100}function lt(e,t={}){const r=[],n=new U(e),a=n.toHsv();for(let i=ve;i>0;i-=1){const c=new U({h:_e(a,i,!0),s:Ie(a,i,!0),v:xe(a,i,!0)});r.push(c)}r.push(n);for(let i=1;i<=Te;i+=1){const c=new U({h:_e(a,i),s:Ie(a,i),v:xe(a,i)});r.push(c)}return t.theme==="dark"?it.map(({index:i,amount:c})=>new U(t.backgroundColor||"#141414").mix(r[i],c).toHexString()):r.map(i=>i.toHexString())}const se=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];se.primary=se[5];function ct(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function ut(e,t){if(!e)return!1;if(e.contains)return e.contains(t);let r=t;for(;r;){if(r===e)return!0;r=r.parentNode}return!1}const Ce="data-rc-order",ke="data-rc-priority",ht="rc-util-key",ae=new Map;function Fe({mark:e}={}){return e?e.startsWith("data-")?e:`data-${e}`:ht}function oe(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function dt(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function ie(e){return Array.from((ae.get(e)||e).children).filter(t=>t.tagName==="STYLE")}function Ne(e,t={}){if(!ct())return null;const{csp:r,prepend:n,priority:a=0}=t,i=dt(n),c=i==="prependQueue",d=document.createElement("style");d.setAttribute(Ce,i),c&&a&&d.setAttribute(ke,`${a}`),r?.nonce&&(d.nonce=r?.nonce),d.innerHTML=e;const p=oe(t),{firstChild:f}=p;if(n){if(c){const h=(t.styles||ie(p)).filter(b=>{if(!["prepend","prependQueue"].includes(b.getAttribute(Ce)))return!1;const v=Number(b.getAttribute(ke)||0);return a>=v});if(h.length)return p.insertBefore(d,h[h.length-1].nextSibling),d}p.insertBefore(d,f)}else p.appendChild(d);return d}function gt(e,t={}){let{styles:r}=t;return r||=ie(oe(t)),r.find(n=>n.getAttribute(Fe(t))===e)}function ft(e,t){const r=ae.get(e);if(!r||!ut(document,r)){const n=Ne("",t),{parentNode:a}=n;ae.set(e,a),e.removeChild(n)}}function mt(e,t,r={}){const n=oe(r),a=ie(n),i={...r,styles:a};ft(n,i);const c=gt(t,i);if(c)return i.csp?.nonce&&c.nonce!==i.csp?.nonce&&(c.nonce=i.csp?.nonce),c.innerHTML!==e&&(c.innerHTML=e),c;const d=Ne(e,i);return d.setAttribute(Fe(i),t),d}function Me(e){return e?.getRootNode?.()}function pt(e){return Me(e)instanceof ShadowRoot}function bt(e){return pt(e)?Me(e):null}let le={};const yt=e=>{};function St(e,t){}function wt(e,t){}function vt(){le={}}function qe(e,t,r){!t&&!le[r]&&(e(!1,r),le[r]=!0)}function ee(e,t){qe(St,e,t)}function Tt(e,t){qe(wt,e,t)}ee.preMessage=yt,ee.resetWarned=vt,ee.noteOnce=Tt;function _t(e){return e.replace(/-(.)/g,(t,r)=>r.toUpperCase())}function It(e,t){ee(e,`[@ant-design/icons] ${t}`)}function ze(e){return typeof e=="object"&&typeof e.name=="string"&&typeof e.theme=="string"&&(typeof e.icon=="object"||typeof e.icon=="function")}function Oe(e={}){return Object.keys(e).reduce((t,r)=>{const n=e[r];return r==="class"?(t.className=n,delete t.class):(delete t[r],t[_t(r)]=n),t},{})}function ce(e,t,r){return r?g.createElement(e.tag,{key:t,...Oe(e.attrs),...r},(e.children||[]).map((n,a)=>ce(n,`${t}-${e.tag}-${a}`))):g.createElement(e.tag,{key:t,...Oe(e.attrs)},(e.children||[]).map((n,a)=>ce(n,`${t}-${e.tag}-${a}`)))}function $e(e){return lt(e)[0]}function De(e){return e?Array.isArray(e)?e:[e]:[]}const xt=`
|
|
1
|
+
(function(s,g){typeof exports=="object"&&typeof module<"u"?module.exports=g(require("react/jsx-runtime"),require("react"),require("antd"),require("axios"),require("dayjs")):typeof define=="function"&&define.amd?define(["react/jsx-runtime","react","antd","axios","dayjs"],g):(s=typeof globalThis<"u"?globalThis:s||self,s.StormForm=g(s.jsxRuntime,s.React,s.antd,s.axios,s.dayjs))})(this,(function(s,g,l,j,X){"use strict";function Ue(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const P=Ue(g),Ke={},Ye="https://storm-api.azurewebsites.net";function Je(){if(!(typeof process>"u"||!process.env))return process.env.STORM_FORM_API_URL||process.env.NEXT_PUBLIC_STORM_FORM_API_URL}function We(){return Ke?.VITE_WEBAPI_URL}function Ge(){return Je()||We()||Ye}j.defaults.baseURL=Ge(),j.defaults.timeout=1e3*60*10;const x=j.create({responseType:"json"});x.getData=(e,t)=>{const r={headers:J(t)};return new Promise((n,a)=>{j.get(e,r).then(i=>{n(i.data)}).catch(i=>{a(Y(i))})})},x.upsertData=(e,t,r,n)=>e==null||e===0||e===""?x.postData(t,r,n):x.putData(`${t}/${e}`,r,n),x.postData=(e,t,r)=>{const n={headers:J(r)};return new Promise((a,i)=>{j.post(e,t,n).then(c=>{a(c.data)}).catch(c=>{i(Y(c))})})},x.putData=(e,t,r)=>{const n={headers:J(r)};return new Promise((a,i)=>{j.put(e,t,n).then(c=>{a(c.data)}).catch(c=>{i(Y(c))})})},x.deleteData=(e,t)=>{const r={headers:J(!0)};return t&&(r.data={...t}),new Promise((n,a)=>{j.delete(e,r).then(i=>{n(i.data)}).catch(i=>{a(Y(i))})})},x.deleteMultipleData=(e,t)=>{const r={headers:J(!0),data:{ids:t}};return new Promise((n,a)=>{j.delete(e,r).then(i=>{n(i.data)}).catch(i=>{a(Y(i))})})};function Y(e){return e===null?"error":e.response?Array.isArray(e.response.data)?e.response.data.map(r=>r.description).join(`
|
|
2
|
+
`):e.response.data:e.request?"network error":"error"}function J(e){var t=e===!0||e===void 0;const r=typeof window<"u"&&typeof localStorage<"u";let n=r?localStorage.getItem("token"):null;const a=r?localStorage.getItem("appKey"):"";return t&&n?{AppKey:a,"Content-Type":"application/json"}:{AppKey:a,"Content-Type":"application/json"}}const Ze={getSystemList:Qe};function Qe(e){return x.getData(`/api/system/list/${e}`,!0)}const Xe=({slug:e,value:t,label:r,opts:n,isRequired:a,values:i,error:c,errors:d,placeholder:p})=>{const[f,h]=g.useState([]),[y,v]=g.useState(!1);if(!e)throw Error("ListInput property: slug required");return!t&&i&&i[e]&&(t=i[e]),!c&&d&&d[e]&&(c=d[e]),g.useEffect(()=>{if(n.listSource==="static list")h(n.listOptions),v(!0);else if(n.listSource.indexOf("list_")>-1){let b=n.listSource.split("_")[1];Ze.getSystemList(b).then(F=>{let k=F.items.map(u=>({label:u.label,value:u.value}));h(k),v(!0)}).catch(()=>{})}},[n.listSource]),s.jsxs(s.Fragment,{children:[n.fieldStyle==="select"&&s.jsx(l.Form.Item,{label:r,name:e,initialValue:t,rules:[{required:a,message:"Required"}],children:s.jsxs(l.Select,{showSearch:!0,optionFilterProp:"children",filterOption:(b,F)=>F.children&&F.children.toLowerCase().indexOf(b.toLowerCase())>=0,children:[s.jsx(l.Select.Option,{value:"",children:p}),f.map((b,F)=>s.jsx(l.Select.Option,{children:b.label},b.value))]})}),y&&n.fieldStyle==="checkboxes"&&s.jsx(l.Form.Item,{label:r,name:e,initialValue:t,rules:[{required:a,message:"Required"}],children:s.jsx(l.Checkbox.Group,{children:s.jsx(l.Space,{direction:"vertical",children:f.map((b,F)=>s.jsx(l.Checkbox,{value:b.value,children:b.label},b.value))})})}),y&&n.fieldStyle==="radios"&&s.jsx(l.Form.Item,{label:r,name:e,initialValue:t,className:"column-vertical",rules:[{required:a,message:"Required"}],children:s.jsx(l.Radio.Group,{options:f})})]})},pe=e=>{let{slug:t,value:r,label:n,opts:a,type:i,isRequired:c,error:d,className:p,placeholder:f}=e;if(!t)throw Error("NumberInput property: slug required");return s.jsx(l.Form.Item,{validateStatus:d?"error":"",name:t,help:d||"",label:n,className:p,initialValue:r,rules:[{required:c,message:"Required"}],children:s.jsx(l.InputNumber,{min:a.minNumber||0,max:a.maxNumber||9999999999,placeholder:f,formatter:h=>i==="currency"?`$ ${h}`:h,parser:h=>h.replace("$","")})})};function re(e){let{slug:t,value:r,fieldType:n,label:a,disableDates:i,showTime:c,disabled:d,isRequired:p}=e;if(!t)throw Error("DatePickerInput property: slug required");return s.jsxs(l.Form.Item,{label:a,children:[n===9&&s.jsx(l.Form.Item,{name:t,initialValue:r,children:s.jsx(l.TimePicker,{name:t,use12Hours:!0,rules:[{required:o.isRequired,message:"Required"}]})}),n!==9&&s.jsx(l.Form.Item,{name:t,initialValue:r,help:Intl.DateTimeFormat().resolvedOptions().timeZone,rules:[{required:o.isRequired,message:"Required"}],children:s.jsx(l.DatePicker,{name:t,disabled:d,disabledDate:i,showToday:!1,use12Hours:!0,showTime:c?{use12Hours:!0,format:"HH:mm a"}:!1,format:c?"MM-DD-YYYY h:mm a":"MM-DD-YYYY"})})]})}const Re=e=>{let{slug:t,value:r,label:n,opts:a,error:i,className:c}=e;if(!t)throw Error("YesNoInput property: slug required");const d=[{label:"Yes",value:!0},{label:"No",value:!1}];return s.jsxs(l.Form.Item,{validateStatus:i?"error":"",name:t,help:i||"",label:n,className:c,initialValue:r,children:[a.fieldStyle==="switch"&&s.jsx(l.Form.Item,{name:t,initialValue:r,children:s.jsx(l.Switch,{})}),a.fieldStyle==="radio"&&s.jsx(l.Form.Item,{name:t,initialValue:r,rules:[{required:o.isRequired,message:"Required"}],children:s.jsx(l.Radio.Group,{options:d})})]})};function et(e){let{slug:t,value:r,label:n,debug:a,className:i}=e;return a?s.jsx(l.Form.Item,{name:t,label:n,className:i,children:s.jsx(l.Input,{value:r})}):s.jsx(l.Form.Item,{label:n,className:i,children:r})}const tt=e=>{let{slug:t,value:r,label:n,className:a}=e;if(!t)throw Error("OptInInput property: slug required");return s.jsx(l.Form.Item,{name:t,initialValue:r,valuePropName:"checked",className:a,label:n,rules:[{validator:async(i,c)=>{if(!c)return Promise.reject(new Error("Required"))}}],children:s.jsx(l.Checkbox,{children:"I Agree"})})},ye=g.createContext({});function be(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=be(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function rt(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=be(e))&&(n&&(n+=" "),n+=t);return n}const nt={aliceblue:"9ehhb",antiquewhite:"9sgk7",aqua:"1ekf",aquamarine:"4zsno",azure:"9eiv3",beige:"9lhp8",bisque:"9zg04",black:"0",blanchedalmond:"9zhe5",blue:"73",blueviolet:"5e31e",brown:"6g016",burlywood:"8ouiv",cadetblue:"3qba8",chartreuse:"4zshs",chocolate:"87k0u",coral:"9yvyo",cornflowerblue:"3xael",cornsilk:"9zjz0",crimson:"8l4xo",cyan:"1ekf",darkblue:"3v",darkcyan:"rkb",darkgoldenrod:"776yz",darkgray:"6mbhl",darkgreen:"jr4",darkgrey:"6mbhl",darkkhaki:"7ehkb",darkmagenta:"5f91n",darkolivegreen:"3bzfz",darkorange:"9yygw",darkorchid:"5z6x8",darkred:"5f8xs",darksalmon:"9441m",darkseagreen:"5lwgf",darkslateblue:"2th1n",darkslategray:"1ugcv",darkslategrey:"1ugcv",darkturquoise:"14up",darkviolet:"5rw7n",deeppink:"9yavn",deepskyblue:"11xb",dimgray:"442g9",dimgrey:"442g9",dodgerblue:"16xof",firebrick:"6y7tu",floralwhite:"9zkds",forestgreen:"1cisi",fuchsia:"9y70f",gainsboro:"8m8kc",ghostwhite:"9pq0v",goldenrod:"8j4f4",gold:"9zda8",gray:"50i2o",green:"pa8",greenyellow:"6senj",grey:"50i2o",honeydew:"9eiuo",hotpink:"9yrp0",indianred:"80gnw",indigo:"2xcoy",ivory:"9zldc",khaki:"9edu4",lavenderblush:"9ziet",lavender:"90c8q",lawngreen:"4vk74",lemonchiffon:"9zkct",lightblue:"6s73a",lightcoral:"9dtog",lightcyan:"8s1rz",lightgoldenrodyellow:"9sjiq",lightgray:"89jo3",lightgreen:"5nkwg",lightgrey:"89jo3",lightpink:"9z6wx",lightsalmon:"9z2ii",lightseagreen:"19xgq",lightskyblue:"5arju",lightslategray:"4nwk9",lightslategrey:"4nwk9",lightsteelblue:"6wau6",lightyellow:"9zlcw",lime:"1edc",limegreen:"1zcxe",linen:"9shk6",magenta:"9y70f",maroon:"4zsow",mediumaquamarine:"40eju",mediumblue:"5p",mediumorchid:"79qkz",mediumpurple:"5r3rv",mediumseagreen:"2d9ip",mediumslateblue:"4tcku",mediumspringgreen:"1di2",mediumturquoise:"2uabw",mediumvioletred:"7rn9h",midnightblue:"z980",mintcream:"9ljp6",mistyrose:"9zg0x",moccasin:"9zfzp",navajowhite:"9zest",navy:"3k",oldlace:"9wq92",olive:"50hz4",olivedrab:"472ub",orange:"9z3eo",orangered:"9ykg0",orchid:"8iu3a",palegoldenrod:"9bl4a",palegreen:"5yw0o",paleturquoise:"6v4ku",palevioletred:"8k8lv",papayawhip:"9zi6t",peachpuff:"9ze0p",peru:"80oqn",pink:"9z8wb",plum:"8nba5",powderblue:"6wgdi",purple:"4zssg",rebeccapurple:"3zk49",red:"9y6tc",rosybrown:"7cv4f",royalblue:"2jvtt",saddlebrown:"5fmkz",salmon:"9rvci",sandybrown:"9jn1c",seagreen:"1tdnb",seashell:"9zje6",sienna:"6973h",silver:"7ir40",skyblue:"5arjf",slateblue:"45e4t",slategray:"4e100",slategrey:"4e100",snow:"9zke2",springgreen:"1egv",steelblue:"2r1kk",tan:"87yx8",teal:"pds",thistle:"8ggk8",tomato:"9yqfb",turquoise:"2j4r4",violet:"9b10u",wheat:"9ld4j",white:"9zldr",whitesmoke:"9lhpx",yellow:"9zl6o",yellowgreen:"61fzm"},q=Math.round;function ne(e,t){const r=e.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],n=r.map(a=>parseFloat(a));for(let a=0;a<3;a+=1)n[a]=t(n[a]||0,r[a]||"",a);return r[3]?n[3]=r[3].includes("%")?n[3]/100:n[3]:n[3]=1,n}const Se=(e,t,r)=>r===0?e:e/100;function W(e,t){const r=t||255;return e>r?r:e<0?0:e}class U{isValid=!0;r=0;g=0;b=0;a=1;_h;_hsl_s;_hsv_s;_l;_v;_max;_min;_brightness;constructor(t){function r(n){return n[0]in t&&n[1]in t&&n[2]in t}if(t)if(typeof t=="string"){let a=function(i){return n.startsWith(i)};const n=t.trim();if(/^#?[A-F\d]{3,8}$/i.test(n))this.fromHexString(n);else if(a("rgb"))this.fromRgbString(n);else if(a("hsl"))this.fromHslString(n);else if(a("hsv")||a("hsb"))this.fromHsvString(n);else{const i=nt[n.toLowerCase()];i&&this.fromHexString(parseInt(i,36).toString(16).padStart(6,"0"))}}else if(t instanceof U)this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this._h=t._h,this._hsl_s=t._hsl_s,this._hsv_s=t._hsv_s,this._l=t._l,this._v=t._v;else if(r("rgb"))this.r=W(t.r),this.g=W(t.g),this.b=W(t.b),this.a=typeof t.a=="number"?W(t.a,1):1;else if(r("hsl"))this.fromHsl(t);else if(r("hsv"))this.fromHsv(t);else throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(t))}setR(t){return this._sc("r",t)}setG(t){return this._sc("g",t)}setB(t){return this._sc("b",t)}setA(t){return this._sc("a",t,1)}setHue(t){const r=this.toHsv();return r.h=t,this._c(r)}getLuminance(){function t(i){const c=i/255;return c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4)}const r=t(this.r),n=t(this.g),a=t(this.b);return .2126*r+.7152*n+.0722*a}getHue(){if(typeof this._h>"u"){const t=this.getMax()-this.getMin();t===0?this._h=0:this._h=q(60*(this.r===this.getMax()?(this.g-this.b)/t+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/t+2:(this.r-this.g)/t+4))}return this._h}getSaturation(){return this.getHSVSaturation()}getHSVSaturation(){if(typeof this._hsv_s>"u"){const t=this.getMax()-this.getMin();t===0?this._hsv_s=0:this._hsv_s=t/this.getMax()}return this._hsv_s}getHSLSaturation(){if(typeof this._hsl_s>"u"){const t=this.getMax()-this.getMin();if(t===0)this._hsl_s=0;else{const r=this.getLightness();this._hsl_s=t/255/(1-Math.abs(2*r-1))}}return this._hsl_s}getLightness(){return typeof this._l>"u"&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return typeof this._v>"u"&&(this._v=this.getMax()/255),this._v}getBrightness(){return typeof this._brightness>"u"&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(t=10){const r=this.getHue(),n=this.getSaturation();let a=this.getLightness()-t/100;return a<0&&(a=0),this._c({h:r,s:n,l:a,a:this.a})}lighten(t=10){const r=this.getHue(),n=this.getSaturation();let a=this.getLightness()+t/100;return a>1&&(a=1),this._c({h:r,s:n,l:a,a:this.a})}mix(t,r=50){const n=this._c(t),a=r/100,i=d=>(n[d]-this[d])*a+this[d],c={r:q(i("r")),g:q(i("g")),b:q(i("b")),a:q(i("a")*100)/100};return this._c(c)}tint(t=10){return this.mix({r:255,g:255,b:255,a:1},t)}shade(t=10){return this.mix({r:0,g:0,b:0,a:1},t)}onBackground(t){const r=this._c(t),n=this.a+r.a*(1-this.a),a=i=>q((this[i]*this.a+r[i]*r.a*(1-this.a))/n);return this._c({r:a("r"),g:a("g"),b:a("b"),a:n})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(t){return this.r===t.r&&this.g===t.g&&this.b===t.b&&this.a===t.a}clone(){return this._c(this)}toHexString(){let t="#";const r=(this.r||0).toString(16);t+=r.length===2?r:"0"+r;const n=(this.g||0).toString(16);t+=n.length===2?n:"0"+n;const a=(this.b||0).toString(16);if(t+=a.length===2?a:"0"+a,typeof this.a=="number"&&this.a>=0&&this.a<1){const i=q(this.a*255).toString(16);t+=i.length===2?i:"0"+i}return t}toHsl(){return{h:this.getHue(),s:this.getHSLSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const t=this.getHue(),r=q(this.getHSLSaturation()*100),n=q(this.getLightness()*100);return this.a!==1?`hsla(${t},${r}%,${n}%,${this.a})`:`hsl(${t},${r}%,${n}%)`}toHsv(){return{h:this.getHue(),s:this.getHSVSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a!==1?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(t,r,n){const a=this.clone();return a[t]=W(r,n),a}_c(t){return new this.constructor(t)}getMax(){return typeof this._max>"u"&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return typeof this._min>"u"&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(t){const r=t.replace("#","");function n(a,i){return parseInt(r[a]+r[i||a],16)}r.length<6?(this.r=n(0),this.g=n(1),this.b=n(2),this.a=r[3]?n(3)/255:1):(this.r=n(0,1),this.g=n(2,3),this.b=n(4,5),this.a=r[6]?n(6,7)/255:1)}fromHsl({h:t,s:r,l:n,a}){const i=(t%360+360)%360;if(this._h=i,this._hsl_s=r,this._l=n,this.a=typeof a=="number"?a:1,r<=0){const b=q(n*255);this.r=b,this.g=b,this.b=b;return}let c=0,d=0,p=0;const f=i/60,h=(1-Math.abs(2*n-1))*r,y=h*(1-Math.abs(f%2-1));f>=0&&f<1?(c=h,d=y):f>=1&&f<2?(c=y,d=h):f>=2&&f<3?(d=h,p=y):f>=3&&f<4?(d=y,p=h):f>=4&&f<5?(c=y,p=h):f>=5&&f<6&&(c=h,p=y);const v=n-h/2;this.r=q((c+v)*255),this.g=q((d+v)*255),this.b=q((p+v)*255)}fromHsv({h:t,s:r,v:n,a}){const i=(t%360+360)%360;this._h=i,this._hsv_s=r,this._v=n,this.a=typeof a=="number"?a:1;const c=q(n*255);if(this.r=c,this.g=c,this.b=c,r<=0)return;const d=i/60,p=Math.floor(d),f=d-p,h=q(n*(1-r)*255),y=q(n*(1-r*f)*255),v=q(n*(1-r*(1-f))*255);switch(p){case 0:this.g=v,this.b=h;break;case 1:this.r=y,this.b=h;break;case 2:this.r=h,this.b=v;break;case 3:this.r=h,this.g=y;break;case 4:this.r=v,this.g=h;break;default:this.g=h,this.b=y;break}}fromHsvString(t){const r=ne(t,Se);this.fromHsv({h:r[0],s:r[1],v:r[2],a:r[3]})}fromHslString(t){const r=ne(t,Se);this.fromHsl({h:r[0],s:r[1],l:r[2],a:r[3]})}fromRgbString(t){const r=ne(t,(n,a)=>a.includes("%")?q(n/100*255):n);this.r=r[0],this.g=r[1],this.b=r[2],this.a=r[3]}}const R=2,we=.16,st=.05,at=.05,ot=.15,ve=5,Te=4,it=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function _e(e,t,r){let n;return Math.round(e.h)>=60&&Math.round(e.h)<=240?n=r?Math.round(e.h)-R*t:Math.round(e.h)+R*t:n=r?Math.round(e.h)+R*t:Math.round(e.h)-R*t,n<0?n+=360:n>=360&&(n-=360),n}function Ie(e,t,r){if(e.h===0&&e.s===0)return e.s;let n;return r?n=e.s-we*t:t===Te?n=e.s+we:n=e.s+st*t,n>1&&(n=1),r&&t===ve&&n>.1&&(n=.1),n<.06&&(n=.06),Math.round(n*100)/100}function xe(e,t,r){let n;return r?n=e.v+at*t:n=e.v-ot*t,n=Math.max(0,Math.min(1,n)),Math.round(n*100)/100}function lt(e,t={}){const r=[],n=new U(e),a=n.toHsv();for(let i=ve;i>0;i-=1){const c=new U({h:_e(a,i,!0),s:Ie(a,i,!0),v:xe(a,i,!0)});r.push(c)}r.push(n);for(let i=1;i<=Te;i+=1){const c=new U({h:_e(a,i),s:Ie(a,i),v:xe(a,i)});r.push(c)}return t.theme==="dark"?it.map(({index:i,amount:c})=>new U(t.backgroundColor||"#141414").mix(r[i],c).toHexString()):r.map(i=>i.toHexString())}const se=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];se.primary=se[5];function ct(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function ut(e,t){if(!e)return!1;if(e.contains)return e.contains(t);let r=t;for(;r;){if(r===e)return!0;r=r.parentNode}return!1}const Ce="data-rc-order",ke="data-rc-priority",ht="rc-util-key",ae=new Map;function Fe({mark:e}={}){return e?e.startsWith("data-")?e:`data-${e}`:ht}function oe(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function dt(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function ie(e){return Array.from((ae.get(e)||e).children).filter(t=>t.tagName==="STYLE")}function Ne(e,t={}){if(!ct())return null;const{csp:r,prepend:n,priority:a=0}=t,i=dt(n),c=i==="prependQueue",d=document.createElement("style");d.setAttribute(Ce,i),c&&a&&d.setAttribute(ke,`${a}`),r?.nonce&&(d.nonce=r?.nonce),d.innerHTML=e;const p=oe(t),{firstChild:f}=p;if(n){if(c){const h=(t.styles||ie(p)).filter(y=>{if(!["prepend","prependQueue"].includes(y.getAttribute(Ce)))return!1;const v=Number(y.getAttribute(ke)||0);return a>=v});if(h.length)return p.insertBefore(d,h[h.length-1].nextSibling),d}p.insertBefore(d,f)}else p.appendChild(d);return d}function gt(e,t={}){let{styles:r}=t;return r||=ie(oe(t)),r.find(n=>n.getAttribute(Fe(t))===e)}function ft(e,t){const r=ae.get(e);if(!r||!ut(document,r)){const n=Ne("",t),{parentNode:a}=n;ae.set(e,a),e.removeChild(n)}}function mt(e,t,r={}){const n=oe(r),a=ie(n),i={...r,styles:a};ft(n,i);const c=gt(t,i);if(c)return i.csp?.nonce&&c.nonce!==i.csp?.nonce&&(c.nonce=i.csp?.nonce),c.innerHTML!==e&&(c.innerHTML=e),c;const d=Ne(e,i);return d.setAttribute(Fe(i),t),d}function Me(e){return e?.getRootNode?.()}function pt(e){return Me(e)instanceof ShadowRoot}function yt(e){return pt(e)?Me(e):null}let le={};const bt=e=>{};function St(e,t){}function wt(e,t){}function vt(){le={}}function qe(e,t,r){!t&&!le[r]&&(e(!1,r),le[r]=!0)}function ee(e,t){qe(St,e,t)}function Tt(e,t){qe(wt,e,t)}ee.preMessage=bt,ee.resetWarned=vt,ee.noteOnce=Tt;function _t(e){return e.replace(/-(.)/g,(t,r)=>r.toUpperCase())}function It(e,t){ee(e,`[@ant-design/icons] ${t}`)}function ze(e){return typeof e=="object"&&typeof e.name=="string"&&typeof e.theme=="string"&&(typeof e.icon=="object"||typeof e.icon=="function")}function Oe(e={}){return Object.keys(e).reduce((t,r)=>{const n=e[r];return r==="class"?(t.className=n,delete t.class):(delete t[r],t[_t(r)]=n),t},{})}function ce(e,t,r){return r?g.createElement(e.tag,{key:t,...Oe(e.attrs),...r},(e.children||[]).map((n,a)=>ce(n,`${t}-${e.tag}-${a}`))):g.createElement(e.tag,{key:t,...Oe(e.attrs)},(e.children||[]).map((n,a)=>ce(n,`${t}-${e.tag}-${a}`)))}function $e(e){return lt(e)[0]}function De(e){return e?Array.isArray(e)?e:[e]:[]}const xt=`
|
|
3
3
|
.anticon {
|
|
4
4
|
display: inline-flex;
|
|
5
5
|
align-items: center;
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
transform: rotate(360deg);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
`,Ct=e=>{const{csp:t,prefixCls:r,layer:n}=g.useContext(
|
|
58
|
+
`,Ct=e=>{const{csp:t,prefixCls:r,layer:n}=g.useContext(ye);let a=xt;r&&(a=a.replace(/anticon/g,r)),n&&(a=`@layer ${n} {
|
|
59
59
|
${a}
|
|
60
|
-
}`),g.useEffect(()=>{const i=e.current,c=bt(i);mt(a,"@ant-design-icons",{prepend:!n,csp:t,attachTo:c})},[])},G={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function kt({primaryColor:e,secondaryColor:t}){G.primaryColor=e,G.secondaryColor=t||$e(e),G.calculated=!!t}function Ft(){return{...G}}const K=e=>{const{icon:t,className:r,onClick:n,style:a,primaryColor:i,secondaryColor:c,...d}=e,p=P.useRef(null);let f=G;if(i&&(f={primaryColor:i,secondaryColor:c||$e(i)}),Ct(p),It(ze(t),`icon should be icon definiton, but got ${t}`),!ze(t))return null;let h=t;return h&&typeof h.icon=="function"&&(h={...h,icon:h.icon(f.primaryColor,f.secondaryColor)}),ce(h.icon,`svg-${h.name}`,{className:r,onClick:n,style:a,"data-icon":h.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",...d,ref:p})};K.displayName="IconReact",K.getTwoToneColors=Ft,K.setTwoToneColors=kt;function Ee(e){const[t,r]=De(e);return K.setTwoToneColors({primaryColor:t,secondaryColor:r})}function Nt(){const e=K.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}function ue(){return ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ue.apply(this,arguments)}Ee(se.primary);const Z=P.forwardRef((e,t)=>{const{className:r,icon:n,spin:a,rotate:i,tabIndex:c,onClick:d,twoToneColor:p,...f}=e,{prefixCls:h="anticon",rootClassName:b}=P.useContext(be),v=rt(b,h,{[`${h}-${n.name}`]:!!n.name,[`${h}-spin`]:!!a||n.name==="loading"},r);let y=c;y===void 0&&d&&(y=-1);const F=i?{msTransform:`rotate(${i}deg)`,transform:`rotate(${i}deg)`}:void 0,[k,u]=De(p);return P.createElement("span",ue({role:"img","aria-label":n.name},f,{ref:t,tabIndex:y,onClick:d,className:v}),P.createElement(K,{icon:n,primaryColor:k,secondaryColor:u,style:F}))});Z.getTwoToneColor=Nt,Z.setTwoToneColor=Ee;var Mt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"};function he(){return he=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},he.apply(this,arguments)}const qt=(e,t)=>P.createElement(Z,he({},e,{ref:t,icon:Mt})),He=P.forwardRef(qt);var zt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM544 472c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v108H372c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h108v108c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V644h108c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V472z"}}]},name:"file-add",theme:"outlined"};function de(){return de=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},de.apply(this,arguments)}const Ot=(e,t)=>P.createElement(Z,de({},e,{ref:t,icon:zt})),$t=P.forwardRef(Ot);var Dt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"};function ge(){return ge=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ge.apply(this,arguments)}const Et=(e,t)=>P.createElement(Z,ge({},e,{ref:t,icon:Dt})),Ht=P.forwardRef(Et),Le={get:Lt,getByIdOrSlug:Pt,getMedias:At,download:jt,downloadFromUrl:Vt};function Lt(e){return x.postData("/api/media/search",e,!0)}function Pt(e){return x.getData(`/api/media/${e}`,!0)}function At(e){return x.postData("/api/media/medias",e,!0)}function jt(e){return x.postData("/api/media/download",e)}function Vt(e){return x.postData("/api/media/download/url",e,!0)}const Pe={success:Bt,error:Ut};function Bt(e){l.notification.success({message:Ae[Math.floor(Math.random()*Ae.length)],description:e,duration:3})}function Ut(e){l.notification.error({message:je[Math.floor(Math.random()*je.length)],description:e,duration:3})}let Ae=["Success","Good Job","Excellent","Way to go!","Nice!","That'll do!","That worked!","Ok","Bingo"],je=["Bummer","Something didn't work","Error","Nope","Shucks"];const{Dragger:Kt}=l.Upload;function Yt(e){const t=e.size/1024/1024<200;return t||Pe.error("File must smaller than 200MB"),t}function Jt({onUploaded:e,accept:t,addToMediaLibrary:r,contentId:n,showUploadList:a=!0,multiple:i=!1}){const c=typeof globalThis<"u"?globalThis.process?.env:void 0,d=typeof window<"u",p=d&&typeof localStorage<"u"?localStorage.getItem("gatsbyUser"):null,f=p!==null&&d?JSON.parse(window.atob(p)):null,h=y=>{y.file.status!=="uploading"&&(y.file.status==="done"?e&&e(y.file.response):y.file.status==="error"&&Pe.error(`${y.file.name} file upload failed.`))},b={Authorization:f?.token?"Bearer "+f.token:"",AppKey:c?.STORM_APPKEY};let v=`https://${c?.REACT_APP_WEBAPI_URL_FULL_ACCESS}/api/media/files`;return r&&(v+="?addToMediaLibrary=true",n&&(v+=`&contentId=${n}`)),s.jsx("div",{children:s.jsx(Kt,{name:"files",accept:t,multiple:i,beforeUpload:Yt,action:v,headers:b,showUploadList:a,onChange:h,children:s.jsxs("div",{className:"p-5 m-5",children:[s.jsx("p",{className:"ant-upload-drag-icon",children:s.jsx($t,{})}),s.jsx("p",{className:"ant-upload-text",children:"Click or drag files to this area to upload"}),t!==void 0&&s.jsx("p",{className:"ant-upload-hint",children:`must be only ${t} files`})]})})})}const fe={image:Wt,currency:Gt,numWithComma:Zt,phone:Qt,timeToRead:Xt,timeDiffMinutes:Rt,startEndDateTime:er,dateFormat:tr,getDateFromString:rr};function Wt(e,t){return e?e.indexOf("?")>-1?`${e}&${t}`:`${e}?${t}`:""}function Gt(e){var t=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"});return t.format(e)}function Zt(e){return e.toLocaleString()}function Qt(e){return e=e.toString().replace(/[^0-9]/g,""),e.length===10?e.substring(0,3)+"."+e.substring(3,6)+"."+e.substring(6):e}function Xt(e){return e?Math.ceil(e.split(" ").length/210):0}function Rt(e,t){console.log(e,t);const r=e&&typeof e=="object"?e:Date.parse(e.replace(" ","T")),n=t&&typeof t=="object"?t:Date.parse(t.replace(" ","T")),a=Math.abs(n-r);return Math.floor(a/1e3/60)}function er(e,t="",r=!0){const n={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric"},a={hour:"numeric",minute:"numeric",timeZoneName:"short"},i={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",timeZoneName:"short"},c=new Intl.DateTimeFormat("en",n),d=new Intl.DateTimeFormat("en",a),p=new Intl.DateTimeFormat("en",i);if(!e)return"";const f=e&&typeof e=="object"?e:Date.parse(e.replace(" ","T")),h=t&&typeof t=="object"?t:Date.parse(t.replace(" ","T"));return!Number.isNaN(f)&&!Number.isNaN(h)?s.jsxs("span",{children:[c.format(f)," - ",d.format(h),r&&s.jsx("br",{})]}):Number.isNaN(f)?Number.isNaN(h)?"":s.jsxs("span",{children:[" ",p.format(h),r&&s.jsx("br",{})]}):s.jsxs("span",{children:[" ",p.format(f),r&&s.jsx("br",{})]})}function tr(e,t="medium",r=!1){const n={weekday:"long",year:"numeric",month:"long",day:"numeric"},a={year:"numeric",month:"long",day:"numeric"},i={year:"numeric",month:"short",day:"numeric"},c={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",timeZoneName:"short"},d={hour:"numeric",minute:"numeric",timeZoneName:"short"},p=new Intl.DateTimeFormat("en",n),f=new Intl.DateTimeFormat("en",i),h=new Intl.DateTimeFormat("en",c),b=new Intl.DateTimeFormat("en",a),v=new Intl.DateTimeFormat("en",d);if(!e)return"";const y=e&&typeof e=="object"?e:Date.parse(e.replace(" ","T"));return Number.isNaN(y)?"":s.jsxs(s.Fragment,{children:[t==="long"&&p.format(y),t==="short"&&f.format(y),t==="medium"&&b.format(y),t==="datetime"&&h.format(y),t==="time"&&v.format(y),r&&s.jsx("br",{})]})}function rr(e){if(!e)return null;const t=Date.parse(e.replace(" ","T"));return Number.isNaN(t)?null:t}const{Search:nr}=l.Input;function sr({fileTypes:e,contentId:t,isMany:r,onSuccess:n,hideScopeFilter:a=!0,showResizer:i=!1}){const[c,d]=g.useState(!1),[p,f]=g.useState([]),[h,b]=g.useState([]),[v,y]=g.useState(0),[F,k]=g.useState([]),[u,m]=g.useState(""),[N,C]=g.useState("content"),[w,O]=g.useState(a?1:0),[V,Q]=g.useState({id:"createdOn",desc:!0}),[L,$]=g.useState({current:1,pageSize:20,total:0,position:["topRight","bottomRight"],showSizeChanger:!0}),[M,z]=g.useState([]),[_,I]=g.useState(null),[E,D]=g.useState(null);g.useEffect(()=>{d(!1);let T={keyword:u,mediaTypes:F,orderBy:V,pagination:{pageNum:L.current,pageSize:L.pageSize}};T.mediaPurposes=[1],T.contentId=t,Le.get(T).then(S=>{const H={...L};H.total=S.totalRecords,f(S.media),$(H)}).catch(S=>console.log(S)).finally(()=>{d(!1)})},[v,F,N]);const A=(T,S,H)=>{let te={...V};const B={...L};B.pageSize!==T.pageSize?(B.pageSize=T.pageSize,B.current=1):B.current=T.current,H.field&&(te={id:H.field,desc:H.order==="descend"}),$(B),Q(te),y(v+1)},_r=(T,S)=>{let H=T.filter(te=>p.find(B=>B.id===te));z(H)},Ir=T=>{const S={...L};S.current=1,$(S),k(T)},xr=T=>{const S={...L};S.current=1,$(S),C(T.target.value)},me=T=>{if(n){if(T){i&&T.mediaType===0?I(T):n([T]);return}n(p.filter(S=>M.find(H=>H===S.id))),z([])}},Cr=T=>{let S=h.concat(T);b(S)};return s.jsx(l.Tabs,{items:[{label:"Search",key:"1",children:s.jsxs(s.Fragment,{children:[s.jsxs(l.Row,{gutter:[16,16],className:"mb-3",children:[s.jsx(l.Col,{xs:6,children:s.jsxs(l.Select,{mode:"multiple",placeholder:"Select Type",value:F,onChange:Ir,className:"mr-2 w-100",children:[s.jsx(l.Select.Option,{value:0,children:"Image"}),s.jsx(l.Select.Option,{value:1,children:"File"}),s.jsx(l.Select.Option,{value:2,children:"Video"}),s.jsx(l.Select.Option,{value:3,children:"Audio"}),s.jsx(l.Select.Option,{value:4,children:"Embedded"})]})}),s.jsx(l.Col,{xs:6,children:!a&&s.jsxs(l.Radio.Group,{buttonStyle:"solid",value:N,onChange:xr,children:[s.jsx(l.Radio.Button,{value:"global",children:"Global"}),s.jsx(l.Radio.Button,{value:"both",children:"Both"}),s.jsx(l.Radio.Button,{value:"content",children:"Content"})]})}),s.jsx(l.Col,{xs:12,children:s.jsx(nr,{id:"keyword",placeholder:"search",onSearch:()=>y(v+1),enterButton:!0,className:"w-100",value:u,onChange:T=>m(T.target.value),loading:c})}),r&&s.jsx(l.Col,{xs:24,children:s.jsx(l.Button,{type:"primary",className:"mr-2",disabled:M.length===0,onClick:()=>me(),children:"Select"})})]}),s.jsx(l.Table,{dataSource:p,rowKey:T=>T.id,pagination:L,loading:c,size:"middle",className:"clear-both pointer",onChange:A,rowSelection:r&&{type:"checkbox",onChange:_r,selectedRowKeys:M,hideSelectAll:!0},onRow:(T,S)=>({onClick:H=>{!r&&me(T)}}),columns:[{title:"",dataIndex:"thumbnail",width:"6%",responsive:["lg"],render:(T,S)=>s.jsx("img",{src:S.thumbnail,alt:"Thumbnail",className:"img-fluid avatar-50"})},{title:"Title",dataIndex:"title",sorter:!0},{title:"Type",dataIndex:"lastName",sorter:!0,render:(T,S)=>s.jsxs("span",{children:[S.mediaType===0&&s.jsx(l.Tag,{color:"blue",children:"Image"}),S.mediaType===1&&s.jsx(l.Tag,{color:"gold",children:"File"}),S.mediaType===2&&s.jsx(l.Tag,{color:"cyan",children:"Video"}),S.mediaType===3&&s.jsx(l.Tag,{color:"magenta",children:"Audio"}),S.mediaType===4&&s.jsx(l.Tag,{color:"volcano",children:"Embedded"})]})},{title:"Created",dataIndex:"createdOn",sorter:!0,responsive:["xl"],render:(T,S)=>s.jsx("span",{children:fe.dateFormat(S.createdOn)})},{title:"Info",responsive:["lg"],align:"center",render:(T,S)=>s.jsx(l.Button,{type:"secondary",onClick:H=>{H.stopPropagation(),D(S)},children:s.jsx(Ht,{})})}]})]})},{label:"Upload",key:"2",children:s.jsxs(s.Fragment,{children:[s.jsx(Jt,{onUploaded:Cr,multiple:!0,showUploadList:!1,addToMediaLibrary:!0,contentId:w===1?t:0}),s.jsx(l.Table,{dataSource:h,rowKey:T=>T.id,pagination:!1,loading:c,size:"middle",className:"clear-both pointer",onRow:(T,S)=>({onClick:H=>{me(T)}}),columns:[{title:"",dataIndex:"thumbnail",width:"6%",responsive:["md"],render:(T,S)=>s.jsx("img",{src:S.url,alt:"Thumbnail",className:"img-fluid"})},{title:"Title",dataIndex:"title",sorter:!0},{title:"Type",dataIndex:"lastName",sorter:!0,render:(T,S)=>s.jsxs("span",{children:[S.mediaType===0&&s.jsx(l.Tag,{color:"blue",children:"Image"}),S.mediaType===1&&s.jsx(l.Tag,{color:"gold",children:"File"}),S.mediaType===2&&s.jsx(l.Tag,{color:"cyan",children:"Video"}),S.mediaType===3&&s.jsx(l.Tag,{color:"magenta",children:"Audio"}),S.mediaType===4&&s.jsx(l.Tag,{color:"volcano",children:"Embedded"})]})},{title:"Created",dataIndex:"createdOn",sorter:!0,responsive:["xl"],render:(T,S)=>s.jsx("span",{children:fe.dateFormat(S.createdOn)})}]})]})}]})}const ar=({slug:e,value:t,label:r,opts:n,form:a,onChange:i,media:c,debug:d,isRequired:p,contentId:f,className:h})=>{n=n||{uploadLimit:"1",fileTypes:null};const[b,v]=g.useState(c||[]),[y,F]=g.useState(!1),k=n.uploadLimit!=="1";if(!e)throw Error("MediaInput property: slug required");g.useEffect(()=>{if(c?.length>0?v(c):v([]),t&&!c){const C=t.split(",").filter(w=>!isNaN(w)).map(w=>parseInt(w,10));Le.getMedias({ids:C}).then(w=>{v(w)})}},[c]);const u=C=>{const w=b.concat(C);v(w),N(w),F(!1)},m=C=>{var w=b.findIndex(O=>O.id===C.id);if(w>-1){let O=[...b];O.splice(w,1),v(O),N(O)}},N=C=>{const w=C.map((O,V)=>O.id).join(",");a.setFieldsValue({[e]:w}),i&&i(e,w)};return s.jsxs(l.Form.Item,{label:r,className:h,children:[s.jsxs("div",{className:"text-center",children:[(k||!k&&b.length===0)&&s.jsx(l.Button,{type:"primary",className:"my-2",onClick:()=>F(!0),children:"Select"}),b.length>0&&s.jsx(l.Table,{dataSource:b,rowKey:C=>C.id,pagination:!1,size:"middle",className:"clear-both mt-3",columns:[{title:"",dataIndex:"url",render:(C,w)=>s.jsxs("span",{children:[w.mediaType===0&&s.jsx("img",{src:w.url,alt:"Thumbnail",className:"img-fluid avatar-50"}),w.mediaType===1&&s.jsx("img",{src:w.thumbnail,alt:"Thumbnail",className:"img-fluid avatar-50"}),w.mediaType===2&&s.jsx(s.Fragment,{}),w.mediaType===3&&s.jsx(s.Fragment,{}),w.mediaType===4&&s.jsx(s.Fragment,{})]})},{title:"Title",dataIndex:"title",render:(C,w)=>s.jsxs("span",{children:[w.title,w.credit?.length>0&&s.jsx("div",{dangerouslySetInnerHTML:{__html:w.credit},className:"credit"})]})},{title:"Type",dataIndex:"lastName",sorter:!0,render:(C,w)=>s.jsxs("span",{children:[w.mediaType===0&&s.jsx(l.Tag,{color:"blue",children:"Image"}),w.mediaType===1&&s.jsx(l.Tag,{color:"gold",children:"File"}),w.mediaType===2&&s.jsx(l.Tag,{color:"cyan",children:"Video"}),w.mediaType===3&&s.jsx(l.Tag,{color:"magenta",children:"Audio"}),w.mediaType===4&&s.jsx(l.Tag,{color:"volcano",children:"Embedded"})]})},{title:"",width:"50px",render:(C,w)=>s.jsx(l.Popconfirm,{title:"Are you sure you want to delete this?",onConfirm:()=>m(w),okText:"Yes",cancelText:"No",children:s.jsx(l.Button,{type:"primary",danger:!0,children:s.jsx(He,{})})})}]})]}),s.jsx(l.Form.Item,{name:e,initialValue:t,hidden:!d,rules:[{required:p,message:"Required"}],children:s.jsx(l.Input,{})}),s.jsx(l.Drawer,{open:y,title:"Search Media",height:"85%",placement:"bottom",onClose:()=>F(!1),children:s.jsx(sr,{mediaTypes:n.referenceTypes,isMany:k,onSuccess:u,hideScopeFilter:!0,contentId:f})})]})},or={siteSearch:ir,get:lr,search:cr,getForm:ur,getUserContent:hr,getByIdOrSlug:dr,getContentTypeById:gr};function ir(e){return x.postData("/api/content/sitesearch",e,!1)}function lr(e){return x.getData(`/api/content/${e}`,!1)}function cr(e){return x.postData("/api/content/search",e,!0)}function ur(e,t){return x.getData(`/api/content/form/${e}/${t}`,!1)}function hr(e,t){return x.getData(`/api/content/usercontent/?status=${t}&page=${e}`,!0)}function dr(e){return x.getData(`/api/content/${e}`,!0)}function gr(e,t){let r=`/api/content/contenttype/${e}`;return t&&(r+=`/${t}`),x.getData(r,!0)}const{Search:fr}=l.Input;function mr({contentTypes:e,isMany:t,isEcommerce:r,onSuccess:n,showDetails:a=!0,isPreviewable:i=!1,initialStatus:c=[0]}){const[d,p]=g.useState(!1),[f,h]=g.useState([]),[b,v]=g.useState(0),[y,F]=g.useState(""),[k,u]=g.useState({id:"title",desc:!1}),[m,N]=g.useState({current:1,pageSize:20,total:0,position:["topRight","bottomRight"],showSizeChanger:!0}),[C,w]=g.useState(c),[O,V]=g.useState([]);g.useEffect(()=>{p(!1);let _={keyword:y,contentType:e||[],isPreviewable:i,status:C,orderBy:k,pagination:{pageNum:m.current,pageSize:m.pageSize},isEcommerce:r};or.search(_).then(I=>{const E={...m};E.total=I.totalRecords,h(I.content),N(E)}).catch(I=>console.log(I)).finally(()=>{p(!1)})},[b]);const Q=(_,I,E)=>{let D={...k};const A={...m};A.pageSize!==_.pageSize?(A.pageSize=_.pageSize,A.current=1):A.current=_.current,E.field&&(D={id:E.field,desc:E.order==="descend"}),N(A),u(D),v(b+1)},L=()=>{const _={...m};_.current=1,N(_),v(b+1)},$=(_,I)=>{let E=_.filter(D=>f.find(A=>A.id===D));V(E)},M=_=>{if(n){if(_){n([_]);return}n(f.filter(I=>O.find(E=>E===I.id))),V([])}};let z=[{title:"Title",dataIndex:"title",sorter:!0}];return a&&(z.push({title:"Type",dataIndex:"contentType",sorter:!0}),z.push({title:"Status",render:(_,I)=>s.jsxs("span",{children:[I.status===0&&s.jsx(l.Tag,{color:"blue",children:"Published"}),I.status===1&&s.jsx(l.Tag,{color:"gold",children:"Draft"}),I.status===2&&s.jsx(l.Tag,{color:"magenta",children:"Trashed"}),I.status===3&&s.jsx(l.Tag,{color:"purple",children:"Published with Pending Updates"})]})})),s.jsxs("div",{children:[s.jsxs(l.Row,{gutter:[16,16],className:"mb-3",children:[s.jsx(l.Col,{xs:12}),s.jsx(l.Col,{xs:12,children:s.jsx(fr,{id:"keyword",placeholder:"search",onSearch:L,enterButton:!0,className:"w-100",value:y,onChange:_=>F(_.target.value),loading:d})}),t&&s.jsx(l.Col,{xs:24,children:s.jsx(l.Button,{type:"primary",className:"mr-2",disabled:O.length===0,onClick:()=>M(),children:"Select"})})]}),s.jsx(l.Table,{dataSource:f,rowKey:_=>_.id,pagination:m,loading:d,size:"middle",className:"clear-both pointer",onChange:Q,expandable:{expandedRowRender:_=>s.jsx("table",{children:s.jsx("tbody",{children:_.meta.values.filter(I=>I.label.toLowerCase().indexOf("url")>-1).map((I,E)=>{let D=I.fullValue??I.value;return D=D?.indexOf("Z")>-1&&X(D).isValid()?fe.dateFormat(D):D,D=D?.replace(/(<([^>]+)>)/gi,"",""),s.jsxs("tr",{children:[s.jsx("td",{style:{verticalAlign:"top",minWidth:150},children:I.label}),s.jsx("td",{children:s.jsx("span",{children:D||""})})]},E)})})})},rowSelection:t&&{type:"checkbox",onChange:$,selectedRowKeys:O,hideSelectAll:!0},onRow:(_,I)=>({onClick:E=>{!t&&M(_)}}),columns:z})]})}const pr=({slug:e,value:t,label:r,opts:n,form:a,onChange:i,references:c,debug:d,isRequired:p,values:f,error:h,errors:b,className:v,placeholder:y,disabled:F})=>{const[k,u]=g.useState(c||[]),[m,N]=g.useState(!1),[C,w]=g.useState(null),O=n.referenceAmount!=="1";if(!e)throw Error("ReferenceInput property: slug required");!t&&f&&f[e]&&(t=f[e]),!h&&b&&b[e]&&(h=b[e]);const V=$=>{const M=$.filter(_=>!k.some(I=>_.id===I.id)),z=k.concat(M);u(z),L(z),N(!1)},Q=$=>{var M=k.findIndex(z=>z.id===$.id);if(M>-1){let z=[...k];z.splice(M,1),u(z),L(z)}},L=$=>{const M=$.map((z,_)=>z.id).join(",");a.setFieldsValue({[e]:M}),i&&i(e,M)};return g.useEffect(()=>{u(c||[])},[c]),g.useEffect(()=>{C&&setShowEdit(!0)},[C]),s.jsxs(l.Form.Item,{label:r,className:v,children:[s.jsxs("div",{className:"text-center",children:[(O||!O&&k.length===0)&&s.jsx(s.Fragment,{children:s.jsx(l.Button,{type:"primary",className:"my-2",onClick:()=>N(!0),children:"Select"})}),k.length>0&&s.jsx(l.Table,{dataSource:k,rowKey:$=>$.id,pagination:!1,size:"middle",className:"clear-both mt-3",columns:[{title:"Title",dataIndex:"title"},{title:"Type",dataIndex:"contentType"},{title:"Status",render:($,M)=>s.jsxs("span",{children:[M.status===0&&s.jsx(l.Tag,{color:"blue",children:"Published"}),M.status===1&&s.jsx(l.Tag,{color:"gold",children:"Draft"}),M.status===2&&s.jsx(l.Tag,{color:"magenta",children:"Trashed"})]})},{title:"",width:"50px",render:($,M)=>s.jsx(l.Popconfirm,{title:"Are you sure you want to delete this?",onConfirm:()=>Q(M),okText:"Yes",cancelText:"No",children:s.jsx(l.Button,{type:"primary",danger:!0,children:s.jsx(He,{})})})}]})]}),s.jsx(l.Form.Item,{name:e,initialValue:t,hidden:!d,rules:[{required:p,message:"Required"}],children:s.jsx(l.Input,{})}),s.jsx(l.Drawer,{open:m,title:"Search References",height:"90%",placement:"bottom",onClose:()=>N(!1),children:s.jsx(mr,{contentTypes:n.referenceTypes,isMany:O,onSuccess:V})})]})},br={hasJsonStructure:Ve,parseJson:yr};function Ve(e){if(typeof e!="string")return!1;try{const t=JSON.parse(e),r=Object.prototype.toString.call(t);return r==="[object Object]"||r==="[object Array]"}catch{return!1}}function yr(e){return Ve(e)?JSON.parse(e):JSON.parse("{}")}const Sr=(e,t)=>{let{properties:r,loading:n,onSubmit:a,hideSubmit:i,onFieldsChange:c,layout:d,entityId:p,debug:f=!1}=e;const[h]=l.Form.useForm(),b=d==="vertical"?24:4,v=d==="vertical"?24:20,y=d==="vertical"?0:4;g.useImperativeHandle(t,()=>({validate(u){h.validateFields().then(m=>{u([])}).catch(m=>{console.log(m),u(m.errorFields)})}})),g.useEffect(()=>{let u=r.reduce((N,C)=>({...N,[C.slug]:C.value}),{});h.setFieldsValue({...u});const m=new URLSearchParams(window.location.search);m.get("utm_source")&&localStorage.setItem("utm_source",m.get("utm_source")),m.get("utm_medium")&&localStorage.setItem("utm_medium",m.get("utm_medium")),m.get("utm_campaign")&&localStorage.setItem("utm_campaign",m.get("utm_campaign")),m.get("utm_term")&&localStorage.setItem("utm_term",m.get("utm_term")),m.get("utm_content")&&localStorage.setItem("utm_content",m.get("utm_content"))},[r]);const F=u=>{for(let N in u)u[N]=Array.isArray(u[N])?JSON.stringify(u[N]):u[N];let m={};localStorage.getItem("utm_source")&&(m.source=localStorage.getItem("utm_source")),localStorage.getItem("utm_medium")&&(m.medium=localStorage.getItem("utm_medium")),localStorage.getItem("utm_campaign")&&(m.campaign=localStorage.getItem("utm_campaign")),localStorage.getItem("utm_term")&&(m.term=localStorage.getItem("utm_term")),localStorage.getItem("utm_content")&&(m.content=localStorage.getItem("utm_content")),a(u,m)},k=u=>{c&&c(u[0].name[0],u[0].value)};return r.length===0?i?s.jsx(s.Fragment,{}):s.jsx("div",{children:"There are no properties at this time."}):s.jsx("div",{children:s.jsxs(l.Form,{form:h,labelCol:{span:b},wrapperCol:{span:v},onFinish:F,onFieldsChange:k,layout:d,children:[r.map((u,m)=>{switch(u.opts=br.parseJson(u.options),u.fieldType){case 1:return s.jsx(l.Form.Item,{label:u.label,name:u.slug,rules:[{required:u.isRequired,message:"Required"},{type:"email",message:"Email is not valid"}],initialValue:u.value?.replaceAll(`
|
|
61
|
-
`,"\\n"),children:s.jsx(l.Input,{placeholder:u.opts?.placeholder||""})},m);case 2:return s.jsx(l.Form.Item,{label:u.label,name:u.slug,rules:[{required:u.isRequired,message:"Required"},{type:"url",message:"URL is not valid"}],initialValue:u.value,children:s.jsx(l.Input,{placeholder:u.opts?.placeholder||""})},m);case 3:return s.jsx(l.Form.Item,{label:u.label,name:u.slug,rules:[{required:u.isRequired,message:"Required"},{pattern:/^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/,message:"Phone is not valid"}],initialValue:u.value,children:s.jsx(l.Input,{placeholder:u.opts?.placeholder||""})},m);case 4:return s.jsx(l.Form.Item,{label:u.label,name:u.slug,initialValue:u.value,rules:[{required:u.isRequired,message:"Required"}],children:s.jsx(l.Input.Password,{placeholder:u.opts?.placeholder||""})},m);case 5:case 6:return s.jsx(l.Form.Item,{label:u.label,name:u.slug,initialValue:u.value,rules:[{required:u.isRequired,message:"Required"}],children:s.jsx(l.Input.TextArea,{placeholder:u.opts?.placeholder||""})},m);case 7:return u.value=u.value?X(u.value):"",g.createElement(re,{...u,key:m,showTime:!0});case 8:return u.value=u.value?X(u.value):"",g.createElement(re,{...u,key:m});case 9:return u.value=u.value?X(u.value):"",g.createElement(re,{...u,key:m});case 10:return g.createElement(pe,{...u,key:m});case 11:return g.createElement(pe,{...u,key:m,type:"currency"});case 12:return g.createElement(ar,{...u,form:h,onChange:c,key:m,debug:f,contentId:p});case 13:return g.createElement(pr,{...u,form:h,onChange:c,key:m,debug:f});case 14:return s.jsx(s.Fragment,{});case 15:return g.createElement(Re,{...u,key:m});case 16:return g.createElement(Xe,{...u,key:m});case 17:return s.jsx(s.Fragment,{});case 18:return s.jsx(l.Form.Item,{children:s.jsx("div",{dangerouslySetInnerHTML:{__html:u.label}})},m);case 19:return g.createElement(tt,{...u,key:m,debug:f});case 20:return s.jsx(s.Fragment,{});case 21:return s.jsx(s.Fragment,{});case 22:return s.jsx(s.Fragment,{});case 23:return g.createElement(et,{...u,key:m,debug:f});case 24:return s.jsx(l.Form.Item,{label:s.jsx("strong",{className:"mt-3",children:u.label}),name:u.slug,children:s.jsx("hr",{})},m);default:return s.jsx(l.Form.Item,{label:u.label,name:u.slug,initialValue:u.value,rules:[{required:u.isRequired,message:"Required"}],children:s.jsx(l.Input,{placeholder:u.opts?.placeholder||""})},m)}}),!i&&s.jsx(l.Form.Item,{wrapperCol:{span:
|
|
60
|
+
}`),g.useEffect(()=>{const i=e.current,c=yt(i);mt(a,"@ant-design-icons",{prepend:!n,csp:t,attachTo:c})},[])},G={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function kt({primaryColor:e,secondaryColor:t}){G.primaryColor=e,G.secondaryColor=t||$e(e),G.calculated=!!t}function Ft(){return{...G}}const K=e=>{const{icon:t,className:r,onClick:n,style:a,primaryColor:i,secondaryColor:c,...d}=e,p=P.useRef(null);let f=G;if(i&&(f={primaryColor:i,secondaryColor:c||$e(i)}),Ct(p),It(ze(t),`icon should be icon definiton, but got ${t}`),!ze(t))return null;let h=t;return h&&typeof h.icon=="function"&&(h={...h,icon:h.icon(f.primaryColor,f.secondaryColor)}),ce(h.icon,`svg-${h.name}`,{className:r,onClick:n,style:a,"data-icon":h.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",...d,ref:p})};K.displayName="IconReact",K.getTwoToneColors=Ft,K.setTwoToneColors=kt;function Ee(e){const[t,r]=De(e);return K.setTwoToneColors({primaryColor:t,secondaryColor:r})}function Nt(){const e=K.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}function ue(){return ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ue.apply(this,arguments)}Ee(se.primary);const Z=P.forwardRef((e,t)=>{const{className:r,icon:n,spin:a,rotate:i,tabIndex:c,onClick:d,twoToneColor:p,...f}=e,{prefixCls:h="anticon",rootClassName:y}=P.useContext(ye),v=rt(y,h,{[`${h}-${n.name}`]:!!n.name,[`${h}-spin`]:!!a||n.name==="loading"},r);let b=c;b===void 0&&d&&(b=-1);const F=i?{msTransform:`rotate(${i}deg)`,transform:`rotate(${i}deg)`}:void 0,[k,u]=De(p);return P.createElement("span",ue({role:"img","aria-label":n.name},f,{ref:t,tabIndex:b,onClick:d,className:v}),P.createElement(K,{icon:n,primaryColor:k,secondaryColor:u,style:F}))});Z.getTwoToneColor=Nt,Z.setTwoToneColor=Ee;var Mt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"};function he(){return he=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},he.apply(this,arguments)}const qt=(e,t)=>P.createElement(Z,he({},e,{ref:t,icon:Mt})),He=P.forwardRef(qt);var zt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM544 472c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v108H372c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h108v108c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V644h108c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V472z"}}]},name:"file-add",theme:"outlined"};function de(){return de=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},de.apply(this,arguments)}const Ot=(e,t)=>P.createElement(Z,de({},e,{ref:t,icon:zt})),$t=P.forwardRef(Ot);var Dt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"};function ge(){return ge=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ge.apply(this,arguments)}const Et=(e,t)=>P.createElement(Z,ge({},e,{ref:t,icon:Dt})),Ht=P.forwardRef(Et),Le={get:Lt,getByIdOrSlug:Pt,getMedias:At,download:jt,downloadFromUrl:Vt};function Lt(e){return x.postData("/api/media/search",e,!0)}function Pt(e){return x.getData(`/api/media/${e}`,!0)}function At(e){return x.postData("/api/media/medias",e,!0)}function jt(e){return x.postData("/api/media/download",e)}function Vt(e){return x.postData("/api/media/download/url",e,!0)}const Pe={success:Bt,error:Ut};function Bt(e){l.notification.success({message:Ae[Math.floor(Math.random()*Ae.length)],description:e,duration:3})}function Ut(e){l.notification.error({message:je[Math.floor(Math.random()*je.length)],description:e,duration:3})}let Ae=["Success","Good Job","Excellent","Way to go!","Nice!","That'll do!","That worked!","Ok","Bingo"],je=["Bummer","Something didn't work","Error","Nope","Shucks"];const{Dragger:Kt}=l.Upload;function Yt(e){const t=e.size/1024/1024<200;return t||Pe.error("File must smaller than 200MB"),t}function Jt({onUploaded:e,accept:t,addToMediaLibrary:r,contentId:n,showUploadList:a=!0,multiple:i=!1}){const c=typeof globalThis<"u"?globalThis.process?.env:void 0,d=typeof window<"u",p=d&&typeof localStorage<"u"?localStorage.getItem("gatsbyUser"):null,f=p!==null&&d?JSON.parse(window.atob(p)):null,h=b=>{b.file.status!=="uploading"&&(b.file.status==="done"?e&&e(b.file.response):b.file.status==="error"&&Pe.error(`${b.file.name} file upload failed.`))},y={Authorization:f?.token?"Bearer "+f.token:"",AppKey:c?.STORM_APPKEY};let v=`https://${c?.REACT_APP_WEBAPI_URL_FULL_ACCESS}/api/media/files`;return r&&(v+="?addToMediaLibrary=true",n&&(v+=`&contentId=${n}`)),s.jsx("div",{children:s.jsx(Kt,{name:"files",accept:t,multiple:i,beforeUpload:Yt,action:v,headers:y,showUploadList:a,onChange:h,children:s.jsxs("div",{className:"p-5 m-5",children:[s.jsx("p",{className:"ant-upload-drag-icon",children:s.jsx($t,{})}),s.jsx("p",{className:"ant-upload-text",children:"Click or drag files to this area to upload"}),t!==void 0&&s.jsx("p",{className:"ant-upload-hint",children:`must be only ${t} files`})]})})})}const fe={image:Wt,currency:Gt,numWithComma:Zt,phone:Qt,timeToRead:Xt,timeDiffMinutes:Rt,startEndDateTime:er,dateFormat:tr,getDateFromString:rr};function Wt(e,t){return e?e.indexOf("?")>-1?`${e}&${t}`:`${e}?${t}`:""}function Gt(e){var t=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"});return t.format(e)}function Zt(e){return e.toLocaleString()}function Qt(e){return e=e.toString().replace(/[^0-9]/g,""),e.length===10?e.substring(0,3)+"."+e.substring(3,6)+"."+e.substring(6):e}function Xt(e){return e?Math.ceil(e.split(" ").length/210):0}function Rt(e,t){console.log(e,t);const r=e&&typeof e=="object"?e:Date.parse(e.replace(" ","T")),n=t&&typeof t=="object"?t:Date.parse(t.replace(" ","T")),a=Math.abs(n-r);return Math.floor(a/1e3/60)}function er(e,t="",r=!0){const n={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric"},a={hour:"numeric",minute:"numeric",timeZoneName:"short"},i={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",timeZoneName:"short"},c=new Intl.DateTimeFormat("en",n),d=new Intl.DateTimeFormat("en",a),p=new Intl.DateTimeFormat("en",i);if(!e)return"";const f=e&&typeof e=="object"?e:Date.parse(e.replace(" ","T")),h=t&&typeof t=="object"?t:Date.parse(t.replace(" ","T"));return!Number.isNaN(f)&&!Number.isNaN(h)?s.jsxs("span",{children:[c.format(f)," - ",d.format(h),r&&s.jsx("br",{})]}):Number.isNaN(f)?Number.isNaN(h)?"":s.jsxs("span",{children:[" ",p.format(h),r&&s.jsx("br",{})]}):s.jsxs("span",{children:[" ",p.format(f),r&&s.jsx("br",{})]})}function tr(e,t="medium",r=!1){const n={weekday:"long",year:"numeric",month:"long",day:"numeric"},a={year:"numeric",month:"long",day:"numeric"},i={year:"numeric",month:"short",day:"numeric"},c={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",timeZoneName:"short"},d={hour:"numeric",minute:"numeric",timeZoneName:"short"},p=new Intl.DateTimeFormat("en",n),f=new Intl.DateTimeFormat("en",i),h=new Intl.DateTimeFormat("en",c),y=new Intl.DateTimeFormat("en",a),v=new Intl.DateTimeFormat("en",d);if(!e)return"";const b=e&&typeof e=="object"?e:Date.parse(e.replace(" ","T"));return Number.isNaN(b)?"":s.jsxs(s.Fragment,{children:[t==="long"&&p.format(b),t==="short"&&f.format(b),t==="medium"&&y.format(b),t==="datetime"&&h.format(b),t==="time"&&v.format(b),r&&s.jsx("br",{})]})}function rr(e){if(!e)return null;const t=Date.parse(e.replace(" ","T"));return Number.isNaN(t)?null:t}const{Search:nr}=l.Input;function sr({fileTypes:e,contentId:t,isMany:r,onSuccess:n,hideScopeFilter:a=!0,showResizer:i=!1}){const[c,d]=g.useState(!1),[p,f]=g.useState([]),[h,y]=g.useState([]),[v,b]=g.useState(0),[F,k]=g.useState([]),[u,m]=g.useState(""),[N,C]=g.useState("content"),[w,O]=g.useState(a?1:0),[V,Q]=g.useState({id:"createdOn",desc:!0}),[L,$]=g.useState({current:1,pageSize:20,total:0,position:["topRight","bottomRight"],showSizeChanger:!0}),[M,z]=g.useState([]),[_,I]=g.useState(null),[E,D]=g.useState(null);g.useEffect(()=>{d(!1);let T={keyword:u,mediaTypes:F,orderBy:V,pagination:{pageNum:L.current,pageSize:L.pageSize}};T.mediaPurposes=[1],T.contentId=t,Le.get(T).then(S=>{const H={...L};H.total=S.totalRecords,f(S.media),$(H)}).catch(S=>console.log(S)).finally(()=>{d(!1)})},[v,F,N]);const A=(T,S,H)=>{let te={...V};const B={...L};B.pageSize!==T.pageSize?(B.pageSize=T.pageSize,B.current=1):B.current=T.current,H.field&&(te={id:H.field,desc:H.order==="descend"}),$(B),Q(te),b(v+1)},_r=(T,S)=>{let H=T.filter(te=>p.find(B=>B.id===te));z(H)},Ir=T=>{const S={...L};S.current=1,$(S),k(T)},xr=T=>{const S={...L};S.current=1,$(S),C(T.target.value)},me=T=>{if(n){if(T){i&&T.mediaType===0?I(T):n([T]);return}n(p.filter(S=>M.find(H=>H===S.id))),z([])}},Cr=T=>{let S=h.concat(T);y(S)};return s.jsx(l.Tabs,{items:[{label:"Search",key:"1",children:s.jsxs(s.Fragment,{children:[s.jsxs(l.Row,{gutter:[16,16],className:"mb-3",children:[s.jsx(l.Col,{xs:6,children:s.jsxs(l.Select,{mode:"multiple",placeholder:"Select Type",value:F,onChange:Ir,className:"mr-2 w-100",children:[s.jsx(l.Select.Option,{value:0,children:"Image"}),s.jsx(l.Select.Option,{value:1,children:"File"}),s.jsx(l.Select.Option,{value:2,children:"Video"}),s.jsx(l.Select.Option,{value:3,children:"Audio"}),s.jsx(l.Select.Option,{value:4,children:"Embedded"})]})}),s.jsx(l.Col,{xs:6,children:!a&&s.jsxs(l.Radio.Group,{buttonStyle:"solid",value:N,onChange:xr,children:[s.jsx(l.Radio.Button,{value:"global",children:"Global"}),s.jsx(l.Radio.Button,{value:"both",children:"Both"}),s.jsx(l.Radio.Button,{value:"content",children:"Content"})]})}),s.jsx(l.Col,{xs:12,children:s.jsx(nr,{id:"keyword",placeholder:"search",onSearch:()=>b(v+1),enterButton:!0,className:"w-100",value:u,onChange:T=>m(T.target.value),loading:c})}),r&&s.jsx(l.Col,{xs:24,children:s.jsx(l.Button,{type:"primary",className:"mr-2",disabled:M.length===0,onClick:()=>me(),children:"Select"})})]}),s.jsx(l.Table,{dataSource:p,rowKey:T=>T.id,pagination:L,loading:c,size:"middle",className:"clear-both pointer",onChange:A,rowSelection:r&&{type:"checkbox",onChange:_r,selectedRowKeys:M,hideSelectAll:!0},onRow:(T,S)=>({onClick:H=>{!r&&me(T)}}),columns:[{title:"",dataIndex:"thumbnail",width:"6%",responsive:["lg"],render:(T,S)=>s.jsx("img",{src:S.thumbnail,alt:"Thumbnail",className:"img-fluid avatar-50"})},{title:"Title",dataIndex:"title",sorter:!0},{title:"Type",dataIndex:"lastName",sorter:!0,render:(T,S)=>s.jsxs("span",{children:[S.mediaType===0&&s.jsx(l.Tag,{color:"blue",children:"Image"}),S.mediaType===1&&s.jsx(l.Tag,{color:"gold",children:"File"}),S.mediaType===2&&s.jsx(l.Tag,{color:"cyan",children:"Video"}),S.mediaType===3&&s.jsx(l.Tag,{color:"magenta",children:"Audio"}),S.mediaType===4&&s.jsx(l.Tag,{color:"volcano",children:"Embedded"})]})},{title:"Created",dataIndex:"createdOn",sorter:!0,responsive:["xl"],render:(T,S)=>s.jsx("span",{children:fe.dateFormat(S.createdOn)})},{title:"Info",responsive:["lg"],align:"center",render:(T,S)=>s.jsx(l.Button,{type:"secondary",onClick:H=>{H.stopPropagation(),D(S)},children:s.jsx(Ht,{})})}]})]})},{label:"Upload",key:"2",children:s.jsxs(s.Fragment,{children:[s.jsx(Jt,{onUploaded:Cr,multiple:!0,showUploadList:!1,addToMediaLibrary:!0,contentId:w===1?t:0}),s.jsx(l.Table,{dataSource:h,rowKey:T=>T.id,pagination:!1,loading:c,size:"middle",className:"clear-both pointer",onRow:(T,S)=>({onClick:H=>{me(T)}}),columns:[{title:"",dataIndex:"thumbnail",width:"6%",responsive:["md"],render:(T,S)=>s.jsx("img",{src:S.url,alt:"Thumbnail",className:"img-fluid"})},{title:"Title",dataIndex:"title",sorter:!0},{title:"Type",dataIndex:"lastName",sorter:!0,render:(T,S)=>s.jsxs("span",{children:[S.mediaType===0&&s.jsx(l.Tag,{color:"blue",children:"Image"}),S.mediaType===1&&s.jsx(l.Tag,{color:"gold",children:"File"}),S.mediaType===2&&s.jsx(l.Tag,{color:"cyan",children:"Video"}),S.mediaType===3&&s.jsx(l.Tag,{color:"magenta",children:"Audio"}),S.mediaType===4&&s.jsx(l.Tag,{color:"volcano",children:"Embedded"})]})},{title:"Created",dataIndex:"createdOn",sorter:!0,responsive:["xl"],render:(T,S)=>s.jsx("span",{children:fe.dateFormat(S.createdOn)})}]})]})}]})}const ar=({slug:e,value:t,label:r,opts:n,form:a,onChange:i,media:c,debug:d,isRequired:p,contentId:f,className:h})=>{n=n||{uploadLimit:"1",fileTypes:null};const[y,v]=g.useState(c||[]),[b,F]=g.useState(!1),k=n.uploadLimit!=="1";if(!e)throw Error("MediaInput property: slug required");g.useEffect(()=>{if(c?.length>0?v(c):v([]),t&&!c){const C=t.split(",").filter(w=>!isNaN(w)).map(w=>parseInt(w,10));Le.getMedias({ids:C}).then(w=>{v(w)})}},[c]);const u=C=>{const w=y.concat(C);v(w),N(w),F(!1)},m=C=>{var w=y.findIndex(O=>O.id===C.id);if(w>-1){let O=[...y];O.splice(w,1),v(O),N(O)}},N=C=>{const w=C.map((O,V)=>O.id).join(",");a.setFieldsValue({[e]:w}),i&&i(e,w)};return s.jsxs(l.Form.Item,{label:r,className:h,children:[s.jsxs("div",{className:"text-center",children:[(k||!k&&y.length===0)&&s.jsx(l.Button,{type:"primary",className:"my-2",onClick:()=>F(!0),children:"Select"}),y.length>0&&s.jsx(l.Table,{dataSource:y,rowKey:C=>C.id,pagination:!1,size:"middle",className:"clear-both mt-3",columns:[{title:"",dataIndex:"url",render:(C,w)=>s.jsxs("span",{children:[w.mediaType===0&&s.jsx("img",{src:w.url,alt:"Thumbnail",className:"img-fluid avatar-50"}),w.mediaType===1&&s.jsx("img",{src:w.thumbnail,alt:"Thumbnail",className:"img-fluid avatar-50"}),w.mediaType===2&&s.jsx(s.Fragment,{}),w.mediaType===3&&s.jsx(s.Fragment,{}),w.mediaType===4&&s.jsx(s.Fragment,{})]})},{title:"Title",dataIndex:"title",render:(C,w)=>s.jsxs("span",{children:[w.title,w.credit?.length>0&&s.jsx("div",{dangerouslySetInnerHTML:{__html:w.credit},className:"credit"})]})},{title:"Type",dataIndex:"lastName",sorter:!0,render:(C,w)=>s.jsxs("span",{children:[w.mediaType===0&&s.jsx(l.Tag,{color:"blue",children:"Image"}),w.mediaType===1&&s.jsx(l.Tag,{color:"gold",children:"File"}),w.mediaType===2&&s.jsx(l.Tag,{color:"cyan",children:"Video"}),w.mediaType===3&&s.jsx(l.Tag,{color:"magenta",children:"Audio"}),w.mediaType===4&&s.jsx(l.Tag,{color:"volcano",children:"Embedded"})]})},{title:"",width:"50px",render:(C,w)=>s.jsx(l.Popconfirm,{title:"Are you sure you want to delete this?",onConfirm:()=>m(w),okText:"Yes",cancelText:"No",children:s.jsx(l.Button,{type:"primary",danger:!0,children:s.jsx(He,{})})})}]})]}),s.jsx(l.Form.Item,{name:e,initialValue:t,hidden:!d,rules:[{required:p,message:"Required"}],children:s.jsx(l.Input,{})}),s.jsx(l.Drawer,{open:b,title:"Search Media",height:"85%",placement:"bottom",onClose:()=>F(!1),children:s.jsx(sr,{mediaTypes:n.referenceTypes,isMany:k,onSuccess:u,hideScopeFilter:!0,contentId:f})})]})},or={siteSearch:ir,get:lr,search:cr,getForm:ur,getUserContent:hr,getByIdOrSlug:dr,getContentTypeById:gr};function ir(e){return x.postData("/api/content/sitesearch",e,!1)}function lr(e){return x.getData(`/api/content/${e}`,!1)}function cr(e){return x.postData("/api/content/search",e,!0)}function ur(e,t){return x.getData(`/api/content/form/${e}/${t}`,!1)}function hr(e,t){return x.getData(`/api/content/usercontent/?status=${t}&page=${e}`,!0)}function dr(e){return x.getData(`/api/content/${e}`,!0)}function gr(e,t){let r=`/api/content/contenttype/${e}`;return t&&(r+=`/${t}`),x.getData(r,!0)}const{Search:fr}=l.Input;function mr({contentTypes:e,isMany:t,isEcommerce:r,onSuccess:n,showDetails:a=!0,isPreviewable:i=!1,initialStatus:c=[0]}){const[d,p]=g.useState(!1),[f,h]=g.useState([]),[y,v]=g.useState(0),[b,F]=g.useState(""),[k,u]=g.useState({id:"title",desc:!1}),[m,N]=g.useState({current:1,pageSize:20,total:0,position:["topRight","bottomRight"],showSizeChanger:!0}),[C,w]=g.useState(c),[O,V]=g.useState([]);g.useEffect(()=>{p(!1);let _={keyword:b,contentType:e||[],isPreviewable:i,status:C,orderBy:k,pagination:{pageNum:m.current,pageSize:m.pageSize},isEcommerce:r};or.search(_).then(I=>{const E={...m};E.total=I.totalRecords,h(I.content),N(E)}).catch(I=>console.log(I)).finally(()=>{p(!1)})},[y]);const Q=(_,I,E)=>{let D={...k};const A={...m};A.pageSize!==_.pageSize?(A.pageSize=_.pageSize,A.current=1):A.current=_.current,E.field&&(D={id:E.field,desc:E.order==="descend"}),N(A),u(D),v(y+1)},L=()=>{const _={...m};_.current=1,N(_),v(y+1)},$=(_,I)=>{let E=_.filter(D=>f.find(A=>A.id===D));V(E)},M=_=>{if(n){if(_){n([_]);return}n(f.filter(I=>O.find(E=>E===I.id))),V([])}};let z=[{title:"Title",dataIndex:"title",sorter:!0}];return a&&(z.push({title:"Type",dataIndex:"contentType",sorter:!0}),z.push({title:"Status",render:(_,I)=>s.jsxs("span",{children:[I.status===0&&s.jsx(l.Tag,{color:"blue",children:"Published"}),I.status===1&&s.jsx(l.Tag,{color:"gold",children:"Draft"}),I.status===2&&s.jsx(l.Tag,{color:"magenta",children:"Trashed"}),I.status===3&&s.jsx(l.Tag,{color:"purple",children:"Published with Pending Updates"})]})})),s.jsxs("div",{children:[s.jsxs(l.Row,{gutter:[16,16],className:"mb-3",children:[s.jsx(l.Col,{xs:12}),s.jsx(l.Col,{xs:12,children:s.jsx(fr,{id:"keyword",placeholder:"search",onSearch:L,enterButton:!0,className:"w-100",value:b,onChange:_=>F(_.target.value),loading:d})}),t&&s.jsx(l.Col,{xs:24,children:s.jsx(l.Button,{type:"primary",className:"mr-2",disabled:O.length===0,onClick:()=>M(),children:"Select"})})]}),s.jsx(l.Table,{dataSource:f,rowKey:_=>_.id,pagination:m,loading:d,size:"middle",className:"clear-both pointer",onChange:Q,expandable:{expandedRowRender:_=>s.jsx("table",{children:s.jsx("tbody",{children:_.meta.values.filter(I=>I.label.toLowerCase().indexOf("url")>-1).map((I,E)=>{let D=I.fullValue??I.value;return D=D?.indexOf("Z")>-1&&X(D).isValid()?fe.dateFormat(D):D,D=D?.replace(/(<([^>]+)>)/gi,"",""),s.jsxs("tr",{children:[s.jsx("td",{style:{verticalAlign:"top",minWidth:150},children:I.label}),s.jsx("td",{children:s.jsx("span",{children:D||""})})]},E)})})})},rowSelection:t&&{type:"checkbox",onChange:$,selectedRowKeys:O,hideSelectAll:!0},onRow:(_,I)=>({onClick:E=>{!t&&M(_)}}),columns:z})]})}const pr=({slug:e,value:t,label:r,opts:n,form:a,onChange:i,references:c,debug:d,isRequired:p,values:f,error:h,errors:y,className:v,placeholder:b,disabled:F})=>{const[k,u]=g.useState(c||[]),[m,N]=g.useState(!1),[C,w]=g.useState(null),O=n.referenceAmount!=="1";if(!e)throw Error("ReferenceInput property: slug required");!t&&f&&f[e]&&(t=f[e]),!h&&y&&y[e]&&(h=y[e]);const V=$=>{const M=$.filter(_=>!k.some(I=>_.id===I.id)),z=k.concat(M);u(z),L(z),N(!1)},Q=$=>{var M=k.findIndex(z=>z.id===$.id);if(M>-1){let z=[...k];z.splice(M,1),u(z),L(z)}},L=$=>{const M=$.map((z,_)=>z.id).join(",");a.setFieldsValue({[e]:M}),i&&i(e,M)};return g.useEffect(()=>{u(c||[])},[c]),g.useEffect(()=>{C&&setShowEdit(!0)},[C]),s.jsxs(l.Form.Item,{label:r,className:v,children:[s.jsxs("div",{className:"text-center",children:[(O||!O&&k.length===0)&&s.jsx(s.Fragment,{children:s.jsx(l.Button,{type:"primary",className:"my-2",onClick:()=>N(!0),children:"Select"})}),k.length>0&&s.jsx(l.Table,{dataSource:k,rowKey:$=>$.id,pagination:!1,size:"middle",className:"clear-both mt-3",columns:[{title:"Title",dataIndex:"title"},{title:"Type",dataIndex:"contentType"},{title:"Status",render:($,M)=>s.jsxs("span",{children:[M.status===0&&s.jsx(l.Tag,{color:"blue",children:"Published"}),M.status===1&&s.jsx(l.Tag,{color:"gold",children:"Draft"}),M.status===2&&s.jsx(l.Tag,{color:"magenta",children:"Trashed"})]})},{title:"",width:"50px",render:($,M)=>s.jsx(l.Popconfirm,{title:"Are you sure you want to delete this?",onConfirm:()=>Q(M),okText:"Yes",cancelText:"No",children:s.jsx(l.Button,{type:"primary",danger:!0,children:s.jsx(He,{})})})}]})]}),s.jsx(l.Form.Item,{name:e,initialValue:t,hidden:!d,rules:[{required:p,message:"Required"}],children:s.jsx(l.Input,{})}),s.jsx(l.Drawer,{open:m,title:"Search References",height:"90%",placement:"bottom",onClose:()=>N(!1),children:s.jsx(mr,{contentTypes:n.referenceTypes,isMany:O,onSuccess:V})})]})},yr={hasJsonStructure:Ve,parseJson:br};function Ve(e){if(typeof e!="string")return!1;try{const t=JSON.parse(e),r=Object.prototype.toString.call(t);return r==="[object Object]"||r==="[object Array]"}catch{return!1}}function br(e){return Ve(e)?JSON.parse(e):JSON.parse("{}")}const Sr=(e,t)=>{let{properties:r,loading:n,onSubmit:a,hideSubmit:i,onFieldsChange:c,layout:d,entityId:p,debug:f=!1}=e;const[h]=l.Form.useForm(),y=d==="vertical"?24:4,v=d==="vertical"?24:20,b=d==="vertical"?0:4;g.useImperativeHandle(t,()=>({validate(u){h.validateFields().then(m=>{u([])}).catch(m=>{console.log(m),u(m.errorFields)})}})),g.useEffect(()=>{let u=r.reduce((N,C)=>({...N,[C.slug]:C.value}),{});h.setFieldsValue({...u});const m=new URLSearchParams(window.location.search);m.get("utm_source")&&localStorage.setItem("utm_source",m.get("utm_source")),m.get("utm_medium")&&localStorage.setItem("utm_medium",m.get("utm_medium")),m.get("utm_campaign")&&localStorage.setItem("utm_campaign",m.get("utm_campaign")),m.get("utm_term")&&localStorage.setItem("utm_term",m.get("utm_term")),m.get("utm_content")&&localStorage.setItem("utm_content",m.get("utm_content"))},[r]);const F=u=>{for(let N in u)u[N]=Array.isArray(u[N])?JSON.stringify(u[N]):u[N];let m={};localStorage.getItem("utm_source")&&(m.source=localStorage.getItem("utm_source")),localStorage.getItem("utm_medium")&&(m.medium=localStorage.getItem("utm_medium")),localStorage.getItem("utm_campaign")&&(m.campaign=localStorage.getItem("utm_campaign")),localStorage.getItem("utm_term")&&(m.term=localStorage.getItem("utm_term")),localStorage.getItem("utm_content")&&(m.content=localStorage.getItem("utm_content")),a(u,m)},k=u=>{c&&c(u[0].name[0],u[0].value)};return r.length===0?i?s.jsx(s.Fragment,{}):s.jsx("div",{children:"There are no properties at this time."}):s.jsx("div",{children:s.jsxs(l.Form,{form:h,labelCol:{span:y},wrapperCol:{span:v},onFinish:F,onFieldsChange:k,layout:d,children:[r.map((u,m)=>{switch(u.opts=yr.parseJson(u.options),u.fieldType){case 1:return s.jsx(l.Form.Item,{label:u.label,name:u.slug,rules:[{required:u.isRequired,message:"Required"},{type:"email",message:"Email is not valid"}],initialValue:u.value?.replaceAll(`
|
|
61
|
+
`,"\\n"),children:s.jsx(l.Input,{placeholder:u.opts?.placeholder||""})},m);case 2:return s.jsx(l.Form.Item,{label:u.label,name:u.slug,rules:[{required:u.isRequired,message:"Required"},{type:"url",message:"URL is not valid"}],initialValue:u.value,children:s.jsx(l.Input,{placeholder:u.opts?.placeholder||""})},m);case 3:return s.jsx(l.Form.Item,{label:u.label,name:u.slug,rules:[{required:u.isRequired,message:"Required"},{pattern:/^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/,message:"Phone is not valid"}],initialValue:u.value,children:s.jsx(l.Input,{placeholder:u.opts?.placeholder||""})},m);case 4:return s.jsx(l.Form.Item,{label:u.label,name:u.slug,initialValue:u.value,rules:[{required:u.isRequired,message:"Required"}],children:s.jsx(l.Input.Password,{placeholder:u.opts?.placeholder||""})},m);case 5:case 6:return s.jsx(l.Form.Item,{label:u.label,name:u.slug,initialValue:u.value,rules:[{required:u.isRequired,message:"Required"}],children:s.jsx(l.Input.TextArea,{placeholder:u.opts?.placeholder||""})},m);case 7:return u.value=u.value?X(u.value):"",g.createElement(re,{...u,key:m,showTime:!0});case 8:return u.value=u.value?X(u.value):"",g.createElement(re,{...u,key:m});case 9:return u.value=u.value?X(u.value):"",g.createElement(re,{...u,key:m});case 10:return g.createElement(pe,{...u,key:m});case 11:return g.createElement(pe,{...u,key:m,type:"currency"});case 12:return g.createElement(ar,{...u,form:h,onChange:c,key:m,debug:f,contentId:p});case 13:return g.createElement(pr,{...u,form:h,onChange:c,key:m,debug:f});case 14:return s.jsx(s.Fragment,{});case 15:return g.createElement(Re,{...u,key:m});case 16:return g.createElement(Xe,{...u,key:m});case 17:return s.jsx(s.Fragment,{});case 18:return s.jsx(l.Form.Item,{children:s.jsx("div",{dangerouslySetInnerHTML:{__html:u.label}})},m);case 19:return g.createElement(tt,{...u,key:m,debug:f});case 20:return s.jsx(s.Fragment,{});case 21:return s.jsx(s.Fragment,{});case 22:return s.jsx(s.Fragment,{});case 23:return g.createElement(et,{...u,key:m,debug:f});case 24:return s.jsx(l.Form.Item,{label:s.jsx("strong",{className:"mt-3",children:u.label}),name:u.slug,children:s.jsx("hr",{})},m);default:return s.jsx(l.Form.Item,{label:u.label,name:u.slug,initialValue:u.value,rules:[{required:u.isRequired,message:"Required"}],children:s.jsx(l.Input,{placeholder:u.opts?.placeholder||""})},m)}}),!i&&s.jsx(l.Form.Item,{wrapperCol:{span:y,offset:b},children:s.jsx(l.Button,{type:"primary",htmlType:"submit",loading:n,children:"Submit"})})]})})},wr=g.forwardRef(Sr),Be={getForm:vr,submitForm:Tr};function vr(e){return x.getData(`/v1/form/${e}`,!1)}function Tr(e,t=!1){return x.postData("/v1/form/submission",e,t)}return({formId:e,appKey:t})=>{const[r,n]=g.useState(null),[a,i]=g.useState("");g.useEffect(()=>{if(!e){console.log("formId is required to use the StormForm component");return}if(!t){console.log("appKey is required to use the StormForm component");return}localStorage.setItem("appKey",t),Be.getForm(e).then(d=>{n(d)}).catch(d=>{console.error(d)})},[e,t]);const c=(d,p)=>{const f={formId:e,props:d,utmValues:p};Be.submitForm(f).then(h=>{h.type==="redirect"?window.location.href=h.value:i(h.value)}).catch(h=>{console.error(h)})};return r?s.jsxs(s.Fragment,{children:[!a&&s.jsx(wr,{properties:r.properties,onSubmit:c}),a&&s.jsx("div",{className:"text-center",children:s.jsx("div",{dangerouslySetInnerHTML:{__html:a}})})]}):s.jsx(s.Fragment,{})}}));
|