//>>built
define("dojox/store/OData","dojo/io-query dojo/request dojo/_base/lang dojo/json dojo/_base/declare dojo/store/util/QueryResults".split(" "),function(m,g,h,n,l,p){return l(null,{headers:{MaxDataServiceVersion:"2.0"},target:"",idProperty:"id",accepts:"application/json;odata\x3dverbose",childAttr:"children",constructor:function(b){l.safeMixin(this,b)},get:function(b,a){a=a||{};var c=h.mixin({Accept:this.accepts},this.headers,a.headers||a);return g(this.target+"("+b+")",{handleAs:"json",headers:c}).then(function(d){return d.d})},
getIdentity:function(b){return b[this.idProperty]},put:function(b,a){a=a||{};var c=this.getIdentity(b)||a[this.idProperty],d=c?this.target+"("+c+")":this.target,e=h.mixin({"Content-Type":"application/json;odata\x3dverbose",Accept:this.accepts},this.headers,a.headers);c&&(e["X-HTTP-Method"]=a.overwrite?"PUT":"MERGE",e["IF-MATCH"]=a.overwrite?"*":a.etag||"*");return g.post(d,{handleAs:"json",data:n.stringify(b),headers:e})},add:function(b,a){a=a||{};a.overwrite=!1;return this.put(b,a)},remove:function(b,
a){a=a||{};return g.post(this.target+"("+b+")",{headers:h.mixin({"IF-MATCH":"*","X-HTTP-Method":"DELETE"},this.headers,a.headers)})},getFormDigest:function(){var b=this.target.indexOf("_vti_bin");b=this.target.slice(0,b)+"_api/contextinfo";return g.post(b).then(function(a){return a.substring(a.indexOf("\x3cd:FormDigestValue\x3e")+19,a.indexOf("\x3c/d:FormDigestValue\x3e"))})},getChildren:function(b,a){var c=this.getIdentity(object)||a[this.idProperty];return this.query({$filter:this.idProperty+" eq "+
c,$expand:this.childAttr},a)},query:function(b,a){a=a||{};var c=h.mixin({Accept:this.accepts},this.headers,a.headers);if(a&&a.sort){b.$orderby="";var d;var e=0;for(d=a.sort.length;e<d;e++){var f=a.sort[e];b.$orderby+=(0<e?",":"")+encodeURIComponent(f.attribute)+(f.descending?" desc":" asc")}}if(0<=a.start||0<=a.count)b.$skip=a.start||0,b.$inlinecount="allpages","count"in a&&Infinity!=a.count&&(b.$top=a.count);b=this.buildQueryString(b);c=g(this.target+(b||""),{handleAs:"json",headers:c});f=c.then(function(k){return k.d.results});
f=p(f);f.total=c.then(function(k){return k.d.__count});return f},buildQueryString:function(b){var a="",c;for(c in b)if(b.hasOwnProperty(c)&&-1==c.indexOf("$")){var d=b[c]+"",e=d.indexOf("*");-1!=e&&(d=d.slice(0!=e?0:1,d.length-(0!=e?1:0)),0<d.length&&(a+=0==a.length?"":"and ",a+=(0==e?"endswith":"startswith")+"("+c+",'"+d+"')"))}0<a.length&&(b.$filter=b.$filter&&0<b.$filter.length?b.$filter+" and "+a:a);a=-1<this.target.indexOf("?");b&&"object"==typeof b&&(b=(b=m.objectToQuery(b))?(a?"\x26":"?")+
b:"");return b}})});