@zealicsolutions/web-ui 1.0.140-beta.192 → 1.0.140-beta.194

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 (25) hide show
  1. package/dist/cjs/contexts/WebpageContext/WebpageContext.d.ts +37 -0
  2. package/dist/cjs/index.js +2 -2
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/esm/_virtual/index3.js +1 -1
  5. package/dist/esm/_virtual/index4.js +1 -1
  6. package/dist/esm/contexts/WebpageContext/WebpageContext.d.ts +37 -0
  7. package/dist/esm/contexts/WebpageContext/WebpageContext.js.map +1 -1
  8. package/dist/esm/contexts/WebpageContext/WebpageContextProvider.js +1 -1
  9. package/dist/esm/contexts/WebpageContext/WebpageContextProvider.js.map +1 -1
  10. package/dist/esm/molecules/Button/hooks/useButtonAction.js +1 -1
  11. package/dist/esm/molecules/Button/hooks/useButtonAction.js.map +1 -1
  12. package/dist/esm/node_modules/@mui/material/esm/Accordion/Accordion.js +1 -1
  13. package/dist/esm/node_modules/@mui/material/esm/Menu/Menu.js +1 -1
  14. package/dist/esm/node_modules/@mui/material/esm/MenuList/MenuList.js +1 -1
  15. package/dist/esm/node_modules/@mui/material/esm/Select/SelectInput.js +1 -1
  16. package/dist/esm/node_modules/@mui/material/esm/SpeedDial/SpeedDial.js +1 -1
  17. package/dist/esm/node_modules/@mui/material/esm/Tabs/Tabs.js +1 -1
  18. package/dist/esm/node_modules/@mui/material/esm/ToggleButtonGroup/ToggleButtonGroup.js +1 -1
  19. package/dist/esm/node_modules/@mui/material/node_modules/react-is/index.js +1 -1
  20. package/dist/esm/node_modules/classnames/index.js +1 -1
  21. package/dist/esm/node_modules/react-slick/lib/arrows.js +1 -1
  22. package/dist/esm/node_modules/react-slick/lib/dots.js +1 -1
  23. package/dist/esm/node_modules/react-slick/lib/inner-slider.js +1 -1
  24. package/dist/esm/node_modules/react-slick/lib/track.js +1 -1
  25. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- var r={exports:{}};export{r};
1
+ var r={exports:{}};export{r as c};
2
2
  //# sourceMappingURL=index3.js.map
@@ -1,2 +1,2 @@
1
- var r={exports:{}};export{r as c};
1
+ var r={exports:{}};export{r};
2
2
  //# sourceMappingURL=index4.js.map
@@ -17,6 +17,31 @@ export type CortexRwoContextType = {
17
17
  /** Input parameters from form fields for multi-parameter actions */
18
18
  inputParams?: Record<string, unknown>;
19
19
  };
20
+ /**
21
+ * Context parameter mapping - maps agent contextKey to a source field
22
+ */
23
+ export type CortexContextParamMapping = {
24
+ /** The agent's required context key (e.g., "studyId") */
25
+ contextKey: string;
26
+ /** The source type (currently only "webpage" is supported) */
27
+ contextSource: 'webpage';
28
+ /** The source field to get the value from (e.g., "primaryRwoId") */
29
+ contextSourceField: string;
30
+ };
31
+ /**
32
+ * Cortex configuration for webpage-level AI support
33
+ * This structure is stored in webpage.config.cortexConfig
34
+ */
35
+ export type CortexConfig = {
36
+ /** The Cortex agent ID to use for this webpage */
37
+ cortexAgentId?: string;
38
+ /** Whether AI support is enabled for this webpage */
39
+ withAISupport?: boolean;
40
+ /** Context parameter mapping configuration */
41
+ contextMapping?: {
42
+ contextParams: CortexContextParamMapping[];
43
+ };
44
+ };
20
45
  export type OpenAIChatOptions = {
21
46
  /** Optional override for cortexAgentId */
22
47
  cortexAgentId?: string;
@@ -25,12 +50,24 @@ export type OpenAIChatOptions = {
25
50
  * This is populated by the button action based on sourceDataModelFieldId.
26
51
  */
27
52
  cortexRwoContext?: CortexRwoContextType;
53
+ /**
54
+ * Input parameters resolved from the button's organism context.
55
+ * These are merged with webpage-level context in CortexProvider.
56
+ */
57
+ inputParams?: Record<string, unknown>;
28
58
  };
29
59
  export type WebpageContextType = {
30
60
  webpageId?: string;
31
61
  webpageName?: string;
62
+ /** @deprecated Use cortexConfig.withAISupport instead */
32
63
  withAISupport?: boolean;
64
+ /** @deprecated Use cortexConfig.cortexAgentId instead */
33
65
  cortexAgentId?: string;
66
+ /**
67
+ * Cortex configuration including agent ID, AI support flag, and context mapping.
68
+ * This is the new structure that replaces legacy withAISupport and cortexAgentId.
69
+ */
70
+ cortexConfig?: CortexConfig;
34
71
  /**
35
72
  * Current RWO context for the webpage.
36
73
  * Includes rwoRecordId from URL when present.
@@ -1 +1 @@
1
- {"version":3,"file":"WebpageContext.js","sources":["../../../../../src/contexts/WebpageContext/WebpageContext.ts"],"sourcesContent":[null],"names":["WebpageContext","createContext","undefined"],"mappings":"4CAsDaA,EAAiBC,OAA8CC"}
1
+ {"version":3,"file":"WebpageContext.js","sources":["../../../../../src/contexts/WebpageContext/WebpageContext.ts"],"sourcesContent":[null],"names":["WebpageContext","createContext","undefined"],"mappings":"4CA6FaA,EAAiBC,OAA8CC"}
@@ -1,2 +1,2 @@
1
- import{jsx as e}from"../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js";import{useMemo as t}from"react";import{WebpageContext as o}from"./WebpageContext.js";const r=({children:r,webpageId:a,webpageName:i,withAISupport:n,cortexAgentId:p,rwoContext:m,isAIAvailable:s,openAIChat:d})=>{const A=t(()=>({webpageId:a,webpageName:i,withAISupport:n,cortexAgentId:p,rwoContext:m,isAIAvailable:s,openAIChat:d}),[a,i,n,p,m,s,d]);return e(o.Provider,{value:A,children:r})};export{r as WebpageContextProvider};
1
+ import{jsx as e}from"../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js";import{useMemo as t}from"react";import{WebpageContext as o}from"./WebpageContext.js";const r=({children:r,webpageId:i,webpageName:n,withAISupport:a,cortexAgentId:p,cortexConfig:m,rwoContext:c,isAIAvailable:s,openAIChat:d})=>{const x=t(()=>({webpageId:i,webpageName:n,withAISupport:a,cortexAgentId:p,cortexConfig:m,rwoContext:c,isAIAvailable:s,openAIChat:d}),[i,n,a,p,m,c,s,d]);return e(o.Provider,{value:x,children:r})};export{r as WebpageContextProvider};
2
2
  //# sourceMappingURL=WebpageContextProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WebpageContextProvider.js","sources":["../../../../../src/contexts/WebpageContext/WebpageContextProvider.tsx"],"sourcesContent":[null],"names":["WebpageContextProvider","children","webpageId","webpageName","withAISupport","cortexAgentId","rwoContext","isAIAvailable","openAIChat","value","useMemo","_jsx","WebpageContext","Provider"],"mappings":"qMASaA,EAA0D,EACrEC,WACAC,YACAC,cACAC,gBACAC,gBACAC,aACAC,gBACAC,iBAEA,MAAMC,EAAQC,EACZ,KAAO,CACLR,YACAC,cACAC,gBACAC,gBACAC,aACAC,gBACAC,eAEF,CAACN,EAAWC,EAAaC,EAAeC,EAAeC,EAAYC,EAAeC,IAGpF,OAAOG,EAACC,EAAeC,SAAQ,CAACJ,MAAOA,EAAKR,SAAGA"}
1
+ {"version":3,"file":"WebpageContextProvider.js","sources":["../../../../../src/contexts/WebpageContext/WebpageContextProvider.tsx"],"sourcesContent":[null],"names":["WebpageContextProvider","children","webpageId","webpageName","withAISupport","cortexAgentId","cortexConfig","rwoContext","isAIAvailable","openAIChat","value","useMemo","_jsx","WebpageContext","Provider"],"mappings":"+LASa,MAAAA,EAA0D,EACrEC,WACAC,YACAC,cACAC,gBACAC,gBACAC,eACAC,aACAC,gBACAC,iBAEA,MAAMC,EAAQC,EACZ,KAAO,CACLT,YACAC,cACAC,gBACAC,gBACAC,eACAC,aACAC,gBACAC,eAEF,CAACP,EAAWC,EAAaC,EAAeC,EAAeC,EAAcC,EAAYC,EAAeC,IAGlG,OAAOG,EAACC,EAAeC,SAAQ,CAACJ,MAAOA,EAAKT,SAAGA"}
@@ -1,2 +1,2 @@
1
- import{getDataByPath as t}from"../../../containers/utils/dataPathUtils.js";import"../../../contexts/AccountButtonContext/AccountButtonContext.js";import"react/jsx-runtime";import"../../../node_modules/@emotion/react/dist/emotion-element-d59e098f.esm.js";import{useState as e,useMemo as o,useContext as r,useCallback as n}from"react";import"../../../node_modules/stylis/dist/umd/stylis.js";import"../../../node_modules/@babel/runtime/helpers/extends.js";import"../../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js";import"../../../contexts/ApiContext/ApiContext.js";import{useContainerRuntime as i}from"../../../contexts/ContainerRuntimeContext/ContainerRuntimeContext.js";import"../../../contexts/FormStepContext/FormStepContext.js";import{useFormContext as a}from"../../../node_modules/react-hook-form/dist/index.esm.mjs.js";import"../../../contexts/LayoutContext/LayoutContext.js";import"../../../theme/theme.js";import"../../../theme/provider.js";import"../../../theme/toastStyles.js";import"../../../contexts/MlrRichTextViewerContext/MlrRichTextViewerContext.js";import"../../../contexts/OrganismContext/OrganismContext.js";import{useOrganismContext as s}from"../../../contexts/OrganismContext/useOrganismContext.js";import"../../../contexts/PopupContext/PopupContext.js";import{usePopupContext as c}from"../../../contexts/PopupContext/usePopupContext.js";import{useReplicatorForm as d}from"../../../contexts/ReplicatorFormContext/ReplicatorFormContext.js";import{useReplicatorRegistry as l}from"../../../contexts/ReplicatorRegistryContext/ReplicatorRegistryContext.js";import"../../../contexts/StateContext/StateContext.js";import{useStateContext as f}from"../../../contexts/StateContext/useStateContext.js";import{WebpageContext as u}from"../../../contexts/WebpageContext/WebpageContext.js";import{useSubmitForm as g}from"../../../contexts/ApiContext/globalQueries/form/useSubmitForm.js";import{encodeObjectToBase64Url as m,getByPath as p,composeRwoParamsV2 as w}from"../../../helpers/rwoContext.js";import{checkIsDataDrivenLink as h,resolveDataDrivenLink as y,navigateToExternalLink as I,checkIsInternalLink as v,downloadFile as x}from"../../../helpers/utils.js";const b=t=>{if(null==t)return t;if("object"==typeof t&&null!==t){const e=t;if("id"in e&&null!==e.id&&void 0!==e.id)return e.id;if("value"in e&&null!==e.value&&void 0!==e.value)return e.value}return t},k=t=>{if(null==t)return;const e=b(t);return"string"==typeof e||"number"==typeof e||"boolean"==typeof e?String(e):void 0},C=t=>{if(null==t)return;const e=b(t);return"string"==typeof e||"number"==typeof e||"boolean"==typeof e?String(e):void 0},_=t=>t&&"object"==typeof t?Object.entries(t).reduce((t,[e,o])=>{const r=C(o);return void 0!==r&&(t[e]=r),t},{}):{},F=t=>{if(null==t)return{value:t};if("object"==typeof t&&null!==t){const e=t;if("id"in e||"value"in e)return{...e}}return{value:t}},R=(t,e)=>{const o=Object.keys(e);if(0===o.length)return!1;if(o.some(o=>void 0!==t[o]&&JSON.stringify(t[o])===JSON.stringify(e[o])))return!0;for(const r of Object.values(t))if(Array.isArray(r))for(const t of r)if(t&&"object"==typeof t){const r=t;if(o.some(t=>void 0!==r[t]&&JSON.stringify(r[t])===JSON.stringify(e[t])))return!0}return!1},j=(t,e)=>{if(0!==Object.keys(e).length)for(let o=0;o<t.length;o+=1){const r=t[o];if(r&&"object"==typeof r&&R(r,e))return o}},A=(R,A={})=>{const{properties:S,moleculeId:P,onClick:O,disabled:D}=R,{onActionStart:E,onActionComplete:L,onActionError:T,onAllActionsComplete:N,stopOnError:M=!0,executeAsync:V=!0}=A,[B,W]=e(!1),[q,U]=e(-1),[$,J]=e([]),[K,H]=e(null),Q=o(()=>{const t=S?.action,e=t?.action,o=e||t;return o?Array.isArray(o)?o:o&&"object"==typeof o&&"type"in o?[o]:[]:[]},[S?.action]),{setActivePopup:z,clearActivePopup:G}=c(),X=a()||{},Y=s?.()||{},Z=i?.()||{},tt=f?.()||{},et=d(),ot=l(),rt=r(u),{onInternalNavigation:nt,formId:it,routing:at,submitHandler:st,localState:ct,localStateObject:dt,organismInfo:lt,prefillData:ft}=Y,{submitForm:ut}=g()||{},gt=n(async t=>{if(!t.link)throw new Error("Link configuration missing");if(h(t.link)){const e={};if(Z?.rawItemDataByDmfId&&Object.assign(e,Z.rawItemDataByDmfId),X&&"function"==typeof X.getValues){const t=X.getValues();Object.keys(t).forEach(o=>{o in e||(e[o]=t[o])})}const o=dt?.data;o&&Object.keys(o).forEach(t=>{t in e||(e[t]=o[t])}),dt&&Object.keys(dt).forEach(t=>{t in e||(e[t]=dt[t])}),tt?.stateConfig&&Object.keys(tt.stateConfig).forEach(t=>{t in e||(e[t]=tt.stateConfig[t])});const r=y(t.link,e);if(!r)return;if(r.isExternal)I(r.destination);else{let t;if(r.recordId){const e={rwoRecordId:r.recordId};t={rwoContext:m(e)}}nt?.({link:r.destination,webpageAlias:r.webpageAlias,query:t})}return}if(v(t.link)){const e={};return t.link?.targetFormId&&(e.organismId=String(t.link?.targetFormId)),t.link?.rwoKey&&(e.rwo=String(t.link?.rwoKey)),void nt?.({link:t.link.internalLink||"",query:e})}I(t.link.externalLink||"")},[Z,X,dt,tt,nt]),mt=n(async t=>{if(!t.download)throw new Error("Download configuration missing");x(t.download.url,t.download.name)},[]),pt=n(t=>{const e=t?.open_popup,o=e?.organismId;if(!o)throw new Error("Popup configuration missing");z?.({id:o})},[z]),wt=n(async t=>{if(!X?.handleSubmit)throw new Error("Form context not available for submit action");const e=(it??"").toString();if(!e)throw new Error("Form ID missing in OrganismContext for submit action");let o,r=at?.rwoRecordIdFromUrl;if(!r)try{const t=new URLSearchParams(window.location.search),o=t.get("rwoContext"),n=t.get("selectedWebpageId");if(o&&n){const t=JSON.parse(atob(o))[n];if(t){const o=t[e];o?.rwoRecordId?r=o.rwoRecordId:t.rwoRecordId&&(r=t.rwoRecordId)}}}catch{}return await X.handleSubmit(async n=>{const i={formId:e,data:n};let a;r&&(i.rwoRecordId=r);try{if(st)a=await st(i);else{if(!ut)return;a=await ut(i)}}catch(d){const e=t.submit?.onError?.link;if(e&&e.internalLink)if(v(e)){const t={};e?.rwoKey&&(t.rwo=String(e?.rwoKey)),nt?.({link:e.internalLink||"",query:t})}else I(e.externalLink||"");throw d}o=a;const s=tt?.stateHandler;"function"==typeof s&&e&&s({[e]:{interacted:"completed"}});const c=t?.submit?.onSuccess?.link;if(c&&(c.internalLink||c.externalLink))if(v(c)){const t={};c?.rwoKey&&(t.rwo=String(c?.rwoKey)),nt?.({link:c.internalLink||"",query:t})}else I(c.externalLink||"");return X?.reset?.(),a},async t=>{throw new Error("Form validation failed")})(),o},[X,ut,nt,it,at]),ht=n(async(e,o)=>{const r=kt(e,o);if(!r)throw new Error(`Navigation configuration missing for ${o}`);switch(o){case"navigateToCreateForm":if(r.targetFormId){const t=`?organismId=${r.targetFormId}`;nt?.({link:t})}break;case"navigateToEditForm":if(r.targetFormId){const t=(()=>{try{return new URLSearchParams(window.location.search).get("selectedWebpageId")||void 0}catch{return}})(),e=r?.link,o=e?.internalLink||`?organismId=${r.targetFormId}`,n=t=>{const e=t.match(/webpageId=([^/&#?]+)/);return e?e[1]:void 0},i=e?.internalLink?n(e.internalLink):void 0,a=t&&i===t,s=r?.inputParams,c=X&&"function"==typeof X.getValues?X.getValues():{},d=Z?.rawItemDataByDmfId||{},l=dt?.data,f={};let u;if(s&&s.length>0)s.forEach(t=>{let e;if(void 0===e&&void 0!==d[t.sourceFieldId]&&(e=d[t.sourceFieldId]),void 0===e&&void 0!==c[t.sourceFieldId]&&(e=c[t.sourceFieldId]),void 0===e&&l&&void 0!==l[t.sourceFieldId]&&(e=l[t.sourceFieldId]),void 0===e&&dt){const o=p(dt,t.sourceFieldId);void 0!==o&&(e=o)}if(void 0===e&&tt?.stateConfig){const o=p(tt.stateConfig,t.sourceFieldId);void 0!==o&&(e=o)}if(null!=e&&""!==e){const o=b(e);f[t.sourceFieldId]=o,!u&&o&&(u=String(o))}});else{const t=at?.rwoRecordIdFromUrl;u=t||(lt&&lt.id?String(lt.id):void 0)}u&&(f.rwoRecordId=u);const g={};if(Object.keys(f).length>0){const e=(()=>{try{const t=new URLSearchParams(window.location.search).get("rwoContext");return t?JSON.parse(atob(t)):{}}catch{return{}}})(),o=i||t;let n;if(o){const t=e[o]||{};n={...e,[o]:{...t,...t.rwoRecordId?{}:{rwoRecordId:u},[r.targetFormId]:f}}}else n={...e,...e.rwoRecordId?{}:{rwoRecordId:u},[r.targetFormId]:f};g.rwoContext=btoa(JSON.stringify(n))}if(a){const t=window.location.pathname+window.location.search;nt?.({link:t,query:g})}else nt?.({link:o,query:g})}break;case"navigateToPrepopulateForm":{const e=r?.link?.internalLink||"",{targetFormId:o}=r||{};if(!o&&!e)break;const n=Array.isArray(r?.fieldMap)?r.fieldMap:[],i=(()=>{try{return new URLSearchParams(window.location.search).get("selectedWebpageId")||void 0}catch{return}})(),a=e?(t=>{const e=t.match(/webpageId=([^/&#?]+)/);return e?e[1]:void 0})(e):void 0,s=i&&a===i,c=Z?.rawItemDataByDmfId||{},d=Z?.nestedPathSegments||[],l=Z?.itemIndex,f=(()=>{const t=dt?.data;if(t&&Object.keys(t).length>0)return t;if(ct&&"object"==typeof ct&&Object.keys(ct).length>0)return ct;if(dt&&"object"==typeof dt){const t=dt;if(Object.values(t).some(t=>Array.isArray(t)))return t}return{}})(),u=X&&"function"==typeof X.getValues?X.getValues():{},g=new Map;n.forEach(t=>{t.sourceParent&&g.set(t.source,t.sourceParent)});const m=(t=>{const e=new Map;return t.forEach(t=>{const o=`${t.sourceParent||"root"}:${t.destinationParent||"root"}`;e.has(o)||e.set(o,{sourceParent:t.sourceParent,destinationParent:t.destinationParent,mappings:[]}),e.get(o).mappings.push(t)}),Array.from(e.values())})(n),p=((t,e)=>{const o={},r=new Set;return t.filter(t=>t.sourceParent&&t.destinationParent).forEach(t=>{t.destinationParent&&r.add(t.destinationParent)}),t.filter(t=>!t.destinationParent).forEach(t=>{t.mappings.forEach(t=>{if(r.has(t.destination))return;const n=e(t.source);void 0!==n&&(Array.isArray(n)?o[t.destination]=n:o[t.destination]=F(n))})}),t.filter(t=>t.sourceParent&&t.destinationParent).forEach(t=>{const r=e(t.sourceParent);if(!Array.isArray(r))return;const n=r.map(e=>{const o={},r=e;return t.mappings.forEach(t=>{const e=r[t.source];void 0!==e&&(o[t.destination]=F(e))}),o});o[t.destinationParent]=n}),o})(m,e=>((e,o,r,n,i,a,s)=>{if(void 0!==r[e])return r[e];if(o){const a=n[o];if(Array.isArray(a)){if(Object.keys(r).length>0){const t=j(a,r);if(void 0!==t){const o=a[t];if(void 0!==o[e])return o[e]}}if(i.length>0&&i[0].dmfId===o){const t=i[0].index;if(void 0!==t&&t<a.length){const o=a[t];if(o&&void 0!==o[e])return o[e]}}if(void 0!==s&&s<a.length){const t=i[i.length-1];if(!t||t.dmfId===o){const t=a[s];if(t&&void 0!==t[e])return t[e]}}const c=i.findIndex(t=>t.dmfId===o);if(c>=0){const o=i.slice(0,c+1),r=t(n,o);if(r&&void 0!==r[e])return r[e]}}}for(let c=i.length-1;c>=0;c-=1){const o=i[c],a=n[o.dmfId];if(Array.isArray(a)){if(Object.keys(r).length>0){const t=j(a,r);if(void 0!==t){const o=a[t];if(void 0!==o[e])return o[e]}}const t=o.index;if(void 0!==t&&t<a.length){const o=a[t];if(o&&void 0!==o[e])return o[e]}}else{const o=i.slice(0,c+1),r=t(n,o);if(r&&void 0!==r[e])return r[e]}}return void 0!==n[e]?n[e]:void 0!==a[e]?a[e]:void 0})(e,g.get(e),c,f,d,u,l)),w=(()=>{try{const t=new URLSearchParams(window.location.search).get("rwoContext");return t?JSON.parse(atob(t)):{}}catch{return{}}})(),h={};if(Object.keys(p).length>0&&o){const t=a||i;let e;if(t){const r=w[t]||{},n=r[o]||{};e={...w,[t]:{...r,[o]:{...n,prefillData:p}}}}else e={...w,[o]:{prefillData:p}};h.rwoContext=btoa(JSON.stringify(e))}if(s){const t=window.location.pathname+window.location.search;nt?.({link:t,query:Object.keys(h).length>0?h:void 0,state:{prefill:p,targetFormId:o}})}else{const t=e||`?organismId=${encodeURIComponent(String(o||""))}`;nt?.({link:t,query:Object.keys(h).length>0?h:void 0,state:{prefill:p,targetFormId:o}})}}break;case"navigateToOrganismWithRwoContext":{const t=r?.sourceDataModelFieldId,e=r?.targetOrganismIds,o=r?.inputParams;if(!Array.isArray(e)||0===e.length)break;const n=(()=>{try{return new URLSearchParams(window.location.search).get("selectedWebpageId")||void 0}catch{return}})(),i=X&&"function"==typeof X.getValues?X.getValues():{},a=Z?.rawItemDataByDmfId||{},s=(()=>{try{const t=new URLSearchParams(window.location.search).get("rwoContext");return t?JSON.parse(atob(t)):{}}catch{return{}}})(),c={};let d,l;if(o&&o.length>0){const t=dt?.data;o.forEach(e=>{let o;if(void 0===o&&void 0!==a[e.sourceFieldId]&&(o=a[e.sourceFieldId]),void 0===o&&void 0!==i[e.sourceFieldId]&&(o=i[e.sourceFieldId]),void 0===o&&t&&void 0!==t[e.sourceFieldId]&&(o=t[e.sourceFieldId]),void 0===o&&dt){const t=p(dt,e.sourceFieldId);void 0!==t&&(o=t)}if(void 0===o&&tt?.stateConfig){const t=p(tt.stateConfig,e.sourceFieldId);void 0!==t&&(o=t)}if(null!=o&&""!==o){const t=b(o);c[e.sourceFieldId]=t,!d&&t&&(d=String(t))}}),d&&(c.rwoRecordId=d)}else if(t){let e;if(!e&&Z?.rawItemDataByDmfId){const o=Z.rawItemDataByDmfId[t];e=C(o)}if(!e&&X&&"function"==typeof X.getValues){const o=p(X.getValues(),t);e=k(o)}if(!e&&dt){const o=dt?.data;if(o&&void 0!==o[t]){const r=o[t];e=C(r)}if(!e){const o=p(dt,t);e=C(o)}}if(!e&&tt?.stateConfig){const o=p(tt.stateConfig,t);e=C(o)}if(!e&&n){const t=s[n]||{};"string"==typeof t.rwoRecordId&&(e=t.rwoRecordId)}e&&(d=e,c.rwoRecordId=String(e),c[String(t)]=String(e))}if(n){const t=s[n]||{},o={...t};d&&!t.rwoRecordId&&(o.rwoRecordId=d),e.forEach(e=>{const r=t[e]||{};o[e]={...r,...c}}),l={...s,[n]:o}}else l={...s},d&&!s.rwoRecordId&&(l.rwoRecordId=d),e.forEach(t=>{const e=s[t]||{};l[t]={...e,...c}});const f={};(Object.keys(c).length>0||void 0!==d)&&(f.rwoContext=btoa(JSON.stringify(l)));const u=window.location.pathname+window.location.search;nt?.({link:u,query:f})}break;case"navigateToPageWithRwoContext":{const t=r?.link,e=!1!==r?.includeRwoRecordId,o=Array.isArray(r?.rwoContextMapping)?r.rwoContextMapping:[];if(!t?.internalLink)break;const n=(t=>{const e=t.match(/webpageId=([^/&#?]+)/);return e?e[1]:void 0})(t.internalLink),i=r?.sourceDataModelFieldId,a=X&&"function"==typeof X.getValues?X.getValues():{};let s=at?.rwoRecordIdFromUrl;if(i){if(!s&&Z?.rawItemDataByDmfId){const t=Z.rawItemDataByDmfId[i];s=C(t)}if(!s){const t=p(a,i);s=k(t)}if(!s&&dt){const t=p(dt,i);s=C(t)}if(!s&&tt?.stateConfig){const t=p(tt.stateConfig,i);s=C(t)}s||(s=String(i))}const c=_(dt?.data),d=_(ct),l=_(Z?.itemDataByDmfId),f=_(Z?.rawItemDataByDmfId),u=[tt?.stateConfig,dt,ct,a,d,l,f,c].reduce((t,e)=>(e&&"object"==typeof e&&Object.assign(t,e),t),{}),{query:g}=w({selectedWebpageId:n,includeRwoRecordId:e,recordId:s,mapping:o,contextSource:u});nt?.({link:t.internalLink,query:g})}}},[nt,X,ct,dt,lt,at]),yt=n(t=>{X?.reset?.()},[X]),It=n(t=>{X?.reset?.(),"function"==typeof G?G():"function"==typeof z&&z(null)},[X,G,z]),vt=n(t=>{const e=t?.add_replicator||{},o=e.targetReplicatorFieldId;let r,n,i,a;if(o&&ot){const t=ot.getReplicator(o);if(!t)return void console.error(`[add_replicator] Replicator "${o}" not found in registry. Make sure the replicator container is rendered and has the correct replicatorFieldId.`);r=o,n=ot.canAdd(o),i=t=>ot.append(o,t),a=t.fieldArrayMethods.fields.length}else{if(!et)return void console.error("[add_replicator] No target replicator available. Either:\n1. Configure targetReplicatorFieldId in the button action, or\n2. Place the button inside a replicator container.");r=et.replicatorFieldId,n=et.canAdd,i=et.fieldArrayMethods.append,a=et.fieldArrayMethods.fields.length}if(n&&(i({}),!1!==e.scrollToNew)){const t=`[data-replicator-instance="${r}-${a}"]`,e=(o=3)=>{requestAnimationFrame(()=>{setTimeout(()=>{const r=document.querySelector(t);r?r.scrollIntoView({behavior:"smooth",block:"nearest"}):o>0&&e(o-1)},50)})};e()}},[et,ot]),xt=n(t=>{const e=(t?.delete_replicator||{}).targetReplicatorFieldId;let o,r,n,i,a;if(e&&ot){const t=ot.getReplicator(e);if(!t)return void console.error(`[delete_replicator] Replicator "${e}" not found in registry. Make sure the replicator container is rendered and has the correct replicatorFieldId.`);o=e,r=ot.canRemove(e),n=t=>ot.remove(e,t),i=t.fieldArrayMethods.fields.length}else{if(!et)return void console.error("[delete_replicator] No target replicator available. Either:\n1. Configure targetReplicatorFieldId in the button action, or\n2. Place the button inside a replicator container.");o=et.replicatorFieldId,r=et.canRemove,n=et.fieldArrayMethods.remove,i=et.fieldArrayMethods.fields.length}r&&(a=void 0===Z?.itemIndex||e?i-1:Z.itemIndex,a<0||a>=i?console.error(`[delete_replicator] Invalid index ${a} (length: ${i})`):n(a))},[et,ot,Z]),bt=n(async t=>{if(!rt?.openAIChat)return;if(rt.isAIAvailable&&!rt.isAIAvailable())return;const e=t?.open_ai_chat||t?.openAIChat||{},o=e?.inputParams,r=e?.cortexAgentId,n=X&&"function"==typeof X.getValues?X.getValues():{},i=Z?.rawItemDataByDmfId||{},a={};if(o&&o.length>0)o.forEach(t=>{const e=n[t.sourceFieldId]??i[t.sourceFieldId];null!=e&&(a[t.sourceFieldId]=b(e))});else{const t=e?.cortexRwoContext?.sourceDataModelFieldId;if(t){let e;if(!e&&Z?.rawItemDataByDmfId){const o=Z.rawItemDataByDmfId[t];e=C(o)}if(!e&&X&&"function"==typeof X.getValues){const o=p(X.getValues(),t);e=k(o)}if(!e&&dt){const o=p(dt,t);e=C(o)}if(!e&&tt?.stateConfig){const o=p(tt.stateConfig,t);e=C(o)}e&&(a.rwoRecordId=e,a.sourceDataModelFieldId=t)}}const s=Object.keys(a).length>0?{inputParams:a}:void 0;await rt.openAIChat({cortexAgentId:r,cortexRwoContext:s})},[rt,X,dt,Z,tt]),kt=n((t,e)=>{switch(e){case"navigateToCreateForm":return t.navigateToCreateForm||t.navigate_to_create_form||null;case"navigateToEditForm":return t.navigateToEditForm||t.navigate_to_edit_form||null;case"navigateToPrepopulateForm":return t.navigateToPrepopulateForm||t.navigate_to_prepopulate_form||null;case"navigateToOrganismWithRwoContext":return t.navigateToOrganismWithRwoContext||t.navigate_to_organism_with_rwo_context||null;case"navigateToPageWithRwoContext":return t.navigateToPageWithRwoContext||t.navigate_to_page_with_rwo_context||null;default:return null}},[]),Ct=n(async(t,e)=>{E?.(t,e);try{let o;switch(t.type){case"link":await gt(t),o="Link executed";break;case"download":await mt(t),o="Download executed";break;case"submit":o=await wt(t);break;case"open_popup":pt(t),o="Popup opened";break;case"navigate_to_create_form":await ht(t,"navigateToCreateForm"),o="Navigation executed";break;case"navigate_to_edit_form":await ht(t,"navigateToEditForm"),o="Navigation executed";break;case"navigate_to_prepopulate_form":await ht(t,"navigateToPrepopulateForm"),o="Navigation executed";break;case"navigate_to_organism_with_rwo_context":await ht(t,"navigateToOrganismWithRwoContext"),o="Navigation executed";break;case"navigate_to_page_with_rwo_context":await ht(t,"navigateToPageWithRwoContext"),o="Navigation executed";break;case"reset":yt(t),o="Reset executed";break;case"destroy":It(t),o="Destroy executed";break;case"open_ai_chat":await bt(t),o="AI Chat opened";break;case"add_replicator":vt(t),o="Replicator instance added";break;case"delete_replicator":xt(t),o="Replicator instance deleted";break;default:throw new Error(`Unsupported action type: ${t.type}`)}return L?.(t,e,o),o}catch(o){const r=o instanceof Error?o:new Error(String(o));if(T?.(t,e,r),M)throw r;return null}},[E,L,T,M,gt,mt,wt,pt,ht,yt,It,bt,vt,xt]),_t=n(async()=>{if(0===Q.length)return[];W(!0),U(0),J([]),H(null);try{const t=Q.some(t=>"submit"===t?.type),e=new Set(["link","navigate_to_create_form","navigate_to_edit_form","navigate_to_prepopulate_form","navigate_to_organism_with_rwo_context","navigate_to_page_with_rwo_context"]),o=t=>"close"===t||"destroy"===t,r=(()=>{if(!t)return Q;return[...Q.filter(t=>t&&"submit"!==t.type&&!e.has(t.type)&&!o(t.type)),...Q.filter(t=>t&&"submit"===t.type),...Q.filter(t=>t&&o(t.type)),...Q.filter(t=>t&&e.has(t.type))]})(),n=[];for(let i=0;i<r.length;i+=1){U(i);const t=await Ct(r[i],i);n.push(t),J([...n])}return N?.(n),n}catch(t){const e=t instanceof Error?t:new Error(String(t));throw H(e),e}finally{W(!1),U(-1)}},[Q,Ct,N,V,M]),Ft=n(t=>{D||(O?O(t):Q.length>0&&_t().catch(()=>{}))},[D,P,O,Q,_t]);return{executeActions:_t,handleAction:Ft,isExecuting:B,currentActionIndex:q,results:$,error:K}};export{A as useButtonAction};
1
+ import{getDataByPath as e}from"../../../containers/utils/dataPathUtils.js";import"../../../contexts/AccountButtonContext/AccountButtonContext.js";import"react/jsx-runtime";import"../../../node_modules/@emotion/react/dist/emotion-element-d59e098f.esm.js";import{useState as t,useMemo as o,useContext as r,useCallback as n}from"react";import"../../../node_modules/stylis/dist/umd/stylis.js";import"../../../node_modules/@babel/runtime/helpers/extends.js";import"../../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js";import"../../../contexts/ApiContext/ApiContext.js";import{useContainerRuntime as i}from"../../../contexts/ContainerRuntimeContext/ContainerRuntimeContext.js";import"../../../contexts/FormStepContext/FormStepContext.js";import{useFormContext as a}from"../../../node_modules/react-hook-form/dist/index.esm.mjs.js";import"../../../contexts/LayoutContext/LayoutContext.js";import"../../../theme/theme.js";import"../../../theme/provider.js";import"../../../theme/toastStyles.js";import"../../../contexts/MlrRichTextViewerContext/MlrRichTextViewerContext.js";import"../../../contexts/OrganismContext/OrganismContext.js";import{useOrganismContext as s}from"../../../contexts/OrganismContext/useOrganismContext.js";import"../../../contexts/PopupContext/PopupContext.js";import{usePopupContext as c}from"../../../contexts/PopupContext/usePopupContext.js";import{useReplicatorForm as d}from"../../../contexts/ReplicatorFormContext/ReplicatorFormContext.js";import{useReplicatorRegistry as l}from"../../../contexts/ReplicatorRegistryContext/ReplicatorRegistryContext.js";import"../../../contexts/StateContext/StateContext.js";import{useStateContext as u}from"../../../contexts/StateContext/useStateContext.js";import{WebpageContext as f}from"../../../contexts/WebpageContext/WebpageContext.js";import{useSubmitForm as g}from"../../../contexts/ApiContext/globalQueries/form/useSubmitForm.js";import{encodeObjectToBase64Url as m,getByPath as p,composeRwoParamsV2 as y}from"../../../helpers/rwoContext.js";import{checkIsDataDrivenLink as w,resolveDataDrivenLink as h,navigateToExternalLink as I,checkIsInternalLink as v,downloadFile as x}from"../../../helpers/utils.js";const b=e=>{if(null==e)return e;if("object"==typeof e&&null!==e){const t=e;if("id"in t&&null!==t.id&&void 0!==t.id)return t.id;if("value"in t&&null!==t.value&&void 0!==t.value)return t.value}return e},F=e=>{if(null==e)return;const t=b(e);return"string"==typeof t||"number"==typeof t||"boolean"==typeof t?String(t):void 0},k=e=>{if(null==e)return;const t=b(e);return"string"==typeof t||"number"==typeof t||"boolean"==typeof t?String(t):void 0},R=e=>e&&"object"==typeof e?Object.entries(e).reduce((e,[t,o])=>{const r=k(o);return void 0!==r&&(e[t]=r),e},{}):{},C=e=>{if(null==e)return{value:e};if("object"==typeof e&&null!==e){const t=e;if("id"in t||"value"in t)return{...t}}return{value:e}},_=(e,t)=>{const o=Object.keys(t);if(0===o.length)return!1;if(o.some(o=>void 0!==e[o]&&JSON.stringify(e[o])===JSON.stringify(t[o])))return!0;for(const r of Object.values(e))if(Array.isArray(r))for(const e of r)if(e&&"object"==typeof e){const r=e;if(o.some(e=>void 0!==r[e]&&JSON.stringify(r[e])===JSON.stringify(t[e])))return!0}return!1},j=(e,t)=>{if(0!==Object.keys(t).length)for(let o=0;o<e.length;o+=1){const r=e[o];if(r&&"object"==typeof r&&_(r,t))return o}},A=(_,A={})=>{const{properties:S,moleculeId:P,onClick:O,disabled:D}=_,{onActionStart:E,onActionComplete:L,onActionError:T,onAllActionsComplete:N,stopOnError:M=!0,executeAsync:V=!0}=A,[B,W]=t(!1),[U,q]=t(-1),[$,J]=t([]),[K,Y]=t(null),H=o(()=>{const e=S?.action,t=e?.action,o=t||e;return o?Array.isArray(o)?o:o&&"object"==typeof o&&"type"in o?[o]:[]:[]},[S?.action]),{setActivePopup:G,clearActivePopup:Q}=c(),z=a()||{},X=s?.()||{},Z=i?.()||{},ee=u?.()||{},te=d(),oe=l(),re=r(f),{onInternalNavigation:ne,formId:ie,routing:ae,submitHandler:se,localState:ce,localStateObject:de,organismInfo:le,prefillData:ue}=X,{submitForm:fe}=g()||{},ge=n(async e=>{if(!e.link)throw new Error("Link configuration missing");if(w(e.link)){const t={};if(Z?.rawItemDataByDmfId&&Object.assign(t,Z.rawItemDataByDmfId),z&&"function"==typeof z.getValues){const e=z.getValues();Object.keys(e).forEach(o=>{o in t||(t[o]=e[o])})}const o=de?.data;o&&Object.keys(o).forEach(e=>{e in t||(t[e]=o[e])}),de&&Object.keys(de).forEach(e=>{e in t||(t[e]=de[e])}),ee?.stateConfig&&Object.keys(ee.stateConfig).forEach(e=>{e in t||(t[e]=ee.stateConfig[e])});const r=h(e.link,t);if(!r)return;if(r.isExternal)I(r.destination);else{let e;if(r.recordId){const t={rwoRecordId:r.recordId};e={rwoContext:m(t)}}ne?.({link:r.destination,webpageAlias:r.webpageAlias,query:e})}return}if(v(e.link)){const t={};return e.link?.targetFormId&&(t.organismId=String(e.link?.targetFormId)),e.link?.rwoKey&&(t.rwo=String(e.link?.rwoKey)),void ne?.({link:e.link.internalLink||"",query:t})}I(e.link.externalLink||"")},[Z,z,de,ee,ne]),me=n(async e=>{if(!e.download)throw new Error("Download configuration missing");x(e.download.url,e.download.name)},[]),pe=n(e=>{const t=e?.open_popup,o=t?.organismId;if(!o)throw new Error("Popup configuration missing");G?.({id:o})},[G]),ye=n(async e=>{if(!z?.handleSubmit)throw new Error("Form context not available for submit action");const t=(ie??"").toString();if(!t)throw new Error("Form ID missing in OrganismContext for submit action");let o,r=ae?.rwoRecordIdFromUrl;if(!r)try{const e=new URLSearchParams(window.location.search),o=e.get("rwoContext"),n=e.get("selectedWebpageId");if(o&&n){const e=JSON.parse(atob(o))[n];if(e){const o=e[t];o?.rwoRecordId?r=o.rwoRecordId:e.rwoRecordId&&(r=e.rwoRecordId)}}}catch{}return await z.handleSubmit(async n=>{const i={formId:t,data:n};let a;r&&(i.rwoRecordId=r);try{if(se)a=await se(i);else{if(!fe)return;a=await fe(i)}}catch(d){const t=e.submit?.onError?.link;if(t&&t.internalLink)if(v(t)){const e={};t?.rwoKey&&(e.rwo=String(t?.rwoKey)),ne?.({link:t.internalLink||"",query:e})}else I(t.externalLink||"");throw d}o=a;const s=ee?.stateHandler;"function"==typeof s&&t&&s({[t]:{interacted:"completed"}});const c=e?.submit?.onSuccess?.link;if(c&&(c.internalLink||c.externalLink))if(v(c)){const e={};c?.rwoKey&&(e.rwo=String(c?.rwoKey)),ne?.({link:c.internalLink||"",query:e})}else I(c.externalLink||"");return z?.reset?.(),a},async e=>{throw new Error("Form validation failed")})(),o},[z,fe,ne,ie,ae]),we=n(async(t,o)=>{const r=Fe(t,o);if(!r)throw new Error(`Navigation configuration missing for ${o}`);switch(o){case"navigateToCreateForm":if(r.targetFormId){const e=`?organismId=${r.targetFormId}`;ne?.({link:e})}break;case"navigateToEditForm":if(r.targetFormId){const e=(()=>{try{return new URLSearchParams(window.location.search).get("selectedWebpageId")||void 0}catch{return}})(),t=r?.link,o=t?.internalLink||`?organismId=${r.targetFormId}`,n=e=>{const t=e.match(/webpageId=([^/&#?]+)/);return t?t[1]:void 0},i=t?.internalLink?n(t.internalLink):void 0,a=e&&i===e,s=r?.inputParams,c=z&&"function"==typeof z.getValues?z.getValues():{},d=Z?.rawItemDataByDmfId||{},l=de?.data,u={};let f;if(s&&s.length>0)s.forEach(e=>{let t;if(void 0===t&&void 0!==d[e.sourceFieldId]&&(t=d[e.sourceFieldId]),void 0===t&&void 0!==c[e.sourceFieldId]&&(t=c[e.sourceFieldId]),void 0===t&&l&&void 0!==l[e.sourceFieldId]&&(t=l[e.sourceFieldId]),void 0===t&&de){const o=p(de,e.sourceFieldId);void 0!==o&&(t=o)}if(void 0===t&&ee?.stateConfig){const o=p(ee.stateConfig,e.sourceFieldId);void 0!==o&&(t=o)}if(null!=t&&""!==t){const o=b(t);u[e.sourceFieldId]=o,!f&&o&&(f=String(o))}});else{const e=ae?.rwoRecordIdFromUrl;f=e||(le&&le.id?String(le.id):void 0)}f&&(u.rwoRecordId=f);const g={};if(Object.keys(u).length>0){const t=(()=>{try{const e=new URLSearchParams(window.location.search).get("rwoContext");return e?JSON.parse(atob(e)):{}}catch{return{}}})(),o=i||e;let n;if(o){const e=t[o]||{};n={...t,[o]:{...e,...e.rwoRecordId?{}:{rwoRecordId:f},[r.targetFormId]:u}}}else n={...t,...t.rwoRecordId?{}:{rwoRecordId:f},[r.targetFormId]:u};g.rwoContext=btoa(JSON.stringify(n))}if(a){const e=window.location.pathname+window.location.search;ne?.({link:e,query:g})}else ne?.({link:o,query:g})}break;case"navigateToPrepopulateForm":{const t=r?.link?.internalLink||"",{targetFormId:o}=r||{};if(!o&&!t)break;const n=Array.isArray(r?.fieldMap)?r.fieldMap:[],i=(()=>{try{return new URLSearchParams(window.location.search).get("selectedWebpageId")||void 0}catch{return}})(),a=t?(e=>{const t=e.match(/webpageId=([^/&#?]+)/);return t?t[1]:void 0})(t):void 0,s=i&&a===i,c=Z?.rawItemDataByDmfId||{},d=Z?.nestedPathSegments||[],l=Z?.itemIndex,u=(()=>{const e=de?.data;if(e&&Object.keys(e).length>0)return e;if(ce&&"object"==typeof ce&&Object.keys(ce).length>0)return ce;if(de&&"object"==typeof de){const e=de;if(Object.values(e).some(e=>Array.isArray(e)))return e}return{}})(),f=z&&"function"==typeof z.getValues?z.getValues():{},g=new Map;n.forEach(e=>{e.sourceParent&&g.set(e.source,e.sourceParent)});const m=(e=>{const t=new Map;return e.forEach(e=>{const o=`${e.sourceParent||"root"}:${e.destinationParent||"root"}`;t.has(o)||t.set(o,{sourceParent:e.sourceParent,destinationParent:e.destinationParent,mappings:[]}),t.get(o).mappings.push(e)}),Array.from(t.values())})(n),p=((e,t)=>{const o={},r=new Set;return e.filter(e=>e.sourceParent&&e.destinationParent).forEach(e=>{e.destinationParent&&r.add(e.destinationParent)}),e.filter(e=>!e.destinationParent).forEach(e=>{e.mappings.forEach(e=>{if(r.has(e.destination))return;const n=t(e.source);void 0!==n&&(Array.isArray(n)?o[e.destination]=n:o[e.destination]=C(n))})}),e.filter(e=>e.sourceParent&&e.destinationParent).forEach(e=>{const r=t(e.sourceParent);if(!Array.isArray(r))return;const n=r.map(t=>{const o={},r=t;return e.mappings.forEach(e=>{const t=r[e.source];void 0!==t&&(o[e.destination]=C(t))}),o});o[e.destinationParent]=n}),o})(m,t=>((t,o,r,n,i,a,s)=>{if(console.log("[resolveFieldFromDataLayer] DEBUG:",{fieldId:t,parentFieldId:o,containerDataKeys:Object.keys(r),containerDataSample:JSON.stringify(r).slice(0,200),localStateDataKeys:Object.keys(n),nestedPathSegments:i,currentItemIndex:s}),void 0!==r[t])return console.log("[resolveFieldFromDataLayer] Found in containerData"),r[t];if(o){const a=n[o];if(console.log("[resolveFieldFromDataLayer] parentArray exists:",Array.isArray(a),"length:",Array.isArray(a)?a.length:0),Array.isArray(a)){if(Object.keys(r).length>0){const e=j(a,r);if(console.log("[resolveFieldFromDataLayer] PRIORITY 1 - matchedIndex:",e),void 0!==e){const o=a[e];if(void 0!==o[t])return console.log("[resolveFieldFromDataLayer] Found via PRIORITY 1 at index:",e),o[t]}}for(let e=0;e<i.length;e+=1){const r=i[e];if(r.dmfId===o&&void 0!==r.index&&(console.log("[resolveFieldFromDataLayer] PRIORITY 2 - found segment at idx:",e,"with index:",r.index),r.index<a.length)){const e=a[r.index];if(e&&void 0!==e[t])return console.log("[resolveFieldFromDataLayer] Found via PRIORITY 2 at index:",r.index),e[t]}}if(void 0!==s&&s<a.length){console.log("[resolveFieldFromDataLayer] PRIORITY 3 - trying currentItemIndex:",s);const e=a[s];if(e&&void 0!==e[t])return console.log("[resolveFieldFromDataLayer] Found via PRIORITY 3 at index:",s),e[t]}const c=i.findIndex(e=>e.dmfId===o);if(console.log("[resolveFieldFromDataLayer] PRIORITY 4 - parentSegmentIndex:",c),c>=0){const o=i.slice(0,c+1),r=e(n,o);if(r&&void 0!==r[t])return console.log("[resolveFieldFromDataLayer] Found via PRIORITY 4"),r[t]}}}for(let c=i.length-1;c>=0;c-=1){const o=i[c],a=n[o.dmfId];if(Array.isArray(a)){if(Object.keys(r).length>0){const e=j(a,r);if(void 0!==e){const o=a[e];if(void 0!==o[t])return o[t]}}const e=o.index;if(void 0!==e&&e<a.length){const o=a[e];if(o&&void 0!==o[t])return o[t]}}else{const o=i.slice(0,c+1),r=e(n,o);if(r&&void 0!==r[t])return r[t]}}return void 0!==n[t]?n[t]:void 0!==a[t]?a[t]:void 0})(t,g.get(t),c,u,d,f,l)),y=(()=>{try{const e=new URLSearchParams(window.location.search).get("rwoContext");return e?JSON.parse(atob(e)):{}}catch{return{}}})(),w={};if(Object.keys(p).length>0&&o){const e=a||i;let t;if(e){const r=y[e]||{},n=r[o]||{};t={...y,[e]:{...r,[o]:{...n,prefillData:p}}}}else t={...y,[o]:{prefillData:p}};w.rwoContext=btoa(JSON.stringify(t))}if(s){const e=window.location.pathname+window.location.search;ne?.({link:e,query:Object.keys(w).length>0?w:void 0,state:{prefill:p,targetFormId:o}})}else{const e=t||`?organismId=${encodeURIComponent(String(o||""))}`;ne?.({link:e,query:Object.keys(w).length>0?w:void 0,state:{prefill:p,targetFormId:o}})}}break;case"navigateToOrganismWithRwoContext":{const e=r?.sourceDataModelFieldId,t=r?.targetOrganismIds,o=r?.inputParams;if(!Array.isArray(t)||0===t.length)break;const n=(()=>{try{return new URLSearchParams(window.location.search).get("selectedWebpageId")||void 0}catch{return}})(),i=z&&"function"==typeof z.getValues?z.getValues():{},a=Z?.rawItemDataByDmfId||{},s=(()=>{try{const e=new URLSearchParams(window.location.search).get("rwoContext");return e?JSON.parse(atob(e)):{}}catch{return{}}})(),c={};let d,l;if(o&&o.length>0){const e=de?.data;o.forEach(t=>{let o;if(void 0===o&&void 0!==a[t.sourceFieldId]&&(o=a[t.sourceFieldId]),void 0===o&&void 0!==i[t.sourceFieldId]&&(o=i[t.sourceFieldId]),void 0===o&&e&&void 0!==e[t.sourceFieldId]&&(o=e[t.sourceFieldId]),void 0===o&&de){const e=p(de,t.sourceFieldId);void 0!==e&&(o=e)}if(void 0===o&&ee?.stateConfig){const e=p(ee.stateConfig,t.sourceFieldId);void 0!==e&&(o=e)}if(null!=o&&""!==o){const e=b(o);c[t.sourceFieldId]=e,!d&&e&&(d=String(e))}}),d&&(c.rwoRecordId=d)}else if(e){let t;if(!t&&Z?.rawItemDataByDmfId){const o=Z.rawItemDataByDmfId[e];t=k(o)}if(!t&&z&&"function"==typeof z.getValues){const o=p(z.getValues(),e);t=F(o)}if(!t&&de){const o=de?.data;if(o&&void 0!==o[e]){const r=o[e];t=k(r)}if(!t){const o=p(de,e);t=k(o)}}if(!t&&ee?.stateConfig){const o=p(ee.stateConfig,e);t=k(o)}if(!t&&n){const e=s[n]||{};"string"==typeof e.rwoRecordId&&(t=e.rwoRecordId)}t&&(d=t,c.rwoRecordId=String(t),c[String(e)]=String(t))}if(n){const e=s[n]||{},o={...e};d&&!e.rwoRecordId&&(o.rwoRecordId=d),t.forEach(t=>{const r=e[t]||{};o[t]={...r,...c}}),l={...s,[n]:o}}else l={...s},d&&!s.rwoRecordId&&(l.rwoRecordId=d),t.forEach(e=>{const t=s[e]||{};l[e]={...t,...c}});const u={};(Object.keys(c).length>0||void 0!==d)&&(u.rwoContext=btoa(JSON.stringify(l)));const f=window.location.pathname+window.location.search;ne?.({link:f,query:u})}break;case"navigateToPageWithRwoContext":{const e=r?.link,t=!1!==r?.includeRwoRecordId,o=Array.isArray(r?.rwoContextMapping)?r.rwoContextMapping:[];if(!e?.internalLink)break;const n=(e=>{const t=e.match(/webpageId=([^/&#?]+)/);return t?t[1]:void 0})(e.internalLink),i=r?.sourceDataModelFieldId,a=z&&"function"==typeof z.getValues?z.getValues():{};let s=ae?.rwoRecordIdFromUrl;if(i){if(!s&&Z?.rawItemDataByDmfId){const e=Z.rawItemDataByDmfId[i];s=k(e)}if(!s){const e=p(a,i);s=F(e)}if(!s&&de){const e=p(de,i);s=k(e)}if(!s&&ee?.stateConfig){const e=p(ee.stateConfig,i);s=k(e)}s||(s=String(i))}const c=R(de?.data),d=R(ce),l=R(Z?.itemDataByDmfId),u=R(Z?.rawItemDataByDmfId),f=[ee?.stateConfig,de,ce,a,d,l,u,c].reduce((e,t)=>(t&&"object"==typeof t&&Object.assign(e,t),e),{}),{query:g}=y({selectedWebpageId:n,includeRwoRecordId:t,recordId:s,mapping:o,contextSource:f});ne?.({link:e.internalLink,query:g})}}},[ne,z,ce,de,le,ae]),he=n(e=>{z?.reset?.()},[z]),Ie=n(e=>{z?.reset?.(),"function"==typeof Q?Q():"function"==typeof G&&G(null)},[z,Q,G]),ve=n(e=>{const t=e?.add_replicator||{},o=t.targetReplicatorFieldId;let r,n,i,a;if(o&&oe){const e=oe.getReplicator(o);if(!e)return void console.error(`[add_replicator] Replicator "${o}" not found in registry. Make sure the replicator container is rendered and has the correct replicatorFieldId.`);r=o,n=oe.canAdd(o),i=e=>oe.append(o,e),a=e.fieldArrayMethods.fields.length}else{if(!te)return void console.error("[add_replicator] No target replicator available. Either:\n1. Configure targetReplicatorFieldId in the button action, or\n2. Place the button inside a replicator container.");r=te.replicatorFieldId,n=te.canAdd,i=te.fieldArrayMethods.append,a=te.fieldArrayMethods.fields.length}if(n&&(i({}),!1!==t.scrollToNew)){const e=`[data-replicator-instance="${r}-${a}"]`,t=(o=3)=>{requestAnimationFrame(()=>{setTimeout(()=>{const r=document.querySelector(e);r?r.scrollIntoView({behavior:"smooth",block:"nearest"}):o>0&&t(o-1)},50)})};t()}},[te,oe]),xe=n(e=>{const t=(e?.delete_replicator||{}).targetReplicatorFieldId;let o,r,n,i,a;if(t&&oe){const e=oe.getReplicator(t);if(!e)return void console.error(`[delete_replicator] Replicator "${t}" not found in registry. Make sure the replicator container is rendered and has the correct replicatorFieldId.`);o=t,r=oe.canRemove(t),n=e=>oe.remove(t,e),i=e.fieldArrayMethods.fields.length}else{if(!te)return void console.error("[delete_replicator] No target replicator available. Either:\n1. Configure targetReplicatorFieldId in the button action, or\n2. Place the button inside a replicator container.");o=te.replicatorFieldId,r=te.canRemove,n=te.fieldArrayMethods.remove,i=te.fieldArrayMethods.fields.length}r&&(a=void 0===Z?.itemIndex||t?i-1:Z.itemIndex,a<0||a>=i?console.error(`[delete_replicator] Invalid index ${a} (length: ${i})`):n(a))},[te,oe,Z]),be=n(async e=>{if(!re?.openAIChat)return;if(re.isAIAvailable&&!re.isAIAvailable())return;const t=e?.open_ai_chat||e?.openAIChat||{},o=t?.inputParams,r=t?.cortexAgentId,n=z&&"function"==typeof z.getValues?z.getValues():{},i=Z?.rawItemDataByDmfId||{},a={};if(o&&o.length>0)o.forEach(e=>{const t=n[e.sourceFieldId]??i[e.sourceFieldId];null!=t&&(a[e.sourceFieldId]=b(t))});else{const e=t?.cortexRwoContext?.sourceDataModelFieldId;if(e){let t;if(!t&&Z?.rawItemDataByDmfId){const o=Z.rawItemDataByDmfId[e];t=k(o)}if(!t&&z&&"function"==typeof z.getValues){const o=p(z.getValues(),e);t=F(o)}if(!t&&de){const o=p(de,e);t=k(o)}if(!t&&ee?.stateConfig){const o=p(ee.stateConfig,e);t=k(o)}t&&(a.rwoRecordId=t,a.sourceDataModelFieldId=e)}}const s=Object.keys(a).length>0?{inputParams:a}:void 0;await re.openAIChat({cortexAgentId:r,cortexRwoContext:s,inputParams:Object.keys(a).length>0?a:void 0})},[re,z,de,Z,ee]),Fe=n((e,t)=>{switch(t){case"navigateToCreateForm":return e.navigateToCreateForm||e.navigate_to_create_form||null;case"navigateToEditForm":return e.navigateToEditForm||e.navigate_to_edit_form||null;case"navigateToPrepopulateForm":return e.navigateToPrepopulateForm||e.navigate_to_prepopulate_form||null;case"navigateToOrganismWithRwoContext":return e.navigateToOrganismWithRwoContext||e.navigate_to_organism_with_rwo_context||null;case"navigateToPageWithRwoContext":return e.navigateToPageWithRwoContext||e.navigate_to_page_with_rwo_context||null;default:return null}},[]),ke=n(async(e,t)=>{E?.(e,t);try{let o;switch(e.type){case"link":await ge(e),o="Link executed";break;case"download":await me(e),o="Download executed";break;case"submit":o=await ye(e);break;case"open_popup":pe(e),o="Popup opened";break;case"navigate_to_create_form":await we(e,"navigateToCreateForm"),o="Navigation executed";break;case"navigate_to_edit_form":await we(e,"navigateToEditForm"),o="Navigation executed";break;case"navigate_to_prepopulate_form":await we(e,"navigateToPrepopulateForm"),o="Navigation executed";break;case"navigate_to_organism_with_rwo_context":await we(e,"navigateToOrganismWithRwoContext"),o="Navigation executed";break;case"navigate_to_page_with_rwo_context":await we(e,"navigateToPageWithRwoContext"),o="Navigation executed";break;case"reset":he(e),o="Reset executed";break;case"destroy":Ie(e),o="Destroy executed";break;case"open_ai_chat":await be(e),o="AI Chat opened";break;case"add_replicator":ve(e),o="Replicator instance added";break;case"delete_replicator":xe(e),o="Replicator instance deleted";break;default:throw new Error(`Unsupported action type: ${e.type}`)}return L?.(e,t,o),o}catch(o){const r=o instanceof Error?o:new Error(String(o));if(T?.(e,t,r),M)throw r;return null}},[E,L,T,M,ge,me,ye,pe,we,he,Ie,be,ve,xe]),Re=n(async()=>{if(0===H.length)return[];W(!0),q(0),J([]),Y(null);try{const e=H.some(e=>"submit"===e?.type),t=new Set(["link","navigate_to_create_form","navigate_to_edit_form","navigate_to_prepopulate_form","navigate_to_organism_with_rwo_context","navigate_to_page_with_rwo_context"]),o=e=>"close"===e||"destroy"===e,r=(()=>{if(!e)return H;return[...H.filter(e=>e&&"submit"!==e.type&&!t.has(e.type)&&!o(e.type)),...H.filter(e=>e&&"submit"===e.type),...H.filter(e=>e&&o(e.type)),...H.filter(e=>e&&t.has(e.type))]})(),n=[];for(let i=0;i<r.length;i+=1){q(i);const e=await ke(r[i],i);n.push(e),J([...n])}return N?.(n),n}catch(e){const t=e instanceof Error?e:new Error(String(e));throw Y(t),t}finally{W(!1),q(-1)}},[H,ke,N,V,M]),Ce=n(e=>{D||(O?O(e):H.length>0&&Re().catch(()=>{}))},[D,P,O,H,Re]);return{executeActions:Re,handleAction:Ce,isExecuting:B,currentActionIndex:U,results:$,error:K}};export{A as useButtonAction};
2
2
  //# sourceMappingURL=useButtonAction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useButtonAction.js","sources":["../../../../../../src/molecules/Button/hooks/useButtonAction.ts"],"sourcesContent":[null],"names":["extractFieldValue","data","obj","id","undefined","value","getValueFromFormContext","extracted","String","getValueFromDisplayStructure","normalizeDmfMap","source","Object","entries","reduce","acc","key","normalized","wrapValueForFormContext","val","parentContainsContainerData","parentItem","containerData","containerKeys","keys","length","some","JSON","stringify","values","Array","isArray","nestedItem","nestedObj","findParentIndexByContainerData","parentArray","i","useButtonAction","props","options","properties","moleculeId","onClick","disabled","onActionStart","onActionComplete","onActionError","onAllActionsComplete","stopOnError","executeAsync","isExecuting","setIsExecuting","useState","currentActionIndex","setCurrentActionIndex","results","setResults","error","setError","actions","useMemo","actionContainer","action","nestedAction","actionConfig","setActivePopup","clearActivePopup","usePopupContext","form","useFormContext","organismCtx","useOrganismContext","containerRuntime","useContainerRuntime","stateCtx","useStateContext","replicatorFormContext","useReplicatorForm","replicatorRegistry","useReplicatorRegistry","webpageCtx","useContext","WebpageContext","onInternalNavigation","formId","organismFormId","routing","submitHandler","pageSubmitHandler","localState","localStateObject","organismInfo","prefillData","submitForm","useSubmitForm","executeLinkAction","useCallback","async","link","Error","checkIsDataDrivenLink","combinedData","rawItemDataByDmfId","assign","getValues","formValues","forEach","localStateData","stateConfig","resolved","resolveDataDrivenLink","isExternal","navigateToExternalLink","destination","query","recordId","rwoContextData","rwoRecordId","rwoContext","encodeObjectToBase64Url","webpageAlias","checkIsInternalLink","targetFormId","organismId","rwoKey","rwo","internalLink","externalLink","executeDownloadAction","download","downloadFile","url","name","executePopupAction","openPopup","open_popup","popupId","executeSubmitAction","handleSubmit","currentFormId","toString","submitResult","rwoRecordIdFromUrl","params","URLSearchParams","window","location","search","rwoContextParam","get","selectedWebpageId","webpageContext","parse","atob","organismContext","payload","result","err","errorLink","submit","onError","handler","stateHandler","interacted","successLink","onSuccess","reset","_invalid","executeNavigationAction","navigationType","config","getNavigationConfig","editCurrentWebpageId","editLinkObj","editLink","extractEditWebpageId","match","editTargetWebpageId","isEditSamePageNavigation","editInputParams","inputParams","editFormValues","editContainerData","editLocalStateData","editContextValues","editPrimaryRecordId","param","sourceFieldId","raw","getByPath","extractedValue","pageRwoId","editFormQuery","existingEditRwoContext","editContextWebpageId","editRwoContext","existingWebpageContext","btoa","currentPath","pathname","baseInternalLink","fieldMap","prepopCurrentWebpageId","targetWebpageId","extractWebpageIdFromLink","isSamePageNavigation","prepopContainerData","prepopNestedPathSegments","nestedPathSegments","prepopItemIndex","itemIndex","prepopLocalStateData","objData","v","prepopFormValues","fieldParentMap","Map","m","sourceParent","set","mappingGroups","groups","mapping","destinationParent","has","mappings","push","from","groupMappingsByParent","prepopPrefill","resolveValue","destinationsWithInnerMappings","Set","filter","g","add","group","rawValue","sourceArray","destArray","map","srcItem","destItem","srcObj","buildDestinationValue","fieldId","parentFieldId","currentItemIndex","matchedIndex","dmfId","segmentIndex","index","lastSegment","parentSegmentIndex","findIndex","seg","parentPath","slice","parentData","getDataByPath","segment","ancestorPath","ancestorData","resolveFieldFromDataLayer","existingPrepopRwoContext","prepopQuery","contextWebpageId","prepopRwoContext","existingOrganismContext","state","prefill","composed","encodeURIComponent","sourceDataModelFieldId","targetOrganismIds","currentSelectedWebpageId","existingRwoContext","organismContextValues","primaryRecordId","newRwoContext","fieldValue","existingWebpageCtx","orgId","existingOrgContext","navigationLink","linkObj","includeRwoRecordId","rwoContextMapping","normalizedLocalStateData","normalizedLocalState","normalizedContainerResolvedData","itemDataByDmfId","normalizedContainerRawData","contextSource","layer","composeRwoParamsV2","executeResetAction","executeDestroyAction","executeAddReplicatorAction","addConfig","add_replicator","targetReplicatorFieldId","targetReplicatorId","canAdd","appendFn","currentLength","entry","getReplicator","console","append","fieldArrayMethods","fields","replicatorFieldId","scrollToNew","selector","scrollToElement","retries","requestAnimationFrame","setTimeout","element","document","querySelector","scrollIntoView","behavior","block","executeDeleteReplicatorAction","delete_replicator","canRemove","removeFn","indexToRemove","remove","executeOpenAIChatAction","openAIChat","isAIAvailable","openAIChatConfig","open_ai_chat","cortexAgentIdOverride","cortexAgentId","chatParams","cortexRwoContext","resolvedRwoRecordId","type","navigateToCreateForm","navigate_to_create_form","navigateToEditForm","navigate_to_edit_form","navigateToPrepopulateForm","navigate_to_prepopulate_form","navigateToOrganismWithRwoContext","navigate_to_organism_with_rwo_context","navigateToPageWithRwoContext","navigate_to_page_with_rwo_context","executeSingleAction","executeActions","containsSubmit","a","navigationTypes","isCloser","t","orderedActions","executionResults","handleAction","event","catch"],"mappings":"upEAkCA,MAAMA,EAAqBC,IACzB,GAAIA,QAAqC,OAAOA,EAEhD,GAAoB,iBAATA,GAA8B,OAATA,EAAe,CAC7C,MAAMC,EAAMD,EAEZ,GAAI,OAAQC,GAAkB,OAAXA,EAAIC,SAA0BC,IAAXF,EAAIC,GACxC,OAAOD,EAAIC,GAGb,GAAI,UAAWD,GAAqB,OAAdA,EAAIG,YAAgCD,IAAdF,EAAIG,MAC9C,OAAOH,EAAIG,KAEd,CAED,OAAOJ,GAIHK,EAA2BL,IAC/B,GAAIA,QAAqC,OAEzC,MAAMM,EAAYP,EAAkBC,GACpC,MACuB,iBAAdM,GACc,iBAAdA,GACc,kBAAdA,EAEAC,OAAOD,QALhB,GAYIE,EAAgCR,IACpC,GAAIA,QAAqC,OAEzC,MAAMM,EAAYP,EAAkBC,GACpC,MACuB,iBAAdM,GACc,iBAAdA,GACc,kBAAdA,EAEAC,OAAOD,QALhB,GAWIG,EAAmBC,GAClBA,GAA4B,iBAAXA,EAEfC,OAAOC,QAAQF,GAAmCG,OAAO,CAACC,GAAMC,EAAKX,MAC1E,MAAMY,EAAaR,EAA6BJ,GAIhD,YAHmBD,IAAfa,IACFF,EAAIC,GAAOC,GAENF,GACN,CAA4B,GARmB,GA4F9CG,EAA2BC,IAC/B,GAAIA,QAAmC,MAAO,CAAEd,MAAOc,GAGvD,GAAmB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B1R,EAAQ8K,OAAQ0H,GAAMA,GAAKE,EAASF,EAAEd,UAClC1R,EAAQ8K,OAAQ0H,GAAMA,GAAKC,EAAgBpI,IAAImI,EAAEd,OAE1E,EAVsB,GAYjBmB,EAA8B,GACpC,IAAK,IAAIpU,EAAI,EAAGA,EAAImU,EAAe9U,OAAQW,GAAK,EAAG,CACjDkB,EAAsBlB,GAEtB,MAAMwH,QAAeoM,GAAoBO,EAAenU,GAAIA,GAC5DoU,EAAiBtI,KAAKtE,GACtBpG,EAAW,IAAIgT,GAChB,CAGD,OADAzT,IAAuByT,GAChBA,CACR,CAAC,MAAO3M,GACP,MAAMpG,EAAQoG,aAAe1D,MAAQ0D,EAAM,IAAI1D,MAAM3F,OAAOqJ,IAG5D,MAFAnG,EAASD,GAEHA,CACP,CAAS,QACRN,GAAe,GACfG,GAAuB,EACxB,GACA,CAACK,EAASqS,GAAqBjT,EAAsBE,EAAcD,IAGhEyT,GAAezQ,EAClB0Q,IACK/T,IAEAD,EACFA,EAAQgU,GACC/S,EAAQlC,OAAS,GAC1BwU,KAAiBU,MAAM,UAK3B,CAAChU,EAAUF,EAAYC,EAASiB,EAASsS,KAG3C,MAAO,CACLA,kBACAQ,gBACAvT,cACAG,qBACAE,UACAE"}
1
+ {"version":3,"file":"useButtonAction.js","sources":["../../../../../../src/molecules/Button/hooks/useButtonAction.ts"],"sourcesContent":[null],"names":["extractFieldValue","data","obj","id","undefined","value","getValueFromFormContext","extracted","String","getValueFromDisplayStructure","normalizeDmfMap","source","Object","entries","reduce","acc","key","normalized","wrapValueForFormContext","val","parentContainsContainerData","parentItem","containerData","containerKeys","keys","length","some","JSON","stringify","values","Array","isArray","nestedItem","nestedObj","findParentIndexByContainerData","parentArray","i","useButtonAction","props","options","properties","moleculeId","onClick","disabled","onActionStart","onActionComplete","onActionError","onAllActionsComplete","stopOnError","executeAsync","isExecuting","setIsExecuting","useState","currentActionIndex","setCurrentActionIndex","results","setResults","error","setError","actions","useMemo","actionContainer","action","nestedAction","actionConfig","setActivePopup","clearActivePopup","usePopupContext","form","useFormContext","organismCtx","useOrganismContext","containerRuntime","useContainerRuntime","stateCtx","useStateContext","replicatorFormContext","useReplicatorForm","replicatorRegistry","useReplicatorRegistry","webpageCtx","useContext","WebpageContext","onInternalNavigation","formId","organismFormId","routing","submitHandler","pageSubmitHandler","localState","localStateObject","organismInfo","prefillData","submitForm","useSubmitForm","executeLinkAction","useCallback","async","link","Error","checkIsDataDrivenLink","combinedData","rawItemDataByDmfId","assign","getValues","formValues","forEach","localStateData","stateConfig","resolved","resolveDataDrivenLink","isExternal","navigateToExternalLink","destination","query","recordId","rwoContextData","rwoRecordId","rwoContext","encodeObjectToBase64Url","webpageAlias","checkIsInternalLink","targetFormId","organismId","rwoKey","rwo","internalLink","externalLink","executeDownloadAction","download","downloadFile","url","name","executePopupAction","openPopup","open_popup","popupId","executeSubmitAction","handleSubmit","currentFormId","toString","submitResult","rwoRecordIdFromUrl","params","URLSearchParams","window","location","search","rwoContextParam","get","selectedWebpageId","webpageContext","parse","atob","organismContext","payload","result","err","errorLink","submit","onError","handler","stateHandler","interacted","successLink","onSuccess","reset","_invalid","executeNavigationAction","navigationType","config","getNavigationConfig","editCurrentWebpageId","editLinkObj","editLink","extractEditWebpageId","match","editTargetWebpageId","isEditSamePageNavigation","editInputParams","inputParams","editFormValues","editContainerData","editLocalStateData","editContextValues","editPrimaryRecordId","param","sourceFieldId","raw","getByPath","extractedValue","pageRwoId","editFormQuery","existingEditRwoContext","editContextWebpageId","editRwoContext","existingWebpageContext","btoa","currentPath","pathname","baseInternalLink","fieldMap","prepopCurrentWebpageId","targetWebpageId","extractWebpageIdFromLink","isSamePageNavigation","prepopContainerData","prepopNestedPathSegments","nestedPathSegments","prepopItemIndex","itemIndex","prepopLocalStateData","objData","v","prepopFormValues","fieldParentMap","Map","m","sourceParent","set","mappingGroups","groups","mapping","destinationParent","has","mappings","push","from","groupMappingsByParent","prepopPrefill","resolveValue","destinationsWithInnerMappings","Set","filter","g","add","group","rawValue","sourceArray","destArray","map","srcItem","destItem","srcObj","buildDestinationValue","fieldId","parentFieldId","currentItemIndex","console","log","containerDataKeys","containerDataSample","slice","localStateDataKeys","matchedIndex","segIdx","segment","dmfId","index","parentSegmentIndex","findIndex","seg","parentPath","parentData","getDataByPath","segmentIndex","ancestorPath","ancestorData","resolveFieldFromDataLayer","existingPrepopRwoContext","prepopQuery","contextWebpageId","prepopRwoContext","existingOrganismContext","state","prefill","composed","encodeURIComponent","sourceDataModelFieldId","targetOrganismIds","currentSelectedWebpageId","existingRwoContext","organismContextValues","primaryRecordId","newRwoContext","fieldValue","existingWebpageCtx","orgId","existingOrgContext","navigationLink","linkObj","includeRwoRecordId","rwoContextMapping","normalizedLocalStateData","normalizedLocalState","normalizedContainerResolvedData","itemDataByDmfId","normalizedContainerRawData","contextSource","layer","composeRwoParamsV2","executeResetAction","executeDestroyAction","executeAddReplicatorAction","addConfig","add_replicator","targetReplicatorFieldId","targetReplicatorId","canAdd","appendFn","currentLength","entry","getReplicator","append","fieldArrayMethods","fields","replicatorFieldId","scrollToNew","selector","scrollToElement","retries","requestAnimationFrame","setTimeout","element","document","querySelector","scrollIntoView","behavior","block","executeDeleteReplicatorAction","delete_replicator","canRemove","removeFn","indexToRemove","remove","executeOpenAIChatAction","openAIChat","isAIAvailable","openAIChatConfig","open_ai_chat","cortexAgentIdOverride","cortexAgentId","chatParams","cortexRwoContext","resolvedRwoRecordId","type","navigateToCreateForm","navigate_to_create_form","navigateToEditForm","navigate_to_edit_form","navigateToPrepopulateForm","navigate_to_prepopulate_form","navigateToOrganismWithRwoContext","navigate_to_organism_with_rwo_context","navigateToPageWithRwoContext","navigate_to_page_with_rwo_context","executeSingleAction","executeActions","containsSubmit","a","navigationTypes","isCloser","t","orderedActions","executionResults","handleAction","event","catch"],"mappings":"upEAkCA,MAAMA,EAAqBC,IACzB,GAAIA,QAAqC,OAAOA,EAEhD,GAAoB,iBAATA,GAA8B,OAATA,EAAe,CAC7C,M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EAAEd,UAElE9R,EAAQ8K,OAAQ8H,GAAMA,GAAgB,WAAXA,EAAEd,SAC7B9R,EAAQ8K,OAAQ8H,GAAMA,GAAKE,EAASF,EAAEd,UAClC9R,EAAQ8K,OAAQ8H,GAAMA,GAAKC,EAAgBxI,IAAIuI,EAAEd,OAE1E,EAVsB,GAYjBmB,EAA8B,GACpC,IAAK,IAAIxU,EAAI,EAAGA,EAAIuU,EAAelV,OAAQW,GAAK,EAAG,CACjDkB,EAAsBlB,GAEtB,MAAMwH,QAAewM,GAAoBO,EAAevU,GAAIA,GAC5DwU,EAAiB1I,KAAKtE,GACtBpG,EAAW,IAAIoT,GAChB,CAGD,OADA7T,IAAuB6T,GAChBA,CACR,CAAC,MAAO/M,GACP,MAAMpG,EAAQoG,aAAe1D,MAAQ0D,EAAM,IAAI1D,MAAM3F,OAAOqJ,IAG5D,MAFAnG,EAASD,GAEHA,CACP,CAAS,QACRN,GAAe,GACfG,GAAuB,EACxB,GACA,CAACK,EAASyS,GAAqBrT,EAAsBE,EAAcD,IAGhE6T,GAAe7Q,EAClB8Q,IACKnU,IAEAD,EACFA,EAAQoU,GACCnT,EAAQlC,OAAS,GAC1B4U,KAAiBU,MAAM,UAK3B,CAACpU,EAAUF,EAAYC,EAASiB,EAAS0S,KAG3C,MAAO,CACLA,kBACAQ,gBACA3T,cACAG,qBACAE,UACAE"}
@@ -1,2 +1,2 @@
1
- import*as e from"react";import"../../node_modules/react-is/index.js";import"../../../../prop-types/index.js";import{clsx as o}from"../../../../clsx/dist/clsx.mjs.js";import r from"../utils/memoTheme.js";import t from"./AccordionContext.js";import s from"../utils/useSlot.js";import a,{getAccordionUtilityClass as i}from"./accordionClasses.js";import{jsxs as n,jsx as d}from"react/jsx-runtime";import p from"../styles/styled.js";import l from"../Paper/Paper.js";import{useDefaultProps as c}from"../DefaultPropsProvider/DefaultPropsProvider.js";import m from"../Collapse/Collapse.js";import u from"../../../utils/esm/chainPropTypes/chainPropTypes.js";import x from"../../../utils/esm/composeClasses/composeClasses.js";import f from"../../../utils/esm/useControlled/useControlled.js";import{r as b}from"../../../../../_virtual/index3.js";import{p as h}from"../../../../../_virtual/index5.js";const g=p(l,{name:"MuiAccordion",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:r}=e;return[{[`& .${a.region}`]:o.region},o.root,!r.square&&o.rounded,!r.disableGutters&&o.gutters]}})(r(({theme:e})=>{const o={duration:e.transitions.duration.shortest};return{position:"relative",transition:e.transitions.create(["margin"],o),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(e.vars||e).palette.divider,transition:e.transitions.create(["opacity","background-color"],o)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${a.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${a.disabled}`]:{backgroundColor:(e.vars||e).palette.action.disabledBackground}}}),r(({theme:e})=>({variants:[{props:e=>!e.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(e.vars||e).shape.borderRadius,borderBottomRightRadius:(e.vars||e).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:e=>!e.disableGutters,style:{[`&.${a.expanded}`]:{margin:"16px 0"}}}]}))),y=p("h3",{name:"MuiAccordion",slot:"Heading"})({all:"unset"}),j=e.forwardRef(function(r,a){const p=c({props:r,name:"MuiAccordion"}),{children:l,className:u,defaultExpanded:b=!1,disabled:h=!1,disableGutters:j=!1,expanded:T,onChange:v,square:C=!1,slots:P={},slotProps:R={},TransitionComponent:w,TransitionProps:A,...q}=p,[E,G]=f({controlled:T,default:b,name:"Accordion",state:"expanded"}),N=e.useCallback(e=>{G(!E),v&&v(e,!E)},[E,v,G]),[O,...B]=e.Children.toArray(l),F=e.useMemo(()=>({expanded:E,disabled:h,disableGutters:j,toggle:N}),[E,h,j,N]),M={...p,square:C,disabled:h,disableGutters:j,expanded:E},k=(e=>{const{classes:o,square:r,expanded:t,disabled:s,disableGutters:a}=e;return x({root:["root",!r&&"rounded",t&&"expanded",s&&"disabled",!a&&"gutters"],heading:["heading"],region:["region"]},i,o)})(M),S={slots:{transition:w,...P},slotProps:{transition:A,...R}},[$,_]=s("root",{elementType:g,externalForwardedProps:{...S,...q},className:o(k.root,u),shouldForwardComponentProp:!0,ownerState:M,ref:a,additionalProps:{square:C}}),[D,L]=s("heading",{elementType:y,externalForwardedProps:S,className:k.heading,ownerState:M}),[I,U]=s("transition",{elementType:m,externalForwardedProps:S,ownerState:M});return n($,{..._,children:[d(D,{...L,children:d(t.Provider,{value:F,children:O})}),d(I,{in:E,timeout:"auto",...U,children:d("div",{"aria-labelledby":O.props.id,id:O.props["aria-controls"],role:"region",className:k.region,children:B})})]})});"production"!==process.env.NODE_ENV&&(j.propTypes={children:u(h.exports.node.isRequired,o=>{const r=e.Children.toArray(o.children)[0];return b.exports.isFragment(r)?new Error("MUI: The Accordion doesn't accept a Fragment as a child. Consider providing an array instead."):e.isValidElement(r)?null:new Error("MUI: Expected the first child of Accordion to be a valid element.")}),classes:h.exports.object,className:h.exports.string,defaultExpanded:h.exports.bool,disabled:h.exports.bool,disableGutters:h.exports.bool,expanded:h.exports.bool,onChange:h.exports.func,slotProps:h.exports.shape({heading:h.exports.oneOfType([h.exports.func,h.exports.object]),root:h.exports.oneOfType([h.exports.func,h.exports.object]),transition:h.exports.oneOfType([h.exports.func,h.exports.object])}),slots:h.exports.shape({heading:h.exports.elementType,root:h.exports.elementType,transition:h.exports.elementType}),square:h.exports.bool,sx:h.exports.oneOfType([h.exports.arrayOf(h.exports.oneOfType([h.exports.func,h.exports.object,h.exports.bool])),h.exports.func,h.exports.object]),TransitionComponent:h.exports.elementType,TransitionProps:h.exports.object});var T=j;export{T as default};
1
+ import*as e from"react";import"../../node_modules/react-is/index.js";import"../../../../prop-types/index.js";import{clsx as o}from"../../../../clsx/dist/clsx.mjs.js";import r from"../utils/memoTheme.js";import t from"./AccordionContext.js";import s from"../utils/useSlot.js";import a,{getAccordionUtilityClass as i}from"./accordionClasses.js";import{jsxs as n,jsx as d}from"react/jsx-runtime";import p from"../styles/styled.js";import l from"../Paper/Paper.js";import{useDefaultProps as c}from"../DefaultPropsProvider/DefaultPropsProvider.js";import m from"../Collapse/Collapse.js";import u from"../../../utils/esm/chainPropTypes/chainPropTypes.js";import x from"../../../utils/esm/composeClasses/composeClasses.js";import f from"../../../utils/esm/useControlled/useControlled.js";import{r as b}from"../../../../../_virtual/index4.js";import{p as h}from"../../../../../_virtual/index5.js";const g=p(l,{name:"MuiAccordion",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:r}=e;return[{[`& .${a.region}`]:o.region},o.root,!r.square&&o.rounded,!r.disableGutters&&o.gutters]}})(r(({theme:e})=>{const o={duration:e.transitions.duration.shortest};return{position:"relative",transition:e.transitions.create(["margin"],o),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(e.vars||e).palette.divider,transition:e.transitions.create(["opacity","background-color"],o)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${a.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${a.disabled}`]:{backgroundColor:(e.vars||e).palette.action.disabledBackground}}}),r(({theme:e})=>({variants:[{props:e=>!e.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(e.vars||e).shape.borderRadius,borderBottomRightRadius:(e.vars||e).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:e=>!e.disableGutters,style:{[`&.${a.expanded}`]:{margin:"16px 0"}}}]}))),y=p("h3",{name:"MuiAccordion",slot:"Heading"})({all:"unset"}),j=e.forwardRef(function(r,a){const p=c({props:r,name:"MuiAccordion"}),{children:l,className:u,defaultExpanded:b=!1,disabled:h=!1,disableGutters:j=!1,expanded:T,onChange:v,square:C=!1,slots:P={},slotProps:R={},TransitionComponent:w,TransitionProps:A,...q}=p,[E,G]=f({controlled:T,default:b,name:"Accordion",state:"expanded"}),N=e.useCallback(e=>{G(!E),v&&v(e,!E)},[E,v,G]),[O,...B]=e.Children.toArray(l),F=e.useMemo(()=>({expanded:E,disabled:h,disableGutters:j,toggle:N}),[E,h,j,N]),M={...p,square:C,disabled:h,disableGutters:j,expanded:E},k=(e=>{const{classes:o,square:r,expanded:t,disabled:s,disableGutters:a}=e;return x({root:["root",!r&&"rounded",t&&"expanded",s&&"disabled",!a&&"gutters"],heading:["heading"],region:["region"]},i,o)})(M),S={slots:{transition:w,...P},slotProps:{transition:A,...R}},[$,_]=s("root",{elementType:g,externalForwardedProps:{...S,...q},className:o(k.root,u),shouldForwardComponentProp:!0,ownerState:M,ref:a,additionalProps:{square:C}}),[D,L]=s("heading",{elementType:y,externalForwardedProps:S,className:k.heading,ownerState:M}),[I,U]=s("transition",{elementType:m,externalForwardedProps:S,ownerState:M});return n($,{..._,children:[d(D,{...L,children:d(t.Provider,{value:F,children:O})}),d(I,{in:E,timeout:"auto",...U,children:d("div",{"aria-labelledby":O.props.id,id:O.props["aria-controls"],role:"region",className:k.region,children:B})})]})});"production"!==process.env.NODE_ENV&&(j.propTypes={children:u(h.exports.node.isRequired,o=>{const r=e.Children.toArray(o.children)[0];return b.exports.isFragment(r)?new Error("MUI: The Accordion doesn't accept a Fragment as a child. Consider providing an array instead."):e.isValidElement(r)?null:new Error("MUI: Expected the first child of Accordion to be a valid element.")}),classes:h.exports.object,className:h.exports.string,defaultExpanded:h.exports.bool,disabled:h.exports.bool,disableGutters:h.exports.bool,expanded:h.exports.bool,onChange:h.exports.func,slotProps:h.exports.shape({heading:h.exports.oneOfType([h.exports.func,h.exports.object]),root:h.exports.oneOfType([h.exports.func,h.exports.object]),transition:h.exports.oneOfType([h.exports.func,h.exports.object])}),slots:h.exports.shape({heading:h.exports.elementType,root:h.exports.elementType,transition:h.exports.elementType}),square:h.exports.bool,sx:h.exports.oneOfType([h.exports.arrayOf(h.exports.oneOfType([h.exports.func,h.exports.object,h.exports.bool])),h.exports.func,h.exports.object]),TransitionComponent:h.exports.elementType,TransitionProps:h.exports.object});var T=j;export{T as default};
2
2
  //# sourceMappingURL=Accordion.js.map
@@ -1,2 +1,2 @@
1
- import*as o from"react";import"../../node_modules/react-is/index.js";import"../../../../prop-types/index.js";import{clsx as e}from"../../../../clsx/dist/clsx.mjs.js";import{useRtl as t}from"../../../system/esm/RtlProvider/index.js";import r from"../styles/rootShouldForwardProp.js";import{getMenuUtilityClass as s}from"./menuClasses.js";import p from"../utils/useSlot.js";import{jsx as n}from"react/jsx-runtime";import a from"../styles/styled.js";import i,{PopoverPaper as l}from"../Popover/Popover.js";import c from"../MenuList/MenuList.js";import{useDefaultProps as u}from"../DefaultPropsProvider/DefaultPropsProvider.js";import m from"../../../utils/esm/useSlotProps/useSlotProps.js";import x from"../../../utils/esm/HTMLElementType/HTMLElementType.js";import d from"../../../utils/esm/composeClasses/composeClasses.js";import{r as f}from"../../../../../_virtual/index3.js";import{p as P}from"../../../../../_virtual/index5.js";const b={vertical:"top",horizontal:"right"},y={vertical:"top",horizontal:"left"},j=a(i,{shouldForwardProp:o=>r(o)||"classes"===o,name:"MuiMenu",slot:"Root"})({}),T=a(l,{name:"MuiMenu",slot:"Paper"})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),h=a(c,{name:"MuiMenu",slot:"List"})({outline:0}),v=o.forwardRef(function(r,a){const i=u({props:r,name:"MuiMenu"}),{autoFocus:l=!0,children:c,className:x,disableAutoFocusItem:P=!1,MenuListProps:v={},onClose:M,open:F,PaperProps:O={},PopoverClasses:g,transitionDuration:w="auto",TransitionProps:{onEntering:S,...C}={},variant:D="selectedMenu",slots:E={},slotProps:k={},...N}=i,L=t(),I={...i,autoFocus:l,disableAutoFocusItem:P,MenuListProps:v,onEntering:S,PaperProps:O,transitionDuration:w,TransitionProps:C,variant:D},R=(o=>{const{classes:e}=o;return d({root:["root"],paper:["paper"],list:["list"]},s,e)})(I),_=l&&!P&&F,z=o.useRef(null);let A=-1;o.Children.map(c,(e,t)=>{o.isValidElement(e)&&("production"!==process.env.NODE_ENV&&f.exports.isFragment(e)&&console.error(["MUI: The Menu component doesn't accept a Fragment as a child.","Consider providing an array instead."].join("\n")),e.props.disabled||("selectedMenu"===D&&e.props.selected||-1===A)&&(A=t))});const H={slots:E,slotProps:{list:v,transition:C,paper:O,...k}},K=m({elementType:E.root,externalSlotProps:k.root,ownerState:I,className:[R.root,x]}),[V,q]=p("paper",{className:R.paper,elementType:T,externalForwardedProps:H,shouldForwardComponentProp:!0,ownerState:I}),[U,W]=p("list",{className:e(R.list,v.className),elementType:h,shouldForwardComponentProp:!0,externalForwardedProps:H,getSlotProps:o=>({...o,onKeyDown:e=>{(o=>{"Tab"===o.key&&(o.preventDefault(),M&&M(o,"tabKeyDown"))})(e),o.onKeyDown?.(e)}}),ownerState:I}),B="function"==typeof H.slotProps.transition?H.slotProps.transition(I):H.slotProps.transition;return n(j,{onClose:M,anchorOrigin:{vertical:"bottom",horizontal:L?"right":"left"},transformOrigin:L?b:y,slots:{root:E.root,paper:V,backdrop:E.backdrop,...E.transition&&{transition:E.transition}},slotProps:{root:K,paper:q,backdrop:"function"==typeof k.backdrop?k.backdrop(I):k.backdrop,transition:{...B,onEntering:(...o)=>{((o,e)=>{z.current&&z.current.adjustStyleForScrollbar(o,{direction:L?"rtl":"ltr"}),S&&S(o,e)})(...o),B?.onEntering?.(...o)}}},open:F,ref:a,transitionDuration:w,ownerState:I,...N,classes:g,children:n(U,{actions:z,autoFocus:l&&(-1===A||P),autoFocusItem:_,variant:D,...W,children:c})})});"production"!==process.env.NODE_ENV&&(v.propTypes={anchorEl:P.exports.oneOfType([x,P.exports.func]),autoFocus:P.exports.bool,children:P.exports.node,classes:P.exports.object,className:P.exports.string,disableAutoFocusItem:P.exports.bool,MenuListProps:P.exports.object,onClose:P.exports.func,open:P.exports.bool.isRequired,PaperProps:P.exports.object,PopoverClasses:P.exports.object,slotProps:P.exports.shape({backdrop:P.exports.oneOfType([P.exports.func,P.exports.object]),list:P.exports.oneOfType([P.exports.func,P.exports.object]),paper:P.exports.oneOfType([P.exports.func,P.exports.object]),root:P.exports.oneOfType([P.exports.func,P.exports.object]),transition:P.exports.oneOfType([P.exports.func,P.exports.object])}),slots:P.exports.shape({backdrop:P.exports.elementType,list:P.exports.elementType,paper:P.exports.elementType,root:P.exports.elementType,transition:P.exports.elementType}),sx:P.exports.oneOfType([P.exports.arrayOf(P.exports.oneOfType([P.exports.func,P.exports.object,P.exports.bool])),P.exports.func,P.exports.object]),transitionDuration:P.exports.oneOfType([P.exports.oneOf(["auto"]),P.exports.number,P.exports.shape({appear:P.exports.number,enter:P.exports.number,exit:P.exports.number})]),TransitionProps:P.exports.object,variant:P.exports.oneOf(["menu","selectedMenu"])});var M=v;export{T as MenuPaper,M as default};
1
+ import*as o from"react";import"../../node_modules/react-is/index.js";import"../../../../prop-types/index.js";import{clsx as e}from"../../../../clsx/dist/clsx.mjs.js";import{useRtl as t}from"../../../system/esm/RtlProvider/index.js";import r from"../styles/rootShouldForwardProp.js";import{getMenuUtilityClass as s}from"./menuClasses.js";import p from"../utils/useSlot.js";import{jsx as n}from"react/jsx-runtime";import a from"../styles/styled.js";import i,{PopoverPaper as l}from"../Popover/Popover.js";import c from"../MenuList/MenuList.js";import{useDefaultProps as u}from"../DefaultPropsProvider/DefaultPropsProvider.js";import m from"../../../utils/esm/useSlotProps/useSlotProps.js";import x from"../../../utils/esm/HTMLElementType/HTMLElementType.js";import d from"../../../utils/esm/composeClasses/composeClasses.js";import{r as f}from"../../../../../_virtual/index4.js";import{p as P}from"../../../../../_virtual/index5.js";const b={vertical:"top",horizontal:"right"},y={vertical:"top",horizontal:"left"},j=a(i,{shouldForwardProp:o=>r(o)||"classes"===o,name:"MuiMenu",slot:"Root"})({}),T=a(l,{name:"MuiMenu",slot:"Paper"})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),h=a(c,{name:"MuiMenu",slot:"List"})({outline:0}),v=o.forwardRef(function(r,a){const i=u({props:r,name:"MuiMenu"}),{autoFocus:l=!0,children:c,className:x,disableAutoFocusItem:P=!1,MenuListProps:v={},onClose:M,open:F,PaperProps:O={},PopoverClasses:g,transitionDuration:w="auto",TransitionProps:{onEntering:S,...C}={},variant:D="selectedMenu",slots:E={},slotProps:k={},...N}=i,L=t(),I={...i,autoFocus:l,disableAutoFocusItem:P,MenuListProps:v,onEntering:S,PaperProps:O,transitionDuration:w,TransitionProps:C,variant:D},R=(o=>{const{classes:e}=o;return d({root:["root"],paper:["paper"],list:["list"]},s,e)})(I),_=l&&!P&&F,z=o.useRef(null);let A=-1;o.Children.map(c,(e,t)=>{o.isValidElement(e)&&("production"!==process.env.NODE_ENV&&f.exports.isFragment(e)&&console.error(["MUI: The Menu component doesn't accept a Fragment as a child.","Consider providing an array instead."].join("\n")),e.props.disabled||("selectedMenu"===D&&e.props.selected||-1===A)&&(A=t))});const H={slots:E,slotProps:{list:v,transition:C,paper:O,...k}},K=m({elementType:E.root,externalSlotProps:k.root,ownerState:I,className:[R.root,x]}),[V,q]=p("paper",{className:R.paper,elementType:T,externalForwardedProps:H,shouldForwardComponentProp:!0,ownerState:I}),[U,W]=p("list",{className:e(R.list,v.className),elementType:h,shouldForwardComponentProp:!0,externalForwardedProps:H,getSlotProps:o=>({...o,onKeyDown:e=>{(o=>{"Tab"===o.key&&(o.preventDefault(),M&&M(o,"tabKeyDown"))})(e),o.onKeyDown?.(e)}}),ownerState:I}),B="function"==typeof H.slotProps.transition?H.slotProps.transition(I):H.slotProps.transition;return n(j,{onClose:M,anchorOrigin:{vertical:"bottom",horizontal:L?"right":"left"},transformOrigin:L?b:y,slots:{root:E.root,paper:V,backdrop:E.backdrop,...E.transition&&{transition:E.transition}},slotProps:{root:K,paper:q,backdrop:"function"==typeof k.backdrop?k.backdrop(I):k.backdrop,transition:{...B,onEntering:(...o)=>{((o,e)=>{z.current&&z.current.adjustStyleForScrollbar(o,{direction:L?"rtl":"ltr"}),S&&S(o,e)})(...o),B?.onEntering?.(...o)}}},open:F,ref:a,transitionDuration:w,ownerState:I,...N,classes:g,children:n(U,{actions:z,autoFocus:l&&(-1===A||P),autoFocusItem:_,variant:D,...W,children:c})})});"production"!==process.env.NODE_ENV&&(v.propTypes={anchorEl:P.exports.oneOfType([x,P.exports.func]),autoFocus:P.exports.bool,children:P.exports.node,classes:P.exports.object,className:P.exports.string,disableAutoFocusItem:P.exports.bool,MenuListProps:P.exports.object,onClose:P.exports.func,open:P.exports.bool.isRequired,PaperProps:P.exports.object,PopoverClasses:P.exports.object,slotProps:P.exports.shape({backdrop:P.exports.oneOfType([P.exports.func,P.exports.object]),list:P.exports.oneOfType([P.exports.func,P.exports.object]),paper:P.exports.oneOfType([P.exports.func,P.exports.object]),root:P.exports.oneOfType([P.exports.func,P.exports.object]),transition:P.exports.oneOfType([P.exports.func,P.exports.object])}),slots:P.exports.shape({backdrop:P.exports.elementType,list:P.exports.elementType,paper:P.exports.elementType,root:P.exports.elementType,transition:P.exports.elementType}),sx:P.exports.oneOfType([P.exports.arrayOf(P.exports.oneOfType([P.exports.func,P.exports.object,P.exports.bool])),P.exports.func,P.exports.object]),transitionDuration:P.exports.oneOfType([P.exports.oneOf(["auto"]),P.exports.number,P.exports.shape({appear:P.exports.number,enter:P.exports.number,exit:P.exports.number})]),TransitionProps:P.exports.object,variant:P.exports.oneOf(["menu","selectedMenu"])});var M=v;export{T as MenuPaper,M as default};
2
2
  //# sourceMappingURL=Menu.js.map
@@ -1,2 +1,2 @@
1
- import*as e from"react";import"../../node_modules/react-is/index.js";import"../../../../prop-types/index.js";import{jsx as t}from"react/jsx-runtime";import r from"../../../utils/esm/getScrollbarSize/getScrollbarSize.js";import n from"../List/List.js";import s from"../../../utils/esm/useEnhancedEffect/useEnhancedEffect.js";import i from"../../../utils/esm/ownerWindow/ownerWindow.js";import o from"../../../utils/esm/useForkRef/useForkRef.js";import{r as l}from"../../../../../_virtual/index3.js";import{p as a}from"../../../../../_virtual/index5.js";import u from"../../../utils/esm/ownerDocument/ownerDocument.js";function c(e,t,r){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:r?null:e.firstChild}function p(e,t,r){return e===t?r?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:r?null:e.lastChild}function d(e,t){if(void 0===t)return!0;let r=e.innerText;return void 0===r&&(r=e.textContent),r=r.trim().toLowerCase(),0!==r.length&&(t.repeating?r[0]===t.keys[0]:r.startsWith(t.keys.join("")))}function m(e,t,r,n,s,i){let o=!1,l=s(e,t,!!t&&r);for(;l;){if(l===e.firstChild){if(o)return!1;o=!0}const t=!n&&(l.disabled||"true"===l.getAttribute("aria-disabled"));if(l.hasAttribute("tabindex")&&d(l,i)&&!t)return l.focus(),!0;l=s(e,l,r)}return!1}const f=e.forwardRef(function(a,f){const{actions:h,autoFocus:g=!1,autoFocusItem:b=!1,children:y,className:v,disabledItemsFocusable:x=!1,disableListWrap:w=!1,onKeyDown:E,variant:j="selectedMenu",...D}=a,k=e.useRef(null),C=e.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});s(()=>{g&&k.current.focus()},[g]),e.useImperativeHandle(h,()=>({adjustStyleForScrollbar:(e,{direction:t})=>{const n=!k.current.style.width;if(e.clientHeight<k.current.clientHeight&&n){const n=`${r(i(e))}px`;k.current.style["rtl"===t?"paddingLeft":"paddingRight"]=n,k.current.style.width=`calc(100% + ${n})`}return k.current}}),[]);const F=o(k,f);let S=-1;e.Children.forEach(y,(t,r)=>{e.isValidElement(t)?("production"!==process.env.NODE_ENV&&l.exports.isFragment(t)&&console.error(["MUI: The Menu component doesn't accept a Fragment as a child.","Consider providing an array instead."].join("\n")),t.props.disabled||("selectedMenu"===j&&t.props.selected||-1===S)&&(S=r),S===r&&(t.props.disabled||t.props.muiSkipListHighlight||t.type.muiSkipListHighlight)&&(S+=1,S>=y.length&&(S=-1))):S===r&&(S+=1,S>=y.length&&(S=-1))});const K=e.Children.map(y,(t,r)=>{if(r===S){const r={};return b&&(r.autoFocus=!0),void 0===t.props.tabIndex&&"selectedMenu"===j&&(r.tabIndex=0),e.cloneElement(t,r)}return t});return t(n,{role:"menu",ref:F,className:v,onKeyDown:e=>{const t=k.current,r=e.key;if(e.ctrlKey||e.metaKey||e.altKey)return void(E&&E(e));const n=u(t).activeElement;if("ArrowDown"===r)e.preventDefault(),m(t,n,w,x,c);else if("ArrowUp"===r)e.preventDefault(),m(t,n,w,x,p);else if("Home"===r)e.preventDefault(),m(t,null,w,x,c);else if("End"===r)e.preventDefault(),m(t,null,w,x,p);else if(1===r.length){const s=C.current,i=r.toLowerCase(),o=performance.now();s.keys.length>0&&(o-s.lastTime>500?(s.keys=[],s.repeating=!0,s.previousKeyMatched=!0):s.repeating&&i!==s.keys[0]&&(s.repeating=!1)),s.lastTime=o,s.keys.push(i);const l=n&&!s.repeating&&d(n,s);s.previousKeyMatched&&(l||m(t,n,!1,x,c,s))?e.preventDefault():s.previousKeyMatched=!1}E&&E(e)},tabIndex:g?0:-1,...D,children:K})});"production"!==process.env.NODE_ENV&&(f.propTypes={autoFocus:a.exports.bool,autoFocusItem:a.exports.bool,children:a.exports.node,className:a.exports.string,disabledItemsFocusable:a.exports.bool,disableListWrap:a.exports.bool,onKeyDown:a.exports.func,variant:a.exports.oneOf(["menu","selectedMenu"])});var h=f;export{h as default};
1
+ import*as e from"react";import"../../node_modules/react-is/index.js";import"../../../../prop-types/index.js";import{jsx as t}from"react/jsx-runtime";import r from"../../../utils/esm/getScrollbarSize/getScrollbarSize.js";import n from"../List/List.js";import s from"../../../utils/esm/useEnhancedEffect/useEnhancedEffect.js";import i from"../../../utils/esm/ownerWindow/ownerWindow.js";import o from"../../../utils/esm/useForkRef/useForkRef.js";import{r as l}from"../../../../../_virtual/index4.js";import{p as a}from"../../../../../_virtual/index5.js";import u from"../../../utils/esm/ownerDocument/ownerDocument.js";function c(e,t,r){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:r?null:e.firstChild}function p(e,t,r){return e===t?r?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:r?null:e.lastChild}function d(e,t){if(void 0===t)return!0;let r=e.innerText;return void 0===r&&(r=e.textContent),r=r.trim().toLowerCase(),0!==r.length&&(t.repeating?r[0]===t.keys[0]:r.startsWith(t.keys.join("")))}function m(e,t,r,n,s,i){let o=!1,l=s(e,t,!!t&&r);for(;l;){if(l===e.firstChild){if(o)return!1;o=!0}const t=!n&&(l.disabled||"true"===l.getAttribute("aria-disabled"));if(l.hasAttribute("tabindex")&&d(l,i)&&!t)return l.focus(),!0;l=s(e,l,r)}return!1}const f=e.forwardRef(function(a,f){const{actions:h,autoFocus:g=!1,autoFocusItem:b=!1,children:y,className:v,disabledItemsFocusable:x=!1,disableListWrap:w=!1,onKeyDown:E,variant:j="selectedMenu",...D}=a,k=e.useRef(null),C=e.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});s(()=>{g&&k.current.focus()},[g]),e.useImperativeHandle(h,()=>({adjustStyleForScrollbar:(e,{direction:t})=>{const n=!k.current.style.width;if(e.clientHeight<k.current.clientHeight&&n){const n=`${r(i(e))}px`;k.current.style["rtl"===t?"paddingLeft":"paddingRight"]=n,k.current.style.width=`calc(100% + ${n})`}return k.current}}),[]);const F=o(k,f);let S=-1;e.Children.forEach(y,(t,r)=>{e.isValidElement(t)?("production"!==process.env.NODE_ENV&&l.exports.isFragment(t)&&console.error(["MUI: The Menu component doesn't accept a Fragment as a child.","Consider providing an array instead."].join("\n")),t.props.disabled||("selectedMenu"===j&&t.props.selected||-1===S)&&(S=r),S===r&&(t.props.disabled||t.props.muiSkipListHighlight||t.type.muiSkipListHighlight)&&(S+=1,S>=y.length&&(S=-1))):S===r&&(S+=1,S>=y.length&&(S=-1))});const K=e.Children.map(y,(t,r)=>{if(r===S){const r={};return b&&(r.autoFocus=!0),void 0===t.props.tabIndex&&"selectedMenu"===j&&(r.tabIndex=0),e.cloneElement(t,r)}return t});return t(n,{role:"menu",ref:F,className:v,onKeyDown:e=>{const t=k.current,r=e.key;if(e.ctrlKey||e.metaKey||e.altKey)return void(E&&E(e));const n=u(t).activeElement;if("ArrowDown"===r)e.preventDefault(),m(t,n,w,x,c);else if("ArrowUp"===r)e.preventDefault(),m(t,n,w,x,p);else if("Home"===r)e.preventDefault(),m(t,null,w,x,c);else if("End"===r)e.preventDefault(),m(t,null,w,x,p);else if(1===r.length){const s=C.current,i=r.toLowerCase(),o=performance.now();s.keys.length>0&&(o-s.lastTime>500?(s.keys=[],s.repeating=!0,s.previousKeyMatched=!0):s.repeating&&i!==s.keys[0]&&(s.repeating=!1)),s.lastTime=o,s.keys.push(i);const l=n&&!s.repeating&&d(n,s);s.previousKeyMatched&&(l||m(t,n,!1,x,c,s))?e.preventDefault():s.previousKeyMatched=!1}E&&E(e)},tabIndex:g?0:-1,...D,children:K})});"production"!==process.env.NODE_ENV&&(f.propTypes={autoFocus:a.exports.bool,autoFocusItem:a.exports.bool,children:a.exports.node,className:a.exports.string,disabledItemsFocusable:a.exports.bool,disableListWrap:a.exports.bool,onKeyDown:a.exports.func,variant:a.exports.oneOf(["menu","selectedMenu"])});var h=f;export{h as default};
2
2
  //# sourceMappingURL=MenuList.js.map
@@ -1,2 +1,2 @@
1
- import*as e from"react";import"../../node_modules/react-is/index.js";import"../../../../prop-types/index.js";import{clsx as r}from"../../../../clsx/dist/clsx.mjs.js";import o from"../Menu/Menu.js";import{StyledSelectSelect as t,StyledSelectIcon as n}from"../NativeSelect/NativeSelectInput.js";import{isFilled as s}from"../InputBase/utils.js";import l from"../styles/slotShouldForwardProp.js";import a,{getSelectUtilityClasses as i}from"./selectClasses.js";import{jsxs as p,jsx as u}from"react/jsx-runtime";import c from"../styles/styled.js";import d from"../../../utils/esm/formatMuiErrorMessage/formatMuiErrorMessage.js";import m from"../../../utils/esm/useId/useId.js";import f from"../../../utils/esm/refType/refType.js";import v from"../../../utils/esm/composeClasses/composeClasses.js";import b from"../../../utils/esm/capitalize/capitalize.js";import x from"../../../utils/esm/useControlled/useControlled.js";import h from"../../../utils/esm/useForkRef/useForkRef.js";import y from"../../../utils/esm/ownerDocument/ownerDocument.js";import{r as g}from"../../../../../_virtual/index3.js";import{p as j}from"../../../../../_virtual/index5.js";var w;const E=c(t,{name:"MuiSelect",slot:"Select",overridesResolver:(e,r)=>{const{ownerState:o}=e;return[{[`&.${a.select}`]:r.select},{[`&.${a.select}`]:r[o.variant]},{[`&.${a.error}`]:r.error},{[`&.${a.multiple}`]:r.multiple}]}})({[`&.${a.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),S=c(n,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,r)=>{const{ownerState:o}=e;return[r.icon,o.variant&&r[`icon${b(o.variant)}`],o.open&&r.iconOpen]}})({}),I=c("input",{shouldForwardProp:e=>l(e)&&"classes"!==e,name:"MuiSelect",slot:"NativeInput"})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function C(e,r){return"object"==typeof r&&null!==r?e===r:String(e)===String(r)}function O(e){return null==e||"string"==typeof e&&!e.trim()}const N=e.forwardRef(function(t,n){const{"aria-describedby":l,"aria-label":a,autoFocus:c,autoWidth:f,children:j,className:N,defaultOpen:M,defaultValue:P,disabled:D,displayEmpty:$,error:F=!1,IconComponent:R,inputRef:k,labelId:A,MenuProps:T={},multiple:V,name:U,onBlur:W,onChange:_,onClose:B,onFocus:q,onOpen:z,open:K,readOnly:L,renderValue:H,required:Y,SelectDisplayProps:G={},tabIndex:J,type:Q,value:X,variant:Z="standard",...ee}=t,[re,oe]=x({controlled:X,default:P,name:"Select"}),[te,ne]=x({controlled:K,default:M,name:"Select"}),se=e.useRef(null),le=e.useRef(null),[ae,ie]=e.useState(null),{current:pe}=e.useRef(null!=K),[ue,ce]=e.useState(),de=h(n,k),me=e.useCallback(e=>{le.current=e,e&&ie(e)},[]),fe=ae?.parentNode;e.useImperativeHandle(de,()=>({focus:()=>{le.current.focus()},node:se.current,value:re}),[re]),e.useEffect(()=>{M&&te&&ae&&!pe&&(ce(f?null:fe.clientWidth),le.current.focus())},[ae,f]),e.useEffect(()=>{c&&le.current.focus()},[c]),e.useEffect(()=>{if(!A)return;const e=y(le.current).getElementById(A);if(e){const r=()=>{getSelection().isCollapsed&&le.current.focus()};return e.addEventListener("click",r),()=>{e.removeEventListener("click",r)}}},[A]);const ve=(e,r)=>{e?z&&z(r):B&&B(r),pe||(ce(f?null:fe.clientWidth),ne(e))},be=e.Children.toArray(j),xe=e=>r=>{let o;if(r.currentTarget.hasAttribute("tabindex")){if(V){o=Array.isArray(re)?re.slice():[];const r=re.indexOf(e.props.value);-1===r?o.push(e.props.value):o.splice(r,1)}else o=e.props.value;if(e.props.onClick&&e.props.onClick(r),re!==o&&(oe(o),_)){const t=r.nativeEvent||r,n=new t.constructor(t.type,t);Object.defineProperty(n,"target",{writable:!0,value:{value:o,name:U}}),_(n,e)}V||ve(!1,r)}},he=null!==ae&&te;let ye,ge;delete ee["aria-invalid"];const je=[];let we=!1,Ee=!1;(s({value:re})||$)&&(H?ye=H(re):we=!0);const Se=be.map(r=>{if(!e.isValidElement(r))return null;let o;if("production"!==process.env.NODE_ENV&&g.exports.isFragment(r)&&console.error(["MUI: The Select component doesn't accept a Fragment as a child.","Consider providing an array instead."].join("\n")),V){if(!Array.isArray(re))throw new Error("production"!==process.env.NODE_ENV?"MUI: The `value` prop must be an array when using the `Select` component with `multiple`.":d(2));o=re.some(e=>C(e,r.props.value)),o&&we&&je.push(r.props.children)}else o=C(re,r.props.value),o&&we&&(ge=r.props.children);return o&&(Ee=!0),e.cloneElement(r,{"aria-selected":o?"true":"false",onClick:xe(r),onKeyUp:e=>{" "===e.key&&e.preventDefault(),r.props.onKeyUp&&r.props.onKeyUp(e)},role:"option",selected:o,value:void 0,"data-value":r.props.value})});"production"!==process.env.NODE_ENV&&e.useEffect(()=>{if(!Ee&&!V&&""!==re){const e=be.map(e=>e.props.value);[`MUI: You have provided an out-of-range value \`${re}\` for the select ${U?`(name="${U}") `:""}component.`,"Consider providing a value that matches one of the available options or ''.",`The available values are ${e.filter(e=>null!=e).map(e=>`\`${e}\``).join(", ")||'""'}.`].join("\n")}},[Ee,be,V,U,re]),we&&(ye=V?0===je.length?null:je.reduce((e,r,o)=>(e.push(r),o<je.length-1&&e.push(", "),e),[]):ge);let Ie,Ce=ue;!f&&pe&&ae&&(Ce=fe.clientWidth),Ie=void 0!==J?J:D?null:0;const Oe=G.id||(U?`mui-component-select-${U}`:void 0),Ne={...t,variant:Z,value:re,open:he,error:F},Me=(e=>{const{classes:r,variant:o,disabled:t,multiple:n,open:s,error:l}=e,a={select:["select",o,t&&"disabled",n&&"multiple",l&&"error"],icon:["icon",`icon${b(o)}`,s&&"iconOpen",t&&"disabled"],nativeInput:["nativeInput"]};return v(a,i,r)})(Ne),Pe={...T.PaperProps,...T.slotProps?.paper},De={...T.MenuListProps,...T.slotProps?.list},$e=m();return p(e.Fragment,{children:[u(E,{as:"div",ref:me,tabIndex:Ie,role:"combobox","aria-controls":he?$e:void 0,"aria-disabled":D?"true":void 0,"aria-expanded":he?"true":"false","aria-haspopup":"listbox","aria-label":a,"aria-labelledby":[A,Oe].filter(Boolean).join(" ")||void 0,"aria-describedby":l,"aria-required":Y?"true":void 0,"aria-invalid":F?"true":void 0,onKeyDown:e=>{if(!L){[" ","ArrowUp","ArrowDown","Enter"].includes(e.key)&&(e.preventDefault(),ve(!0,e))}},onMouseDown:D||L?null:e=>{0===e.button&&(e.preventDefault(),le.current.focus(),ve(!0,e))},onBlur:e=>{!he&&W&&(Object.defineProperty(e,"target",{writable:!0,value:{value:re,name:U}}),W(e))},onFocus:q,...G,ownerState:Ne,className:r(G.className,Me.select,N),id:Oe,children:O(ye)?w||(w=u("span",{className:"notranslate","aria-hidden":!0,children:"​"})):ye}),u(I,{"aria-invalid":F,value:Array.isArray(re)?re.join(","):re,name:U,ref:se,"aria-hidden":!0,onChange:e=>{const r=be.find(r=>r.props.value===e.target.value);void 0!==r&&(oe(r.props.value),_&&_(e,r))},tabIndex:-1,disabled:D,className:Me.nativeInput,autoFocus:c,required:Y,...ee,ownerState:Ne}),u(S,{as:R,className:Me.icon,ownerState:Ne}),u(o,{id:`menu-${U||""}`,anchorEl:fe,open:he,onClose:e=>{ve(!1,e)},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...T,slotProps:{...T.slotProps,list:{"aria-labelledby":A,role:"listbox","aria-multiselectable":V?"true":void 0,disableListWrap:!0,id:$e,...De},paper:{...Pe,style:{minWidth:Ce,...null!=Pe?Pe.style:null}}},children:Se})]})});"production"!==process.env.NODE_ENV&&(N.propTypes={"aria-describedby":j.exports.string,"aria-label":j.exports.string,autoFocus:j.exports.bool,autoWidth:j.exports.bool,children:j.exports.node,classes:j.exports.object,className:j.exports.string,defaultOpen:j.exports.bool,defaultValue:j.exports.any,disabled:j.exports.bool,displayEmpty:j.exports.bool,error:j.exports.bool,IconComponent:j.exports.elementType.isRequired,inputRef:f,labelId:j.exports.string,MenuProps:j.exports.object,multiple:j.exports.bool,name:j.exports.string,onBlur:j.exports.func,onChange:j.exports.func,onClose:j.exports.func,onFocus:j.exports.func,onOpen:j.exports.func,open:j.exports.bool,readOnly:j.exports.bool,renderValue:j.exports.func,required:j.exports.bool,SelectDisplayProps:j.exports.object,tabIndex:j.exports.oneOfType([j.exports.number,j.exports.string]),type:j.exports.any,value:j.exports.any,variant:j.exports.oneOf(["standard","outlined","filled"])});var M=N;export{M as default};
1
+ import*as e from"react";import"../../node_modules/react-is/index.js";import"../../../../prop-types/index.js";import{clsx as r}from"../../../../clsx/dist/clsx.mjs.js";import o from"../Menu/Menu.js";import{StyledSelectSelect as t,StyledSelectIcon as n}from"../NativeSelect/NativeSelectInput.js";import{isFilled as s}from"../InputBase/utils.js";import l from"../styles/slotShouldForwardProp.js";import a,{getSelectUtilityClasses as i}from"./selectClasses.js";import{jsxs as p,jsx as u}from"react/jsx-runtime";import c from"../styles/styled.js";import d from"../../../utils/esm/formatMuiErrorMessage/formatMuiErrorMessage.js";import m from"../../../utils/esm/useId/useId.js";import f from"../../../utils/esm/refType/refType.js";import v from"../../../utils/esm/composeClasses/composeClasses.js";import b from"../../../utils/esm/capitalize/capitalize.js";import x from"../../../utils/esm/useControlled/useControlled.js";import h from"../../../utils/esm/useForkRef/useForkRef.js";import y from"../../../utils/esm/ownerDocument/ownerDocument.js";import{r as g}from"../../../../../_virtual/index4.js";import{p as j}from"../../../../../_virtual/index5.js";var w;const E=c(t,{name:"MuiSelect",slot:"Select",overridesResolver:(e,r)=>{const{ownerState:o}=e;return[{[`&.${a.select}`]:r.select},{[`&.${a.select}`]:r[o.variant]},{[`&.${a.error}`]:r.error},{[`&.${a.multiple}`]:r.multiple}]}})({[`&.${a.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),S=c(n,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,r)=>{const{ownerState:o}=e;return[r.icon,o.variant&&r[`icon${b(o.variant)}`],o.open&&r.iconOpen]}})({}),I=c("input",{shouldForwardProp:e=>l(e)&&"classes"!==e,name:"MuiSelect",slot:"NativeInput"})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function C(e,r){return"object"==typeof r&&null!==r?e===r:String(e)===String(r)}function O(e){return null==e||"string"==typeof e&&!e.trim()}const N=e.forwardRef(function(t,n){const{"aria-describedby":l,"aria-label":a,autoFocus:c,autoWidth:f,children:j,className:N,defaultOpen:M,defaultValue:P,disabled:D,displayEmpty:$,error:F=!1,IconComponent:R,inputRef:k,labelId:A,MenuProps:T={},multiple:V,name:U,onBlur:W,onChange:_,onClose:B,onFocus:q,onOpen:z,open:K,readOnly:L,renderValue:H,required:Y,SelectDisplayProps:G={},tabIndex:J,type:Q,value:X,variant:Z="standard",...ee}=t,[re,oe]=x({controlled:X,default:P,name:"Select"}),[te,ne]=x({controlled:K,default:M,name:"Select"}),se=e.useRef(null),le=e.useRef(null),[ae,ie]=e.useState(null),{current:pe}=e.useRef(null!=K),[ue,ce]=e.useState(),de=h(n,k),me=e.useCallback(e=>{le.current=e,e&&ie(e)},[]),fe=ae?.parentNode;e.useImperativeHandle(de,()=>({focus:()=>{le.current.focus()},node:se.current,value:re}),[re]),e.useEffect(()=>{M&&te&&ae&&!pe&&(ce(f?null:fe.clientWidth),le.current.focus())},[ae,f]),e.useEffect(()=>{c&&le.current.focus()},[c]),e.useEffect(()=>{if(!A)return;const e=y(le.current).getElementById(A);if(e){const r=()=>{getSelection().isCollapsed&&le.current.focus()};return e.addEventListener("click",r),()=>{e.removeEventListener("click",r)}}},[A]);const ve=(e,r)=>{e?z&&z(r):B&&B(r),pe||(ce(f?null:fe.clientWidth),ne(e))},be=e.Children.toArray(j),xe=e=>r=>{let o;if(r.currentTarget.hasAttribute("tabindex")){if(V){o=Array.isArray(re)?re.slice():[];const r=re.indexOf(e.props.value);-1===r?o.push(e.props.value):o.splice(r,1)}else o=e.props.value;if(e.props.onClick&&e.props.onClick(r),re!==o&&(oe(o),_)){const t=r.nativeEvent||r,n=new t.constructor(t.type,t);Object.defineProperty(n,"target",{writable:!0,value:{value:o,name:U}}),_(n,e)}V||ve(!1,r)}},he=null!==ae&&te;let ye,ge;delete ee["aria-invalid"];const je=[];let we=!1,Ee=!1;(s({value:re})||$)&&(H?ye=H(re):we=!0);const Se=be.map(r=>{if(!e.isValidElement(r))return null;let o;if("production"!==process.env.NODE_ENV&&g.exports.isFragment(r)&&console.error(["MUI: The Select component doesn't accept a Fragment as a child.","Consider providing an array instead."].join("\n")),V){if(!Array.isArray(re))throw new Error("production"!==process.env.NODE_ENV?"MUI: The `value` prop must be an array when using the `Select` component with `multiple`.":d(2));o=re.some(e=>C(e,r.props.value)),o&&we&&je.push(r.props.children)}else o=C(re,r.props.value),o&&we&&(ge=r.props.children);return o&&(Ee=!0),e.cloneElement(r,{"aria-selected":o?"true":"false",onClick:xe(r),onKeyUp:e=>{" "===e.key&&e.preventDefault(),r.props.onKeyUp&&r.props.onKeyUp(e)},role:"option",selected:o,value:void 0,"data-value":r.props.value})});"production"!==process.env.NODE_ENV&&e.useEffect(()=>{if(!Ee&&!V&&""!==re){const e=be.map(e=>e.props.value);[`MUI: You have provided an out-of-range value \`${re}\` for the select ${U?`(name="${U}") `:""}component.`,"Consider providing a value that matches one of the available options or ''.",`The available values are ${e.filter(e=>null!=e).map(e=>`\`${e}\``).join(", ")||'""'}.`].join("\n")}},[Ee,be,V,U,re]),we&&(ye=V?0===je.length?null:je.reduce((e,r,o)=>(e.push(r),o<je.length-1&&e.push(", "),e),[]):ge);let Ie,Ce=ue;!f&&pe&&ae&&(Ce=fe.clientWidth),Ie=void 0!==J?J:D?null:0;const Oe=G.id||(U?`mui-component-select-${U}`:void 0),Ne={...t,variant:Z,value:re,open:he,error:F},Me=(e=>{const{classes:r,variant:o,disabled:t,multiple:n,open:s,error:l}=e,a={select:["select",o,t&&"disabled",n&&"multiple",l&&"error"],icon:["icon",`icon${b(o)}`,s&&"iconOpen",t&&"disabled"],nativeInput:["nativeInput"]};return v(a,i,r)})(Ne),Pe={...T.PaperProps,...T.slotProps?.paper},De={...T.MenuListProps,...T.slotProps?.list},$e=m();return p(e.Fragment,{children:[u(E,{as:"div",ref:me,tabIndex:Ie,role:"combobox","aria-controls":he?$e:void 0,"aria-disabled":D?"true":void 0,"aria-expanded":he?"true":"false","aria-haspopup":"listbox","aria-label":a,"aria-labelledby":[A,Oe].filter(Boolean).join(" ")||void 0,"aria-describedby":l,"aria-required":Y?"true":void 0,"aria-invalid":F?"true":void 0,onKeyDown:e=>{if(!L){[" ","ArrowUp","ArrowDown","Enter"].includes(e.key)&&(e.preventDefault(),ve(!0,e))}},onMouseDown:D||L?null:e=>{0===e.button&&(e.preventDefault(),le.current.focus(),ve(!0,e))},onBlur:e=>{!he&&W&&(Object.defineProperty(e,"target",{writable:!0,value:{value:re,name:U}}),W(e))},onFocus:q,...G,ownerState:Ne,className:r(G.className,Me.select,N),id:Oe,children:O(ye)?w||(w=u("span",{className:"notranslate","aria-hidden":!0,children:"​"})):ye}),u(I,{"aria-invalid":F,value:Array.isArray(re)?re.join(","):re,name:U,ref:se,"aria-hidden":!0,onChange:e=>{const r=be.find(r=>r.props.value===e.target.value);void 0!==r&&(oe(r.props.value),_&&_(e,r))},tabIndex:-1,disabled:D,className:Me.nativeInput,autoFocus:c,required:Y,...ee,ownerState:Ne}),u(S,{as:R,className:Me.icon,ownerState:Ne}),u(o,{id:`menu-${U||""}`,anchorEl:fe,open:he,onClose:e=>{ve(!1,e)},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...T,slotProps:{...T.slotProps,list:{"aria-labelledby":A,role:"listbox","aria-multiselectable":V?"true":void 0,disableListWrap:!0,id:$e,...De},paper:{...Pe,style:{minWidth:Ce,...null!=Pe?Pe.style:null}}},children:Se})]})});"production"!==process.env.NODE_ENV&&(N.propTypes={"aria-describedby":j.exports.string,"aria-label":j.exports.string,autoFocus:j.exports.bool,autoWidth:j.exports.bool,children:j.exports.node,classes:j.exports.object,className:j.exports.string,defaultOpen:j.exports.bool,defaultValue:j.exports.any,disabled:j.exports.bool,displayEmpty:j.exports.bool,error:j.exports.bool,IconComponent:j.exports.elementType.isRequired,inputRef:f,labelId:j.exports.string,MenuProps:j.exports.object,multiple:j.exports.bool,name:j.exports.string,onBlur:j.exports.func,onChange:j.exports.func,onClose:j.exports.func,onFocus:j.exports.func,onOpen:j.exports.func,open:j.exports.bool,readOnly:j.exports.bool,renderValue:j.exports.func,required:j.exports.bool,SelectDisplayProps:j.exports.object,tabIndex:j.exports.oneOfType([j.exports.number,j.exports.string]),type:j.exports.any,value:j.exports.any,variant:j.exports.oneOf(["standard","outlined","filled"])});var M=N;export{M as default};
2
2
  //# sourceMappingURL=SelectInput.js.map
@@ -1,2 +1,2 @@
1
- import*as e from"react";import"../../node_modules/react-is/index.js";import"../../../../prop-types/index.js";import{clsx as o}from"../../../../clsx/dist/clsx.mjs.js";import t from"../styles/useTheme.js";import{jsxs as r,jsx as n}from"react/jsx-runtime";import s from"../styles/styled.js";import i from"../utils/memoTheme.js";import a,{getSpeedDialUtilityClass as p}from"./speedDialClasses.js";import l from"../utils/useSlot.js";import c from"../Fab/Fab.js";import{useDefaultProps as u}from"../DefaultPropsProvider/DefaultPropsProvider.js";import m from"../../../utils/esm/useTimeout/useTimeout.js";import d from"../Zoom/Zoom.js";import f from"../../../utils/esm/composeClasses/composeClasses.js";import x from"../../../utils/esm/clamp/clamp.js";import y from"../../../utils/esm/capitalize/capitalize.js";import v from"../../../utils/esm/useControlled/useControlled.js";import b from"../../../utils/esm/useForkRef/useForkRef.js";import{r as j}from"../../../../../_virtual/index3.js";import g from"../../../utils/esm/isMuiElement/isMuiElement.js";import{p as D}from"../../../../../_virtual/index5.js";function h(e){return"up"===e||"down"===e?"vertical":"right"===e||"left"===e?"horizontal":void 0}const w=s("div",{name:"MuiSpeedDial",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,o[`direction${y(t.direction)}`]]}})(i(({theme:e})=>({zIndex:(e.vars||e).zIndex.speedDial,display:"flex",alignItems:"center",pointerEvents:"none",variants:[{props:{direction:"up"},style:{flexDirection:"column-reverse",[`& .${a.actions}`]:{flexDirection:"column-reverse",marginBottom:-32,paddingBottom:48}}},{props:{direction:"down"},style:{flexDirection:"column",[`& .${a.actions}`]:{flexDirection:"column",marginTop:-32,paddingTop:48}}},{props:{direction:"left"},style:{flexDirection:"row-reverse",[`& .${a.actions}`]:{flexDirection:"row-reverse",marginRight:-32,paddingRight:48}}},{props:{direction:"right"},style:{flexDirection:"row",[`& .${a.actions}`]:{flexDirection:"row",marginLeft:-32,paddingLeft:48}}}]}))),E=s(c,{name:"MuiSpeedDial",slot:"Fab"})({pointerEvents:"auto"}),T=s("div",{name:"MuiSpeedDial",slot:"Actions",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.actions,!t.open&&o.actionsClosed]}})({display:"flex",pointerEvents:"auto",variants:[{props:({ownerState:e})=>!e.open,style:{transition:"top 0s linear 0.2s",pointerEvents:"none"}}]}),C=e.forwardRef(function(s,i){const a=u({props:s,name:"MuiSpeedDial"}),c=t(),D={enter:c.transitions.duration.enteringScreen,exit:c.transitions.duration.leavingScreen},{ariaLabel:C,FabProps:{ref:P,...S}={},children:F,className:M,direction:O="up",hidden:R=!1,icon:L,onBlur:N,onClose:$,onFocus:k,onKeyDown:I,onMouseEnter:z,onMouseLeave:B,onOpen:K,open:_,openIcon:V,slots:A={},slotProps:Z={},TransitionComponent:q,TransitionProps:U,transitionDuration:G=D,...H}=a,[J,Q]=v({controlled:_,default:!1,name:"SpeedDial",state:"open"}),W={...a,open:J,direction:O},X=(e=>{const{classes:o,open:t,direction:r}=e,n={root:["root",`direction${y(r)}`],fab:["fab"],actions:["actions",!t&&"actionsClosed"]};return f(n,p,o)})(W),Y=m(),ee=e.useRef(0),oe=e.useRef(),te=e.useRef([]);te.current=[te.current[0]];const re=e.useCallback(e=>{te.current[0]=e},[]),ne=b(P,re),se=(e,o)=>t=>{te.current[e+1]=t,o&&o(t)};e.useEffect(()=>{J||(ee.current=0,oe.current=void 0)},[J]);const ie=e=>{"mouseleave"===e.type&&B&&B(e),"blur"===e.type&&N&&N(e),Y.clear(),"blur"===e.type?Y.start(0,()=>{Q(!1),$&&$(e,"blur")}):(Q(!1),$&&$(e,"mouseLeave"))},ae=e=>{"mouseenter"===e.type&&z&&z(e),"focus"===e.type&&k&&k(e),Y.clear(),J||Y.start(0,()=>{if(Q(!0),K){K(e,{focus:"focus",mouseenter:"mouseEnter"}[e.type])}})},pe=C.replace(/^[^a-z]+|[^\w:.-]+/gi,""),le=e.Children.toArray(F).filter(o=>("production"!==process.env.NODE_ENV&&j.exports.isFragment(o)&&console.error(["MUI: The SpeedDial component doesn't accept a Fragment as a child.","Consider providing an array instead."].join("\n")),e.isValidElement(o))),ce=le.map((o,t)=>{const{FabProps:{ref:r,...n}={},tooltipPlacement:s}=o.props,i=s||("vertical"===h(O)?"left":"top");return e.cloneElement(o,{FabProps:{...n,ref:se(t,r)},delay:30*(J?t:le.length-t),open:J,tooltipPlacement:i,id:`${pe}-action-${t}`})}),ue={slots:{transition:q,...A},slotProps:{transition:U,...Z}},[me,de]=l("root",{elementType:w,externalForwardedProps:{...ue,...H},ownerState:W,ref:i,className:o(X.root,M),additionalProps:{role:"presentation"},getSlotProps:e=>({...e,onKeyDown:o=>{e.onKeyDown?.(o),(e=>{I&&I(e);const o=e.key.replace("Arrow","").toLowerCase(),{current:t=o}=oe;if("Escape"===e.key)return Q(!1),te.current[0].focus(),void($&&$(e,"escapeKeyDown"));if(h(o)===h(t)&&void 0!==h(o)){e.preventDefault();const r=o===t?1:-1,n=x(ee.current+r,0,te.current.length-1);te.current[n].focus(),ee.current=n,oe.current=t}})(o)},onBlur:o=>{e.onBlur?.(o),ie(o)},onFocus:o=>{e.onFocus?.(o),ae(o)},onMouseEnter:o=>{e.onMouseEnter?.(o),ae(o)},onMouseLeave:o=>{e.onMouseLeave?.(o),ie(o)}})}),[fe,xe]=l("transition",{elementType:d,externalForwardedProps:ue,ownerState:W});return r(me,{...de,children:[n(fe,{in:!R,timeout:G,unmountOnExit:!0,...xe,children:n(E,{color:"primary","aria-label":C,"aria-haspopup":"true","aria-expanded":J,"aria-controls":`${pe}-actions`,...S,onClick:e=>{S.onClick&&S.onClick(e),Y.clear(),J?(Q(!1),$&&$(e,"toggle")):(Q(!0),K&&K(e,"toggle"))},className:o(X.fab,S.className),ref:ne,ownerState:W,children:e.isValidElement(L)&&g(L,["SpeedDialIcon"])?e.cloneElement(L,{open:J}):L})}),n(T,{id:`${pe}-actions`,role:"menu","aria-orientation":h(O),className:o(X.actions,!J&&X.actionsClosed),ownerState:W,children:ce})]})});"production"!==process.env.NODE_ENV&&(C.propTypes={ariaLabel:D.exports.string.isRequired,children:D.exports.node,classes:D.exports.object,className:D.exports.string,direction:D.exports.oneOf(["down","left","right","up"]),FabProps:D.exports.object,hidden:D.exports.bool,icon:D.exports.node,onBlur:D.exports.func,onClose:D.exports.func,onFocus:D.exports.func,onKeyDown:D.exports.func,onMouseEnter:D.exports.func,onMouseLeave:D.exports.func,onOpen:D.exports.func,open:D.exports.bool,openIcon:D.exports.node,slotProps:D.exports.shape({root:D.exports.oneOfType([D.exports.func,D.exports.object]),transition:D.exports.oneOfType([D.exports.func,D.exports.object])}),slots:D.exports.shape({root:D.exports.elementType,transition:D.exports.elementType}),sx:D.exports.oneOfType([D.exports.arrayOf(D.exports.oneOfType([D.exports.func,D.exports.object,D.exports.bool])),D.exports.func,D.exports.object]),TransitionComponent:D.exports.elementType,transitionDuration:D.exports.oneOfType([D.exports.number,D.exports.shape({appear:D.exports.number,enter:D.exports.number,exit:D.exports.number})]),TransitionProps:D.exports.object});var P=C;export{P as default};
1
+ import*as e from"react";import"../../node_modules/react-is/index.js";import"../../../../prop-types/index.js";import{clsx as o}from"../../../../clsx/dist/clsx.mjs.js";import t from"../styles/useTheme.js";import{jsxs as r,jsx as n}from"react/jsx-runtime";import s from"../styles/styled.js";import i from"../utils/memoTheme.js";import a,{getSpeedDialUtilityClass as p}from"./speedDialClasses.js";import l from"../utils/useSlot.js";import c from"../Fab/Fab.js";import{useDefaultProps as u}from"../DefaultPropsProvider/DefaultPropsProvider.js";import m from"../../../utils/esm/useTimeout/useTimeout.js";import d from"../Zoom/Zoom.js";import f from"../../../utils/esm/composeClasses/composeClasses.js";import x from"../../../utils/esm/clamp/clamp.js";import y from"../../../utils/esm/capitalize/capitalize.js";import v from"../../../utils/esm/useControlled/useControlled.js";import b from"../../../utils/esm/useForkRef/useForkRef.js";import{r as j}from"../../../../../_virtual/index4.js";import g from"../../../utils/esm/isMuiElement/isMuiElement.js";import{p as D}from"../../../../../_virtual/index5.js";function h(e){return"up"===e||"down"===e?"vertical":"right"===e||"left"===e?"horizontal":void 0}const w=s("div",{name:"MuiSpeedDial",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,o[`direction${y(t.direction)}`]]}})(i(({theme:e})=>({zIndex:(e.vars||e).zIndex.speedDial,display:"flex",alignItems:"center",pointerEvents:"none",variants:[{props:{direction:"up"},style:{flexDirection:"column-reverse",[`& .${a.actions}`]:{flexDirection:"column-reverse",marginBottom:-32,paddingBottom:48}}},{props:{direction:"down"},style:{flexDirection:"column",[`& .${a.actions}`]:{flexDirection:"column",marginTop:-32,paddingTop:48}}},{props:{direction:"left"},style:{flexDirection:"row-reverse",[`& .${a.actions}`]:{flexDirection:"row-reverse",marginRight:-32,paddingRight:48}}},{props:{direction:"right"},style:{flexDirection:"row",[`& .${a.actions}`]:{flexDirection:"row",marginLeft:-32,paddingLeft:48}}}]}))),E=s(c,{name:"MuiSpeedDial",slot:"Fab"})({pointerEvents:"auto"}),T=s("div",{name:"MuiSpeedDial",slot:"Actions",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.actions,!t.open&&o.actionsClosed]}})({display:"flex",pointerEvents:"auto",variants:[{props:({ownerState:e})=>!e.open,style:{transition:"top 0s linear 0.2s",pointerEvents:"none"}}]}),C=e.forwardRef(function(s,i){const a=u({props:s,name:"MuiSpeedDial"}),c=t(),D={enter:c.transitions.duration.enteringScreen,exit:c.transitions.duration.leavingScreen},{ariaLabel:C,FabProps:{ref:P,...S}={},children:F,className:M,direction:O="up",hidden:R=!1,icon:L,onBlur:N,onClose:$,onFocus:k,onKeyDown:I,onMouseEnter:z,onMouseLeave:B,onOpen:K,open:_,openIcon:V,slots:A={},slotProps:Z={},TransitionComponent:q,TransitionProps:U,transitionDuration:G=D,...H}=a,[J,Q]=v({controlled:_,default:!1,name:"SpeedDial",state:"open"}),W={...a,open:J,direction:O},X=(e=>{const{classes:o,open:t,direction:r}=e,n={root:["root",`direction${y(r)}`],fab:["fab"],actions:["actions",!t&&"actionsClosed"]};return f(n,p,o)})(W),Y=m(),ee=e.useRef(0),oe=e.useRef(),te=e.useRef([]);te.current=[te.current[0]];const re=e.useCallback(e=>{te.current[0]=e},[]),ne=b(P,re),se=(e,o)=>t=>{te.current[e+1]=t,o&&o(t)};e.useEffect(()=>{J||(ee.current=0,oe.current=void 0)},[J]);const ie=e=>{"mouseleave"===e.type&&B&&B(e),"blur"===e.type&&N&&N(e),Y.clear(),"blur"===e.type?Y.start(0,()=>{Q(!1),$&&$(e,"blur")}):(Q(!1),$&&$(e,"mouseLeave"))},ae=e=>{"mouseenter"===e.type&&z&&z(e),"focus"===e.type&&k&&k(e),Y.clear(),J||Y.start(0,()=>{if(Q(!0),K){K(e,{focus:"focus",mouseenter:"mouseEnter"}[e.type])}})},pe=C.replace(/^[^a-z]+|[^\w:.-]+/gi,""),le=e.Children.toArray(F).filter(o=>("production"!==process.env.NODE_ENV&&j.exports.isFragment(o)&&console.error(["MUI: The SpeedDial component doesn't accept a Fragment as a child.","Consider providing an array instead."].join("\n")),e.isValidElement(o))),ce=le.map((o,t)=>{const{FabProps:{ref:r,...n}={},tooltipPlacement:s}=o.props,i=s||("vertical"===h(O)?"left":"top");return e.cloneElement(o,{FabProps:{...n,ref:se(t,r)},delay:30*(J?t:le.length-t),open:J,tooltipPlacement:i,id:`${pe}-action-${t}`})}),ue={slots:{transition:q,...A},slotProps:{transition:U,...Z}},[me,de]=l("root",{elementType:w,externalForwardedProps:{...ue,...H},ownerState:W,ref:i,className:o(X.root,M),additionalProps:{role:"presentation"},getSlotProps:e=>({...e,onKeyDown:o=>{e.onKeyDown?.(o),(e=>{I&&I(e);const o=e.key.replace("Arrow","").toLowerCase(),{current:t=o}=oe;if("Escape"===e.key)return Q(!1),te.current[0].focus(),void($&&$(e,"escapeKeyDown"));if(h(o)===h(t)&&void 0!==h(o)){e.preventDefault();const r=o===t?1:-1,n=x(ee.current+r,0,te.current.length-1);te.current[n].focus(),ee.current=n,oe.current=t}})(o)},onBlur:o=>{e.onBlur?.(o),ie(o)},onFocus:o=>{e.onFocus?.(o),ae(o)},onMouseEnter:o=>{e.onMouseEnter?.(o),ae(o)},onMouseLeave:o=>{e.onMouseLeave?.(o),ie(o)}})}),[fe,xe]=l("transition",{elementType:d,externalForwardedProps:ue,ownerState:W});return r(me,{...de,children:[n(fe,{in:!R,timeout:G,unmountOnExit:!0,...xe,children:n(E,{color:"primary","aria-label":C,"aria-haspopup":"true","aria-expanded":J,"aria-controls":`${pe}-actions`,...S,onClick:e=>{S.onClick&&S.onClick(e),Y.clear(),J?(Q(!1),$&&$(e,"toggle")):(Q(!0),K&&K(e,"toggle"))},className:o(X.fab,S.className),ref:ne,ownerState:W,children:e.isValidElement(L)&&g(L,["SpeedDialIcon"])?e.cloneElement(L,{open:J}):L})}),n(T,{id:`${pe}-actions`,role:"menu","aria-orientation":h(O),className:o(X.actions,!J&&X.actionsClosed),ownerState:W,children:ce})]})});"production"!==process.env.NODE_ENV&&(C.propTypes={ariaLabel:D.exports.string.isRequired,children:D.exports.node,classes:D.exports.object,className:D.exports.string,direction:D.exports.oneOf(["down","left","right","up"]),FabProps:D.exports.object,hidden:D.exports.bool,icon:D.exports.node,onBlur:D.exports.func,onClose:D.exports.func,onFocus:D.exports.func,onKeyDown:D.exports.func,onMouseEnter:D.exports.func,onMouseLeave:D.exports.func,onOpen:D.exports.func,open:D.exports.bool,openIcon:D.exports.node,slotProps:D.exports.shape({root:D.exports.oneOfType([D.exports.func,D.exports.object]),transition:D.exports.oneOfType([D.exports.func,D.exports.object])}),slots:D.exports.shape({root:D.exports.elementType,transition:D.exports.elementType}),sx:D.exports.oneOfType([D.exports.arrayOf(D.exports.oneOfType([D.exports.func,D.exports.object,D.exports.bool])),D.exports.func,D.exports.object]),TransitionComponent:D.exports.elementType,transitionDuration:D.exports.oneOfType([D.exports.number,D.exports.shape({appear:D.exports.number,enter:D.exports.number,exit:D.exports.number})]),TransitionProps:D.exports.object});var P=C;export{P as default};
2
2
  //# sourceMappingURL=SpeedDial.js.map