/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{createArcadeProfile as e,createArcadeExecutor as t}from"../../../arcade.js";const s=e("form-calculation");class r{constructor(){this._executors=new Map,this._executorPromises=new Map}async getArcadeExecutor(e){return this._executors.has(e)?this._executors.get(e):this._executorPromises.has(e)?this._executorPromises.get(e):this._createExecutor(e)}async _createExecutor(e){try{const r=t(e,s);this._executorPromises.set(e,r);const o=await r;return this._executors.set(e,o),o}finally{this._executorPromises.delete(e)}}}export{r as ArcadeExecutorProvider};
