From 62eb1f6f62ea39032db2005495a43e0c48d2a232 Mon Sep 17 00:00:00 2001 From: Travis Date: Tue, 7 Jul 2015 15:13:53 +0000 Subject: [PATCH] Update docs and files to distribute --- familysearch-javascript-sdk.js | 6 +++--- familysearch-javascript-sdk.min.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/familysearch-javascript-sdk.js b/familysearch-javascript-sdk.js index b520653..ce36674 100644 --- a/familysearch-javascript-sdk.js +++ b/familysearch-javascript-sdk.js @@ -8956,7 +8956,7 @@ FS.prototype.restoreChildAndParents = function(caprid, opts) { return self.helpers.chainHttpPromises( self.plumbing.getUrl('child-and-parents-relationship-restore-template', caprid, {caprid: caprid}), function(url) { - return self.plumbing.post(url, null, {}, opts, function() { + return self.plumbing.post(url, null, {'Content-Type': 'application/x-fs-v1+json'}, opts, function() { return caprid; }); } @@ -9527,7 +9527,7 @@ FS.prototype.restorePerson = function(pid, opts) { return self.helpers.chainHttpPromises( self.plumbing.getUrl('person-restore-template', pid, {pid: pid}), function(url) { - return self.plumbing.post(url, null, {}, opts, function() { + return self.plumbing.post(url, null, {'Content-Type': 'application/x-fs-v1+json'}, opts, function() { return pid; }); } @@ -11250,7 +11250,7 @@ FS.prototype.restoreCouple = function(crid, opts) { return self.helpers.chainHttpPromises( self.plumbing.getUrl('couple-relationship-restore-template', crid, {crid: crid}), function(url) { - return self.plumbing.post(url, null, {}, opts, function() { + return self.plumbing.post(url, null, {'Content-Type': 'application/x-fs-v1+json'}, opts, function() { return crid; }); } diff --git a/familysearch-javascript-sdk.min.js b/familysearch-javascript-sdk.min.js index e22307f..18776c2 100644 --- a/familysearch-javascript-sdk.min.js +++ b/familysearch-javascript-sdk.min.js @@ -1,4 +1,4 @@ !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;"undefined"!=typeof window?b=window:"undefined"!=typeof global?b=global:"undefined"!=typeof self&&(b=self),b.FamilySearch=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g0&&(g=(10>j?"0":"")+j.toString(),i++),c=a[i],i++,i=0&&(b=b.slice(0,c)),"from"===b[0]?(c=b.indexOf("to"),a=e(b.slice(1,c),!0)+"/"+e(b.slice(c+1),!0)):a=e(b,!1)}return a}}},{"./../FamilySearch":1}],12:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils"),f=e.maybe,g=d.Discussion=function(a,b){d.BaseClass.call(this,a,b)};d.prototype.createDiscussion=function(a){return new g(this,a)},g.prototype={constructor:g,$getDiscussionUrl:function(){return this.$helpers.removeAccessToken(f(f(this.links).discussion).href)},$getCommentsUrl:function(){return this.$helpers.removeAccessToken(f(f(this.links).comments).href)},$getComments:function(){return this.$client.getDiscussionComments(this.$getCommentsUrl())},$getAgentId:function(){return f(this.contributor).resourceId},$getAgentUrl:function(){return this.$helpers.removeAccessToken(f(this.contributor).resource)},$getAgent:function(){return this.$client.getAgent(this.$getAgentUrl()||this.$getAgentId())},$save:function(a,b,c){var d=this,f=d.$helpers.chainHttpPromises(d.id?d.$plumbing.getUrl("discussion-template",null,{did:d.id}):d.$plumbing.getUrl("discussions"),function(a){return d.$plumbing.post(a,{discussions:[d]},{"Content-Type":"application/x-fs-v1+json"},c,function(a,b){return d.id||b.getResponseHeader("X-ENTITY-ID")})}),g=f.then(function(a){return d.$helpers.extendHttpPromise(g,f),b?d.$client.getDiscussion(a,{},c).then(function(b){return e.deletePropertiesPartial(d,e.appFieldRejector),e.extend(d,b.getDiscussion()),a}):a});return g},$delete:function(a,b){return this.$client.deleteDiscussion(this.$getDiscussionUrl()||this.id,a,b)}}},{"./../FamilySearch":1,"./../utils":53}],13:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils"),f=e.maybe,g=d.DiscussionRef=function(a,b){d.BaseClass.call(this,a,b),b&&b.discussion&&this.$setDiscussion(b.discussion)};d.prototype.createDiscussionRef=function(a){return new g(this,a)},g.prototype={constructor:g,$getDiscussionRefUrl:function(){return this.$helpers.removeAccessToken(f(f(this.links)["discussion-reference"]).href)},$getDiscussionUrl:function(){return this.$helpers.removeAccessToken(this.resource)},$getDiscussion:function(){return this.$client.getDiscussion(this.$getDiscussionUrl()||this.resourceId)},$setDiscussion:function(a){return a instanceof d.Discussion?(this.resource=a.$getDiscussionUrl(),this.resourceId=a.id):this.$helpers.isAbsoluteUrl(a)?this.resource=this.$helpers.removeAccessToken(a):this.resourceId=a,this},$save:function(a,b){var c=this;return c.$helpers.chainHttpPromises(c.$plumbing.getUrl("person-discussion-references-template",null,{pid:c.$personId}),function(d){!c.resource&&c.resourceId&&(c.resource=c.resourceId);var e={persons:[{id:c.$personId,"discussion-references":[{resource:c.resource}]}]};a&&(e.persons[0].attribution=c.$client.createAttribution(a));var f={"Content-Type":"application/x-fs-v1+json"};return c.$plumbing.post(d,e,f,b,function(a,b){return c.$getDiscussionRefUrl()||(c.links={"discussion-reference":{href:b.getResponseHeader("Location"),title:"Discussion Reference"}}),c.$getDiscussionRefUrl()})})},$delete:function(a,b){return this.$client.deleteDiscussionRef(this.$getDiscussionRefUrl()||this.$personId,this.id,a,b)}}},{"./../FamilySearch":1,"./../utils":53}],14:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils"),f=e.maybe,g=d.Fact=function(a,b){d.BaseClass.call(this,a,b),b&&(b.$date&&(this.$setDate(b.$date),delete this.$date),b.$formalDate&&(this.$setFormalDate(b.$formalDate),delete this.$formalDate),b.$place&&(this.$setPlace(b.$place),delete this.$place),b.$normalizedPlace&&(this.$setNormalizedPlace(b.$normalizedPlace),delete this.$normalizedPlace),b.$changeMessage&&(this.$setChangeMessage(b.$changeMessage),delete this.$changeMessage),!b.attribution||b.attribution instanceof d.Attribution||(this.attribution=a.createAttribution(b.attribution)))};d.prototype.createFact=function(a){return new g(this,a)},g.prototype={constructor:g,$getDate:function(){return f(this.date).original},$getNormalizedDate:function(){return f(f(f(this.date).normalized)[0]).value},$getFormalDate:function(){return f(this.date).formal},$getPlace:function(){return f(this.place).original},$getNormalizedPlace:function(){return f(f(f(this.place).normalized)[0]).value},$getNormalizedPlaceId:function(){var a=f(this.place).description;return a&&"#"===a.charAt(0)?a.substr(1):""},$isCustomNonEvent:function(){if(this.qualifiers){var a=e.find(this.qualifiers,{name:"http://familysearch.org/v1/Event"});return!!a&&"false"===a.value}return!1},$setType:function(a){return this.$changed=!0,this.type=a,this},$setCustomNonEvent:function(a){var b;return a?(this.qualifiers||(this.qualifiers=[]),b=e.findIndex(this.qualifiers,{name:"http://familysearch.org/v1/Event"}),0>b&&(b=this.qualifiers.push({name:"http://familysearch.org/v1/Event"})-1),this.qualifiers[b].value="false"):this.qualifiers&&(b=e.findIndex(this.qualifiers,{name:"http://familysearch.org/v1/Event"}),b>=0&&this.qualifiers.splice(b,1),0===this.qualifiers.length&&delete this.qualifiers),this.$changed=!0,this},$setDate:function(a){this.$changed=!0;var b;return e.isString(a)?b=a:a instanceof d.Date?(b=a.original,this.$setFormalDate(a.$getFormalDate()),this.$setNormalizedDate(a.normalized)):e.isObject(a)&&(b=a.$original,this.$setFormalDate(a.$formal),this.$setNormalizedDate(a.$normalized)),b?(this.date||(this.date={}),this.date.original=b):delete this.date,this},$setFormalDate:function(a){return this.$changed=!0,a?(this.date||(this.date={}),this.date.formal=a):this.date&&delete this.date.formal,this},$setNormalizedDate:function(a){return this.$changed=!0,a?(this.date||(this.date={}),this.date.normalized=[{value:a}]):this.date&&delete this.date.normalized,this},$setPlace:function(a){this.$changed=!0;var b;return e.isString(a)||null==a?b=a:a instanceof d.PlaceDescription?(b=a.$getFullName(),this.$setNormalizedPlace(b)):e.isObject(a)&&(b=a.$original,this.$setNormalizedPlace(a.$normalized)),b?(this.place||(this.place={}),this.place.original=b):delete this.place,this},$setNormalizedPlace:function(a){return this.$changed=!0,a?(this.place||(this.place={}),this.place.normalized=[{value:a}]):this.place&&delete this.place.normalized,this},$setChangeMessage:function(a){return this.attribution=this.$client.createAttribution(a),this}}},{"./../FamilySearch":1,"./../utils":53}],15:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils"),f=e.maybe,g=d.Memory=function(a,b){d.BaseClass.call(this,a,b)};d.prototype.createMemory=function(a){return new g(this,a)},g.prototype={constructor:g,$getTitle:function(){return f(f(this.titles)[0]).value},$getDescription:function(){return f(f(this.description)[0]).value},$getIconUrl:function(){return this.$helpers.appendAccessToken(f(f(this.links)["image-icon"]).href)},$getThumbnailUrl:function(){return this.$helpers.appendAccessToken(f(f(this.links)["image-thumbnail"]).href)},$getImageUrl:function(){return this.$helpers.appendAccessToken(f(f(this.links).image).href)},$getMemoryArtifactUrl:function(){return this.$helpers.appendAccessToken(this.$helpers.removeAccessToken(this.about))},$getMemoryUrl:function(){return this.$helpers.removeAccessToken(f(f(this.links).description).href)},$getArtifactFilename:function(){return f(f(this.artifactMetadata)[0]).filename},$getArtifactType:function(){return f(f(this.artifactMetadata)[0]).artifactType},$getArtifactHeight:function(){return f(f(this.artifactMetadata)[0]).height},$getArtifactWidth:function(){return f(f(this.artifactMetadata)[0]).width},$getCommentsUrl:function(){return this.$helpers.removeAccessToken(f(f(this.links).comments).href)},$getComments:function(){return this.$client.getMemoryComments(this.$getCommentsUrl()||this.id)},$setTitle:function(a){return this.titles=[{value:a}],this},$setDescription:function(a){return this.description=[{value:a}],this},$setArtifactFilename:function(a){return e.isArray(this.artifactMetadata)&&this.artifactMetadata.length||(this.artifactMetadata=[{}]),this.artifactMetadata[0].filename=a,this},$save:function(a,b,c){var d=this,f=d.$helpers.chainHttpPromises(d.id?d.$plumbing.getUrl("memory-template",null,{mid:d.id}):d.$plumbing.getUrl("memories"),function(a){if(d.id)return d.$plumbing.post(a,{sourceDescriptions:[d]},{},c,function(){return d.id});var b={};return d.$getTitle()&&(b.title=d.$getTitle()),d.$getDescription()&&(b.description=d.$getDescription()),d.$getArtifactFilename()&&(b.filename=d.$getArtifactFilename()),d.$plumbing.post(d.$helpers.appendQueryParameters(a,b),d.$data,{"Content-Type":e.isString(d.$data)?"text/plain":"multipart/form-data"},c,d.$helpers.getResponseEntityId)}),g=f.then(function(a){return d.$helpers.extendHttpPromise(g,f),b?d.$client.getMemory(a,{},c).then(function(b){return e.deletePropertiesPartial(d,e.appFieldRejector),e.extend(d,b.getMemory()),a}):a});return g},$delete:function(a,b){return this.$client.deleteMemory(this.$getMemoryUrl()||this.id,a,b)}}},{"./../FamilySearch":1,"./../utils":53}],16:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils"),f=e.maybe,g=d.MemoryArtifactRef=function(a,b){d.BaseClass.call(this,a,b)};d.prototype.createMemoryArtifactRef=function(a){return new g(this,a)},g.prototype={constructor:g,$getQualifierName:function(){return f(f(this.qualifiers)[0]).name},$getQualifierValue:function(){return f(f(this.qualifiers)[0]).value},$setQualifierName:function(a){return e.isArray(this.qualifiers)&&this.qualifiers.length||(this.qualifiers=[{}]),this.qualifiers[0].name=a,this},$setQualifierValue:function(a){return e.isArray(this.qualifiers)&&this.qualifiers.length||(this.qualifiers=[{}]),this.qualifiers[0].value=a,this}}},{"./../FamilySearch":1,"./../utils":53}],17:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils"),f=e.maybe,g=d.MemoryPersona=function(a,b){d.BaseClass.call(this,a,b)};d.prototype.createMemoryPersona=function(a){return new g(this,a)},g.prototype={constructor:g,$getMemoryPersonaUrl:function(){return this.$helpers.removeAccessToken(f(f(this.links).persona).href)},$getMemoryArtifactRef:function(){return f(this.media)[0]},$getName:function(){return f(this.names)[0]},$getDisplayName:function(){return f(this.display).name},$getMemoryUrl:function(){return this.$helpers.removeAccessToken(f(this.$getMemoryArtifactRef()).description)},$getMemory:function(){return this.$client.getMemory(this.$getMemoryUrl()||this.$memoryId)},$setName:function(a){return a instanceof d.Name||(a=this.$client.createName(a)),this.names=[a],this},$setMemoryArtifactRef:function(a){return this.media=[a],this},$save:function(a,b,c){var d=this,f=d.$helpers.chainHttpPromises(d.$plumbing.getUrl(d.id?"memory-persona-template":"memory-personas-template",null,{mid:d.$memoryId,pid:d.id}),function(a){if(!d.$getMemoryArtifactRef()){var b=d.$helpers.getUrlFromDiscoveryResource(d.$client.settings.discoveryResource,"memory-template",{mid:d.$memoryId});d.$setMemoryArtifactRef(d.$client.createMemoryArtifactRef({description:b}))}return d.$plumbing.post(a,{persons:[d]},{},c,function(a,b){return d.$getMemoryPersonaUrl()||d.$helpers.removeAccessToken(b.getResponseHeader("Location"))})}),g=f.then(function(a){return d.$helpers.extendHttpPromise(g,f),b?d.$client.getMemoryPersona(a,null,{},c).then(function(b){return e.deletePropertiesPartial(d,e.appFieldRejector),e.extend(d,b.getMemoryPersona()),a}):a});return g},$delete:function(a,b){return this.$client.deleteMemoryPersona(this.$getMemoryPersonaUrl()||this.$memoryId,this.id,a,b)}}},{"./../FamilySearch":1,"./../utils":53}],18:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils"),f=e.maybe,g=d.MemoryPersonaRef=function(a,b){d.BaseClass.call(this,a,b),b&&b.$memoryPersona&&this.$setMemoryPersona(b.$memoryPersona)};d.prototype.createMemoryPersonaRef=function(a){return new g(this,a)},g.prototype={constructor:g,$getMemoryPersonaRefUrl:function(){return this.$helpers.removeAccessToken(f(f(this.links)["evidence-reference"]).href); },$getMemoryPersonaUrl:function(){return this.$helpers.removeAccessToken(this.resource)},$getMemoryPersona:function(){return this.$client.getMemoryPersona(this.$getMemoryPersonaUrl())},$getMemoryUrl:function(){return this.$helpers.removeAccessToken(f(f(this.links).memory).href)},$getMemory:function(){return this.$client.getMemory(this.$getMemoryUrl())},$setMemoryPersona:function(a){return a instanceof d.MemoryPersona&&(a=a.$getMemoryPersonaUrl()),this.resource=this.$helpers.removeAccessToken(a),this},$save:function(a,b){var c=this;return c.$helpers.chainHttpPromises(c.$plumbing.getUrl("person-memory-persona-references-template",null,{pid:c.$personId}),function(a){return c.$plumbing.post(a,{persons:[{evidence:[c]}]},{},b,function(a,b){return c.id||(c.id=b.getResponseHeader("X-ENTITY-ID")),c.$getMemoryPersonaRefUrl()||(c.links={"evidence-reference":{href:b.getResponseHeader("Location")}}),c.$getMemoryPersonaRefUrl()})})},$delete:function(a,b){return this.$client.deleteMemoryPersonaRef(this.$getMemoryPersonaRefUrl()||this.$personId,this.id,a,b)}}},{"./../FamilySearch":1,"./../utils":53}],19:[function(a,b,c){function d(a,b){var c=b||0;for(f.isArray(a.nameForms)||(a.nameForms=[]);c>=a.nameForms.length;)a.nameForms.push({});return a.nameForms[c]}var e=a("./../FamilySearch"),f=a("./../utils"),g=f.maybe,h=e.Name=function(a,b){e.BaseClass.call(this,a,b),b&&(f.isString(b)?this.$setFullText(b):(b.type&&this.$setType(b.type),b.$givenName&&(this.$setGivenName(b.$givenName),delete this.$givenName),b.$surname&&(this.$setSurname(b.$surname),delete this.$surname),b.$prefix&&(this.$setPrefix(b.$prefix),delete this.$prefix),b.$suffix&&(this.$setSuffix(b.$suffix),delete this.$suffix),b.$fullText&&(this.$setFullText(b.$fullText),delete this.$fullText),this.$setPreferred(!!b.preferred),b.$changeMessage&&(this.$setChangeMessage(b.$changeMessage),delete this.$changeMessage),!b.attribution||b.attribution instanceof e.Attribution||(this.attribution=a.createAttribution(b.attribution))))};e.prototype.createName=function(a){return new h(this,a)},h.prototype={constructor:h,$getNameFormsCount:function(){return this.nameForms?this.nameForms.length:0},$getNameForm:function(a){return g(this.nameForms)[a||0]},$getFullText:function(a){return g(this.$getNameForm(a)).fullText},$getLang:function(a){return g(this.$getNameForm(a)).lang},$getNamePart:function(a,b){return g(f.find(g(this.$getNameForm(b)).parts,{type:a})).value},$getGivenName:function(a){return this.$getNamePart("http://gedcomx.org/Given",a)},$getSurname:function(a){return this.$getNamePart("http://gedcomx.org/Surname",a)},$getPrefix:function(a){return this.$getNamePart("http://gedcomx.org/Prefix",a)},$getSuffix:function(a){return this.$getNamePart("http://gedcomx.org/Suffix",a)},$setType:function(a){return this.$changed=!0,a?this.type=a:delete this.type,this},$setPreferred:function(a){return this.$changed=!0,this.preferred=a,this},$setFullText:function(a,b){this.$changed=!0;var c=d(this,b);return a?c.fullText=a:delete c.fullText,this},$setNamePart:function(a,b,c){this.$changed=!0;var e=d(this,c);f.isArray(e.parts)||(e.parts=[]);var g=f.find(e.parts,{type:b});return a?(g||(g={type:b},e.parts.push(g)),g.value=a):g&&e.parts.splice(e.parts.indexOf(g),1),this},$setGivenName:function(a,b){return this.$setNamePart(a,"http://gedcomx.org/Given",b)},$setSurname:function(a,b){return this.$setNamePart(a,"http://gedcomx.org/Surname",b)},$setPrefix:function(a,b){return this.$setNamePart(a,"http://gedcomx.org/Prefix",b)},$setSuffix:function(a,b){return this.$setNamePart(a,"http://gedcomx.org/Suffix",b)},$setChangeMessage:function(a){return this.attribution=this.$client.createAttribution(a),this}}},{"./../FamilySearch":1,"./../utils":53}],20:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils"),f=e.maybe,g=d.Note=function(a,b){d.BaseClass.call(this,a,b),!this.attribution||this.attribution instanceof d.Attribution||(this.attribution=a.createAttribution(this.attribution))};d.prototype.createNote=function(a){return new g(this,a)},g.prototype={constructor:g,$getNoteUrl:function(){return this.$helpers.removeAccessToken(f(f(this.links).note).href)},$save:function(a,b,c){var d,f,g=this,h={};g.$personId?(d=g.id?"person-note-template":"person-notes-template",f="persons"):g.$coupleId?(d=g.id?"couple-relationship-note-template":"couple-relationship-notes-template",f="relationships"):g.$childAndParentsId&&(d=g.id?"child-and-parents-relationship-note-template":"child-and-parents-relationship-notes-template",f="childAndParentsRelationships",h["Content-Type"]="application/x-fs-v1+json");var i=g.$helpers.chainHttpPromises(g.$plumbing.getUrl(d,null,{pid:g.$personId,crid:g.$coupleId,caprid:g.$childAndParentsId,nid:g.id}),function(b){var d={};return d[f]=[{notes:[g]}],a&&(d[f][0].attribution=g.$client.createAttribution(a)),g.$plumbing.post(b,d,h,c,function(a,b){return{id:g.id||b.getResponseHeader("X-ENTITY-ID"),location:g.$getNoteUrl()||g.$helpers.removeAccessToken(b.getResponseHeader("Location"))}})}),j=i.then(function(a){return g.$helpers.extendHttpPromise(j,i),b?g.$client.getPersonNote(a.location,null,{},c).then(function(b){return e.deletePropertiesPartial(g,e.appFieldRejector),e.extend(g,b.getNote()),a.id}):a.id});return j},$delete:function(a,b){return this.$personId?this.$client.deletePersonNote(this.$getNoteUrl()||this.$personId,this.id,a,b):this.$coupleId?this.$client.deleteCoupleNote(this.$getNoteUrl()||this.$coupleId,this.id,a,b):this.$client.deleteChildAndParentsNote(this.$getNoteUrl()||this.$childAndParentsId,this.id,a,b)}}},{"./../FamilySearch":1,"./../utils":53}],21:[function(a,b,c){function d(a){return a?" "+a:""}var e=a("../FamilySearch"),f=a("../utils"),g=f.maybe,h=e.Person=function(a,b){e.BaseClass.call(this,a,b),b&&(b.$gender&&(this.$setGender(b.$gender),delete this.$gender),b.names&&f.forEach(this.names,function(b,c){b instanceof e.Name||(this.names[c]=a.createName(b))},this),b.facts&&f.forEach(this.facts,function(b,c){b instanceof e.Fact||(this.facts[c]=a.createFact(b))},this),!b.attribution||b.attribution instanceof e.Attribution||(this.attribution=a.createAttribution(b.attribution)))};e.prototype.createPerson=function(a){return new h(this,a)},h.prototype={constructor:h,$getFacts:function(a){return(a?f.filter(this.facts,{type:a}):this.facts)||[]},$getFact:function(a){return f.find(this.facts,{type:a})},$getBirth:function(){return this.$getFact("http://gedcomx.org/Birth")},$getBirthDate:function(){var a=this.$getBirth();return a?a.$getDate():""},$getBirthPlace:function(){var a=this.$getBirth();return a?a.$getPlace():""},$getChristening:function(){return this.$getFact("http://gedcomx.org/Christening")},$getChristeningDate:function(){var a=this.$getChristening();return a?a.$getDate():""},$getChristeningPlace:function(){var a=this.$getChristening();return a?a.$getPlace():""},$getDeath:function(){return this.$getFact("http://gedcomx.org/Death")},$getDeathDate:function(){var a=this.$getDeath();return a?a.$getDate():""},$getDeathPlace:function(){var a=this.$getDeath();return a?a.$getPlace():""},$getBurial:function(){return this.$getFact("http://gedcomx.org/Burial")},$getBurialDate:function(){var a=this.$getBurial();return a?a.$getDate():""},$getBurialPlace:function(){var a=this.$getBurial();return a?a.$getPlace():""},$getDisplayBirthDate:function(){return g(this.display).birthDate},$getDisplayBirthPlace:function(){return g(this.display).birthPlace},$getDisplayDeathDate:function(){return g(this.display).deathDate},$getDisplayDeathPlace:function(){return g(this.display).deathPlace},$getDisplayGender:function(){return g(this.display).gender},$getDisplayLifeSpan:function(){return g(this.display).lifespan},$getDisplayName:function(){return g(this.display).name},$getNames:function(a){return(a?f.filter(this.names,{type:a}):this.names)||[]},$getPreferredName:function(){return f.findOrFirst(this.names,{preferred:!0})},$getGivenName:function(){var a=this.$getPreferredName();return a&&(a=a.$getGivenName()),a},$getSurname:function(){var a=this.$getPreferredName();return a&&(a=a.$getSurname()),a},$getPersistentIdentifier:function(){return g(g(this.identifiers)["http://gedcomx.org/Persistent"])[0]},$getPersonUrl:function(){return this.$helpers.removeAccessToken(g(g(this.links).person).href)},$getChanges:function(a){return this.$client.getPersonChanges(this.$helpers.removeAccessToken(this.links["change-history"].href),a)},$getDiscussionRefs:function(){return this.$client.getPersonDiscussionRefs(this.$helpers.removeAccessToken(this.links["discussion-references"].href))},$getMemoryPersonaRefs:function(){return this.$client.getMemoryPersonaRefs(this.$helpers.removeAccessToken(this.links["evidence-references"].href))},$getNotes:function(){return this.$client.getPersonNotes(this.$helpers.removeAccessToken(this.links.notes.href))},$getSourceRefs:function(){return this.$client.getPersonSourceRefs(this.id)},$getSources:function(){return this.$client.getPersonSourcesQuery(this.id)},$getSpouses:function(){return this.$client.getSpouses(this.id)},$getParents:function(){return this.$client.getParents(this.id)},$getChildren:function(){return this.$client.getChildren(this.id)},$getMatches:function(){return this.$client.getPersonMatches(this.id)},$getAncestry:function(a){return this.$client.getAncestry(this.id,a)},$getDescendancy:function(a){return this.$client.getDescendancy(this.id,a)},$getPersonPortraitUrl:function(a){return this.$client.getPersonPortraitUrl(this.id,a)},$setNames:function(a,b){return f.isArray(this.names)&&f.forEach(this.names,function(a){this.$deleteName(a,b)},this),this.names=[],f.forEach(a,function(a){this.$addName(a)},this),this},$addName:function(a){return f.isArray(this.names)||(this.names=[]),a instanceof e.Name||(a=this.$client.createName(a)),this.names.push(a),this},$deleteName:function(a,b){a instanceof e.Name||(a=f.find(this.names,{id:a}));var c=f.indexOf(this.names,a);return c>=0&&(this.$deletedConclusions||(this.$deletedConclusions={}),this.$deletedConclusions[a.id]=b,this.names.splice(c,1)),this},$setFacts:function(a,b){return f.isArray(this.facts)&&f.forEach(this.facts,function(a){this.$deleteFact(a,b)},this),this.facts=[],f.forEach(a,function(a){this.$addFact(a)},this),this},$addFact:function(a){return f.isArray(this.facts)||(this.facts=[]),a instanceof e.Fact||(a=this.$client.createFact(a)),this.facts.push(a),this},$deleteFact:function(a,b){a instanceof e.Fact||(a=f.find(this.facts,{id:a}));var c=f.indexOf(this.facts,a);return c>=0&&(this.$deletedConclusions||(this.$deletedConclusions={}),this.$deletedConclusions[a.id]=b,this.facts.splice(c,1)),this},$setGender:function(a,b){return this.gender||(this.gender={}),this.gender.$changed=!0,this.gender.type=a,b&&(this.gender.attribution=this.$client.createAttribution(b)),this},$save:function(a,b,c){var e=this.$client.createPerson(),g=!1;this.id&&(e.id=this.id),this.id||(this.gender||this.$setGender("http://gedcomx.org/Unknown"),f.isArray(this.names)&&0!==this.names.length||this.$addName({$fullText:"Unknown",$givenName:"Unknown"}),f.find(this.names,{preferred:!0})||this.names[0].$setPreferred(!0),1!==this.names.length||this.names[0].type||this.names[0].$setType("http://gedcomx.org/BirthName"),f.isUndefined(this.living)&&(this.living=!1)),a&&(e.attribution=this.$client.createAttribution(a)),this.id||(e.living=this.living),!this.gender||this.gender.id&&!this.gender.$changed||(e.gender=this.gender,g=!0),f.forEach(this.names,function(a){(!a.id||a.$changed)&&(a.$getFullText()||a.$setFullText((d(a.$getPrefix())+d(a.$getGivenName())+d(a.$getSurname())+d(a.$getSuffix())).trim()),e.$addName(a),g=!0)}),f.forEach(this.facts,function(a){(!a.id||a.$changed)&&(e.$addFact(a),g=!0)});var h=[],i=this;g&&h.push(i.$helpers.chainHttpPromises(e.id?i.$plumbing.getUrl("person-template",null,{pid:e.id}):i.$plumbing.getUrl("persons"),function(a){return i.$plumbing.post(a,{persons:[e]},{},c,i.$helpers.getResponseEntityId)})),this.id&&this.$deletedConclusions&&f.forEach(this.$deletedConclusions,function(b,d){b=b||a,h.push(i.$helpers.chainHttpPromises(i.$plumbing.getUrl("person-conclusion-template",null,{pid:e.id,cid:d}),function(a){return i.$plumbing.del(a,b?{"X-Reason":b}:{},c)}))});var j=this,k=i.$helpers.promiseAll(h).then(function(a){var d=e.id?e.id:a[0];return i.$helpers.extendHttpPromise(k,h[0]),b?i.$client.getPerson(d,{},c).then(function(a){return f.deletePropertiesPartial(j,f.appFieldRejector),f.extend(j,a.getPerson()),d}):d});return k},$delete:function(a,b){return this.$client.deletePerson(this.$getPersonUrl()||this.id,a,b)},$restore:function(a){return this.$client.restorePerson(this.$getPersonUrl()||this.id,a)}}},{"../FamilySearch":1,"../utils":53}],22:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils"),f=d.PlaceDescription=function(a,b){d.BaseClass.call(this,a,b),b&&b.names&&e.forEach(this.names,function(b,c){b instanceof d.TextValue||(this.names[c]=a.createTextValue(b)),this.names[c]=a.createTextValue(b)},this)};d.prototype.createPlaceDescription=function(a){return new f(this,a)},f.prototype={constructor:f,$getName:function(){return e.maybe(this.display).name},$getFullName:function(){return e.maybe(this.display).fullName},$getType:function(){return e.maybe(this.display).type},$getJurisdictionSummary:function(){return this.jurisdiction instanceof d.PlaceDescription?this.jurisdiction:void 0},$getJurisdictionDetails:function(){if(this.jurisdiction instanceof d.PlaceDescription)return this.$client.getPlaceDescription(this.jurisdiction.id);var a=this.$client.settings.deferredWrapper(),b=a.promise;return a.reject(new Error("No jurisdiction available")),b},$setJurisdiction:function(a){a instanceof d.PlaceDescription||(a=this.client.createPlaceDescription(a)),this.jurisdiction=a}}},{"./../FamilySearch":1,"./../utils":53}],23:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils"),f=d.PlacesSearchResult=function(a,b){if(d.BaseClass.call(this,a,b),b&&b.content&&b.content.gedcomx&&b.content.gedcomx.places){var c=b.content.gedcomx.places,f={};e.forEach(c,function(b,c,d){d[c]=f[b.id]=a.createPlaceDescription(b)}),e.forEach(c,function(a){if(a.jurisdiction&&a.jurisdiction.resource){var b=a.jurisdiction.resource.substring(1);f[b]&&a.$setJurisdiction(f[b])}})}};d.prototype.createPlacesSearchResult=function(a){return new f(this,a)},f.prototype={constructor:f,$getPlace:function(){var a=e.maybe;return a(a(a(this.content).gedcomx).places)[0]}}},{"./../FamilySearch":1,"./../utils":53}],24:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils"),f=e.maybe,g=d.SearchResult=function(a,b){d.BaseClass.call(this,a,b),e.forEach(f(f(f(b).content).gedcomx).persons,function(b,c,d){d[c]=a.createPerson(b)})};d.prototype.createSearchResult=function(a){return new g(this,a)},g.prototype={constructor:g,$getPerson:function(a){return e.find(f(f(this.content).gedcomx).persons,{id:a})},$getPrimaryPerson:function(){return this.$getPerson(this.id)},$getFullPrimaryPerson:function(){return this.$client.getPerson(this.id)},$getFatherIds:function(){var a=this.id,b=this;return e.uniq(e.map(e.filter(f(f(this.content).gedcomx).relationships,function(c){return"http://gedcomx.org/ParentChild"===c.type&&c.person2.resourceId===a&&c.person1&&"http://gedcomx.org/Male"===f(b.$getPerson(c.person1.resourceId).gender).type}),function(a){return a.person1.resourceId}))},$getFathers:function(){return e.map(this.$getFatherIds(),this.$getPerson,this)},$getMotherIds:function(){var a=this.id,b=this;return e.uniq(e.map(e.filter(f(f(this.content).gedcomx).relationships,function(c){return"http://gedcomx.org/ParentChild"===c.type&&c.person2.resourceId===a&&c.person1&&"http://gedcomx.org/Male"!==f(b.$getPerson(c.person1.resourceId).gender).type}),function(a){return a.person1.resourceId}))},$getMothers:function(){return e.map(this.$getMotherIds(),this.$getPerson,this)},$getSpouseIds:function(){var a=this.id;return e.uniq(e.map(e.filter(f(f(this.content).gedcomx).relationships,function(b){return"http://gedcomx.org/Couple"===b.type&&(b.person1.resourceId===a||b.person2.resourceId===a)}),function(b){return b.person1.resourceId===a?b.person2.resourceId:b.person1.resourceId}))},$getSpouses:function(){return e.map(this.$getSpouseIds(),this.$getPerson,this)},$getChildIds:function(){var a=this.id;return e.uniq(e.map(e.filter(f(f(this.content).gedcomx).relationships,function(b){return"http://gedcomx.org/ParentChild"===b.type&&b.person1.resourceId===a&&b.person2}),function(a){return a.person2.resourceId}))},$getChildren:function(){return e.map(this.$getChildIds(),this.$getPerson,this)}}},{"./../FamilySearch":1,"./../utils":53}],25:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils"),f=e.maybe,g=d.SourceDescription=function(a,b){d.BaseClass.call(this,a,b),b&&(b.$citation&&this.$setCitation(b.$citation),b.$title&&this.$setTitle(b.$title),b.$text&&this.$setText(b.$text),!b.attribution||b.attribution instanceof d.Attribution||(this.attribution=a.createAttribution(b.attribution)))};d.prototype.createSourceDescription=function(a){return new g(this,a)},g.prototype={constructor:g,$getCitation:function(){return f(f(this.citations)[0]).value},$getTitle:function(){return f(f(this.titles)[0]).value},$getText:function(){return f(f(this.notes)[0]).text},$getSourceDescriptionUrl:function(){return this.$helpers.removeAccessToken(f(f(this.links).description).href)},$getSourceRefsQuery:function(){return this.$client.getSourceRefsQuery(this.id)},$setCitation:function(a){return this.citations=[{value:a}],this},$setTitle:function(a){return this.titles=[{value:a}],this},$setText:function(a){return this.notes=[{text:a}],this},$save:function(a,b,c){var d=this;a&&(d.attribution=d.$client.createAttribution(a));var f=d.$helpers.chainHttpPromises(d.id?d.$plumbing.getUrl("source-description-template",null,{sdid:d.id}):d.$plumbing.getUrl("source-descriptions"),function(a){return d.$plumbing.post(a,{sourceDescriptions:[d]},{},c,function(a,b){return d.id||b.getResponseHeader("X-ENTITY-ID")})}),g=f.then(function(a){return d.$helpers.extendHttpPromise(g,f),b?d.$client.getSourceDescription(a,{},c).then(function(b){return e.deletePropertiesPartial(d,e.appFieldRejector),e.extend(d,b.getSourceDescription()),a}):a});return g},$delete:function(a,b){return this.$client.deleteSourceDescription(this.id,a,b)}}},{"./../FamilySearch":1,"./../utils":53}],26:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils"),f=e.maybe,g=d.SourceRef=function(a,b){d.BaseClass.call(this,a,b),b&&(this.$personId=b.$personId,this.$coupleId=b.$coupleId,this.$childAndParentsId=b.$childAndParentsId,b.$sourceDescription&&this.$setSourceDescription(b.$sourceDescription),b.$tags&&this.$setTags(b.$tags),!b.attribution||b.attribution instanceof d.Attribution||(this.attribution=a.createAttribution(b.attribution)))};d.prototype.createSourceRef=function(a){return new g(this,a)},g.prototype={constructor:g,$getSourceRefUrl:function(){return this.$helpers.removeAccessToken(f(f(this.links)["source-reference"]).href)},$getSourceDescriptionUrl:function(){return this.$helpers.removeAccessToken(this.description)},$getSourceDescription:function(){return this.$client.getSourceDescription(this.$getSourceDescriptionUrl())},$getTags:function(){return e.map(this.tags,function(a){return a.resource})},$setSourceDescription:function(a){return a instanceof d.SourceDescription?(this.$sourceDescriptionId=a.id,this.description=a.$getSourceDescriptionUrl()):this.$helpers.isAbsoluteUrl(a)?(delete this.$sourceDescriptionId,this.description=this.$sourceDescriptionUrl):(this.$sourceDescriptionId=a,delete this.description),this},$setTags:function(a){return this.tags=e.map(a,function(a){return{resource:a}}),this},$addTag:function(a){return e.isArray(this.tags)||(this.tags=[]),this.tags.push({resource:a}),this},$removeTag:function(a){return a=e.find(this.tags,{resource:a}),a&&this.tags.splice(e.indexOf(this.tags,a),1),this},$save:function(a,b){var c=this;a&&(c.attribution=c.$client.createAttribution(a));var d,e,f={};return c.$personId?(d="person-source-references-template",e="persons"):c.$coupleId?(d="couple-relationship-source-references-template",e="relationships"):c.$childAndParentsId&&(d="child-and-parents-relationship-source-references-template",d="child-and-parents-relationship-source-references-template",e="childAndParentsRelationships",f["Content-Type"]="application/x-fs-v1+json"),c.$helpers.chainHttpPromises(c.$plumbing.getUrl(d,null,{pid:c.$personId,crid:c.$coupleId,caprid:c.$childAndParentsId,srid:c.id}),function(a){!c.description&&c.$sourceDescriptionId&&(c.description=c.$helpers.getUrlFromDiscoveryResource(c.$client.settings.discoveryResource,"source-description-template",{sdid:c.$sourceDescriptionId})),c.description=c.$helpers.removeAccessToken(c.description);var d={};return d[e]=[{sources:[c]}],c.$plumbing.post(a,d,f,b,function(a,b){return c.id||(c.id=b.getResponseHeader("X-ENTITY-ID")),c.$getSourceRefUrl()||(c.links={"source-reference":{href:c.$helpers.removeAccessToken(b.getResponseHeader("Location"))}}),c.id})})},$delete:function(a,b){return this.$personId?this.$client.deletePersonSourceRef(this.$getSourceRefUrl()||this.$personID,this.id,a,b):this.$coupleId?this.$client.deleteCoupleSourceRef(this.$getSourceRefUrl()||this.$coupleId,this.id,a,b):this.$client.deleteChildAndParentsSourceRef(this.$getSourceRefUrl()||this.$childAndParentsId,this.id,a,b)}}},{"./../FamilySearch":1,"./../utils":53}],27:[function(a,b,c){var d=a("./../FamilySearch"),e=d.TextValue=function(a,b){d.BaseClass.call(this,a,b)};d.prototype.createTextValue=function(a){return new e(this,a)},e.prototype={constructor:e}},{"./../FamilySearch":1}],28:[function(a,b,c){var d=a("../FamilySearch"),e=d.User=function(a,b){d.BaseClass.call(this,a,b)};d.prototype.createUser=function(a){return new e(this,a)},e.prototype={constructor:e}},{"../FamilySearch":1}],29:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils"),f=d.VocabularyElement=function(a,b){d.BaseClass.call(this,a,b)};d.prototype.createVocabularyElement=function(a){return new f(this,a)},f.prototype={constructor:f,$getLabel:function(){return e.maybe(e.maybe(this.labels)[0])["@value"]},$getDescription:function(){return e.maybe(e.maybe(this.descriptions)[0])["@value"]}}},{"./../FamilySearch":1,"./../utils":53}],30:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils"),f=d.VocabularyList=function(a,b){d.BaseClass.call(this,a,b),b&&b.elements&&e.forEach(this.elements,function(b,c,d){d[c]=a.createVocabularyElement(b)})};d.prototype.createVocabularyList=function(a){return new f(this,a)},f.prototype={constructor:f,$getTitle:function(){return e.maybe(this.title)},$getDescription:function(){return e.maybe(this.description)},$getElements:function(){return e.maybe(this.elements)}}},{"./../FamilySearch":1,"./../utils":53}],31:[function(a,b,c){b.exports={clientId:null,environment:null,httpWrapper:null,deferredWrapper:null,setTimeout:null,clearTimeout:null,redirectUri:null,autoSignin:!1,autoExpire:!1,accessToken:null,saveAccessToken:!1,logging:!1,accessTokenCookie:"FS_ACCESS_TOKEN",authCodePollDelay:50,defaultThrottleRetryAfter:500,maxHttpRequestRetries:2,maxAccessTokenInactivityTime:354e4,maxAccessTokenCreationTime:8634e4,apiServer:{sandbox:"https://sandbox.familysearch.org",staging:"https://stage.familysearch.org",beta:"https://beta.familysearch.org",production:"https://familysearch.org"},oauthServer:{sandbox:"https://integration.familysearch.org/cis-web/oauth2/v3",staging:"https://identbeta.familysearch.org/cis-web/oauth2/v3",beta:"https://identbeta.familysearch.org/cis-web/oauth2/v3",production:"https://ident.familysearch.org/cis-web/oauth2/v3"},authoritiesServer:{sandbox:"https://sandbox.familysearch.org",staging:"https://stage.familysearch.org",beta:"https://apibeta.familysearch.org",production:"https://api.familysearch.org"},discoveryUrl:"/.well-known/app-meta"}},{}],32:[function(a,b,c){var d=a("./utils"),e=d.forEach,f=function(a){this.settings=a.settings,this.client=a,this.accessTokenInactiveTimer=null,this.accessTokenCreationTimer=null};f.prototype.getAbsoluteUrl=function(a,b){return this.isAbsoluteUrl(b)?b:a+("/"!==b.charAt(0)?"/":"")+b},f.prototype.isOAuthServerUrl=function(a){return 0===a.indexOf(this.settings.oauthServer[this.settings.environment])},f.prototype.getAPIServerUrl=function(a){return this.getAbsoluteUrl(this.settings.apiServer[this.settings.environment],a)},f.prototype.getAuthoritiesServerUrl=function(a){return this.getAbsoluteUrl(this.settings.authoritiesServer[this.settings.environment],a)},f.prototype.appendAccessToken=function(a){if(a){var b=this.decodeQueryString(a);a=this.removeQueryString(a),b.access_token=this.settings.accessToken,a=this.appendQueryParameters(a,b)}return a},f.prototype.log=function(){this.settings.debug&&console.log.apply(null,arguments)},f.prototype.nextTick=function(a){this.settings.setTimeout(function(){a()},0)},f.prototype.refPromise=function(a){if(a&&d.isFunction(a.then))return a;var b=this;return{then:function(c){var d=b.settings.deferredWrapper();return b.nextTick(function(){d.resolve(c(a))}),d.promise}}},f.prototype.promiseAll=function(a){var b=this.settings.deferredWrapper(),c=0,f=d.isArray(a)?[]:{},g=this;return e(a,function(a,d){c++,g.refPromise(a).then(function(a){f.hasOwnProperty(d)||(f[d]=a,--c||b.resolve(f))},function(){f.hasOwnProperty(d)||b.reject.apply(b,arguments)})}),0===c&&b.resolve(f),b.promise},f.prototype.setTimer=function(a,b,c){return c&&this.settings.clearTimeout(c),this.settings.setTimeout(function(){a()},b)},f.prototype.setAccessTokenInactiveTimer=function(a){this.accessTokenInactiveTimer=this.setTimer(this.settings.eraseAccessToken,a,this.accessTokenInactiveTimer)},f.prototype.setAccessTokenCreationTimer=function(a){this.accessTokenCreationTimer=this.setTimer(this.settings.eraseAccessToken,a,this.accessTokenCreationTimer)},f.prototype.clearAccessTokenTimers=function(){this.settings.clearTimeout(this.accessTokenInactiveTimer),this.accessTokenInactiveTimer=null,this.settings.clearTimeout(this.accessTokenCreationTimer),this.accessTokenCreationTimer=null},f.prototype.getAccessTokenCookieName=function(){return this.settings.accessTokenCookie+"_"+this.settings.instanceId},f.prototype.readAccessToken=function(){if("undefined"!=typeof window){var a=(new Date).getTime(),b=this,c=this.readCookie(this.getAccessTokenCookieName());if(c){var d=c.split("|",3);if(3===d.length){var e=a-parseInt(d[0],10),f=a-parseInt(d[1],10);e=0?"&":"?")+c},f.prototype.decodeQueryString=function(a){var b={};if(a){var c=a.indexOf("?");if(-1!==c){var f=a.substring(c+1).split("&");e(f,function(a){var c=a.split("=",2);if(c&&c[0]){var e=decodeURIComponent(c[0]),f=null!=c[1]?decodeURIComponent(c[1]):c[1];null==b[e]||d.isArray(b[e])||(b[e]=[b[e]]),null!=b[e]?b[e].push(f):b[e]=f}})}}return b},f.prototype.removeQueryString=function(a){if(a){var b=a.indexOf("?");-1!==b&&(a=a.substring(0,b))}return a},f.prototype.removeAccessToken=function(a){if(a){var b=this.decodeQueryString(a);a=this.removeQueryString(a),delete b.access_token,a=this.appendQueryParameters(a,b)}return a},f.prototype.populateUriTemplate=function(a,b){for(var c=a.split(/[{}]/),d=!1,e=0,f=c.length;f>e;e++)if(e%2===1){var g=b[c[e]];c[e]=d?encodeURIComponent(g):encodeURI(g)}else-1!==c[e].indexOf("?")&&(d=!0);return c.join("")},f.prototype.getUrlFromDiscoveryResource=function(a,b,c){var d="",e=a.links[b];if(e.href)d=this.removeAccessToken(e.href);else if(e.template){var f=e.template.replace(/{\?[^}]*}/,"");d=this.populateUriTemplate(f,c||{})}return d},f.prototype.attributionNeeded=function(a){return!(a.attribution&&a.attribution.changeMessage&&!a.attribution.contributor)},f.prototype.createCookie=function(a,b,c){var d="",e="https"===document.location.protocol&&"localhost"!==document.location.hostname;if(c){var f=new Date;f.setTime(f.getTime()+86400*c),d="; expires="+f.toUTCString()}document.cookie=a+"="+b+d+"; path=/"+(e?"; secure":"")},f.prototype.readCookie=function(a){for(var b=a+"=",c=document.cookie.split(";"),d=0;d=200&&299>=l&&!a.responseText?j.resolve(null):j.reject(a,b,c)}),d.wrapFunctions(k,i,["getResponseHeader","getAllResponseHeaders"]),k.getStatusCode=function(){return l},k.getRequest=function(){return h},k}},c.deferredWrapper=function(a){return function(){var b=a();return{promise:b.promise(),resolve:b.resolve,reject:b.reject}}},b.exports=c},{"./utils":53}],34:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils");d.prototype.getAuthCode=function(){var a=this,b=a.settings,c=b.deferredWrapper();return"undefined"==typeof window?(c.reject(),c.promise):b.expireCallback&&!b.autoSignin?(b.expireCallback(this),c.reject(),c.promise):a.plumbing.getUrl("http://oauth.net/core/2.0/endpoint/authorize").then(function(c){var d=a.openPopup(c,{ -response_type:"code",client_id:b.clientId,redirect_uri:b.redirectUri});return a._pollForAuthCode(d)})},d.prototype.handleAccessTokenResponse=function(a,b){var c=this;a.then(function(a){var d=a.access_token;d?(c.helpers.setAccessToken(d),b.resolve(d)):b.reject(a.error)},function(){b.reject.apply(b,arguments)})},d.prototype.getAccessToken=function(a){var b=this,c=b.settings,d=c.deferredWrapper(),e=b.plumbing,f=b.helpers;if(c.accessToken)f.nextTick(function(){d.resolve(c.accessToken)});else{var g;g=a?f.refPromise(a):b.getAuthCode(),g.then(function(a){e.getUrl("http://oauth.net/core/2.0/endpoint/token").then(function(f){var g=e.post(f,{grant_type:"authorization_code",code:a,client_id:c.clientId},{"Content-Type":"application/x-www-form-urlencoded"});b.handleAccessTokenResponse(g,d)})},function(){d.reject.apply(d,arguments)})}return d.promise},d.prototype.getAccessTokenForMobile=function(a,b){var c=this,d=c.settings.deferredWrapper(),e=c.plumbing,f=c.helpers;return c.settings.accessToken?f.nextTick(function(){d.resolve(c.settings.accessToken)}):e.getUrl("http://oauth.net/core/2.0/endpoint/token").then(function(f){var g=e.post(f,{grant_type:"password",client_id:c.settings.clientId,username:a,password:b},{"Content-Type":"application/x-www-form-urlencoded"});c.handleAccessTokenResponse(g,d)}),d.promise},d.prototype.getOAuth2AuthorizeURL=function(a){var b=this,c=b.settings;return this.plumbing.getUrl("http://oauth.net/core/2.0/endpoint/authorize").then(function(d){var e={response_type:"code",client_id:c.clientId,redirect_uri:c.redirectUri};return a&&(e.state=a),b.helpers.appendQueryParameters(d,e)})},d.prototype.hasAccessToken=function(){return!!this.settings.accessToken},d.prototype.invalidateAccessToken=function(){var a=this;return a.helpers.eraseAccessToken(!0),a.helpers.chainHttpPromises(a.plumbing.getUrl("http://oauth.net/core/2.0/endpoint/token"),function(b){return a.plumbing.del(b)})},d.prototype.openPopup=function(a,b){var c=e.isUndefined(window.screenX)?window.screenLeft:window.screenX,d=e.isUndefined(window.screenY)?window.screenTop:window.screenY,f=e.isUndefined(window.outerWidth)?document.documentElement.clientWidth:window.outerWidth,g=e.isUndefined(window.outerHeight)?document.documentElement.clientHeight-22:window.outerHeight,h=b.width||780,i=b.height||500,j=parseInt(c+(f-h)/2,10),k=parseInt(d+(g-i)/2.5,10),l="width="+h+",height="+i+",left="+j+",top="+k;return window.open(this.helpers.appendQueryParameters(a,b),"",l)},d.prototype.getCode=function(a,b){var c=this.helpers.decodeQueryString(a);c.code?b.resolve(c.code):b.reject(c.error)},d.prototype._pollForAuthCode=function(a){var b=this,c=b.settings.deferredWrapper();if(a){var d=setInterval(function(){try{a.location.hostname===window.location.hostname&&(b.getCode(a.location.href,c),clearInterval(d),a.close())}catch(e){}},b.settings.authCodePollDelay);window.FamilySearchOauthReceiver=function(a){b.getCode(a,c),clearInterval(d)}}else c.reject("Popup blocked");return c.promise}},{"./../FamilySearch":1,"./../utils":53}],35:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils");d.prototype.getDate=function(a,b){var c=this,d={date:a};return c.plumbing.get(c.helpers.getAPIServerUrl("/platform/dates"),d,{Accept:"text/plain"},b,e.compose(e.objectExtender({getDate:function(){return e.maybe(this.date)}}),function(a){var b={};return a&&(b.date=c.createDate({normalized:a})),b}))}},{"./../FamilySearch":1,"./../utils":53}],36:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils");d.prototype._changeHistoryResponseMapper=function(){var a=this;return e.compose(e.objectExtender({getChanges:function(){return this.entries||[]}}),function(b){for(var c=0;c=0?null:d.helpers.getLastUrlSegment(a)}return void 0})})},d.prototype.setPreferredSpouse=function(a,b,c){var d,f=[],g=this;return null===b?f.push(g.getChildren(a),function(a){var b=e.find(a.getChildAndParentsRelationships(),function(a){return!a.$getFatherId()||!a.$getMotherId()});return g.plumbing.getUrl("child-and-parents-relationship-template",null,{caprid:b.id})}):f.push(g.plumbing.getUrl("couple-relationship-template",b,{crid:b})),f.push(function(a){return d=a,g.getCurrentUser()},function(b){var c=b.getUser().treeUserId;return g.plumbing.getUrl("preferred-spouse-relationship-template",null,{uid:c,pid:a})},function(b){return g.plumbing.put(b,null,{Location:d},c,function(){return a})}),g.helpers.chainHttpPromises.apply(g.helpers,f)},d.prototype.deletePreferredSpouse=function(a,b){var c=this;return c.helpers.chainHttpPromises(c.getCurrentUser(),function(b){var d=b.getUser().treeUserId;return c.plumbing.getUrl("preferred-spouse-relationship-template",null,{uid:d,pid:a})},function(d){return c.plumbing.del(d,{},b,function(){return a})})},d.prototype.getPreferredParents=function(a,b,c){var d=this;return d.helpers.chainHttpPromises(d.getCurrentUser(),function(b){var c=b.getUser().treeUserId;return d.plumbing.getUrl("preferred-parent-relationship-template",null,{uid:c,pid:a})},function(a){var e=d.plumbing.get(a+".json",b,{Accept:"application/x-fs-v1+json","X-Expect-Override":"200-ok"},c);return e.then(function(){return 200===e.getStatusCode()?d.helpers.getLastUrlSegment(e.getResponseHeader("Location")):void 0})})},d.prototype.setPreferredParents=function(a,b,c){var d,e=this;return e.helpers.chainHttpPromises(e.plumbing.getUrl("child-and-parents-relationship-template",b,{caprid:b}),function(a){return d=a,e.getCurrentUser()},function(b){var c=b.getUser().treeUserId;return e.plumbing.getUrl("preferred-parent-relationship-template",null,{uid:c,pid:a})},function(b){return e.plumbing.put(b,null,{Location:d},c,function(){return a})})},d.prototype.deletePreferredParents=function(a,b){var c=this;return c.helpers.chainHttpPromises(c.getCurrentUser(),function(b){var d=b.getUser().treeUserId;return c.plumbing.getUrl("preferred-parent-relationship-template",null,{uid:d,pid:a})},function(d){return c.plumbing.del(d,{},b,function(){return a})})}},{"../FamilySearch":1,"../utils":53}],43:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils");d.prototype.getPlace=function(a,b){var c=this,d=c.helpers.getAPIServerUrl(c.helpers.populateUriTemplate("/platform/places/{id}",{id:a}));return c.plumbing.get(d,{},{},b,e.compose(e.objectExtender({getPlace:function(){return e.maybe(this.places)[0]}}),function(a){return e.forEach(a.places,function(a,b,d){d[b]=c.createPlaceDescription(a)}),a}))},d.prototype.getPlaceDescription=function(a,b){var c=this,d=c.helpers.getAPIServerUrl(c.helpers.populateUriTemplate("/platform/places/description/{id}",{id:a}));return c.plumbing.get(d,{},{},b,e.compose(e.objectExtender({getPlaceDescription:function(){return e.maybe(this.places)[0]}}),function(a){var b={};return e.forEach(a.places,function(a,d,e){e[d]=b[a.id]=c.createPlaceDescription(a)}),e.forEach(a.places,function(a){if(a.jurisdiction&&a.jurisdiction.resource){var c=a.jurisdiction.resource.substring(1);b[c]&&a.$setJurisdiction(b[c])}}),a}))},d.prototype.getPlacesSearch=function(a,b){var c=this,d=c.helpers.getAPIServerUrl("/platform/places/search");return c.plumbing.get(d,e.removeEmptyProperties({q:e.searchParamsFilter(e.removeEmptyProperties(e.extend({},a))),start:a.start,count:a.count}),{Accept:"application/x-gedcomx-atom+json"},b,e.compose(e.objectExtender({getSearchResults:function(){return e.maybe(this.entries)}}),function(a){return e.forEach(a.entries,function(a,b,d){d[b]=c.createPlacesSearchResult(a)}),a}))},d.prototype.getPlaceDescriptionChildren=function(a,b){var c=this,d=c.helpers.getAPIServerUrl(c.helpers.populateUriTemplate("/platform/places/description/{id}/children",{id:a}));return c.plumbing.get(d,{},{},b,e.compose(e.objectExtender({getChildren:function(){return e.maybe(this.places)}}),function(a){return e.forEach(a.places,function(a,b,d){d[b]=c.createPlaceDescription(a)}),a}))},d.prototype.getPlaceType=function(a,b){var c=this,d=c.helpers.getAPIServerUrl(c.helpers.populateUriTemplate("/platform/places/types/{id}",{id:a}));return c.plumbing.get(d,{},{Accept:"application/ld+json"},b,e.compose(e.objectExtender({getPlaceType:function(){return c.createVocabularyElement(this)}})))},d.prototype.getPlaceTypes=function(a){var b=this,c=b.helpers.getAPIServerUrl("/platform/places/types");return b.plumbing.get(c,{},{Accept:"application/ld+json"},a,e.compose(e.objectExtender({getList:function(){return b.createVocabularyList(this)},getPlaceTypes:function(){return this.getList().$getElements()}})))},d.prototype.getPlaceTypeGroup=function(a,b){var c=this,d=c.helpers.getAPIServerUrl(c.helpers.populateUriTemplate("/platform/places/type-groups/{id}",{id:a}));return c.plumbing.get(d,{},{Accept:"application/ld+json"},b,e.compose(e.objectExtender({getList:function(){return c.createVocabularyList(this)},getPlaceTypes:function(){return this.getList().$getElements()}})))},d.prototype.getPlaceTypeGroups=function(a){var b=this,c=b.helpers.getAPIServerUrl("/platform/places/type-groups");return b.plumbing.get(c,{},{Accept:"application/ld+json"},a,e.compose(e.objectExtender({getList:function(){return b.createVocabularyList(this)},getPlaceTypeGroups:function(){return this.getList().$getElements()}})))}},{"./../FamilySearch":1,"./../utils":53}],44:[function(a,b,c){var d=a("./../FamilySearch");d.prototype.getRedirectUrl=function(a){return this.helpers.appendAccessToken(this.helpers.appendQueryParameters(this.helpers.getAPIServerUrl("/platform/redirect"),a)); -}},{"./../FamilySearch":1}],45:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils"),f={getSearchResults:function(){return this.entries||[]},getResultsCount:function(){return this.results||0},getIndex:function(){return this.index||0}};d.prototype._getSearchMatchResponseMapper=function(){var a=this;return e.compose(e.objectExtender(f),function(b){return e.forEach(b.entries,function(b,c,d){d[c]=a.createSearchResult(b)}),b})},d.prototype.getPersonSearch=function(a,b){var c=this;return c.helpers.chainHttpPromises(c.plumbing.getUrl("person-search"),function(d){return c.plumbing.get(d,e.removeEmptyProperties({q:e.searchParamsFilter(e.removeEmptyProperties(e.extend({},a))),start:a.start,count:a.count,context:a.context}),{Accept:"application/x-gedcomx-atom+json"},b,e.compose(c._getSearchMatchResponseMapper(),function(a,b){return a.getContext=function(){return b.getResponseHeader("X-FS-Page-Context")},a}))})},d.prototype.getPersonMatches=function(a,b,c){var d=this;return d.helpers.chainHttpPromises(d.plumbing.getUrl("person-matches-template",a,{pid:a}),function(a){return d.plumbing.get(a,b,{Accept:"application/x-gedcomx-atom+json"},c,d._getSearchMatchResponseMapper())})},d.prototype.getPersonMatchesQuery=function(a,b){var c=this;return c.helpers.chainHttpPromises(c.plumbing.getUrl("person-matches-query"),function(d){return c.plumbing.get(d,e.removeEmptyProperties({q:e.searchParamsFilter(e.removeEmptyProperties(e.extend({},a))),start:a.start,count:a.count}),{Accept:"application/x-gedcomx-atom+json"},b,c._getSearchMatchResponseMapper())})}},{"./../FamilySearch":1,"./../utils":53}],46:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils"),f=e.maybe;d.prototype.getCollectionsForUser=function(a,b,c){var d=this;return d.helpers.chainHttpPromises(d.plumbing.getUrl("user-collections-for-user-template",a,{uid:a}),function(a){return d.plumbing.get(a,{},{Accept:"application/x-fs-v1+json"},c,e.compose(e.objectExtender({getCollections:function(){return this.collections||[]}}),function(a){return e.forEach(a.collections,function(a,b,c){c[b]=d.createCollection(a)}),a}))})},d.prototype.getCollection=function(a,b,c){var d=this;return d.helpers.chainHttpPromises(d.plumbing.getUrl("user-collection-template",a,{udcid:a}),function(a){return d.plumbing.get(a,b,{Accept:"application/x-fs-v1+json"},c,e.compose(e.objectExtender({getCollection:function(){return f(this.collections)[0]}}),function(a){return e.forEach(a.collections,function(a,b,c){c[b]=d.createCollection(a)}),a}))})},d.prototype.getCollectionSourceDescriptions=function(a,b,c){var d=this;return d.helpers.chainHttpPromises(d.plumbing.getUrl("user-collection-source-descriptions-template",a,{udcid:a}),function(a){return d.plumbing.get(a,b,{Accept:"application/x-fs-v1+json"},c,e.compose(e.objectExtender({getSourceDescriptions:function(){return this.sourceDescriptions||[]}}),function(a){return e.forEach(a.sourceDescriptions,function(a,b,c){c[b]=d.createSourceDescription(a)}),a}))})},d.prototype.getCollectionSourceDescriptionsForUser=function(a,b,c){var d=this;return d.helpers.chainHttpPromises(d.plumbing.getUrl("user-collections-source-descriptions-for-user-template",a,{uid:a}),function(a){return d.plumbing.get(a,b,{Accept:"application/x-fs-v1+json"},c,e.compose(e.objectExtender({getSourceDescriptions:function(){return this.sourceDescriptions||[]}}),function(a){return e.forEach(a.sourceDescriptions,function(a,b,c){c[b]=d.createSourceDescription(a)}),a}))})},d.prototype.moveSourceDescriptionsToCollection=function(a,b,c){var f=this;return f.helpers.chainHttpPromises(f.plumbing.getUrl("user-collection-source-descriptions-template",a,{udcid:a}),function(g){var h=e.map(b,function(a){return{id:a instanceof d.SourceDescription?a.id:a}});return f.plumbing.post(g,{sourceDescriptions:h},{},c,function(){return a})})},d.prototype.removeSourceDescriptionsFromCollections=function(a,b){var c=this;return c.helpers.chainHttpPromises(c.getCurrentUser(),function(a){var b=a.getUser().treeUserId;return c.plumbing.getUrl("user-collections-source-descriptions-for-user-template",null,{uid:b})},function(f){var g=e.map(a,function(a){return a instanceof d.SourceDescription?a.id:a});return c.plumbing.del(c.helpers.appendQueryParameters(f,{id:g}),{},b,function(){return a})})},d.prototype.deleteCollection=function(a,b){var c=this;return c.helpers.chainHttpPromises(c.plumbing.getUrl("user-collection-template",a,{udcid:a}),function(d){return c.plumbing.del(d,{},b,function(){return a})})}},{"./../FamilySearch":1,"./../utils":53}],47:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils"),f=e.maybe;d.prototype.getSourceDescription=function(a,b,c){a instanceof d.SourceRef&&(a=a.$getSourceDescriptionUrl()||a.$sourceDescriptionId);var g=this;return g.helpers.chainHttpPromises(g.plumbing.getUrl("source-description-template",a,{sdid:a}),function(a){return g.plumbing.get(a,b,{},c,e.compose(e.objectExtender({getSourceDescription:function(){return f(this.sourceDescriptions)[0]}}),function(a){for(var b=f(f(a).sourceDescriptions),c=0;c=400?(a=c.errors?c.errors[0]:new Error("server responded with a "+k),i.reject(a)):i.resolve(c)}),j.getStatusCode=function(){return k},j.getResponseHeader=function(a){return l[a]},j.getAllResponseHeaders=function(){return l},j.getRequest=function(){return h},j}},c.deferredWrapper=function(a){return function(){var b=a();return{promise:b.promise,resolve:b.resolve,reject:b.reject}}},b.exports=c},{"./utils":53}],51:[function(a,b,c){function d(a){var b,c,e,f,g,h,i,j="";for(b in a)if(a.hasOwnProperty(b))if(c=a[b],c instanceof Array)for(i=0;i=500&&g>0||429===k){var l=n.getResponseHeader("Retry-After"),m=l?parseInt(l,10):j.settings.defaultThrottleRetryAfter;j.settings.setTimeout(function(){n=j.http(a,b,c,d,e,f,g-1),j.helpers.extendHttpPromise(i,n),n.then(function(a){h.resolve(a)},function(){h.reject.apply(h,arguments)})},m)}else h.reject.apply(h,arguments)})},function(){h.reject.apply(h,arguments)}),i},b.exports=f},{"./utils":53}],52:[function(a,b,c){var d=a("./FamilySearch"),e=a("./utils"),f=e.maybe,c={};c.setMember=function(a,b){this[a]||(this[a]={}),b instanceof d.Person?(this[a].resource=b.$getPersonUrl(),delete this[a].resourceId):this.$helpers.isAbsoluteUrl(b)?(this[a].resource=b,delete this[a].resourceId):e.isString(b)?(this[a].resourceId=b,delete this[a].resource):this[a]=b},c.deleteMember=function(a,b){this.$deletedMembers||(this.$deletedMembers={}),this.$deletedMembers[a]=b,delete this[a]},c.setFacts=function(a,b,d){e.isArray(this[a])&&e.forEach(this[a],function(b){c.deleteFact.call(this,a,b,d)},this),this[a]=[],e.forEach(b,function(b){c.addFact.call(this,a,b)},this)},c.addFact=function(a,b){e.isArray(this[a])||(this[a]=[]),b instanceof d.Fact||(b=this.$client.createFact(b)),this[a].push(b)},c.deleteFact=function(a,b,c){b instanceof d.Fact||(b=e.find(this[a],{id:b}));var g=e.indexOf(this[a],b);if(g>=0){var h=this.$helpers.removeAccessToken(f(f(f(b).links).conclusion).href);h&&(this.$deletedFacts||(this.$deletedFacts={}),this.$deletedFacts[h]=c),this[a].splice(g,1)}},b.exports=c},{"./FamilySearch":1,"./utils":53}],53:[function(a,b,c){function d(a,b){for(var c in a)if(a.hasOwnProperty(c)&&b[c]!==a[c])return!1;return!0}function e(a){return c.isString(a)?(a=a.replace(/[:"]/g,"").trim(),a.indexOf(" ")>=0?'"'+a+'"':a):a}var c=b.exports;Object.create||(Object.create=function(){function a(){}return function(b){if(1!==arguments.length)throw new Error("Object.create implementation only accepts one parameter.");return a.prototype=b,new a}}()),"function"!=typeof Object.getPrototypeOf&&(Object.getPrototypeOf="object"==typeof"".__proto__?function(a){return a.__proto__}:function(a){return a.constructor.prototype}),c.isArray=function(a){return Array.isArray?Array.isArray(a):"[object Array]"==Object.prototype.toString.call(a)},c.isString=function(a){return"[object String]"==Object.prototype.toString.call(a)},c.isFunction=function(a){return"function"!=typeof/./?"function"==typeof a:"[object Function]"==Object.prototype.toString.call(a)},c.isObject=function(a){return a===Object(a)},c.isUndefined=function(a){return void 0===a};var f=c.forEach=function(a,b,c){if(null!=a)if(Array.prototype.forEach&&a.forEach===Array.prototype.forEach)a.forEach(b,c);else if(a.length===+a.length){for(var d=0,e=a.length;e>d;d++)if(b.call(c,a[d],d,a)==={})return}else for(var f in a)if(a.hasOwnProperty(f)&&b.call(c,a[f],f,a)==={})return};c.removeEmptyProperties=function(a){return f(a,function(b,c){(null==b||""===b)&&delete a[c]}),a},c.keys=Object.keys||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c);return b},c.filter=function(a,b,e){var g=[],h=c.isFunction(b);return f(a,function(a){(h?b.call(e,a):d(b,a))&&g.push(a)}),g},c.map=function(a,b,c){var d=[];return f(a,function(a,e,f){d.push(b.call(c,a,e,f))}),d},c.contains=function(a,b){if(null==a)return!1;if(a.indexOf&&a.indexOf===Array.prototype.indexOf)return-1!==a.indexOf(b);var c=!1;return f(a,function(a){a===b&&(c=!0)}),c},c.indexOf=function(a,b){if(Array.prototype.indexOf===a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},c.uniq=function(a){var b=[];return f(a,function(a){c.contains(b,a)||b.push(a)}),b},c.find=function(a,b,e){var f,g=c.isFunction(b);if(a)for(var h=0,i=a.length;i>h;h++){var j=a[h];if(g?b.call(e,j):d(b,j)){f=j;break}}return f},c.findIndex=function(a,b,e){var f=-1,g=c.isFunction(b);if(a)for(var h=0,i=a.length;i>h;h++){var j=a[h];if(g?b.call(e,j):d(b,j)){f=h;break}}return f},c.compose=function(){var a=arguments;return function(){for(var b=arguments,c=a.length-1;c>=0;c--)a[c]&&(b=[a[c].apply(this,b)]);return b[0]}},c.flatten=function(a){var b=[];return f(a,function(a){c.isArray(a)&&Array.prototype.push.apply(b,a)}),b},c.flatMap=c.compose(c.flatten,c.map),c.union=function(){return c.uniq(c.flatten(arguments))},c.findOrFirst=function(a,b){if(!c.isUndefined(a)){var d=c.find(a,b);return c.isUndefined(d)?a[0]:d}return void 0},c.extend=function(a){return a=a||{},f(Array.prototype.slice.call(arguments,1),function(b){b&&f(b,function(b,c){a[c]=b})}),a},c.partialRight=function(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(this,Array.prototype.slice.call(arguments).concat(b))}},c.partial=function(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(this,b.concat(Array.prototype.slice.call(arguments)))}},c.maybe=function(a){return null!=a?a:{}},c.clonePartial=function(a,b){var d;if(null==a||"object"!=typeof a)return a;if(a instanceof Date)return d=new Date,d.setTime(a.getTime()),d;if(a instanceof Array){d=[];for(var e=0,f=a.length;f>e;e++)(!b||b(e))&&d.push(c.clonePartial(a[e],b));return d}if(a instanceof Object){d=Object.create(Object.getPrototypeOf(a));for(var g in a)!a.hasOwnProperty(g)||b&&!b(g)||(d[g]=c.clonePartial(a[g],b));return d}throw new Error("Unable to copy obj")},c.objectExtender=function(a,b){return function(d){return d&&(b?f(b(d),function(b){c.extend(b,c.isFunction(a)?a(d,b):a)}):c.extend(d,c.isFunction(a)?a(d,d):a)),d}},c.appFieldRejector=function(a){return!(c.isString(a)&&"_"===a.charAt(0))},c.deletePropertiesPartial=function(a,b){for(var c in a)!a.hasOwnProperty(c)||b&&!b(c)||delete a[c]},c.wrapFunctions=function(a,b,c){return f(c,function(c){a[c]=function(){return b[c].apply(b,arguments)}}),a};var g={start:!0,count:!0,context:!0};c.searchParamsFilter=function(a){return c.map(c.filter(c.keys(a),function(a){return!g[a]}),function(b){return b+":"+e(a[b])}).join(" ")}},{}]},{},[1])(1)}); \ No newline at end of file +response_type:"code",client_id:b.clientId,redirect_uri:b.redirectUri});return a._pollForAuthCode(d)})},d.prototype.handleAccessTokenResponse=function(a,b){var c=this;a.then(function(a){var d=a.access_token;d?(c.helpers.setAccessToken(d),b.resolve(d)):b.reject(a.error)},function(){b.reject.apply(b,arguments)})},d.prototype.getAccessToken=function(a){var b=this,c=b.settings,d=c.deferredWrapper(),e=b.plumbing,f=b.helpers;if(c.accessToken)f.nextTick(function(){d.resolve(c.accessToken)});else{var g;g=a?f.refPromise(a):b.getAuthCode(),g.then(function(a){e.getUrl("http://oauth.net/core/2.0/endpoint/token").then(function(f){var g=e.post(f,{grant_type:"authorization_code",code:a,client_id:c.clientId},{"Content-Type":"application/x-www-form-urlencoded"});b.handleAccessTokenResponse(g,d)})},function(){d.reject.apply(d,arguments)})}return d.promise},d.prototype.getAccessTokenForMobile=function(a,b){var c=this,d=c.settings.deferredWrapper(),e=c.plumbing,f=c.helpers;return c.settings.accessToken?f.nextTick(function(){d.resolve(c.settings.accessToken)}):e.getUrl("http://oauth.net/core/2.0/endpoint/token").then(function(f){var g=e.post(f,{grant_type:"password",client_id:c.settings.clientId,username:a,password:b},{"Content-Type":"application/x-www-form-urlencoded"});c.handleAccessTokenResponse(g,d)}),d.promise},d.prototype.getOAuth2AuthorizeURL=function(a){var b=this,c=b.settings;return this.plumbing.getUrl("http://oauth.net/core/2.0/endpoint/authorize").then(function(d){var e={response_type:"code",client_id:c.clientId,redirect_uri:c.redirectUri};return a&&(e.state=a),b.helpers.appendQueryParameters(d,e)})},d.prototype.hasAccessToken=function(){return!!this.settings.accessToken},d.prototype.invalidateAccessToken=function(){var a=this;return a.helpers.eraseAccessToken(!0),a.helpers.chainHttpPromises(a.plumbing.getUrl("http://oauth.net/core/2.0/endpoint/token"),function(b){return a.plumbing.del(b)})},d.prototype.openPopup=function(a,b){var c=e.isUndefined(window.screenX)?window.screenLeft:window.screenX,d=e.isUndefined(window.screenY)?window.screenTop:window.screenY,f=e.isUndefined(window.outerWidth)?document.documentElement.clientWidth:window.outerWidth,g=e.isUndefined(window.outerHeight)?document.documentElement.clientHeight-22:window.outerHeight,h=b.width||780,i=b.height||500,j=parseInt(c+(f-h)/2,10),k=parseInt(d+(g-i)/2.5,10),l="width="+h+",height="+i+",left="+j+",top="+k;return window.open(this.helpers.appendQueryParameters(a,b),"",l)},d.prototype.getCode=function(a,b){var c=this.helpers.decodeQueryString(a);c.code?b.resolve(c.code):b.reject(c.error)},d.prototype._pollForAuthCode=function(a){var b=this,c=b.settings.deferredWrapper();if(a){var d=setInterval(function(){try{a.location.hostname===window.location.hostname&&(b.getCode(a.location.href,c),clearInterval(d),a.close())}catch(e){}},b.settings.authCodePollDelay);window.FamilySearchOauthReceiver=function(a){b.getCode(a,c),clearInterval(d)}}else c.reject("Popup blocked");return c.promise}},{"./../FamilySearch":1,"./../utils":53}],35:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils");d.prototype.getDate=function(a,b){var c=this,d={date:a};return c.plumbing.get(c.helpers.getAPIServerUrl("/platform/dates"),d,{Accept:"text/plain"},b,e.compose(e.objectExtender({getDate:function(){return e.maybe(this.date)}}),function(a){var b={};return a&&(b.date=c.createDate({normalized:a})),b}))}},{"./../FamilySearch":1,"./../utils":53}],36:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils");d.prototype._changeHistoryResponseMapper=function(){var a=this;return e.compose(e.objectExtender({getChanges:function(){return this.entries||[]}}),function(b){for(var c=0;c=0?null:d.helpers.getLastUrlSegment(a)}return void 0})})},d.prototype.setPreferredSpouse=function(a,b,c){var d,f=[],g=this;return null===b?f.push(g.getChildren(a),function(a){var b=e.find(a.getChildAndParentsRelationships(),function(a){return!a.$getFatherId()||!a.$getMotherId()});return g.plumbing.getUrl("child-and-parents-relationship-template",null,{caprid:b.id})}):f.push(g.plumbing.getUrl("couple-relationship-template",b,{crid:b})),f.push(function(a){return d=a,g.getCurrentUser()},function(b){var c=b.getUser().treeUserId;return g.plumbing.getUrl("preferred-spouse-relationship-template",null,{uid:c,pid:a})},function(b){return g.plumbing.put(b,null,{Location:d},c,function(){return a})}),g.helpers.chainHttpPromises.apply(g.helpers,f)},d.prototype.deletePreferredSpouse=function(a,b){var c=this;return c.helpers.chainHttpPromises(c.getCurrentUser(),function(b){var d=b.getUser().treeUserId;return c.plumbing.getUrl("preferred-spouse-relationship-template",null,{uid:d,pid:a})},function(d){return c.plumbing.del(d,{},b,function(){return a})})},d.prototype.getPreferredParents=function(a,b,c){var d=this;return d.helpers.chainHttpPromises(d.getCurrentUser(),function(b){var c=b.getUser().treeUserId;return d.plumbing.getUrl("preferred-parent-relationship-template",null,{uid:c,pid:a})},function(a){var e=d.plumbing.get(a+".json",b,{Accept:"application/x-fs-v1+json","X-Expect-Override":"200-ok"},c);return e.then(function(){return 200===e.getStatusCode()?d.helpers.getLastUrlSegment(e.getResponseHeader("Location")):void 0})})},d.prototype.setPreferredParents=function(a,b,c){var d,e=this;return e.helpers.chainHttpPromises(e.plumbing.getUrl("child-and-parents-relationship-template",b,{caprid:b}),function(a){return d=a,e.getCurrentUser()},function(b){var c=b.getUser().treeUserId;return e.plumbing.getUrl("preferred-parent-relationship-template",null,{uid:c,pid:a})},function(b){return e.plumbing.put(b,null,{Location:d},c,function(){return a})})},d.prototype.deletePreferredParents=function(a,b){var c=this;return c.helpers.chainHttpPromises(c.getCurrentUser(),function(b){var d=b.getUser().treeUserId;return c.plumbing.getUrl("preferred-parent-relationship-template",null,{uid:d,pid:a})},function(d){return c.plumbing.del(d,{},b,function(){return a})})}},{"../FamilySearch":1,"../utils":53}],43:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils");d.prototype.getPlace=function(a,b){var c=this,d=c.helpers.getAPIServerUrl(c.helpers.populateUriTemplate("/platform/places/{id}",{id:a}));return c.plumbing.get(d,{},{},b,e.compose(e.objectExtender({getPlace:function(){return e.maybe(this.places)[0]}}),function(a){return e.forEach(a.places,function(a,b,d){d[b]=c.createPlaceDescription(a)}),a}))},d.prototype.getPlaceDescription=function(a,b){var c=this,d=c.helpers.getAPIServerUrl(c.helpers.populateUriTemplate("/platform/places/description/{id}",{id:a}));return c.plumbing.get(d,{},{},b,e.compose(e.objectExtender({getPlaceDescription:function(){return e.maybe(this.places)[0]}}),function(a){var b={};return e.forEach(a.places,function(a,d,e){e[d]=b[a.id]=c.createPlaceDescription(a)}),e.forEach(a.places,function(a){if(a.jurisdiction&&a.jurisdiction.resource){var c=a.jurisdiction.resource.substring(1);b[c]&&a.$setJurisdiction(b[c])}}),a}))},d.prototype.getPlacesSearch=function(a,b){var c=this,d=c.helpers.getAPIServerUrl("/platform/places/search");return c.plumbing.get(d,e.removeEmptyProperties({q:e.searchParamsFilter(e.removeEmptyProperties(e.extend({},a))),start:a.start,count:a.count}),{Accept:"application/x-gedcomx-atom+json"},b,e.compose(e.objectExtender({getSearchResults:function(){return e.maybe(this.entries)}}),function(a){return e.forEach(a.entries,function(a,b,d){d[b]=c.createPlacesSearchResult(a)}),a}))},d.prototype.getPlaceDescriptionChildren=function(a,b){var c=this,d=c.helpers.getAPIServerUrl(c.helpers.populateUriTemplate("/platform/places/description/{id}/children",{id:a}));return c.plumbing.get(d,{},{},b,e.compose(e.objectExtender({getChildren:function(){return e.maybe(this.places)}}),function(a){return e.forEach(a.places,function(a,b,d){d[b]=c.createPlaceDescription(a)}),a}))},d.prototype.getPlaceType=function(a,b){var c=this,d=c.helpers.getAPIServerUrl(c.helpers.populateUriTemplate("/platform/places/types/{id}",{id:a}));return c.plumbing.get(d,{},{Accept:"application/ld+json"},b,e.compose(e.objectExtender({getPlaceType:function(){return c.createVocabularyElement(this)}})))},d.prototype.getPlaceTypes=function(a){var b=this,c=b.helpers.getAPIServerUrl("/platform/places/types");return b.plumbing.get(c,{},{Accept:"application/ld+json"},a,e.compose(e.objectExtender({getList:function(){return b.createVocabularyList(this)},getPlaceTypes:function(){return this.getList().$getElements()}})))},d.prototype.getPlaceTypeGroup=function(a,b){var c=this,d=c.helpers.getAPIServerUrl(c.helpers.populateUriTemplate("/platform/places/type-groups/{id}",{id:a}));return c.plumbing.get(d,{},{Accept:"application/ld+json"},b,e.compose(e.objectExtender({getList:function(){return c.createVocabularyList(this)},getPlaceTypes:function(){return this.getList().$getElements()}})))},d.prototype.getPlaceTypeGroups=function(a){var b=this,c=b.helpers.getAPIServerUrl("/platform/places/type-groups");return b.plumbing.get(c,{},{Accept:"application/ld+json"},a,e.compose(e.objectExtender({getList:function(){return b.createVocabularyList(this)},getPlaceTypeGroups:function(){return this.getList().$getElements()}})))}},{"./../FamilySearch":1,"./../utils":53}],44:[function(a,b,c){ +var d=a("./../FamilySearch");d.prototype.getRedirectUrl=function(a){return this.helpers.appendAccessToken(this.helpers.appendQueryParameters(this.helpers.getAPIServerUrl("/platform/redirect"),a))}},{"./../FamilySearch":1}],45:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils"),f={getSearchResults:function(){return this.entries||[]},getResultsCount:function(){return this.results||0},getIndex:function(){return this.index||0}};d.prototype._getSearchMatchResponseMapper=function(){var a=this;return e.compose(e.objectExtender(f),function(b){return e.forEach(b.entries,function(b,c,d){d[c]=a.createSearchResult(b)}),b})},d.prototype.getPersonSearch=function(a,b){var c=this;return c.helpers.chainHttpPromises(c.plumbing.getUrl("person-search"),function(d){return c.plumbing.get(d,e.removeEmptyProperties({q:e.searchParamsFilter(e.removeEmptyProperties(e.extend({},a))),start:a.start,count:a.count,context:a.context}),{Accept:"application/x-gedcomx-atom+json"},b,e.compose(c._getSearchMatchResponseMapper(),function(a,b){return a.getContext=function(){return b.getResponseHeader("X-FS-Page-Context")},a}))})},d.prototype.getPersonMatches=function(a,b,c){var d=this;return d.helpers.chainHttpPromises(d.plumbing.getUrl("person-matches-template",a,{pid:a}),function(a){return d.plumbing.get(a,b,{Accept:"application/x-gedcomx-atom+json"},c,d._getSearchMatchResponseMapper())})},d.prototype.getPersonMatchesQuery=function(a,b){var c=this;return c.helpers.chainHttpPromises(c.plumbing.getUrl("person-matches-query"),function(d){return c.plumbing.get(d,e.removeEmptyProperties({q:e.searchParamsFilter(e.removeEmptyProperties(e.extend({},a))),start:a.start,count:a.count}),{Accept:"application/x-gedcomx-atom+json"},b,c._getSearchMatchResponseMapper())})}},{"./../FamilySearch":1,"./../utils":53}],46:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils"),f=e.maybe;d.prototype.getCollectionsForUser=function(a,b,c){var d=this;return d.helpers.chainHttpPromises(d.plumbing.getUrl("user-collections-for-user-template",a,{uid:a}),function(a){return d.plumbing.get(a,{},{Accept:"application/x-fs-v1+json"},c,e.compose(e.objectExtender({getCollections:function(){return this.collections||[]}}),function(a){return e.forEach(a.collections,function(a,b,c){c[b]=d.createCollection(a)}),a}))})},d.prototype.getCollection=function(a,b,c){var d=this;return d.helpers.chainHttpPromises(d.plumbing.getUrl("user-collection-template",a,{udcid:a}),function(a){return d.plumbing.get(a,b,{Accept:"application/x-fs-v1+json"},c,e.compose(e.objectExtender({getCollection:function(){return f(this.collections)[0]}}),function(a){return e.forEach(a.collections,function(a,b,c){c[b]=d.createCollection(a)}),a}))})},d.prototype.getCollectionSourceDescriptions=function(a,b,c){var d=this;return d.helpers.chainHttpPromises(d.plumbing.getUrl("user-collection-source-descriptions-template",a,{udcid:a}),function(a){return d.plumbing.get(a,b,{Accept:"application/x-fs-v1+json"},c,e.compose(e.objectExtender({getSourceDescriptions:function(){return this.sourceDescriptions||[]}}),function(a){return e.forEach(a.sourceDescriptions,function(a,b,c){c[b]=d.createSourceDescription(a)}),a}))})},d.prototype.getCollectionSourceDescriptionsForUser=function(a,b,c){var d=this;return d.helpers.chainHttpPromises(d.plumbing.getUrl("user-collections-source-descriptions-for-user-template",a,{uid:a}),function(a){return d.plumbing.get(a,b,{Accept:"application/x-fs-v1+json"},c,e.compose(e.objectExtender({getSourceDescriptions:function(){return this.sourceDescriptions||[]}}),function(a){return e.forEach(a.sourceDescriptions,function(a,b,c){c[b]=d.createSourceDescription(a)}),a}))})},d.prototype.moveSourceDescriptionsToCollection=function(a,b,c){var f=this;return f.helpers.chainHttpPromises(f.plumbing.getUrl("user-collection-source-descriptions-template",a,{udcid:a}),function(g){var h=e.map(b,function(a){return{id:a instanceof d.SourceDescription?a.id:a}});return f.plumbing.post(g,{sourceDescriptions:h},{},c,function(){return a})})},d.prototype.removeSourceDescriptionsFromCollections=function(a,b){var c=this;return c.helpers.chainHttpPromises(c.getCurrentUser(),function(a){var b=a.getUser().treeUserId;return c.plumbing.getUrl("user-collections-source-descriptions-for-user-template",null,{uid:b})},function(f){var g=e.map(a,function(a){return a instanceof d.SourceDescription?a.id:a});return c.plumbing.del(c.helpers.appendQueryParameters(f,{id:g}),{},b,function(){return a})})},d.prototype.deleteCollection=function(a,b){var c=this;return c.helpers.chainHttpPromises(c.plumbing.getUrl("user-collection-template",a,{udcid:a}),function(d){return c.plumbing.del(d,{},b,function(){return a})})}},{"./../FamilySearch":1,"./../utils":53}],47:[function(a,b,c){var d=a("./../FamilySearch"),e=a("./../utils"),f=e.maybe;d.prototype.getSourceDescription=function(a,b,c){a instanceof d.SourceRef&&(a=a.$getSourceDescriptionUrl()||a.$sourceDescriptionId);var g=this;return g.helpers.chainHttpPromises(g.plumbing.getUrl("source-description-template",a,{sdid:a}),function(a){return g.plumbing.get(a,b,{},c,e.compose(e.objectExtender({getSourceDescription:function(){return f(this.sourceDescriptions)[0]}}),function(a){for(var b=f(f(a).sourceDescriptions),c=0;c=400?(a=c.errors?c.errors[0]:new Error("server responded with a "+k),i.reject(a)):i.resolve(c)}),j.getStatusCode=function(){return k},j.getResponseHeader=function(a){return l[a]},j.getAllResponseHeaders=function(){return l},j.getRequest=function(){return h},j}},c.deferredWrapper=function(a){return function(){var b=a();return{promise:b.promise,resolve:b.resolve,reject:b.reject}}},b.exports=c},{"./utils":53}],51:[function(a,b,c){function d(a){var b,c,e,f,g,h,i,j="";for(b in a)if(a.hasOwnProperty(b))if(c=a[b],c instanceof Array)for(i=0;i=500&&g>0||429===k){var l=n.getResponseHeader("Retry-After"),m=l?parseInt(l,10):j.settings.defaultThrottleRetryAfter;j.settings.setTimeout(function(){n=j.http(a,b,c,d,e,f,g-1),j.helpers.extendHttpPromise(i,n),n.then(function(a){h.resolve(a)},function(){h.reject.apply(h,arguments)})},m)}else h.reject.apply(h,arguments)})},function(){h.reject.apply(h,arguments)}),i},b.exports=f},{"./utils":53}],52:[function(a,b,c){var d=a("./FamilySearch"),e=a("./utils"),f=e.maybe,c={};c.setMember=function(a,b){this[a]||(this[a]={}),b instanceof d.Person?(this[a].resource=b.$getPersonUrl(),delete this[a].resourceId):this.$helpers.isAbsoluteUrl(b)?(this[a].resource=b,delete this[a].resourceId):e.isString(b)?(this[a].resourceId=b,delete this[a].resource):this[a]=b},c.deleteMember=function(a,b){this.$deletedMembers||(this.$deletedMembers={}),this.$deletedMembers[a]=b,delete this[a]},c.setFacts=function(a,b,d){e.isArray(this[a])&&e.forEach(this[a],function(b){c.deleteFact.call(this,a,b,d)},this),this[a]=[],e.forEach(b,function(b){c.addFact.call(this,a,b)},this)},c.addFact=function(a,b){e.isArray(this[a])||(this[a]=[]),b instanceof d.Fact||(b=this.$client.createFact(b)),this[a].push(b)},c.deleteFact=function(a,b,c){b instanceof d.Fact||(b=e.find(this[a],{id:b}));var g=e.indexOf(this[a],b);if(g>=0){var h=this.$helpers.removeAccessToken(f(f(f(b).links).conclusion).href);h&&(this.$deletedFacts||(this.$deletedFacts={}),this.$deletedFacts[h]=c),this[a].splice(g,1)}},b.exports=c},{"./FamilySearch":1,"./utils":53}],53:[function(a,b,c){function d(a,b){for(var c in a)if(a.hasOwnProperty(c)&&b[c]!==a[c])return!1;return!0}function e(a){return c.isString(a)?(a=a.replace(/[:"]/g,"").trim(),a.indexOf(" ")>=0?'"'+a+'"':a):a}var c=b.exports;Object.create||(Object.create=function(){function a(){}return function(b){if(1!==arguments.length)throw new Error("Object.create implementation only accepts one parameter.");return a.prototype=b,new a}}()),"function"!=typeof Object.getPrototypeOf&&(Object.getPrototypeOf="object"==typeof"".__proto__?function(a){return a.__proto__}:function(a){return a.constructor.prototype}),c.isArray=function(a){return Array.isArray?Array.isArray(a):"[object Array]"==Object.prototype.toString.call(a)},c.isString=function(a){return"[object String]"==Object.prototype.toString.call(a)},c.isFunction=function(a){return"function"!=typeof/./?"function"==typeof a:"[object Function]"==Object.prototype.toString.call(a)},c.isObject=function(a){return a===Object(a)},c.isUndefined=function(a){return void 0===a};var f=c.forEach=function(a,b,c){if(null!=a)if(Array.prototype.forEach&&a.forEach===Array.prototype.forEach)a.forEach(b,c);else if(a.length===+a.length){for(var d=0,e=a.length;e>d;d++)if(b.call(c,a[d],d,a)==={})return}else for(var f in a)if(a.hasOwnProperty(f)&&b.call(c,a[f],f,a)==={})return};c.removeEmptyProperties=function(a){return f(a,function(b,c){(null==b||""===b)&&delete a[c]}),a},c.keys=Object.keys||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c);return b},c.filter=function(a,b,e){var g=[],h=c.isFunction(b);return f(a,function(a){(h?b.call(e,a):d(b,a))&&g.push(a)}),g},c.map=function(a,b,c){var d=[];return f(a,function(a,e,f){d.push(b.call(c,a,e,f))}),d},c.contains=function(a,b){if(null==a)return!1;if(a.indexOf&&a.indexOf===Array.prototype.indexOf)return-1!==a.indexOf(b);var c=!1;return f(a,function(a){a===b&&(c=!0)}),c},c.indexOf=function(a,b){if(Array.prototype.indexOf===a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},c.uniq=function(a){var b=[];return f(a,function(a){c.contains(b,a)||b.push(a)}),b},c.find=function(a,b,e){var f,g=c.isFunction(b);if(a)for(var h=0,i=a.length;i>h;h++){var j=a[h];if(g?b.call(e,j):d(b,j)){f=j;break}}return f},c.findIndex=function(a,b,e){var f=-1,g=c.isFunction(b);if(a)for(var h=0,i=a.length;i>h;h++){var j=a[h];if(g?b.call(e,j):d(b,j)){f=h;break}}return f},c.compose=function(){var a=arguments;return function(){for(var b=arguments,c=a.length-1;c>=0;c--)a[c]&&(b=[a[c].apply(this,b)]);return b[0]}},c.flatten=function(a){var b=[];return f(a,function(a){c.isArray(a)&&Array.prototype.push.apply(b,a)}),b},c.flatMap=c.compose(c.flatten,c.map),c.union=function(){return c.uniq(c.flatten(arguments))},c.findOrFirst=function(a,b){if(!c.isUndefined(a)){var d=c.find(a,b);return c.isUndefined(d)?a[0]:d}return void 0},c.extend=function(a){return a=a||{},f(Array.prototype.slice.call(arguments,1),function(b){b&&f(b,function(b,c){a[c]=b})}),a},c.partialRight=function(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(this,Array.prototype.slice.call(arguments).concat(b))}},c.partial=function(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(this,b.concat(Array.prototype.slice.call(arguments)))}},c.maybe=function(a){return null!=a?a:{}},c.clonePartial=function(a,b){var d;if(null==a||"object"!=typeof a)return a;if(a instanceof Date)return d=new Date,d.setTime(a.getTime()),d;if(a instanceof Array){d=[];for(var e=0,f=a.length;f>e;e++)(!b||b(e))&&d.push(c.clonePartial(a[e],b));return d}if(a instanceof Object){d=Object.create(Object.getPrototypeOf(a));for(var g in a)!a.hasOwnProperty(g)||b&&!b(g)||(d[g]=c.clonePartial(a[g],b));return d}throw new Error("Unable to copy obj")},c.objectExtender=function(a,b){return function(d){return d&&(b?f(b(d),function(b){c.extend(b,c.isFunction(a)?a(d,b):a)}):c.extend(d,c.isFunction(a)?a(d,d):a)),d}},c.appFieldRejector=function(a){return!(c.isString(a)&&"_"===a.charAt(0))},c.deletePropertiesPartial=function(a,b){for(var c in a)!a.hasOwnProperty(c)||b&&!b(c)||delete a[c]},c.wrapFunctions=function(a,b,c){return f(c,function(c){a[c]=function(){return b[c].apply(b,arguments)}}),a};var g={start:!0,count:!0,context:!0};c.searchParamsFilter=function(a){return c.map(c.filter(c.keys(a),function(a){return!g[a]}),function(b){return b+":"+e(a[b])}).join(" ")}},{}]},{},[1])(1)}); \ No newline at end of file