UNPKG

datajunction-ui

Version:
6 lines 136 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),W=require("react"),Le=require("./index-h1A5IisM.cjs");;/* empty css */function Is(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const Y=Is(W),As={hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:"#002b36",color:"#839496"},"hljs-comment":{color:"#586e75"},"hljs-quote":{color:"#586e75"},"hljs-keyword":{color:"#859900"},"hljs-selector-tag":{color:"#859900"},"hljs-addition":{color:"#859900"},"hljs-number":{color:"#2aa198"},"hljs-string":{color:"#2aa198"},"hljs-meta .hljs-meta-string":{color:"#2aa198"},"hljs-literal":{color:"#2aa198"},"hljs-doctag":{color:"#2aa198"},"hljs-regexp":{color:"#2aa198"},"hljs-title":{color:"#268bd2"},"hljs-section":{color:"#268bd2"},"hljs-name":{color:"#268bd2"},"hljs-selector-id":{color:"#268bd2"},"hljs-selector-class":{color:"#268bd2"},"hljs-attribute":{color:"#b58900"},"hljs-attr":{color:"#b58900"},"hljs-variable":{color:"#b58900"},"hljs-template-variable":{color:"#b58900"},"hljs-class .hljs-title":{color:"#b58900"},"hljs-type":{color:"#b58900"},"hljs-symbol":{color:"#cb4b16"},"hljs-bullet":{color:"#cb4b16"},"hljs-subst":{color:"#cb4b16"},"hljs-meta":{color:"#cb4b16"},"hljs-meta .hljs-keyword":{color:"#cb4b16"},"hljs-selector-attr":{color:"#cb4b16"},"hljs-selector-pseudo":{color:"#cb4b16"},"hljs-link":{color:"#cb4b16"},"hljs-built_in":{color:"#dc322f"},"hljs-deletion":{color:"#dc322f"},"hljs-formula":{background:"#073642"},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"}};function ws({id:e,state:t,engine_name:a,engine_version:r,errors:o,links:l,output_table:d,scheduled:i,started:p,finished:h,numRows:m,isList:x=!1}){return x===!1?u.jsx("div",{className:"table-responsive",children:u.jsxs("table",{className:"card-inner-table table",children:[u.jsx("thead",{className:"fs-7 fw-bold text-gray-400 border-bottom-0",children:u.jsxs("tr",{children:[u.jsx("th",{children:"Query ID"}),u.jsx("th",{children:"Engine"}),u.jsx("th",{children:"State"}),u.jsx("th",{children:"Scheduled"}),u.jsx("th",{children:"Started"}),u.jsx("th",{children:"Errors"}),u.jsx("th",{children:"Links"}),u.jsx("th",{children:"Output Table"}),u.jsx("th",{children:"Number of Rows"})]})}),u.jsx("tbody",{children:u.jsxs("tr",{children:[u.jsx("td",{children:u.jsx("span",{className:"rounded-pill badge bg-secondary-soft",children:e})}),u.jsx("td",{children:u.jsxs("span",{className:"rounded-pill badge bg-secondary-soft",children:[a," - ",r]})}),u.jsx("td",{children:t}),u.jsx("td",{children:i}),u.jsx("td",{children:p}),u.jsx("td",{children:o!=null&&o.length?o.map((N,_)=>u.jsx("p",{children:u.jsx("span",{className:"rounded-pill badge bg-secondary-error",children:N})},`error-${_}`)):u.jsx(u.Fragment,{})}),u.jsx("td",{children:l!=null&&l.length?l.map((N,_)=>u.jsx("p",{children:u.jsx("a",{href:N,target:"_blank",rel:"noreferrer",children:N})},_)):u.jsx(u.Fragment,{})}),u.jsx("td",{children:d}),u.jsx("td",{children:m})]})})]})}):u.jsx("div",{className:"rightbottom",children:u.jsxs("ul",{style:{padding:"20px"},children:[u.jsxs("li",{className:"query-info",children:[u.jsx("label",{children:"Query ID"})," ",u.jsx("span",{className:"tag_value rounded-pill badge",children:l!=null&&l.length?u.jsx("a",{href:l[l.length-1],target:"_blank",rel:"noreferrer",children:e}):e})]}),u.jsxs("li",{className:"query-info",children:[u.jsx("label",{children:"State"}),u.jsx("span",{className:"tag_value rounded-pill badge",children:t})]}),u.jsxs("li",{className:"query-info",children:[u.jsx("label",{children:"Engine"})," ",u.jsxs("span",{className:"tag_value rounded-pill badge",children:[a," - ",r]})]}),u.jsxs("li",{className:"query-info",children:[u.jsx("label",{children:"Scheduled"})," ",i]}),u.jsxs("li",{className:"query-info",children:[u.jsx("label",{children:"Started"})," ",p]}),u.jsxs("li",{className:"query-info",children:[u.jsx("label",{children:"Finished"})," ",h]}),u.jsxs("li",{className:"query-info",children:[u.jsx("label",{children:"Logs"})," ",o!=null&&o.length?o.map((N,_)=>u.jsx("div",{style:{height:"800px",width:"80%",overflow:"scroll",borderRadius:"0",border:"1px solid #ccc"},className:"queryrunner-query",children:u.jsx(Le.SyntaxHighlighter,{language:"javascript",style:As,wrapLines:!0,children:N})},`error-${_}`)):u.jsx(u.Fragment,{})]}),u.jsxs("li",{className:"query-info",children:[u.jsx("label",{children:"Links:"})," ",l!=null&&l.length?l.map((N,_)=>u.jsx("p",{children:u.jsx("a",{href:N,target:"_blank",rel:"noreferrer",children:N})},_)):u.jsx(u.Fragment,{})]}),u.jsxs("li",{className:"query-info",children:[u.jsx("label",{children:"Output Table:"})," ",d]}),u.jsxs("li",{className:"query-info",children:[u.jsx("label",{children:"Rows:"})," ",m]})]})})}function as(e){var t,a,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(a=as(e[t]))&&(r&&(r+=" "),r+=a);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Ee(){for(var e,t,a=0,r="";a<arguments.length;)(e=arguments[a++])&&(t=as(e))&&(r&&(r+=" "),r+=t);return r}var Vs=Object.defineProperty,js=(e,t)=>{for(var a in t)Vs(e,a,{get:t[a],enumerable:!0})},Ke=({className:e,handleOnClick:t,label:a,title:r,disabled:o,disabledTranslation:l,testID:d})=>Y.createElement("button",{type:"button","data-testid":d,disabled:o&&!l,className:e,title:l&&o?l.title:r,onClick:i=>t(i)},l&&o?l.label:a);Ke.displayName="ActionElement";var ss=W.forwardRef(({className:e,label:t,title:a,testID:r},o)=>Y.createElement("span",{"data-testid":r,ref:o,className:e,title:a},t));ss.displayName="DragHandle";var ns="~",Ft="------",da=ns,Ts=Ft,Ls=Ft,pa=ns,Ds=Ft,Gs=Ft,xa=",",ma={fields:{title:"Fields",placeholderName:da,placeholderLabel:Ts,placeholderGroupLabel:Ls},operators:{title:"Operators",placeholderName:pa,placeholderLabel:Ds,placeholderGroupLabel:Gs},value:{title:"Value"},removeRule:{label:"x",title:"Remove rule"},removeGroup:{label:"x",title:"Remove group"},addRule:{label:"+Rule",title:"Add rule"},addGroup:{label:"+Group",title:"Add group"},combinators:{title:"Combinators"},notToggle:{label:"Not",title:"Invert this group"},cloneRule:{label:"⧉",title:"Clone rule"},cloneRuleGroup:{label:"⧉",title:"Clone group"},dragHandle:{label:"⁞⁞",title:"Drag handle"},lockRule:{label:"🔓",title:"Lock rule"},lockGroup:{label:"🔓",title:"Lock group"},lockRuleDisabled:{label:"🔒",title:"Unlock rule"},lockGroupDisabled:{label:"🔒",title:"Unlock group"},valueSourceSelector:{title:"Value source"}},Ps=[{name:"=",label:"="},{name:"!=",label:"!="},{name:"<",label:"<"},{name:">",label:">"},{name:"<=",label:"<="},{name:">=",label:">="},{name:"contains",label:"contains"},{name:"beginsWith",label:"begins with"},{name:"endsWith",label:"ends with"},{name:"doesNotContain",label:"does not contain"},{name:"doesNotBeginWith",label:"does not begin with"},{name:"doesNotEndWith",label:"does not end with"},{name:"null",label:"is null"},{name:"notNull",label:"is not null"},{name:"in",label:"in"},{name:"notIn",label:"not in"},{name:"between",label:"between"},{name:"notBetween",label:"not between"}],Bt=[{name:"and",label:"AND"},{name:"or",label:"OR"}];[...Bt];var ce={queryBuilder:"queryBuilder",ruleGroup:"ruleGroup",header:"ruleGroup-header",body:"ruleGroup-body",combinators:"ruleGroup-combinators",addRule:"ruleGroup-addRule",addGroup:"ruleGroup-addGroup",cloneRule:"rule-cloneRule",cloneGroup:"ruleGroup-cloneGroup",removeGroup:"ruleGroup-remove",notToggle:"ruleGroup-notToggle",rule:"rule",fields:"rule-fields",operators:"rule-operators",value:"rule-value",removeRule:"rule-remove",betweenRules:"betweenRules",valid:"queryBuilder-valid",invalid:"queryBuilder-invalid",dndDragging:"dndDragging",dndOver:"dndOver",dragHandle:"queryBuilder-dragHandle",disabled:"queryBuilder-disabled",lockRule:"rule-lock",lockGroup:"ruleGroup-lock",valueSource:"rule-valueSource",valueListItem:"rule-value-list-item"},Ms={queryBuilder:"",ruleGroup:"",header:"",body:"",combinators:"",addRule:"",addGroup:"",cloneRule:"",cloneGroup:"",removeGroup:"",notToggle:"",rule:"",fields:"",operators:"",value:"",removeRule:"",dragHandle:"",lockRule:"",lockGroup:"",valueSource:""},Ce={rule:"rule",ruleGroup:"rule-group",inlineCombinator:"inline-combinator",addGroup:"add-group",removeGroup:"remove-group",cloneGroup:"clone-group",cloneRule:"clone-rule",addRule:"add-rule",removeRule:"remove-rule",combinators:"combinators",fields:"fields",operators:"operators",valueEditor:"value-editor",notToggle:"not-toggle",dragHandle:"drag-handle",lockRule:"lock-rule",lockGroup:"lock-group",valueSourceSelector:"value-source-selector"},Be={parentPathDisabled:"action aborted: parent path disabled",pathDisabled:"action aborted: path is disabled",onAddRuleFalse:"onAddRule callback returned false",onAddGroupFalse:"onAddGroup callback returned false",onRemoveFalse:"onRemove callback returned false",add:"rule or group added",remove:"rule or group removed",update:"rule or group updated",move:"rule or group moved"},rs=({component:e,independentCombinators:t,...a})=>Y.createElement("div",{className:ce.betweenRules,"data-testid":Ce.inlineCombinator},Y.createElement(e,{...a,testID:Ce.combinators}));rs.displayName="InlineCombinator";var os=({className:e,handleOnChange:t,title:a,label:r,checked:o,disabled:l,testID:d})=>Y.createElement("label",{"data-testid":d,className:e,title:a},Y.createElement("input",{type:"checkbox",onChange:i=>t(i.target.checked),checked:!!o,disabled:l}),r);os.displayName="NotToggle";var Fs=(e,t=xa)=>typeof e=="string"?e.split(`\\${t}`).map(a=>a.split(t)).reduce((a,r,o)=>o===0?r:[...a.slice(0,a.length-1),`${a[a.length-1]}${t}${r[0]}`,...r.slice(1)],[]):[],Ea=(e,t=xa)=>e.map(a=>`${a??""}`.replaceAll(t,`\\${t}`)).join(t),je=e=>typeof e=="string"?e.trim():e,De=e=>Array.isArray(e)?e.map(je):typeof e=="string"?Fs(e,xa).filter(t=>!/^\s*$/.test(t)).map(t=>t.trim()):typeof e=="number"?[e]:[],Wa=e=>typeof e=="object"&&"rules"in e?ls(e):e,ls=e=>{const t=[],a=o=>t.push(Wa(o));let r=0;for(let o=0;o<e.rules.length;o+=2)if(e.rules.length===1)a(e.rules[0]);else if(e.rules[o+1]==="and"){r=o;let l=1;for(;e.rules[r+l]==="and";)o+=2,l+=2;t.push({rules:e.rules.slice(r,o+1).map(Wa)}),o-=2}else e.rules[o+1]==="or"&&(o===0||o===e.rules.length-3?((o===0||e.rules[o-1]==="or")&&a(e.rules[o]),a(e.rules[o+1]),o===e.rules.length-3&&a(e.rules[o+2])):(e.rules[o-1]==="and"||a(e.rules[o]),a(e.rules[o+1])));return t.length===1&&typeof t[0]=="object"&&"rules"in t[0]?{...e,...t[0]}:{...e,rules:t}},fa=e=>{const t=ls(e),a=t.rules.map(l=>typeof l=="string"||!("rules"in l)?l:fa(l)),r=a.length<2?"and":a[1],o=a.filter(l=>typeof l!="string");return{...t,combinator:r,rules:o}},Ze=e=>Array.isArray(e)&&e.length>0&&"options"in e[0],is=(e,t)=>(Ze(e)?e.flatMap(a=>a.options):e).find(a=>a.name===t),$e=e=>!Array.isArray(e)||e.length===0?null:Ze(e)?e[0].options[0].name:e[0].name,cs=(e,t,a)=>{if(!e.comparator){const o=l=>l.name!==e.name;return Ze(t)?t.map(l=>({...l,options:l.options.filter(o)})):t.filter(o)}const r=o=>e.name===o.name?!1:typeof e.comparator=="string"?e[e.comparator]===o[e.comparator]:e.comparator(o,a);return Ze(t)?t.map(o=>({...o,options:o.options.filter(r)})).filter(o=>o.options.length>0):t.filter(r)},us=/^\s*[+-]?(\d+|\d*\.\d+|\d+\.\d*)([Ee][+-]?\d+)?\s*$/,Nt=e=>e===null||typeof e!="object"?!1:Object.getPrototypeOf(e)===Object.prototype,Ra=(e,{parseNumbers:t})=>typeof e=="bigint"||typeof e=="number"?e:t&&(t==="native"||us.test(e))?parseFloat(e):e,hs=e=>{switch(e.toLowerCase()){case"null":return"is null";case"notnull":return"is not null";case"notin":return"not in";case"notbetween":return"not between";case"contains":case"beginswith":case"endswith":return"like";case"doesnotcontain":case"doesnotbeginwith":case"doesnotendwith":return"not like";default:return e}},$a={"=":"$eq","!=":"$ne","<":"$lt","<=":"$lte",">":"$gt",">=":"$gte",in:"$in",notIn:"$nin"},Ja={and:"&&",or:"||"},ds=e=>({...e,rules:e.rules.map(t=>{if(typeof t=="string")return t;if("rules"in t)return ds(t);let{value:a}=t;return typeof a=="string"&&(a=Ra(a,{parseNumbers:!0})),{...t,value:a}})}),ft=e=>typeof e=="string"&&e.length>0||typeof e=="number"&&!isNaN(e)||typeof e!="string"&&typeof e!="number",_e=(e,t)=>t&&(typeof e=="number"||typeof e=="bigint"||typeof e=="string"&&us.test(e)),Bs=e=>e.length>=3,_a=(e=["",""])=>Array.isArray(e)?e:typeof e=="string"?[e,e]:e??["",""],Dt=e=>/^(does)?not/i.test(e),lt=(e,t)=>typeof e!="string"||!t?e:e.replaceAll('"','\\"'),Ya=({field:e,operator:t,value:a,valueSource:r},{escapeQuotes:o,parseNumbers:l}={})=>{const d=r==="field",i=t.replace(/^=$/,"=="),p=typeof a=="number"||typeof a=="boolean"||typeof a=="bigint"||_e(a,l);switch(i){case"<":case"<=":case"==":case"!=":case">":case">=":return`${e} ${i} ${d||p?je(a):`"${lt(a,o)}"`}`;case"contains":case"doesNotContain":return`${Dt(i)?"!":""}${e}.contains(${d?je(a):`"${lt(a,o)}"`})`;case"beginsWith":case"doesNotBeginWith":return`${Dt(i)?"!":""}${e}.startsWith(${d?je(a):`"${lt(a,o)}"`})`;case"endsWith":case"doesNotEndWith":return`${Dt(i)?"!":""}${e}.endsWith(${d?je(a):`"${lt(a,o)}"`})`;case"null":return`${e} == null`;case"notNull":return`${e} != null`;case"in":case"notIn":{const h=Dt(i),m=De(a);return m.length>0?`${h?"!(":""}${e} in [${m.map(x=>d||_e(x,l)?`${je(x)}`:`"${lt(x,o)}"`).join(", ")}]${h?")":""}`:""}case"between":case"notBetween":{const h=De(a);if(h.length>=2&&h[0]&&h[1]){const[m,x]=h,N=_e(m,!0)?parseFloat(m):NaN,_=_e(x,!0)?parseFloat(x):NaN;let F=isNaN(N)?d?`${m}`:`"${lt(m,o)}"`:N,K=isNaN(_)?d?`${x}`:`"${lt(x,o)}"`:_;if(F===N&&K===_&&_<N){const ae=_;K=N,F=ae}return t==="between"?`(${e} >= ${F} && ${e} <= ${K})`:`(${e} < ${F} || ${e} > ${K})`}else return""}}return""},We=e=>typeof e!="string"?e:e.replaceAll("\\","\\\\").replaceAll('"','\\"'),za=({field:e,operator:t,value:a,valueSource:r},{parseNumbers:o}={})=>{const l=r==="field",d=typeof a=="number"||typeof a=="boolean"||typeof a=="bigint"||_e(a,o);if(t==="="&&!l)return`{"${e}":${d?je(a):`"${We(a)}"`}}`;switch(t){case"<":case"<=":case"=":case"!=":case">":case">=":{const i=$a[t];return l?`{"$expr":{"${i}":["$${e}","$${a}"]}}`:`{"${e}":{"${i}":${d?je(a):`"${We(a)}"`}}}`}case"contains":return l?`{"$where":"this.${e}.includes(this.${a})"}`:`{"${e}":{"$regex":"${We(a)}"}}`;case"beginsWith":return l?`{"$where":"this.${e}.startsWith(this.${a})"}`:`{"${e}":{"$regex":"^${We(a)}"}}`;case"endsWith":return l?`{"$where":"this.${e}.endsWith(this.${a})"}`:`{"${e}":{"$regex":"${We(a)}$"}}`;case"doesNotContain":return l?`{"$where":"!this.${e}.includes(this.${a})"}`:`{"${e}":{"$not":{"$regex":"${We(a)}"}}}`;case"doesNotBeginWith":return l?`{"$where":"!this.${e}.startsWith(this.${a})"}`:`{"${e}":{"$not":{"$regex":"^${We(a)}"}}}`;case"doesNotEndWith":return l?`{"$where":"!this.${e}.endsWith(this.${a})"}`:`{"${e}":{"$not":{"$regex":"${We(a)}$"}}}`;case"null":return`{"${e}":null}`;case"notNull":return`{"${e}":{"$ne":null}}`;case"in":case"notIn":{const i=De(a);return i.length>0?l?`{"$where":"${t==="notIn"?"!":""}[${i.map(p=>`this.${p}`).join(",")}].includes(this.${e})"}`:`{"${e}":{"${$a[t]}":[${i.map(p=>_e(p,o)?`${je(p)}`:`"${We(p)}"`).join(",")}]}}`:""}case"between":case"notBetween":{const i=De(a);if(i.length>=2&&ft(i[0])&&ft(i[1])){const[p,h]=i,m=_e(p,!0)?parseFloat(p):NaN,x=_e(h,!0)?parseFloat(h):NaN,N=l||!isNaN(m)?`${p}`:`"${We(p)}"`,_=l||!isNaN(x)?`${h}`:`"${We(h)}"`;return t==="between"?l?`{"$and":[{"$expr":{"$gte":["$${e}","$${N}"]}},{"$expr":{"$lte":["$${e}","$${_}"]}}]}`:`{"${e}":{"$gte":${N},"$lte":${_}}}`:l?`{"$or":[{"$expr":{"$lt":["$${e}","$${N}"]}},{"$expr":{"$gt":["$${e}","$${_}"]}}]}`:`{"$or":[{"${e}":{"$lt":${N}}},{"${e}":{"$gt":${_}}}]}`}else return""}}return""},Gt=e=>/^(does)?not/i.test(e),ca=(e,t)=>t?`!(${e})`:`${e}`,it=(e,t)=>typeof e!="string"||!t?e:e.replaceAll("'","\\'"),Xa=({field:e,operator:t,value:a,valueSource:r},{escapeQuotes:o,parseNumbers:l}={})=>{const d=r==="field",i=t.replace(/^=$/,"=="),p=typeof a=="number"||typeof a=="boolean"||typeof a=="bigint"||_e(a,l);switch(i){case"<":case"<=":case"==":case"!=":case">":case">=":return`${e} ${i} ${d||p?je(a):`'${it(a,o)}'`}`;case"contains":case"doesNotContain":return ca(`${e} matches ${d||p?je(a):`'${it(a,o)}'`}`,Gt(i));case"beginsWith":case"doesNotBeginWith":{const h=d?`'^'.concat(${je(a)})`:`'${typeof a=="string"&&!a.startsWith("^")||p?"^":""}${it(a,o)}'`;return ca(`${e} matches ${h}`,Gt(i))}case"endsWith":case"doesNotEndWith":{const h=d?`${je(a)}.concat('$')`:`'${it(a,o)}${typeof a=="string"&&!a.endsWith("$")||p?"$":""}'`;return ca(`${e} matches ${h}`,Gt(i))}case"null":return`${e} == null`;case"notNull":return`${e} != null`;case"in":case"notIn":{const h=Gt(i)?"!":"",m=De(a);return m.length>0?`${h}(${m.map(x=>`${e} == ${d||_e(x,l)?`${je(x)}`:`'${it(x,o)}'`}`).join(" or ")})`:""}case"between":case"notBetween":{const h=De(a);if(h.length>=2&&h[0]&&h[1]){const[m,x]=h,N=_e(m,!0)?parseFloat(m):NaN,_=_e(x,!0)?parseFloat(x):NaN;let F=isNaN(N)?d?`${m}`:`'${it(m,o)}'`:N,K=isNaN(_)?d?`${x}`:`'${it(x,o)}'`:_;if(F===N&&K===_&&_<N){const ae=_;K=N,F=ae}return t==="between"?`(${e} >= ${F} and ${e} <= ${K})`:`(${e} < ${F} or ${e} > ${K})`}else return""}}return""},ct=(e,t)=>t&&typeof e=="string"?e.replaceAll("'","''"):e,ba=({operator:e,value:t,valueSource:a},{escapeQuotes:r,parseNumbers:o,quoteFieldNamesWith:l}={})=>{const d=a==="field",[i,p]=_a(l),h=e.toLowerCase(),m=x=>`${i}${x}${p}`;switch(h){case"null":case"notnull":return"";case"in":case"notin":{const x=De(t);return x.length>0?`(${x.map(N=>d?m(N):_e(N,o)?`${je(N)}`:`'${ct(N,r)}'`).join(", ")})`:""}case"between":case"notbetween":{const x=De(t);if(x.length>=2&&ft(x[0])&&ft(x[1])){const[N,_]=x;return d?`${m(N)} and ${m(_)}`:_e(N,o)&&_e(_,o)?`${je(N)} and ${je(_)}`:`'${ct(N,r)}' and '${ct(_,r)}'`}return""}case"contains":case"doesnotcontain":return d?`'%' || ${m(t)} || '%'`:`'%${ct(t,r)}%'`;case"beginswith":case"doesnotbeginwith":return d?`${m(t)} || '%'`:`'${ct(t,r)}%'`;case"endswith":case"doesnotendwith":return d?`'%' || ${m(t)}`:`'%${ct(t,r)}'`}return typeof t=="boolean"?t?"TRUE":"FALSE":d?m(t):_e(t,o)?`${je(t)}`:`'${ct(t,r)}'`},Us=e=>e.replace(/^(=)$/,"$1=").replace(/^notNull$/i,"!=").replace(/^null$/i,"=="),Et=(e,t)=>/^(does)?not/i.test(e)?{"!":t}:t,Ka=({field:e,operator:t,value:a,valueSource:r},{parseNumbers:o}={})=>{const l=r==="field",d={var:e},i=p=>l?{var:`${p}`}:_e(p,o)?parseFloat(p):p;switch(t){case"<":case"<=":case"=":case"!=":case">":case">=":return{[Us(t)]:[d,i(a)]};case"null":case"notNull":return{[`${t==="notNull"?"!":"="}=`]:[d,null]};case"in":case"notIn":{const p=De(a).map(i);return p.length>0?Et(t,{in:[d,p]}):!1}case"between":case"notBetween":{const p=De(a);if(p.length>=2&&ft(p[0])&&ft(p[1])){let[h,m]=p;if(!l&&_e(h,!0)&&_e(m,!0)){const N=parseFloat(h),_=parseFloat(m);if(_<N){const F=_;m=N,h=F}else h=N,m=_}else l&&(h={var:h},m={var:m});return Et(t,{"<=":[h,d,m]})}return!1}case"contains":case"doesNotContain":{const p={in:[i(a),d]};return Et(t,p)}case"beginsWith":case"doesNotBeginWith":{const p={startsWith:[d,i(a)]};return Et(t,p)}case"endsWith":case"doesNotEndWith":{const p={endsWith:[d,i(a)]};return Et(t,p)}}return!1},Hs=(e,{parseNumbers:t,escapeQuotes:a,quoteFieldNamesWith:r=["",""],valueProcessor:o=ba}={})=>{const l=o(e,{parseNumbers:t,escapeQuotes:a,quoteFieldNamesWith:r}),d=hs(e.operator),i=d.toLowerCase();if((i==="in"||i==="not in"||i==="between"||i==="not between")&&!l)return"";const[p,h]=_a(r);return`${p}${e.field}${h} ${d} ${l}`.trim()},Za=e=>Nt(e)&&typeof e.valid=="boolean",He=(e,t,a)=>{if(typeof t=="boolean")return t;if(Za(t))return t.valid;if(typeof a=="function"&&!("rules"in e)){const r=a(e);if(typeof r=="boolean")return r;if(Za(r))return r.valid}return!0},Pt=e=>{const t=new Set,a=[];return e.forEach(r=>{t.has(r.name)||(t.add(r.name),a.push(r))}),a},ua=e=>{const t=new Set,a=new Set,r=[];return e.forEach(o=>{if(!t.has(o.label)){t.add(o.label);const l=[];o.options.forEach(d=>{a.has(d.name)||(a.add(d.name),l.push(d))}),r.push({...o,options:l})}}),r};function es(e,t={}){let a="json",r=ba,o=null,l=["",""],d=()=>!0,i=[],p={},h="",m=":",x=!1,N=da,_=pa;if(typeof t=="string")a=t.toLowerCase(),a==="mongodb"?o=za:a==="cel"?o=Ya:a==="spel"?o=Xa:a==="jsonlogic"&&(o=Ka);else{a=(t.format??"json").toLowerCase();const{valueProcessor:V=null,ruleProcessor:j=null}=t;typeof j=="function"&&(o=j),r=typeof V=="function"?(f,c)=>Bs(V)?V(f.field,f.operator,f.value,f.valueSource):V(f,c):a==="mongodb"?o??za:a==="cel"?o??Ya:a==="spel"?o??Xa:a==="jsonlogic"?o??Ka:ba,l=_a(t.quoteFieldNamesWith),d=t.validator??(()=>!0),i=t.fields??[],h=t.fallbackExpression??"",m=t.paramPrefix??":",x=!!t.parseNumbers,N=t.placeholderFieldName??da,_=t.placeholderOperatorName??pa}if(h||(h=a==="mongodb"?'"$and":[{"$expr":true}]':a==="cel"||a==="spel"?"1 == 1":"(1 = 1)"),a==="json"||a==="json_without_ids"){const V=x?ds(e):e;return a==="json"?JSON.stringify(V,null,2):JSON.stringify(V,["rules","field","value","operator","combinator","not","valueSource"])}if(typeof d=="function"){const V=d(e);if(typeof V=="boolean"){if(V===!1)return a==="parameterized"?{sql:h,params:[]}:a==="parameterized_named"?{sql:h,params:{}}:a==="mongodb"?`{${h}}`:a==="jsonlogic"?!1:h}else p=V}const F={};Pt(i).forEach(V=>{typeof V.validator=="function"&&(F[V.name]=V.validator)});const ae=V=>{let j,f;if(V.id&&(j=p[V.id]),i.length){const c=i.filter(b=>b.name===V.field);if(c.length){const b=c[0];typeof b.validator=="function"&&(f=b.validator)}}return[j,f]};if(a==="sql"){const V=(j,f)=>{if(!He(j,p[j.id??""]))return f?h:"";const c=j.rules.map(b=>{if(typeof b=="string")return b;if("rules"in b)return V(b);const[g,v]=ae(b);if(!He(b,g,v)||b.field===N||b.operator===_)return"";const y=(b.valueSource??"value")==="value";return typeof o=="function"?o(b,{parseNumbers:x,escapeQuotes:y,quoteFieldNamesWith:l}):Hs(b,{parseNumbers:x,escapeQuotes:y,valueProcessor:r,quoteFieldNamesWith:l})});return c.length===0?h:`${j.not?"NOT ":""}(${c.filter(Boolean).join("combinator"in j?` ${j.combinator} `:" ")})`};return V(e,!0)}if(a==="parameterized"||a==="parameterized_named"){const V=a==="parameterized",j=[],f={},c={},b=y=>(c[y]=(c[y]??0)+1,`${y}_${c[y]}`),g=y=>{const[T,B]=ae(y);if(!He(y,T,B)||y.field===N||y.operator===_)return"";const E=r(y,{parseNumbers:x,quoteFieldNamesWith:l}),I=hs(y.operator);if((y.valueSource??"value")==="value"){if(I.toLowerCase()==="is null"||I.toLowerCase()==="is not null")return`${l[0]}${y.field}${l[1]} ${I}`;if(I.toLowerCase()==="in"||I.toLowerCase()==="not in")if(E){const M=De(y.value);if(V)return M.forEach(k=>j.push(_e(k,x)?parseFloat(k):k)),`${l[0]}${y.field}${l[1]} ${I} (${M.map(()=>"?").join(", ")})`;const L=[];return M.forEach(k=>{const q=b(y.field);L.push(`${m}${q}`),f[q]=_e(k,x)?parseFloat(k):k}),`${l[0]}${y.field}${l[1]} ${I} (${L.join(", ")})`}else return"";else if(I.toLowerCase()==="between"||I.toLowerCase()==="not between")if(E){const M=De(y.value),[L,k]=M.slice(0,2).map(U=>_e(U,x)?parseFloat(U):U);if(V)return j.push(L),j.push(k),`${l[0]}${y.field}${l[1]} ${I} ? and ?`;const q=b(y.field),H=b(y.field);return f[q]=L,f[H]=k,`${l[0]}${y.field}${l[1]} ${I} ${m}${q} and ${m}${H}`}else return"";let G=y.value;typeof y.value=="string"&&(_e(y.value,x)?G=parseFloat(y.value):G=/^'.*'$/g.test(E)?E.replace(/(^'|'$)/g,""):E);let P="";return V?j.push(G):(P=b(y.field),f[P]=G),`${l[0]}${y.field}${l[1]} ${I} ${V?"?":`${m}${P}`}`.trim()}else{const G=I.toLowerCase();if((G==="in"||G==="not in"||G==="between"||G==="not between")&&!E)return""}return`${l[0]}${y.field}${l[1]} ${I} ${E}`.trim()},v=(y,T)=>{if(!He(y,p[y.id??""]))return T?h:"";const B=y.rules.map(E=>typeof E=="string"?E:"rules"in E?v(E):g(E));return B.length===0?h:`${y.not?"NOT ":""}(${B.filter(Boolean).join("combinator"in y?` ${y.combinator} `:" ")})`};return V?{sql:v(e,!0),params:j}:{sql:v(e,!0),params:f}}if(a==="mongodb"){const V=(c,b)=>{if(!He(c,p[c.id??""]))return b?h:"";const g=`"$${c.combinator.toLowerCase()}"`;let v=!1;const y=c.rules.map(T=>{if("rules"in T){const I=V(T);return I?(v=!0,/^\{.+\}$/.test(I)?I:`{${I}}`):""}const[B,E]=ae(T);return!He(T,B,E)||T.field===N||T.operator===_?"":(o??r)(T,{parseNumbers:x})}).filter(Boolean);return y.length>0?y.length===1&&!v?y[0]:`${g}:[${y.join(",")}]`:h},j="combinator"in e?e:fa(e),f=V(j,!0);return/^\{.+\}$/.test(f)?f:`{${f}}`}if(a==="cel"){const V=(j,f)=>{if(!He(j,p[j.id??""]))return f?h:"";const c=j.rules.map(v=>{if(typeof v=="string")return Ja[v];if("rules"in v)return V(v);const[y,T]=ae(v);return!He(v,y,T)||v.field===N||v.operator===_?"":(o??r)(v,{parseNumbers:x,escapeQuotes:(v.valueSource??"value")==="value"})}).filter(Boolean).join("combinator"in j?` ${Ja[j.combinator]} `:" "),[b,g]=j.not||!f?[`${j.not?"!":""}(`,")"]:["",""];return c?`${b}${c}${g}`:h};return V(e,!0)}if(a==="spel"){const V=(j,f)=>{if(!He(j,p[j.id??""]))return f?h:"";const c=j.rules.map(v=>{if(typeof v=="string")return v;if("rules"in v)return V(v);const[y,T]=ae(v);return!He(v,y,T)||v.field===N||v.operator===_?"":(o??r)(v,{parseNumbers:x,escapeQuotes:(v.valueSource??"value")==="value"})}).filter(Boolean).join("combinator"in j?` ${j.combinator} `:" "),[b,g]=j.not||!f?[`${j.not?"!":""}(`,")"]:["",""];return c?`${b}${c}${g}`:h};return V(e,!0)}if(a==="jsonlogic"){const V="combinator"in e?e:fa(e),j=f=>{if(!He(f,p[f.id??""]))return!1;const c=f.rules.map(g=>{if("rules"in g)return j(g);const[v,y]=ae(g);return!He(g,v,y)||g.field===N||g.operator===_?!1:(o??r)(g,{parseNumbers:x})}).filter(Boolean);if(c.length===0)return!1;const b=c.length===1?c[0]:{[f.combinator]:c};return f.not?{"!":b}:b};return j(V)}return""}var Rt=globalThis.crypto,Ye=()=>"00-0-4-2-000".replace(/[^-]/g,e=>((Math.random()+~~e)*65536>>e).toString(16).padStart(4,"0"));if(Rt){if(typeof Rt.randomUUID=="function")Ye=()=>Rt.randomUUID();else if(typeof Rt.getRandomValues=="function"){const e=["".padEnd(8,"x"),"".padEnd(4,"x"),"4".padEnd(4,"x"),"y".padEnd(4,"x"),"".padEnd(12,"x")].join("-"),t=["8","9","a","b"],a=/[xy]/g,r=new Uint32Array(32);Ye=()=>{Rt.getRandomValues(r);let o=-1;return e.replaceAll(a,l=>(o++,l==="y"?t[r[o]%4]:(r[o]%16).toString(16)))}}}var qs=(...e)=>{const t=a=>Ee(e.filter(Boolean).map(r=>Ee(r[a])));return{queryBuilder:t("queryBuilder"),ruleGroup:t("ruleGroup"),header:t("header"),body:t("body"),combinators:t("combinators"),addRule:t("addRule"),addGroup:t("addGroup"),cloneRule:t("cloneRule"),cloneGroup:t("cloneGroup"),removeGroup:t("removeGroup"),rule:t("rule"),fields:t("fields"),operators:t("operators"),value:t("value"),removeRule:t("removeRule"),notToggle:t("notToggle"),dragHandle:t("dragHandle"),lockRule:t("lockRule"),lockGroup:t("lockGroup"),valueSource:t("valueSource")}},ps=e=>{const t=typeof e=="boolean"?e:typeof e=="object"&&e!==null?e.valid:null;return typeof t=="boolean"?t?ce.valid:ce.invalid:""},Qs=(e,t,a)=>{const r=e??{};if(r.valueSources)return typeof r.valueSources=="function"?r.valueSources(t):r.valueSources;if(a){const o=a(r.name,t);if(o)return o}return["value"]},Ws={};js(Ws,{errorBothQueryDefaultQuery:()=>Ys,errorControlledToUncontrolled:()=>Xs,errorDeprecatedRuleGroupProps:()=>$s,errorDeprecatedRuleProps:()=>Js,errorEnabledDndWithoutReactDnD:()=>Ks,errorUncontrolledToControlled:()=>zs});var $s="A custom RuleGroup component has rendered a standard RuleGroup component with deprecated props. The combinator, not, and rules props should not be used. Instead, the full group object should be passed as the ruleGroup prop.",Js="A custom RuleGroup component has rendered a standard Rule component with deprecated props. The field, operator, value, and valueSource props should not be used. Instead, the full rule object should be passed as the rule prop.",Ys="QueryBuilder was rendered with both query and defaultQuery props. QueryBuilder must be either controlled or uncontrolled (specify either the query prop, or the defaultQuery prop, but not both). Decide between using a controlled or uncontrolled query builder and remove one of these props. More info: https://reactjs.org/link/controlled-components",zs="QueryBuilder is changing from an uncontrolled component to be controlled. This is likely caused by the query changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled query builder for the lifetime of the component. More info: https://reactjs.org/link/controlled-components",Xs="QueryBuilder is changing from a controlled component to be uncontrolled. This is likely caused by the query changing from defined to undefined, which should not happen. Decide between using a controlled or uncontrolled query builder for the lifetime of the component. More info: https://reactjs.org/link/controlled-components",Ks="QueryBuilder was rendered with the enableDragAndDrop prop set to true, but either react-dnd or react-dnd-html5-backend (or both) was not installed. To enable drag-and-drop functionality, install both packages and wrap QueryBuilder in QueryBuilderDnD from @react-querybuilder/dnd.",Zs=e=>{const t=W.useRef(null);return W.useEffect(()=>{t.current=e},[e]),t.current},en=({defaultQuery:e,queryProp:t,isFirstRender:a})=>{const r=Zs(!!t);W.useEffect(()=>{},[e,r,t,a])},ms=(e,t)=>{W.useEffect(()=>{},[t,e])},ya=Object.keys,tn=Object.entries,an=(e,t)=>e===!1?!1:e?!0:t!==!1,sn=(e,t)=>e?!0:e===!1?!1:!!t,nn=(e,t,a)=>e?an(t,a):sn(t,a),ha=(e,t,a)=>W.useMemo(()=>nn(e,t,a),[a,e,t]),rn=e=>{const t=W.useContext(Na),a=ha(!0,e.enableMountQueryChange,t.enableMountQueryChange),r=ha(!1,e.enableDragAndDrop,t.enableDragAndDrop)&&t.enableDragAndDrop!==!1,o=ha(!1,e.debugMode,t.debugMode),l=W.useMemo(()=>qs(Ms,t.controlClassnames,e.controlClassnames),[t.controlClassnames,e.controlClassnames]),d=W.useMemo(()=>({..._n,...t.controlElements,...e.controlElements}),[e.controlElements,t.controlElements]),i=W.useMemo(()=>{const K={};return ya(e.translations).forEach(ae=>{const V=t.translations;K[ae]={...ma[ae],...V,...e.translations[ae]}}),{...ma,...K}},[t.translations,e.translations]),{controlClassnames:p,controlElements:h,debugMode:m,enableDragAndDrop:x,enableMountQueryChange:N,translations:_,...F}=t;return{controlClassnames:l,controlElements:d,debugMode:o,enableDragAndDrop:r,enableMountQueryChange:a,translations:i,...F}},fs=(e,t)=>{W.useEffect(()=>{},[])};(function(){var e=function(A,C,O,D){for(O=O||{},D=A.length;D--;O[A[D]]=C);return O},t=[1,27],a=[1,31],r=[1,32],o=[1,28],l=[1,29],d=[1,30],i=[1,33],p=[1,34],h=[1,18],m=[1,26],x=[1,12],N=[1,13],_=[1,19],F=[1,20],K=[1,40],ae=[1,39],V=[1,41],j=[1,42],f=[1,43],c=[1,36],b=[1,37],g=[1,38],v=[5,37,43,45,49,50,53,54,55,56,60,61,62,63],y=[1,44],T=[1,45],B=[1,46],E=[5,23,24,25,26,27,28,31,37,40,43,44,45,46,49,50,53,54,55,56,60,61,62,63],I=[7,9,10,12,13,14,16,18,21,35,40,41,44,46],G=[2,36],P=[1,85],M=[43,45,50],L=[5,37,43,45,49,50,53,61,62,63],k=[5,37,43,45,49,50,53,54,55,56,61,62,63],q=[2,37],H=[49,50],U={trace:function(){},yy:{},symbols_:{error:2,main:3,expr:4,EOF:5,string_literal:6,STRING_LIT:7,bytes_literal:8,b:9,B:10,number_literal:11,INT_LIT:12,UINT_LIT:13,FLOAT_LIT:14,boolean_literal:15,BOOL_LIT:16,null_literal:17,NULL_LIT:18,literal:19,ident:20,IDENT:21,relop:22,"==":23,">=":24,">":25,"<=":26,"<":27,"!=":28,relation:29,member:30,in:31,list:32,map:33,negation:34,"!":35,negative:36,"-":37,unary:38,primary:39,DOT:40,"(":41,expr_list:42,")":43,"[":44,"]":45,"{":46,field_inits:47,trailing_comma:48,"}":49,",":50,map_inits:51,math_operation:52,"+":53,"*":54,"/":55,"%":56,conditional_expr:57,conditional_and:58,conditional_or:59,"?":60,":":61,"&&":62,"||":63,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",7:"STRING_LIT",9:"b",10:"B",12:"INT_LIT",13:"UINT_LIT",14:"FLOAT_LIT",16:"BOOL_LIT",18:"NULL_LIT",21:"IDENT",23:"==",24:">=",25:">",26:"<=",27:"<",28:"!=",31:"in",35:"!",37:"-",40:"DOT",41:"(",43:")",44:"[",45:"]",46:"{",49:"}",50:",",53:"+",54:"*",55:"/",56:"%",60:"?",61:":",62:"&&",63:"||"},productions_:[0,[3,2],[6,1],[8,2],[8,2],[11,1],[11,1],[11,1],[15,1],[17,1],[19,1],[19,1],[19,1],[19,1],[19,1],[20,1],[22,1],[22,1],[22,1],[22,1],[22,1],[22,1],[29,3],[29,3],[29,3],[34,1],[34,2],[36,1],[36,2],[38,2],[30,1],[30,1],[30,3],[30,6],[30,4],[30,5],[48,0],[48,1],[39,1],[39,2],[39,5],[39,6],[39,3],[39,1],[39,1],[39,1],[32,4],[33,4],[52,3],[52,3],[52,3],[52,3],[52,3],[4,1],[4,1],[4,1],[4,1],[4,1],[4,1],[57,5],[58,3],[59,3],[42,1],[42,3],[47,3],[47,5],[51,3],[51,5]],performAction:function(C,O,D,z,Z,S,ee){var R=S.length-1;switch(Z){case 1:return{nodeType:"Main",value:S[R-1]};case 2:this.$={type:"StringLiteral",value:S[R]};break;case 3:case 4:this.$={type:"BytesLiteral",value:S[R]};break;case 5:this.$={type:"IntegerLiteral",value:parseInt(S[R],/x/.test(S[R])?16:10)};break;case 6:this.$={type:"UnsignedIntegerLiteral",value:parseInt(S[R].replace(/u$/i,""),/^0x/.test(S[R])?16:10)};break;case 7:this.$={type:"FloatLiteral",value:parseFloat(S[R])};break;case 8:this.$={type:"BooleanLiteral",value:S[R]==="true"};break;case 9:this.$={type:"NullLiteral",value:null};break;case 10:case 11:case 12:case 13:case 14:case 16:case 17:case 18:case 19:case 20:case 21:case 38:case 43:case 44:case 45:case 53:case 54:case 55:case 56:case 57:case 58:this.$=S[R];break;case 15:this.$={type:"Identifier",value:S[R]};break;case 22:case 23:case 24:this.$={type:"Relation",left:S[R-2],operator:S[R-1],right:S[R]};break;case 25:case 27:this.$=1;break;case 26:case 28:this.$=this.$+=1;break;case 29:this.$={type:"Negation",negations:S[R-1],value:S[R]};break;case 30:case 31:this.$=S[R];break;case 32:this.$={type:"Member",left:S[R-2],right:S[R]};break;case 33:this.$={type:"Member",left:S[R-5],right:S[R-3],list:S[R-1]};break;case 34:this.$={type:"DynamicPropertyAccessor",left:S[R-3],right:S[R-1]};break;case 35:this.$={type:"FieldsObject",left:S[R-4],list:S[R-2],trailingComma:S[R-1]};break;case 36:this.$=!1;break;case 37:this.$=!0;break;case 39:this.$={type:"Property",value:S[R]};break;case 40:this.$={type:"FunctionCall",name:S[R-4],args:S[R-2],trailingComma:S[R-1]};break;case 41:this.$={type:"Property",value:S[R-4],args:S[R-2],trailingComma:S[R-1]};break;case 42:this.$={type:"ExpressionGroup",value:S[R-1]};break;case 46:this.$={type:"List",value:S[R-2],trailingComma:S[R-1]};break;case 47:this.$={type:"Map",value:S[R-2],trailingComma:S[R-1]};break;case 48:this.$={type:"Addition",left:S[R-2],right:S[R]};break;case 49:this.$={type:"Subtraction",left:S[R-2],right:S[R]};break;case 50:this.$={type:"Multiplication",left:S[R-2],right:S[R]};break;case 51:this.$={type:"Division",left:S[R-2],right:S[R]};break;case 52:this.$={type:"Modulo",left:S[R-2],right:S[R]};break;case 59:this.$={type:"ConditionalExpr",condition:S[R-4],valueIfTrue:S[R-2],valueIfFalse:S[R]};break;case 60:this.$={type:"ConditionalAnd",left:S[R-2],right:S[R]};break;case 61:this.$={type:"ConditionalOr",left:S[R-2],right:S[R]};break;case 62:this.$={type:"ExpressionList",value:[S[R]]};break;case 63:this.$=S[R-2],this.$.value.push(S[R]);break;case 64:this.$={type:"FieldInits",value:[{type:"FieldInit",left:S[R-2],right:S[R]}]};break;case 65:this.$=S[R-4],this.$.value.push({type:"FieldInit",left:S[R-2],right:S[R]});break;case 66:this.$={type:"MapInits",value:[{type:"MapInit",left:S[R-2],right:S[R]}]};break;case 67:this.$=S[R-4],this.$.value.push({type:"MapInit",left:S[R-2],right:S[R]});break}},table:[{3:1,4:2,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,44:_,46:F,52:8,57:4,58:5,59:6},{1:[3]},{5:[1,35],37:K,53:ae,54:V,55:j,56:f,60:c,62:b,63:g},e(v,[2,53],{22:47,23:[1,49],24:[1,50],25:[1,51],26:[1,52],27:[1,53],28:[1,54],31:[1,48],40:y,44:T,46:B}),e(v,[2,54]),e(v,[2,55]),e(v,[2,56]),e(v,[2,57]),e(v,[2,58]),e(E,[2,30]),e(E,[2,31]),e(E,[2,38],{41:[1,55]}),{20:56,21:h},{4:57,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,44:_,46:F,52:8,57:4,58:5,59:6},e(E,[2,43]),e(E,[2,44]),e(E,[2,45]),{6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,32:14,33:15,35:[1,59],39:58,40:x,41:N,44:_,46:F},e([5,23,24,25,26,27,28,31,37,40,41,43,44,45,46,49,50,53,54,55,56,60,61,62,63],[2,15]),{4:61,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,42:60,44:_,46:F,52:8,57:4,58:5,59:6},{4:63,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,44:_,46:F,51:62,52:8,57:4,58:5,59:6},e(E,[2,10]),e(E,[2,11]),e(E,[2,12]),e(E,[2,13]),e(E,[2,14]),e(I,[2,25]),e(E,[2,2]),e(E,[2,5]),e(E,[2,6]),e(E,[2,7]),{6:64,7:t},{6:65,7:t},e(E,[2,8]),e(E,[2,9]),{1:[2,1]},{4:66,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,44:_,46:F,52:8,57:4,58:5,59:6},{4:67,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,44:_,46:F,52:8,57:4,58:5,59:6},{4:68,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,44:_,46:F,52:8,57:4,58:5,59:6},{4:69,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,44:_,46:F,52:8,57:4,58:5,59:6},{4:70,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,44:_,46:F,52:8,57:4,58:5,59:6},{4:71,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,44:_,46:F,52:8,57:4,58:5,59:6},{4:72,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,44:_,46:F,52:8,57:4,58:5,59:6},{4:73,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,44:_,46:F,52:8,57:4,58:5,59:6},{20:74,21:h},{4:75,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,44:_,46:F,52:8,57:4,58:5,59:6},{20:77,21:h,47:76},{6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,30:78,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,44:_,46:F},{32:79,33:80,44:_,46:F},e(I,[2,16]),e(I,[2,17]),e(I,[2,18]),e(I,[2,19]),e(I,[2,20]),e(I,[2,21]),{4:61,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,42:81,44:_,46:F,52:8,57:4,58:5,59:6},e(E,[2,39],{41:[1,82]}),{37:K,43:[1,83],53:ae,54:V,55:j,56:f,60:c,62:b,63:g},e(E,[2,29]),e(I,[2,26]),{45:G,48:84,50:P},e(M,[2,62],{37:K,53:ae,54:V,55:j,56:f,60:c,62:b,63:g}),{48:86,49:G,50:[1,87]},{37:K,53:ae,54:V,55:j,56:f,60:c,61:[1,88],62:b,63:g},e(E,[2,3]),e(E,[2,4]),{37:K,53:ae,54:V,55:j,56:f,60:c,61:[1,89],62:b,63:g},e([5,43,45,49,50,61,62,63],[2,60],{37:K,53:ae,54:V,55:j,56:f,60:c}),e([5,43,45,49,50,61,63],[2,61],{37:K,53:ae,54:V,55:j,56:f,60:c,62:b}),e(L,[2,48],{54:V,55:j,56:f,60:c}),e(L,[2,49],{54:V,55:j,56:f,60:c}),e(k,[2,50],{60:c}),e(k,[2,51],{60:c}),e(k,[2,52],{60:c}),e(E,[2,32],{41:[1,90]}),{37:K,45:[1,91],53:ae,54:V,55:j,56:f,60:c,62:b,63:g},{48:92,49:G,50:[1,93]},{61:[1,94]},e(v,[2,22],{40:y,44:T,46:B}),e(v,[2,23]),e(v,[2,24]),{43:G,48:95,50:P},{4:61,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,42:96,44:_,46:F,52:8,57:4,58:5,59:6},e(E,[2,42]),{45:[1,97]},e([43,45],q,{30:3,57:4,58:5,59:6,29:7,52:8,39:9,38:10,20:11,32:14,33:15,19:16,34:17,6:21,11:22,8:23,15:24,17:25,4:98,7:t,9:a,10:r,12:o,13:l,14:d,16:i,18:p,21:h,35:m,40:x,41:N,44:_,46:F}),{49:[1,99]},{4:100,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,44:_,46:F,49:q,52:8,57:4,58:5,59:6},{4:101,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,44:_,46:F,52:8,57:4,58:5,59:6},{4:102,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,44:_,46:F,52:8,57:4,58:5,59:6},{4:61,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,42:103,44:_,46:F,52:8,57:4,58:5,59:6},e(E,[2,34]),{49:[1,104]},{20:105,21:h,49:q},{4:106,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,44:_,46:F,52:8,57:4,58:5,59:6},{43:[1,107]},{43:G,48:108,50:P},e(E,[2,46]),e(M,[2,63],{37:K,53:ae,54:V,55:j,56:f,60:c,62:b,63:g}),e(E,[2,47]),{37:K,53:ae,54:V,55:j,56:f,60:c,61:[1,109],62:b,63:g},e(H,[2,66],{37:K,53:ae,54:V,55:j,56:f,60:c,62:b,63:g}),e(v,[2,59]),{43:[1,110],50:[1,111]},e(E,[2,35]),{61:[1,112]},e(H,[2,64],{37:K,53:ae,54:V,55:j,56:f,60:c,62:b,63:g}),e(E,[2,40]),{43:[1,113]},{4:114,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,44:_,46:F,52:8,57:4,58:5,59:6},e(E,[2,33]),{4:98,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,44:_,46:F,52:8,57:4,58:5,59:6},{4:115,6:21,7:t,8:23,9:a,10:r,11:22,12:o,13:l,14:d,15:24,16:i,17:25,18:p,19:16,20:11,21:h,29:7,30:3,32:14,33:15,34:17,35:m,38:10,39:9,40:x,41:N,44:_,46:F,52:8,57:4,58:5,59:6},e(E,[2,41]),e(H,[2,67],{37:K,53:ae,54:V,55:j,56:f,60:c,62:b,63:g}),e(H,[2,65],{37:K,53:ae,54:V,55:j,56:f,60:c,62:b,63:g})],defaultActions:{35:[2,1]},parseError:function(C,O){if(O.recoverable)this.trace(C);else{var D=new Error(C);throw D.hash=O,D}},parse:function(C){var O=this,D=[0],z=[null],Z=[],S=this.table,ee="",R=0,pe=0,fe=2,ye=1,ve=Z.slice.call(arguments,1),se=Object.create(this.lexer),he={yy:{}};for(var Ge in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ge)&&(he.yy[Ge]=this.yy[Ge]);se.setInput(C,he.yy),he.yy.lexer=se,he.yy.parser=this,typeof se.yylloc>"u"&&(se.yylloc={});var Re=se.yylloc;Z.push(Re);var Ie=se.options&&se.options.ranges;typeof he.yy.parseError=="function"?this.parseError=he.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var Te=function(){var Ne;return Ne=se.lex()||ye,typeof Ne!="number"&&(Ne=O.symbols_[Ne]||Ne),Ne},de,xe,be,Ae,we={},qe,Oe,Qe,re;;){if(xe=D[D.length-1],this.defaultActions[xe]?be=this.defaultActions[xe]:((de===null||typeof de>"u")&&(de=Te()),be=S[xe]&&S[xe][de]),typeof be>"u"||!be.length||!be[0]){var oe="";re=[];for(qe in S[xe])this.terminals_[qe]&&qe>fe&&re.push("'"+this.terminals_[qe]+"'");se.showPosition?oe="Parse error on line "+(R+1)+`: `+se.showPosition()+` Expecting `+re.join(", ")+", got '"+(this.terminals_[de]||de)+"'":oe="Parse error on line "+(R+1)+": Unexpected "+(de==ye?"end of input":"'"+(this.terminals_[de]||de)+"'"),this.parseError(oe,{text:se.match,token:this.terminals_[de]||de,line:se.yylineno,loc:Re,expected:re})}if(be[0]instanceof Array&&be.length>1)throw new Error("Parse Error: multiple actions possible at state: "+xe+", token: "+de);switch(be[0]){case 1:D.push(de),z.push(se.yytext),Z.push(se.yylloc),D.push(be[1]),de=null,pe=se.yyleng,ee=se.yytext,R=se.yylineno,Re=se.yylloc;break;case 2:if(Oe=this.productions_[be[1]][1],we.$=z[z.length-Oe],we._$={first_line:Z[Z.length-(Oe||1)].first_line,last_line:Z[Z.length-1].last_line,first_column:Z[Z.length-(Oe||1)].first_column,last_column:Z[Z.length-1].last_column},Ie&&(we._$.range=[Z[Z.length-(Oe||1)].range[0],Z[Z.length-1].range[1]]),Ae=this.performAction.apply(we,[ee,pe,R,he.yy,be[1],z,Z].concat(ve)),typeof Ae<"u")return Ae;Oe&&(D=D.slice(0,-1*Oe*2),z=z.slice(0,-1*Oe),Z=Z.slice(0,-1*Oe)),D.push(this.productions_[be[1]][0]),z.push(we.$),Z.push(we._$),Qe=S[D[D.length-2]][D[D.length-1]],D.push(Qe);break;case 3:return!0}}return!0}},J=function(){var A={EOF:1,parseError:function(O,D){if(this.yy.parser)this.yy.parser.parseError(O,D);else throw new Error(O)},setInput:function(C,O){return this.yy=O||this.yy||{},this._input=C,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var C=this._input[0];this.yytext+=C,this.yyleng++,this.offset++,this.match+=C,this.matched+=C;var O=C.match(/(?:\r\n?|\n).*/g);return O?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),C},unput:function(C){var O=C.length,D=C.split(/(?:\r\n?|\n)/g);this._input=C+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-O),this.offset-=O;var z=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),D.length-1&&(this.yylineno-=D.length-1);var Z=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:D?(D.length===z.length?this.yylloc.first_column:0)+z[z.length-D.length].length-D[0].length:this.yylloc.first_column-O},this.options.ranges&&(this.yylloc.range=[Z[0],Z[0]+this.yyleng-O]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(C){this.unput(this.match.slice(C))},pastInput:function(){var C=this.matched.substr(0,this.matched.length-this.match.length);return(C.length>20?"...":"")+C.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var C=this.match;return C.length<20&&(C+=this._input.substr(0,20-C.length)),(C.substr(0,20)+(C.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var C=this.pastInput(),O=new Array(C.length+1).join("-");return C+this.upcomingInput()+` `+O+"^"},test_match:function(C,O){var D,z,Z;if(this.options.backtrack_lexer&&(Z={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Z.yylloc.range=this.yylloc.range.slice(0))),z=C[0].match(/(?:\r\n?|\n).*/g),z&&(this.yylineno+=z.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:z?z[z.length-1].length-z[z.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+C[0].length},this.yytext+=C[0],this.match+=C[0],this.matches=C,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(C[0].length),this.matched+=C[0],D=this.performAction.call(this,this.yy,this,O,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),D)return D;if(this._backtrack){for(var S in Z)this[S]=Z[S];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var C,O,D,z;this._more||(this.yytext="",this.match="");for(var Z=this._currentRules(),S=0;S<Z.length;S++)if(D=this._input.match(this.rules[Z[S]]),D&&(!O||D[0].length>O[0].length)){if(O=D,z=S,this.options.backtrack_lexer){if(C=this.test_match(D,Z[S]),C!==!1)return C;if(this._backtrack){O=!1;continue}else return!1}else if(!this.options.flex)break}return O?(C=this.test_match(O,Z[z]),C!==!1?C:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var O=this.next();return O||this.lex()},begin:function(O){this.conditionStack.push(O)},popState:function(){var O=this.conditionStack.length-1;return O>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(O){return O=this.conditionStack.length-1-Math.abs(O||0),O>=0?this.conditionStack[O]:"INITIAL"},pushState:function(O){this.begin(O)},stateStackSize:function(){return this.conditionStack.length},options:{flex:!0},performAction:function(O,D,z,Z){switch(z){case 0:break;case 1:break;case 2:return 31;case 3:return"as";case 4:return"break";case 5:return"const";case 6:return"continue";case 7:return"else";case 8:return"for";case 9:return"function";case 10:return"if";case 11:return"import";case 12:return"let";case 13:return"loop";case 14:return"package";case 15:return"namespace";case 16:return"return";case 17:return"var";case 18:return"void";case 19:return"while";case 20:return 18;case 21:return 16;case 22:return 16;case 23:return 40;case 24:return 60;case 25:return 61;case 26:return 50;case 27:return 44;case 28:return 45;case 29:return 41;case 30:return 43;case 31:return 28;case 32:return 35;case 33:return 53;case 34:return 37;case 35:return 54;case 36:return 55;case 37:return 56;case 38:return 23;case 39:return 24;case 40:return 25;case 41:return 26;case 42:return 27;case 43:return 46;case 44:return 49;case 45:return 62;case 46