/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../core/handleUtils"],(function(e,t){"use strict";const n=Symbol("widget"),r=[],o={},i=new WeakMap;function d(e,t){let n=t.children;if(n&&n.length)for(let r=0;r<n.length;++r)n[r]=d(e,n[r]);else n=r;const i=t.vnodeSelector;if(c(i)){const r=t.properties||o,d=r.key||i;return{vnodeSelector:"div",properties:{key:d,afterCreate:s,afterUpdate:l,afterRemoved:a,parentWidget:e,widgetConstructor:i,widgetProperties:{...r,key:d,children:n}},children:void 0,text:void 0,domNode:null}}return t}function s(e,n,r,{parentWidget:o,widgetConstructor:d,widgetProperties:s}){const l=new d(s);l.container=e,i.set(e,l),null==l.afterCreate||l.afterCreate(l,e),o._internalHandles.add(t.makeHandle((()=>a(e))))}function l(e,t,n,{widgetProperties:r}){const o=i.get(e);o&&(o.set(r),null==o.afterUpdate||o.afterUpdate(o,e))}function a(e){const t=i.get(e);t&&(t.destroy(),i.delete(e))}function c(e){return"function"==typeof e&&e[n]}e.WIDGET_SYMBOL=n,e.isWidgetConstructor=c,e.processWidgets=d,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
