/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
v4.34.7 */
import{a as c,b as p}from"./D7F7K3QC.js";export default $arcgis.t(([f,{property:s,subclass:d},h])=>{var m=Object.defineProperty,w=Object.getOwnPropertyDescriptor,a=(t,r,o,e)=>{for(var n=e>1?void 0:e?w(r,o):r,l=t.length-1,u;l>=0;l--)(u=t[l])&&(n=(e?u(r,o,n):u(n))||n);return e&&n&&m(r,o,n),n};function _(t="Aborted"){return new h("AbortError",t)}function q(t,r="Aborted"){if(v(t))throw _(r)}function b(t){return t instanceof AbortSignal?t:t?.signal??void 0}function v(t){return b(t)?.aborted??!1}function y(t){return t?.name==="AbortError"}function C(t){return{ok:!0,value:t}}function g(t){return{ok:!1,error:t}}function k(t){return t?.ok?t.value:null}function A(t){return t!=null&&!t.ok?t.error:null}function E(t,r){let o=b(t);if(o==null)return;if(o.aborted){r();return}let e=()=>r();return o.addEventListener("abort",e,{once:!0}),{remove:()=>o.removeEventListener("abort",e)}}function D(t,r){return new i(t,r)}var i=class extends f{constructor(t,r){super({}),this._abortHandle=null,this.abort=()=>{this._abortController=c(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;let{signal:o}=this._abortController;this.promise=t(o),this.promise.then(e=>{this._result=C(e),this._cleanup()},e=>{this._result=g(e),this._cleanup()}),this._abortHandle=E(r,this.abort)}get value(){return k(this._result)}get error(){return A(this._result)}get finished(){return this._result!=null}destroy(){this.abort()}_cleanup(){this._abortHandle=p(this._abortHandle),this._abortController=null}[Symbol.dispose](){this._cleanup()}};a([s()],i.prototype,"value",1);a([s()],i.prototype,"error",1);a([s()],i.prototype,"finished",1);a([s()],i.prototype,"promise",2);a([s()],i.prototype,"_result",2);i=a([d("esri.components.asyncUtils.ReactiveTask")],i);function O(t){return t.catch(r=>{if(!y(r))throw r})}function P(t,r={}){if("requestIdleCallback"in window)return window.requestIdleCallback(t,r);let o=r.timeout!=null?r.timeout:50,e=typeof performance<"u"&&performance.now?performance.now.bind(performance):Date.now,n=e();return window.setTimeout(()=>{t({didTimeout:!1,timeRemaining(){return Math.max(0,o-(e()-n))}})},1)}function j(t){"cancelIdleCallback"in window&&window.cancelIdleCallback(t),window.clearTimeout(t)}return{a:q,b:v,c:y,d:D,e:O,f:P,g:j}},"core/Accessor","core/accessorSupport/decorators","core/Error")