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AAWmD,EACJpB,EAAyBoB,EAClC,KAEAX,EAAUA,EAAiB,SAAE,WAC3BlG,EAAMgE,WAAY,GACbiB,GAAkBtE,IACrBX,EAAMiE,eAAiB7C,EACvBD,EAAS2F,OAAO9B,GAChBD,EAAkBC,EAAwBE,EAAWZ,QAAU,KAEnE,KAGQkC,KAAKZ,EAAiBI,GAEzBf,EAYEiB,GARLlG,EAAM+D,SAAWmC,EACjBlG,EAAMgE,WAAY,EACdrD,IAAaX,EAAMiE,eAQzB,SAAuBjE,GACrBkG,EAAQO,MAAMrF,GACU,OAApB2D,GACFA,EAAgBoB,QAAQnG,EAE5B,GAXSA,EAYX,EAGA4D,EAAS5B,UAAU,IAAMmC,GAAQ,SAAShC,EAAQ4E,EAASC,GACrDzF,EAAWY,KACb6E,EAAQD,EAASA,EAAU5E,EAAQA,EAAS,CAAC,GAE/C,IAAI8E,EAASrD,EAASO,GAAM+C,KAAK1G,KAAM2B,EAAQ3B,KAAMuG,EAASC,GAC9D,OAAOC,EAAOlD,UAAYkD,CAC5B,CACF,IAEOrD,CACT,CAGF,EACF,GAGD,CAz4BD,CAy4BGlF,OAAQA,OAAOC,Q,kBC94BlB,EAAQ,OACRwB,EAAOgH,QAAU,Y","sources":["webpack://apps/./node_modules/angular-resource/angular-resource.js","webpack://apps/./node_modules/angular-resource/index.js"],"sourcesContent":["/**\n * @license AngularJS v1.8.3\n * (c) 2010-2020 Google LLC. http://angularjs.org\n * License: MIT\n */\n(function(window, angular) {'use strict';\n\nvar $resourceMinErr = angular.$$minErr('$resource');\n\n// Helper functions and regex to lookup a dotted path on an object\n// stopping at undefined/null. The path must be composed of ASCII\n// identifiers (just like $parse)\nvar MEMBER_NAME_REGEX = /^(\\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;\n\nfunction isValidDottedPath(path) {\n return (path != null && path !== '' && path !== 'hasOwnProperty' &&\n MEMBER_NAME_REGEX.test('.' + path));\n}\n\nfunction lookupDottedPath(obj, path) {\n if (!isValidDottedPath(path)) {\n throw $resourceMinErr('badmember', 'Dotted member path \"@{0}\" is invalid.', path);\n }\n var keys = path.split('.');\n for (var i = 0, ii = keys.length; i < ii && angular.isDefined(obj); i++) {\n var key = keys[i];\n obj = (obj !== null) ? obj[key] : undefined;\n }\n return obj;\n}\n\n/**\n * Create a shallow copy of an object and clear other fields from the destination\n */\nfunction shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}\n\n/**\n * @ngdoc module\n * @name ngResource\n * @description\n *\n * The `ngResource` module provides interaction support with RESTful services\n * via the $resource service.\n *\n * See {@link ngResource.$resourceProvider} and {@link ngResource.$resource} for usage.\n */\n\n/**\n * @ngdoc provider\n * @name $resourceProvider\n *\n * @description\n *\n * Use `$resourceProvider` to change the default behavior of the {@link ngResource.$resource}\n * service.\n *\n * ## Dependencies\n * Requires the {@link ngResource } module to be installed.\n *\n */\n\n/**\n * @ngdoc service\n * @name $resource\n * @requires $http\n * @requires ng.$log\n * @requires $q\n * @requires ng.$timeout\n *\n * @description\n * A factory which creates a resource object that lets you interact with\n * [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer) server-side data sources.\n *\n * The returned resource object has action methods which provide high-level behaviors without\n * the need to interact with the low level {@link ng.$http $http} service.\n *\n * Requires the {@link ngResource `ngResource`} module to be installed.\n *\n * By default, trailing slashes will be stripped from the calculated URLs,\n * which can pose problems with server backends that do not expect that\n * behavior. This can be disabled by configuring the `$resourceProvider` like\n * this:\n *\n * ```js\n app.config(['$resourceProvider', function($resourceProvider) {\n // Don't strip trailing slashes from calculated URLs\n $resourceProvider.defaults.stripTrailingSlashes = false;\n }]);\n * ```\n *\n * @param {string} url A parameterized URL template with parameters prefixed by `:` as in\n * `/user/:username`. If you are using a URL with a port number (e.g.\n * `http://example.com:8080/api`), it will be respected.\n *\n * If you are using a url with a suffix, just add the suffix, like this:\n * `$resource('http://example.com/resource.json')` or `$resource('http://example.com/:id.json')`\n * or even `$resource('http://example.com/resource/:resource_id.:format')`\n * If the parameter before the suffix is empty, :resource_id in this case, then the `/.` will be\n * collapsed down to a single `.`. If you need this sequence to appear and not collapse then you\n * can escape it with `/\\.`.\n *\n * @param {Object=} paramDefaults Default values for `url` parameters. These can be overridden in\n * `actions` methods. If a parameter value is a function, it will be called every time\n * a param value needs to be obtained for a request (unless the param was overridden). The\n * function will be passed the current data value as an argument.\n *\n * Each key value in the parameter object is first bound to url template if present and then any\n * excess keys are appended to the url search query after the `?`.\n *\n * Given a template `/path/:verb` and parameter `{verb: 'greet', salutation: 'Hello'}` results in\n * URL `/path/greet?salutation=Hello`.\n *\n * If the parameter value is prefixed with `@`, then the value for that parameter will be\n * extracted from the corresponding property on the `data` object (provided when calling actions\n * with a request body).\n * For example, if the `defaultParam` object is `{someParam: '@someProp'}` then the value of\n * `someParam` will be `data.someProp`.\n * Note that the parameter will be ignored, when calling a \"GET\" action method (i.e. an action\n * method that does not accept a request body).\n *\n * @param {Object.=} actions Hash with declaration of custom actions that will be available\n * in addition to the default set of resource actions (see below). If a custom action has the same\n * key as a default action (e.g. `save`), then the default action will be *overwritten*, and not\n * extended.\n *\n * The declaration should be created in the format of {@link ng.$http#usage $http.config}:\n *\n * {\n * action1: {method:?, params:?, isArray:?, headers:?, ...},\n * action2: {method:?, params:?, isArray:?, headers:?, ...},\n * ...\n * }\n *\n * Where:\n *\n * - **`action`** – {string} – The name of action. This name becomes the name of the method on\n * your resource object.\n * - **`method`** – {string} – Case insensitive HTTP method (e.g. `GET`, `POST`, `PUT`,\n * `DELETE`, `JSONP`, etc).\n * - **`params`** – {Object=} – Optional set of pre-bound parameters for this action. If any of\n * the parameter value is a function, it will be called every time when a param value needs to\n * be obtained for a request (unless the param was overridden). The function will be passed the\n * current data value as an argument.\n * - **`url`** – {string} – Action specific `url` override. The url templating is supported just\n * like for the resource-level urls.\n * - **`isArray`** – {boolean=} – If true then the returned object for this action is an array,\n * see `returns` section.\n * - **`transformRequest`** –\n * `{function(data, headersGetter)|Array.}` –\n * Transform function or an array of such functions. The transform function takes the http\n * request body and headers and returns its transformed (typically serialized) version.\n * By default, transformRequest will contain one function that checks if the request data is\n * an object and serializes it using `angular.toJson`. To prevent this behavior, set\n * `transformRequest` to an empty array: `transformRequest: []`\n * - **`transformResponse`** –\n * `{function(data, headersGetter, status)|Array.}` –\n * Transform function or an array of such functions. The transform function takes the HTTP\n * response body, headers and status and returns its transformed (typically deserialized)\n * version.\n * By default, transformResponse will contain one function that checks if the response looks\n * like a JSON string and deserializes it using `angular.fromJson`. To prevent this behavior,\n * set `transformResponse` to an empty array: `transformResponse: []`\n * - **`cache`** – `{boolean|Cache}` – A boolean value or object created with\n * {@link ng.$cacheFactory `$cacheFactory`} to enable or disable caching of the HTTP response.\n * See {@link $http#caching $http Caching} for more information.\n * - **`timeout`** – `{number}` – Timeout in milliseconds.
\n * **Note:** In contrast to {@link ng.$http#usage $http.config}, {@link ng.$q promises} are\n * **not** supported in `$resource`, because the same value would be used for multiple requests.\n * If you are looking for a way to cancel requests, you should use the `cancellable` option.\n * - **`cancellable`** – `{boolean}` – If true, the request made by a \"non-instance\" call will be\n * cancelled (if not already completed) by calling `$cancelRequest()` on the call's return\n * value. Calling `$cancelRequest()` for a non-cancellable or an already completed/cancelled\n * request will have no effect.\n * - **`withCredentials`** – `{boolean}` – Whether to set the `withCredentials` flag on the\n * XHR object. See\n * [XMLHttpRequest.withCredentials](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials)\n * for more information.\n * - **`responseType`** – `{string}` – See\n * [XMLHttpRequest.responseType](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseType).\n * - **`interceptor`** – `{Object=}` – The interceptor object has four optional methods -\n * `request`, `requestError`, `response`, and `responseError`. See\n * {@link ng.$http#interceptors $http interceptors} for details. Note that\n * `request`/`requestError` interceptors are applied before calling `$http`, thus before any\n * global `$http` interceptors. Also, rejecting or throwing an error inside the `request`\n * interceptor will result in calling the `responseError` interceptor.\n * The resource instance or collection is available on the `resource` property of the\n * `http response` object passed to `response`/`responseError` interceptors.\n * Keep in mind that the associated promise will be resolved with the value returned by the\n * response interceptors. Make sure you return an appropriate value and not the `response`\n * object passed as input. For reference, the default `response` interceptor (which gets applied\n * if you don't specify a custom one) returns `response.resource`.
\n * See {@link ngResource.$resource#using-interceptors below} for an example of using\n * interceptors in `$resource`.\n * - **`hasBody`** – `{boolean}` – If true, then the request will have a body.\n * If not specified, then only POST, PUT and PATCH requests will have a body. *\n * @param {Object} options Hash with custom settings that should extend the\n * default `$resourceProvider` behavior. The supported options are:\n *\n * - **`stripTrailingSlashes`** – {boolean} – If true then the trailing\n * slashes from any calculated URL will be stripped. (Defaults to true.)\n * - **`cancellable`** – {boolean} – If true, the request made by a \"non-instance\" call will be\n * cancelled (if not already completed) by calling `$cancelRequest()` on the call's return value.\n * This can be overwritten per action. (Defaults to false.)\n *\n * @returns {Object} A resource \"class\" object with methods for the default set of resource actions\n * optionally extended with custom `actions`. The default set contains these actions:\n * ```js\n * {\n * 'get': {method: 'GET'},\n * 'save': {method: 'POST'},\n * 'query': {method: 'GET', isArray: true},\n * 'remove': {method: 'DELETE'},\n * 'delete': {method: 'DELETE'}\n * }\n * ```\n *\n * Calling these methods invoke {@link ng.$http} with the specified http method, destination and\n * parameters. When the data is returned from the server then the object is an instance of the\n * resource class. The actions `save`, `remove` and `delete` are available on it as methods with\n * the `$` prefix. This allows you to easily perform CRUD operations (create, read, update,\n * delete) on server-side data like this:\n * ```js\n * var User = $resource('/user/:userId', {userId: '@id'});\n * User.get({userId: 123}).$promise.then(function(user) {\n * user.abc = true;\n * user.$save();\n * });\n * ```\n *\n * It is important to realize that invoking a `$resource` object method immediately returns an\n * empty reference (object or array depending on `isArray`). Once the data is returned from the\n * server the existing reference is populated with the actual data. This is a useful trick since\n * usually the resource is assigned to a model which is then rendered by the view. Having an empty\n * object results in no rendering, once the data arrives from the server then the object is\n * populated with the data and the view automatically re-renders itself showing the new data. This\n * means that in most cases one never has to write a callback function for the action methods.\n *\n * The action methods on the class object or instance object can be invoked with the following\n * parameters:\n *\n * - \"class\" actions without a body: `Resource.action([parameters], [success], [error])`\n * - \"class\" actions with a body: `Resource.action([parameters], postData, [success], [error])`\n * - instance actions: `instance.$action([parameters], [success], [error])`\n *\n *\n * When calling instance methods, the instance itself is used as the request body (if the action\n * should have a body). By default, only actions using `POST`, `PUT` or `PATCH` have request\n * bodies, but you can use the `hasBody` configuration option to specify whether an action\n * should have a body or not (regardless of its HTTP method).\n *\n *\n * Success callback is called with (value (Object|Array), responseHeaders (Function),\n * status (number), statusText (string)) arguments, where `value` is the populated resource\n * instance or collection object. The error callback is called with (httpResponse) argument.\n *\n * Class actions return an empty instance (with the additional properties listed below).\n * Instance actions return a promise for the operation.\n *\n * The Resource instances and collections have these additional properties:\n *\n * - `$promise`: The {@link ng.$q promise} of the original server interaction that created this\n * instance or collection.\n *\n * On success, the promise is resolved with the same resource instance or collection object,\n * updated with data from server. This makes it easy to use in the\n * {@link ngRoute.$routeProvider `resolve` section of `$routeProvider.when()`} to defer view\n * rendering until the resource(s) are loaded.\n *\n * On failure, the promise is rejected with the {@link ng.$http http response} object.\n *\n * If an interceptor object was provided, the promise will instead be resolved with the value\n * returned by the response interceptor (on success) or responceError interceptor (on failure).\n *\n * - `$resolved`: `true` after first server interaction is completed (either with success or\n * rejection), `false` before that. Knowing if the Resource has been resolved is useful in\n * data-binding. If there is a response/responseError interceptor and it returns a promise,\n * `$resolved` will wait for that too.\n *\n * The Resource instances and collections have these additional methods:\n *\n * - `$cancelRequest`: If there is a cancellable, pending request related to the instance or\n * collection, calling this method will abort the request.\n *\n * The Resource instances have these additional methods:\n *\n * - `toJSON`: It returns a simple object without any of the extra properties added as part of\n * the Resource API. This object can be serialized through {@link angular.toJson} safely\n * without attaching AngularJS-specific fields. Notice that `JSON.stringify` (and\n * `angular.toJson`) automatically use this method when serializing a Resource instance\n * (see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#toJSON%28%29_behavior)).\n *\n * @example\n *\n * ### Basic usage\n *\n ```js\n // Define a CreditCard class\n var CreditCard = $resource('/users/:userId/cards/:cardId',\n {userId: 123, cardId: '@id'}, {\n charge: {method: 'POST', params: {charge: true}}\n });\n\n // We can retrieve a collection from the server\n var cards = CreditCard.query();\n // GET: /users/123/cards\n // server returns: [{id: 456, number: '1234', name: 'Smith'}]\n\n // Wait for the request to complete\n cards.$promise.then(function() {\n var card = cards[0];\n\n // Each item is an instance of CreditCard\n expect(card instanceof CreditCard).toEqual(true);\n\n // Non-GET methods are mapped onto the instances\n card.name = 'J. Smith';\n card.$save();\n // POST: /users/123/cards/456 {id: 456, number: '1234', name: 'J. Smith'}\n // server returns: {id: 456, number: '1234', name: 'J. Smith'}\n\n // Our custom method is mapped as well (since it uses POST)\n card.$charge({amount: 9.99});\n // POST: /users/123/cards/456?amount=9.99&charge=true {id: 456, number: '1234', name: 'J. Smith'}\n });\n\n // We can create an instance as well\n var newCard = new CreditCard({number: '0123'});\n newCard.name = 'Mike Smith';\n\n var savePromise = newCard.$save();\n // POST: /users/123/cards {number: '0123', name: 'Mike Smith'}\n // server returns: {id: 789, number: '0123', name: 'Mike Smith'}\n\n savePromise.then(function() {\n // Once the promise is resolved, the created instance\n // is populated with the data returned by the server\n expect(newCard.id).toEqual(789);\n });\n ```\n *\n * The object returned from a call to `$resource` is a resource \"class\" which has one \"static\"\n * method for each action in the definition.\n *\n * Calling these methods invokes `$http` on the `url` template with the given HTTP `method`,\n * `params` and `headers`.\n *\n * @example\n *\n * ### Accessing the response\n *\n * When the data is returned from the server then the object is an instance of the resource type and\n * all of the non-GET methods are available with `$` prefix. This allows you to easily support CRUD\n * operations (create, read, update, delete) on server-side data.\n *\n ```js\n var User = $resource('/users/:userId', {userId: '@id'});\n User.get({userId: 123}).$promise.then(function(user) {\n user.abc = true;\n user.$save();\n });\n ```\n *\n * It's worth noting that the success callback for `get`, `query` and other methods gets called with\n * the resource instance (populated with the data that came from the server) as well as an `$http`\n * header getter function, the HTTP status code and the response status text. So one could rewrite\n * the above example and get access to HTTP headers as follows:\n *\n ```js\n var User = $resource('/users/:userId', {userId: '@id'});\n User.get({userId: 123}, function(user, getResponseHeaders) {\n user.abc = true;\n user.$save(function(user, putResponseHeaders) {\n // `user` => saved `User` object\n // `putResponseHeaders` => `$http` header getter\n });\n });\n ```\n *\n * @example\n *\n * ### Creating custom actions\n *\n * In this example we create a custom method on our resource to make a PUT request:\n *\n ```js\n var app = angular.module('app', ['ngResource']);\n\n // Some APIs expect a PUT request in the format URL/object/ID\n // Here we are creating an 'update' method\n app.factory('Notes', ['$resource', function($resource) {\n return $resource('/notes/:id', {id: '@id'}, {\n update: {method: 'PUT'}\n });\n }]);\n\n // In our controller we get the ID from the URL using `$location`\n app.controller('NotesCtrl', ['$location', 'Notes', function($location, Notes) {\n // First, retrieve the corresponding `Note` object from the server\n // (Assuming a URL of the form `.../notes?id=XYZ`)\n var noteId = $location.search().id;\n var note = Notes.get({id: noteId});\n\n note.$promise.then(function() {\n note.content = 'Hello, world!';\n\n // Now call `update` to save the changes on the server\n Notes.update(note);\n // This will PUT /notes/ID with the note object as the request payload\n\n // Since `update` is a non-GET method, it will also be available on the instance\n // (prefixed with `$`), so we could replace the `Note.update()` call with:\n //note.$update();\n });\n }]);\n ```\n *\n * @example\n *\n * ### Cancelling requests\n *\n * If an action's configuration specifies that it is cancellable, you can cancel the request related\n * to an instance or collection (as long as it is a result of a \"non-instance\" call):\n *\n ```js\n // ...defining the `Hotel` resource...\n var Hotel = $resource('/api/hotels/:id', {id: '@id'}, {\n // Let's make the `query()` method cancellable\n query: {method: 'get', isArray: true, cancellable: true}\n });\n\n // ...somewhere in the PlanVacationController...\n ...\n this.onDestinationChanged = function onDestinationChanged(destination) {\n // We don't care about any pending request for hotels\n // in a different destination any more\n if (this.availableHotels) {\n this.availableHotels.$cancelRequest();\n }\n\n // Let's query for hotels in `destination`\n // (calls: /api/hotels?location=)\n this.availableHotels = Hotel.query({location: destination});\n };\n ```\n *\n * @example\n *\n * ### Using interceptors\n *\n * You can use interceptors to transform the request or response, perform additional operations, and\n * modify the returned instance/collection. The following example, uses `request` and `response`\n * interceptors to augment the returned instance with additional info:\n *\n ```js\n var Thing = $resource('/api/things/:id', {id: '@id'}, {\n save: {\n method: 'POST',\n interceptor: {\n request: function(config) {\n // Before the request is sent out, store a timestamp on the request config\n config.requestTimestamp = Date.now();\n return config;\n },\n response: function(response) {\n // Get the instance from the response object\n var instance = response.resource;\n\n // Augment the instance with a custom `saveLatency` property, computed as the time\n // between sending the request and receiving the response.\n instance.saveLatency = Date.now() - response.config.requestTimestamp;\n\n // Return the instance\n return instance;\n }\n }\n }\n });\n\n Thing.save({foo: 'bar'}).$promise.then(function(thing) {\n console.log('That thing was saved in ' + thing.saveLatency + 'ms.');\n });\n ```\n *\n */\nangular.module('ngResource', ['ng']).\n info({ angularVersion: '1.8.3' }).\n provider('$resource', function ResourceProvider() {\n var PROTOCOL_AND_IPV6_REGEX = /^https?:\\/\\/\\[[^\\]]*][^/]*/;\n\n var provider = this;\n\n /**\n * @ngdoc property\n * @name $resourceProvider#defaults\n * @description\n * Object containing default options used when creating `$resource` instances.\n *\n * The default values satisfy a wide range of usecases, but you may choose to overwrite any of\n * them to further customize your instances. The available properties are:\n *\n * - **stripTrailingSlashes** – `{boolean}` – If true, then the trailing slashes from any\n * calculated URL will be stripped.
\n * (Defaults to true.)\n * - **cancellable** – `{boolean}` – If true, the request made by a \"non-instance\" call will be\n * cancelled (if not already completed) by calling `$cancelRequest()` on the call's return\n * value. For more details, see {@link ngResource.$resource}. This can be overwritten per\n * resource class or action.
\n * (Defaults to false.)\n * - **actions** - `{Object.}` - A hash with default actions declarations. Actions are\n * high-level methods corresponding to RESTful actions/methods on resources. An action may\n * specify what HTTP method to use, what URL to hit, if the return value will be a single\n * object or a collection (array) of objects etc. For more details, see\n * {@link ngResource.$resource}. The actions can also be enhanced or overwritten per resource\n * class.
\n * The default actions are:\n * ```js\n * {\n * get: {method: 'GET'},\n * save: {method: 'POST'},\n * query: {method: 'GET', isArray: true},\n * remove: {method: 'DELETE'},\n * delete: {method: 'DELETE'}\n * }\n * ```\n *\n * #### Example\n *\n * For example, you can specify a new `update` action that uses the `PUT` HTTP verb:\n *\n * ```js\n * angular.\n * module('myApp').\n * config(['$resourceProvider', function ($resourceProvider) {\n * $resourceProvider.defaults.actions.update = {\n * method: 'PUT'\n * };\n * }]);\n * ```\n *\n * Or you can even overwrite the whole `actions` list and specify your own:\n *\n * ```js\n * angular.\n * module('myApp').\n * config(['$resourceProvider', function ($resourceProvider) {\n * $resourceProvider.defaults.actions = {\n * create: {method: 'POST'},\n * get: {method: 'GET'},\n * getAll: {method: 'GET', isArray:true},\n * update: {method: 'PUT'},\n * delete: {method: 'DELETE'}\n * };\n * });\n * ```\n *\n */\n this.defaults = {\n // Strip slashes by default\n stripTrailingSlashes: true,\n\n // Make non-instance requests cancellable (via `$cancelRequest()`)\n cancellable: false,\n\n // Default actions configuration\n actions: {\n 'get': {method: 'GET'},\n 'save': {method: 'POST'},\n 'query': {method: 'GET', isArray: true},\n 'remove': {method: 'DELETE'},\n 'delete': {method: 'DELETE'}\n }\n };\n\n this.$get = ['$http', '$log', '$q', '$timeout', function($http, $log, $q, $timeout) {\n\n var noop = angular.noop,\n forEach = angular.forEach,\n extend = angular.extend,\n copy = angular.copy,\n isArray = angular.isArray,\n isDefined = angular.isDefined,\n isFunction = angular.isFunction,\n isNumber = angular.isNumber,\n encodeUriQuery = angular.$$encodeUriQuery,\n encodeUriSegment = angular.$$encodeUriSegment;\n\n function Route(template, defaults) {\n this.template = template;\n this.defaults = extend({}, provider.defaults, defaults);\n this.urlParams = {};\n }\n\n Route.prototype = {\n setUrlParams: function(config, params, actionUrl) {\n var self = this,\n url = actionUrl || self.template,\n val,\n encodedVal,\n protocolAndIpv6 = '';\n\n var urlParams = self.urlParams = Object.create(null);\n forEach(url.split(/\\W/), function(param) {\n if (param === 'hasOwnProperty') {\n throw $resourceMinErr('badname', 'hasOwnProperty is not a valid parameter name.');\n }\n if (!(new RegExp('^\\\\d+$').test(param)) && param &&\n (new RegExp('(^|[^\\\\\\\\]):' + param + '(\\\\W|$)').test(url))) {\n urlParams[param] = {\n isQueryParamValue: (new RegExp('\\\\?.*=:' + param + '(?:\\\\W|$)')).test(url)\n };\n }\n });\n url = url.replace(/\\\\:/g, ':');\n url = url.replace(PROTOCOL_AND_IPV6_REGEX, function(match) {\n protocolAndIpv6 = match;\n return '';\n });\n\n params = params || {};\n forEach(self.urlParams, function(paramInfo, urlParam) {\n val = params.hasOwnProperty(urlParam) ? params[urlParam] : self.defaults[urlParam];\n if (isDefined(val) && val !== null) {\n if (paramInfo.isQueryParamValue) {\n encodedVal = encodeUriQuery(val, true);\n } else {\n encodedVal = encodeUriSegment(val);\n }\n url = url.replace(new RegExp(':' + urlParam + '(\\\\W|$)', 'g'), function(match, p1) {\n return encodedVal + p1;\n });\n } else {\n url = url.replace(new RegExp('(/?):' + urlParam + '(\\\\W|$)', 'g'), function(match,\n leadingSlashes, tail) {\n if (tail.charAt(0) === '/') {\n return tail;\n } else {\n return leadingSlashes + tail;\n }\n });\n }\n });\n\n // strip trailing slashes and set the url (unless this behavior is specifically disabled)\n if (self.defaults.stripTrailingSlashes) {\n url = url.replace(/\\/+$/, '') || '/';\n }\n\n // Collapse `/.` if found in the last URL path segment before the query.\n // E.g. `http://url.com/id/.format?q=x` becomes `http://url.com/id.format?q=x`.\n url = url.replace(/\\/\\.(?=\\w+($|\\?))/, '.');\n // Replace escaped `/\\.` with `/.`.\n // (If `\\.` comes from a param value, it will be encoded as `%5C.`.)\n config.url = protocolAndIpv6 + url.replace(/\\/(\\\\|%5C)\\./, '/.');\n\n\n // set params - delegate param encoding to $http\n forEach(params, function(value, key) {\n if (!self.urlParams[key]) {\n config.params = config.params || {};\n config.params[key] = value;\n }\n });\n }\n };\n\n\n function resourceFactory(url, paramDefaults, actions, options) {\n var route = new Route(url, options);\n\n actions = extend({}, provider.defaults.actions, actions);\n\n function extractParams(data, actionParams) {\n var ids = {};\n actionParams = extend({}, paramDefaults, actionParams);\n forEach(actionParams, function(value, key) {\n if (isFunction(value)) { value = value(data); }\n ids[key] = value && value.charAt && value.charAt(0) === '@' ?\n lookupDottedPath(data, value.substr(1)) : value;\n });\n return ids;\n }\n\n function defaultResponseInterceptor(response) {\n return response.resource;\n }\n\n function Resource(value) {\n shallowClearAndCopy(value || {}, this);\n }\n\n Resource.prototype.toJSON = function() {\n var data = extend({}, this);\n delete data.$promise;\n delete data.$resolved;\n delete data.$cancelRequest;\n return data;\n };\n\n forEach(actions, function(action, name) {\n var hasBody = action.hasBody === true || (action.hasBody !== false && /^(POST|PUT|PATCH)$/i.test(action.method));\n var numericTimeout = action.timeout;\n var cancellable = isDefined(action.cancellable) ?\n action.cancellable : route.defaults.cancellable;\n\n if (numericTimeout && !isNumber(numericTimeout)) {\n $log.debug('ngResource:\\n' +\n ' Only numeric values are allowed as `timeout`.\\n' +\n ' Promises are not supported in $resource, because the same value would ' +\n 'be used for multiple requests. If you are looking for a way to cancel ' +\n 'requests, you should use the `cancellable` option.');\n delete action.timeout;\n numericTimeout = null;\n }\n\n Resource[name] = function(a1, a2, a3, a4) {\n var params = {}, data, onSuccess, onError;\n\n switch (arguments.length) {\n case 4:\n onError = a4;\n onSuccess = a3;\n // falls through\n case 3:\n case 2:\n if (isFunction(a2)) {\n if (isFunction(a1)) {\n onSuccess = a1;\n onError = a2;\n break;\n }\n\n onSuccess = a2;\n onError = a3;\n // falls through\n } else {\n params = a1;\n data = a2;\n onSuccess = a3;\n break;\n }\n // falls through\n case 1:\n if (isFunction(a1)) onSuccess = a1;\n else if (hasBody) data = a1;\n else params = a1;\n break;\n case 0: break;\n default:\n throw $resourceMinErr('badargs',\n 'Expected up to 4 arguments [params, data, success, error], got {0} arguments',\n arguments.length);\n }\n\n var isInstanceCall = this instanceof Resource;\n var value = isInstanceCall ? data : (action.isArray ? [] : new Resource(data));\n var httpConfig = {};\n var requestInterceptor = action.interceptor && action.interceptor.request || undefined;\n var requestErrorInterceptor = action.interceptor && action.interceptor.requestError ||\n undefined;\n var responseInterceptor = action.interceptor && action.interceptor.response ||\n defaultResponseInterceptor;\n var responseErrorInterceptor = action.interceptor && action.interceptor.responseError ||\n $q.reject;\n var successCallback = onSuccess ? function(val) {\n onSuccess(val, response.headers, response.status, response.statusText);\n } : undefined;\n var errorCallback = onError || undefined;\n var timeoutDeferred;\n var numericTimeoutPromise;\n var response;\n\n forEach(action, function(value, key) {\n switch (key) {\n default:\n httpConfig[key] = copy(value);\n break;\n case 'params':\n case 'isArray':\n case 'interceptor':\n case 'cancellable':\n break;\n }\n });\n\n if (!isInstanceCall && cancellable) {\n timeoutDeferred = $q.defer();\n httpConfig.timeout = timeoutDeferred.promise;\n\n if (numericTimeout) {\n numericTimeoutPromise = $timeout(timeoutDeferred.resolve, numericTimeout);\n }\n }\n\n if (hasBody) httpConfig.data = data;\n route.setUrlParams(httpConfig,\n extend({}, extractParams(data, action.params || {}), params),\n action.url);\n\n // Start the promise chain\n var promise = $q.\n resolve(httpConfig).\n then(requestInterceptor).\n catch(requestErrorInterceptor).\n then($http);\n\n promise = promise.then(function(resp) {\n var data = resp.data;\n\n if (data) {\n // Need to convert action.isArray to boolean in case it is undefined\n if (isArray(data) !== (!!action.isArray)) {\n throw $resourceMinErr('badcfg',\n 'Error in resource configuration for action `{0}`. Expected response to ' +\n 'contain an {1} but got an {2} (Request: {3} {4})', name, action.isArray ? 'array' : 'object',\n isArray(data) ? 'array' : 'object', httpConfig.method, httpConfig.url);\n }\n if (action.isArray) {\n value.length = 0;\n forEach(data, function(item) {\n if (typeof item === 'object') {\n value.push(new Resource(item));\n } else {\n // Valid JSON values may be string literals, and these should not be converted\n // into objects. These items will not have access to the Resource prototype\n // methods, but unfortunately there\n value.push(item);\n }\n });\n } else {\n var promise = value.$promise; // Save the promise\n shallowClearAndCopy(data, value);\n value.$promise = promise; // Restore the promise\n }\n }\n\n resp.resource = value;\n response = resp;\n return responseInterceptor(resp);\n }, function(rejectionOrResponse) {\n rejectionOrResponse.resource = value;\n response = rejectionOrResponse;\n return responseErrorInterceptor(rejectionOrResponse);\n });\n\n promise = promise['finally'](function() {\n value.$resolved = true;\n if (!isInstanceCall && cancellable) {\n value.$cancelRequest = noop;\n $timeout.cancel(numericTimeoutPromise);\n timeoutDeferred = numericTimeoutPromise = httpConfig.timeout = null;\n }\n });\n\n // Run the `success`/`error` callbacks, but do not let them affect the returned promise.\n promise.then(successCallback, errorCallback);\n\n if (!isInstanceCall) {\n // we are creating instance / collection\n // - set the initial promise\n // - return the instance / collection\n value.$promise = promise;\n value.$resolved = false;\n if (cancellable) value.$cancelRequest = cancelRequest;\n\n return value;\n }\n\n // instance call\n return promise;\n\n function cancelRequest(value) {\n promise.catch(noop);\n if (timeoutDeferred !== null) {\n timeoutDeferred.resolve(value);\n }\n }\n };\n\n\n Resource.prototype['$' + name] = function(params, success, error) {\n if (isFunction(params)) {\n error = success; success = params; params = {};\n }\n var result = Resource[name].call(this, params, this, success, error);\n return result.$promise || result;\n };\n });\n\n return Resource;\n }\n\n return resourceFactory;\n }];\n });\n\n\n})(window, window.angular);\n","require('./angular-resource');\nmodule.exports = 'ngResource';\n"],"names":["window","angular","$resourceMinErr","$$minErr","MEMBER_NAME_REGEX","lookupDottedPath","obj","path","test","isValidDottedPath","keys","split","i","ii","length","isDefined","key","undefined","shallowClearAndCopy","src","dst","forEach","value","hasOwnProperty","charAt","module","info","angularVersion","provider","PROTOCOL_AND_IPV6_REGEX","this","defaults","stripTrailingSlashes","cancellable","actions","method","isArray","$get","$http","$log","$q","$timeout","noop","extend","copy","isFunction","isNumber","encodeUriQuery","$$encodeUriQuery","encodeUriSegment","$$encodeUriSegment","Route","template","urlParams","prototype","setUrlParams","config","params","actionUrl","val","encodedVal","self","url","protocolAndIpv6","Object","create","param","RegExp","isQueryParamValue","replace","match","paramInfo","urlParam","p1","leadingSlashes","tail","paramDefaults","options","route","defaultResponseInterceptor","response","resource","Resource","toJSON","data","$promise","$resolved","$cancelRequest","action","name","hasBody","numericTimeout","timeout","debug","a1","a2","a3","a4","onSuccess","onError","arguments","timeoutDeferred","numericTimeoutPromise","isInstanceCall","httpConfig","requestInterceptor","interceptor","request","requestErrorInterceptor","requestError","responseInterceptor","responseErrorInterceptor","responseError","reject","successCallback","headers","status","statusText","errorCallback","defer","promise","resolve","actionParams","ids","substr","extractParams","then","catch","resp","item","push","rejectionOrResponse","cancel","success","error","result","call","exports"],"sourceRoot":""}