/*! * Copyright 2013 Phil DeJarnett - http://www.overzealous.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ angular.module("naturalSort",[]).factory("naturalService",function(){"use strict";var a=function(a){return"00000000000000000000".slice(a.length)},b=function(a){return null===a||void 0===a?"":""+a},c=function(c){return b(c).replace(/(\d+)((\.\d+)+)?/g,function(b,c,d,e){return d!==e?b.replace(/(\d+)/g,function(b){return a(b)+b}):(d=d||".0",a(c)+c+d+a(d))})};return{naturalValue:c,naturalSort:function(a,b){return a=natVale(a),b=c(b),b>a?-1:a>b?1:0}}}).run(["$rootScope","naturalService",function(a,b){"use strict";a.natural=function(a){return function(c){return b.naturalValue(c[a])}}}]);