@mohsinonxrm/pptb-dataverse-request-studio 1.4.0-beta.2 → 1.4.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/dist/assets/AssociateMode-Bs_R9XbQ.js +1 -0
  3. package/dist/assets/AssociateTargetsEditor-CVWE3tbv.js +1 -0
  4. package/dist/assets/{BatchMode-CHTXXyh5.js → BatchMode-XGXMc2XF.js} +9 -9
  5. package/dist/assets/{BinaryColumnPickers-xRDRVLGn.js → BinaryColumnPickers-mrnLqk3Z.js} +1 -1
  6. package/dist/assets/{BulkDeleteMode-8wZ9ILFr.js → BulkDeleteMode-DowWcbnA.js} +1 -1
  7. package/dist/assets/BulkWriteMode-Dt3M0dGV.js +6 -0
  8. package/dist/assets/DisassociateMode-qIc2CUpE.js +2 -0
  9. package/dist/assets/ExecuteWorkflowMode-Ce6sKYci.js +1 -0
  10. package/dist/assets/{ManageFileMode-BWGAVS0m.js → ManageFileMode-CcNSQkJf.js} +1 -1
  11. package/dist/assets/{ManageImageMode-BrOtm2A4.js → ManageImageMode-Dn4P4D6H.js} +1 -1
  12. package/dist/assets/{MergeMode-dDHs2-no.js → MergeMode-DzPQq2Ao.js} +1 -1
  13. package/dist/assets/{PredefinedQueryMode-B4zzRppz.js → PredefinedQueryMode-CaQqp2lm.js} +1 -1
  14. package/dist/assets/{RetrieveNextLinkMode-bLLnlOMS.js → RetrieveNextLinkMode-BNbknSwe.js} +1 -1
  15. package/dist/assets/{cssMode-DL5lLcAs.js → cssMode-B4BP9f3X.js} +1 -1
  16. package/dist/assets/{freemarker2-BCOyezro.js → freemarker2-DFKOu_2v.js} +1 -1
  17. package/dist/assets/{handlebars-OAtZzz2T.js → handlebars-cWHtgvCj.js} +1 -1
  18. package/dist/assets/{html-DEDOENUr.js → html-DSPQITYl.js} +1 -1
  19. package/dist/assets/{htmlMode-CbTgJqB3.js → htmlMode-Cr-uAXsT.js} +1 -1
  20. package/dist/assets/{index-DGsVifiB.js → index-D0g0tm7R.js} +66 -66
  21. package/dist/assets/{javascript-CZCBdW2I.js → javascript-B3oRul8j.js} +1 -1
  22. package/dist/assets/{jsonMode-DlcExoVE.js → jsonMode-_zXsQ367.js} +1 -1
  23. package/dist/assets/{liquid-DqAKLfE-.js → liquid-Cib5dNaW.js} +1 -1
  24. package/dist/assets/{mdx-NkZXeCnk.js → mdx-8A_8JwPK.js} +1 -1
  25. package/dist/assets/{monacoSetup-BIbZ_vQb.js → monacoSetup-DObeMDBe.js} +3 -3
  26. package/dist/assets/{python-DewoE6OC.js → python-DsudPCj1.js} +1 -1
  27. package/dist/assets/{razor-41Lf02tV.js → razor-CrmV2uj7.js} +1 -1
  28. package/dist/assets/{tsMode-DRTJQ7Fk.js → tsMode-BnycW89y.js} +1 -1
  29. package/dist/assets/{typescript-C7yUoo-S.js → typescript-Bs6iTDav.js} +1 -1
  30. package/dist/assets/{xml-D8F8OJXA.js → xml-DuKZPRNV.js} +1 -1
  31. package/dist/assets/{yaml-DGFY75wt.js → yaml-DDDa6myK.js} +1 -1
  32. package/dist/index.html +1 -1
  33. package/package.json +1 -1
  34. package/dist/assets/AssociateMode-d9KnV2ms.js +0 -1
  35. package/dist/assets/AssociateTargetsEditor-CuQhdosb.js +0 -1
  36. package/dist/assets/BulkWriteMode-Rw-BEdWo.js +0 -6
  37. package/dist/assets/DisassociateMode-CKUtzpgc.js +0 -2
  38. package/dist/assets/ExecuteWorkflowMode-lUjZeNYk.js +0 -1
@@ -1 +1 @@
1
- import{f as P,r as b,bo as Xe,bp as me,ag as ce,bq as Ye,t as e,B as $,D as E,a9 as G,br as J,a6 as ae,bs as Ze,aD as Te,O as et,bt as tt,bu as rt,bl as Q,Y as n,b5 as Fe,Z as M,aa as at,ab as te,aw as we,a$ as st,bv as it,bw as se,bj as ie,b3 as ne,bx as nt,Q as oe,ac as ot,ad as lt,by as dt,bz as ct,c as ut,b6 as pt,bA as ye,u as gt,e as Ne,bB as bt,bC as ht,bD as ft,bE as mt,aj as yt,ak as xt,al as jt,am as St,bF as vt,ba as kt,i as re,k as Tt,bG as De,bH as Ft,bI as xe,aK as Ie,aL as wt,L as Nt,q as Dt,at as le,au as It,av as Ct,H as Pt,y as je,z as Mt,A as Lt,G as Rt,R as Bt,U as At,S as Ot,I as zt,aF as $t,bJ as Et,bm as Vt,J as Ce,a5 as Pe,b4 as Ut,T as Ht,aT as _t,bn as Gt,bK as Wt}from"./index-DGsVifiB.js";const qt=new Set(["createdon","modifiedon","createdby","modifiedby","createdonbehalfby","modifiedonbehalfby","versionnumber","importsequencenumber","overriddencreatedon","utcconversiontimezonecode","timezoneruleversionnumber","statecode","statuscode"]),Kt=s=>qt.has(s.logicalName)||s.attributeType==="File"||s.attributeType==="Image"||s.attributeType==="Uniqueidentifier"&&s.isPrimaryKey===!0;function Jt(s){const{table:a,target:i,sub:t,fieldChoices:d,customValues:c,setFieldChoice:p,setCustomValue:o}=s,u=P(a),[h,S]=b.useState(""),[k,D]=b.useState(!0),T=b.useMemo(()=>!u||!i||!t?[]:u.columns.filter(x=>!Kt(x)&&x.isValidForUpdate!==!1&&!Xe(x)).map(x=>{const v=me(i,x),F=me(t,x),V=v==null||v==="",I=F==null||F==="";let N;return V&&I?N="both-empty":V&&!I?N="auto-fill":!V&&I?N="sub-empty":ce(x)?N=Ye(v,F)?"same":"differs":N=String(v)===String(F)?"same":"differs",{col:x,targetVal:v,subVal:F,state:N}}),[u,i,t]),L=b.useMemo(()=>{let m=T;if(k&&(m=m.filter(y=>y.state==="differs"||y.state==="auto-fill")),h){const y=h.toLowerCase();m=m.filter(x=>x.col.displayName.toLowerCase().includes(y)||x.col.logicalName.toLowerCase().includes(y))}return m},[T,k,h]),w=b.useMemo(()=>{const m=Object.values(d).filter(v=>v!=="target").length,y=T.filter(v=>v.state==="differs").length,x=T.filter(v=>v.state==="auto-fill").length;return{overrides:m,differs:y,autoFill:x}},[d,T]);return u?!i||!t?e.jsxs("div",{children:[e.jsx(G,{icon:J,title:"Field comparison",sub:"Pick both Target and Subordinate to see a side-by-side diff.",group:"write"}),e.jsx($,{layout:"multiline",intent:"info",style:{maxWidth:720},children:e.jsx(E,{children:!i&&!t?"Pick a Target (the record that survives) and a Subordinate (the duplicate to merge away) to start.":i?"Pick a Subordinate record on the left rail.":"Pick a Target record on the left rail."})})]}):e.jsxs("div",{children:[e.jsxs(G,{icon:J,title:"Field comparison",sub:e.jsxs("span",{children:["For each differing field, pick what the merged row should carry — the Target's value, the Subordinate's value, or your own."," ",e.jsx("strong",{children:"Empty Target fields get auto-filled"})," from the Subordinate by the server."]}),group:"write",children:[e.jsx(ae,{contentBefore:e.jsx(Ze,{}),"aria-label":"Filter fields",placeholder:"Filter fields…",value:h,onChange:(m,y)=>S(y.value),size:"small",style:{width:220}}),e.jsx(Te,{content:k?"Showing only differing / auto-fill rows":"Showing every column",relationship:"description",children:e.jsx(et,{size:"small",appearance:k?"primary":"outline",icon:k?e.jsx(tt,{}):e.jsx(rt,{}),onClick:()=>D(m=>!m),children:k?"Diff only":"All fields"})}),e.jsxs(Q,{appearance:"tint",color:w.overrides>0?"brand":"subtle",children:[w.overrides," override",w.overrides===1?"":"s"]}),e.jsxs(Q,{appearance:"ghost",children:[w.differs," differ · ",w.autoFill," auto-fill"]})]}),e.jsx("div",{style:{maxWidth:1200,overflowX:"auto"},children:e.jsxs("table",{style:{width:"100%",borderCollapse:"separate",borderSpacing:0},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx(q,{style:{width:"20%"},children:"Field"}),e.jsx(q,{tone:"target",children:"Target (survives)"}),e.jsx(q,{tone:"sub",children:"Subordinate"}),e.jsx(q,{style:{width:"34%"},children:"Final value"})]})}),e.jsxs("tbody",{children:[L.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:4,style:{padding:"24px 8px",textAlign:"center",color:n.colorNeutralForeground3,fontStyle:"italic"},children:k?'No differing fields. Toggle "All fields" to see the full row.':"No fields match the search."})}),L.map(m=>e.jsx(Qt,{tbl:u,row:m,choice:d[m.col.logicalName]??"target",customValue:c[m.col.logicalName],onChoice:y=>p(m.col.logicalName,y),onCustom:y=>o(m.col.logicalName,y)},m.col.logicalName))]})]})})]}):e.jsx($,{layout:"multiline",intent:"error",children:e.jsxs(E,{children:["Unknown table ",e.jsx("code",{children:a}),"."]})})}function Qt({tbl:s,row:a,choice:i,customValue:t,onChoice:d,onCustom:c}){const p=Fe(),{col:o,targetVal:u,subVal:h,state:S}=a,k=S==="differs",D=S==="auto-fill",T=!(h==null||h==="");return e.jsxs("tr",{children:[e.jsx(K,{children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx("span",{style:{fontWeight:500,color:n.colorNeutralForeground1,fontSize:12},children:o.displayName}),e.jsxs(M,{style:{color:n.colorNeutralForeground3,fontFamily:n.fontFamilyMonospace,fontSize:10},children:[o.logicalName," ·"," ",e.jsx("span",{style:{color:n.colorBrandForeground2},children:o.attributeType})]}),D&&e.jsx(Te,{content:"Target is empty — server will auto-fill from Subordinate. No override needed.",relationship:"description",children:e.jsx(Q,{appearance:"tint",color:"success",size:"extra-small",style:{alignSelf:"flex-start"},children:"auto-fill"})})]})}),e.jsx(K,{tone:"target",children:e.jsx(Se,{col:o,value:u,tbl:s})}),e.jsx(K,{tone:"sub",children:e.jsx(Se,{col:o,value:h,tbl:s})}),e.jsx(K,{children:e.jsxs("div",{className:st(p.inlineCard),style:{padding:"6px 8px"},children:[e.jsxs(at,{layout:"horizontal",value:i,onChange:(L,w)=>d(w.value),children:[e.jsx(te,{value:"target",label:e.jsxs("span",{style:{fontSize:11},children:["Target",!k&&!D&&e.jsx("span",{style:{color:n.colorNeutralForeground3},children:" · default"})]})}),e.jsx(te,{value:"subordinate",disabled:!T,label:e.jsxs("span",{style:{fontSize:11},children:["Subordinate",!T&&e.jsx("span",{style:{color:n.colorNeutralForeground3},children:" · empty"})]})}),e.jsx(te,{value:"custom",label:e.jsx("span",{style:{fontSize:11},children:"Custom"})})]}),i==="custom"&&e.jsx("div",{style:{marginTop:6},children:e.jsx(Xt,{col:o,value:t,onChange:c,fallback:typeof u=="object"?"":String(u??""),parentTable:s.logicalName})}),i==="subordinate"&&e.jsxs("div",{style:{marginTop:6,display:"flex",alignItems:"center",gap:6},children:[e.jsx(we,{style:{width:14,height:14,color:n.colorBrandForeground1}}),e.jsxs(M,{style:{color:n.colorBrandForeground2,fontWeight:500},children:["Will overwrite Target with: ",e.jsx("strong",{children:Me(o,h)})]})]})]})})]})}function q({children:s,style:a,tone:i}){const t=i==="target"?{background:"rgba(31,127,56,.08)",color:n.colorPaletteGreenForeground1}:i==="sub"?{background:"rgba(242,176,80,.08)",color:n.colorPaletteDarkOrangeForeground1}:{};return e.jsx("th",{style:{textAlign:"left",padding:"8px 10px",fontSize:11,fontWeight:600,color:n.colorNeutralForeground2,borderBottom:`2px solid ${n.colorNeutralStroke2}`,whiteSpace:"nowrap",...t,...a},children:s})}function K({children:s,tone:a}){const i=a==="target"?{background:"rgba(31,127,56,.025)",borderLeft:`2px solid ${n.colorPaletteGreenBorderActive}`}:a==="sub"?{background:"rgba(242,176,80,.025)",borderLeft:`2px solid ${n.colorPaletteDarkOrangeBorderActive}`}:{};return e.jsx("td",{style:{padding:"8px 10px",verticalAlign:"top",borderBottom:`1px solid ${n.colorNeutralStroke3}`,fontSize:12,...i},children:s})}function Se({col:s,value:a,tbl:i}){if(a==null||a==="")return e.jsx("span",{style:{color:n.colorNeutralForeground3,fontStyle:"italic",fontSize:11},children:"(empty)"});const t=Me(s,a);return e.jsx("span",{style:{fontFamily:s.attributeType==="Uniqueidentifier"||ce(s)&&!a.name?n.fontFamilyMonospace:n.fontFamilyBase,fontSize:12,color:n.colorNeutralForeground1,wordBreak:"break-word"},children:t})}function Me(s,a){if(a==null||a==="")return"(empty)";if(s.attributeType==="Boolean")return a===!0||a==="1"||a===1?s.trueOption.label:s.falseOption.label;if(ce(s)&&typeof a=="object"&&"id"in a)return dt(a);const i=se(s);if(i){const t=Number(a);if(Number.isFinite(t)){const d=i.find(c=>c.value===t);if(d)return`${d.label} · ${t}`}if(s.attributeType==="MultiSelectPicklist"&&typeof a=="string")return a.split(",").map(d=>{const c=i.find(p=>String(p.value)===d);return c?c.label:d}).join(", ")}if(s.attributeType==="Money"){const t=Number(a);if(Number.isFinite(t))return t.toLocaleString(void 0,{style:"currency",currency:"USD"})}return s.attributeType==="DateTime"&&typeof a=="string"?ct(a,s):String(a)}function Xt({col:s,value:a,onChange:i,fallback:t,parentTable:d}){switch(it(d,s.logicalName),s.attributeType){case"Memo":return e.jsx(lt,{"aria-label":`${s.displayName} (custom value)`,rows:2,size:"small",value:a??t,onChange:(c,p)=>i(p.value),style:{fontFamily:n.fontFamilyMonospace,fontSize:12}});case"Integer":case"BigInt":case"Decimal":case"Double":case"Money":return e.jsx(ot,{"aria-label":`${s.displayName} (custom value)`,size:"small",value:Number(a??0),onChange:(c,p)=>{const o=p.value??Number(p.displayValue??0);Number.isFinite(o)&&i(o)}});case"Boolean":return e.jsx(oe,{checked:a===!0,onChange:(c,p)=>i(p.checked),label:a===!0?s.trueOption.label:s.falseOption.label});case"Picklist":case"State":case"Status":case"EntityName":{const c=se(s)??[],p=c.find(o=>o.value===a);return e.jsx(ie,{"aria-label":`${s.displayName} (custom value)`,size:"small",value:p?.label??(a!=null?String(a):""),selectedOptions:a!=null?[String(a)]:[],onOptionSelect:(o,u)=>u.optionValue&&i(Number(u.optionValue)),placeholder:"Pick a value…",children:c.map(o=>e.jsx(ne,{value:String(o.value),text:o.label,children:o.label},o.value))})}case"Lookup":case"Customer":case"Owner":return e.jsx(nt,{col:s,value:a,onChange:i});case"MultiSelectPicklist":{const c=se(s)??[],p=Array.isArray(a)?a:typeof a=="string"&&a?a.split(",").map(o=>Number(o.trim())).filter(o=>Number.isFinite(o)):[];return e.jsx(ie,{"aria-label":`${s.displayName} (custom value)`,size:"small",multiselect:!0,value:p.map(o=>c.find(u=>u.value===o)?.label??String(o)).join(", "),selectedOptions:p.map(String),onOptionSelect:(o,u)=>{const h=(u.selectedOptions??[]).map(S=>Number(S)).filter(S=>Number.isFinite(S));i(h)},placeholder:"Pick one or more…",children:c.map(o=>e.jsx(ne,{value:String(o.value),text:o.label,children:o.label},o.value))})}case"DateTime":return e.jsx(ae,{"aria-label":`${s.displayName} (custom value)`,size:"small",type:s.format==="DateOnly"?"date":"datetime-local",value:typeof a=="string"?a.slice(0,16):"",onChange:(c,p)=>i(p.value),style:{fontFamily:n.fontFamilyMonospace,fontSize:12}});default:return e.jsx(ae,{"aria-label":`${s.displayName} (custom value)`,size:"small",value:a??t,onChange:(c,p)=>i(p.value)})}}const de=["account","contact","lead","incident"],Le="account, contact, lead, and incident",Yt=s=>de.includes(s),Zt=()=>({table:"",targetId:null,subordinateId:null,fieldChoices:{},customValues:{},performParentingChecks:!0,suppressDuplicateDetection:!1,bypass:$t(),headers:zt(),dirty:new Set,targetSnapshot:null,subordinateSnapshot:null}),z=Et;function nr({themeMode:s}){const a=ut("merge"),i=pt("merge",ye,Zt),[t,d]=b.useState(i.state),{table:c}=gt(t.table||null),{entities:p}=Ne(),[o,u]=b.useState("target"),[h,S]=b.useState("builder"),[k,D]=b.useState(null),[T,L]=b.useState(!1),[w,m]=b.useState([]),[y,x]=b.useState(i.lastSavedId),[v,F]=b.useState(i.lastSavedHash),[V,I]=b.useState(!1),[N,X]=b.useState(!1),j=P(t.table),Y=b.useMemo(()=>{const r=t.subordinateSnapshot;if(!j||!r)return[];const g=new Set;for(const[l,f]of Object.entries(t.fieldChoices)){if(f!=="subordinate")continue;const A=j.columns.find(Qe=>Qe.logicalName===l),O=A&&bt(r,A)?.targetEntity;O&&g.add(O)}return[...g].sort()},[j,t.subordinateSnapshot,t.fieldChoices]),Re=Y.join("|"),[Be,Ae]=b.useState([]);b.useEffect(()=>{for(const r of Y)P(r)||ht.getTable(r).catch(()=>{}).then(g=>{g||Ae(l=>l.includes(r)?l:[...l,r])})},[Re]);const W=Y.filter(r=>!P(r)),ue=W.filter(r=>Be.includes(r)),U=b.useMemo(()=>ft(t),[t,c]),Oe=W.join("|"),ze=b.useMemo(()=>mt(t),[t,c,Oe]);b.useEffect(()=>{let r=!1;if(!t.table||!t.targetId||!j||!z(t.targetId)){d(l=>({...l,targetSnapshot:null}));return}if(typeof window>"u"||!window.dataverseAPI?.queryData)return;I(!0);const g=`/${j.entitySetName}(${t.targetId})`;return window.dataverseAPI.queryData(g).then(l=>{if(r)return;const f=l?.value,A=Array.isArray(f)?f[0]??null:f&&typeof f=="object"?f:l&&typeof l=="object"&&j.primaryKey in l?l:null;d(O=>({...O,targetSnapshot:A})),I(!1)}).catch(()=>{r||(d(l=>({...l,targetSnapshot:null})),I(!1))}),()=>{r=!0}},[t.table,t.targetId,j]),b.useEffect(()=>{let r=!1;if(!t.table||!t.subordinateId||!j||!z(t.subordinateId)){d(l=>({...l,subordinateSnapshot:null}));return}if(typeof window>"u"||!window.dataverseAPI?.queryData)return;X(!0);const g=`/${j.entitySetName}(${t.subordinateId})`;return window.dataverseAPI.queryData(g).then(l=>{if(r)return;const f=l?.value,A=Array.isArray(f)?f[0]??null:f&&typeof f=="object"?f:l&&typeof l=="object"&&j.primaryKey in l?l:null;d(O=>({...O,subordinateSnapshot:A})),X(!1)}).catch(()=>{r||(d(l=>({...l,subordinateSnapshot:null})),X(!1))}),()=>{r=!0}},[t.table,t.subordinateId,j]);const pe=r=>d(g=>{const l=new Set(g.dirty);return l.add(r),{...g,dirty:l}}),R=(r,g,l)=>{d(f=>({...f,[r]:g})),l&&pe(l)},$e=(r,g)=>{d(l=>{const f={...l.fieldChoices};return g==="target"?delete f[r]:f[r]=g,{...l,fieldChoices:f,dirty:new Set(l.dirty).add("fielddiff")}})},Ee=(r,g)=>{d(l=>({...l,customValues:{...l.customValues,[r]:g},dirty:new Set(l.dirty).add("fielddiff")}))},Z=t.targetSnapshot,ee=t.subordinateSnapshot,H=Object.values(t.fieldChoices).filter(r=>r!=="target").length,Ve=j?Yt(j.logicalName)?t.targetId?z(t.targetId)?t.subordinateId?z(t.subordinateId)?t.targetId===t.subordinateId?"Target and Subordinate must be different records.":t.headers.some(r=>r.enabled&&!r.name)?"Fix empty header name.":ue.length>0?`Couldn't load metadata for ${ue.join(", ")}, so a lookup kept from the Subordinate can’t be bound. Pick Target or Custom for it instead.`:W.length>0?`Loading metadata for ${W.join(", ")} to bind the lookups kept from the Subordinate…`:null:"Subordinate record id is not a valid GUID.":"Pick a Subordinate record (the loser).":"Target record id is not a valid GUID.":"Pick a Target record (the winner).":`Merge is only supported for ${Le}.`:"Pick a target table first.",Ue=async()=>{L(!0);const r=await _t.merge(t,je(ge,null));D(r),L(!1),S("results"),m(g=>[{id:`r-${Date.now()}`,snapshot:B,modeId:"merge",url:U.relativeUrl,method:"POST",ts:Date.now(),status:r.status,ms:r.ms,rowCount:r.ok?1:0},...g].slice(0,8)),d(g=>({...g,dirty:new Set}))},ge=b.useMemo(()=>{let r=[...t.headers];return t.suppressDuplicateDetection&&r.push({id:"__sup-dupe",name:"MSCRM.SuppressDuplicateDetection",value:"true",enabled:!0,builtin:!0,hint:"Skips duplicate detection rules when applying UpdateContent overrides."}),r=yt(r,t.bypass),r},[t.headers,t.suppressDuplicateDetection,t.bypass]),be=b.useMemo(()=>{const r=[...xt(t.bypass,"bypass"),...jt({op:"merge",bypass:t.bypass})];return t.targetId&&!z(t.targetId)&&r.push({id:"merge-bad-target-guid",severity:"error",source:"validation",focusNode:"target",title:"Invalid Target record id",body:`"${t.targetId}" isn't a valid GUID. The merge will fail at the wire.`}),t.subordinateId&&!z(t.subordinateId)&&r.push({id:"merge-bad-sub-guid",severity:"error",source:"validation",focusNode:"subordinate",title:"Invalid Subordinate record id",body:`"${t.subordinateId}" isn't a valid GUID. The merge will fail at the wire.`}),r},[t.bypass,t.targetId,t.subordinateId]),He=St(be),B=b.useMemo(()=>vt(t),[t]);kt("merge",B,y,v);const _e=b.useMemo(()=>re(B),[B]),he=v===null?!0:_e!==v,Ge=r=>{x(r.id),F(re(r.state))},fe=r=>{if(r.modeId!=="merge")return;const g=r.state;if(p.length>0&&!p.some(l=>l.logicalName===g.table)){Vt(`Can't load "${r.name}": entity \`${g.table}\` isn't available in this environment. The solution may have been removed or you may be connected to a different org.`);return}d(ye(g)),x(r.id),F(re(g)),D(null),u("target")},We=r=>{const g=Gt(r,"merge");if(!g)return;const l=y,f=v;fe(g),x(l),F(f)};Tt(b.useMemo(()=>t.table?{state:B,modeId:"merge",dirty:he,lastSavedId:y,onSaved:Ge,onLoadSaved:fe}:null,[B,he,y,t.table]));const qe=[{id:"target",label:"Target",meta:j?.displayName??"Pick a table",items:[{id:"target",icon:Ft,iconFilled:De,label:"Master (survives)",badge:t.targetId?"✓":null,badgeAppearance:"ghost",dirty:t.dirty.has("target")||t.dirty.has("entity")}]},{id:"subordinate-section",label:"Subordinate",meta:t.subordinateId?"will be deactivated":"pick a record",items:[{id:"subordinate",icon:xe,iconFilled:J,label:"Subordinate record",badge:t.subordinateId?"✓":null,badgeAppearance:"ghost",dirty:t.dirty.has("subordinate")}]},{id:"override",label:"Override fields",meta:`${H} override${H===1?"":"s"}`,items:[{id:"fielddiff",icon:xe,iconFilled:J,label:"Field comparison",badge:H||null,badgeAppearance:"tint",badgeColor:H>0?"brand":"subtle",dirty:t.dirty.has("fielddiff")}]},{id:"settings",label:"Settings",meta:(t.performParentingChecks?1:0)+(t.suppressDuplicateDetection?1:0)==0?"defaults":`${(t.performParentingChecks?1:0)+(t.suppressDuplicateDetection?1:0)} set`,items:[{id:"options",icon:wt,iconFilled:Ie,label:"Merge options",badge:(t.performParentingChecks?1:0)+(t.suppressDuplicateDetection?1:0)||null,badgeAppearance:"ghost",dirty:t.dirty.has("options")}]},{id:"headers",label:"Headers",meta:`${t.headers.filter(r=>r.enabled).length} active`,items:[{id:"headers",icon:Dt,iconFilled:Nt,label:"HTTP headers",badge:t.headers.filter(r=>r.enabled).length||null,dirty:t.dirty.has("headers")},{id:"bypass",icon:le,iconFilled:le,label:"Bypass logic",badge:It(t.bypass),badgeAppearance:t.bypass.businessLogic!=="none"||t.bypass.suppressFlows?"tint":"ghost",badgeColor:t.bypass.businessLogic!=="none"||t.bypass.suppressFlows?"warning":"subtle",dirty:t.dirty.has("bypass")}]}];let C;switch(o){case"target":C=e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[e.jsx(rr,{state:t,setState:d,markDirty:pe,onEntityChange:()=>{x(void 0),F(null)}}),e.jsx(ke,{title:"Master record",sub:"The record that keeps its identity. Subordinate is merged into it.",table:t.table,selectedId:t.targetId,onPick:r=>R("targetId",r,"target")})]});break;case"subordinate":C=e.jsx(ke,{title:"Subordinate (deactivated)",sub:"The duplicate to merge away. Its relationships re-parent to the Target; the row gets statecode=Inactive.",table:t.table,selectedId:t.subordinateId,onPick:r=>R("subordinateId",r,"subordinate"),conflictWith:t.targetId});break;case"fielddiff":C=e.jsxs("div",{children:[e.jsx(er,{overrideCount:H,subordinateName:_(j,ee??void 0)}),e.jsx(tr,{table:t.table,target:Z??void 0,subordinate:ee??void 0,targetLoading:V,subordinateLoading:N}),e.jsx(Jt,{table:t.table,target:t.targetSnapshot??null,sub:t.subordinateSnapshot??null,fieldChoices:t.fieldChoices,customValues:t.customValues,setFieldChoice:$e,setCustomValue:Ee})]});break;case"options":C=e.jsx(ar,{performParentingChecks:t.performParentingChecks,setPerformParentingChecks:r=>R("performParentingChecks",r,"options"),suppressDuplicateDetection:t.suppressDuplicateDetection,setSuppressDuplicateDetection:r=>R("suppressDuplicateDetection",r,"options")});break;case"headers":C=e.jsx(Pt,{items:t.headers,setItems:r=>R("headers",r,"headers"),group:"write"});break;case"bypass":C=e.jsx(Ct,{value:t.bypass,onChange:r=>R("bypass",r,"bypass"),group:"write"});break}const Ke=je(ge,null),Je={method:"POST",built:U,headers:Ke,body:ze,entityLogical:U.entityLogical};return e.jsx(Mt,{sidebar:e.jsx(Ot,{type:a,urlPreview:U.relativeNoBase,sections:qe,activeNode:o,onSelect:r=>{u(r),S("builder")},recents:w,onRecentClick:We}),urlBar:e.jsx(At,{method:"POST",url:U.relativeUrl,executeVerb:a.executeVerb,disabledReason:Ve??He,loading:T,onExecute:Ue,advisories:be,onAdvisoryFocus:u}),children:e.jsxs(Lt,{tab:h,onTabChange:S,resultCount:k?.ok?1:null,children:[h==="builder"&&C,h==="code"&&e.jsx(Rt,{themeMode:s,inputs:Je}),h==="results"&&e.jsx(Bt,{result:k,mode:"single",table:t.table,writeContext:{operation:"merge",table:t.table,recordId:t.targetId,recordName:_(j,Z??void 0),targetName:_(j,Z??void 0),subordinateName:_(j,ee??void 0)}})]})})}function er({overrideCount:s,subordinateName:a}){return e.jsx($,{layout:"multiline",intent:"warning",icon:e.jsx(le,{}),style:{marginBottom:14},children:e.jsxs(E,{children:[e.jsx(Ce,{children:"Merge is irreversible."}),a?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:a})," will be deactivated,"," "]}):"The subordinate will be deactivated, ","its related records re-parent to the Target, and ",e.jsx("strong",{children:s})," field",s===1?"":"s"," on the Target will be overwritten by your overrides. The server also auto-fills any empty Target fields from the Subordinate."]})})}function tr({table:s,target:a,subordinate:i,targetLoading:t,subordinateLoading:d}){const c=Fe(),p=P(s);return p?e.jsxs("div",{className:c.inlineCard,style:{padding:14,marginBottom:14,display:"grid",gridTemplateColumns:"1fr 44px 1fr",gap:10,alignItems:"stretch"},children:[e.jsx(ve,{tone:"target",chip:"TARGET",chipDescription:"survives the merge",row:a,tbl:p,emptyHint:t?"Loading Target record…":"Pick a Target record."}),e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",color:n.colorNeutralForeground3},children:e.jsx(we,{style:{width:28,height:28}})}),e.jsx(ve,{tone:"sub",chip:"SUBORDINATE",chipDescription:"will be deactivated",row:i,tbl:p,emptyHint:d?"Loading Subordinate record…":"Pick a Subordinate record."})]}):null}function ve({tone:s,chip:a,chipDescription:i,row:t,tbl:d,emptyHint:c}){const p=s==="target"?{border:`1px solid ${n.colorPaletteGreenBorderActive}`,background:n.colorPaletteGreenBackground1}:{border:`1px solid ${n.colorPaletteDarkOrangeBorderActive}`,background:n.colorPaletteDarkOrangeBackground1},o=s==="target"?n.colorPaletteGreenForeground1:n.colorPaletteDarkOrangeForeground1,u=_(d,t),h=t?String(t[d.primaryKey]??""):null,S=t?.createdon?String(t.createdon):null,k=S?new Date(S).toLocaleDateString(void 0,{year:"numeric",month:"short"}):null;return e.jsxs("div",{style:{...p,borderRadius:n.borderRadiusMedium,padding:12},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[e.jsx(Q,{appearance:"filled",style:{background:o,color:n.colorNeutralForegroundOnBrand,fontWeight:700,letterSpacing:.4},children:a}),e.jsx(M,{style:{color:n.colorNeutralForeground3},children:i})]}),t?e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:[e.jsx(Wt,{size:"small",name:u??"?",avatar:{color:"colorful"}}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:13,fontWeight:600},children:u??"(no name)"}),e.jsx("div",{style:{fontFamily:n.fontFamilyMonospace,fontSize:10,color:n.colorNeutralForeground3},children:h??""})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2,fontSize:11,color:n.colorNeutralForeground3},children:[k&&e.jsxs("div",{children:["Created:"," ",e.jsx("strong",{style:{color:n.colorNeutralForeground2},children:k})]}),t.accountnumber!=null&&e.jsxs("div",{children:["Account #:"," ",e.jsx("strong",{style:{color:n.colorNeutralForeground2,fontFamily:n.fontFamilyMonospace},children:String(t.accountnumber)})]}),t.revenue!=null&&e.jsxs("div",{children:["Revenue:"," ",e.jsx("strong",{style:{color:n.colorNeutralForeground2},children:Number(t.revenue).toLocaleString(void 0,{style:"currency",currency:"USD",maximumFractionDigits:0})})]}),t.emailaddress1!=null&&e.jsxs("div",{children:["Email:"," ",e.jsx("strong",{style:{color:n.colorNeutralForeground2},children:String(t.emailaddress1)})]})]})]}):e.jsx("div",{style:{padding:"20px 4px",color:n.colorNeutralForeground3,fontSize:12,fontStyle:"italic",textAlign:"center"},children:c})]})}function rr({state:s,setState:a,markDirty:i,onEntityChange:t}){const d=P(s.table),{allEntities:c,allLoading:p}=Ne(),o=b.useMemo(()=>de.map(u=>c.find(h=>h.logicalName===u)).filter(u=>!!u),[c]);return e.jsxs("div",{children:[e.jsx(G,{icon:Ht,title:"Merge entity type",sub:`Pick the table to merge. The Merge action is restricted to ${Le}.`,group:"write"}),e.jsxs("div",{style:{maxWidth:560},children:[e.jsx(Pe,{label:"Entity",hint:p?"Loading tables…":o.length===0?`No Merge-supported table (${de.join(", ")}) was found in this environment.`:void 0,children:e.jsx(ie,{value:d?.displayName??"",selectedOptions:[s.table],onOptionSelect:(u,h)=>{h.optionValue&&(a(S=>({...S,table:h.optionValue,targetId:null,subordinateId:null,fieldChoices:{},customValues:{},targetSnapshot:null,subordinateSnapshot:null})),i("entity"),i("target"),i("subordinate"),i("fielddiff"),t())},children:o.map(u=>e.jsx(ne,{value:u.logicalName,text:u.displayName,children:e.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.jsx("span",{children:u.displayName}),e.jsxs(M,{style:{color:n.colorNeutralForeground3},children:[u.entitySetName," · supports Merge"]})]})},u.logicalName))})}),e.jsx($,{layout:"multiline",intent:"info",style:{marginTop:14},children:e.jsxs(E,{children:["Merge requires both records be the ",e.jsx("strong",{children:"same entity type"}),"."," ",e.jsx("code",{children:"incident"})," behaves differently — per docs, the ",e.jsx("code",{children:"UpdateContent"})," ","parameter is ",e.jsx("strong",{children:"ignored"})," for incident, and the merge runs in the user's security context (not system)."]})})]})]})}function ke({title:s,sub:a,table:i,selectedId:t,onPick:d,conflictWith:c}){const p=P(i),o=c&&t&&c===t;return e.jsxs("div",{children:[e.jsx(G,{icon:De,title:s,sub:a,group:"write"}),e.jsxs("div",{style:{maxWidth:480},children:[e.jsx(Pe,{label:"Record",children:e.jsx(Ut,{table:i,selectedId:t,onPick:u=>d(u?.id??null),placeholder:`Search ${p?.displayName??""} records…`})}),o&&e.jsx($,{layout:"multiline",intent:"error",style:{marginTop:14},children:e.jsx(E,{children:"Target and Subordinate must be different records."})}),!t&&e.jsx(M,{style:{display:"block",marginTop:8,color:n.colorNeutralForeground3},children:"Tip: use the search box to filter by primary name (e.g. account name, contact full name)."})]})]})}function ar({performParentingChecks:s,setPerformParentingChecks:a,suppressDuplicateDetection:i,setSuppressDuplicateDetection:t}){return e.jsxs("div",{children:[e.jsx(G,{icon:Ie,title:"Merge options",sub:"Controls applied during the merge operation.",group:"write"}),e.jsxs("div",{style:{maxWidth:720,display:"flex",flexDirection:"column",gap:16},children:[e.jsx("div",{style:{padding:12,border:`1px solid ${n.colorNeutralStroke2}`,borderRadius:n.borderRadiusMedium},children:e.jsx(oe,{checked:s,onChange:(d,c)=>a(c.checked),label:e.jsxs("span",{children:[e.jsx("strong",{children:"PerformParentingChecks"}),e.jsx(M,{style:{display:"block",color:n.colorNeutralForeground3,marginTop:2},children:"When enabled, the merge fails if the Target and Subordinate have different parent records. Useful for child entities (e.g. contacts under different accounts)."})]})})}),e.jsx("div",{style:{padding:12,border:`1px solid ${n.colorNeutralStroke2}`,borderRadius:n.borderRadiusMedium},children:e.jsx(oe,{checked:i,onChange:(d,c)=>t(c.checked),label:e.jsxs("span",{children:[e.jsx("strong",{children:"MSCRM.SuppressDuplicateDetection"})," ",e.jsx("code",{style:{fontFamily:n.fontFamilyMonospace,fontSize:11},children:"= true"}),e.jsxs(M,{style:{display:"block",color:n.colorNeutralForeground3,marginTop:2},children:["Skip duplicate detection rules when applying ",e.jsx("code",{children:"UpdateContent"})," to the Target. Adds the ",e.jsx("code",{children:"MSCRM.SuppressDuplicateDetection: true"})," request header."]})]})})}),e.jsx($,{layout:"multiline",intent:"warning",children:e.jsxs(E,{children:[e.jsx(Ce,{children:"Merge is destructive."}),"The Subordinate is deactivated (",e.jsx("code",{children:"statecode=Inactive"}),") and most of its relationships re-parent to the Target. Some Target fields take Subordinate's value only when the Target's value is empty. Use ",e.jsx("strong",{children:"UpdateContent"})," (the Field comparison pane) to override that."]})})]})]})}function _(s,a){if(!s||!a)return null;const i=a[s.primaryName];return i!=null?String(i):null}export{nr as MergeMode};
1
+ import{f as M,r as b,bp as Xe,bq as me,ah as ce,br as Ye,t as e,B as E,D as $,a9 as _,bs as J,a6 as ae,bt as Ze,aE as Te,O as et,bu as tt,bv as rt,bm as Q,Y as n,b6 as we,Z as P,aa as at,ab as te,ax as Fe,b0 as st,bw as it,bx as se,bk as ie,b4 as ne,by as nt,Q as oe,ac as ot,ad as lt,bz as dt,bA as ct,c as ut,b7 as pt,bB as ye,u as gt,e as Ne,bC as bt,bD as ht,bE as ft,bF as mt,ak as yt,al as xt,am as jt,an as St,bG as vt,bb as kt,i as re,k as Tt,bH as De,bI as wt,bJ as xe,aL as Ie,aM as Ft,L as Nt,q as Dt,au as le,av as It,aw as Ct,H as Mt,y as je,z as Pt,A as Lt,G as Rt,R as Bt,U as At,S as Ot,I as zt,aG as Et,bK as $t,bn as Vt,J as Ce,a5 as Me,b5 as Ut,T as Ht,aU as Gt,bo as _t,bL as Wt}from"./index-D0g0tm7R.js";const qt=new Set(["createdon","modifiedon","createdby","modifiedby","createdonbehalfby","modifiedonbehalfby","versionnumber","importsequencenumber","overriddencreatedon","utcconversiontimezonecode","timezoneruleversionnumber","statecode","statuscode"]),Kt=s=>qt.has(s.logicalName)||s.attributeType==="File"||s.attributeType==="Image"||s.attributeType==="Uniqueidentifier"&&s.isPrimaryKey===!0;function Jt(s){const{table:a,target:i,sub:t,fieldChoices:d,customValues:c,setFieldChoice:p,setCustomValue:o}=s,u=M(a),[h,S]=b.useState(""),[k,D]=b.useState(!0),T=b.useMemo(()=>!u||!i||!t?[]:u.columns.filter(x=>!Kt(x)&&x.isValidForUpdate!==!1&&!Xe(x)).map(x=>{const v=me(i,x),w=me(t,x),V=v==null||v==="",I=w==null||w==="";let N;return V&&I?N="both-empty":V&&!I?N="auto-fill":!V&&I?N="sub-empty":ce(x)?N=Ye(v,w)?"same":"differs":N=String(v)===String(w)?"same":"differs",{col:x,targetVal:v,subVal:w,state:N}}),[u,i,t]),L=b.useMemo(()=>{let m=T;if(k&&(m=m.filter(y=>y.state==="differs"||y.state==="auto-fill")),h){const y=h.toLowerCase();m=m.filter(x=>x.col.displayName.toLowerCase().includes(y)||x.col.logicalName.toLowerCase().includes(y))}return m},[T,k,h]),F=b.useMemo(()=>{const m=Object.values(d).filter(v=>v!=="target").length,y=T.filter(v=>v.state==="differs").length,x=T.filter(v=>v.state==="auto-fill").length;return{overrides:m,differs:y,autoFill:x}},[d,T]);return u?!i||!t?e.jsxs("div",{children:[e.jsx(_,{icon:J,title:"Field comparison",sub:"Pick both Target and Subordinate to see a side-by-side diff.",group:"write"}),e.jsx(E,{layout:"multiline",intent:"info",style:{maxWidth:720},children:e.jsx($,{children:!i&&!t?"Pick a Target (the record that survives) and a Subordinate (the duplicate to merge away) to start.":i?"Pick a Subordinate record on the left rail.":"Pick a Target record on the left rail."})})]}):e.jsxs("div",{children:[e.jsxs(_,{icon:J,title:"Field comparison",sub:e.jsxs("span",{children:["For each differing field, pick what the merged row should carry — the Target's value, the Subordinate's value, or your own."," ",e.jsx("strong",{children:"Empty Target fields get auto-filled"})," from the Subordinate by the server."]}),group:"write",children:[e.jsx(ae,{contentBefore:e.jsx(Ze,{}),"aria-label":"Filter fields",placeholder:"Filter fields…",value:h,onChange:(m,y)=>S(y.value),size:"small",style:{width:220}}),e.jsx(Te,{content:k?"Showing only differing / auto-fill rows":"Showing every column",relationship:"description",children:e.jsx(et,{size:"small",appearance:k?"primary":"outline",icon:k?e.jsx(tt,{}):e.jsx(rt,{}),onClick:()=>D(m=>!m),children:k?"Diff only":"All fields"})}),e.jsxs(Q,{appearance:"tint",color:F.overrides>0?"brand":"subtle",children:[F.overrides," override",F.overrides===1?"":"s"]}),e.jsxs(Q,{appearance:"ghost",children:[F.differs," differ · ",F.autoFill," auto-fill"]})]}),e.jsx("div",{style:{maxWidth:1200,overflowX:"auto"},children:e.jsxs("table",{style:{width:"100%",borderCollapse:"separate",borderSpacing:0},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx(q,{style:{width:"20%"},children:"Field"}),e.jsx(q,{tone:"target",children:"Target (survives)"}),e.jsx(q,{tone:"sub",children:"Subordinate"}),e.jsx(q,{style:{width:"34%"},children:"Final value"})]})}),e.jsxs("tbody",{children:[L.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:4,style:{padding:"24px 8px",textAlign:"center",color:n.colorNeutralForeground3,fontStyle:"italic"},children:k?'No differing fields. Toggle "All fields" to see the full row.':"No fields match the search."})}),L.map(m=>e.jsx(Qt,{tbl:u,row:m,choice:d[m.col.logicalName]??"target",customValue:c[m.col.logicalName],onChoice:y=>p(m.col.logicalName,y),onCustom:y=>o(m.col.logicalName,y)},m.col.logicalName))]})]})})]}):e.jsx(E,{layout:"multiline",intent:"error",children:e.jsxs($,{children:["Unknown table ",e.jsx("code",{children:a}),"."]})})}function Qt({tbl:s,row:a,choice:i,customValue:t,onChoice:d,onCustom:c}){const p=we(),{col:o,targetVal:u,subVal:h,state:S}=a,k=S==="differs",D=S==="auto-fill",T=!(h==null||h==="");return e.jsxs("tr",{children:[e.jsx(K,{children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx("span",{style:{fontWeight:500,color:n.colorNeutralForeground1,fontSize:12},children:o.displayName}),e.jsxs(P,{style:{color:n.colorNeutralForeground3,fontFamily:n.fontFamilyMonospace,fontSize:10},children:[o.logicalName," ·"," ",e.jsx("span",{style:{color:n.colorBrandForeground2},children:o.attributeType})]}),D&&e.jsx(Te,{content:"Target is empty — server will auto-fill from Subordinate. No override needed.",relationship:"description",children:e.jsx(Q,{appearance:"tint",color:"success",size:"extra-small",style:{alignSelf:"flex-start"},children:"auto-fill"})})]})}),e.jsx(K,{tone:"target",children:e.jsx(Se,{col:o,value:u,tbl:s})}),e.jsx(K,{tone:"sub",children:e.jsx(Se,{col:o,value:h,tbl:s})}),e.jsx(K,{children:e.jsxs("div",{className:st(p.inlineCard),style:{padding:"6px 8px"},children:[e.jsxs(at,{layout:"horizontal",value:i,onChange:(L,F)=>d(F.value),children:[e.jsx(te,{value:"target",label:e.jsxs("span",{style:{fontSize:11},children:["Target",!k&&!D&&e.jsx("span",{style:{color:n.colorNeutralForeground3},children:" · default"})]})}),e.jsx(te,{value:"subordinate",disabled:!T,label:e.jsxs("span",{style:{fontSize:11},children:["Subordinate",!T&&e.jsx("span",{style:{color:n.colorNeutralForeground3},children:" · empty"})]})}),e.jsx(te,{value:"custom",label:e.jsx("span",{style:{fontSize:11},children:"Custom"})})]}),i==="custom"&&e.jsx("div",{style:{marginTop:6},children:e.jsx(Xt,{col:o,value:t,onChange:c,fallback:typeof u=="object"?"":String(u??""),parentTable:s.logicalName})}),i==="subordinate"&&e.jsxs("div",{style:{marginTop:6,display:"flex",alignItems:"center",gap:6},children:[e.jsx(Fe,{style:{width:14,height:14,color:n.colorBrandForeground1}}),e.jsxs(P,{style:{color:n.colorBrandForeground2,fontWeight:500},children:["Will overwrite Target with: ",e.jsx("strong",{children:Pe(o,h)})]})]})]})})]})}function q({children:s,style:a,tone:i}){const t=i==="target"?{background:"rgba(31,127,56,.08)",color:n.colorPaletteGreenForeground1}:i==="sub"?{background:"rgba(242,176,80,.08)",color:n.colorPaletteDarkOrangeForeground1}:{};return e.jsx("th",{style:{textAlign:"left",padding:"8px 10px",fontSize:11,fontWeight:600,color:n.colorNeutralForeground2,borderBottom:`2px solid ${n.colorNeutralStroke2}`,whiteSpace:"nowrap",...t,...a},children:s})}function K({children:s,tone:a}){const i=a==="target"?{background:"rgba(31,127,56,.025)",borderLeft:`2px solid ${n.colorPaletteGreenBorderActive}`}:a==="sub"?{background:"rgba(242,176,80,.025)",borderLeft:`2px solid ${n.colorPaletteDarkOrangeBorderActive}`}:{};return e.jsx("td",{style:{padding:"8px 10px",verticalAlign:"top",borderBottom:`1px solid ${n.colorNeutralStroke3}`,fontSize:12,...i},children:s})}function Se({col:s,value:a,tbl:i}){if(a==null||a==="")return e.jsx("span",{style:{color:n.colorNeutralForeground3,fontStyle:"italic",fontSize:11},children:"(empty)"});const t=Pe(s,a);return e.jsx("span",{style:{fontFamily:s.attributeType==="Uniqueidentifier"||ce(s)&&!a.name?n.fontFamilyMonospace:n.fontFamilyBase,fontSize:12,color:n.colorNeutralForeground1,wordBreak:"break-word"},children:t})}function Pe(s,a){if(a==null||a==="")return"(empty)";if(s.attributeType==="Boolean")return a===!0||a==="1"||a===1?s.trueOption.label:s.falseOption.label;if(ce(s)&&typeof a=="object"&&"id"in a)return dt(a);const i=se(s);if(i){const t=Number(a);if(Number.isFinite(t)){const d=i.find(c=>c.value===t);if(d)return`${d.label} · ${t}`}if(s.attributeType==="MultiSelectPicklist"&&typeof a=="string")return a.split(",").map(d=>{const c=i.find(p=>String(p.value)===d);return c?c.label:d}).join(", ")}if(s.attributeType==="Money"){const t=Number(a);if(Number.isFinite(t))return t.toLocaleString(void 0,{style:"currency",currency:"USD"})}return s.attributeType==="DateTime"&&typeof a=="string"?ct(a,s):String(a)}function Xt({col:s,value:a,onChange:i,fallback:t,parentTable:d}){switch(it(d,s.logicalName),s.attributeType){case"Memo":return e.jsx(lt,{"aria-label":`${s.displayName} (custom value)`,rows:2,size:"small",value:a??t,onChange:(c,p)=>i(p.value),style:{fontFamily:n.fontFamilyMonospace,fontSize:12}});case"Integer":case"BigInt":case"Decimal":case"Double":case"Money":return e.jsx(ot,{"aria-label":`${s.displayName} (custom value)`,size:"small",value:Number(a??0),onChange:(c,p)=>{const o=p.value??Number(p.displayValue??0);Number.isFinite(o)&&i(o)}});case"Boolean":return e.jsx(oe,{checked:a===!0,onChange:(c,p)=>i(p.checked),label:a===!0?s.trueOption.label:s.falseOption.label});case"Picklist":case"State":case"Status":case"EntityName":{const c=se(s)??[],p=c.find(o=>o.value===a);return e.jsx(ie,{"aria-label":`${s.displayName} (custom value)`,size:"small",value:p?.label??(a!=null?String(a):""),selectedOptions:a!=null?[String(a)]:[],onOptionSelect:(o,u)=>u.optionValue&&i(Number(u.optionValue)),placeholder:"Pick a value…",children:c.map(o=>e.jsx(ne,{value:String(o.value),text:o.label,children:o.label},o.value))})}case"Lookup":case"Customer":case"Owner":return e.jsx(nt,{col:s,value:a,onChange:i});case"MultiSelectPicklist":{const c=se(s)??[],p=Array.isArray(a)?a:typeof a=="string"&&a?a.split(",").map(o=>Number(o.trim())).filter(o=>Number.isFinite(o)):[];return e.jsx(ie,{"aria-label":`${s.displayName} (custom value)`,size:"small",multiselect:!0,value:p.map(o=>c.find(u=>u.value===o)?.label??String(o)).join(", "),selectedOptions:p.map(String),onOptionSelect:(o,u)=>{const h=(u.selectedOptions??[]).map(S=>Number(S)).filter(S=>Number.isFinite(S));i(h)},placeholder:"Pick one or more…",children:c.map(o=>e.jsx(ne,{value:String(o.value),text:o.label,children:o.label},o.value))})}case"DateTime":return e.jsx(ae,{"aria-label":`${s.displayName} (custom value)`,size:"small",type:s.format==="DateOnly"?"date":"datetime-local",value:typeof a=="string"?a.slice(0,16):"",onChange:(c,p)=>i(p.value),style:{fontFamily:n.fontFamilyMonospace,fontSize:12}});default:return e.jsx(ae,{"aria-label":`${s.displayName} (custom value)`,size:"small",value:a??t,onChange:(c,p)=>i(p.value)})}}const de=["account","contact","lead","incident"],Le="account, contact, lead, and incident",Yt=s=>de.includes(s),Zt=()=>({table:"",targetId:null,subordinateId:null,fieldChoices:{},customValues:{},performParentingChecks:!0,suppressDuplicateDetection:!1,bypass:Et(),headers:zt(),dirty:new Set,targetSnapshot:null,subordinateSnapshot:null}),z=$t;function nr({themeMode:s}){const a=ut("merge"),i=pt("merge",ye,Zt),[t,d]=b.useState(i.state),{table:c}=gt(t.table||null),{entities:p}=Ne(),[o,u]=b.useState("target"),[h,S]=b.useState("builder"),[k,D]=b.useState(null),[T,L]=b.useState(!1),[F,m]=b.useState([]),[y,x]=b.useState(i.lastSavedId),[v,w]=b.useState(i.lastSavedHash),[V,I]=b.useState(!1),[N,X]=b.useState(!1),j=M(t.table),Y=b.useMemo(()=>{const r=t.subordinateSnapshot;if(!j||!r)return[];const g=new Set;for(const[l,f]of Object.entries(t.fieldChoices)){if(f!=="subordinate")continue;const A=j.columns.find(Qe=>Qe.logicalName===l),O=A&&bt(r,A)?.targetEntity;O&&g.add(O)}return[...g].sort()},[j,t.subordinateSnapshot,t.fieldChoices]),Re=Y.join("|"),[Be,Ae]=b.useState([]);b.useEffect(()=>{for(const r of Y)M(r)||ht.getTable(r).catch(()=>{}).then(g=>{g||Ae(l=>l.includes(r)?l:[...l,r])})},[Re]);const W=Y.filter(r=>!M(r)),ue=W.filter(r=>Be.includes(r)),U=b.useMemo(()=>ft(t),[t,c]),Oe=W.join("|"),ze=b.useMemo(()=>mt(t),[t,c,Oe]);b.useEffect(()=>{let r=!1;if(!t.table||!t.targetId||!j||!z(t.targetId)){d(l=>({...l,targetSnapshot:null}));return}if(typeof window>"u"||!window.dataverseAPI?.queryData)return;I(!0);const g=`/${j.entitySetName}(${t.targetId})`;return window.dataverseAPI.queryData(g).then(l=>{if(r)return;const f=l?.value,A=Array.isArray(f)?f[0]??null:f&&typeof f=="object"?f:l&&typeof l=="object"&&j.primaryKey in l?l:null;d(O=>({...O,targetSnapshot:A})),I(!1)}).catch(()=>{r||(d(l=>({...l,targetSnapshot:null})),I(!1))}),()=>{r=!0}},[t.table,t.targetId,j]),b.useEffect(()=>{let r=!1;if(!t.table||!t.subordinateId||!j||!z(t.subordinateId)){d(l=>({...l,subordinateSnapshot:null}));return}if(typeof window>"u"||!window.dataverseAPI?.queryData)return;X(!0);const g=`/${j.entitySetName}(${t.subordinateId})`;return window.dataverseAPI.queryData(g).then(l=>{if(r)return;const f=l?.value,A=Array.isArray(f)?f[0]??null:f&&typeof f=="object"?f:l&&typeof l=="object"&&j.primaryKey in l?l:null;d(O=>({...O,subordinateSnapshot:A})),X(!1)}).catch(()=>{r||(d(l=>({...l,subordinateSnapshot:null})),X(!1))}),()=>{r=!0}},[t.table,t.subordinateId,j]);const pe=r=>d(g=>{const l=new Set(g.dirty);return l.add(r),{...g,dirty:l}}),R=(r,g,l)=>{d(f=>({...f,[r]:g})),l&&pe(l)},Ee=(r,g)=>{d(l=>{const f={...l.fieldChoices};return g==="target"?delete f[r]:f[r]=g,{...l,fieldChoices:f,dirty:new Set(l.dirty).add("fielddiff")}})},$e=(r,g)=>{d(l=>({...l,customValues:{...l.customValues,[r]:g},dirty:new Set(l.dirty).add("fielddiff")}))},Z=t.targetSnapshot,ee=t.subordinateSnapshot,H=Object.values(t.fieldChoices).filter(r=>r!=="target").length,Ve=j?Yt(j.logicalName)?t.targetId?z(t.targetId)?t.subordinateId?z(t.subordinateId)?t.targetId===t.subordinateId?"Target and Subordinate must be different records.":t.headers.some(r=>r.enabled&&!r.name)?"Fix empty header name.":ue.length>0?`Couldn't load metadata for ${ue.join(", ")}, so a lookup kept from the Subordinate can’t be bound. Pick Target or Custom for it instead.`:W.length>0?`Loading metadata for ${W.join(", ")} to bind the lookups kept from the Subordinate…`:null:"Subordinate record id is not a valid GUID.":"Pick a Subordinate record (the loser).":"Target record id is not a valid GUID.":"Pick a Target record (the winner).":`Merge is only supported for ${Le}.`:"Pick a target table first.",Ue=async()=>{L(!0);const r=await Gt.merge(t,je(ge,null));D(r),L(!1),S("results"),m(g=>[{id:`r-${Date.now()}`,snapshot:B,modeId:"merge",url:U.relativeUrl,method:"POST",ts:Date.now(),status:r.status,ms:r.ms,rowCount:r.ok?1:0},...g].slice(0,8)),d(g=>({...g,dirty:new Set}))},ge=b.useMemo(()=>{let r=[...t.headers];return t.suppressDuplicateDetection&&r.push({id:"__sup-dupe",name:"MSCRM.SuppressDuplicateDetection",value:"true",enabled:!0,builtin:!0,hint:"Skips duplicate detection rules when applying UpdateContent overrides."}),r=yt(r,t.bypass),r},[t.headers,t.suppressDuplicateDetection,t.bypass]),be=b.useMemo(()=>{const r=[...xt(t.bypass,"bypass"),...jt({op:"merge",bypass:t.bypass})];return t.targetId&&!z(t.targetId)&&r.push({id:"merge-bad-target-guid",severity:"error",source:"validation",focusNode:"target",title:"Invalid Target record id",body:`"${t.targetId}" isn't a valid GUID. The merge will fail at the wire.`}),t.subordinateId&&!z(t.subordinateId)&&r.push({id:"merge-bad-sub-guid",severity:"error",source:"validation",focusNode:"subordinate",title:"Invalid Subordinate record id",body:`"${t.subordinateId}" isn't a valid GUID. The merge will fail at the wire.`}),r},[t.bypass,t.targetId,t.subordinateId]),He=St(be),B=b.useMemo(()=>vt(t),[t]);kt("merge",B,y,v);const Ge=b.useMemo(()=>re(B),[B]),he=v===null?!0:Ge!==v,_e=r=>{x(r.id),w(re(r.state))},fe=r=>{if(r.modeId!=="merge")return;const g=r.state;if(p.length>0&&!p.some(l=>l.logicalName===g.table)){Vt(`Can't load "${r.name}": entity \`${g.table}\` isn't available in this environment. The solution may have been removed or you may be connected to a different org.`);return}d(ye(g)),x(r.id),w(re(g)),D(null),u("target")},We=r=>{const g=_t(r,"merge");if(!g)return;const l=y,f=v;fe(g),x(l),w(f)};Tt(b.useMemo(()=>t.table?{state:B,modeId:"merge",dirty:he,lastSavedId:y,onSaved:_e,onLoadSaved:fe}:null,[B,he,y,t.table]));const qe=[{id:"target",label:"Target",meta:j?.displayName??"Pick a table",items:[{id:"target",icon:wt,iconFilled:De,label:"Master (survives)",badge:t.targetId?"✓":null,badgeAppearance:"ghost",dirty:t.dirty.has("target")||t.dirty.has("entity")}]},{id:"subordinate-section",label:"Subordinate",meta:t.subordinateId?"will be deactivated":"pick a record",items:[{id:"subordinate",icon:xe,iconFilled:J,label:"Subordinate record",badge:t.subordinateId?"✓":null,badgeAppearance:"ghost",dirty:t.dirty.has("subordinate")}]},{id:"override",label:"Override fields",meta:`${H} override${H===1?"":"s"}`,items:[{id:"fielddiff",icon:xe,iconFilled:J,label:"Field comparison",badge:H||null,badgeAppearance:"tint",badgeColor:H>0?"brand":"subtle",dirty:t.dirty.has("fielddiff")}]},{id:"settings",label:"Settings",meta:(t.performParentingChecks?1:0)+(t.suppressDuplicateDetection?1:0)==0?"defaults":`${(t.performParentingChecks?1:0)+(t.suppressDuplicateDetection?1:0)} set`,items:[{id:"options",icon:Ft,iconFilled:Ie,label:"Merge options",badge:(t.performParentingChecks?1:0)+(t.suppressDuplicateDetection?1:0)||null,badgeAppearance:"ghost",dirty:t.dirty.has("options")}]},{id:"headers",label:"Headers",meta:`${t.headers.filter(r=>r.enabled).length} active`,items:[{id:"headers",icon:Dt,iconFilled:Nt,label:"HTTP headers",badge:t.headers.filter(r=>r.enabled).length||null,dirty:t.dirty.has("headers")},{id:"bypass",icon:le,iconFilled:le,label:"Bypass logic",badge:It(t.bypass),badgeAppearance:t.bypass.businessLogic!=="none"||t.bypass.suppressFlows?"tint":"ghost",badgeColor:t.bypass.businessLogic!=="none"||t.bypass.suppressFlows?"warning":"subtle",dirty:t.dirty.has("bypass")}]}];let C;switch(o){case"target":C=e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[e.jsx(rr,{state:t,setState:d,markDirty:pe,onEntityChange:()=>{x(void 0),w(null)}}),e.jsx(ke,{title:"Master record",sub:"The record that keeps its identity. Subordinate is merged into it.",table:t.table,selectedId:t.targetId,onPick:r=>R("targetId",r,"target")})]});break;case"subordinate":C=e.jsx(ke,{title:"Subordinate (deactivated)",sub:"The duplicate to merge away. Its relationships re-parent to the Target; the row gets statecode=Inactive.",table:t.table,selectedId:t.subordinateId,onPick:r=>R("subordinateId",r,"subordinate"),conflictWith:t.targetId});break;case"fielddiff":C=e.jsxs("div",{children:[e.jsx(er,{overrideCount:H,subordinateName:G(j,ee??void 0)}),e.jsx(tr,{table:t.table,target:Z??void 0,subordinate:ee??void 0,targetLoading:V,subordinateLoading:N}),e.jsx(Jt,{table:t.table,target:t.targetSnapshot??null,sub:t.subordinateSnapshot??null,fieldChoices:t.fieldChoices,customValues:t.customValues,setFieldChoice:Ee,setCustomValue:$e})]});break;case"options":C=e.jsx(ar,{performParentingChecks:t.performParentingChecks,setPerformParentingChecks:r=>R("performParentingChecks",r,"options"),suppressDuplicateDetection:t.suppressDuplicateDetection,setSuppressDuplicateDetection:r=>R("suppressDuplicateDetection",r,"options")});break;case"headers":C=e.jsx(Mt,{items:t.headers,setItems:r=>R("headers",r,"headers"),group:"write"});break;case"bypass":C=e.jsx(Ct,{value:t.bypass,onChange:r=>R("bypass",r,"bypass"),group:"write"});break}const Ke=je(ge,null),Je={method:"POST",built:U,headers:Ke,body:ze,entityLogical:U.entityLogical};return e.jsx(Pt,{sidebar:e.jsx(Ot,{type:a,urlPreview:U.relativeNoBase,sections:qe,activeNode:o,onSelect:r=>{u(r),S("builder")},recents:F,onRecentClick:We}),urlBar:e.jsx(At,{method:"POST",url:U.relativeUrl,executeVerb:a.executeVerb,disabledReason:Ve??He,loading:T,onExecute:Ue,advisories:be,onAdvisoryFocus:u}),children:e.jsxs(Lt,{tab:h,onTabChange:S,resultCount:k?.ok?1:null,children:[h==="builder"&&C,h==="code"&&e.jsx(Rt,{themeMode:s,inputs:Je}),h==="results"&&e.jsx(Bt,{result:k,mode:"single",table:t.table,writeContext:{operation:"merge",table:t.table,recordId:t.targetId,recordName:G(j,Z??void 0),targetName:G(j,Z??void 0),subordinateName:G(j,ee??void 0)}})]})})}function er({overrideCount:s,subordinateName:a}){return e.jsx(E,{layout:"multiline",intent:"warning",icon:e.jsx(le,{}),style:{marginBottom:14},children:e.jsxs($,{children:[e.jsx(Ce,{children:"Merge is irreversible."}),a?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:a})," will be deactivated,"," "]}):"The subordinate will be deactivated, ","its related records re-parent to the Target, and ",e.jsx("strong",{children:s})," field",s===1?"":"s"," on the Target will be overwritten by your overrides. The server also auto-fills any empty Target fields from the Subordinate."]})})}function tr({table:s,target:a,subordinate:i,targetLoading:t,subordinateLoading:d}){const c=we(),p=M(s);return p?e.jsxs("div",{className:c.inlineCard,style:{padding:14,marginBottom:14,display:"grid",gridTemplateColumns:"1fr 44px 1fr",gap:10,alignItems:"stretch"},children:[e.jsx(ve,{tone:"target",chip:"TARGET",chipDescription:"survives the merge",row:a,tbl:p,emptyHint:t?"Loading Target record…":"Pick a Target record."}),e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",color:n.colorNeutralForeground3},children:e.jsx(Fe,{style:{width:28,height:28}})}),e.jsx(ve,{tone:"sub",chip:"SUBORDINATE",chipDescription:"will be deactivated",row:i,tbl:p,emptyHint:d?"Loading Subordinate record…":"Pick a Subordinate record."})]}):null}function ve({tone:s,chip:a,chipDescription:i,row:t,tbl:d,emptyHint:c}){const p=s==="target"?{border:`1px solid ${n.colorPaletteGreenBorderActive}`,background:n.colorPaletteGreenBackground1}:{border:`1px solid ${n.colorPaletteDarkOrangeBorderActive}`,background:n.colorPaletteDarkOrangeBackground1},o=s==="target"?n.colorPaletteGreenForeground1:n.colorPaletteDarkOrangeForeground1,u=G(d,t),h=t?String(t[d.primaryKey]??""):null,S=t?.createdon?String(t.createdon):null,k=S?new Date(S).toLocaleDateString(void 0,{year:"numeric",month:"short"}):null;return e.jsxs("div",{style:{...p,borderRadius:n.borderRadiusMedium,padding:12},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[e.jsx(Q,{appearance:"filled",style:{background:o,color:n.colorNeutralForegroundOnBrand,fontWeight:700,letterSpacing:.4},children:a}),e.jsx(P,{style:{color:n.colorNeutralForeground3},children:i})]}),t?e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:[e.jsx(Wt,{size:"small",name:u??"?",avatar:{color:"colorful"}}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:13,fontWeight:600},children:u??"(no name)"}),e.jsx("div",{style:{fontFamily:n.fontFamilyMonospace,fontSize:10,color:n.colorNeutralForeground3},children:h??""})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2,fontSize:11,color:n.colorNeutralForeground3},children:[k&&e.jsxs("div",{children:["Created:"," ",e.jsx("strong",{style:{color:n.colorNeutralForeground2},children:k})]}),t.accountnumber!=null&&e.jsxs("div",{children:["Account #:"," ",e.jsx("strong",{style:{color:n.colorNeutralForeground2,fontFamily:n.fontFamilyMonospace},children:String(t.accountnumber)})]}),t.revenue!=null&&e.jsxs("div",{children:["Revenue:"," ",e.jsx("strong",{style:{color:n.colorNeutralForeground2},children:Number(t.revenue).toLocaleString(void 0,{style:"currency",currency:"USD",maximumFractionDigits:0})})]}),t.emailaddress1!=null&&e.jsxs("div",{children:["Email:"," ",e.jsx("strong",{style:{color:n.colorNeutralForeground2},children:String(t.emailaddress1)})]})]})]}):e.jsx("div",{style:{padding:"20px 4px",color:n.colorNeutralForeground3,fontSize:12,fontStyle:"italic",textAlign:"center"},children:c})]})}function rr({state:s,setState:a,markDirty:i,onEntityChange:t}){const d=M(s.table),{allEntities:c,allLoading:p}=Ne(),o=b.useMemo(()=>de.map(u=>c.find(h=>h.logicalName===u)).filter(u=>!!u),[c]);return e.jsxs("div",{children:[e.jsx(_,{icon:Ht,title:"Merge entity type",sub:`Pick the table to merge. The Merge action is restricted to ${Le}.`,group:"write"}),e.jsxs("div",{style:{maxWidth:560},children:[e.jsx(Me,{label:"Entity",hint:p?"Loading tables…":o.length===0?`No Merge-supported table (${de.join(", ")}) was found in this environment.`:void 0,children:e.jsx(ie,{value:d?.displayName??"",selectedOptions:[s.table],onOptionSelect:(u,h)=>{h.optionValue&&(a(S=>({...S,table:h.optionValue,targetId:null,subordinateId:null,fieldChoices:{},customValues:{},targetSnapshot:null,subordinateSnapshot:null})),i("entity"),i("target"),i("subordinate"),i("fielddiff"),t())},children:o.map(u=>e.jsx(ne,{value:u.logicalName,text:u.displayName,children:e.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.jsx("span",{children:u.displayName}),e.jsxs(P,{style:{color:n.colorNeutralForeground3},children:[u.entitySetName," · supports Merge"]})]})},u.logicalName))})}),e.jsx(E,{layout:"multiline",intent:"info",style:{marginTop:14},children:e.jsxs($,{children:["Merge requires both records be the ",e.jsx("strong",{children:"same entity type"}),"."," ",e.jsx("code",{children:"incident"})," behaves differently — per docs, the ",e.jsx("code",{children:"UpdateContent"})," ","parameter is ",e.jsx("strong",{children:"ignored"})," for incident, and the merge runs in the user's security context (not system)."]})})]})]})}function ke({title:s,sub:a,table:i,selectedId:t,onPick:d,conflictWith:c}){const p=M(i),o=c&&t&&c===t;return e.jsxs("div",{children:[e.jsx(_,{icon:De,title:s,sub:a,group:"write"}),e.jsxs("div",{style:{maxWidth:480},children:[e.jsx(Me,{label:"Record",children:e.jsx(Ut,{table:i,selectedId:t,onPick:u=>d(u?.id??null),placeholder:`Search ${p?.displayName??""} records…`})}),o&&e.jsx(E,{layout:"multiline",intent:"error",style:{marginTop:14},children:e.jsx($,{children:"Target and Subordinate must be different records."})}),!t&&e.jsx(P,{style:{display:"block",marginTop:8,color:n.colorNeutralForeground3},children:"Tip: use the search box to filter by primary name (e.g. account name, contact full name)."})]})]})}function ar({performParentingChecks:s,setPerformParentingChecks:a,suppressDuplicateDetection:i,setSuppressDuplicateDetection:t}){return e.jsxs("div",{children:[e.jsx(_,{icon:Ie,title:"Merge options",sub:"Controls applied during the merge operation.",group:"write"}),e.jsxs("div",{style:{maxWidth:720,display:"flex",flexDirection:"column",gap:16},children:[e.jsx("div",{style:{padding:12,border:`1px solid ${n.colorNeutralStroke2}`,borderRadius:n.borderRadiusMedium},children:e.jsx(oe,{checked:s,onChange:(d,c)=>a(c.checked),label:e.jsxs("span",{children:[e.jsx("strong",{children:"PerformParentingChecks"}),e.jsx(P,{style:{display:"block",color:n.colorNeutralForeground3,marginTop:2},children:"When enabled, the merge fails if the Target and Subordinate have different parent records. Useful for child entities (e.g. contacts under different accounts)."})]})})}),e.jsx("div",{style:{padding:12,border:`1px solid ${n.colorNeutralStroke2}`,borderRadius:n.borderRadiusMedium},children:e.jsx(oe,{checked:i,onChange:(d,c)=>t(c.checked),label:e.jsxs("span",{children:[e.jsx("strong",{children:"MSCRM.SuppressDuplicateDetection"})," ",e.jsx("code",{style:{fontFamily:n.fontFamilyMonospace,fontSize:11},children:"= true"}),e.jsxs(P,{style:{display:"block",color:n.colorNeutralForeground3,marginTop:2},children:["Skip duplicate detection rules when applying ",e.jsx("code",{children:"UpdateContent"})," to the Target. Adds the ",e.jsx("code",{children:"MSCRM.SuppressDuplicateDetection: true"})," request header."]})]})})}),e.jsx(E,{layout:"multiline",intent:"warning",children:e.jsxs($,{children:[e.jsx(Ce,{children:"Merge is destructive."}),"The Subordinate is deactivated (",e.jsx("code",{children:"statecode=Inactive"}),") and most of its relationships re-parent to the Target. Some Target fields take Subordinate's value only when the Target's value is empty. Use ",e.jsx("strong",{children:"UpdateContent"})," (the Field comparison pane) to override that."]})})]})]})}function G(s,a){if(!s||!a)return null;const i=a[s.primaryName];return i!=null?String(i):null}export{nr as MergeMode};
@@ -1 +1 @@
1
- import{aV as Re,aW as Be,aX as Le,aY as De,aZ as Ee,a_ as Qe,a$ as J,b0 as He,r as c,b1 as Oe,u as K,t,a5 as X,b2 as Ae,b3 as A,Z as f,Y as p,a3 as be,b4 as Xe,f as ge,c as Ge,b5 as We,b6 as _e,b7 as ie,e as Ve,b8 as Ue,b9 as Ye,ba as Ze,i as Y,k as Je,bb as Ke,bc as et,F as oe,n as tt,bd as at,be as rt,aK as nt,aL as st,L as lt,q as it,aM as de,H as ot,aN as dt,bf as ct,a9 as ut,B as ce,D as ue,J as pe,bg as pt,w as mt,bh as yt,bi as me,bj as ht,bk as Z,bl as C,aD as ft,y as bt,z as gt,A as xt,G as vt,R as jt,U as St,S as kt,aR as wt,aS as Nt,bm as Tt,aT as qt,aU as Ft,bn as Pt}from"./index-DGsVifiB.js";const Ct=(n,r)=>{const u=Re("group-label"),{label:o}=n;return{components:{root:"div",label:"span"},root:Le(De("div",{ref:r,role:"group","aria-labelledby":o?u:void 0,...n}),{elementType:"div"}),label:Be(o,{defaultProps:{id:u,role:"presentation"},elementType:"span"})}},$t=n=>Ee(n.root,{children:[n.label&&Qe(n.label,{children:n.label.children}),n.root.children]}),ye={root:"fui-OptionGroup",label:"fui-OptionGroup__label"},zt=He({root:{mc9l5x:"f22iagw",Beiy3e4:"f1vx9l62",Belr9w4:"fiut8dr",B8lkq7l:"f1xxzjds",eii1in:0,H93o2g:0,Gwp8xu:0,Bd39igo:"f16cmn8k",om0q45:"f5642y",Hl9o3s:"ffdf81h",sl1c2c:0,z4hxbw:0,B0i58d9:0,Bi9x0x4:0,Bgurq3m:"f1bsn9kn"},label:{Beyfa6y:0,Bbmb7ep:0,Btl43ni:0,B7oj6ja:0,Dimara:"ft85np5",sj55zd:"f11d4kpn",mc9l5x:"ftgm304",Be2twd7:"fy9rknc",Bhrd7zp:"fl43uef",Bg96gwp:"fwrc4pm",Byoj8tv:0,uwmqm3:0,z189sj:0,z8tnut:0,B0ocmuz:"f1mpq0zz"}},{d:[".f22iagw{display:flex;}",".f1vx9l62{flex-direction:column;}",".fiut8dr{row-gap:var(--spacingHorizontalXXS);}",'.f1xxzjds:not(:last-child)::after{content:"";}',[".f16cmn8k:not(:last-child)::after{border-bottom:var(--strokeWidthThin) solid var(--colorNeutralStroke2);}",{p:-1}],".f5642y:not(:last-child)::after{display:block;}",".ffdf81h:not(:last-child)::after{padding-bottom:var(--spacingHorizontalXS);}",[".f1bsn9kn:not(:last-child)::after{margin:0 calc(var(--spacingHorizontalXS) * -1) var(--spacingVerticalXS);}",{p:-1}],[".ft85np5{border-radius:var(--borderRadiusMedium);}",{p:-1}],".f11d4kpn{color:var(--colorNeutralForeground3);}",".ftgm304{display:block;}",".fy9rknc{font-size:var(--fontSizeBase200);}",".fl43uef{font-weight:var(--fontWeightSemibold);}",".fwrc4pm{line-height:var(--lineHeightBase200);}",[".f1mpq0zz{padding:var(--spacingHorizontalS) var(--spacingHorizontalSNudge);}",{p:-1}]]}),It=n=>{"use no memo";const r=zt();return n.root.className=J(ye.root,r.root,n.root.className),n.label&&(n.label.className=J(ye.label,r.label,n.label.className)),n},ee=c.forwardRef((n,r)=>{const u=Ct(n,r);return It(u),Oe("useOptionGroupStyles_unstable")(u),$t(u)});ee.displayName="OptionGroup";function Mt(n){const r=new Set,u=[];for(const o of n.navigationProperties){if(o.cardinality==="OneToMany")continue;const a=`${o.relationshipName}|${o.targetEntity}`;r.has(a)||(r.add(a),u.push({relationshipName:o.relationshipName,sourceTable:o.targetEntity,via:o.referencingAttribute??o.name,manyToMany:o.cardinality==="ManyToMany"}))}return u.sort((o,a)=>o.sourceTable.localeCompare(a.sourceTable)||o.relationshipName.localeCompare(a.relationshipName))}function Rt(n,r,u){return n.navigationProperties.find(a=>a.relationshipName===r&&a.cardinality!=="ManyToOne"&&a.targetEntity===u)?.name??null}function Bt({table:n,value:r,onChange:u}){const o=c.useMemo(()=>Mt(n),[n]),{table:a,loading:y}=K(r.sourceTable||null);c.useEffect(()=>{if(!a||!r.relationshipName)return;const l=Rt(a,r.relationshipName,n.logicalName)??"";l!==r.navProperty&&u({...r,navProperty:l})},[a,r.relationshipName,n.logicalName]);const h=l=>`${l.relationshipName}|${l.sourceTable}`,g=o.find(l=>l.relationshipName===r.relationshipName&&l.sourceTable===r.sourceTable),x=l=>`${ge(l.sourceTable)?.displayName??l.sourceTable} · ${l.relationshipName}`;return t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[t.jsx(X,{label:"Relationship",hint:o.length?`Rows of ${n.displayName} related to one row of another table.`:void 0,validationState:o.length?"none":"warning",validationMessage:o.length?void 0:`${n.displayName} has no lookups or many-to-many relationships.`,children:t.jsx(Ae,{placeholder:"Pick a relationship…",value:g?x(g):"",selectedOptions:g?[h(g)]:[],onOptionSelect:(l,N)=>{const v=o.find($=>h($)===N.optionValue);v&&u({sourceTable:v.sourceTable,relationshipName:v.relationshipName,navProperty:"",recordId:v.sourceTable===r.sourceTable?r.recordId:null,recordName:v.sourceTable===r.sourceTable?r.recordName:void 0})},listbox:{style:{maxHeight:360}},children:o.map(l=>t.jsx(A,{value:h(l),text:x(l),children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",minWidth:0},children:[t.jsx("span",{children:x(l)}),t.jsx(f,{style:{color:p.colorNeutralForeground3,fontFamily:p.fontFamilyMonospace},children:l.manyToMany?`many-to-many · ${l.via}`:`via ${l.via}`})]})},h(l)))})}),r.sourceTable&&y&&!a&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[t.jsx(be,{size:"tiny"}),t.jsxs(f,{children:["Loading ",r.sourceTable," metadata…"]})]}),a&&r.relationshipName&&!r.navProperty&&t.jsxs(f,{style:{color:p.colorPaletteRedForeground1},children:[a.displayName," has no collection navigation property for ",r.relationshipName,"."]}),a&&r.navProperty&&t.jsx(X,{label:`${a.displayName} row`,hint:t.jsxs("span",{children:["Collection: ",t.jsx("code",{children:`${a.entitySetName}(…)/${r.navProperty}`})]}),children:t.jsx(Xe,{table:a.logicalName,selectedId:r.recordId,onPick:l=>u({...r,recordId:l?.id??null,recordName:l?.primary})})})]})}const Lt=()=>({table:"",queryId:null,queryType:"savedQuery",top:50,prefer:{...Nt(),formattedValues:!0},headers:wt(),dirty:new Set}),he={sourceTable:"",relationshipName:"",navProperty:"",recordId:null};function fe(n){if(!n)return[];const r=[...n.matchAll(/<cell\s+([^>]+?)\s*\/?>/g)],u=[];for(const o of r){const a=o[1],y=/name="([^"]+)"/.exec(a);if(!y)continue;const h=y[1],g=/width="([^"]+)"/.exec(a),x=g&&parseInt(g[1],10)||100,l=h.indexOf(".");l>=0?u.push({fullName:h,width:x,isLink:!0,linkAlias:h.slice(0,l),attr:h.slice(l+1)}):u.push({fullName:h,width:x,isLink:!1,attr:h})}return u}function Dt(n){switch(n){case 0:return"Main view";case 1:return"Advanced Find";case 2:return"Subgrid";case 4:return"Quick Find";case 8:return"Reserved";case 16:return"Lookup";case 32:return"Marketing list";case 64:return"Address book";case 128:return"Main (no subj)";case 256:return"Outlook filter";case 512:return"Reserved";case 1024:return"Offline filter";case 2048:return"Outlook template";case 4096:return"Reserved";case 8192:return"Svc mgmt app";default:return`Type ${n}`}}function Qt({themeMode:n}){const r=Ge("predefined-query"),u=We(),o=_e("predefined-query",ie,Lt),[a,y]=c.useState(o.state),{table:h}=K(a.table||null),{entities:g}=Ve(),[x,l]=c.useState("target"),[N,v]=c.useState("builder"),[$,te]=c.useState(null),[xe,ae]=c.useState(!1),[ve,je]=c.useState([]),[z,I]=c.useState(o.lastSavedId),[M,R]=c.useState(o.lastSavedHash),[T,B]=c.useState([]),[G,W]=c.useState(!1),[re,_]=c.useState(null),[k,L]=c.useState(""),{table:Se}=K(a.related?.sourceTable||null),D=c.useMemo(()=>Ue(a),[a,h,Se]),V=ge(a.table),d=T.find(e=>e.id===a.queryId)??null,E=T.filter(e=>e.kind==="savedQuery"),Q=T.filter(e=>e.kind==="userQuery"),H=c.useMemo(()=>{const e=k.trim().toLowerCase();return e?E.filter(i=>i.name.toLowerCase().includes(e)):E},[E,k]),O=c.useMemo(()=>{const e=k.trim().toLowerCase();return e?Q.filter(i=>i.name.toLowerCase().includes(e)):Q},[Q,k]);c.useEffect(()=>{L(d?.name??"")},[d?.name,a.table]),c.useEffect(()=>{let e=!1;if(!a.table){B([]),_(null);return}if(typeof window>"u"||!window.dataverseAPI?.queryData){B([]);return}W(!0),_(null);const i="savedqueryid,name,description,fetchxml,layoutxml,returnedtypecode,querytype,isdefault,isquickfindquery,iscustomizable,ismanaged",m="userqueryid,name,description,fetchxml,layoutxml,returnedtypecode,querytype",b=`savedqueries?$select=${i}&$filter=returnedtypecode eq '${a.table}' and statecode eq 0&$orderby=name asc`,ze=`userqueries?$select=${m}&$filter=returnedtypecode eq '${a.table}' and statecode eq 0&$orderby=name asc`;return Promise.all([window.dataverseAPI.queryData(b).catch(j=>{throw j instanceof Error?j:new Error(String(j))}),window.dataverseAPI.queryData(ze).catch(()=>({value:[]}))]).then(([j,U])=>{if(e)return;const Ie=j?.value??[],Me=U?.value??[],le=[...Ie.map(s=>{const S=s.layoutxml!=null?String(s.layoutxml):null;return{id:String(s.savedqueryid??""),name:String(s.name??"(unnamed)"),description:s.description!=null?String(s.description):null,fetchXml:s.fetchxml!=null?String(s.fetchxml):null,layoutXml:S,layoutColumns:fe(S),returnedTypeCode:String(s.returnedtypecode??a.table),queryType:typeof s.querytype=="number"?s.querytype:0,isDefault:s.isdefault===!0,isQuickFind:s.isquickfindquery===!0,isCustom:s.iscustomizable?.Value===!0,isManaged:s.ismanaged===!0,kind:"savedQuery"}}),...Me.map(s=>{const S=s.layoutxml!=null?String(s.layoutxml):null;return{id:String(s.userqueryid??""),name:String(s.name??"(unnamed)"),description:s.description!=null?String(s.description):null,fetchXml:s.fetchxml!=null?String(s.fetchxml):null,layoutXml:S,layoutColumns:fe(S),returnedTypeCode:String(s.returnedtypecode??a.table),queryType:typeof s.querytype=="number"?s.querytype:0,isDefault:!1,isQuickFind:!1,isCustom:!0,isManaged:!1,kind:"userQuery"}})];le.sort((s,S)=>s.kind!==S.kind?s.kind==="savedQuery"?-1:1:s.isDefault!==S.isDefault?s.isDefault?-1:1:s.name.localeCompare(S.name)),B(le),W(!1)}).catch(j=>{if(e)return;const U=j instanceof Error?j.message:String(j);_(U),B([]),W(!1)}),()=>{e=!0}},[a.table]);const P=e=>y(i=>{const m=new Set(i.dirty);return m.add(e),{...i,dirty:m}}),w=(e,i,m)=>{y(b=>({...b,[e]:i})),m&&P(m)},ke=e=>{y(i=>({...i,table:e,queryId:null})),P("target"),I(void 0),R(null)},we=async()=>{ae(!0);const e=await qt.predefined(a);te(e),ae(!1),v("results"),je(i=>[{id:`r-${Date.now()}`,snapshot:q,modeId:"predefined-query",url:D.relativeUrl,method:"GET",ts:Date.now(),status:e.status,ms:e.ms,rowCount:Ft(e.body)??0},...i].slice(0,8)),y(i=>({...i,dirty:new Set}))},Ne=a.table?a.queryId?a.related&&!(a.related.navProperty&&a.related.recordId)?"Pick the relationship and the row whose related records to query.":null:"Pick a saved query or user view.":"Pick a table first.",q=c.useMemo(()=>Ye(a),[a]);Ze("predefined-query",q,z,M);const Te=c.useMemo(()=>Y(q),[q]),ne=M===null?!0:Te!==M,qe=e=>{I(e.id),R(Y(e.state))},se=e=>{if(e.modeId!=="predefined-query")return;const i=e.state;if(g.length>0&&!g.some(m=>m.logicalName===i.table)){Tt(`Can't load "${e.name}": entity \`${i.table}\` isn't available in this environment. The solution may have been removed or you may be connected to a different org.`);return}y(ie(i)),I(e.id),R(Y(i)),te(null),l("target")},Fe=e=>{const i=Pt(e,"predefined-query");if(!i)return;const m=z,b=M;se(i),I(m),R(b)};Je(c.useMemo(()=>a.table?{state:q,modeId:"predefined-query",dirty:ne,lastSavedId:z,onSaved:qe,onLoadSaved:se}:null,[q,ne,z,a.table]));const Pe=[{id:"target",label:"Target",meta:V?.displayName,items:[{id:"target",icon:et,iconFilled:Ke,label:d?.name??(a.table?"Pick a query":"Pick a table"),badge:d?.kind==="savedQuery"?"system":d?.kind==="userQuery"?"user":null,badgeAppearance:"ghost",dirty:a.dirty.has("target")}]},{id:"conditions",label:"Conditions",items:[{id:"conditions",icon:tt,iconFilled:oe,label:"Filter (read-only)",badge:d?"inherited":null,badgeAppearance:"ghost"}]},{id:"top",label:"Top",items:[{id:"top",icon:rt,iconFilled:at,label:"$top",code:!0,badge:a.top?a.top.toString():"default",badgeAppearance:"ghost",dirty:a.dirty.has("top")}]},{id:"prefer",label:"Prefer",items:[{id:"prefer",icon:st,iconFilled:nt,label:"Prefer header",badge:de(a.prefer)?"on":null,badgeAppearance:"ghost",dirty:a.dirty.has("prefer")}]},{id:"headers",label:"Headers",meta:`${a.headers.filter(e=>e.enabled).length} active`,items:[{id:"headers",icon:it,iconFilled:lt,label:"HTTP headers",badge:a.headers.filter(e=>e.enabled).length||null,dirty:a.dirty.has("headers")}]}];let F;switch(x){case"target":F=t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[t.jsx(mt,{table:a.table,onTableChange:e=>{ke(e),a.related&&w("related",he)},group:"read",sub:"Pick the table whose saved queries (system views) or user queries (personal views) you want to execute."}),a.table&&t.jsxs("div",{style:{maxWidth:640,display:"flex",flexDirection:"column",gap:14},children:[t.jsx(X,{label:"Run against",hint:a.related?"The query runs over one row’s related records: /<set>(<id>)/<nav>?savedQuery=…":"The query runs over the whole table: /<set>?savedQuery=…",children:t.jsxs(yt,{ariaLabel:"Run the query against",children:[t.jsx(me,{checked:!a.related,onClick:()=>{a.related&&w("related",null,"target")},children:"Table"}),t.jsx(me,{checked:!!a.related,onClick:()=>{a.related||w("related",he,"target")},children:"Related records of a row"})]})}),a.related&&V&&t.jsx(Bt,{table:V,value:a.related,onChange:e=>w("related",e,"target")}),t.jsx(X,{label:"View",hint:T.length>0?`${E.length} system · ${Q.length} personal`:void 0,children:t.jsxs(ht,{freeform:!0,clearable:!0,value:k,selectedOptions:a.queryId?[a.queryId]:[],placeholder:G?"Loading queries…":T.length===0?"No queries on this table":"Search views by name…",disabled:G,onChange:e=>{const i=e.target.value;L(i),i===""&&a.queryId&&(y(m=>({...m,queryId:null})),P("target"))},onOptionSelect:(e,i)=>{if(!i.optionValue){y(b=>({...b,queryId:null})),L(""),P("target");return}const m=T.find(b=>b.id===i.optionValue);m&&(y(b=>({...b,queryId:m.id,queryType:m.kind})),L(m.name),P("target"))},listbox:{style:{maxHeight:420}},children:[H.length===0&&O.length===0&&k.trim()&&t.jsx(A,{value:"__none",text:"",disabled:!0,children:t.jsxs(f,{style:{color:p.colorNeutralForeground3},children:['No views match "',k.trim(),'"']})}),H.length>0&&t.jsx(ee,{label:`System views (${H.length})`,children:H.map(e=>t.jsx(A,{value:e.id,text:e.name,children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0},children:[t.jsx(Z,{style:{fontWeight:e.isDefault?600:400},children:e.name}),e.description&&t.jsx(f,{style:{color:p.colorNeutralForeground3},children:e.description})]})},e.id))}),O.length>0&&t.jsx(ee,{label:`Personal views (${O.length})`,children:O.map(e=>t.jsx(A,{value:e.id,text:e.name,children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0},children:[t.jsx(Z,{children:e.name}),e.description&&t.jsx(f,{style:{color:p.colorNeutralForeground3},children:e.description})]})},e.id))})]})}),G&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:p.colorNeutralForeground3},children:[t.jsx(be,{size:"tiny"}),t.jsx(f,{children:"Fetching saved + user queries…"})]}),re&&t.jsx(ce,{intent:"error",layout:"multiline",children:t.jsxs(ue,{children:[t.jsx(pe,{children:"Couldn't load queries"}),re]})}),d&&t.jsxs("div",{className:J(u.inlineCard),style:{padding:14,display:"flex",flexDirection:"column",gap:10},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[t.jsx(Z,{style:{fontWeight:600},children:d.name}),t.jsx(C,{appearance:"ghost",size:"small",children:Dt(d.queryType)}),d.isDefault&&t.jsx(C,{appearance:"tint",color:"brand",size:"small",children:"default view"}),d.isQuickFind&&t.jsx(C,{appearance:"tint",color:"informative",size:"small",children:"quick find"}),d.kind==="savedQuery"&&d.isManaged&&t.jsx(C,{appearance:"ghost",size:"small",children:"managed"}),d.kind==="savedQuery"&&!d.isManaged&&t.jsx(C,{appearance:"ghost",size:"small",children:"unmanaged"})]}),t.jsxs("div",{children:[t.jsx(f,{style:{fontWeight:600,color:p.colorNeutralForeground2},children:"Query GUID"}),t.jsx("div",{children:t.jsx("code",{style:{fontFamily:p.fontFamilyMonospace,fontSize:11,color:p.colorNeutralForeground2},children:d.id})})]}),d.layoutColumns.length>0&&t.jsxs("div",{children:[t.jsxs(f,{style:{fontWeight:600,color:p.colorNeutralForeground2},children:["Result columns (",d.layoutColumns.length,") — from layoutxml"]}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginTop:4},children:d.layoutColumns.map(e=>t.jsx(ft,{relationship:"label",content:e.isLink?`${e.fullName} — joined column via link alias \`${e.linkAlias}\` · width ${e.width}px`:`${e.fullName} — width ${e.width}px`,children:t.jsx("span",{style:{fontFamily:p.fontFamilyMonospace,fontSize:11,padding:"2px 6px",borderRadius:4,background:e.isLink?p.colorPaletteBlueBackground2:p.colorNeutralBackground3,color:e.isLink?p.colorPaletteBlueForeground2:p.colorNeutralForeground1,cursor:"help"},children:e.isLink?`${e.linkAlias}.${e.attr}`:e.attr})},e.fullName))}),d.layoutColumns.some(e=>e.isLink)&&t.jsx(f,{style:{display:"block",marginTop:6,color:p.colorNeutralForeground3},children:"Blue pills are joined columns (link-entity in FetchXml)."})]})]})]})]});break;case"conditions":F=t.jsxs("div",{children:[t.jsx(ut,{icon:oe,title:"Conditions",sub:"Read-only summary — predefined queries embed their own FetchXml. Edit the saved query in the model-driven app to change conditions."}),t.jsx(ce,{layout:"multiline",intent:"warning",style:{marginBottom:12},children:t.jsxs(ue,{children:[t.jsx(pe,{children:"$select / $filter / $orderby / $expand are locked"}),"With ",t.jsx("code",{children:"?savedQuery=…"})," / ",t.jsx("code",{children:"?userQuery=…"}),", the FetchXml in the query owns column projection, filter, sort and joins. Only ",t.jsx("code",{children:"$top"})," and"," ",t.jsx("code",{children:"Prefer"})," headers remain editable."]})}),d?.fetchXml?t.jsx("div",{style:{border:`1px solid ${p.colorNeutralStroke2}`,borderRadius:p.borderRadiusMedium,overflow:"hidden",height:480},children:t.jsx(pt,{height:"100%",language:"xml",value:d.fetchXml,theme:n==="dark"?"vs-dark":"light",options:{readOnly:!0,domReadOnly:!0,lineNumbers:"on",renderLineHighlight:"line",minimap:{enabled:!1},scrollBeyondLastLine:!1,fontFamily:"Cascadia Mono, Consolas, monospace",fontSize:13,tabSize:2,wordWrap:"on",automaticLayout:!0,padding:{top:12,bottom:12},bracketPairColorization:{enabled:!0},guides:{bracketPairs:!0,indentation:!0},smoothScrolling:!0}})}):d?t.jsx(f,{style:{color:p.colorNeutralForeground3},children:"(No FetchXml available for this query — it may be a layout-only definition.)"}):t.jsx(f,{style:{color:p.colorNeutralForeground3},children:"Pick a query in Target to see its FetchXml."})]});break;case"top":F=t.jsx(ct,{top:a.top,setTop:e=>w("top",e,"top"),maxPageSize:a.prefer.maxpagesize});break;case"prefer":F=t.jsx(dt,{spec:a.prefer,setSpec:e=>w("prefer",e,"prefer"),sendsPageSize:!0});break;case"headers":F=t.jsx(ot,{items:a.headers,setItems:e=>w("headers",e,"headers")});break}const Ce=bt(a.headers,de(a.prefer)),$e={method:"GET",built:D,headers:Ce};return t.jsx(gt,{sidebar:t.jsx(kt,{type:r,urlPreview:D.relativeNoBase,sections:Pe,activeNode:x,onSelect:e=>{l(e),v("builder")},recents:ve,onRecentClick:Fe}),urlBar:t.jsx(St,{method:"GET",url:D.relativeUrl,executeVerb:r.executeVerb,disabledReason:Ne,loading:xe,onExecute:we}),children:t.jsxs(xt,{tab:N,onTabChange:v,resultCount:$?.body?.value?.length??null,children:[N==="builder"&&F,N==="code"&&t.jsx(vt,{themeMode:n,inputs:$e}),N==="results"&&t.jsx(jt,{result:$,mode:"multi",table:a.table,preferredColumnOrder:d?.layoutColumns.map(e=>e.fullName)})]})})}export{Qt as PredefinedQueryMode};
1
+ import{aW as Re,aX as Be,aY as Le,aZ as Ee,a_ as Qe,a$ as De,b0 as J,b1 as He,r as c,b2 as Oe,u as K,t,a5 as X,b3 as Ae,b4 as A,Z as f,Y as p,a3 as be,b5 as Xe,f as ge,c as Ge,b6 as We,b7 as _e,b8 as ie,e as Ve,b9 as Ue,ba as Ye,bb as Ze,i as Y,k as Je,bc as Ke,bd as et,F as oe,n as tt,be as at,bf as rt,aL as nt,aM as st,L as lt,q as it,aN as de,H as ot,aO as dt,bg as ct,a9 as ut,B as ce,D as ue,J as pe,bh as pt,w as mt,bi as yt,bj as me,bk as ht,bl as Z,bm as C,aE as ft,y as bt,z as gt,A as xt,G as vt,R as jt,U as St,S as kt,aS as wt,aT as Nt,bn as Tt,aU as qt,aV as Ft,bo as Pt}from"./index-D0g0tm7R.js";const Ct=(n,r)=>{const u=Re("group-label"),{label:o}=n;return{components:{root:"div",label:"span"},root:Le(Ee("div",{ref:r,role:"group","aria-labelledby":o?u:void 0,...n}),{elementType:"div"}),label:Be(o,{defaultProps:{id:u,role:"presentation"},elementType:"span"})}},$t=n=>Qe(n.root,{children:[n.label&&De(n.label,{children:n.label.children}),n.root.children]}),ye={root:"fui-OptionGroup",label:"fui-OptionGroup__label"},zt=He({root:{mc9l5x:"f22iagw",Beiy3e4:"f1vx9l62",Belr9w4:"fiut8dr",B8lkq7l:"f1xxzjds",eii1in:0,H93o2g:0,Gwp8xu:0,Bd39igo:"f16cmn8k",om0q45:"f5642y",Hl9o3s:"ffdf81h",sl1c2c:0,z4hxbw:0,B0i58d9:0,Bi9x0x4:0,Bgurq3m:"f1bsn9kn"},label:{Beyfa6y:0,Bbmb7ep:0,Btl43ni:0,B7oj6ja:0,Dimara:"ft85np5",sj55zd:"f11d4kpn",mc9l5x:"ftgm304",Be2twd7:"fy9rknc",Bhrd7zp:"fl43uef",Bg96gwp:"fwrc4pm",Byoj8tv:0,uwmqm3:0,z189sj:0,z8tnut:0,B0ocmuz:"f1mpq0zz"}},{d:[".f22iagw{display:flex;}",".f1vx9l62{flex-direction:column;}",".fiut8dr{row-gap:var(--spacingHorizontalXXS);}",'.f1xxzjds:not(:last-child)::after{content:"";}',[".f16cmn8k:not(:last-child)::after{border-bottom:var(--strokeWidthThin) solid var(--colorNeutralStroke2);}",{p:-1}],".f5642y:not(:last-child)::after{display:block;}",".ffdf81h:not(:last-child)::after{padding-bottom:var(--spacingHorizontalXS);}",[".f1bsn9kn:not(:last-child)::after{margin:0 calc(var(--spacingHorizontalXS) * -1) var(--spacingVerticalXS);}",{p:-1}],[".ft85np5{border-radius:var(--borderRadiusMedium);}",{p:-1}],".f11d4kpn{color:var(--colorNeutralForeground3);}",".ftgm304{display:block;}",".fy9rknc{font-size:var(--fontSizeBase200);}",".fl43uef{font-weight:var(--fontWeightSemibold);}",".fwrc4pm{line-height:var(--lineHeightBase200);}",[".f1mpq0zz{padding:var(--spacingHorizontalS) var(--spacingHorizontalSNudge);}",{p:-1}]]}),It=n=>{"use no memo";const r=zt();return n.root.className=J(ye.root,r.root,n.root.className),n.label&&(n.label.className=J(ye.label,r.label,n.label.className)),n},ee=c.forwardRef((n,r)=>{const u=Ct(n,r);return It(u),Oe("useOptionGroupStyles_unstable")(u),$t(u)});ee.displayName="OptionGroup";function Mt(n){const r=new Set,u=[];for(const o of n.navigationProperties){if(o.cardinality==="OneToMany")continue;const a=`${o.relationshipName}|${o.targetEntity}`;r.has(a)||(r.add(a),u.push({relationshipName:o.relationshipName,sourceTable:o.targetEntity,via:o.referencingAttribute??o.name,manyToMany:o.cardinality==="ManyToMany"}))}return u.sort((o,a)=>o.sourceTable.localeCompare(a.sourceTable)||o.relationshipName.localeCompare(a.relationshipName))}function Rt(n,r,u){return n.navigationProperties.find(a=>a.relationshipName===r&&a.cardinality!=="ManyToOne"&&a.targetEntity===u)?.name??null}function Bt({table:n,value:r,onChange:u}){const o=c.useMemo(()=>Mt(n),[n]),{table:a,loading:y}=K(r.sourceTable||null);c.useEffect(()=>{if(!a||!r.relationshipName)return;const l=Rt(a,r.relationshipName,n.logicalName)??"";l!==r.navProperty&&u({...r,navProperty:l})},[a,r.relationshipName,n.logicalName]);const h=l=>`${l.relationshipName}|${l.sourceTable}`,g=o.find(l=>l.relationshipName===r.relationshipName&&l.sourceTable===r.sourceTable),x=l=>`${ge(l.sourceTable)?.displayName??l.sourceTable} · ${l.relationshipName}`;return t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[t.jsx(X,{label:"Relationship",hint:o.length?`Rows of ${n.displayName} related to one row of another table.`:void 0,validationState:o.length?"none":"warning",validationMessage:o.length?void 0:`${n.displayName} has no lookups or many-to-many relationships.`,children:t.jsx(Ae,{placeholder:"Pick a relationship…",value:g?x(g):"",selectedOptions:g?[h(g)]:[],onOptionSelect:(l,N)=>{const v=o.find($=>h($)===N.optionValue);v&&u({sourceTable:v.sourceTable,relationshipName:v.relationshipName,navProperty:"",recordId:v.sourceTable===r.sourceTable?r.recordId:null,recordName:v.sourceTable===r.sourceTable?r.recordName:void 0})},listbox:{style:{maxHeight:360}},children:o.map(l=>t.jsx(A,{value:h(l),text:x(l),children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",minWidth:0},children:[t.jsx("span",{children:x(l)}),t.jsx(f,{style:{color:p.colorNeutralForeground3,fontFamily:p.fontFamilyMonospace},children:l.manyToMany?`many-to-many · ${l.via}`:`via ${l.via}`})]})},h(l)))})}),r.sourceTable&&y&&!a&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[t.jsx(be,{size:"tiny"}),t.jsxs(f,{children:["Loading ",r.sourceTable," metadata…"]})]}),a&&r.relationshipName&&!r.navProperty&&t.jsxs(f,{style:{color:p.colorPaletteRedForeground1},children:[a.displayName," has no collection navigation property for ",r.relationshipName,"."]}),a&&r.navProperty&&t.jsx(X,{label:`${a.displayName} row`,hint:t.jsxs("span",{children:["Collection: ",t.jsx("code",{children:`${a.entitySetName}(…)/${r.navProperty}`})]}),children:t.jsx(Xe,{table:a.logicalName,selectedId:r.recordId,onPick:l=>u({...r,recordId:l?.id??null,recordName:l?.primary})})})]})}const Lt=()=>({table:"",queryId:null,queryType:"savedQuery",top:50,prefer:{...Nt(),formattedValues:!0},headers:wt(),dirty:new Set}),he={sourceTable:"",relationshipName:"",navProperty:"",recordId:null};function fe(n){if(!n)return[];const r=[...n.matchAll(/<cell\s+([^>]+?)\s*\/?>/g)],u=[];for(const o of r){const a=o[1],y=/name="([^"]+)"/.exec(a);if(!y)continue;const h=y[1],g=/width="([^"]+)"/.exec(a),x=g&&parseInt(g[1],10)||100,l=h.indexOf(".");l>=0?u.push({fullName:h,width:x,isLink:!0,linkAlias:h.slice(0,l),attr:h.slice(l+1)}):u.push({fullName:h,width:x,isLink:!1,attr:h})}return u}function Et(n){switch(n){case 0:return"Main view";case 1:return"Advanced Find";case 2:return"Subgrid";case 4:return"Quick Find";case 8:return"Reserved";case 16:return"Lookup";case 32:return"Marketing list";case 64:return"Address book";case 128:return"Main (no subj)";case 256:return"Outlook filter";case 512:return"Reserved";case 1024:return"Offline filter";case 2048:return"Outlook template";case 4096:return"Reserved";case 8192:return"Svc mgmt app";default:return`Type ${n}`}}function Dt({themeMode:n}){const r=Ge("predefined-query"),u=We(),o=_e("predefined-query",ie,Lt),[a,y]=c.useState(o.state),{table:h}=K(a.table||null),{entities:g}=Ve(),[x,l]=c.useState("target"),[N,v]=c.useState("builder"),[$,te]=c.useState(null),[xe,ae]=c.useState(!1),[ve,je]=c.useState([]),[z,I]=c.useState(o.lastSavedId),[M,R]=c.useState(o.lastSavedHash),[T,B]=c.useState([]),[G,W]=c.useState(!1),[re,_]=c.useState(null),[k,L]=c.useState(""),{table:Se}=K(a.related?.sourceTable||null),E=c.useMemo(()=>Ue(a),[a,h,Se]),V=ge(a.table),d=T.find(e=>e.id===a.queryId)??null,Q=T.filter(e=>e.kind==="savedQuery"),D=T.filter(e=>e.kind==="userQuery"),H=c.useMemo(()=>{const e=k.trim().toLowerCase();return e?Q.filter(i=>i.name.toLowerCase().includes(e)):Q},[Q,k]),O=c.useMemo(()=>{const e=k.trim().toLowerCase();return e?D.filter(i=>i.name.toLowerCase().includes(e)):D},[D,k]);c.useEffect(()=>{L(d?.name??"")},[d?.name,a.table]),c.useEffect(()=>{let e=!1;if(!a.table){B([]),_(null);return}if(typeof window>"u"||!window.dataverseAPI?.queryData){B([]);return}W(!0),_(null);const i="savedqueryid,name,description,fetchxml,layoutxml,returnedtypecode,querytype,isdefault,isquickfindquery,iscustomizable,ismanaged",m="userqueryid,name,description,fetchxml,layoutxml,returnedtypecode,querytype",b=`savedqueries?$select=${i}&$filter=returnedtypecode eq '${a.table}' and statecode eq 0&$orderby=name asc`,ze=`userqueries?$select=${m}&$filter=returnedtypecode eq '${a.table}' and statecode eq 0&$orderby=name asc`;return Promise.all([window.dataverseAPI.queryData(b).catch(j=>{throw j instanceof Error?j:new Error(String(j))}),window.dataverseAPI.queryData(ze).catch(()=>({value:[]}))]).then(([j,U])=>{if(e)return;const Ie=j?.value??[],Me=U?.value??[],le=[...Ie.map(s=>{const S=s.layoutxml!=null?String(s.layoutxml):null;return{id:String(s.savedqueryid??""),name:String(s.name??"(unnamed)"),description:s.description!=null?String(s.description):null,fetchXml:s.fetchxml!=null?String(s.fetchxml):null,layoutXml:S,layoutColumns:fe(S),returnedTypeCode:String(s.returnedtypecode??a.table),queryType:typeof s.querytype=="number"?s.querytype:0,isDefault:s.isdefault===!0,isQuickFind:s.isquickfindquery===!0,isCustom:s.iscustomizable?.Value===!0,isManaged:s.ismanaged===!0,kind:"savedQuery"}}),...Me.map(s=>{const S=s.layoutxml!=null?String(s.layoutxml):null;return{id:String(s.userqueryid??""),name:String(s.name??"(unnamed)"),description:s.description!=null?String(s.description):null,fetchXml:s.fetchxml!=null?String(s.fetchxml):null,layoutXml:S,layoutColumns:fe(S),returnedTypeCode:String(s.returnedtypecode??a.table),queryType:typeof s.querytype=="number"?s.querytype:0,isDefault:!1,isQuickFind:!1,isCustom:!0,isManaged:!1,kind:"userQuery"}})];le.sort((s,S)=>s.kind!==S.kind?s.kind==="savedQuery"?-1:1:s.isDefault!==S.isDefault?s.isDefault?-1:1:s.name.localeCompare(S.name)),B(le),W(!1)}).catch(j=>{if(e)return;const U=j instanceof Error?j.message:String(j);_(U),B([]),W(!1)}),()=>{e=!0}},[a.table]);const P=e=>y(i=>{const m=new Set(i.dirty);return m.add(e),{...i,dirty:m}}),w=(e,i,m)=>{y(b=>({...b,[e]:i})),m&&P(m)},ke=e=>{y(i=>({...i,table:e,queryId:null})),P("target"),I(void 0),R(null)},we=async()=>{ae(!0);const e=await qt.predefined(a);te(e),ae(!1),v("results"),je(i=>[{id:`r-${Date.now()}`,snapshot:q,modeId:"predefined-query",url:E.relativeUrl,method:"GET",ts:Date.now(),status:e.status,ms:e.ms,rowCount:Ft(e.body)??0},...i].slice(0,8)),y(i=>({...i,dirty:new Set}))},Ne=a.table?a.queryId?a.related&&!(a.related.navProperty&&a.related.recordId)?"Pick the relationship and the row whose related records to query.":null:"Pick a saved query or user view.":"Pick a table first.",q=c.useMemo(()=>Ye(a),[a]);Ze("predefined-query",q,z,M);const Te=c.useMemo(()=>Y(q),[q]),ne=M===null?!0:Te!==M,qe=e=>{I(e.id),R(Y(e.state))},se=e=>{if(e.modeId!=="predefined-query")return;const i=e.state;if(g.length>0&&!g.some(m=>m.logicalName===i.table)){Tt(`Can't load "${e.name}": entity \`${i.table}\` isn't available in this environment. The solution may have been removed or you may be connected to a different org.`);return}y(ie(i)),I(e.id),R(Y(i)),te(null),l("target")},Fe=e=>{const i=Pt(e,"predefined-query");if(!i)return;const m=z,b=M;se(i),I(m),R(b)};Je(c.useMemo(()=>a.table?{state:q,modeId:"predefined-query",dirty:ne,lastSavedId:z,onSaved:qe,onLoadSaved:se}:null,[q,ne,z,a.table]));const Pe=[{id:"target",label:"Target",meta:V?.displayName,items:[{id:"target",icon:et,iconFilled:Ke,label:d?.name??(a.table?"Pick a query":"Pick a table"),badge:d?.kind==="savedQuery"?"system":d?.kind==="userQuery"?"user":null,badgeAppearance:"ghost",dirty:a.dirty.has("target")}]},{id:"conditions",label:"Conditions",items:[{id:"conditions",icon:tt,iconFilled:oe,label:"Filter (read-only)",badge:d?"inherited":null,badgeAppearance:"ghost"}]},{id:"top",label:"Top",items:[{id:"top",icon:rt,iconFilled:at,label:"$top",code:!0,badge:a.top?a.top.toString():"default",badgeAppearance:"ghost",dirty:a.dirty.has("top")}]},{id:"prefer",label:"Prefer",items:[{id:"prefer",icon:st,iconFilled:nt,label:"Prefer header",badge:de(a.prefer)?"on":null,badgeAppearance:"ghost",dirty:a.dirty.has("prefer")}]},{id:"headers",label:"Headers",meta:`${a.headers.filter(e=>e.enabled).length} active`,items:[{id:"headers",icon:it,iconFilled:lt,label:"HTTP headers",badge:a.headers.filter(e=>e.enabled).length||null,dirty:a.dirty.has("headers")}]}];let F;switch(x){case"target":F=t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[t.jsx(mt,{table:a.table,onTableChange:e=>{ke(e),a.related&&w("related",he)},group:"read",sub:"Pick the table whose saved queries (system views) or user queries (personal views) you want to execute."}),a.table&&t.jsxs("div",{style:{maxWidth:640,display:"flex",flexDirection:"column",gap:14},children:[t.jsx(X,{label:"Run against",hint:a.related?"The query runs over one row’s related records: /<set>(<id>)/<nav>?savedQuery=…":"The query runs over the whole table: /<set>?savedQuery=…",children:t.jsxs(yt,{ariaLabel:"Run the query against",children:[t.jsx(me,{checked:!a.related,onClick:()=>{a.related&&w("related",null,"target")},children:"Table"}),t.jsx(me,{checked:!!a.related,onClick:()=>{a.related||w("related",he,"target")},children:"Related records of a row"})]})}),a.related&&V&&t.jsx(Bt,{table:V,value:a.related,onChange:e=>w("related",e,"target")}),t.jsx(X,{label:"View",hint:T.length>0?`${Q.length} system · ${D.length} personal`:void 0,children:t.jsxs(ht,{freeform:!0,clearable:!0,value:k,selectedOptions:a.queryId?[a.queryId]:[],placeholder:G?"Loading queries…":T.length===0?"No queries on this table":"Search views by name…",disabled:G,onChange:e=>{const i=e.target.value;L(i),i===""&&a.queryId&&(y(m=>({...m,queryId:null})),P("target"))},onOptionSelect:(e,i)=>{if(!i.optionValue){y(b=>({...b,queryId:null})),L(""),P("target");return}const m=T.find(b=>b.id===i.optionValue);m&&(y(b=>({...b,queryId:m.id,queryType:m.kind})),L(m.name),P("target"))},listbox:{style:{maxHeight:420}},children:[H.length===0&&O.length===0&&k.trim()&&t.jsx(A,{value:"__none",text:"",disabled:!0,children:t.jsxs(f,{style:{color:p.colorNeutralForeground3},children:['No views match "',k.trim(),'"']})}),H.length>0&&t.jsx(ee,{label:`System views (${H.length})`,children:H.map(e=>t.jsx(A,{value:e.id,text:e.name,children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0},children:[t.jsx(Z,{style:{fontWeight:e.isDefault?600:400},children:e.name}),e.description&&t.jsx(f,{style:{color:p.colorNeutralForeground3},children:e.description})]})},e.id))}),O.length>0&&t.jsx(ee,{label:`Personal views (${O.length})`,children:O.map(e=>t.jsx(A,{value:e.id,text:e.name,children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0},children:[t.jsx(Z,{children:e.name}),e.description&&t.jsx(f,{style:{color:p.colorNeutralForeground3},children:e.description})]})},e.id))})]})}),G&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:p.colorNeutralForeground3},children:[t.jsx(be,{size:"tiny"}),t.jsx(f,{children:"Fetching saved + user queries…"})]}),re&&t.jsx(ce,{intent:"error",layout:"multiline",children:t.jsxs(ue,{children:[t.jsx(pe,{children:"Couldn't load queries"}),re]})}),d&&t.jsxs("div",{className:J(u.inlineCard),style:{padding:14,display:"flex",flexDirection:"column",gap:10},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[t.jsx(Z,{style:{fontWeight:600},children:d.name}),t.jsx(C,{appearance:"ghost",size:"small",children:Et(d.queryType)}),d.isDefault&&t.jsx(C,{appearance:"tint",color:"brand",size:"small",children:"default view"}),d.isQuickFind&&t.jsx(C,{appearance:"tint",color:"informative",size:"small",children:"quick find"}),d.kind==="savedQuery"&&d.isManaged&&t.jsx(C,{appearance:"ghost",size:"small",children:"managed"}),d.kind==="savedQuery"&&!d.isManaged&&t.jsx(C,{appearance:"ghost",size:"small",children:"unmanaged"})]}),t.jsxs("div",{children:[t.jsx(f,{style:{fontWeight:600,color:p.colorNeutralForeground2},children:"Query GUID"}),t.jsx("div",{children:t.jsx("code",{style:{fontFamily:p.fontFamilyMonospace,fontSize:11,color:p.colorNeutralForeground2},children:d.id})})]}),d.layoutColumns.length>0&&t.jsxs("div",{children:[t.jsxs(f,{style:{fontWeight:600,color:p.colorNeutralForeground2},children:["Result columns (",d.layoutColumns.length,") — from layoutxml"]}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginTop:4},children:d.layoutColumns.map(e=>t.jsx(ft,{relationship:"label",content:e.isLink?`${e.fullName} — joined column via link alias \`${e.linkAlias}\` · width ${e.width}px`:`${e.fullName} — width ${e.width}px`,children:t.jsx("span",{style:{fontFamily:p.fontFamilyMonospace,fontSize:11,padding:"2px 6px",borderRadius:4,background:e.isLink?p.colorPaletteBlueBackground2:p.colorNeutralBackground3,color:e.isLink?p.colorPaletteBlueForeground2:p.colorNeutralForeground1,cursor:"help"},children:e.isLink?`${e.linkAlias}.${e.attr}`:e.attr})},e.fullName))}),d.layoutColumns.some(e=>e.isLink)&&t.jsx(f,{style:{display:"block",marginTop:6,color:p.colorNeutralForeground3},children:"Blue pills are joined columns (link-entity in FetchXml)."})]})]})]})]});break;case"conditions":F=t.jsxs("div",{children:[t.jsx(ut,{icon:oe,title:"Conditions",sub:"Read-only summary — predefined queries embed their own FetchXml. Edit the saved query in the model-driven app to change conditions."}),t.jsx(ce,{layout:"multiline",intent:"warning",style:{marginBottom:12},children:t.jsxs(ue,{children:[t.jsx(pe,{children:"$select / $filter / $orderby / $expand are locked"}),"With ",t.jsx("code",{children:"?savedQuery=…"})," / ",t.jsx("code",{children:"?userQuery=…"}),", the FetchXml in the query owns column projection, filter, sort and joins. Only ",t.jsx("code",{children:"$top"})," and"," ",t.jsx("code",{children:"Prefer"})," headers remain editable."]})}),d?.fetchXml?t.jsx("div",{style:{border:`1px solid ${p.colorNeutralStroke2}`,borderRadius:p.borderRadiusMedium,overflow:"hidden",height:480},children:t.jsx(pt,{height:"100%",language:"xml",value:d.fetchXml,theme:n==="dark"?"vs-dark":"light",options:{readOnly:!0,domReadOnly:!0,lineNumbers:"on",renderLineHighlight:"line",minimap:{enabled:!1},scrollBeyondLastLine:!1,fontFamily:"Cascadia Mono, Consolas, monospace",fontSize:13,tabSize:2,wordWrap:"on",automaticLayout:!0,padding:{top:12,bottom:12},bracketPairColorization:{enabled:!0},guides:{bracketPairs:!0,indentation:!0},smoothScrolling:!0}})}):d?t.jsx(f,{style:{color:p.colorNeutralForeground3},children:"(No FetchXml available for this query — it may be a layout-only definition.)"}):t.jsx(f,{style:{color:p.colorNeutralForeground3},children:"Pick a query in Target to see its FetchXml."})]});break;case"top":F=t.jsx(ct,{top:a.top,setTop:e=>w("top",e,"top"),maxPageSize:a.prefer.maxpagesize});break;case"prefer":F=t.jsx(dt,{spec:a.prefer,setSpec:e=>w("prefer",e,"prefer"),sendsPageSize:!0});break;case"headers":F=t.jsx(ot,{items:a.headers,setItems:e=>w("headers",e,"headers")});break}const Ce=bt(a.headers,de(a.prefer)),$e={method:"GET",built:E,headers:Ce};return t.jsx(gt,{sidebar:t.jsx(kt,{type:r,urlPreview:E.relativeNoBase,sections:Pe,activeNode:x,onSelect:e=>{l(e),v("builder")},recents:ve,onRecentClick:Fe}),urlBar:t.jsx(St,{method:"GET",url:E.relativeUrl,executeVerb:r.executeVerb,disabledReason:Ne,loading:xe,onExecute:we}),children:t.jsxs(xt,{tab:N,onTabChange:v,resultCount:$?.body?.value?.length??null,children:[N==="builder"&&F,N==="code"&&t.jsx(vt,{themeMode:n,inputs:$e}),N==="results"&&t.jsx(jt,{result:$,mode:"multi",table:a.table,preferredColumnOrder:d?.layoutColumns.map(e=>e.fullName)})]})})}export{Dt as PredefinedQueryMode};
@@ -1 +1 @@
1
- import{c as G,aH as I,r as o,aI as O,aJ as R,ay as q,aK as V,aL as W,L as J,q as _,aM as L,t as e,H as K,aN as Q,a9 as X,B as S,D as w,J as T,aD as k,O as j,aO as Y,aP as Z,a5 as ee,ad as te,Y as i,Z as ae,aQ as se,X as re,y as ne,z as oe,A as ie,G as le,R as de,U as ce,S as ue,aR as he,aS as pe,aT as xe,aU as me}from"./index-DGsVifiB.js";const ye=()=>({url:"",prefer:pe(),headers:he(),dirty:new Set});function ge(y,l){const d={ok:!1,url:null,host:"",path:"",entitySet:null,skiptoken:null,params:[],errors:[]};if(!y.trim())return d;let t;try{t=new URL(y)}catch{return{...d,errors:["Not a valid URL — paste the full https://… string."]}}const n=[];t.protocol!=="https:"&&n.push("Must be https:// — Dataverse rejects plain HTTP.");const c=t.pathname.match(/^\/api\/data\/v\d+\.\d+\/([^/?]+)/);c||n.push("Path doesn't look like a Dataverse Web API URL (expected /api/data/v<x>.<x>/<entityset>)."),l&&t.host&&t.host.toLowerCase()!==l.toLowerCase()&&n.push(`URL host (${t.host}) doesn't match the connected environment (${l}). Switch connections or paste a URL from the current org.`);const h=[];t.searchParams.forEach((p,g)=>h.push({key:g,value:p}));const u=t.searchParams.get("$skiptoken");return{ok:n.length===0,url:t,host:t.host,path:t.pathname,entitySet:c?c[1]:null,skiptoken:u,params:h,errors:n}}function fe({themeMode:y}){const l=G("retrieve-nextlink"),d=I(),[t,n]=o.useState(ye),[c,h]=o.useState("url"),[u,p]=o.useState("builder"),[g,P]=o.useState(null),[C,v]=o.useState(!1),[U,F]=o.useState([]),f=o.useMemo(()=>O(t),[t]),r=o.useMemo(()=>ge(t.url,d.host),[t.url,d.host]),N=a=>n(s=>{const m=new Set(s.dirty);return m.add(a),{...s,dirty:m}}),x=(a,s,m)=>{n(A=>({...A,[a]:s})),m&&N(m)},M=o.useMemo(()=>r.errors.map((a,s)=>({id:`nl-err-${s}`,severity:"error",source:"validation",focusNode:"url",title:"Invalid next-link URL",body:a})),[r]),B=async()=>{if(!r.ok)return;v(!0);const a=await xe.nextLink(t);P(a),v(!1),p("results"),F(s=>[{id:`r-${Date.now()}`,modeId:"retrieve-nextlink",url:t.url,method:"GET",ts:Date.now(),status:a.status,ms:a.ms,rowCount:me(a.body)??0},...s].slice(0,8)),n(s=>({...s,dirty:new Set}))},$=t.url.trim()?r.ok?null:r.errors[0]??"URL is not safe to follow.":"Paste an @odata.nextLink URL first.",D=async()=>{try{const a=await navigator.clipboard?.readText();a&&x("url",a.trim(),"url")}catch{}},E=[{id:"url",label:"Target",meta:"Server-issued",items:[{id:"url",icon:q,iconFilled:R,label:"@odata.nextLink",badge:r.entitySet??(t.url?"invalid":"empty"),badgeAppearance:"ghost",badgeColor:r.errors.length?"danger":r.entitySet?"informative":"subtle",dirty:t.dirty.has("url")}]},{id:"prefer",label:"Prefer",items:[{id:"prefer",icon:W,iconFilled:V,label:"Prefer header",badge:L(t.prefer)?"on":null,badgeAppearance:"ghost",dirty:t.dirty.has("prefer")}]},{id:"headers",label:"Headers",meta:`${t.headers.filter(a=>a.enabled).length} active`,items:[{id:"headers",icon:_,iconFilled:J,label:"HTTP headers",badge:t.headers.filter(a=>a.enabled).length||null,dirty:t.dirty.has("headers")}]}];let b;switch(c){case"url":b=e.jsxs("div",{children:[e.jsx(X,{icon:R,title:"Next-link URL",sub:"Paste the @odata.nextLink returned by the previous page. The URL is opaque — clauses are not editable here."}),e.jsx(S,{layout:"multiline",intent:"info",style:{marginBottom:12},children:e.jsxs(w,{children:[e.jsx(T,{children:"Why no clause editor?"}),"The next page must use the ",e.jsx("strong",{children:"same shape"})," as the original query. Dataverse encodes paging state in a ",e.jsx("code",{children:"$skiptoken"})," cookie — editing any other clause invalidates the cursor."]})}),e.jsxs("div",{style:{display:"flex",gap:8,marginBottom:8},children:[e.jsx(k,{content:"Paste from clipboard",relationship:"label",children:e.jsx(j,{icon:e.jsx(Y,{}),appearance:"outline",size:"small",onClick:D,children:"Paste"})}),e.jsx(k,{content:"Clear the URL field",relationship:"label",children:e.jsx(j,{icon:e.jsx(Z,{}),appearance:"subtle",size:"small",disabled:!t.url,onClick:()=>x("url","","url"),children:"Clear"})})]}),e.jsx(ee,{label:"@odata.nextLink",hint:"The full URL including https://. Skiptoken cookies are URL-encoded inside.",children:e.jsx(te,{rows:6,value:t.url,onChange:(a,s)=>x("url",s.value,"url"),placeholder:`https://${d.host}/api/data/v9.2/<entityset>?$select=…&$skiptoken=…`,style:{fontFamily:i.fontFamilyMonospace,fontSize:11}})}),r.errors.map((a,s)=>e.jsx(S,{intent:"error",layout:"multiline",style:{marginTop:12},children:e.jsxs(w,{children:[e.jsx(T,{children:"Can't follow this URL"}),a]})},s)),r.url&&r.ok&&e.jsxs("div",{style:{marginTop:16,padding:12,border:`1px solid ${i.colorNeutralStroke2}`,borderRadius:i.borderRadiusMedium,background:i.colorNeutralBackground1},children:[e.jsx(ae,{style:{display:"block",fontWeight:600,marginBottom:8,color:i.colorNeutralForeground2},children:"Parsed (read-only)"}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"120px 1fr",rowGap:4,columnGap:12,fontFamily:i.fontFamilyMonospace,fontSize:11},children:[e.jsx("span",{style:{color:i.colorNeutralForeground3},children:"host"}),e.jsx("span",{children:r.host}),e.jsx("span",{style:{color:i.colorNeutralForeground3},children:"entityset"}),e.jsx("span",{children:r.entitySet??"—"}),r.params.map((a,s)=>e.jsxs("span",{style:{display:"contents"},children:[e.jsx("span",{style:{color:i.colorBrandForeground1},children:a.key}),e.jsx("span",{style:{wordBreak:"break-all"},children:se(a.value)})]},s))]})]}),r.ok&&e.jsx("div",{style:{marginTop:16},children:e.jsx(k,{content:"Open the parsed URL in a new tab (auth will be required)",relationship:"description",children:e.jsx(j,{icon:e.jsx(re,{}),appearance:"outline",onClick:()=>window.open(t.url,"_blank","noopener"),children:"Open in new tab"})})})]});break;case"prefer":b=e.jsx(Q,{spec:t.prefer,setSpec:a=>x("prefer",a,"prefer"),sendsPageSize:!0});break;case"headers":b=e.jsx(K,{items:t.headers,setItems:a=>x("headers",a,"headers")});break}const z=ne(t.headers,L(t.prefer)),H={method:"GET",built:f,headers:z,isNextLink:!0,rawNextLink:t.url};return e.jsx(oe,{sidebar:e.jsx(ue,{type:l,urlPreview:f.relativeNoBase,sections:E,activeNode:c,onSelect:a=>{h(a),p("builder")},recents:U}),urlBar:e.jsx(ce,{method:"GET",url:f.relativeUrl,executeVerb:l.executeVerb,disabledReason:$,loading:C,onExecute:B,advisories:M,onAdvisoryFocus:a=>h(a)}),children:e.jsxs(ie,{tab:u,onTabChange:p,resultCount:g?.body?.value?.length??null,children:[u==="builder"&&b,u==="code"&&e.jsx(le,{themeMode:y,inputs:H}),u==="results"&&e.jsx(de,{result:g,mode:"next"})]})})}export{fe as RetrieveNextLinkMode};
1
+ import{c as G,aI as I,r as o,aJ as O,aK as R,az as q,aL as V,aM as W,L as J,q as _,aN as L,t as e,H as K,aO as Q,a9 as X,B as S,D as w,J as T,aE as k,O as j,aP as Y,aQ as Z,a5 as ee,ad as te,Y as i,Z as ae,aR as se,X as re,y as ne,z as oe,A as ie,G as le,R as de,U as ce,S as ue,aS as he,aT as pe,aU as xe,aV as me}from"./index-D0g0tm7R.js";const ye=()=>({url:"",prefer:pe(),headers:he(),dirty:new Set});function ge(y,l){const d={ok:!1,url:null,host:"",path:"",entitySet:null,skiptoken:null,params:[],errors:[]};if(!y.trim())return d;let t;try{t=new URL(y)}catch{return{...d,errors:["Not a valid URL — paste the full https://… string."]}}const n=[];t.protocol!=="https:"&&n.push("Must be https:// — Dataverse rejects plain HTTP.");const c=t.pathname.match(/^\/api\/data\/v\d+\.\d+\/([^/?]+)/);c||n.push("Path doesn't look like a Dataverse Web API URL (expected /api/data/v<x>.<x>/<entityset>)."),l&&t.host&&t.host.toLowerCase()!==l.toLowerCase()&&n.push(`URL host (${t.host}) doesn't match the connected environment (${l}). Switch connections or paste a URL from the current org.`);const h=[];t.searchParams.forEach((p,g)=>h.push({key:g,value:p}));const u=t.searchParams.get("$skiptoken");return{ok:n.length===0,url:t,host:t.host,path:t.pathname,entitySet:c?c[1]:null,skiptoken:u,params:h,errors:n}}function fe({themeMode:y}){const l=G("retrieve-nextlink"),d=I(),[t,n]=o.useState(ye),[c,h]=o.useState("url"),[u,p]=o.useState("builder"),[g,P]=o.useState(null),[C,v]=o.useState(!1),[U,F]=o.useState([]),f=o.useMemo(()=>O(t),[t]),r=o.useMemo(()=>ge(t.url,d.host),[t.url,d.host]),N=a=>n(s=>{const m=new Set(s.dirty);return m.add(a),{...s,dirty:m}}),x=(a,s,m)=>{n(A=>({...A,[a]:s})),m&&N(m)},M=o.useMemo(()=>r.errors.map((a,s)=>({id:`nl-err-${s}`,severity:"error",source:"validation",focusNode:"url",title:"Invalid next-link URL",body:a})),[r]),B=async()=>{if(!r.ok)return;v(!0);const a=await xe.nextLink(t);P(a),v(!1),p("results"),F(s=>[{id:`r-${Date.now()}`,modeId:"retrieve-nextlink",url:t.url,method:"GET",ts:Date.now(),status:a.status,ms:a.ms,rowCount:me(a.body)??0},...s].slice(0,8)),n(s=>({...s,dirty:new Set}))},E=t.url.trim()?r.ok?null:r.errors[0]??"URL is not safe to follow.":"Paste an @odata.nextLink URL first.",$=async()=>{try{const a=await navigator.clipboard?.readText();a&&x("url",a.trim(),"url")}catch{}},z=[{id:"url",label:"Target",meta:"Server-issued",items:[{id:"url",icon:q,iconFilled:R,label:"@odata.nextLink",badge:r.entitySet??(t.url?"invalid":"empty"),badgeAppearance:"ghost",badgeColor:r.errors.length?"danger":r.entitySet?"informative":"subtle",dirty:t.dirty.has("url")}]},{id:"prefer",label:"Prefer",items:[{id:"prefer",icon:W,iconFilled:V,label:"Prefer header",badge:L(t.prefer)?"on":null,badgeAppearance:"ghost",dirty:t.dirty.has("prefer")}]},{id:"headers",label:"Headers",meta:`${t.headers.filter(a=>a.enabled).length} active`,items:[{id:"headers",icon:_,iconFilled:J,label:"HTTP headers",badge:t.headers.filter(a=>a.enabled).length||null,dirty:t.dirty.has("headers")}]}];let b;switch(c){case"url":b=e.jsxs("div",{children:[e.jsx(X,{icon:R,title:"Next-link URL",sub:"Paste the @odata.nextLink returned by the previous page. The URL is opaque — clauses are not editable here."}),e.jsx(S,{layout:"multiline",intent:"info",style:{marginBottom:12},children:e.jsxs(w,{children:[e.jsx(T,{children:"Why no clause editor?"}),"The next page must use the ",e.jsx("strong",{children:"same shape"})," as the original query. Dataverse encodes paging state in a ",e.jsx("code",{children:"$skiptoken"})," cookie — editing any other clause invalidates the cursor."]})}),e.jsxs("div",{style:{display:"flex",gap:8,marginBottom:8},children:[e.jsx(k,{content:"Paste from clipboard",relationship:"label",children:e.jsx(j,{icon:e.jsx(Y,{}),appearance:"outline",size:"small",onClick:$,children:"Paste"})}),e.jsx(k,{content:"Clear the URL field",relationship:"label",children:e.jsx(j,{icon:e.jsx(Z,{}),appearance:"subtle",size:"small",disabled:!t.url,onClick:()=>x("url","","url"),children:"Clear"})})]}),e.jsx(ee,{label:"@odata.nextLink",hint:"The full URL including https://. Skiptoken cookies are URL-encoded inside.",children:e.jsx(te,{rows:6,value:t.url,onChange:(a,s)=>x("url",s.value,"url"),placeholder:`https://${d.host}/api/data/v9.2/<entityset>?$select=…&$skiptoken=…`,style:{fontFamily:i.fontFamilyMonospace,fontSize:11}})}),r.errors.map((a,s)=>e.jsx(S,{intent:"error",layout:"multiline",style:{marginTop:12},children:e.jsxs(w,{children:[e.jsx(T,{children:"Can't follow this URL"}),a]})},s)),r.url&&r.ok&&e.jsxs("div",{style:{marginTop:16,padding:12,border:`1px solid ${i.colorNeutralStroke2}`,borderRadius:i.borderRadiusMedium,background:i.colorNeutralBackground1},children:[e.jsx(ae,{style:{display:"block",fontWeight:600,marginBottom:8,color:i.colorNeutralForeground2},children:"Parsed (read-only)"}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"120px 1fr",rowGap:4,columnGap:12,fontFamily:i.fontFamilyMonospace,fontSize:11},children:[e.jsx("span",{style:{color:i.colorNeutralForeground3},children:"host"}),e.jsx("span",{children:r.host}),e.jsx("span",{style:{color:i.colorNeutralForeground3},children:"entityset"}),e.jsx("span",{children:r.entitySet??"—"}),r.params.map((a,s)=>e.jsxs("span",{style:{display:"contents"},children:[e.jsx("span",{style:{color:i.colorBrandForeground1},children:a.key}),e.jsx("span",{style:{wordBreak:"break-all"},children:se(a.value)})]},s))]})]}),r.ok&&e.jsx("div",{style:{marginTop:16},children:e.jsx(k,{content:"Open the parsed URL in a new tab (auth will be required)",relationship:"description",children:e.jsx(j,{icon:e.jsx(re,{}),appearance:"outline",onClick:()=>window.open(t.url,"_blank","noopener"),children:"Open in new tab"})})})]});break;case"prefer":b=e.jsx(Q,{spec:t.prefer,setSpec:a=>x("prefer",a,"prefer"),sendsPageSize:!0});break;case"headers":b=e.jsx(K,{items:t.headers,setItems:a=>x("headers",a,"headers")});break}const D=ne(t.headers,L(t.prefer)),H={method:"GET",built:f,headers:D,isNextLink:!0,rawNextLink:t.url};return e.jsx(oe,{sidebar:e.jsx(ue,{type:l,urlPreview:f.relativeNoBase,sections:z,activeNode:c,onSelect:a=>{h(a),p("builder")},recents:U}),urlBar:e.jsx(ce,{method:"GET",url:f.relativeUrl,executeVerb:l.executeVerb,disabledReason:E,loading:C,onExecute:B,advisories:M,onAdvisoryFocus:a=>h(a)}),children:e.jsxs(ie,{tab:u,onTabChange:p,resultCount:g?.body?.value?.length??null,children:[u==="builder"&&b,u==="code"&&e.jsx(le,{themeMode:y,inputs:H}),u==="results"&&e.jsx(de,{result:g,mode:"next"})]})})}export{fe as RetrieveNextLinkMode};
@@ -1,4 +1,4 @@
1
- import{m as tt}from"./monacoSetup-BIbZ_vQb.js";import"./index-DGsVifiB.js";var rt=Object.defineProperty,nt=Object.getOwnPropertyDescriptor,it=Object.getOwnPropertyNames,ot=Object.prototype.hasOwnProperty,at=(e,n,i,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of it(n))!ot.call(e,t)&&t!==i&&rt(e,t,{get:()=>n[t],enumerable:!(r=nt(n,t))||r.enumerable});return e},st=(e,n,i)=>(at(e,n,"default"),i),d={};st(d,tt);function ct(e,n){const i=globalThis.MonacoEnvironment;if(i?.createTrustedTypesPolicy)try{return i.createTrustedTypesPolicy(e,n)}catch(r){console.error(r);return}try{return globalThis.trustedTypes?.createPolicy(e,n)}catch(r){console.error(r);return}}var M;typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"&&globalThis.workerttPolicy!==void 0?M=globalThis.workerttPolicy:M=ct("defaultWorkerFactory",{createScriptURL:e=>e});function ut(e){const n=e.label,i=globalThis.MonacoEnvironment;if(i){if(typeof i.getWorker=="function")return i.getWorker("workerMain.js",n);if(typeof i.getWorkerUrl=="function"){const r=i.getWorkerUrl("workerMain.js",n);return new Worker(M?M.createScriptURL(r):r,{name:n,type:"module"})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function dt(e){const n=Promise.resolve(ut({label:e.label??"monaco-editor-worker"})).then(i=>(i.postMessage("ignore"),i.postMessage(e.createData),i));return d.editor.createWebWorker({worker:n,host:e.host,keepIdleModels:e.keepIdleModels})}var lt=120*1e3,ft=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>lt&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=dt({label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let n;return this._getClient().then(i=>{n=i}).then(i=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(i=>n)}},J;(function(e){function n(i){return typeof i=="string"}e.is=n})(J||(J={}));var N;(function(e){function n(i){return typeof i=="string"}e.is=n})(N||(N={}));var Z;(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function n(i){return typeof i=="number"&&e.MIN_VALUE<=i&&i<=e.MAX_VALUE}e.is=n})(Z||(Z={}));var D;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function n(i){return typeof i=="number"&&e.MIN_VALUE<=i&&i<=e.MAX_VALUE}e.is=n})(D||(D={}));var w;(function(e){function n(r,t){return r===Number.MAX_VALUE&&(r=D.MAX_VALUE),t===Number.MAX_VALUE&&(t=D.MAX_VALUE),{line:r,character:t}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&a.uinteger(t.line)&&a.uinteger(t.character)}e.is=i})(w||(w={}));var h;(function(e){function n(r,t,o,s){if(a.uinteger(r)&&a.uinteger(t)&&a.uinteger(o)&&a.uinteger(s))return{start:w.create(r,t),end:w.create(o,s)};if(w.is(r)&&w.is(t))return{start:r,end:t};throw new Error(`Range#create called with invalid arguments[${r}, ${t}, ${o}, ${s}]`)}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&w.is(t.start)&&w.is(t.end)}e.is=i})(h||(h={}));var C;(function(e){function n(r,t){return{uri:r,range:t}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&h.is(t.range)&&(a.string(t.uri)||a.undefined(t.uri))}e.is=i})(C||(C={}));var K;(function(e){function n(r,t,o,s){return{targetUri:r,targetRange:t,targetSelectionRange:o,originSelectionRange:s}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&h.is(t.targetRange)&&a.string(t.targetUri)&&h.is(t.targetSelectionRange)&&(h.is(t.originSelectionRange)||a.undefined(t.originSelectionRange))}e.is=i})(K||(K={}));var S;(function(e){function n(r,t,o,s){return{red:r,green:t,blue:o,alpha:s}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.numberRange(t.red,0,1)&&a.numberRange(t.green,0,1)&&a.numberRange(t.blue,0,1)&&a.numberRange(t.alpha,0,1)}e.is=i})(S||(S={}));var ee;(function(e){function n(r,t){return{range:r,color:t}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&h.is(t.range)&&S.is(t.color)}e.is=i})(ee||(ee={}));var te;(function(e){function n(r,t,o){return{label:r,textEdit:t,additionalTextEdits:o}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.string(t.label)&&(a.undefined(t.textEdit)||I.is(t))&&(a.undefined(t.additionalTextEdits)||a.typedArray(t.additionalTextEdits,I.is))}e.is=i})(te||(te={}));var A;(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(A||(A={}));var re;(function(e){function n(r,t,o,s,c,f){const u={startLine:r,endLine:t};return a.defined(o)&&(u.startCharacter=o),a.defined(s)&&(u.endCharacter=s),a.defined(c)&&(u.kind=c),a.defined(f)&&(u.collapsedText=f),u}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.uinteger(t.startLine)&&a.uinteger(t.startLine)&&(a.undefined(t.startCharacter)||a.uinteger(t.startCharacter))&&(a.undefined(t.endCharacter)||a.uinteger(t.endCharacter))&&(a.undefined(t.kind)||a.string(t.kind))}e.is=i})(re||(re={}));var O;(function(e){function n(r,t){return{location:r,message:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&C.is(t.location)&&a.string(t.message)}e.is=i})(O||(O={}));var x;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(x||(x={}));var ne;(function(e){e.Unnecessary=1,e.Deprecated=2})(ne||(ne={}));var ie;(function(e){function n(i){const r=i;return a.objectLiteral(r)&&a.string(r.href)}e.is=n})(ie||(ie={}));var F;(function(e){function n(r,t,o,s,c,f){let u={range:r,message:t};return a.defined(o)&&(u.severity=o),a.defined(s)&&(u.code=s),a.defined(c)&&(u.source=c),a.defined(f)&&(u.relatedInformation=f),u}e.create=n;function i(r){var t;let o=r;return a.defined(o)&&h.is(o.range)&&a.string(o.message)&&(a.number(o.severity)||a.undefined(o.severity))&&(a.integer(o.code)||a.string(o.code)||a.undefined(o.code))&&(a.undefined(o.codeDescription)||a.string((t=o.codeDescription)===null||t===void 0?void 0:t.href))&&(a.string(o.source)||a.undefined(o.source))&&(a.undefined(o.relatedInformation)||a.typedArray(o.relatedInformation,O.is))}e.is=i})(F||(F={}));var E;(function(e){function n(r,t,...o){let s={title:r,command:t};return a.defined(o)&&o.length>0&&(s.arguments=o),s}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.title)&&a.string(t.command)}e.is=i})(E||(E={}));var I;(function(e){function n(o,s){return{range:o,newText:s}}e.replace=n;function i(o,s){return{range:{start:o,end:o},newText:s}}e.insert=i;function r(o){return{range:o,newText:""}}e.del=r;function t(o){const s=o;return a.objectLiteral(s)&&a.string(s.newText)&&h.is(s.range)}e.is=t})(I||(I={}));var V;(function(e){function n(r,t,o){const s={label:r};return t!==void 0&&(s.needsConfirmation=t),o!==void 0&&(s.description=o),s}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.string(t.label)&&(a.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(a.string(t.description)||t.description===void 0)}e.is=i})(V||(V={}));var L;(function(e){function n(i){const r=i;return a.string(r)}e.is=n})(L||(L={}));var oe;(function(e){function n(o,s,c){return{range:o,newText:s,annotationId:c}}e.replace=n;function i(o,s,c){return{range:{start:o,end:o},newText:s,annotationId:c}}e.insert=i;function r(o,s){return{range:o,newText:"",annotationId:s}}e.del=r;function t(o){const s=o;return I.is(s)&&(V.is(s.annotationId)||L.is(s.annotationId))}e.is=t})(oe||(oe={}));var H;(function(e){function n(r,t){return{textDocument:r,edits:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&B.is(t.textDocument)&&Array.isArray(t.edits)}e.is=i})(H||(H={}));var T;(function(e){function n(r,t,o){let s={kind:"create",uri:r};return t!==void 0&&(t.overwrite!==void 0||t.ignoreIfExists!==void 0)&&(s.options=t),o!==void 0&&(s.annotationId=o),s}e.create=n;function i(r){let t=r;return t&&t.kind==="create"&&a.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||a.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||a.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||L.is(t.annotationId))}e.is=i})(T||(T={}));var X;(function(e){function n(r,t,o,s){let c={kind:"rename",oldUri:r,newUri:t};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(c.options=o),s!==void 0&&(c.annotationId=s),c}e.create=n;function i(r){let t=r;return t&&t.kind==="rename"&&a.string(t.oldUri)&&a.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||a.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||a.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||L.is(t.annotationId))}e.is=i})(X||(X={}));var $;(function(e){function n(r,t,o){let s={kind:"delete",uri:r};return t!==void 0&&(t.recursive!==void 0||t.ignoreIfNotExists!==void 0)&&(s.options=t),o!==void 0&&(s.annotationId=o),s}e.create=n;function i(r){let t=r;return t&&t.kind==="delete"&&a.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||a.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||a.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||L.is(t.annotationId))}e.is=i})($||($={}));var z;(function(e){function n(i){let r=i;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(t=>a.string(t.kind)?T.is(t)||X.is(t)||$.is(t):H.is(t)))}e.is=n})(z||(z={}));var ae;(function(e){function n(r){return{uri:r}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)}e.is=i})(ae||(ae={}));var se;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)&&a.integer(t.version)}e.is=i})(se||(se={}));var B;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)&&(t.version===null||a.integer(t.version))}e.is=i})(B||(B={}));var ce;(function(e){function n(r,t,o,s){return{uri:r,languageId:t,version:o,text:s}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)&&a.string(t.languageId)&&a.integer(t.version)&&a.string(t.text)}e.is=i})(ce||(ce={}));var q;(function(e){e.PlainText="plaintext",e.Markdown="markdown";function n(i){const r=i;return r===e.PlainText||r===e.Markdown}e.is=n})(q||(q={}));var P;(function(e){function n(i){const r=i;return a.objectLiteral(i)&&q.is(r.kind)&&a.string(r.value)}e.is=n})(P||(P={}));var v;(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(v||(v={}));var G;(function(e){e.PlainText=1,e.Snippet=2})(G||(G={}));var ue;(function(e){e.Deprecated=1})(ue||(ue={}));var de;(function(e){function n(r,t,o){return{newText:r,insert:t,replace:o}}e.create=n;function i(r){const t=r;return t&&a.string(t.newText)&&h.is(t.insert)&&h.is(t.replace)}e.is=i})(de||(de={}));var le;(function(e){e.asIs=1,e.adjustIndentation=2})(le||(le={}));var fe;(function(e){function n(i){const r=i;return r&&(a.string(r.detail)||r.detail===void 0)&&(a.string(r.description)||r.description===void 0)}e.is=n})(fe||(fe={}));var ge;(function(e){function n(i){return{label:i}}e.create=n})(ge||(ge={}));var he;(function(e){function n(i,r){return{items:i||[],isIncomplete:!!r}}e.create=n})(he||(he={}));var j;(function(e){function n(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=n;function i(r){const t=r;return a.string(t)||a.objectLiteral(t)&&a.string(t.language)&&a.string(t.value)}e.is=i})(j||(j={}));var ve;(function(e){function n(i){let r=i;return!!r&&a.objectLiteral(r)&&(P.is(r.contents)||j.is(r.contents)||a.typedArray(r.contents,j.is))&&(i.range===void 0||h.is(i.range))}e.is=n})(ve||(ve={}));var pe;(function(e){function n(i,r){return r?{label:i,documentation:r}:{label:i}}e.create=n})(pe||(pe={}));var me;(function(e){function n(i,r,...t){let o={label:i};return a.defined(r)&&(o.documentation=r),a.defined(t)?o.parameters=t:o.parameters=[],o}e.create=n})(me||(me={}));var R;(function(e){e.Text=1,e.Read=2,e.Write=3})(R||(R={}));var _e;(function(e){function n(i,r){let t={range:i};return a.number(r)&&(t.kind=r),t}e.create=n})(_e||(_e={}));var p;(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(p||(p={}));var be;(function(e){e.Deprecated=1})(be||(be={}));var we;(function(e){function n(i,r,t,o,s){let c={name:i,kind:r,location:{uri:o,range:t}};return s&&(c.containerName=s),c}e.create=n})(we||(we={}));var ke;(function(e){function n(i,r,t,o){return o!==void 0?{name:i,kind:r,location:{uri:t,range:o}}:{name:i,kind:r,location:{uri:t}}}e.create=n})(ke||(ke={}));var xe;(function(e){function n(r,t,o,s,c,f){let u={name:r,detail:t,kind:o,range:s,selectionRange:c};return f!==void 0&&(u.children=f),u}e.create=n;function i(r){let t=r;return t&&a.string(t.name)&&a.number(t.kind)&&h.is(t.range)&&h.is(t.selectionRange)&&(t.detail===void 0||a.string(t.detail))&&(t.deprecated===void 0||a.boolean(t.deprecated))&&(t.children===void 0||Array.isArray(t.children))&&(t.tags===void 0||Array.isArray(t.tags))}e.is=i})(xe||(xe={}));var Ee;(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Ee||(Ee={}));var U;(function(e){e.Invoked=1,e.Automatic=2})(U||(U={}));var Ie;(function(e){function n(r,t,o){let s={diagnostics:r};return t!=null&&(s.only=t),o!=null&&(s.triggerKind=o),s}e.create=n;function i(r){let t=r;return a.defined(t)&&a.typedArray(t.diagnostics,F.is)&&(t.only===void 0||a.typedArray(t.only,a.string))&&(t.triggerKind===void 0||t.triggerKind===U.Invoked||t.triggerKind===U.Automatic)}e.is=i})(Ie||(Ie={}));var Le;(function(e){function n(r,t,o){let s={title:r},c=!0;return typeof t=="string"?(c=!1,s.kind=t):E.is(t)?s.command=t:s.edit=t,c&&o!==void 0&&(s.kind=o),s}e.create=n;function i(r){let t=r;return t&&a.string(t.title)&&(t.diagnostics===void 0||a.typedArray(t.diagnostics,F.is))&&(t.kind===void 0||a.string(t.kind))&&(t.edit!==void 0||t.command!==void 0)&&(t.command===void 0||E.is(t.command))&&(t.isPreferred===void 0||a.boolean(t.isPreferred))&&(t.edit===void 0||z.is(t.edit))}e.is=i})(Le||(Le={}));var Ae;(function(e){function n(r,t){let o={range:r};return a.defined(t)&&(o.data=t),o}e.create=n;function i(r){let t=r;return a.defined(t)&&h.is(t.range)&&(a.undefined(t.command)||E.is(t.command))}e.is=i})(Ae||(Ae={}));var Re;(function(e){function n(r,t){return{tabSize:r,insertSpaces:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.uinteger(t.tabSize)&&a.boolean(t.insertSpaces)}e.is=i})(Re||(Re={}));var Pe;(function(e){function n(r,t,o){return{range:r,target:t,data:o}}e.create=n;function i(r){let t=r;return a.defined(t)&&h.is(t.range)&&(a.undefined(t.target)||a.string(t.target))}e.is=i})(Pe||(Pe={}));var ye;(function(e){function n(r,t){return{range:r,parent:t}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&h.is(t.range)&&(t.parent===void 0||e.is(t.parent))}e.is=i})(ye||(ye={}));var Me;(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(Me||(Me={}));var De;(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(De||(De={}));var Ce;(function(e){function n(i){const r=i;return a.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}e.is=n})(Ce||(Ce={}));var Fe;(function(e){function n(r,t){return{range:r,text:t}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&a.string(t.text)}e.is=i})(Fe||(Fe={}));var je;(function(e){function n(r,t,o){return{range:r,variableName:t,caseSensitiveLookup:o}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&a.boolean(t.caseSensitiveLookup)&&(a.string(t.variableName)||t.variableName===void 0)}e.is=i})(je||(je={}));var Ue;(function(e){function n(r,t){return{range:r,expression:t}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&(a.string(t.expression)||t.expression===void 0)}e.is=i})(Ue||(Ue={}));var We;(function(e){function n(r,t){return{frameId:r,stoppedLocation:t}}e.create=n;function i(r){const t=r;return a.defined(t)&&h.is(r.stoppedLocation)}e.is=i})(We||(We={}));var Q;(function(e){e.Type=1,e.Parameter=2;function n(i){return i===1||i===2}e.is=n})(Q||(Q={}));var Y;(function(e){function n(r){return{value:r}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&(t.tooltip===void 0||a.string(t.tooltip)||P.is(t.tooltip))&&(t.location===void 0||C.is(t.location))&&(t.command===void 0||E.is(t.command))}e.is=i})(Y||(Y={}));var Ne;(function(e){function n(r,t,o){const s={position:r,label:t};return o!==void 0&&(s.kind=o),s}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&w.is(t.position)&&(a.string(t.label)||a.typedArray(t.label,Y.is))&&(t.kind===void 0||Q.is(t.kind))&&t.textEdits===void 0||a.typedArray(t.textEdits,I.is)&&(t.tooltip===void 0||a.string(t.tooltip)||P.is(t.tooltip))&&(t.paddingLeft===void 0||a.boolean(t.paddingLeft))&&(t.paddingRight===void 0||a.boolean(t.paddingRight))}e.is=i})(Ne||(Ne={}));var Se;(function(e){function n(i){return{kind:"snippet",value:i}}e.createSnippet=n})(Se||(Se={}));var Oe;(function(e){function n(i,r,t,o){return{insertText:i,filterText:r,range:t,command:o}}e.create=n})(Oe||(Oe={}));var Ve;(function(e){function n(i){return{items:i}}e.create=n})(Ve||(Ve={}));var He;(function(e){e.Invoked=0,e.Automatic=1})(He||(He={}));var Te;(function(e){function n(i,r){return{range:i,text:r}}e.create=n})(Te||(Te={}));var Xe;(function(e){function n(i,r){return{triggerKind:i,selectedCompletionInfo:r}}e.create=n})(Xe||(Xe={}));var $e;(function(e){function n(i){const r=i;return a.objectLiteral(r)&&N.is(r.uri)&&a.string(r.name)}e.is=n})($e||($e={}));var ze;(function(e){function n(o,s,c,f){return new gt(o,s,c,f)}e.create=n;function i(o){let s=o;return!!(a.defined(s)&&a.string(s.uri)&&(a.undefined(s.languageId)||a.string(s.languageId))&&a.uinteger(s.lineCount)&&a.func(s.getText)&&a.func(s.positionAt)&&a.func(s.offsetAt))}e.is=i;function r(o,s){let c=o.getText(),f=t(s,(g,_)=>{let b=g.range.start.line-_.range.start.line;return b===0?g.range.start.character-_.range.start.character:b}),u=c.length;for(let g=f.length-1;g>=0;g--){let _=f[g],b=o.offsetAt(_.range.start),l=o.offsetAt(_.range.end);if(l<=u)c=c.substring(0,b)+_.newText+c.substring(l,c.length);else throw new Error("Overlapping edit");u=b}return c}e.applyEdits=r;function t(o,s){if(o.length<=1)return o;const c=o.length/2|0,f=o.slice(0,c),u=o.slice(c);t(f,s),t(u,s);let g=0,_=0,b=0;for(;g<f.length&&_<u.length;)s(f[g],u[_])<=0?o[b++]=f[g++]:o[b++]=u[_++];for(;g<f.length;)o[b++]=f[g++];for(;_<u.length;)o[b++]=u[_++];return o}})(ze||(ze={}));var gt=class{constructor(e,n,i,r){this._uri=e,this._languageId=n,this._version=i,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let n=this.offsetAt(e.start),i=this.offsetAt(e.end);return this._content.substring(n,i)}return this._content}update(e,n){this._content=e.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],n=this._content,i=!0;for(let r=0;r<n.length;r++){i&&(e.push(r),i=!1);let t=n.charAt(r);i=t==="\r"||t===`
1
+ import{m as tt}from"./monacoSetup-DObeMDBe.js";import"./index-D0g0tm7R.js";var rt=Object.defineProperty,nt=Object.getOwnPropertyDescriptor,it=Object.getOwnPropertyNames,ot=Object.prototype.hasOwnProperty,at=(e,n,i,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of it(n))!ot.call(e,t)&&t!==i&&rt(e,t,{get:()=>n[t],enumerable:!(r=nt(n,t))||r.enumerable});return e},st=(e,n,i)=>(at(e,n,"default"),i),d={};st(d,tt);function ct(e,n){const i=globalThis.MonacoEnvironment;if(i?.createTrustedTypesPolicy)try{return i.createTrustedTypesPolicy(e,n)}catch(r){console.error(r);return}try{return globalThis.trustedTypes?.createPolicy(e,n)}catch(r){console.error(r);return}}var M;typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"&&globalThis.workerttPolicy!==void 0?M=globalThis.workerttPolicy:M=ct("defaultWorkerFactory",{createScriptURL:e=>e});function ut(e){const n=e.label,i=globalThis.MonacoEnvironment;if(i){if(typeof i.getWorker=="function")return i.getWorker("workerMain.js",n);if(typeof i.getWorkerUrl=="function"){const r=i.getWorkerUrl("workerMain.js",n);return new Worker(M?M.createScriptURL(r):r,{name:n,type:"module"})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function dt(e){const n=Promise.resolve(ut({label:e.label??"monaco-editor-worker"})).then(i=>(i.postMessage("ignore"),i.postMessage(e.createData),i));return d.editor.createWebWorker({worker:n,host:e.host,keepIdleModels:e.keepIdleModels})}var lt=120*1e3,ft=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>lt&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=dt({label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let n;return this._getClient().then(i=>{n=i}).then(i=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(i=>n)}},J;(function(e){function n(i){return typeof i=="string"}e.is=n})(J||(J={}));var N;(function(e){function n(i){return typeof i=="string"}e.is=n})(N||(N={}));var Z;(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function n(i){return typeof i=="number"&&e.MIN_VALUE<=i&&i<=e.MAX_VALUE}e.is=n})(Z||(Z={}));var D;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function n(i){return typeof i=="number"&&e.MIN_VALUE<=i&&i<=e.MAX_VALUE}e.is=n})(D||(D={}));var w;(function(e){function n(r,t){return r===Number.MAX_VALUE&&(r=D.MAX_VALUE),t===Number.MAX_VALUE&&(t=D.MAX_VALUE),{line:r,character:t}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&a.uinteger(t.line)&&a.uinteger(t.character)}e.is=i})(w||(w={}));var h;(function(e){function n(r,t,o,s){if(a.uinteger(r)&&a.uinteger(t)&&a.uinteger(o)&&a.uinteger(s))return{start:w.create(r,t),end:w.create(o,s)};if(w.is(r)&&w.is(t))return{start:r,end:t};throw new Error(`Range#create called with invalid arguments[${r}, ${t}, ${o}, ${s}]`)}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&w.is(t.start)&&w.is(t.end)}e.is=i})(h||(h={}));var C;(function(e){function n(r,t){return{uri:r,range:t}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&h.is(t.range)&&(a.string(t.uri)||a.undefined(t.uri))}e.is=i})(C||(C={}));var K;(function(e){function n(r,t,o,s){return{targetUri:r,targetRange:t,targetSelectionRange:o,originSelectionRange:s}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&h.is(t.targetRange)&&a.string(t.targetUri)&&h.is(t.targetSelectionRange)&&(h.is(t.originSelectionRange)||a.undefined(t.originSelectionRange))}e.is=i})(K||(K={}));var S;(function(e){function n(r,t,o,s){return{red:r,green:t,blue:o,alpha:s}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.numberRange(t.red,0,1)&&a.numberRange(t.green,0,1)&&a.numberRange(t.blue,0,1)&&a.numberRange(t.alpha,0,1)}e.is=i})(S||(S={}));var ee;(function(e){function n(r,t){return{range:r,color:t}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&h.is(t.range)&&S.is(t.color)}e.is=i})(ee||(ee={}));var te;(function(e){function n(r,t,o){return{label:r,textEdit:t,additionalTextEdits:o}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.string(t.label)&&(a.undefined(t.textEdit)||I.is(t))&&(a.undefined(t.additionalTextEdits)||a.typedArray(t.additionalTextEdits,I.is))}e.is=i})(te||(te={}));var A;(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(A||(A={}));var re;(function(e){function n(r,t,o,s,c,f){const u={startLine:r,endLine:t};return a.defined(o)&&(u.startCharacter=o),a.defined(s)&&(u.endCharacter=s),a.defined(c)&&(u.kind=c),a.defined(f)&&(u.collapsedText=f),u}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.uinteger(t.startLine)&&a.uinteger(t.startLine)&&(a.undefined(t.startCharacter)||a.uinteger(t.startCharacter))&&(a.undefined(t.endCharacter)||a.uinteger(t.endCharacter))&&(a.undefined(t.kind)||a.string(t.kind))}e.is=i})(re||(re={}));var O;(function(e){function n(r,t){return{location:r,message:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&C.is(t.location)&&a.string(t.message)}e.is=i})(O||(O={}));var x;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(x||(x={}));var ne;(function(e){e.Unnecessary=1,e.Deprecated=2})(ne||(ne={}));var ie;(function(e){function n(i){const r=i;return a.objectLiteral(r)&&a.string(r.href)}e.is=n})(ie||(ie={}));var F;(function(e){function n(r,t,o,s,c,f){let u={range:r,message:t};return a.defined(o)&&(u.severity=o),a.defined(s)&&(u.code=s),a.defined(c)&&(u.source=c),a.defined(f)&&(u.relatedInformation=f),u}e.create=n;function i(r){var t;let o=r;return a.defined(o)&&h.is(o.range)&&a.string(o.message)&&(a.number(o.severity)||a.undefined(o.severity))&&(a.integer(o.code)||a.string(o.code)||a.undefined(o.code))&&(a.undefined(o.codeDescription)||a.string((t=o.codeDescription)===null||t===void 0?void 0:t.href))&&(a.string(o.source)||a.undefined(o.source))&&(a.undefined(o.relatedInformation)||a.typedArray(o.relatedInformation,O.is))}e.is=i})(F||(F={}));var E;(function(e){function n(r,t,...o){let s={title:r,command:t};return a.defined(o)&&o.length>0&&(s.arguments=o),s}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.title)&&a.string(t.command)}e.is=i})(E||(E={}));var I;(function(e){function n(o,s){return{range:o,newText:s}}e.replace=n;function i(o,s){return{range:{start:o,end:o},newText:s}}e.insert=i;function r(o){return{range:o,newText:""}}e.del=r;function t(o){const s=o;return a.objectLiteral(s)&&a.string(s.newText)&&h.is(s.range)}e.is=t})(I||(I={}));var V;(function(e){function n(r,t,o){const s={label:r};return t!==void 0&&(s.needsConfirmation=t),o!==void 0&&(s.description=o),s}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.string(t.label)&&(a.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(a.string(t.description)||t.description===void 0)}e.is=i})(V||(V={}));var L;(function(e){function n(i){const r=i;return a.string(r)}e.is=n})(L||(L={}));var oe;(function(e){function n(o,s,c){return{range:o,newText:s,annotationId:c}}e.replace=n;function i(o,s,c){return{range:{start:o,end:o},newText:s,annotationId:c}}e.insert=i;function r(o,s){return{range:o,newText:"",annotationId:s}}e.del=r;function t(o){const s=o;return I.is(s)&&(V.is(s.annotationId)||L.is(s.annotationId))}e.is=t})(oe||(oe={}));var H;(function(e){function n(r,t){return{textDocument:r,edits:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&B.is(t.textDocument)&&Array.isArray(t.edits)}e.is=i})(H||(H={}));var T;(function(e){function n(r,t,o){let s={kind:"create",uri:r};return t!==void 0&&(t.overwrite!==void 0||t.ignoreIfExists!==void 0)&&(s.options=t),o!==void 0&&(s.annotationId=o),s}e.create=n;function i(r){let t=r;return t&&t.kind==="create"&&a.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||a.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||a.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||L.is(t.annotationId))}e.is=i})(T||(T={}));var X;(function(e){function n(r,t,o,s){let c={kind:"rename",oldUri:r,newUri:t};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(c.options=o),s!==void 0&&(c.annotationId=s),c}e.create=n;function i(r){let t=r;return t&&t.kind==="rename"&&a.string(t.oldUri)&&a.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||a.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||a.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||L.is(t.annotationId))}e.is=i})(X||(X={}));var $;(function(e){function n(r,t,o){let s={kind:"delete",uri:r};return t!==void 0&&(t.recursive!==void 0||t.ignoreIfNotExists!==void 0)&&(s.options=t),o!==void 0&&(s.annotationId=o),s}e.create=n;function i(r){let t=r;return t&&t.kind==="delete"&&a.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||a.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||a.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||L.is(t.annotationId))}e.is=i})($||($={}));var z;(function(e){function n(i){let r=i;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(t=>a.string(t.kind)?T.is(t)||X.is(t)||$.is(t):H.is(t)))}e.is=n})(z||(z={}));var ae;(function(e){function n(r){return{uri:r}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)}e.is=i})(ae||(ae={}));var se;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)&&a.integer(t.version)}e.is=i})(se||(se={}));var B;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)&&(t.version===null||a.integer(t.version))}e.is=i})(B||(B={}));var ce;(function(e){function n(r,t,o,s){return{uri:r,languageId:t,version:o,text:s}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)&&a.string(t.languageId)&&a.integer(t.version)&&a.string(t.text)}e.is=i})(ce||(ce={}));var q;(function(e){e.PlainText="plaintext",e.Markdown="markdown";function n(i){const r=i;return r===e.PlainText||r===e.Markdown}e.is=n})(q||(q={}));var P;(function(e){function n(i){const r=i;return a.objectLiteral(i)&&q.is(r.kind)&&a.string(r.value)}e.is=n})(P||(P={}));var v;(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(v||(v={}));var G;(function(e){e.PlainText=1,e.Snippet=2})(G||(G={}));var ue;(function(e){e.Deprecated=1})(ue||(ue={}));var de;(function(e){function n(r,t,o){return{newText:r,insert:t,replace:o}}e.create=n;function i(r){const t=r;return t&&a.string(t.newText)&&h.is(t.insert)&&h.is(t.replace)}e.is=i})(de||(de={}));var le;(function(e){e.asIs=1,e.adjustIndentation=2})(le||(le={}));var fe;(function(e){function n(i){const r=i;return r&&(a.string(r.detail)||r.detail===void 0)&&(a.string(r.description)||r.description===void 0)}e.is=n})(fe||(fe={}));var ge;(function(e){function n(i){return{label:i}}e.create=n})(ge||(ge={}));var he;(function(e){function n(i,r){return{items:i||[],isIncomplete:!!r}}e.create=n})(he||(he={}));var j;(function(e){function n(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=n;function i(r){const t=r;return a.string(t)||a.objectLiteral(t)&&a.string(t.language)&&a.string(t.value)}e.is=i})(j||(j={}));var ve;(function(e){function n(i){let r=i;return!!r&&a.objectLiteral(r)&&(P.is(r.contents)||j.is(r.contents)||a.typedArray(r.contents,j.is))&&(i.range===void 0||h.is(i.range))}e.is=n})(ve||(ve={}));var pe;(function(e){function n(i,r){return r?{label:i,documentation:r}:{label:i}}e.create=n})(pe||(pe={}));var me;(function(e){function n(i,r,...t){let o={label:i};return a.defined(r)&&(o.documentation=r),a.defined(t)?o.parameters=t:o.parameters=[],o}e.create=n})(me||(me={}));var R;(function(e){e.Text=1,e.Read=2,e.Write=3})(R||(R={}));var _e;(function(e){function n(i,r){let t={range:i};return a.number(r)&&(t.kind=r),t}e.create=n})(_e||(_e={}));var p;(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(p||(p={}));var be;(function(e){e.Deprecated=1})(be||(be={}));var we;(function(e){function n(i,r,t,o,s){let c={name:i,kind:r,location:{uri:o,range:t}};return s&&(c.containerName=s),c}e.create=n})(we||(we={}));var ke;(function(e){function n(i,r,t,o){return o!==void 0?{name:i,kind:r,location:{uri:t,range:o}}:{name:i,kind:r,location:{uri:t}}}e.create=n})(ke||(ke={}));var xe;(function(e){function n(r,t,o,s,c,f){let u={name:r,detail:t,kind:o,range:s,selectionRange:c};return f!==void 0&&(u.children=f),u}e.create=n;function i(r){let t=r;return t&&a.string(t.name)&&a.number(t.kind)&&h.is(t.range)&&h.is(t.selectionRange)&&(t.detail===void 0||a.string(t.detail))&&(t.deprecated===void 0||a.boolean(t.deprecated))&&(t.children===void 0||Array.isArray(t.children))&&(t.tags===void 0||Array.isArray(t.tags))}e.is=i})(xe||(xe={}));var Ee;(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Ee||(Ee={}));var U;(function(e){e.Invoked=1,e.Automatic=2})(U||(U={}));var Ie;(function(e){function n(r,t,o){let s={diagnostics:r};return t!=null&&(s.only=t),o!=null&&(s.triggerKind=o),s}e.create=n;function i(r){let t=r;return a.defined(t)&&a.typedArray(t.diagnostics,F.is)&&(t.only===void 0||a.typedArray(t.only,a.string))&&(t.triggerKind===void 0||t.triggerKind===U.Invoked||t.triggerKind===U.Automatic)}e.is=i})(Ie||(Ie={}));var Le;(function(e){function n(r,t,o){let s={title:r},c=!0;return typeof t=="string"?(c=!1,s.kind=t):E.is(t)?s.command=t:s.edit=t,c&&o!==void 0&&(s.kind=o),s}e.create=n;function i(r){let t=r;return t&&a.string(t.title)&&(t.diagnostics===void 0||a.typedArray(t.diagnostics,F.is))&&(t.kind===void 0||a.string(t.kind))&&(t.edit!==void 0||t.command!==void 0)&&(t.command===void 0||E.is(t.command))&&(t.isPreferred===void 0||a.boolean(t.isPreferred))&&(t.edit===void 0||z.is(t.edit))}e.is=i})(Le||(Le={}));var Ae;(function(e){function n(r,t){let o={range:r};return a.defined(t)&&(o.data=t),o}e.create=n;function i(r){let t=r;return a.defined(t)&&h.is(t.range)&&(a.undefined(t.command)||E.is(t.command))}e.is=i})(Ae||(Ae={}));var Re;(function(e){function n(r,t){return{tabSize:r,insertSpaces:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.uinteger(t.tabSize)&&a.boolean(t.insertSpaces)}e.is=i})(Re||(Re={}));var Pe;(function(e){function n(r,t,o){return{range:r,target:t,data:o}}e.create=n;function i(r){let t=r;return a.defined(t)&&h.is(t.range)&&(a.undefined(t.target)||a.string(t.target))}e.is=i})(Pe||(Pe={}));var ye;(function(e){function n(r,t){return{range:r,parent:t}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&h.is(t.range)&&(t.parent===void 0||e.is(t.parent))}e.is=i})(ye||(ye={}));var Me;(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(Me||(Me={}));var De;(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(De||(De={}));var Ce;(function(e){function n(i){const r=i;return a.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}e.is=n})(Ce||(Ce={}));var Fe;(function(e){function n(r,t){return{range:r,text:t}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&a.string(t.text)}e.is=i})(Fe||(Fe={}));var je;(function(e){function n(r,t,o){return{range:r,variableName:t,caseSensitiveLookup:o}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&a.boolean(t.caseSensitiveLookup)&&(a.string(t.variableName)||t.variableName===void 0)}e.is=i})(je||(je={}));var Ue;(function(e){function n(r,t){return{range:r,expression:t}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&(a.string(t.expression)||t.expression===void 0)}e.is=i})(Ue||(Ue={}));var We;(function(e){function n(r,t){return{frameId:r,stoppedLocation:t}}e.create=n;function i(r){const t=r;return a.defined(t)&&h.is(r.stoppedLocation)}e.is=i})(We||(We={}));var Q;(function(e){e.Type=1,e.Parameter=2;function n(i){return i===1||i===2}e.is=n})(Q||(Q={}));var Y;(function(e){function n(r){return{value:r}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&(t.tooltip===void 0||a.string(t.tooltip)||P.is(t.tooltip))&&(t.location===void 0||C.is(t.location))&&(t.command===void 0||E.is(t.command))}e.is=i})(Y||(Y={}));var Ne;(function(e){function n(r,t,o){const s={position:r,label:t};return o!==void 0&&(s.kind=o),s}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&w.is(t.position)&&(a.string(t.label)||a.typedArray(t.label,Y.is))&&(t.kind===void 0||Q.is(t.kind))&&t.textEdits===void 0||a.typedArray(t.textEdits,I.is)&&(t.tooltip===void 0||a.string(t.tooltip)||P.is(t.tooltip))&&(t.paddingLeft===void 0||a.boolean(t.paddingLeft))&&(t.paddingRight===void 0||a.boolean(t.paddingRight))}e.is=i})(Ne||(Ne={}));var Se;(function(e){function n(i){return{kind:"snippet",value:i}}e.createSnippet=n})(Se||(Se={}));var Oe;(function(e){function n(i,r,t,o){return{insertText:i,filterText:r,range:t,command:o}}e.create=n})(Oe||(Oe={}));var Ve;(function(e){function n(i){return{items:i}}e.create=n})(Ve||(Ve={}));var He;(function(e){e.Invoked=0,e.Automatic=1})(He||(He={}));var Te;(function(e){function n(i,r){return{range:i,text:r}}e.create=n})(Te||(Te={}));var Xe;(function(e){function n(i,r){return{triggerKind:i,selectedCompletionInfo:r}}e.create=n})(Xe||(Xe={}));var $e;(function(e){function n(i){const r=i;return a.objectLiteral(r)&&N.is(r.uri)&&a.string(r.name)}e.is=n})($e||($e={}));var ze;(function(e){function n(o,s,c,f){return new gt(o,s,c,f)}e.create=n;function i(o){let s=o;return!!(a.defined(s)&&a.string(s.uri)&&(a.undefined(s.languageId)||a.string(s.languageId))&&a.uinteger(s.lineCount)&&a.func(s.getText)&&a.func(s.positionAt)&&a.func(s.offsetAt))}e.is=i;function r(o,s){let c=o.getText(),f=t(s,(g,_)=>{let b=g.range.start.line-_.range.start.line;return b===0?g.range.start.character-_.range.start.character:b}),u=c.length;for(let g=f.length-1;g>=0;g--){let _=f[g],b=o.offsetAt(_.range.start),l=o.offsetAt(_.range.end);if(l<=u)c=c.substring(0,b)+_.newText+c.substring(l,c.length);else throw new Error("Overlapping edit");u=b}return c}e.applyEdits=r;function t(o,s){if(o.length<=1)return o;const c=o.length/2|0,f=o.slice(0,c),u=o.slice(c);t(f,s),t(u,s);let g=0,_=0,b=0;for(;g<f.length&&_<u.length;)s(f[g],u[_])<=0?o[b++]=f[g++]:o[b++]=u[_++];for(;g<f.length;)o[b++]=f[g++];for(;_<u.length;)o[b++]=u[_++];return o}})(ze||(ze={}));var gt=class{constructor(e,n,i,r){this._uri=e,this._languageId=n,this._version=i,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let n=this.offsetAt(e.start),i=this.offsetAt(e.end);return this._content.substring(n,i)}return this._content}update(e,n){this._content=e.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],n=this._content,i=!0;for(let r=0;r<n.length;r++){i&&(e.push(r),i=!1);let t=n.charAt(r);i=t==="\r"||t===`
2
2
  `,t==="\r"&&r+1<n.length&&n.charAt(r+1)===`
3
3
  `&&r++}i&&n.length>0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),i=0,r=n.length;if(r===0)return w.create(0,e);for(;i<r;){let o=Math.floor((i+r)/2);n[o]>e?r=o:i=o+1}let t=i-1;return w.create(t,e-n[t])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let i=n[e.line],r=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(i+e.character,r),i)}get lineCount(){return this.getLineOffsets().length}},a;(function(e){const n=Object.prototype.toString;function i(l){return typeof l<"u"}e.defined=i;function r(l){return typeof l>"u"}e.undefined=r;function t(l){return l===!0||l===!1}e.boolean=t;function o(l){return n.call(l)==="[object String]"}e.string=o;function s(l){return n.call(l)==="[object Number]"}e.number=s;function c(l,W,et){return n.call(l)==="[object Number]"&&W<=l&&l<=et}e.numberRange=c;function f(l){return n.call(l)==="[object Number]"&&-2147483648<=l&&l<=2147483647}e.integer=f;function u(l){return n.call(l)==="[object Number]"&&0<=l&&l<=2147483647}e.uinteger=u;function g(l){return n.call(l)==="[object Function]"}e.func=g;function _(l){return l!==null&&typeof l=="object"}e.objectLiteral=_;function b(l,W){return Array.isArray(l)&&l.every(W)}e.typedArray=b})(a||(a={}));var ht=class{constructor(e,n,i){this._languageId=e,this._worker=n,this._disposables=[],this._listener=Object.create(null);const r=o=>{let s=o.getLanguageId();if(s!==this._languageId)return;let c;this._listener[o.uri.toString()]=o.onDidChangeContent(()=>{window.clearTimeout(c),c=window.setTimeout(()=>this._doValidate(o.uri,s),500)}),this._doValidate(o.uri,s)},t=o=>{d.editor.setModelMarkers(o,this._languageId,[]);let s=o.uri.toString(),c=this._listener[s];c&&(c.dispose(),delete this._listener[s])};this._disposables.push(d.editor.onDidCreateModel(r)),this._disposables.push(d.editor.onWillDisposeModel(t)),this._disposables.push(d.editor.onDidChangeModelLanguage(o=>{t(o.model),r(o.model)})),this._disposables.push(i(o=>{d.editor.getModels().forEach(s=>{s.getLanguageId()===this._languageId&&(t(s),r(s))})})),this._disposables.push({dispose:()=>{d.editor.getModels().forEach(t);for(let o in this._listener)this._listener[o].dispose()}}),d.editor.getModels().forEach(r)}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables.length=0}_doValidate(e,n){this._worker(e).then(i=>i.doValidation(e.toString())).then(i=>{const r=i.map(o=>pt(e,o));let t=d.editor.getModel(e);t&&t.getLanguageId()===n&&d.editor.setModelMarkers(t,n,r)}).then(void 0,i=>{console.error(i)})}};function vt(e){switch(e){case x.Error:return d.MarkerSeverity.Error;case x.Warning:return d.MarkerSeverity.Warning;case x.Information:return d.MarkerSeverity.Info;case x.Hint:return d.MarkerSeverity.Hint;default:return d.MarkerSeverity.Info}}function pt(e,n){let i=typeof n.code=="number"?String(n.code):n.code;return{severity:vt(n.severity),startLineNumber:n.range.start.line+1,startColumn:n.range.start.character+1,endLineNumber:n.range.end.line+1,endColumn:n.range.end.character+1,message:n.message,code:i,source:n.source}}var mt=class{constructor(e,n){this._worker=e,this._triggerCharacters=n}get triggerCharacters(){return this._triggerCharacters}provideCompletionItems(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.doComplete(t.toString(),k(n))).then(o=>{if(!o)return;const s=e.getWordUntilPosition(n),c=new d.Range(n.lineNumber,s.startColumn,n.lineNumber,s.endColumn),f=o.items.map(u=>{const g={label:u.label,insertText:u.insertText||u.label,sortText:u.sortText,filterText:u.filterText,documentation:u.documentation,detail:u.detail,command:wt(u.command),range:c,kind:bt(u.kind)};return u.textEdit&&(_t(u.textEdit)?g.range={insert:m(u.textEdit.insert),replace:m(u.textEdit.replace)}:g.range=m(u.textEdit.range),g.insertText=u.textEdit.newText),u.additionalTextEdits&&(g.additionalTextEdits=u.additionalTextEdits.map(y)),u.insertTextFormat===G.Snippet&&(g.insertTextRules=d.languages.CompletionItemInsertTextRule.InsertAsSnippet),g});return{isIncomplete:o.isIncomplete,suggestions:f}})}};function k(e){if(e)return{character:e.column-1,line:e.lineNumber-1}}function Ge(e){if(e)return{start:{line:e.startLineNumber-1,character:e.startColumn-1},end:{line:e.endLineNumber-1,character:e.endColumn-1}}}function m(e){if(e)return new d.Range(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1)}function _t(e){return typeof e.insert<"u"&&typeof e.replace<"u"}function bt(e){const n=d.languages.CompletionItemKind;switch(e){case v.Text:return n.Text;case v.Method:return n.Method;case v.Function:return n.Function;case v.Constructor:return n.Constructor;case v.Field:return n.Field;case v.Variable:return n.Variable;case v.Class:return n.Class;case v.Interface:return n.Interface;case v.Module:return n.Module;case v.Property:return n.Property;case v.Unit:return n.Unit;case v.Value:return n.Value;case v.Enum:return n.Enum;case v.Keyword:return n.Keyword;case v.Snippet:return n.Snippet;case v.Color:return n.Color;case v.File:return n.File;case v.Reference:return n.Reference}return n.Property}function y(e){if(e)return{range:m(e.range),text:e.newText}}function wt(e){return e&&e.command==="editor.action.triggerSuggest"?{id:e.command,title:e.title,arguments:e.arguments}:void 0}var kt=class{constructor(e){this._worker=e}provideHover(e,n,i){let r=e.uri;return this._worker(r).then(t=>t.doHover(r.toString(),k(n))).then(t=>{if(t)return{range:m(t.range),contents:Et(t.contents)}})}};function xt(e){return e&&typeof e=="object"&&typeof e.kind=="string"}function Be(e){return typeof e=="string"?{value:e}:xt(e)?e.kind==="plaintext"?{value:e.value.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}:{value:e.value}:{value:"```"+e.language+`
4
4
  `+e.value+"\n```\n"}}function Et(e){if(e)return Array.isArray(e)?e.map(Be):[Be(e)]}var It=class{constructor(e){this._worker=e}provideDocumentHighlights(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.findDocumentHighlights(r.toString(),k(n))).then(t=>{if(t)return t.map(o=>({range:m(o.range),kind:Lt(o.kind)}))})}};function Lt(e){switch(e){case R.Read:return d.languages.DocumentHighlightKind.Read;case R.Write:return d.languages.DocumentHighlightKind.Write;case R.Text:return d.languages.DocumentHighlightKind.Text}return d.languages.DocumentHighlightKind.Text}var At=class{constructor(e){this._worker=e}provideDefinition(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.findDefinition(r.toString(),k(n))).then(t=>{if(t)return[Qe(t)]})}};function Qe(e){return{uri:d.Uri.parse(e.uri),range:m(e.range)}}var Rt=class{constructor(e){this._worker=e}provideReferences(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.findReferences(t.toString(),k(n))).then(o=>{if(o)return o.map(Qe)})}},Pt=class{constructor(e){this._worker=e}provideRenameEdits(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.doRename(t.toString(),k(n),i)).then(o=>yt(o))}};function yt(e){if(!e||!e.changes)return;let n=[];for(let i in e.changes){const r=d.Uri.parse(i);for(let t of e.changes[i])n.push({resource:r,versionId:void 0,textEdit:{range:m(t.range),text:t.newText}})}return{edits:n}}var Mt=class{constructor(e){this._worker=e}provideDocumentSymbols(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentSymbols(i.toString())).then(r=>{if(r)return r.map(t=>Dt(t)?Ye(t):{name:t.name,detail:"",containerName:t.containerName,kind:Je(t.kind),range:m(t.location.range),selectionRange:m(t.location.range),tags:[]})})}};function Dt(e){return"children"in e}function Ye(e){return{name:e.name,detail:e.detail??"",kind:Je(e.kind),range:m(e.range),selectionRange:m(e.selectionRange),tags:e.tags??[],children:(e.children??[]).map(n=>Ye(n))}}function Je(e){let n=d.languages.SymbolKind;switch(e){case p.File:return n.File;case p.Module:return n.Module;case p.Namespace:return n.Namespace;case p.Package:return n.Package;case p.Class:return n.Class;case p.Method:return n.Method;case p.Property:return n.Property;case p.Field:return n.Field;case p.Constructor:return n.Constructor;case p.Enum:return n.Enum;case p.Interface:return n.Interface;case p.Function:return n.Function;case p.Variable:return n.Variable;case p.Constant:return n.Constant;case p.String:return n.String;case p.Number:return n.Number;case p.Boolean:return n.Boolean;case p.Array:return n.Array}return n.Function}var Vt=class{constructor(e){this._worker=e}provideLinks(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentLinks(i.toString())).then(r=>{if(r)return{links:r.map(t=>({range:m(t.range),url:t.target}))}})}},Ct=class{constructor(e){this._worker=e}provideDocumentFormattingEdits(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.format(r.toString(),null,Ze(n)).then(o=>{if(!(!o||o.length===0))return o.map(y)}))}},Ft=class{constructor(e){this._worker=e,this.canFormatMultipleRanges=!1}provideDocumentRangeFormattingEdits(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.format(t.toString(),Ge(n),Ze(i)).then(s=>{if(!(!s||s.length===0))return s.map(y)}))}};function Ze(e){return{tabSize:e.tabSize,insertSpaces:e.insertSpaces}}var jt=class{constructor(e){this._worker=e}provideDocumentColors(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentColors(i.toString())).then(r=>{if(r)return r.map(t=>({color:t.color,range:m(t.range)}))})}provideColorPresentations(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getColorPresentations(r.toString(),n.color,Ge(n.range))).then(t=>{if(t)return t.map(o=>{let s={label:o.label};return o.textEdit&&(s.textEdit=y(o.textEdit)),o.additionalTextEdits&&(s.additionalTextEdits=o.additionalTextEdits.map(y)),s})})}},Ut=class{constructor(e){this._worker=e}provideFoldingRanges(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getFoldingRanges(r.toString(),n)).then(t=>{if(t)return t.map(o=>{const s={start:o.startLine+1,end:o.endLine+1};return typeof o.kind<"u"&&(s.kind=Wt(o.kind)),s})})}};function Wt(e){switch(e){case A.Comment:return d.languages.FoldingRangeKind.Comment;case A.Imports:return d.languages.FoldingRangeKind.Imports;case A.Region:return d.languages.FoldingRangeKind.Region}}var Nt=class{constructor(e){this._worker=e}provideSelectionRanges(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getSelectionRanges(r.toString(),n.map(k))).then(t=>{if(t)return t.map(o=>{const s=[];for(;o;)s.push({range:m(o.range)}),o=o.parent;return s})})}};function Ht(e){const n=[],i=[],r=new ft(e);n.push(r);const t=(...s)=>r.getLanguageServiceWorker(...s);function o(){const{languageId:s,modeConfiguration:c}=e;Ke(i),c.completionItems&&i.push(d.languages.registerCompletionItemProvider(s,new mt(t,["/","-",":"]))),c.hovers&&i.push(d.languages.registerHoverProvider(s,new kt(t))),c.documentHighlights&&i.push(d.languages.registerDocumentHighlightProvider(s,new It(t))),c.definitions&&i.push(d.languages.registerDefinitionProvider(s,new At(t))),c.references&&i.push(d.languages.registerReferenceProvider(s,new Rt(t))),c.documentSymbols&&i.push(d.languages.registerDocumentSymbolProvider(s,new Mt(t))),c.rename&&i.push(d.languages.registerRenameProvider(s,new Pt(t))),c.colors&&i.push(d.languages.registerColorProvider(s,new jt(t))),c.foldingRanges&&i.push(d.languages.registerFoldingRangeProvider(s,new Ut(t))),c.diagnostics&&i.push(new ht(s,t,e.onDidChange)),c.selectionRanges&&i.push(d.languages.registerSelectionRangeProvider(s,new Nt(t))),c.documentFormattingEdits&&i.push(d.languages.registerDocumentFormattingEditProvider(s,new Ct(t))),c.documentRangeFormattingEdits&&i.push(d.languages.registerDocumentRangeFormattingEditProvider(s,new Ft(t)))}return o(),n.push(qe(i)),qe(n)}function qe(e){return{dispose:()=>Ke(e)}}function Ke(e){for(;e.length;)e.pop().dispose()}export{mt as CompletionAdapter,At as DefinitionAdapter,ht as DiagnosticsAdapter,jt as DocumentColorAdapter,Ct as DocumentFormattingEditProvider,It as DocumentHighlightAdapter,Vt as DocumentLinkAdapter,Ft as DocumentRangeFormattingEditProvider,Mt as DocumentSymbolAdapter,Ut as FoldingRangeAdapter,kt as HoverAdapter,Rt as ReferenceAdapter,Pt as RenameAdapter,Nt as SelectionRangeAdapter,ft as WorkerManager,k as fromPosition,Ge as fromRange,Ht as setupMode,m as toRange,y as toTextEdit};
@@ -1,3 +1,3 @@
1
- import{m as f}from"./monacoSetup-BIbZ_vQb.js";import"./index-DGsVifiB.js";var F=Object.defineProperty,b=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,$=Object.prototype.hasOwnProperty,v=(t,n,_,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of x(n))!$.call(t,o)&&o!==_&&F(t,o,{get:()=>n[o],enumerable:!(e=b(n,o))||e.enumerable});return t},E=(t,n,_)=>(v(t,n,"default"),_),r={};E(r,f);var d=["assign","flush","ftl","return","global","import","include","break","continue","local","nested","nt","setting","stop","t","lt","rt","fallback"],s=["attempt","autoesc","autoEsc","compress","comment","escape","noescape","function","if","list","items","sep","macro","noparse","noParse","noautoesc","noAutoEsc","outputformat","switch","visit","recurse"],a={close:">",id:"angle",open:"<"},u={close:"\\]",id:"bracket",open:"\\["},D={close:"[>\\]]",id:"auto",open:"[<\\[]"},k={close:"\\}",id:"dollar",open1:"\\$",open2:"\\{"},p={close:"\\]",id:"bracket",open1:"\\[",open2:"="};function l(t){return{brackets:[["<",">"],["[","]"],["(",")"],["{","}"]],comments:{blockComment:[`${t.open}--`,`--${t.close}`]},autoCloseBefore:`
1
+ import{m as f}from"./monacoSetup-DObeMDBe.js";import"./index-D0g0tm7R.js";var F=Object.defineProperty,b=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,$=Object.prototype.hasOwnProperty,v=(t,n,_,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of x(n))!$.call(t,o)&&o!==_&&F(t,o,{get:()=>n[o],enumerable:!(e=b(n,o))||e.enumerable});return t},E=(t,n,_)=>(v(t,n,"default"),_),r={};E(r,f);var d=["assign","flush","ftl","return","global","import","include","break","continue","local","nested","nt","setting","stop","t","lt","rt","fallback"],s=["attempt","autoesc","autoEsc","compress","comment","escape","noescape","function","if","list","items","sep","macro","noparse","noParse","noautoesc","noAutoEsc","outputformat","switch","visit","recurse"],a={close:">",id:"angle",open:"<"},u={close:"\\]",id:"bracket",open:"\\["},D={close:"[>\\]]",id:"auto",open:"[<\\[]"},k={close:"\\}",id:"dollar",open1:"\\$",open2:"\\{"},p={close:"\\]",id:"bracket",open1:"\\[",open2:"="};function l(t){return{brackets:[["<",">"],["[","]"],["(",")"],["{","}"]],comments:{blockComment:[`${t.open}--`,`--${t.close}`]},autoCloseBefore:`
2
2
  \r }]),.:;=`,autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],folding:{markers:{start:new RegExp(`${t.open}#(?:${s.join("|")})([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`),end:new RegExp(`${t.open}/#(?:${s.join("|")})[\\r\\n\\t ]*>`)}},onEnterRules:[{beforeText:new RegExp(`${t.open}#(?!(?:${d.join("|")}))([a-zA-Z_]+)([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`),afterText:new RegExp(`^${t.open}/#([a-zA-Z_]+)[\\r\\n\\t ]*${t.close}$`),action:{indentAction:r.languages.IndentAction.IndentOutdent}},{beforeText:new RegExp(`${t.open}#(?!(?:${d.join("|")}))([a-zA-Z_]+)([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`),action:{indentAction:r.languages.IndentAction.Indent}}]}}function g(){return{brackets:[["<",">"],["[","]"],["(",")"],["{","}"]],autoCloseBefore:`
3
3
  \r }]),.:;=`,autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],folding:{markers:{start:new RegExp(`[<\\[]#(?:${s.join("|")})([^/>\\]]*(?!/)[>\\]])[^<\\[]*$`),end:new RegExp(`[<\\[]/#(?:${s.join("|")})[\\r\\n\\t ]*>`)}},onEnterRules:[{beforeText:new RegExp(`[<\\[]#(?!(?:${d.join("|")}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`),afterText:new RegExp("^[<\\[]/#([a-zA-Z_]+)[\\r\\n\\t ]*[>\\]]$"),action:{indentAction:r.languages.IndentAction.IndentOutdent}},{beforeText:new RegExp(`[<\\[]#(?!(?:${d.join("|")}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`),action:{indentAction:r.languages.IndentAction.Indent}}]}}function i(t,n){const _=`_${t.id}_${n.id}`,e=c=>c.replace(/__id__/g,_),o=c=>{const m=c.source.replace(/__id__/g,_);return new RegExp(m,c.flags)};return{unicode:!0,includeLF:!1,start:e("default__id__"),ignoreCase:!1,defaultToken:"invalid",tokenPostfix:".freemarker2",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],[e("open__id__")]:new RegExp(t.open),[e("close__id__")]:new RegExp(t.close),[e("iOpen1__id__")]:new RegExp(n.open1),[e("iOpen2__id__")]:new RegExp(n.open2),[e("iClose__id__")]:new RegExp(n.close),[e("startTag__id__")]:o(/(@open__id__)(#)/),[e("endTag__id__")]:o(/(@open__id__)(\/#)/),[e("startOrEndTag__id__")]:o(/(@open__id__)(\/?#)/),[e("closeTag1__id__")]:o(/((?:@blank)*)(@close__id__)/),[e("closeTag2__id__")]:o(/((?:@blank)*\/?)(@close__id__)/),blank:/[ \t\n\r]/,keywords:["false","true","in","as","using"],directiveStartCloseTag1:/attempt|recover|sep|auto[eE]sc|no(?:autoe|AutoE)sc|compress|default|no[eE]scape|comment|no[pP]arse/,directiveStartCloseTag2:/else|break|continue|return|stop|flush|t|lt|rt|nt|nested|recurse|fallback|ftl/,directiveStartBlank:/if|else[iI]f|list|for[eE]ach|switch|case|assign|global|local|include|import|function|macro|transform|visit|stop|return|call|setting|output[fF]ormat|nested|recurse|escape|ftl|items/,directiveEndCloseTag1:/if|list|items|sep|recover|attempt|for[eE]ach|local|global|assign|function|macro|output[fF]ormat|auto[eE]sc|no(?:autoe|AutoE)sc|compress|transform|switch|escape|no[eE]scape/,escapedChar:/\\(?:[ntrfbgla\\'"\{=]|(?:x[0-9A-Fa-f]{1,4}))/,asciiDigit:/[0-9]/,integer:/[0-9]+/,nonEscapedIdStartChar:/[\$@-Z_a-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u1FFF\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183-\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3006\u3031-\u3035\u303B-\u303C\u3040-\u318F\u31A0-\u31BA\u31F0-\u31FF\u3300-\u337F\u3400-\u4DB5\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,escapedIdChar:/\\[\-\.:#]/,idStartChar:/(?:@nonEscapedIdStartChar)|(?:@escapedIdChar)/,id:/(?:@idStartChar)(?:(?:@idStartChar)|(?:@asciiDigit))*/,specialHashKeys:/\*\*|\*|false|true|in|as|using/,namedSymbols:/&lt;=|&gt;=|\\lte|\\lt|&lt;|\\gte|\\gt|&gt;|&amp;&amp;|\\and|-&gt;|->|==|!=|\+=|-=|\*=|\/=|%=|\+\+|--|<=|&&|\|\||:|\.\.\.|\.\.\*|\.\.<|\.\.!|\?\?|=|<|\+|-|\*|\/|%|\||\.\.|\?|!|&|\.|,|;/,arrows:["->","-&gt;"],delimiters:[";",":",",","."],stringOperators:["lte","lt","gte","gt"],noParseTags:["noparse","noParse","comment"],tokenizer:{[e("default__id__")]:[{include:e("@directive_token__id__")},{include:e("@interpolation_and_text_token__id__")}],[e("fmExpression__id__.directive")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("fmExpression__id__.interpolation")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@expression_token__id__")},{include:e("@greater_operators_token__id__")}],[e("inParen__id__.plain")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("inParen__id__.gt")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@expression_token__id__")},{include:e("@greater_operators_token__id__")}],[e("noSpaceExpression__id__")]:[{include:e("@no_space_expression_end_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("unifiedCall__id__")]:[{include:e("@unified_call_token__id__")}],[e("singleString__id__")]:[{include:e("@string_single_token__id__")}],[e("doubleString__id__")]:[{include:e("@string_double_token__id__")}],[e("rawSingleString__id__")]:[{include:e("@string_single_raw_token__id__")}],[e("rawDoubleString__id__")]:[{include:e("@string_double_raw_token__id__")}],[e("expressionComment__id__")]:[{include:e("@expression_comment_token__id__")}],[e("noParse__id__")]:[{include:e("@no_parse_token__id__")}],[e("terseComment__id__")]:[{include:e("@terse_comment_token__id__")}],[e("directive_token__id__")]:[[o(/(?:@startTag__id__)(@directiveStartCloseTag1)(?:@closeTag1__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{cases:{"@noParseTags":{token:"tag",next:e("@noParse__id__.$3")},"@default":{token:"tag"}}},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(?:@startTag__id__)(@directiveStartCloseTag2)(?:@closeTag2__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(?:@startTag__id__)(@directiveStartBlank)(@blank)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"",next:e("@fmExpression__id__.directive")}]],[o(/(?:@endTag__id__)(@directiveEndCloseTag1)(?:@closeTag1__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(@open__id__)(@)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive",next:e("@unifiedCall__id__")}]],[o(/(@open__id__)(\/@)((?:(?:@id)(?:\.(?:@id))*)?)(?:@closeTag1__id__)/),[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(@open__id__)#--/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:{token:"comment",next:e("@terseComment__id__")}],[o(/(?:@startOrEndTag__id__)([a-zA-Z_]+)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag.invalid",next:e("@fmExpression__id__.directive")}]]],[e("interpolation_and_text_token__id__")]:[[o(/(@iOpen1__id__)(@iOpen2__id__)/),[{token:n.id==="bracket"?"@brackets.interpolation":"delimiter.interpolation"},{token:n.id==="bracket"?"delimiter.interpolation":"@brackets.interpolation",next:e("@fmExpression__id__.interpolation")}]],[/[\$#<\[\{]|(?:@blank)+|[^\$<#\[\{\n\r\t ]+/,{token:"source"}]],[e("string_single_token__id__")]:[[/[^'\\]/,{token:"string"}],[/@escapedChar/,{token:"string.escape"}],[/'/,{token:"string",next:"@pop"}]],[e("string_double_token__id__")]:[[/[^"\\]/,{token:"string"}],[/@escapedChar/,{token:"string.escape"}],[/"/,{token:"string",next:"@pop"}]],[e("string_single_raw_token__id__")]:[[/[^']+/,{token:"string.raw"}],[/'/,{token:"string.raw",next:"@pop"}]],[e("string_double_raw_token__id__")]:[[/[^"]+/,{token:"string.raw"}],[/"/,{token:"string.raw",next:"@pop"}]],[e("expression_token__id__")]:[[/(r?)(['"])/,{cases:{"r'":[{token:"keyword"},{token:"string.raw",next:e("@rawSingleString__id__")}],'r"':[{token:"keyword"},{token:"string.raw",next:e("@rawDoubleString__id__")}],"'":[{token:"source"},{token:"string",next:e("@singleString__id__")}],'"':[{token:"source"},{token:"string",next:e("@doubleString__id__")}]}}],[/(?:@integer)(?:\.(?:@integer))?/,{cases:{"(?:@integer)":{token:"number"},"@default":{token:"number.float"}}}],[/(\.)(@blank*)(@specialHashKeys)/,[{token:"delimiter"},{token:""},{token:"identifier"}]],[/(?:@namedSymbols)/,{cases:{"@arrows":{token:"meta.arrow"},"@delimiters":{token:"delimiter"},"@default":{token:"operators"}}}],[/@id/,{cases:{"@keywords":{token:"keyword.$0"},"@stringOperators":{token:"operators"},"@default":{token:"identifier"}}}],[/[\[\]\(\)\{\}]/,{cases:{"\\[":{cases:{"$S2==gt":{token:"@brackets",next:e("@inParen__id__.gt")},"@default":{token:"@brackets",next:e("@inParen__id__.plain")}}},"\\]":{cases:{...n.id==="bracket"?{"$S2==interpolation":{token:"@brackets.interpolation",next:"@popall"}}:{},...t.id==="bracket"?{"$S2==directive":{token:"@brackets.directive",next:"@popall"}}:{},[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}},"\\(":{token:"@brackets",next:e("@inParen__id__.gt")},"\\)":{cases:{[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}},"\\{":{cases:{"$S2==gt":{token:"@brackets",next:e("@inParen__id__.gt")},"@default":{token:"@brackets",next:e("@inParen__id__.plain")}}},"\\}":{cases:{...n.id==="bracket"?{}:{"$S2==interpolation":{token:"@brackets.interpolation",next:"@popall"}},[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}}}}],[/\$\{/,{token:"delimiter.invalid"}]],[e("blank_and_expression_comment_token__id__")]:[[/(?:@blank)+/,{token:""}],[/[<\[][#!]--/,{token:"comment",next:e("@expressionComment__id__")}]],[e("directive_end_token__id__")]:[[/>/,t.id==="bracket"?{token:"operators"}:{token:"@brackets.directive",next:"@popall"}],[o(/(\/)(@close__id__)/),[{token:"delimiter.directive"},{token:"@brackets.directive",next:"@popall"}]]],[e("greater_operators_token__id__")]:[[/>/,{token:"operators"}],[/>=/,{token:"operators"}]],[e("no_space_expression_end_token__id__")]:[[/(?:@blank)+/,{token:"",switchTo:e("@fmExpression__id__.directive")}]],[e("unified_call_token__id__")]:[[/(@id)((?:@blank)+)/,[{token:"tag"},{token:"",next:e("@fmExpression__id__.directive")}]],[o(/(@id)(\/?)(@close__id__)/),[{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive",next:"@popall"}]],[/./,{token:"@rematch",next:e("@noSpaceExpression__id__")}]],[e("no_parse_token__id__")]:[[o(/(@open__id__)(\/#?)([a-zA-Z]+)((?:@blank)*)(@close__id__)/),{cases:{"$S2==$3":[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:""},{token:"@brackets.directive",next:"@popall"}],"$S2==comment":[{token:"comment"},{token:"comment"},{token:"comment"},{token:"comment"},{token:"comment"}],"@default":[{token:"source"},{token:"source"},{token:"source"},{token:"source"},{token:"source"}]}}],[/[^<\[\-]+|[<\[\-]/,{cases:{"$S2==comment":{token:"comment"},"@default":{token:"source"}}}]],[e("expression_comment_token__id__")]:[[/--[>\]]/,{token:"comment",next:"@pop"}],[/[^\->\]]+|[>\]\-]/,{token:"comment"}]],[e("terse_comment_token__id__")]:[[o(/--(?:@close__id__)/),{token:"comment",next:"@popall"}],[/[^<\[\-]+|[<\[\-]/,{token:"comment"}]]}}}function A(t){const n=i(a,t),_=i(u,t),e=i(D,t);return{...n,..._,...e,unicode:!0,includeLF:!1,start:`default_auto_${t.id}`,ignoreCase:!1,defaultToken:"invalid",tokenPostfix:".freemarker2",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{...n.tokenizer,..._.tokenizer,...e.tokenizer}}}var w={conf:l(a),language:i(a,k)},T={conf:l(u),language:i(u,k)},h={conf:l(a),language:i(a,p)},S={conf:l(u),language:i(u,p)},P={conf:g(),language:A(k)},y={conf:g(),language:A(p)};export{h as TagAngleInterpolationBracket,w as TagAngleInterpolationDollar,y as TagAutoInterpolationBracket,P as TagAutoInterpolationDollar,S as TagBracketInterpolationBracket,T as TagBracketInterpolationDollar};
@@ -1 +1 @@
1
- import{m as i}from"./monacoSetup-BIbZ_vQb.js";import"./index-DGsVifiB.js";var l=Object.defineProperty,s=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,c=Object.prototype.hasOwnProperty,p=(t,e,r,m)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of d(e))!c.call(t,n)&&n!==r&&l(t,n,{get:()=>e[n],enumerable:!(m=s(e,n))||m.enumerable});return t},h=(t,e,r)=>(p(t,e,"default"),r),a={};h(a,i);var o=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],y={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["{{!--","--}}"]},brackets:[["<!--","-->"],["<",">"],["{{","}}"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${o.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:a.languages.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${o.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:a.languages.IndentAction.Indent}}]},k={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/\{\{!--/,"comment.block.start.handlebars","@commentBlock"],[/\{\{!/,"comment.start.handlebars","@comment"],[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.root"}],[/<!DOCTYPE/,"metatag.html","@doctype"],[/<!--/,"comment.html","@commentHtml"],[/(<)(\w+)(\/>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)(\w+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/</,"delimiter.html"],[/\{/,"delimiter.html"],[/[^<{]+/]],doctype:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/[^>]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/\}\}/,"comment.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentBlock:[[/--\}\}/,"comment.block.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentHtml:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],handlebarsInSimpleState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3"}],{include:"handlebarsRoot"}],handlebarsInEmbeddedState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"handlebarsRoot"}],handlebarsRoot:[[/"[^"]*"/,"string.handlebars"],[/[#/][^\s}]+/,"keyword.helper.handlebars"],[/else\b/,"keyword.helper.handlebars"],[/[\s]+/],[/[^}]/,"variable.parameter.handlebars"]]}};export{y as conf,k as language};
1
+ import{m as i}from"./monacoSetup-DObeMDBe.js";import"./index-D0g0tm7R.js";var l=Object.defineProperty,s=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,c=Object.prototype.hasOwnProperty,p=(t,e,r,m)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of d(e))!c.call(t,n)&&n!==r&&l(t,n,{get:()=>e[n],enumerable:!(m=s(e,n))||m.enumerable});return t},h=(t,e,r)=>(p(t,e,"default"),r),a={};h(a,i);var o=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],y={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["{{!--","--}}"]},brackets:[["<!--","-->"],["<",">"],["{{","}}"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${o.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:a.languages.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${o.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:a.languages.IndentAction.Indent}}]},k={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/\{\{!--/,"comment.block.start.handlebars","@commentBlock"],[/\{\{!/,"comment.start.handlebars","@comment"],[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.root"}],[/<!DOCTYPE/,"metatag.html","@doctype"],[/<!--/,"comment.html","@commentHtml"],[/(<)(\w+)(\/>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)(\w+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/</,"delimiter.html"],[/\{/,"delimiter.html"],[/[^<{]+/]],doctype:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/[^>]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/\}\}/,"comment.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentBlock:[[/--\}\}/,"comment.block.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentHtml:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],handlebarsInSimpleState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3"}],{include:"handlebarsRoot"}],handlebarsInEmbeddedState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"handlebarsRoot"}],handlebarsRoot:[[/"[^"]*"/,"string.handlebars"],[/[#/][^\s}]+/,"keyword.helper.handlebars"],[/else\b/,"keyword.helper.handlebars"],[/[\s]+/],[/[^}]/,"variable.parameter.handlebars"]]}};export{y as conf,k as language};