/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{__decorate as r}from"tslib";import t from"./Accessor.js";import{DefaultsStore as o}from"./accessorSupport/DefaultsStore.js";import{setupConstructedDefaults as s}from"./accessorSupport/defaultsStoreUtils.js";import{read as e}from"./accessorSupport/read.js";import{getProperties as c}from"./accessorSupport/utils.js";import{write as i}from"./accessorSupport/write.js";import{subclass as p}from"./accessorSupport/decorators/subclass.js";const a=t=>{const a=t;let n=class extends a{constructor(...r){super(...r);const t=c(this),e=t.store,i=new o;t.store=i,s(t,e,i)}read(r,t){e(this,r,t)}write(r,t){return i(this,r??{},t)}toJSON(r){return this.write({},r)}static fromJSON(r,t){return u.call(this,r,t)}};return n=r([p("esri.core.JSONSupport")],n),n.prototype.toJSON.isDefaultToJSON=!0,n};function u(r,t){if(!r)return null;if(r.declaredClass)throw new Error("JSON object is already hydrated");const o=new this;return o.read(r,t),o}const n=a(t);export{n as JSONSupport,a as JSONSupportMixin};
