"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[63241],{15617:function(e,n,t){t.d(n,{X:function(){return o}});var a=t(85893);t(67294);var l=t(56709),i=t(99782);let o=e=>{let{label:n,checked:t,onChange:o,disabled:r,sx:s}=e;return(0,a.jsxs)(l.Z,{sx:s,disabled:r,children:[(0,a.jsx)(i.Z,{checked:t,onChange:e=>{o(e.target.checked)}}),(0,a.jsx)(l.Z.Label,{sx:{fontWeight:400},children:n})]})}},48189:function(e,n,t){t.d(n,{_:function(){return l}});var a=t(85893);t(67294);let l=e=>{let{label:n,sideContent:t}=e;return(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5,margin:"0 0 4px 0"},children:[(0,a.jsx)("label",{style:{flex:"1 1 auto",display:"block",padding:0,margin:0,fontWeight:400,fontSize:"inherit"},children:n}),t&&(0,a.jsx)("div",{style:{flex:"0 0 auto"},children:t})]})}},63241:function(e,n,t){t.r(n),t.d(n,{default:function(){return f}});var a=t(85893),l=t(67294),i=t(63429),o=t(69579),r=t(44182),s=t(51624),d=t(85069),c=t(66750),b=t(55837),p=t(48189),u=t(15617),m=t(66312),y=t(91587);let h=0;function f(){let[e,n]=(0,l.useState)({isBusyGeneratingElm:!1,cqlContent:"library LibraryOne\n\nusing FHIR version '4.0.1'\n\ninclude FHIRHelpers version '4.0.1'\n\ncontext Patient\n\ndefine x: Patient.gender = 'female'",elmContent:"",showOptions:!1,enableDateRangeOptimization:!1,enableAnnotations:!1,enableLocators:!1,enableResultTypes:!1,enableDetailedErrors:!1,disableListTraversal:!1,disableListDemotion:!1,disableListPromotion:!1,enableIntervalDemotion:!1,enableIntervalPromotion:!1,disableMethodInvocation:!1,requireFromKeyword:!1,disableDefaultModelInfoLoad:!1}),t=(0,r.k)(),f=async()=>{let t=h+1;h=t,n(e=>({...e,isBusyGeneratingElm:!0}));let a=await fetch("/api",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"cql.convertCqlToElm",params:{cql:e.cqlContent,enableDateRangeOptimization:e.enableDateRangeOptimization,enableAnnotations:e.enableAnnotations,enableLocators:e.enableLocators,enableResultTypes:e.enableResultTypes,enableDetailedErrors:e.enableDetailedErrors,disableListTraversal:e.disableListTraversal,disableListDemotion:e.disableListDemotion,disableListPromotion:e.disableListPromotion,enableIntervalDemotion:e.enableIntervalDemotion,enableIntervalPromotion:e.enableIntervalPromotion,disableMethodInvocation:e.disableMethodInvocation,requireFromKeyword:e.requireFromKeyword,disableDefaultModelInfoLoad:e.disableDefaultModelInfoLoad}})}),l=await a.json();t===h&&n(e=>({...e,isBusyGeneratingElm:!1,elmContent:JSON.stringify(l,null,2)}))};return(0,a.jsx)(y.default,{children:(0,a.jsxs)("div",{style:{margin:"".concat(i.sC," 0")},children:[(0,a.jsxs)("form",{style:{margin:"0 0 ".concat(i.LC," 0")},onSubmit:async e=>{e.preventDefault(),await f()},children:[(0,a.jsxs)(d.NI,{sx:{margin:"0 0 ".concat(i.LC," 0")},children:[(0,a.jsx)(d.NI.Label,{htmlFor:"cql-content",children:"CQL"}),(0,a.jsx)(c.m,{id:"cql-content",value:e.cqlContent,onChange:e=>{n(n=>({...n,cqlContent:e}))},inputAppearance:!0,lineNumbers:!0,scopeName:"source.cql",style:{width:"100%",fontFamily:o.p,fontSize:"85%"}}),(0,a.jsx)(d.NI.Caption,{children:"The CQL code to be converted to ELM."})]}),(0,a.jsxs)("div",{style:{display:"flex",gap:10},children:[(0,a.jsx)(d.zx,{type:"submit",disabled:e.isBusyGeneratingElm,children:e.isBusyGeneratingElm?(0,a.jsxs)(l.Fragment,{children:["Loading",(0,a.jsx)(s.b,{ticker:t})]}):"Convert to ELM"}),(0,a.jsx)(d.zx,{onClick:()=>{n(e=>({...e,showOptions:!e.showOptions}))},type:"button",children:"Options..."})]})]}),e.elmContent?(0,a.jsxs)(d.NI,{children:[(0,a.jsx)(d.NI.Label,{htmlFor:"elm-content",children:"ELM (JSON)"})," ",(0,a.jsx)(c.m,{id:"elm-content",value:e.elmContent,readOnly:!0,inputAppearance:!0,lineNumbers:!0,scopeName:"source.json",style:{width:"100%",fontFamily:o.p,fontSize:"85%"}})]}):(0,a.jsxs)("div",{children:[(0,a.jsx)(p._,{label:"ELM (JSON)"}),(0,a.jsx)(b.j,{children:(0,a.jsx)("div",{style:{padding:"30px 12px",color:"var(--gray-text-color)",textAlign:"center"},children:"Press Convert to ELM to see the result."})})]}),e.showOptions&&(0,a.jsx)(m.V,{onClose:()=>{n(e=>({...e,showOptions:!1}))},children:(0,a.jsxs)("div",{style:{padding:"20px 30px"},children:[(0,a.jsx)("h2",{style:{margin:"0 0 ".concat(i.sC," 0")},children:"Translator options"}),(0,a.jsx)("div",{style:{margin:"0 0 ".concat(i.sC," 0")},children:[{appStateKey:"enableDateRangeOptimization",label:"Enable date range optimization"},{appStateKey:"enableAnnotations",label:"Enable annotations"},{appStateKey:"enableLocators",label:"Enable locators"},{appStateKey:"enableResultTypes",label:"Enable result types"},{appStateKey:"enableDetailedErrors",label:"Enable detailed errors"},{appStateKey:"disableListTraversal",label:"Disable list traversal"},{appStateKey:"disableListDemotion",label:"Disable list demotion"},{appStateKey:"disableListPromotion",label:"Disable list promotion"},{appStateKey:"enableIntervalDemotion",label:"Enable interval demotion"},{appStateKey:"enableIntervalPromotion",label:"Enable interval promotion"},{appStateKey:"disableMethodInvocation",label:"Disable method invocation"},{appStateKey:"requireFromKeyword",label:"Require from keyword"},{appStateKey:"disableDefaultModelInfoLoad",label:"Disable default model info load"}].map((t,l)=>(0,a.jsx)("div",{style:{margin:"0 0 ".concat(i.LX," 0")},children:(0,a.jsx)(u.X,{checked:e[t.appStateKey],onChange:e=>{n(n=>({...n,[t.appStateKey]:e}))},label:t.label})},l))}),(0,a.jsx)(d.zx,{type:"button",onClick:()=>{n(e=>({...e,showOptions:!1}))},children:"Close"})]})})]})})}},55837:function(e,n,t){t.d(n,{j:function(){return i}});var a=t(85893);t(67294);var l=t(63429);function i(e){let{overflowXAuto:n=!1,children:t}=e;return(0,a.jsx)("div",{style:{width:"100%",overflow:"hidden",background:"white",borderRadius:3,border:"".concat(l.G5," solid rgb(118, 118, 118)")},children:n?(0,a.jsx)("div",{style:{display:"flex",overflowX:"auto"},children:(0,a.jsx)("div",{style:{flex:"1 1 auto"},children:t})}):t})}},51624:function(e,n,t){t.d(n,{b:function(){return l},s:function(){return i}});var a=t(85893);function l(e){let{ticker:n}=e;return(0,a.jsxs)("span",{style:{whiteSpace:"nowrap"},children:[Array(n%4).fill(".").join(""),(0,a.jsx)("span",{style:{color:"transparent",textShadow:"none"},children:Array(3-n%4).fill(".").join("")})]})}function i(e){return"".concat(Array(e%4).fill(".").join("")).concat(Array(3-e%4).fill(" ").join(""))}t(67294)},44182:function(e,n,t){t.d(n,{k:function(){return l}});var a=t(67294);function l(){let[e,n]=a.useState(0);return(0,a.useEffect)(()=>{let e=setInterval(()=>{n(e=>e+1)},1e3);return()=>clearInterval(e)}),e}}}]);