1import{r as G,a as Te,j as S,g as ur}from"./react-core-BN_aFRlH.js";import{d_ as lr,d$ as cr,dK as St,dU as Rt,dO as Ae,e0 as jt,e1 as Ct,dM as kt,e2 as dr,e3 as pr,e4 as fr,e5 as mr,e6 as hr,e7 as gr,e8 as yr,dT as Dt,e9 as vr,ea as br,eb as xr,dR as wr,ec as Er,dP as Sr,dW as Ue,ed as yt,ee as He,ef as vt,eg as Rr,dX as bt,e as qe,u as jr,a as Cr,aO as kr,c as Dr,aa as xt,R as Or,s as Nr,cc as Lr,B as nt,aE as Ir,a5 as at,cd as _r,Y as Pe,a6 as Qe,aw as Fr,eh as Pr,aq as zr,b1 as Mr,aB as Tr,cX as Ar,a1 as qr}from"./index-CYXZwtPb.js";import{c as Br}from"./index-Bf-M12yT.js";import{E as Ot}from"./ErrorWarningBox-BSnb1AlK.js";import"./mui-CP4qtwp0.js";import"./animation-C-KGoQCB.js";import"./charts-BUx6XpEL.js";import"./tiptap-Cj1aK4WN.js";import"./dnd-kit-BDzVY4GX.js";var Ur=(o=>(o[o.RegisterOption=0]="RegisterOption",o[o.UnregisterOption=1]="UnregisterOption",o))(Ur||{});let $r={0(o,p){let e=[...o.options,{id:p.id,element:p.element,propsRef:p.propsRef}];return{...o,options:Er(e,i=>i.element.current)}},1(o,p){let e=o.options.slice(),i=o.options.findIndex(a=>a.id===p.id);return i===-1?o:(e.splice(i,1),{...o,options:e})}},ot=G.createContext(null);ot.displayName="RadioGroupDataContext";function Nt(o){let p=G.useContext(ot);if(p===null){let e=new Error(`<${o} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Nt),e}return p}let it=G.createContext(null);it.displayName="RadioGroupActionsContext";function Lt(o){let p=G.useContext(it);if(p===null){let e=new Error(`<${o} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Lt),e}return p}function Gr(o,p){return wr(p.type,$r,o,p)}let Wr="div";function Vr(o,p){let e=Rt(),{id:i=`headlessui-radiogroup-${e}`,value:a,defaultValue:u,form:f,name:l,onChange:y,by:v=(n,w)=>n===w,disabled:k=!1,...I}=o,z=Ae(typeof v=="string"?(n,w)=>{let R=v;return n?.[R]===w?.[R]}:v),[W,se]=G.useReducer(Gr,{options:[]}),U=W.options,[J,re]=jt(),[$,be]=Ct(),xe=G.useRef(null),ne=kt(xe,p),[ae,he]=dr(a,y,u),te=G.useMemo(()=>U.find(n=>!n.propsRef.current.disabled),[U]),ue=G.useMemo(()=>U.some(n=>z(n.propsRef.current.value,ae)),[U,ae]),ce=Ae(n=>{var w;if(k||z(n,ae))return!1;let R=(w=U.find(E=>z(E.propsRef.current.value,n)))==null?void 0:w.propsRef.current;return R!=null&&R.disabled?!1:(he?.(n),!0)});pr({container:xe.current,accept(n){return n.getAttribute("role")==="radio"?NodeFilter.FILTER_REJECT:n.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(n){n.setAttribute("role","none")}});let F=Ae(n=>{let w=xe.current;if(!w)return;let R=Sr(w),E=U.filter(_=>_.propsRef.current.disabled===!1).map(_=>_.element.current);switch(n.key){case Ue.Enter:Rr(n.currentTarget);break;case Ue.ArrowLeft:case Ue.ArrowUp:if(n.preventDefault(),n.stopPropagation(),yt(E,He.Previous|He.WrapAround)===vt.Success){let _=U.find(H=>H.element.current===R?.activeElement);_&&ce(_.propsRef.current.value)}break;case Ue.ArrowRight:case Ue.ArrowDown:if(n.preventDefault(),n.stopPropagation(),yt(E,He.Next|He.WrapAround)===vt.Success){let _=U.find(H=>H.element.current===R?.activeElement);_&&ce(_.propsRef.current.value)}break;case Ue.Space:{n.preventDefault(),n.stopPropagation();let _=U.find(H=>H.element.current===R?.activeElement);_&&ce(_.propsRef.current.value)}break}}),ge=Ae(n=>(se({type:0,...n}),()=>se({type:1,id:n.id}))),t=G.useMemo(()=>({value:ae,firstOption:te,containsCheckedOption:ue,disabled:k,compare:z,...W}),[ae,te,ue,k,z,W]),Re=G.useMemo(()=>({registerOption:ge,change:ce}),[ge,ce]),ke={ref:ne,id:i,role:"radiogroup","aria-labelledby":J,"aria-describedby":$,onKeyDown:F},Ee=G.useMemo(()=>({value:ae}),[ae]),Se=G.useRef(null),d=fr();return G.useEffect(()=>{Se.current&&u!==void 0&&d.addEventListener(Se.current,"reset",()=>{ce(u)})},[Se,ce]),Te.createElement(be,{name:"RadioGroup.Description"},Te.createElement(re,{name:"RadioGroup.Label"},Te.createElement(it.Provider,{value:Re},Te.createElement(ot.Provider,{value:t},l!=null&&ae!=null&&mr({[l]:ae}).map(([n,w],R)=>Te.createElement(hr,{features:gr.Hidden,ref:R===0?E=>{var _;Se.current=(_=E?.closest("form"))!=null?_:null}:void 0,...yr({key:n,as:"input",type:"radio",checked:w!=null,hidden:!0,readOnly:!0,form:f,disabled:k,name:n,value:w})})),Dt({ourProps:ke,theirProps:I,slot:Ee,defaultTag:Wr,name:"RadioGroup"})))))}var Hr=(o=>(o[o.Empty=1]="Empty",o[o.Active=2]="Active",o))(Hr||{});let Yr="div";function Qr(o,p){var e;let i=Rt(),{id:a=`headlessui-radiogroup-option-${i}`,value:u,disabled:f=!1,...l}=o,y=G.useRef(null),v=kt(y,p),[k,I]=jt(),[z,W]=Ct(),{addFlag:se,removeFlag:U,hasFlag:J}=vr(1),re=br({value:u,disabled:f}),$=Nt("RadioGroup.Option"),be=Lt("RadioGroup.Option");xr(()=>be.registerOption({id:a,element:y,propsRef:re}),[a,be,y,re]);let xe=Ae(ge=>{var t;if(bt(ge.currentTarget))return ge.preventDefault();be.change(u)&&(se(2),(t=y.current)==null||t.focus())}),ne=Ae(ge=>{if(bt(ge.currentTarget))return ge.preventDefault();se(2)}),ae=Ae(()=>U(2)),he=((e=$.firstOption)==null?void 0:e.id)===a,te=$.disabled||f,ue=$.compare($.value,u),ce={ref:v,id:a,role:"radio","aria-checked":ue?"true":"false","aria-labelledby":k,"aria-describedby":z,"aria-disabled":te?!0:void 0,tabIndex:te?-1:ue||!$.containsCheckedOption&&he?0:-1,onClick:te?void 0:xe,onFocus:te?void 0:ne,onBlur:te?void 0:ae},F=G.useMemo(()=>({checked:ue,disabled:te,active:J(2)}),[ue,te,J]);return Te.createElement(W,{name:"RadioGroup.Description"},Te.createElement(I,{name:"RadioGroup.Label"},Dt({ourProps:ce,theirProps:l,slot:F,defaultTag:Yr,name:"RadioGroup.Option"})))}let Zr=St(Vr),Jr=St(Qr),Ye=Object.assign(Zr,{Option:Jr,Label:cr,Description:lr});const Kr=()=>{const{t:o}=qe(),p=jr(),e=Cr(),{invalidateAllDashboardsQuery:i}=kr(),[a,u]=G.useState(null),f=Dr({mutationFn:async l=>Nr.ai.createHurreeLensDashboard(l),onSuccess:l=>
1{i(),e.invalidateQueries({queryKey:xt.user.current()}),e.invalidateQueries({queryKey:xt.dashboard.rivaList()}).then(()=>{p(Or.RIVA_DASHBOARD.replace(":dashId",String(l.id)),{state:{showConfetti:!0}})})},onError:l=>{console.error("Error creating riva dashboard:",l);const y=l?.response?.data?.Message||l?.message||"";y.includes("Error calling model")?u(o("rivaVision.createDashboard.modelError")):y.includes("Error formatting json output")?u(o("rivaVision.createDashboard.formatError")):u(o("common.fileUpload.fileError"))}});return{handleCreateDashboard:f.mutateAsync,isLoading:f.isPending,isError:f.isError,error:f.error,customError:a}},Xr=({isFileUploaded:o,onSubmit:p})=>{const{t:e}=qe();return S.jsx("div",{"data-testid":"add-riva-vision-header",children:S.jsx(Lr,{title:"Riva Vision",renderImages:S.jsx(Ir,{hovered:!1}),render:S.jsx(nt,{size:"small",type:"button",variant:"primary","aria-label":e("rivaVision.generateDashboard"),disabled:!o,onClick:p,children:e("rivaVision.generateDashboard")})})})},tt=[{id:1,title:"common.fileTypes.img.title",code:"img",description:"common.fileTypes.img.description"},{id:2,title:"common.fileTypes.txt.title",code:"txt",description:"common.fileTypes.txt.description"},{id:3,title:"common.fileTypes.pdf.title",code:"pdf",description:"common.fileTypes.pdf.title"}],en=({fileType:o,setFileType:p,setIsFileUploaded:e})=>{const{t:i}=qe(),{track:a}=at(),u=tt.find(l=>l.code===o)||tt[0],f=l=>{a(Qe.RIVA_VISION_FILE_SELECT,`${l.code}`),p(l.code),e(!1)};return S.jsx("div",{className:"w-full py-4",children:S.jsx("div",{className:"w-full",children:S.jsx(Ye,{value:u,onChange:f,children:S.jsx("div",{className:"rounded-xl border border-gray-border-50 dark:border-gray-border-dark-500",children:tt.map(l=>S.jsx(Ye.Option,{"data-testid":`file-type-option-${l.code}`,value:l,className:({checked:y})=>Pe("relative flex cursor-pointer border border-gray-border-50","bg-white px-5 py-4 focus:outline-none dark:border-gray-border-dark-500","dark:bg-gray-background-dark-700",y&&"bg-success-accent-50 dark:bg-gray-background-dark-200",l.id===1&&"rounded-t-xl",l.id===3&&"rounded-b-xl"),children:({checked:y})=>S.jsx("div",{className:"flex w-full items-center justify-between",children:S.jsxs("div",{className:"flex items-center",children:[S.jsx(_r,{id:String(l.id),checked:y,tabIndex:0,className:Pe("mr-4 border-2 border-gray-border-50 outline-none","focus:ring-transparent dark:border-gray-border-dark-500","dark:bg-gray-background-dark-700",y&&"text-primary-main-400 focus:outline-primary-main-400 dark:bg-primary-main-500")}),S.jsxs("div",{className:"text-sm",children:[S.jsx(Ye.Label,{as:"p",className:"font-medium text-text-heading-950 dark:text-text-dark-heading",children:i(l.title)}),S.jsx(Ye.Description,{as:"span",className:"text-text-muted-700 dark:text-text-dark-muted",children:S.jsx("span",{children:i(l.description)})})]})]})})},l.code))})})})})};var rt,wt;function tn(){return wt||(wt=1,rt=(function(o){var p={};function e(i){if(p[i])return p[i].exports;var a=p[i]={i,l:!1,exports:{}};return o[i].call(a.exports,a,a.exports,e),a.l=!0,a.exports}return e.m=o,e.c=p,e.d=function(i,a,u){e.o(i,a)||Object.defineProperty(i,a,{enumerable:!0,get:u})},e.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},e.t=function(i,a){if(1&a&&(i=e(i)),8&a||4&a&&typeof i=="object"&&i&&i.__esModule)return i;var u=Object.create(null);if(e.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:i}),2&a&&typeof i!="string")for(var f in i)e.d(u,f,(function(l){return i[l]}).bind(null,f));return u},e.n=function(i){var a=i&&i.__esModule?function(){return i.default}:function(){return i};return e.d(a,"a",a),a},e.o=function(i,a){return Object.prototype.hasOwnProperty.call(i,a)},e.p="",e(e.s=32)})([function(o,p,e){o.exports=e(27)()},function(o,p,e){o.exports=e(25)},function(o,p,e){o.exports=e(21)},function(o,p,e){var i=e(20);o.exports=function(a){for(var u=1;u<arguments.length;u++)if(u%2){var f=arguments[u]!=null?arguments[u]:{},l=Object.keys(f);typeof Object.getOwnPropertySymbols=="function"&&(l=l.concat(Object.getOwnPropertySymbols(f).filter(function(y){return Object.getOwnPropertyDescriptor(f,y).enumerable}))),l.forEach(function(y){i(a,y,f[y])})}else Object.defineProperties(a,Object.getOwnPropertyDescriptors(arguments[u]));return a}},function(o,p){function e(i,a,u,f,l,y,v){try{var k=i[y](v),I=k.value}catch(z){return void u(z)}k.done?a(I):Promise.resolve(I).then(f,l)}o.exports=function(i){return function(){var a=this,u=arguments;return new Promise(function(f,l){var y=i.apply(a,u);
1function v(I){e(y,f,l,v,k,"next",I)}function k(I){e(y,f,l,v,k,"throw",I)}v(void 0)})}}},function(o,p){function e(i){return o.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},e(i)}o.exports=e},function(o,p){o.exports=function(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}},function(o,p){function e(i,a){for(var u=0;u<a.length;u++){var f=a[u];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(i,f.key,f)}}o.exports=function(i,a,u){return a&&e(i.prototype,a),u&&e(i,u),i}},function(o,p,e){var i=e(22),a=e(9);o.exports=function(u,f){return!f||i(f)!=="object"&&typeof f!="function"?a(u):f}},function(o,p){o.exports=function(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(o,p,e){var i=e(23);o.exports=function(a,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(u&&u.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),u&&i(a,u)}},function(o,p,e){var i=e(29),a=e(30),u=e(31);o.exports=function(f,l){return i(f)||a(f,l)||u()}},function(o,p,e){var i=e(17),a=e(18),u=e(19);o.exports=function(f){return i(f)||a(f)||u()}},function(o,p,e){e(5);var i=e(24);function a(u,f,l){return typeof Reflect<"u"&&Reflect.get?o.exports=a=Reflect.get:o.exports=a=function(y,v,k){var I=i(y,v);if(I){var z=Object.getOwnPropertyDescriptor(I,v);return z.get?z.get.call(k):z.value}},a(u,f,l||u)}o.exports=a},function(o,p){o.exports="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgOCAxNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjMzMzMzMzIj48cGF0aCBkPSJNMSwxNCBDMC40LDE0IDAsMTMuNiAwLDEzIEwwLDEgQzAsMC40IDAuNCwwIDEsMCBDMS42LDAgMiwwLjQgMiwxIEwyLDEzIEMyLDEzLjYgMS42LDE0IDEsMTQgWiIgaWQ9IlBhdGgiPjwvcGF0aD48cGF0aCBkPSJNNywxNCBDNi40LDE0IDYsMTMuNiA2LDEzIEw2LDEgQzYsMC40IDYuNCwwIDcsMCBDNy42LDAgOCwwLjQgOCwxIEw4LDEzIEM4LDEzLjYgNy42LDE0IDcsMTQgWiIgaWQ9IlBhdGgiPjwvcGF0aD48L2c+PC9zdmc+Cg=="},function(o,p){o.exports="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTQgMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTUuMCwgMC4wKSIgZmlsbD0iIzMzMzMzMyI+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNC4wLCAwLjApIj48cG9seWdvbiBwb2ludHM9IjcuNzE5IDQuOTY0IDEyLjY5MiAwLjAxNyAxNC4zODkgMS43MTUgOS40MTIgNi42NjYgMTQuMzU0IDExLjYzNCAxMi42NTcgMTMuMzMxIDYuMDE3IDYuNjU3IDcuNzE1IDQuOTYwIj48L3BvbHlnb24+PHBvbHlnb24gcG9pbnRzPSI3LjYxMiA0Ljk2NCA3LjYxNiA0Ljk2MCA5LjMxMyA2LjY1NyAyLjY3NCAxMy4zMzEgMC45NzcgMTEuNjM0IDUuOTE5IDYuNjY2IDAuOTQyIDEuNzE1IDIuNjM5IDAuMDE3Ij48L3BvbHlnb24+PC9nPjwvZz48L3N2Zz4K"},function(o,p){o.exports="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTEgMTUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGc+PHBhdGggZD0iTTAuNSwxNC45IEMwLjIsMTQuNyAwLDE0LjQgMCwxNCBMMCwyIEMwLDEuNiAwLjIsMS4zIDAuNSwxLjEgQzAuOCwwLjkgMS4yLDAuOSAxLjUsMS4xIEwxMC41LDcuMSBDMTAuOCw3LjMgMTAuOSw3LjYgMTAuOSw3LjkgQzEwLjksOC4yIDEwLjcsOC41IDEwLjUsOC43IEwxLjUsMTQuNyBDMS40LDE0LjkgMC44LDE1LjEgMC41LDE0LjkgWiBNMiwzLjkgTDIsMTIuMiBMOC4yLDguMSBMMiwzLjkgWiI+PC9wYXRoPjwvZz48L3N2Zz4K"},function(o,p){o.exports=function(e){if(Array.isArray(e)){for(var i=0,a=new Array(e.length);i<e.length;i++)a[i]=e[i];return a}}},function(o,p){o.exports=function(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}},function(o,p){o.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(o,p){o.exports=function(e,i,a){return i in e?Object.defineProperty(e,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[i]=a,e}},function(o,p,e){var i=(function(a){var u,f=Object.prototype,l=f.hasOwnProperty,y=typeof Symbol=="function"?Symbol:{},v=y.iterator||"@@iterator",k=y.asyncIterator||"@@asyncIterator",I=y.toStringTag||"@@toStringTag";function z(d,n,w,R){var E=n&&n.prototype instanceof be?n:be,_=Object.create(E.prototype),H=new ke(R||[]);return _._invoke=(function(je,Le,r){var c=se;return function(D,j){if(c===J)throw new Error("Generator is already running");if(c===re){if(D==="throw")throw j;return Se()}for(r.method=D,r.arg=j;;){var b=r.delegate;if(b){var L=ge(b,r);
1if(L){if(L===$)continue;return L}}if(r.method==="next")r.sent=r._sent=r.arg;else if(r.method==="throw"){if(c===se)throw c=re,r.arg;r.dispatchException(r.arg)}else r.method==="return"&&r.abrupt("return",r.arg);c=J;var T=W(je,Le,r);if(T.type==="normal"){if(c=r.done?re:U,T.arg===$)continue;return{value:T.arg,done:r.done}}T.type==="throw"&&(c=re,r.method="throw",r.arg=T.arg)}}})(d,w,H),_}function W(d,n,w){try{return{type:"normal",arg:d.call(n,w)}}catch(R){return{type:"throw",arg:R}}}a.wrap=z;var se="suspendedStart",U="suspendedYield",J="executing",re="completed",$={};function be(){}function xe(){}function ne(){}var ae={};ae[v]=function(){return this};var he=Object.getPrototypeOf,te=he&&he(he(Ee([])));te&&te!==f&&l.call(te,v)&&(ae=te);var ue=ne.prototype=be.prototype=Object.create(ae);function ce(d){["next","throw","return"].forEach(function(n){d[n]=function(w){return this._invoke(n,w)}})}function F(d){var n;this._invoke=function(w,R){function E(){return new Promise(function(_,H){(function je(Le,r,c,D){var j=W(d[Le],d,r);if(j.type!=="throw"){var b=j.arg,L=b.value;return L&&typeof L=="object"&&l.call(L,"__await")?Promise.resolve(L.__await).then(function(T){je("next",T,c,D)},function(T){je("throw",T,c,D)}):Promise.resolve(L).then(function(T){b.value=T,c(b)},function(T){return je("throw",T,c,D)})}D(j.arg)}
1)(w,R,_,H)})}return n=n?n.then(E,E):E()}}function ge(d,n){var w=d.iterator[n.method];if(w===u){if(n.delegate=null,n.method==="throw"){if(d.iterator.return&&(n.method="return",n.arg=u,ge(d,n),n.method==="throw"))return $;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return $}var R=W(w,d.iterator,n.arg);if(R.type==="throw")return n.method="throw",n.arg=R.arg,n.delegate=null,$;var E=R.arg;return E?E.done?(n[d.resultName]=E.value,n.next=d.nextLoc,n.method!=="return"&&(n.method="next",n.arg=u),n.delegate=null,$):E:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,$)}function t(d){var n={tryLoc:d[0]};1 in d&&(n.catchLoc=d[1]),2 in d&&(n.finallyLoc=d[2],n.afterLoc=d[3]),this.tryEntries.push(n)}function Re(d){var n=d.completion||{};n.type="normal",delete n.arg,d.completion=n}function ke(d){this.tryEntries=[{tryLoc:"root"}],d.forEach(t,this),this.reset(!0)}function Ee(d){if(d){var n=d[v];if(n)return n.call(d);if(typeof d.next=="function")return d;if(!isNaN(d.length)){var w=-1,R=function E(){for(;++w<d.length;)if(l.call(d,w))return E.value=d[w],E.done=!1,E;return E.value=u,E.done=!0,E};return R.next=R}}return{next:Se}}function Se(){return{value:u,done:!0}}return xe.prototype=ue.constructor=ne,ne.constructor=xe,ne[I]=xe.displayName="GeneratorFunction",a.isGeneratorFunction=function(d){var n=typeof d=="function"&&d.constructor;return!!n&&(n===xe||(n.displayName||n.name)==="GeneratorFunction")},a.mark=function(d){return Object.setPrototypeOf?Object.setPrototypeOf(d,ne):(d.__proto__=ne,I in d||(d[I]="GeneratorFunction")),d.prototype=Object.create(ue),d},a.awrap=function(d){return{__await:d}},ce(F.prototype),F.prototype[k]=function(){return this},a.AsyncIterator=F,a.async=function(d,n,w,R){var E=new F(z(d,n,w,R));return a.isGeneratorFunction(n)?E:E.next().then(function(_){return _.done?_.value:E.next()})},ce(ue),ue[I]="Generator",ue[v]=function(){return this},ue.toString=function(){return"[object Generator]"},a.keys=function(d){var n=[];for(var w in d)n.push(w);return n.reverse(),function R(){for(;n.length;){var E=n.pop();if(E in d)return R.value=E,R.done=!1,R}return R.done=!0,R}},a.values=Ee,ke.prototype={constructor:ke,reset:function(d){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(Re),!d)for(var n in this)n.charAt(0)==="t"&&l.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=u)},stop:function(){this.done=!0;var d=this.tryEntries[0].completion;if(d.type==="throw")throw d.arg;return this.rval},dispatchException:function(d){if(this.done)throw d;var n=this;function w(Le,r){return _.type="throw",_.arg=d,n.next=Le,r&&(n.method="next",n.arg=u),!!r}for(var R=this.tryEntries.length-1;0<=R;--R){var E=this.tryEntries[R],_=E.completion;if(E.tryLoc==="root")return w("end");if(E.tryLoc<=this.prev){var H=l.call(E,"catchLoc"),je=l.call(E,"finallyLoc");if(H&&je){if(this.prev<E.catchLoc)return w(E.catchLoc,!0);if(this.prev<E.finallyLoc)return w(E.finallyLoc)}else if(H){if(this.prev<E.catchLoc)return w(E.catchLoc,!0)}else{if(!je)throw new Error("try statement without catch or finally");if(this.prev<E.finallyLoc)return w(E.finallyLoc)}}}},abrupt:function(d,n){for(var w=this.tryEntries.length-1;0<=w;--w){var R=this.tryEntries[w];if(R.tryLoc<=this.prev&&l.call(R,"finallyLoc")&&this.prev<R.finallyLoc){var E=R;break}}E&&(d==="break"||d==="continue")&&E.tryLoc<=n&&n<=E.finallyLoc&&(E=null);var _=E?E.completion:{};return _.type=d,_.arg=n,E?(this.method="next",this.next=E.finallyLoc,$):this.complete(_)},complete:function(d,n){if(d.type==="throw")throw d.arg;return d.type==="break"||d.type==="continue"?this.next=d.arg:d.type==="return"?(this.rval=this.arg=d.arg,this.method="return",this.next="end"):d.type==="normal"&&n&&(this.next=n),$},finish:function(d){for(var n=this.tryEntries.length-1;0<=n;--n){var w=this.tryEntries[n];if(w.finallyLoc===d)return this.complete(w.completion,w.afterLoc),Re(w),$}},catch:function(d){for(var n=this.tryEntries.length-1;0<=n;--n){var w=this.tryEntries[n];if(w.tryLoc===d){var R=w.completion;if(R.type==="throw"){var E=R.arg;Re(w)}return E}}throw new Error("illegal catch attempt")},delegateYield:function(d,n,w){return this.delegate={iterator:Ee(d),resultName:n,nextLoc:w},this.method==="next"&&(this.arg=u),$}},a}
1)(o.exports);try{regeneratorRuntime=i}catch{Function("r","regeneratorRuntime = r")(i)}},function(o,p){function e(a){return(e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u})(a)}function i(a){return typeof Symbol=="function"&&e(Symbol.iterator)==="symbol"?o.exports=i=function(u){return e(u)}:o.exports=i=function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":e(u)},i(a)}o.exports=i},function(o,p){function e(i,a){return o.exports=e=Object.setPrototypeOf||function(u,f){return u.__proto__=f,u},e(i,a)}o.exports=e},function(o,p,e){var i=e(5);o.exports=function(a,u){for(;!Object.prototype.hasOwnProperty.call(a,u)&&(a=i(a))!==null;);return a}},function(o,p,e){var i=e(26),a=typeof Symbol=="function"&&Symbol.for,u=a?Symbol.for("react.element"):60103,f=a?Symbol.for("react.portal"):60106,l=a?Symbol.for("react.fragment"):60107,y=a?Symbol.for("react.strict_mode"):60108,v=a?Symbol.for("react.profiler"):60114,k=a?Symbol.for("react.provider"):60109,I=a?Symbol.for("react.context"):60110,z=a?Symbol.for("react.concurrent_mode"):60111,W=a?Symbol.for("react.forward_ref"):60112,se=a?Symbol.for("react.suspense"):60113,U=a?Symbol.for("react.memo"):60115,J=a?Symbol.for("react.lazy"):60116,re=typeof Symbol=="function"&&Symbol.iterator;function $(r){for(var c=arguments.length-1,D="https://reactjs.org/docs/error-decoder.html?invariant="+r,j=0;j<c;j++)D+="&args[]="+encodeURIComponent(arguments[j+1]);(function(b,L,T,de,Y,Z,x,C){if(!b){if((b=void 0)===L)b=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var h=[T,de,Y,Z,x,C],s=0;(b=Error(L.replace(/%s/g,function(){return h[s++]}))).name="Invariant Violation"}throw b.framesToPop=1,b}})(!1,"Minified React error #"+r+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",D)}var be={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},xe={};function ne(r,c,D){this.props=r,this.context=c,this.refs=xe,this.updater=D||be}function ae(){}function he(r,c,D){this.props=r,this.context=c,this.refs=xe,this.updater=D||be}ne.prototype.isReactComponent={},ne.prototype.setState=function(r,c){typeof r!="object"&&typeof r!="function"&&r!=null&&$("85"),this.updater.enqueueSetState(this,r,c,"setState")},ne.prototype.forceUpdate=function(r){this.updater.enqueueForceUpdate(this,r,"forceUpdate")},ae.prototype=ne.prototype;var te=he.prototype=new ae;te.constructor=he,i(te,ne.prototype),te.isPureReactComponent=!0;var ue={current:null},ce={current:null},F=Object.prototype.hasOwnProperty,ge={key:!0,ref:!0,__self:!0,__source:!0};function t(r,c,D){var j=void 0,b={},L=null,T=null;if(c!=null)for(j in c.ref!==void 0&&(T=c.ref),c.key!==void 0&&(L=""+c.key),c)F.call(c,j)&&!ge.hasOwnProperty(j)&&(b[j]=c[j]);var de=arguments.length-2;if(de===1)b.children=D;else if(1<de){for(var Y=Array(de),Z=0;Z<de;Z++)Y[Z]=arguments[Z+2];b.children=Y}if(r&&r.defaultProps)for(j in de=r.defaultProps)b[j]===void 0&&(b[j]=de[j]);return{$$typeof:u,type:r,key:L,ref:T,props:b,_owner:ce.current}}function Re(r){return typeof r=="object"&&r!==null&&r.$$typeof===u}var ke=/\/+/g,Ee=[];
vendor: 4,701 bytes, line 1
1function Se(r,c,D,j){if(Ee.length){var b=Ee.pop();return b.result=r,b.keyPrefix=c,b.func=D,b.context=j,b.count=0,b}return{result:r,keyPrefix:c,func:D,context:j,count:0}}function d(r){r.result=null,r.keyPrefix=null,r.func=null,r.context=null,r.count=0,Ee.length<10&&Ee.push(r)}function n(r,c,D){return r==null?0:(function j(b,L,T,de){var Y=typeof b;Y!=="undefined"&&Y!=="boolean"||(b=null);var Z=!1;if(b===null)Z=!0;else switch(Y){case"string":case"number":Z=!0;break;case"object":switch(b.$$typeof){case u:case f:Z=!0}}if(Z)return T(de,b,L===""?"."+w(b,0):L),1;if(Z=0,L=L===""?".":L+":",Array.isArray(b))for(var x=0;x<b.length;x++){var C=L+w(Y=b[x],x);Z+=j(Y,C,T,de)}else if(typeof(C=b===null||typeof b!="object"?null:typeof(C=re&&b[re]||b["@@iterator"])=="function"?C:null)=="function")for(b=C.call(b),x=0;!(Y=b.next()).done;)Z+=j(Y=Y.value,C=L+w(Y,x++),T,de);else Y==="object"&&$("31",(T=""+b)=="[object Object]"?"object with keys {"+Object.keys(b).join(", ")+"}":T,"");return Z})(r,"",c,D)}function w(r,c){return typeof r=="object"&&r!==null&&r.key!=null?(function(D){var j={"=":"=0",":":"=2"};return"$"+(""+D).replace(/[=:]/g,function(b){return j[b]})})(r.key):c.toString(36)}function R(r,c){r.func.call(r.context,c,r.count++)}function E(r,c,D){var j=r.result,b=r.keyPrefix;r=r.func.call(r.context,c,r.count++),Array.isArray(r)?_(r,j,D,function(L){return L}):r!=null&&(Re(r)&&(r=(function(L,T){return{$$typeof:u,type:L.type,key:T,ref:L.ref,props:L.props,_owner:L._owner}})(r,b+(!r.key||c&&c.key===r.key?"":(""+r.key).replace(ke,"$&/")+"/")+D)),j.push(r))}function _(r,c,D,j,b){var L="";D!=null&&(L=(""+D).replace(ke,"$&/")+"/"),n(r,E,c=Se(c,L,j,b)),d(c)}function H(){var r=ue.current;return r===null&&$("321"),r}var je={Children:{map:function(r,c,D){if(r==null)return r;var j=[];return _(r,j,null,c,D),j},forEach:function(r,c,D){if(r==null)return r;n(r,R,c=Se(null,null,c,D)),d(c)},count:function(r){return n(r,function(){return null},null)},toArray:function(r){var c=[];return _(r,c,null,function(D){return D}),c},only:function(r){return Re(r)||$("143"),r}},createRef:function(){return{current:null}},Component:ne,PureComponent:he,createContext:function(r,c){return c===void 0&&(c=null),(r={$$typeof:I,_calculateChangedBits:c,_currentValue:r,_currentValue2:r,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:k,_context:r},r.Consumer=r},forwardRef:function(r){return{$$typeof:W,render:r}},lazy:function(r){return{$$typeof:J,_ctor:r,_status:-1,_result:null}},memo:function(r,c){return{$$typeof:U,type:r,compare:c===void 0?null:c}},useCallback:function(r,c){return H().useCallback(r,c)},useContext:function(r,c){return H().useContext(r,c)},useEffect:function(r,c){return H().useEffect(r,c)},useImperativeHandle:function(r,c,D){return H().useImperativeHandle(r,c,D)},useDebugValue:function(){},useLayoutEffect:function(r,c){return H().useLayoutEffect(r,c)},useMemo:function(r,c){return H().useMemo(r,c)},useReducer:function(r,c,D){return H().useReducer(r,c,D)},useRef:function(r){return H().useRef(r)},useState:function(r){return H().useState(r)},Fragment:l,StrictMode:y,Suspense:se,createElement:t,cloneElement:function(r,c,D){r==null&&$("267",r);var j=void 0,b=i({},r.props),L=r.key,T=r.ref,de=r._owner;if(c!=null){c.ref!==void 0&&(T=c.ref,de=ce.current),c.key!==void 0&&(L=""+c.key);var Y=void 0;for(j in r.type&&r.type.defaultProps&&(Y=r.type.defaultProps),c)F.call(c,j)&&!ge.hasOwnProperty(j)&&(b[j]=c[j]===void 0&&Y!==void 0?Y[j]:c[j])}if((j=arguments.length-2)===1)b.children=D;else if(1<j){Y=Array(j);for(var Z=0;Z<j;Z++)Y[Z]=arguments[Z+2];b.children=Y}return{$$typeof:u,type:r.type,key:L,ref:T,props:b,_owner:de}},createFactory:function(r){var c=t.bind(null,r);return c.type=r,c},isValidElement:Re,version:"16.8.6",unstable_ConcurrentMode:z,unstable_Profiler:v,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:ue,ReactCurrentOwner:ce,assign:i}},Le=je;o.exports=Le.default||Le},function(o,p,e){var i=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;o.exports=(function(){try{if(!Object.assign)return!1;var f=new String("abc");if(f[5]="de",Object.getOwnPropertyNames(f)[0]==="5")return!1;for(var l={},y=0;y<10;y++)l["_"+String.fromCharCode(y)]=y;if(Object.getOwnPropertyNames(l).map(function(k){return l[k]}).join("")!=="0123456789")return!1;var v={};return"abcdefghijklmnopqrst".split("").forEach(function(k){v[k]=k}),Object.keys(Object.assign({},v)).join("")==="abcdefghijklmnopqrst"}catch{return!1}})()?Object.assign:function(f,l){for(var y,v,k=(function(se){if(se==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(se)})(f),I=1;I<arguments.length;
1I++){for(var z in y=Object(arguments[I]))a.call(y,z)&&(k[z]=y[z]);if(i){v=i(y);for(var W=0;W<v.length;W++)u.call(y,v[W])&&(k[v[W]]=y[v[W]])}}return k}},function(o,p,e){var i=e(28);function a(){}function u(){}u.resetWarningCache=a,o.exports=function(){function f(v,k,I,z,W,se){if(se!==i){var U=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw U.name="Invariant Violation",U}}function l(){return f}var y={array:f.isRequired=f,bool:f,func:f,number:f,object:f,string:f,symbol:f,any:f,arrayOf:l,element:f,elementType:f,instanceOf:l,node:f,objectOf:l,oneOf:l,oneOfType:l,shape:l,exact:l,checkPropTypes:u,resetWarningCache:a};return y.PropTypes=y}},function(o,p,e){o.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(o,p){o.exports=function(e){if(Array.isArray(e))return e}},function(o,p){o.exports=function(e,i){var a=[],u=!0,f=!1,l=void 0;try{for(var y,v=e[Symbol.iterator]();!(u=(y=v.next()).done)&&(a.push(y.value),!i||a.length!==i);u=!0);}catch(k){f=!0,l=k}finally{try{u||v.return==null||v.return()}finally{if(f)throw l}}return a}},function(o,p){o.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(o,p,e){e.r(p);function i(x){var C=x.input,h=x.previews,s=x.submitButton,g=x.dropzoneProps,O=x.files,m=x.extra.maxFiles;return F.a.createElement("div",Object.assign({},g),h,O.length<m&&C,0<O.length&&s)}var a=e(12),u=e.n(a),f=e(3),l=e.n(f),y=e(2),v=e.n(y),k=e(4),I=e.n(k),z=e(6),W=e.n(z),se=e(7),U=e.n(se),J=e(8),re=e.n(J),$=e(9),be=e.n($),xe=e(10),ne=e.n(xe),ae=e(5),he=e.n(ae),te=e(13),ue=e.n(te),ce=e(1),F=e.n(ce),ge=e(0),t=e.n(ge);i.propTypes={input:t.a.node,previews:t.a.arrayOf(t.a.node),submitButton:t.a.node,dropzoneProps:t.a.shape({ref:t.a.any.isRequired,className:t.a.string.isRequired,style:t.a.object,onDragEnter:t.a.func.isRequired,onDragOver:t.a.func.isRequired,onDragLeave:t.a.func.isRequired,onDrop:t.a.func.isRequired}).isRequired,files:t.a.arrayOf(t.a.any).isRequired,extra:t.a.shape({active:t.a.bool.isRequired,reject:t.a.bool.isRequired,dragged:t.a.arrayOf(t.a.any).isRequired,accept:t.a.string.isRequired,multiple:t.a.bool.isRequired,minSizeBytes:t.a.number.isRequired,maxSizeBytes:t.a.number.isRequired,maxFiles:t.a.number.isRequired,onFiles:t.a.func.isRequired,onCancelFile:t.a.func.isRequired,onRemoveFile:t.a.func.isRequired,onRestartFile:t.a.func.isRequired}).isRequired};function Re(x){var C,h=x.className,s=x.labelClassName,g=x.labelWithFilesClassName,O=x.style,m=x.labelStyle,A=x.labelWithFilesStyle,N=x.getFilesFromEvent,Q=x.accept,X=x.multiple,K=x.disabled,V=x.content,ye=x.withFilesContent,pe=x.onFiles,fe=x.files;return F.a.createElement("label",{className:0<fe.length?g:s,style:0<fe.length?A:m},0<fe.length?ye:V,F.a.createElement("input",{className:h,style:O,type:"file",accept:Q,multiple:X,disabled:K,onChange:(C=I()(v.a.mark(function oe(q){var le,B;return v.a.wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return le=q.target,M.next=3,N(q);case 3:B=M.sent,pe(B),le.value=null;case 6:case"end":return M.stop()}},oe)})),function(oe){return C.apply(this,arguments)})}))}var ke=i;Re.propTypes={className:t.a.string,labelClassName:t.a.string,labelWithFilesClassName:t.a.string,style:t.a.object,labelStyle:t.a.object,labelWithFilesStyle:t.a.object,getFilesFromEvent:t.a.func.isRequired,accept:t.a.string.isRequired,multiple:t.a.bool.isRequired,disabled:t.a.bool.isRequired,content:t.a.node,withFilesContent:t.a.node,onFiles:t.a.func.isRequired,files:t.a.arrayOf(t.a.any).isRequired,extra:t.a.shape({active:t.a.bool.isRequired,reject:t.a.bool.isRequired,dragged:t.a.arrayOf(t.a.any).isRequired,accept:t.a.string.isRequired,multiple:t.a.bool.isRequired,minSizeBytes:t.a.number.isRequired,maxSizeBytes:t.a.number.isRequired,maxFiles:t.a.number.isRequired}).isRequired};function Ee(x){for(var C=0,h=x;1024<=h;)h/=1024,C+=1;return"".concat(h.toFixed(10<=h||C<1?0:1)).concat(["bytes","kB","MB","GB","TB","PB","EB","ZB","YB"][C])}function Se(x){var C=new Date(0);C.setSeconds(x);var h=C.toISOString().slice(11,19);return x<3600?h.slice(3):h}function d(x,C){if(!C||C==="*")return!0;var h=x.type||"",s=h.replace(/\/.*$/,"");return C.split(",").map(function(g){return g.trim()}).some(function(g){return g.charAt(0)==="."?x.name===void 0||x.name.toLowerCase().endsWith(g.toLowerCase()):g.endsWith("/*")?s===g.replace(/\/.*$/,""):h===g})}function n(x){for(var C=arguments.length,h=new Array(1<C?C-1:0),s=1;s<C;s++)h[s-1]=arguments[s];return typeof x=="function"?x.apply(void 0,h):x}function w(x){var C=null;if("dataTransfer"in x){var h=x.dataTransfer;"files"in h&&h.files.length?C=h.files:h.items&&h.items.length&&(C=h.items)}else x.target&&x.target.files&&(C=x.target.files);return Array.prototype.slice.call(C)}var R=Re,E=e(11),_=e.n(E),H={dropzone:"dzu-dropzone",dropzoneActive:"dzu-dropzoneActive",dropzoneReject:"dzu-dropzoneActive",dropzoneDisabled:"dzu-dropzoneDisabled",input:"dzu-input",inputLabel:"dzu-inputLabel",inputLabelWithFiles:"dzu-inputLabelWithFiles",preview:"dzu-previewContainer",previewImage:"dzu-previewImage",submitButtonContainer:"dzu-submitButtonContainer",submitButton:"dzu-submitButton"},je=e(14),Le=e.n(je),r=e(15),c=e.n(r),D=e(16),j=e.n(D),b={cancel:{backgroundImage:"url(".concat(Le.a,")")},remove:{backgroundImage:"url(".concat(c.a,")")},restart:{backgroundImage:"url(".concat(j.a,")")}},L=(function(x){function C(){return W()(this,C),re()(this,he()(C).apply(this,arguments))}return ne()(C,x),U()(C,[{key:"render",value:function(){var h=this.props,s=h.className,g=h.imageClassName,O=h.style,m=h.imageStyle,A=h.fileWithMeta,N=A.cancel,Q=A.remove,X=A.restart,K=h.meta,V=K.name,ye=V===void 0?"":V,pe=K.percent,fe=pe===void 0?0:pe,oe=K.size,q=oe===void 0?0:oe,le=K.previewUrl,B=K.status,M=K.duration,Ce=K.validationError,P=h.isUpload,De=h.canCancel,ee=h.canRemove,Ie=h.canRestart,_e=h.extra.minSizeBytes,me="".concat(ye||"?",", ").concat(Ee(q));return M&&(me="".concat(me,", ").concat(Se(M))),B==="error_file_size"||B==="error_validation"?F.a.createElement("div",{className:s,style:O},F.a.createElement("span",{className:"dzu-previewFileNameError"},me),B==="error_file_size"&&F.a.createElement("span",null,q<_e?"File too small":"File too big"),B==="error_validation"&&F.a.createElement("span",null,String(Ce)),ee&&F.a.createElement("span",{className:"dzu-previewButton",style:b.remove,onClick:Q})):(B!=="error_upload_params"&&B!=="exception_upload"&&B!=="error_upload"||(me="".concat(me," (upload failed)")),B==="aborted"&&(me="".concat(me," (cancelled)")),F.a.createElement("div",{className:s,style:O},le&&F.a.createElement("img",{className:g,style:m,src:le,alt:me,title:me}),!le&&F.a.createElement("span",{className:"dzu-previewFileName"},me),F.a.createElement("div",{className:"dzu-previewStatusContainer"},P&&F.a.createElement("progress",{max:100,value:B==="done"||B==="headers_received"?100:fe}),B==="uploading"&&De&&F.a.createElement("span",{className:"dzu-previewButton",style:b.cancel,onClick:N}),B!=="preparing"&&B!=="getting_upload_params"&&B!=="uploading"&&ee&&F.a.createElement("span",{className:"dzu-previewButton",style:b.remove,onClick:Q}),["error_upload_params","exception_upload","error_upload","aborted","ready"].includes(B)&&Ie&&F.a.createElement("span",{className:"dzu-previewButton",style:b.restart,onClick:X}))))}}]),C})(F.a.PureComponent);
1L.propTypes={className:t.a.string,imageClassName:t.a.string,style:t.a.object,imageStyle:t.a.object,fileWithMeta:t.a.shape({file:t.a.any.isRequired,meta:t.a.object.isRequired,cancel:t.a.func.isRequired,restart:t.a.func.isRequired,remove:t.a.func.isRequired,xhr:t.a.any}).isRequired,meta:t.a.shape({status:t.a.oneOf(["preparing","error_file_size","error_validation","ready","getting_upload_params","error_upload_params","uploading","exception_upload","aborted","error_upload","headers_received","done"]).isRequired,type:t.a.string.isRequired,name:t.a.string,uploadedDate:t.a.string.isRequired,percent:t.a.number,size:t.a.number,lastModifiedDate:t.a.string,previewUrl:t.a.string,duration:t.a.number,width:t.a.number,height:t.a.number,videoWidth:t.a.number,videoHeight:t.a.number,validationError:t.a.any}).isRequired,isUpload:t.a.bool.isRequired,canCancel:t.a.bool.isRequired,canRemove:t.a.bool.isRequired,canRestart:t.a.bool.isRequired,files:t.a.arrayOf(t.a.any).isRequired,extra:t.a.shape({active:t.a.bool.isRequired,reject:t.a.bool.isRequired,dragged:t.a.arrayOf(t.a.any).isRequired,accept:t.a.string.isRequired,multiple:t.a.bool.isRequired,minSizeBytes:t.a.number.isRequired,maxSizeBytes:t.a.number.isRequired,maxFiles:t.a.number.isRequired}).isRequired};function T(x){var C=x.className,h=x.buttonClassName,s=x.style,g=x.buttonStyle,O=x.disabled,m=x.content,A=x.onSubmit,N=x.files,Q=N.some(function(X){return["preparing","getting_upload_params","uploading"].includes(X.meta.status)})||!N.some(function(X){return["headers_received","done"].includes(X.meta.status)});return F.a.createElement("div",{className:C,style:s},F.a.createElement("button",{className:h,style:g,onClick:function(){A(N.filter(function(X){return["headers_received","done"].includes(X.meta.status)}))},disabled:O||Q},m))}var de=L;T.propTypes={className:t.a.string,buttonClassName:t.a.string,style:t.a.object,buttonStyle:t.a.object,disabled:t.a.bool.isRequired,content:t.a.node,onSubmit:t.a.func.isRequired,files:t.a.arrayOf(t.a.object).isRequired,extra:t.a.shape({active:t.a.bool.isRequired,reject:t.a.bool.isRequired,dragged:t.a.arrayOf(t.a.any).isRequired,accept:t.a.string.isRequired,multiple:t.a.bool.isRequired,minSizeBytes:t.a.number.isRequired,maxSizeBytes:t.a.number.isRequired,maxFiles:t.a.number.isRequired}).isRequired};var Y=T;e.d(p,"Layout",function(){return ke}),e.d(p,"Input",function(){return R}),e.d(p,"Preview",function(){return de}),e.d(p,"SubmitButton",function(){return Y}),e.d(p,"formatBytes",function(){return Ee}),e.d(p,"formatDuration",function(){return Se}),e.d(p,"accepts",function(){return d}),e.d(p,"defaultClassNames",function(){return H}),e.d(p,"getFilesFromEvent",function(){return w});var Z=(function(x){function C(h){var s;
1return W()(this,C),(s=re()(this,he()(C).call(this,h))).forceUpdate=function(){s.mounted&&ue()(he()(C.prototype),"forceUpdate",be()(s)).call(be()(s))},s.getFilesFromEvent=function(){return s.props.getFilesFromEvent||w},s.getDataTransferItemsFromEvent=function(){return s.props.getDataTransferItemsFromEvent||w},s.handleDragEnter=(function(){var g=I()(v.a.mark(function O(m){var A;return v.a.wrap(function(N){for(;;)switch(N.prev=N.next){case 0:return m.preventDefault(),m.stopPropagation(),N.next=4,s.getDataTransferItemsFromEvent()(m);case 4:A=N.sent,s.setState({active:!0,dragged:A});case 6:case"end":return N.stop()}},O)}));return function(O){return g.apply(this,arguments)}})(),s.handleDragOver=(function(){var g=I()(v.a.mark(function O(m){var A;return v.a.wrap(function(N){for(;;)switch(N.prev=N.next){case 0:return m.preventDefault(),m.stopPropagation(),clearTimeout(s.dragTimeoutId),N.next=5,s.getDataTransferItemsFromEvent()(m);case 5:A=N.sent,s.setState({active:!0,dragged:A});case 7:case"end":return N.stop()}},O)}));return function(O){return g.apply(this,arguments)}})(),s.handleDragLeave=function(g){g.preventDefault(),g.stopPropagation(),s.dragTimeoutId=window.setTimeout(function(){return s.setState({active:!1,dragged:[]})},150)},s.handleDrop=(function(){var g=I()(v.a.mark(function O(m){var A;return v.a.wrap(function(N){for(;;)switch(N.prev=N.next){case 0:return m.preventDefault(),m.stopPropagation(),s.setState({active:!1,dragged:[]}),N.next=5,s.getFilesFromEvent()(m);case 5:A=N.sent,s.handleFiles(A);case 7:case"end":return N.stop()}},O)}));return function(O){return g.apply(this,arguments)}})(),s.handleDropDisabled=function(g){g.preventDefault(),g.stopPropagation(),s.setState({active:!1,dragged:[]})},s.handleChangeStatus=function(g){if(s.props.onChangeStatus){var O=(s.props.onChangeStatus(g,g.meta.status,s.files)||{}).meta,m=O===void 0?{}:O;m&&(delete m.status,g.meta=l()({},g.meta,{},m),s.forceUpdate())}},s.handleSubmit=function(g){s.props.onSubmit&&s.props.onSubmit(g,u()(s.files))},s.handleCancel=function(g){g.meta.status==="uploading"&&(g.meta.status="aborted",g.xhr&&g.xhr.abort(),s.handleChangeStatus(g),s.forceUpdate())},s.handleRemove=function(g){var O=s.files.findIndex(function(m){return m===g});O!==-1&&(URL.revokeObjectURL(g.meta.previewUrl||""),g.meta.status="removed",s.handleChangeStatus(g),s.files.splice(O,1),s.forceUpdate())},s.handleRestart=function(g){s.props.getUploadParams&&(g.meta.status==="ready"?g.meta.status="started":g.meta.status="restarted",s.handleChangeStatus(g),g.meta.status="getting_upload_params",g.meta.percent=0,s.handleChangeStatus(g),s.forceUpdate(),s.uploadFile(g))},s.handleFiles=function(g){g.forEach(function(m,A){return s.handleFile(m,"".concat(new Date().getTime(),"-").concat(A))});var O=s.dropzone.current;O&&setTimeout(function(){return O.scroll({top:O.scrollHeight,behavior:"smooth"})},150)},s.handleFile=(function(){var g=I()(v.a.mark(function O(m,A){var N,Q,X,K,V,ye,pe,fe,oe,q,le,B,M,Ce,P,De;return v.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:if(N=m.name,Q=m.size,X=m.type,K=m.lastModified,V=s.props,ye=V.minSizeBytes,pe=V.maxSizeBytes,fe=V.maxFiles,oe=V.accept,q=V.getUploadParams,le=V.autoUpload,B=V.validate,M=new Date().toISOString(),Ce=K&&new Date(K).toISOString(),P={file:m,meta:{name:N,size:Q,type:X,lastModifiedDate:Ce,uploadedDate:M,percent:0,id:A}},m.type==="application/x-moz-file"||d(m,oe)){ee.next=9;break}return P.meta.status="rejected_file_type",s.handleChangeStatus(P),ee.abrupt("return");case 9:if(s.files.length>=fe)return P.meta.status="rejected_max_files",s.handleChangeStatus(P),ee.abrupt("return");ee.next=13;break;case 13:if(P.cancel=function(){return s.handleCancel(P)},P.remove=function(){return s.handleRemove(P)},P.restart=function(){return s.handleRestart(P)},P.meta.status="preparing",s.files.push(P),s.handleChangeStatus(P),s.forceUpdate(),Q<ye||pe<Q)return P.meta.status="error_file_size",s.handleChangeStatus(P),s.forceUpdate(),ee.abrupt("return");ee.next=25;break;case 25:return ee.next=27,s.generatePreview(P);case 27:if(!B){ee.next=35;break}if(De=B(P))return P.meta.status="error_validation",P.meta.validationError=De,s.handleChangeStatus(P),s.forceUpdate(),ee.abrupt("return");ee.next=35;break;case 35:q?le?(s.uploadFile(P),P.meta.status="getting_upload_params"):P.meta.status="ready":P.meta.status="done",s.handleChangeStatus(P),s.forceUpdate();case 38:case"end":return ee.stop()}},O)}));return function(O,m){return g.apply(this,arguments)}})(),s.generatePreview=(function(){var g=I()(v.a.mark(function O(m){var A,N,Q,X,K,V,ye,pe,fe,oe;return v.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:if(A=m.meta.type,N=m.file,Q=A.startsWith("image/"),X=A.startsWith("audio/"),K=A.startsWith("video/"),Q||
1X||K){q.next=6;break}return q.abrupt("return");case 6:if(V=URL.createObjectURL(N),ye=function(le){return Promise.race([new Promise(function(B){le instanceof HTMLImageElement?le.onload=B:le.onloadedmetadata=B}),new Promise(function(B,M){setTimeout(M,1e3)})])},q.prev=8,Q)return(pe=new Image).src=V,m.meta.previewUrl=V,q.next=15,ye(pe);q.next=17;break;case 15:m.meta.width=pe.width,m.meta.height=pe.height;case 17:if(X)return(fe=new Audio).src=V,q.next=22,ye(fe);q.next=23;break;case 22:m.meta.duration=fe.duration;case 23:if(K)return(oe=document.createElement("video")).src=V,q.next=28,ye(oe);q.next=31;break;case 28:m.meta.duration=oe.duration,m.meta.videoWidth=oe.videoWidth,m.meta.videoHeight=oe.videoHeight;case 31:Q||URL.revokeObjectURL(V),q.next=37;break;case 34:q.prev=34,q.t0=q.catch(8),URL.revokeObjectURL(V);case 37:s.forceUpdate();case 38:case"end":return q.stop()}},O,null,[[8,34]])}));return function(O){return g.apply(this,arguments)}})(),s.uploadFile=(function(){var g=I()(v.a.mark(function O(m){var A,N,Q,X,K,V,ye,pe,fe,oe,q,le,B,M,Ce,P,De,ee,Ie,_e,me;return v.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:if(A=s.props.getUploadParams){ie.next=3;break}return ie.abrupt("return");case 3:return N=null,ie.prev=4,ie.next=7,A(m);case 7:N=ie.sent,ie.next=13;break;case 10:ie.prev=10,ie.t0=ie.catch(4),console.error("Error Upload Params",ie.t0.stack);case 13:if(N===null)return ie.abrupt("return");ie.next=15;break;case 15:if(X=(Q=N).url,K=Q.method,V=K===void 0?"POST":K,ye=Q.body,pe=Q.fields,fe=pe===void 0?{}:pe,oe=Q.headers,q=oe===void 0?{}:oe,le=Q.meta,delete(B=le===void 0?{}:le).status,X){ie.next=22;break}return m.meta.status="error_upload_params",s.handleChangeStatus(m),s.forceUpdate(),ie.abrupt("return");case 22:for(M=new XMLHttpRequest,Ce=new FormData,M.open(V,X,!0),P=0,De=Object.keys(fe);P<De.length;P++)ee=De[P],Ce.append(ee,fe[ee]);for(M.setRequestHeader("X-Requested-With","XMLHttpRequest"),Ie=0,_e=Object.keys(q);Ie<_e.length;Ie++)me=_e[Ie],M.setRequestHeader(me,q[me]);m.meta=l()({},m.meta,{},B),M.upload.addEventListener("progress",function(ve){m.meta.percent=100*ve.loaded/ve.total||100,s.forceUpdate()}),M.addEventListener("readystatechange",function(){M.readyState!==2&&M.readyState!==4||(M.status===0&&m.meta.status!=="aborted"&&(m.meta.status="exception_upload",s.handleChangeStatus(m),s.forceUpdate()),0<M.status&&M.status<400&&(m.meta.percent=100,M.readyState===2&&(m.meta.status="headers_received"),M.readyState===4&&(m.meta.status="done"),s.handleChangeStatus(m),s.forceUpdate()),400<=M.status&&m.meta.status!=="error_upload"&&(m.meta.status="error_upload",s.handleChangeStatus(m),s.forceUpdate()))}),Ce.append("file",m.file),s.props.timeout&&(M.timeout=s.props.timeout),M.send(ye||Ce),m.xhr=M,m.meta.status="uploading",s.handleChangeStatus(m),s.forceUpdate();case 38:case"end":return ie.stop()}},O,null,[[4,10]])}));return function(O){return g.apply(this,arguments)}})(),s.state={active:!1,dragged:[]},s.files=[],s.mounted=!0,s.dropzone=F.a.createRef(),s}return ne()(C,x),U()(C,[{key:"componentDidMount",value:function(){this.props.initialFiles&&this.handleFiles(this.props.initialFiles)}},{key:"componentDidUpdate",value:function(h){var s=this.props.initialFiles;h.initialFiles!==s&&s&&this.handleFiles(s)}},{key:"componentWillUnmount",value:function(){var h=!(this.mounted=!1),s=!1,g=void 0;try{for(var O,m=this.files[Symbol.iterator]();!(h=(O=m.next()).done);h=!0){var A=O.value;this.handleCancel(A)}}catch(N){s=!0,g=N}finally{try{h||m.return==null||m.return()}finally{if(s)throw g}}}},{key:"render",value:function(){var h=this.props,s=h.accept,g=h.multiple,O=h.maxFiles,m=h.minSizeBytes,A=h.maxSizeBytes,N=h.onSubmit,Q=h.getUploadParams,X=h.disabled,K=h.canCancel,V=h.canRemove,ye=h.canRestart,pe=h.inputContent,fe=h.inputWithFilesContent,oe=h.submitButtonDisabled,q=h.submitButtonContent,le=h.classNames,B=h.styles,M=h.addClassNames,Ce=h.InputComponent,P=h.PreviewComponent,De=h.SubmitButtonComponent,ee=h.LayoutComponent,Ie=this.state,_e=Ie.active,me=Ie.dragged,ie=me.some(function(Fe){return Fe.type!=="application/x-moz-file"&&!d(Fe,s)}),ve={active:_e,reject:ie,dragged:me,accept:s,multiple:g,minSizeBytes:m,maxSizeBytes:A,maxFiles:O},we=u()(this.files),Ze=n(X,we,ve),st=(function(Fe,lt,sr){for(var Ge=l()({},H),ct=l()({},lt),Je=arguments.length,We=new Array(3<Je?Je-3:0),Ve=3;Ve<Je;Ve++)We[Ve-3]=arguments[Ve];for(var Ke=0,dt=Object.entries(Fe);Ke<dt.length;Ke++){var pt=_()(dt[Ke],2),Be=pt[0],$e=pt[1];Ge[Be]=n.apply(void 0,[$e].concat(We))}for(var Xe=0,ft=Object.entries(sr);Xe<ft.length;Xe++){var mt=_()(ft[Xe],2);Be=mt[0],$e=mt[1],Ge[Be]="".concat(Ge[Be]," ").concat(n.apply(void 0,[$e].concat(We)))}for(var et=0,ht=Object.entries(lt);et<ht.length;et++){var gt=_()(ht[et],2);Be=gt[0],$e=gt[1],ct[Be]=n.apply(void 0,[$e].concat(We))}return{classNames:Ge,styles:ct}})(le,B,M,we,ve),Oe=st.classNames,_t=Oe.dropzone,Ft=Oe.dropzoneActive,Pt=Oe.dropzoneReject,zt=Oe.dropzoneDisabled,Mt=Oe.input,Tt=Oe.input
1Label,At=Oe.inputLabelWithFiles,qt=Oe.preview,Bt=Oe.previewImage,Ut=Oe.submitButtonContainer,$t=Oe.submitButton,Ne=st.styles,Gt=Ne.dropzone,Wt=Ne.dropzoneActive,Vt=Ne.dropzoneReject,Ht=Ne.dropzoneDisabled,Yt=Ne.input,Qt=Ne.inputLabel,Zt=Ne.inputLabelWithFiles,Jt=Ne.preview,Kt=Ne.previewImage,Xt=Ne.submitButtonContainer,er=Ne.submitButton,tr=Ce||R,rr=P||de,nr=De||Y,ar=ee||ke,ut=null;P!==null&&(ut=we.map(function(Fe){return F.a.createElement(rr,{className:qt,imageClassName:Bt,style:Jt,imageStyle:Kt,key:Fe.meta.id,fileWithMeta:Fe,meta:l()({},Fe.meta),isUpload:!!Q,canCancel:n(K,we,ve),canRemove:n(V,we,ve),canRestart:n(ye,we,ve),files:we,extra:ve})}));var or=Ce!==null?F.a.createElement(tr,{className:Mt,labelClassName:Tt,labelWithFilesClassName:At,style:Yt,labelStyle:Qt,labelWithFilesStyle:Zt,getFilesFromEvent:this.getFilesFromEvent(),accept:s,multiple:g,disabled:Ze,content:n(pe,we,ve),withFilesContent:n(fe,we,ve),onFiles:this.handleFiles,files:we,extra:ve}):null,ir=N&&De!==null?F.a.createElement(nr,{className:Ut,buttonClassName:$t,style:Xt,buttonStyle:er,disabled:n(oe,we,ve),content:n(q,we,ve),onSubmit:this.handleSubmit,files:we,extra:ve}):null,ze=_t,Me=Gt;return Ze?(ze="".concat(ze," ").concat(zt),Me=l()({},Me||{},{},Ht||{})):ie?(ze="".concat(ze," ").concat(Pt),Me=l()({},Me||{},{},Vt||{})):_e&&(ze="".concat(ze," ").concat(Ft),Me=l()({},Me||{},{},Wt||{})),F.a.createElement(ar,{input:or,previews:ut,submitButton:ir,dropzoneProps:{ref:this.dropzone,className:ze,style:Me,onDragEnter:this.handleDragEnter,onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:Ze?this.handleDropDisabled:this.handleDrop},files:we,extra:l()({},ve,{onFiles:this.handleFiles,onCancelFile:this.handleCancel,onRemoveFile:this.handleRemove,onRestartFile:this.handleRestart})})}}]),C})(F.a.Component);Z.defaultProps={accept:"*",multiple:!0,minSizeBytes:0,maxSizeBytes:Number.MAX_SAFE_INTEGER,maxFiles:Number.MAX_SAFE_INTEGER,autoUpload:!0,disabled:!1,canCancel:!0,canRemove:!0,canRestart:!0,inputContent:"Drag Files or Click to Browse",inputWithFilesContent:"Add Files",submitButtonDisabled:!1,submitButtonContent:"Submit",classNames:{},styles:{},addClassNames:{}},Z.propTypes={onChangeStatus:t.a.func,getUploadParams:t.a.func,onSubmit:t.a.func,getFilesFromEvent:t.a.func,getDataTransferItemsFromEvent:t.a.func,accept:t.a.string,multiple:t.a.bool,minSizeBytes:t.a.number.isRequired,maxSizeBytes:t.a.number.isRequired,maxFiles:t.a.number.isRequired,validate:t.a.func,autoUpload:t.a.bool,timeout:t.a.number,initialFiles:t.a.arrayOf(t.a.any),disabled:t.a.oneOfType([t.a.bool,t.a.func]),canCancel:t.a.oneOfType([t.a.bool,t.a.func]),canRemove:t.a.oneOfType([t.a.bool,t.a.func]),canRestart:t.a.oneOfType([t.a.bool,t.a.func]),inputContent:t.a.oneOfType([t.a.node,t.a.func]),inputWithFilesContent:t.a.oneOfType([t.a.node,t.a.func]),submitButtonDisabled:t.a.oneOfType([t.a.bool,t.a.func]),submitButtonContent:t.a.oneOfType([t.a.node,t.a.func]),classNames:t.a.object.isRequired,styles:t.a.object.isRequired,addClassNames:t.a.object.isRequired,InputComponent:t.a.func,PreviewComponent:t.a.func,SubmitButtonComponent:t.a.func,LayoutComponent:t.a.func},p.default=Z}])),rt}var It=tn();const rn=ur(It),nn=".jpg, .png, .jpeg",an=".pdf",Et=({fileType:o,isFileUploaded:p})=>{const{t:e}=qe(),[i,a]=G.useState(!1),{track:u}=at(),f=()=>{document.querySelector(".custom-dropzone input[type='file']")?.click()},l=k=>{u(Qe.RIVA_VISION_BROWSE_FILE),k.preventDefault(),p?a(!0):f()},y=()=>{a(!1),f()},v=o==="img"?e("common.fileUpload.limitDescription",{size:"200MB",types:"PNG, JPG, JPEG"}):e("common.fileUpload.limitDescription",{size:"200MB",types:"PDF"});return S.jsxs(S.Fragment,{children:[S.jsxs(Fr,{className:Pe("group mb-3 flex h-24 w-full border p-3","items-center rounded-xl border-gray-border-50","bg-gray-background-100 dark:border-gray-border-dark-500"),children:[S.jsx(Pr,{className:"m-6 h-10 w-10 text-gray-icon-500"}),S.jsxs("div",{children:[S.jsx("h3",{className:"my-2 font-semibold text-text-main-700 dark:text-text-dark-main-700",children:e("common.fileUpload.dragDrop")}),S.jsx("p",{className:"text-sm font-light text-text-muted-800 dark:text-text-dark-muted",children:v})]}),S.jsx(nt,{type:"button",variant:"light",size:"small",className:Pe("ml-auto hover:!border hover:!border-success-accent-500","hover:!bg-success-accent-50 dark:hover:!border-gray-background-dark-100","text-text-heading-950 dar
1k:text-text-dark-heading dark:hover:!bg-gray-background-dark-500"),onClick:l,children:e("common.fileUpload.browseFiles")})]}),i&&S.jsx(zr,{title:e("common.modals.areYouSure"),description:e("rivaVision.confirmationModal.replaceFile"),open:i,onClose:()=>a(!1),onConfirm:y,buttonText:e("common.fileUpload.uploadAnyway"),cancelButtonText:e("common.modals.goBack")})]})},on=({fileWithMeta:o,setProgress:p,error:e,progress:i,isFileUploaded:a,setIsFileUploaded:u})=>{const f=y=>{y.remove(),p(0),u(!1)},l=e.length>0;return S.jsx(S.Fragment,{children:!l&&a&&S.jsxs("div",{className:"mt-3 flex w-full items-center justify-between p-2",children:[S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx(Br,{className:"text-gray-icon-500"}),S.jsx("p",{className:"text-text-muted-800 dark:text-text-dark-muted",children:o.file.name}),S.jsx("p",{className:"mt-0.5 text-xs text-text-muted-800 dark:text-text-dark-muted",children:It.formatBytes(o.file.size)})]}),i>0&&i<100&&S.jsx("div",{className:"mx-4 h-2 w-full rounded-full bg-gray-200",children:S.jsx("div",{"data-testid":"progress-bar",className:"h-2 rounded-full bg-success-main-400 dark:bg-success-accent-900",style:{width:`${i||0}%`,transition:"width 0.3s ease-in-out"}})}),S.jsx(nt,{type:"button","aria-label":"Remove file button","data-testid":"remove-file-button",variant:"icon",className:"rounded-full p-1 text-gray-icon-500 hover:text-danger-main-400",onClick:()=>f(o),children:S.jsx(Mr,{size:18})})]})})},sn=({fileType:o,isFileUploaded:p,setIsFileUploaded:e,setFileData:i})=>{const{t:a}=qe(),{track:u}=at(),[f,l]=G.useState(null),[y,v]=G.useState(0),[k,I]=G.useState(""),z=G.useRef(null);G.useEffect(()=>()=>{z.current&&clearInterval(z.current)},[]);const W=G.useCallback(U=>{const J=new FileReader;J.onabort=()=>console.error("file reading was aborted"),J.onerror=()=>console.error("file reading has failed"),J.onload=()=>{const re=J.result,$={type:U.type,fileData:re};i($)},J.readAsDataURL(U)},[e,i]),se=(U,J)=>{if(J==="preparing"||J==="uploading"){f&&(f.remove(),e(!1));let re=0;z.current&&clearInterval(z.current),z.current=setInterval(()=>{re+=10,v(Math.min(re,90))},200)}else J==="done"?(u(Qe.RIVA_VISION_FILE_UPLOAD,"success"),z.current&&clearInterval(z.current),W(U.file),l(U),e(!0),v(100)):J==="removed"?(l(null),v(0)):J==="error_file_size"?(u(Qe.RIVA_VISION_FILE_UPLOAD,"error"),I(a("common.fileUpload.fileSizeError"))):I(a("common.fileUpload.fileError"))};return S.jsxs("div",{className:"flex w-auto flex-col items-center justify-center","data-testid":"file-uploader",children:[S.jsx(rn,{onChangeStatus:se,accept:o==="img"?nn:an,multiple:!1,maxSizeBytes:2e8,inputContent:S.jsx(Et,{fileType:o,isFileUploaded:p}),inputWithFilesContent:S.jsx(Et,{fileType:o,isFileUploaded:p}),classNames:{dropzone:"custom-dropzone w-full flex flex-col-reverse",input:"hidden",inputLabel:""},PreviewComponent:({fileWithMeta:U})=>S.jsx(on,{fileWithMeta:U,setProgress:v,error:k,progress:y,isFileUploaded:p,setIsFileUploaded:e})}),k&&S.jsx(Ot,{containerClassName:"bg-danger-accent-100 text-text-main-700 w-full",children:k})]})},un="/assets/riva-vision-image-dark-Dx0r4wgA.png",ln="/assets/riva-vision-image-6cDr0-7s.png",cn=({setFileData:o,isFileUploaded:p,setIsFileUploaded:e,isError:i,customError:a})=>{const{t:u}=qe(),{theme:f}=Tr(),[l,y]=G.useState("img"),[v,k]=G.useState(""),I=z=>{const W=z.target.value;k(W),e(!0),o({type:"txt",fileData:W})};return G.useEffect(()=>{l!=="txt"&&v&&k("")},[l]),S.jsx("div",{className:"mb-6","data-testid":"form-riva-vision",children:S.jsxs("div",{className:"grid grid-cols-1 gap-4 p-6 px-6 md:px-12 lg:px-24 xl:px-48",children:[S.jsx("h2",{className:"text-lg font-semibold text-text-main-700 dark:text-text-dark-heading",children:u("rivaVision.welcome",{brand:"Riva Vision"})}),S.jsx("p",{className:"text-sm font-light text-text-muted-700 dark:text-text-dark-muted",children:u("rivaVision.description",{brand:"Riva Vision"})}),S.jsx("img",{src:f==="light"?ln:un,alt:"Riva Vision showcase"}),S.jsx("div",{className:"border-b border-t border-gray-border-50 dark:border-gray-border-dark-300",children:S.jsx(en,{fileType:l,setFileType:y,setIsFileUploaded:e})}),l!=="txt"&&S.jsx(sn,{fileType:l,setFileData:o,isFileUploaded:p,setIsFileUploaded:e}),l==="txt"&&S.jsx(Ar,{name:"Enter report text","data-testid":"text-input","aria-label":u("rivaVision.textInput.ariaLabel"),labelText:u("rivaVision.textInput.label"),placeholder:u("rivaVision.textInput.placeholder"),labelClassName:"text-lg text-text-main-700 dark:text-text-dark-main-700 font-normal",className:Pe("-mt-2 h-60 w-full text-sm placeholder:text-text-muted-700","items-start bg-white"),value:v,onCh
1ange:I}),i&&p&&S.jsx(Ot,{containerClassName:Pe("bg-danger-accent-100 text-text-main-700","w-full dark:bg-danger-main-400 dark:text-text-dark-main-300"),children:a})]})})},xn=()=>{const{t:o}=qe(),[p,e]=G.useState(),[i,a]=G.useState(!1),{handleCreateDashboard:u,isLoading:f,isError:l,customError:y}=Kr(),v=async()=>{p&&await u(p)};return S.jsxs("div",{className:"relative",children:[S.jsx(Xr,{isFileUploaded:i,onSubmit:v}),S.jsx(cn,{isFileUploaded:i,setIsFileUploaded:a,fileData:p,setFileData:e,isError:l,customError:y}),f&&S.jsx("div",{className:Pe("absolute inset-0 flex items-center justify-center bg-white","bg-opacity-40 backdrop-blur-sm dark:bg-gray-background-dark-200","dark:bg-opacity-40"),children:S.jsxs("div",{className:Pe("flex w-64 flex-col items-center bg-white p-6 shadow-lg","rounded-2xl dark:bg-gray-background-dark-100"),children:[S.jsx(qr,{type:"spinner",size:"normal",className:"border-r-success-main-400 border-t-success-main-400"}),S.jsx("p",{className:"mt-4 text-lg font-semibold text-text-main-700 dark:text-text-dark-main-700",children:o("rivaVision.creatingMagic")})]})})]})};export{xn as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.