Dashboard sipadu mbip
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

alpaca.min.js 595KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153
  1. ! function(e, t) {
  2. var n = !0;
  3. e && "undefined" != typeof e.umd && (n = e.umd), n && "object" == typeof exports ? module.exports = t(require("jquery"), require("handlebars"), require("bootstrap")) : n && "function" == typeof define && define.amd ? define("alpaca", ["jquery", "handlebars", "bootstrap"], t) : e.Alpaca = t(e.jQuery, e.Handlebars, e.Bootstrap) }(this, function($, Handlebars, Bootstrap) {
  4. return this.HandlebarsPrecompiled = this.HandlebarsPrecompiled || {}, this.HandlebarsPrecompiled["web-display"] = this.HandlebarsPrecompiled["web-display"] || {}, this.HandlebarsPrecompiled["web-display"]["container-array-item"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  5. return "" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  6. var r, o, l, s = '<script type="text/x-handlebars-template">\n\n <div>\n ';
  7. return o = null != (o = n.itemField || (null != t ? t.itemField : t)) ? o : n.helperMissing, l = { name: "itemField", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(null != t ? t : {}, l) : o, n.itemField || (r = n.blockHelperMissing.call(t, r, l)), null != r && (s += r), s + "\n </div>\n\n</script>\n" }, useData: !0 }), this.HandlebarsPrecompiled["web-display"]["container-array"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  8. var r, o, l, s = "\n ";
  9. return o = null != (o = n.item || (null != t ? t.item : t)) ? o : n.helperMissing, l = { name: "item", hash: {}, fn: e.program(2, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(null != t ? t : {}, l) : o, n.item || (r = n.blockHelperMissing.call(t, r, l)), null != r && (s += r), s + "\n\n" }, 2: function(e, t, n, i, a) {
  10. return "" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  11. var r;
  12. return '<script type="text/x-handlebars-template">\n\n <div>\n\n' + (null != (r = n.each.call(null != t ? t : {}, null != t ? t.items : t, { name: "each", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n </div>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-display"]["container-object-item"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  13. return "" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  14. var r, o, l, s = '<script type="text/x-handlebars-template">\n\n <div>\n ';
  15. return o = null != (o = n.itemField || (null != t ? t.itemField : t)) ? o : n.helperMissing, l = { name: "itemField", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(null != t ? t : {}, l) : o, n.itemField || (r = n.blockHelperMissing.call(t, r, l)), null != r && (s += r), s + "\n </div>\n\n</script>\n" }, useData: !0 }), this.HandlebarsPrecompiled["web-display"]["container-object"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  16. var r, o, l, s = "\n ";
  17. return o = null != (o = n.item || (null != t ? t.item : t)) ? o : n.helperMissing, l = { name: "item", hash: {}, fn: e.program(2, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(null != t ? t : {}, l) : o, n.item || (r = n.blockHelperMissing.call(t, r, l)), null != r && (s += r), s + "\n\n" }, 2: function(e, t, n, i, a) {
  18. return "" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  19. var r;
  20. return '<script type="text/x-handlebars-template">\n\n <div>\n\n' + (null != (r = n.each.call(null != t ? t : {}, null != t ? t.items : t, { name: "each", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n </div>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-display"]["container-table-item"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  21. return "" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  22. var r;
  23. return '<script type="text/x-handlebars-template">\n\n <tr>\n ' + (null != (r = (n.itemField || t && t.itemField || n.helperMissing).call(null != t ? t : {}, "td", { name: "itemField", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n </tr>\n\n\n</script>\n" }, useData: !0 }), this.HandlebarsPrecompiled["web-display"]["container-table"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  24. return "" }, 3: function(e, t, n, i, a) {
  25. var r;
  26. return " <th>" + e.escapeExpression(e.lambda(null != (r = null != t ? t.value : t) ? r.title : r, t)) + "</th>\n" }, 5: function(e, t, n, i, a) {
  27. var r;
  28. return "\n " + (null != (r = (n.item || t && t.item || n.helperMissing).call(null != t ? t : {}, "tr", { name: "item", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n\n" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  29. var r, o, l, s = null != t ? t : {},
  30. u = n.helperMissing,
  31. c = '<script type="text/x-handlebars-template">\n\n <div>\n\n ';
  32. return o = null != (o = n.arrayToolbar || (null != t ? t.arrayToolbar : t)) ? o : u, l = { name: "arrayToolbar", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(s, l) : o, n.arrayToolbar || (r = n.blockHelperMissing.call(t, r, l)), null != r && (c += r), c + "\n\n <table>\n\n <!-- table headers -->\n <thead>\n <tr>\n" + (null != (r = (n.eachProperty || t && t.eachProperty || u).call(s, null != (r = null != (r = null != t ? t.schema : t) ? r.items : r) ? r.properties : r, { name: "eachProperty", hash: {}, fn: e.program(3, a, 0), inverse: e.noop, data: a })) ? r : "") + " </tr>\n </thead>\n\n <!-- table body -->\n <tbody>\n" + (null != (r = n.each.call(s, null != t ? t.items : t, { name: "each", hash: {}, fn: e.program(5, a, 0), inverse: e.noop, data: a })) ? r : "") + " </tbody>\n\n </table>\n\n </div>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-display"]["container-tablerow-item"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  33. return "" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  34. var r, o, l, s = '<script type="text/x-handlebars-template">\n\n <td>\n ';
  35. return o = null != (o = n.itemField || (null != t ? t.itemField : t)) ? o : n.helperMissing, l = { name: "itemField", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(null != t ? t : {}, l) : o, n.itemField || (r = n.blockHelperMissing.call(t, r, l)), null != r && (s += r), s + "\n </td>\n\n</script>\n" }, useData: !0 }), this.HandlebarsPrecompiled["web-display"]["container-tablerow"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  36. var r, o, l, s = " ";
  37. return o = null != (o = n.item || (null != t ? t.item : t)) ? o : n.helperMissing, l = { name: "item", hash: {}, fn: e.program(2, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(null != t ? t : {}, l) : o, n.item || (r = n.blockHelperMissing.call(t, r, l)), null != r && (s += r), s + "\n" }, 2: function(e, t, n, i, a) {
  38. return "" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  39. var r;
  40. return '<script type="text/x-handlebars-template">\n\n <div class="alpaca-merge-up">\n\n' + (null != (r = n.each.call(null != t ? t : {}, null != t ? t.items : t, { name: "each", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n </div>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-display"].container = Handlebars.template({ 1: function(e, t, n, i, a) {
  41. var r;
  42. return ' <legend class="' + (null != (r = n["if"].call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.labelClass : r, { name: "if", hash: {}, fn: e.program(2, a, 0), inverse: e.noop, data: a })) ? r : "") + ' alpaca-container-label">' + (null != (r = e.lambda(null != (r = null != t ? t.options : t) ? r.label : r, t)) ? r : "") + "</legend>\n" }, 2: function(e, t, n, i, a) {
  43. var r;
  44. return e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.labelClass : r, t)) }, 4: function(e, t, n, i, a) {
  45. var r;
  46. return null != (r = n.each.call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.helpers : r, { name: "each", hash: {}, fn: e.program(5, a, 0), inverse: e.noop, data: a })) ? r : "" }, 5: function(e, t, n, i, a) {
  47. var r;
  48. return ' <p class="alpaca-helper ' + (null != (r = n["if"].call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.helperClass : r, { name: "if", hash: {}, fn: e.program(6, a, 0), inverse: e.noop, data: a })) ? r : "") + '">\n <i class="alpaca-icon-helper"></i>\n ' + (null != (r = e.lambda(t, t)) ? r : "") + "\n </p>\n" }, 6: function(e, t, n, i, a) {
  49. var r;
  50. return e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.helperClass : r, t)) }, 8: function(e, t, n, i, a) {
  51. return "" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  52. var r, o, l, s = null != t ? t : {},
  53. u = '<script type="text/x-handlebars-template">\n\n <div>\n\n' + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.label : r, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n" + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.helpers : r, { name: "if", hash: {}, fn: e.program(4, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n ";
  54. return o = null != (o = n.container || (null != t ? t.container : t)) ? o : n.helperMissing, l = { name: "container", hash: {}, fn: e.program(8, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(s, l) : o, n.container || (r = n.blockHelperMissing.call(t, r, l)), null != r && (u += r), u + "\n\n </div>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-display"]["control-any"] = Handlebars.template({ compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  55. var r;
  56. return '<script type="text/x-handlebars-template">\n\n <div>' + (null != (r = (n.str || t && t.str || n.helperMissing).call(null != t ? t : {}, null != t ? t.data : t, { name: "str", hash: {}, data: a })) ? r : "") + "</div>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-display"]["control-checkbox"] = Handlebars.template({ compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  57. var r;
  58. return '<script type="text/x-handlebars-template">\n\n <div>' + (null != (r = (n.str || t && t.str || n.helperMissing).call(null != t ? t : {}, null != t ? t.data : t, { name: "str", hash: {}, data: a })) ? r : "") + "</div>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-display"]["control-hidden"] = Handlebars.template({ compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  59. return '<script type="text/x-handlebars-template">\n\n</script>' }, useData: !0 }), this.HandlebarsPrecompiled["web-display"]["control-image"] = Handlebars.template({ compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  60. var r, o = null != t ? t : {},
  61. l = n.helperMissing,
  62. s = "function",
  63. u = e.escapeExpression;
  64. return '<script type="text/x-handlebars-template">\n\n <div class="alpaca-image-display">\n <img id="' + u((r = null != (r = n.id || (null != t ? t.id : t)) ? r : l, typeof r === s ? r.call(o, { name: "id", hash: {}, data: a }) : r)) + '-image" src="' + u((r = null != (r = n.data || (null != t ? t.data : t)) ? r : l, typeof r === s ? r.call(o, { name: "data", hash: {}, data: a }) : r)) + '">\n </div>\n\n</script>' }, useData: !0 }), this.HandlebarsPrecompiled["web-display"]["control-password"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  65. return "" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  66. var r;
  67. return '<script type="text/x-handlebars-template">\n\n <div>' + (null != (r = (n.disguise || t && t.disguise || n.helperMissing).call(null != t ? t : {}, null != t ? t.data : t, "&bull;", { name: "disguise", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + "</div>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-display"]["control-radio"] = Handlebars.template({ 1: function(e, t, n, i, a, r, o) {
  68. var l;
  69. return null != (l = (n.compare || t && t.compare || n.helperMissing).call(null != t ? t : {}, null != t ? t.value : t, null != o[1] ? o[1].data : o[1], { name: "compare", hash: {}, fn: e.program(2, a, 0, r, o), inverse: e.noop, data: a })) ? l : "" }, 2: function(e, t, n, i, a) {
  70. var r, o;
  71. return " " + (null != (o = null != (o = n.text || (null != t ? t.text : t)) ? o : n.helperMissing, r = "function" == typeof o ? o.call(null != t ? t : {}, { name: "text", hash: {}, data: a }) : o) ? r : "") + "\n" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a, r, o) {
  72. var l;
  73. return '<script type="text/x-handlebars-template">\n\n <div>\n' + (null != (l = n.each.call(null != t ? t : {}, null != t ? t.selectOptions : t, { name: "each", hash: {}, fn: e.program(1, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + " </div>\n\n</script>\n" }, useData: !0, useDepths: !0 }), this.HandlebarsPrecompiled["web-display"]["control-select"] = Handlebars.template({ compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  74. var r;
  75. return '<script type="text/x-handlebars-template">\n\n <div>\n ' + e.escapeExpression((r = null != (r = n.displayableText || (null != t ? t.displayableText : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "displayableText", hash: {}, data: a }) : r)) + "\n </div>\n\n</script>\n" }, useData: !0 }), this.HandlebarsPrecompiled["web-display"]["control-text"] = Handlebars.template({ compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  76. var r, o;
  77. return '<script type="text/x-handlebars-template">\n\n <div>' + (null != (o = null != (o = n.data || (null != t ? t.data : t)) ? o : n.helperMissing, r = "function" == typeof o ? o.call(null != t ? t : {}, { name: "data", hash: {}, data: a }) : o) ? r : "") + "</div>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-display"]["control-textarea"] = Handlebars.template({ compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  78. var r, o;
  79. return '<script type="text/x-handlebars-template">\n\n <p>\n ' + (null != (o = null != (o = n.data || (null != t ? t.data : t)) ? o : n.helperMissing, r = "function" == typeof o ? o.call(null != t ? t : {}, { name: "data", hash: {}, data: a }) : o) ? r : "") + "\n </p>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-display"]["control-url"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  80. var r;
  81. return 'target="' + e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.anchorTarget : r, t)) + '"' }, 3: function(e, t, n, i, a) {
  82. var r;
  83. return e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.anchorTitle : r, t)) }, 5: function(e, t, n, i, a) {
  84. var r;
  85. return e.escapeExpression((r = null != (r = n.data || (null != t ? t.data : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "data", hash: {}, data: a }) : r)) }, 7: function(e, t, n, i, a) {
  86. var r;
  87. return " " + e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.anchorTitle : r, t)) + "\n" }, 9: function(e, t, n, i, a) {
  88. var r;
  89. return " " + e.escapeExpression((r = null != (r = n.data || (null != t ? t.data : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "data", hash: {}, data: a }) : r)) + "\n" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  90. var r, o, l = null != t ? t : {};
  91. return '<script type="text/x-handlebars-template">\n\n <div class="alpaca-control-url-anchor-wrapper">\n <a href="' + e.escapeExpression((o = null != (o = n.data || (null != t ? t.data : t)) ? o : n.helperMissing, "function" == typeof o ? o.call(l, { name: "data", hash: {}, data: a }) : o)) + '" ' + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.anchorTarget : r, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + ' title="' + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.anchorTitle : r, { name: "if", hash: {}, fn: e.program(3, a, 0), inverse: e.program(5, a, 0), data: a })) ? r : "") + '">\n' + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.anchorTitle : r, { name: "if", hash: {}, fn: e.program(7, a, 0), inverse: e.program(9, a, 0), data: a })) ? r : "") + " </a>\n </div>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-display"].control = Handlebars.template({ 1: function(e, t, n, i, a) {
  92. var r, o, l = null != t ? t : {};
  93. return ' <label class="' + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.labelClass : r, { name: "if", hash: {}, fn: e.program(2, a, 0), inverse: e.noop, data: a })) ? r : "") + ' alpaca-control-label" for="' + e.escapeExpression((o = null != (o = n.id || (null != t ? t.id : t)) ? o : n.helperMissing, "function" == typeof o ? o.call(l, { name: "id", hash: {}, data: a }) : o)) + '">' + (null != (r = e.lambda(null != (r = null != t ? t.options : t) ? r.label : r, t)) ? r : "") + "</label>\n" }, 2: function(e, t, n, i, a) {
  94. var r;
  95. return e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.labelClass : r, t)) }, 4: function(e, t, n, i, a) {
  96. return "" }, 6: function(e, t, n, i, a) {
  97. var r;
  98. return null != (r = n.each.call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.helpers : r, { name: "each", hash: {}, fn: e.program(7, a, 0), inverse: e.noop, data: a })) ? r : "" }, 7: function(e, t, n, i, a) {
  99. var r;
  100. return ' <p class="' + (null != (r = n["if"].call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.helperClass : r, { name: "if", hash: {}, fn: e.program(8, a, 0), inverse: e.noop, data: a })) ? r : "") + '">\n <i class="info-sign"></i>\n ' + (null != (r = e.lambda(t, t)) ? r : "") + "\n </p>\n" }, 8: function(e, t, n, i, a) {
  101. var r;
  102. return e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.helperClass : r, t)) }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  103. var r, o, l, s = null != t ? t : {},
  104. u = '<script type="text/x-handlebars-template">\n\n <div>\n\n' + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.label : r, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n ";
  105. return o = null != (o = n.control || (null != t ? t.control : t)) ? o : n.helperMissing, l = { name: "control", hash: {}, fn: e.program(4, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(s, l) : o, n.control || (r = n.blockHelperMissing.call(t, r, l)), null != r && (u += r), u + "\n\n" + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.helpers : r, { name: "if", hash: {}, fn: e.program(6, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n </div>\n\n</script>\n" }, useData: !0 }), this.HandlebarsPrecompiled["web-display"].form = Handlebars.template({ 1: function(e, t, n, i, a) {
  106. return "" }, 3: function(e, t, n, i, a) {
  107. var r;
  108. return null != (r = n.each.call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.buttons : r, { name: "each", hash: {}, fn: e.program(4, a, 0), inverse: e.noop, data: a })) ? r : "" }, 4: function(e, t, n, i, a) {
  109. var r, o, l = null != t ? t : {},
  110. s = n.helperMissing,
  111. u = "function",
  112. c = e.escapeExpression;
  113. return ' <button data-key="' + c((o = null != (o = n.key || a && a.key) ? o : s, typeof o === u ? o.call(l, { name: "key", hash: {}, data: a }) : o)) + '" ' + (null != (r = (n.compare || t && t.compare || s).call(l, null != t ? t.type : t, "submit", { name: "compare", hash: {}, fn: e.program(5, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = (n.compare || t && t.compare || s).call(l, null != t ? t.type : t, "reset", { name: "compare", hash: {}, fn: e.program(7, a, 0), inverse: e.noop, data: a })) ? r : "") + ' class="alpaca-form-button alpaca-form-button-' + c((o = null != (o = n.key || a && a.key) ? o : s, typeof o === u ? o.call(l, { name: "key", hash: {}, data: a }) : o)) + " " + c((o = null != (o = n.styles || (null != t ? t.styles : t)) ? o : s, typeof o === u ? o.call(l, { name: "styles", hash: {}, data: a }) : o)) + '" ' + (null != (r = n.each.call(l, null != t ? t.value : t, { name: "each", hash: {}, fn: e.program(9, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n.each.call(l, null != t ? t.attributes : t, { name: "each", hash: {}, fn: e.program(11, a, 0), inverse: e.noop, data: a })) ? r : "") + ">" + (null != (o = null != (o = n.value || (null != t ? t.value : t)) ? o : s, r = typeof o === u ? o.call(l, { name: "value", hash: {}, data: a }) : o) ? r : "") + "</button>\n" }, 5: function(e, t, n, i, a) {
  114. return 'type="submit"' }, 7: function(e, t, n, i, a) {
  115. return 'type="reset"' }, 9: function(e, t, n, i, a) {
  116. var r, o = e.escapeExpression;
  117. return o((r = null != (r = n.key || a && a.key) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "key", hash: {}, data: a }) : r)) + '="' + o(e.lambda(t, t)) + '"' }, 11: function(e, t, n, i, a) {
  118. var r, o = e.escapeExpression;
  119. return " " + o((r = null != (r = n.key || a && a.key) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "key", hash: {}, data: a }) : r)) + '="' + o(e.lambda(t, t)) + '"' }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  120. var r, o, l, s = null != t ? t : {},
  121. u = '<script type="text/x-handlebars-template">\n\n <form role="form">\n\n ';
  122. return o = null != (o = n.formItems || (null != t ? t.formItems : t)) ? o : n.helperMissing, l = { name: "formItems", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(s, l) : o, n.formItems || (r = n.blockHelperMissing.call(t, r, l)), null != r && (u += r), u + '\n\n <div class="alpaca-form-buttons-container">\n' + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.buttons : r, { name: "if", hash: {}, fn: e.program(3, a, 0), inverse: e.noop, data: a })) ? r : "") + " </div>\n\n </form>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"] = this.HandlebarsPrecompiled["web-edit"] || {}, this.HandlebarsPrecompiled["web-edit"]["container-array-actionbar"] = Handlebars.template({ 1: function(e, t, n, i, a, r, o) {
  123. var l, s, u = e.escapeExpression,
  124. c = null != t ? t : {};
  125. return ' <button class="alpaca-array-actionbar-action ' + u(e.lambda(null != (l = null != (l = null != o[1] ? o[1].view : o[1]) ? l.styles : l) ? l.smallButton : l, t)) + '" data-alpaca-array-actionbar-action="' + u((s = null != (s = n.action || (null != t ? t.action : t)) ? s : n.helperMissing, "function" == typeof s ? s.call(c, { name: "action", hash: {}, data: a }) : s)) + '">\n' + (null != (l = n["if"].call(c, null != t ? t.iconClass : t, { name: "if", hash: {}, fn: e.program(2, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + " " + (null != (l = n["if"].call(c, null != t ? t.label : t, { name: "if", hash: {}, fn: e.program(4, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + "\n </button>\n" }, 2: function(e, t, n, i, a) {
  126. return ' <i class="' + e.escapeExpression(e.lambda(null != t ? t.iconClass : t, t)) + '"></i>\n' }, 4: function(e, t, n, i, a) {
  127. var r, o;
  128. return null != (o = null != (o = n.label || (null != t ? t.label : t)) ? o : n.helperMissing, r = "function" == typeof o ? o.call(null != t ? t : {}, { name: "label", hash: {}, data: a }) : o) ? r : "" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a, r, o) {
  129. var l, s, u = null != t ? t : {},
  130. c = n.helperMissing,
  131. d = "function",
  132. p = e.escapeExpression;
  133. return '<script type="text/x-handlebars-template">\n\n <div class="alpaca-array-actionbar alpaca-array-actionbar-' + p((s = null != (s = n.actionbarStyle || (null != t ? t.actionbarStyle : t)) ? s : c, typeof s === d ? s.call(u, { name: "actionbarStyle", hash: {}, data: a }) : s)) + ' btn-group" data-alpaca-array-actionbar-parent-field-id="' + p((s = null != (s = n.parentFieldId || (null != t ? t.parentFieldId : t)) ? s : c, typeof s === d ? s.call(u, { name: "parentFieldId", hash: {}, data: a }) : s)) + '" data-alpaca-array-actionbar-field-id="' + p((s = null != (s = n.fieldId || (null != t ? t.fieldId : t)) ? s : c, typeof s === d ? s.call(u, { name: "fieldId", hash: {}, data: a }) : s)) + '" data-alpaca-array-actionbar-item-index="' + p((s = null != (s = n.itemIndex || (null != t ? t.itemIndex : t)) ? s : c, typeof s === d ? s.call(u, { name: "itemIndex", hash: {}, data: a }) : s)) + '">\n' + (null != (l = n.each.call(u, null != t ? t.actions : t, { name: "each", hash: {}, fn: e.program(1, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + " </div>\n\n</script>" }, useData: !0, useDepths: !0 }), this.HandlebarsPrecompiled["web-edit"]["container-array-item"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  134. var r, o, l, s = null != t ? t : {},
  135. u = n.helperMissing,
  136. c = "function",
  137. d = n.blockHelperMissing,
  138. p = ' <div class="pull-left">\n ';
  139. return o = null != (o = n.arrayActionbar || (null != t ? t.arrayActionbar : t)) ? o : u, l = { name: "arrayActionbar", hash: {}, fn: e.program(2, a, 0), inverse: e.noop, data: a }, r = typeof o === c ? o.call(s, l) : o, n.arrayActionbar || (r = d.call(t, r, l)), null != r && (p += r), p += '\n </div>\n <div class="pull-right">\n ', o = null != (o = n.itemField || (null != t ? t.itemField : t)) ? o : u, l = { name: "itemField", hash: {}, fn: e.program(2, a, 0), inverse: e.noop, data: a }, r = typeof o === c ? o.call(s, l) : o, n.itemField || (r = d.call(t, r, l)), null != r && (p += r), p + '\n </div>\n <div class="clear"></div>\n' }, 2: function(e, t, n, i, a) {
  140. return "" }, 4: function(e, t, n, i, a) {
  141. var r;
  142. return null != (r = (n.compare || t && t.compare || n.helperMissing).call(null != t ? t : {}, null != t ? t.actionbarStyle : t, "right", { name: "compare", hash: {}, fn: e.program(5, a, 0), inverse: e.program(7, a, 0), data: a })) ? r : "" }, 5: function(e, t, n, i, a) {
  143. var r, o, l, s = null != t ? t : {},
  144. u = n.helperMissing,
  145. c = "function",
  146. d = n.blockHelperMissing,
  147. p = ' <div class="pull-left">\n ';
  148. return o = null != (o = n.itemField || (null != t ? t.itemField : t)) ? o : u, l = { name: "itemField", hash: {}, fn: e.program(2, a, 0), inverse: e.noop, data: a }, r = typeof o === c ? o.call(s, l) : o, n.itemField || (r = d.call(t, r, l)), null != r && (p += r), p += '\n </div>\n <div class="pull-right">\n ', o = null != (o = n.arrayActionbar || (null != t ? t.arrayActionbar : t)) ? o : u, l = { name: "arrayActionbar", hash: {}, fn: e.program(2, a, 0), inverse: e.noop, data: a }, r = typeof o === c ? o.call(s, l) : o, n.arrayActionbar || (r = d.call(t, r, l)), null != r && (p += r), p + '\n </div>\n <div class="alpaca-clear"></div>\n' }, 7: function(e, t, n, i, a) {
  149. var r, o, l, s = null != t ? t : {},
  150. u = n.helperMissing,
  151. c = " <div>\n\n" + (null != (r = (n.compare || t && t.compare || u).call(s, null != t ? t.actionbarStyle : t, "top", { name: "compare", hash: {}, fn: e.program(8, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n ";
  152. return o = null != (o = n.itemField || (null != t ? t.itemField : t)) ? o : u, l = { name: "itemField", hash: {}, fn: e.program(2, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(s, l) : o, n.itemField || (r = n.blockHelperMissing.call(t, r, l)), null != r && (c += r), c + "\n\n" + (null != (r = (n.compare || t && t.compare || u).call(s, null != t ? t.actionbarStyle : t, "bottom", { name: "compare", hash: {}, fn: e.program(8, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n </div>\n" }, 8: function(e, t, n, i, a) {
  153. var r, o, l, s = " ";
  154. return o = null != (o = n.arrayActionbar || (null != t ? t.arrayActionbar : t)) ? o : n.helperMissing, l = { name: "arrayActionbar", hash: {}, fn: e.program(2, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(null != t ? t : {}, l) : o, n.arrayActionbar || (r = n.blockHelperMissing.call(t, r, l)), null != r && (s += r), s + "\n" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  155. var r;
  156. return '<script type="text/x-handlebars-template">\n\n <div>\n' + (null != (r = (n.compare || t && t.compare || n.helperMissing).call(null != t ? t : {}, null != t ? t.actionbarStyle : t, "left", { name: "compare", hash: {}, fn: e.program(1, a, 0), inverse: e.program(4, a, 0), data: a })) ? r : "") + " </div>\n\n</script>\n" }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"]["container-array-toolbar"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  157. return " btn-group" }, 3: function(e, t, n, i, a, r, o) {
  158. var l, s = null != t ? t : {},
  159. u = n.helperMissing;
  160. return "\n" + (null != (l = (n.compare || t && t.compare || u).call(s, null != o[1] ? o[1].toolbarStyle : o[1], "link", { name: "compare", hash: {}, fn: e.program(4, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + "\n" + (null != (l = (n.compare || t && t.compare || u).call(s, null != o[1] ? o[1].toolbarStyle : o[1], "button", { name: "compare", hash: {}, fn: e.program(6, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + "\n" }, 4: function(e, t, n, i, a) {
  161. var r, o, l = null != t ? t : {},
  162. s = n.helperMissing,
  163. u = "function";
  164. return ' <a href="#" class="alpaca-array-toolbar-action" data-alpaca-array-toolbar-action="' + e.escapeExpression((o = null != (o = n.action || (null != t ? t.action : t)) ? o : s, typeof o === u ? o.call(l, { name: "action", hash: {}, data: a }) : o)) + '">' + (null != (o = null != (o = n.label || (null != t ? t.label : t)) ? o : s, r = typeof o === u ? o.call(l, { name: "label", hash: {}, data: a }) : o) ? r : "") + "</a>\n" }, 6: function(e, t, n, i, a, r, o) {
  165. var l, s, u = e.escapeExpression,
  166. c = null != t ? t : {};
  167. return ' <button class="alpaca-array-toolbar-action ' + u(e.lambda(null != (l = null != (l = null != o[1] ? o[1].view : o[1]) ? l.styles : l) ? l.smallButton : l, t)) + '" data-alpaca-array-toolbar-action="' + u((s = null != (s = n.action || (null != t ? t.action : t)) ? s : n.helperMissing, "function" == typeof s ? s.call(c, { name: "action", hash: {}, data: a }) : s)) + '">\n' + (null != (l = n["if"].call(c, null != t ? t.iconClass : t, { name: "if", hash: {}, fn: e.program(7, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + " " + (null != (l = n["if"].call(c, null != t ? t.label : t, { name: "if", hash: {}, fn: e.program(9, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + "\n </button>\n" }, 7: function(e, t, n, i, a) {
  168. var r;
  169. return ' <i class="' + e.escapeExpression((r = null != (r = n.iconClass || (null != t ? t.iconClass : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "iconClass", hash: {}, data: a }) : r)) + '"></i>\n' }, 9: function(e, t, n, i, a) {
  170. var r, o;
  171. return null != (o = null != (o = n.label || (null != t ? t.label : t)) ? o : n.helperMissing, r = "function" == typeof o ? o.call(null != t ? t : {}, { name: "label", hash: {}, data: a }) : o) ? r : "" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a, r, o) {
  172. var l, s, u = null != t ? t : {},
  173. c = n.helperMissing;
  174. return '<script type="text/x-handlebars-template">\n\n <div class="alpaca-array-toolbar" data-alpaca-array-toolbar-field-id="' + e.escapeExpression((s = null != (s = n.id || (null != t ? t.id : t)) ? s : c, "function" == typeof s ? s.call(u, { name: "id", hash: {}, data: a }) : s)) + '" ' + (null != (l = (n.compare || t && t.compare || c).call(u, null != t ? t.toolbarStyle : t, "button", { name: "compare", hash: {}, fn: e.program(1, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + ">\n\n" + (null != (l = n.each.call(u, null != t ? t.actions : t, { name: "each", hash: {}, fn: e.program(3, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + "\n </div>\n\n</script>" }, useData: !0, useDepths: !0 }), this.HandlebarsPrecompiled["web-edit"]["container-array"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  175. return "" }, 3: function(e, t, n, i, a) {
  176. var r, o, l, s = "\n ";
  177. return o = null != (o = n.item || (null != t ? t.item : t)) ? o : n.helperMissing, l = { name: "item", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(null != t ? t : {}, l) : o, n.item || (r = n.blockHelperMissing.call(t, r, l)), null != r && (s += r), s + "\n\n" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  178. var r, o, l, s = null != t ? t : {},
  179. u = '<script type="text/x-handlebars-template">\n\n <div>\n\n ';
  180. return o = null != (o = n.arrayToolbar || (null != t ? t.arrayToolbar : t)) ? o : n.helperMissing, l = { name: "arrayToolbar", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(s, l) : o, n.arrayToolbar || (r = n.blockHelperMissing.call(t, r, l)), null != r && (u += r), u + "\n\n" + (null != (r = n.each.call(s, null != t ? t.items : t, { name: "each", hash: {}, fn: e.program(3, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n </div>\n\n</script>\n" }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"]["container-object-item"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  181. return "" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  182. var r, o, l, s = '<script type="text/x-handlebars-template">\n\n <div>\n\n ';
  183. return o = null != (o = n.itemField || (null != t ? t.itemField : t)) ? o : n.helperMissing, l = { name: "itemField", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(null != t ? t : {}, l) : o, n.itemField || (r = n.blockHelperMissing.call(t, r, l)), null != r && (s += r), s + "\n\n </div>\n\n</script>\n" }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"]["container-object"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  184. var r, o, l, s = "\n ";
  185. return o = null != (o = n.item || (null != t ? t.item : t)) ? o : n.helperMissing, l = { name: "item", hash: {}, fn: e.program(2, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(null != t ? t : {}, l) : o, n.item || (r = n.blockHelperMissing.call(t, r, l)), null != r && (s += r), s + "\n\n" }, 2: function(e, t, n, i, a) {
  186. return "" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  187. var r;
  188. return '<script type="text/x-handlebars-template">\n\n <div>\n\n' + (null != (r = n.each.call(null != t ? t : {}, null != t ? t.items : t, { name: "each", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n </div>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"]["container-table-item"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  189. return "" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  190. var r;
  191. return '<script type="text/x-handlebars-template">\n\n <tr>\n ' + (null != (r = (n.itemField || t && t.itemField || n.helperMissing).call(null != t ? t : {}, "td", { name: "itemField", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n </tr>\n\n</script>\n" }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"]["container-table"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  192. return "" }, 3: function(e, t, n, i, a) {
  193. return ' <!-- hidden column storing sort order -->\n <th class="alpaca-table-reorder-index-header"></th>\n <!-- draggable -->\n <th class="alpaca-table-reorder-draggable-header"></th>\n' }, 5: function(e, t, n, i, a) {
  194. var r, o, l = null != t ? t : {},
  195. s = n.helperMissing,
  196. u = "function";
  197. return ' <th data-header-id="' + e.escapeExpression((o = null != (o = n.id || (null != t ? t.id : t)) ? o : s, typeof o === u ? o.call(l, { name: "id", hash: {}, data: a }) : o)) + '" ' + (null != (r = n["if"].call(l, null != t ? t.hidden : t, { name: "if", hash: {}, fn: e.program(6, a, 0), inverse: e.noop, data: a })) ? r : "") + ">" + (null != (o = null != (o = n.title || (null != t ? t.title : t)) ? o : s, r = typeof o === u ? o.call(l, { name: "title", hash: {}, data: a }) : o) ? r : "") + "</th>\n" }, 6: function(e, t, n, i, a) {
  198. return 'class="alpaca-table-column-hidden"' }, 8: function(e, t, n, i, a) {
  199. return " <th>Actions</th>\n" }, 10: function(e, t, n, i, a) {
  200. var r;
  201. return "\n " + (null != (r = (n.item || t && t.item || n.helperMissing).call(null != t ? t : {}, "tr", { name: "item", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n\n" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  202. var r, o, l, s = null != t ? t : {},
  203. u = '<script type="text/x-handlebars-template">\n\n <div>\n\n ';
  204. return o = null != (o = n.arrayToolbar || (null != t ? t.arrayToolbar : t)) ? o : n.helperMissing, l = { name: "arrayToolbar", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(s, l) : o, n.arrayToolbar || (r = n.blockHelperMissing.call(t, r, l)), null != r && (u += r), u + "\n\n <table>\n\n <!-- table headers -->\n <thead>\n <tr>\n\n" + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.dragRows : r, { name: "if", hash: {}, fn: e.program(3, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n" + (null != (r = n.each.call(s, null != t ? t.headers : t, { name: "each", hash: {}, fn: e.program(5, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n" + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.showActionsColumn : r, { name: "if", hash: {}, fn: e.program(8, a, 0), inverse: e.noop, data: a })) ? r : "") + " </tr>\n </thead>\n\n <!-- table body -->\n <tbody>\n" + (null != (r = n.each.call(s, null != t ? t.items : t, { name: "each", hash: {}, fn: e.program(10, a, 0), inverse: e.noop, data: a })) ? r : "") + " </tbody>\n\n </table>\n\n </div>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"]["container-tablerow-item"] = Handlebars.template({
  205. 1: function(e, t, n, i, a) {
  206. return "" },
  207. compiler: [7, ">= 4.0.0"],
  208. main: function(e, t, n, i, a) {
  209. var r, o, l, s = '<script type="text/x-handlebars-template">\n\n <td>\n ';
  210. return o = null != (o = n.itemField || (null != t ? t.itemField : t)) ? o : n.helperMissing, l = { name: "itemField", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(null != t ? t : {}, l) : o, n.itemField || (r = n.blockHelperMissing.call(t, r, l)), null != r && (s += r), s + "\n </td>\n\n</script>\n"
  211. },
  212. useData: !0
  213. }), this.HandlebarsPrecompiled["web-edit"]["container-tablerow"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  214. return '\n <!-- hidden sort order column -->\n <div class="alpaca-table-reorder-index-cell"></div>\n\n <!-- reorder draggable -->\n <div class="alpaca-table-reorder-draggable-cell">\n <i class="glyphicon glyphicon-menu-hamburger"></i>\n </div>\n' }, 3: function(e, t, n, i, a) {
  215. var r;
  216. return null != (r = n["if"].call(null != t ? t : {}, null != t ? t.hidden : t, { name: "if", hash: {}, fn: e.program(4, a, 0), inverse: e.program(6, a, 0), data: a })) ? r : "" }, 4: function(e, t, n, i, a) {
  217. return "" }, 6: function(e, t, n, i, a) {
  218. var r, o, l, s = " ";
  219. return o = null != (o = n.item || (null != t ? t.item : t)) ? o : n.helperMissing, l = { name: "item", hash: {}, fn: e.program(4, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(null != t ? t : {}, l) : o, n.item || (r = n.blockHelperMissing.call(t, r, l)), null != r && (s += r), s + "\n" }, 8: function(e, t, n, i, a) {
  220. var r, o, l, s = ' <div class="alpaca-merge-up">\n ';
  221. return o = null != (o = n.arrayActionbar || (null != t ? t.arrayActionbar : t)) ? o : n.helperMissing, l = { name: "arrayActionbar", hash: {}, fn: e.program(4, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(null != t ? t : {}, l) : o, n.arrayActionbar || (r = n.blockHelperMissing.call(t, r, l)), null != r && (s += r), s + "\n </div>\n" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  222. var r, o = null != t ? t : {};
  223. return '<script type="text/x-handlebars-template">\n\n <div class="alpaca-merge-up">\n\n <!-- drag cell -->\n' + (null != (r = n["if"].call(o, null != (r = null != t ? t.options : t) ? r.dragRows : r, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n" + (null != (r = n.each.call(o, null != t ? t.items : t, { name: "each", hash: {}, fn: e.program(3, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n <!-- actions cell -->\n" + (null != (r = n["if"].call(o, null != (r = null != t ? t.options : t) ? r.showActionsColumn : r, { name: "if", hash: {}, fn: e.program(8, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n </div>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"].container = Handlebars.template({ 1: function(e, t, n, i, a) {
  224. var r;
  225. return ' <legend class="' + (null != (r = n["if"].call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.labelClass : r, { name: "if", hash: {}, fn: e.program(2, a, 0), inverse: e.noop, data: a })) ? r : "") + ' alpaca-container-label">' + (null != (r = e.lambda(null != (r = null != t ? t.options : t) ? r.label : r, t)) ? r : "") + "</legend>\n" }, 2: function(e, t, n, i, a) {
  226. var r;
  227. return e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.labelClass : r, t)) }, 4: function(e, t, n, i, a) {
  228. var r;
  229. return null != (r = n.each.call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.helpers : r, { name: "each", hash: {}, fn: e.program(5, a, 0), inverse: e.noop, data: a })) ? r : "" }, 5: function(e, t, n, i, a) {
  230. var r;
  231. return ' <p class="alpaca-helper ' + (null != (r = n["if"].call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.helperClass : r, { name: "if", hash: {}, fn: e.program(6, a, 0), inverse: e.noop, data: a })) ? r : "") + '">\n <i class="alpaca-icon-helper"></i>\n ' + (null != (r = e.lambda(t, t)) ? r : "") + "\n </p>\n" }, 6: function(e, t, n, i, a) {
  232. var r;
  233. return e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.helperClass : r, t)) }, 8: function(e, t, n, i, a) {
  234. return "" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  235. var r, o, l, s = null != t ? t : {},
  236. u = '<script type="text/x-handlebars-template">\n\n <div>\n\n' + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.label : r, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n" + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.helpers : r, { name: "if", hash: {}, fn: e.program(4, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n ";
  237. return o = null != (o = n.container || (null != t ? t.container : t)) ? o : n.helperMissing, l = { name: "container", hash: {}, fn: e.program(8, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(s, l) : o, n.container || (r = n.blockHelperMissing.call(t, r, l)), null != r && (u += r), u + "\n\n </div>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"]["control-any"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  238. return 'readonly="readonly"' }, 3: function(e, t, n, i, a) {
  239. var r;
  240. return 'name="' + e.escapeExpression((r = null != (r = n.name || (null != t ? t.name : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "name", hash: {}, data: a }) : r)) + '"' }, 5: function(e, t, n, i, a) {
  241. var r, o = e.escapeExpression;
  242. return "data-" + o((r = null != (r = n.key || a && a.key) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "key", hash: {}, data: a }) : r)) + '="' + o(e.lambda(t, t)) + '"' }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  243. var r, o, l = null != t ? t : {};
  244. return '<script type="text/x-handlebars-template">\n\n <input type="text" id="' + e.escapeExpression((o = null != (o = n.id || (null != t ? t.id : t)) ? o : n.helperMissing, "function" == typeof o ? o.call(l, { name: "id", hash: {}, data: a }) : o)) + '" size="40" ' + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.readonly : r, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != t ? t.name : t, { name: "if", hash: {}, fn: e.program(3, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n.each.call(l, null != (r = null != t ? t.options : t) ? r.data : r, { name: "each", hash: {}, fn: e.program(5, a, 0), inverse: e.noop, data: a })) ? r : "") + "/>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"]["control-checkbox"] = Handlebars.template({ 1: function(e, t, n, i, a, r, o) {
  245. var l;
  246. return "\n" + (null != (l = n.each.call(null != t ? t : {}, null != t ? t.checkboxOptions : t, { name: "each", hash: {}, fn: e.program(2, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + "\n" }, 2: function(e, t, n, i, a, r, o) {
  247. var l, s, u = null != t ? t : {},
  248. c = n.helperMissing,
  249. d = "function",
  250. p = e.escapeExpression;
  251. return '\n <div>\n\n <label>\n\n <input type="checkbox" data-checkbox-index="' + p((s = null != (s = n.index || a && a.index) ? s : c, typeof s === d ? s.call(u, { name: "index", hash: {}, data: a }) : s)) + '" data-checkbox-value="' + p((s = null != (s = n.value || (null != t ? t.value : t)) ? s : c, typeof s === d ? s.call(u, { name: "value", hash: {}, data: a }) : s)) + '" ' + (null != (l = n["if"].call(u, null != (l = null != o[1] ? o[1].options : o[1]) ? l.readonly : l, { name: "if", hash: {}, fn: e.program(3, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + " " + (null != (l = n["if"].call(u, null != t ? t.name : t, { name: "if", hash: {}, fn: e.program(5, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + " " + (null != (l = n.each.call(u, null != (l = null != o[1] ? o[1].options : o[1]) ? l.data : l, { name: "each", hash: {}, fn: e.program(7, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + "/>\n " + (null != (s = null != (s = n.text || (null != t ? t.text : t)) ? s : c, l = typeof s === d ? s.call(u, { name: "text", hash: {}, data: a }) : s) ? l : "") + "\n\n </label>\n </div>\n\n" }, 3: function(e, t, n, i, a) {
  252. return 'readonly="readonly"' }, 5: function(e, t, n, i, a) {
  253. var r;
  254. return 'name="' + e.escapeExpression((r = null != (r = n.name || (null != t ? t.name : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "name", hash: {}, data: a }) : r)) + '"' }, 7: function(e, t, n, i, a) {
  255. var r, o = null != t ? t : {},
  256. l = n.helperMissing,
  257. s = "function",
  258. u = e.escapeExpression;
  259. return "data-" + u((r = null != (r = n.key || a && a.key) ? r : l, typeof r === s ? r.call(o, { name: "key", hash: {}, data: a }) : r)) + '="' + u((r = null != (r = n.value || (null != t ? t.value : t)) ? r : l, typeof r === s ? r.call(o, { name: "value", hash: {}, data: a }) : r)) + '"' }, 9: function(e, t, n, i, a) {
  260. var r, o = null != t ? t : {};
  261. return '\n <div>\n\n <label>\n\n <input type="checkbox" ' + (null != (r = n["if"].call(o, null != (r = null != t ? t.options : t) ? r.readonly : r, { name: "if", hash: {}, fn: e.program(3, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(o, null != t ? t.name : t, { name: "if", hash: {}, fn: e.program(5, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n.each.call(o, null != (r = null != t ? t.options : t) ? r.data : r, { name: "each", hash: {}, fn: e.program(7, a, 0), inverse: e.noop, data: a })) ? r : "") + "/>\n\n " + (null != (r = e.lambda(null != (r = null != t ? t.options : t) ? r.rightLabel : r, t)) ? r : "") + "\n </label>\n\n </div>\n\n" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a, r, o) {
  262. var l;
  263. return '<script type="text/x-handlebars-template">\n\n' + (null != (l = n["if"].call(null != t ? t : {}, null != (l = null != t ? t.options : t) ? l.multiple : l, { name: "if", hash: {}, fn: e.program(1, a, 0, r, o), inverse: e.program(9, a, 0, r, o), data: a })) ? l : "") + "\n</script>\n" }, useData: !0, useDepths: !0 }), this.HandlebarsPrecompiled["web-edit"]["control-ckeditor"] = Handlebars.template({ compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  264. var r;
  265. return '<script type="text/x-handlebars-template">\n\n <textarea id="' + e.escapeExpression((r = null != (r = n.id || (null != t ? t.id : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "id", hash: {}, data: a }) : r)) + '" cols="80" rows="10">\n </textarea>\n\n</script>' }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"]["control-editor"] = Handlebars.template({ compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  266. var r;
  267. return '<script type="text/x-handlebars-template">\n\n <div id="' + e.escapeExpression((r = null != (r = n.id || (null != t ? t.id : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "id", hash: {}, data: a }) : r)) + '" class="control-field-editor-el"></div>\n\n</script>' }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"]["control-file"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  268. var r;
  269. return 'size="' + e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.size : r, t)) + '"' }, 3: function(e, t, n, i, a) {
  270. return 'readonly="readonly"' }, 5: function(e, t, n, i, a) {
  271. var r;
  272. return 'name="' + e.escapeExpression((r = null != (r = n.name || (null != t ? t.name : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "name", hash: {}, data: a }) : r)) + '"' }, 7: function(e, t, n, i, a) {
  273. var r, o = e.escapeExpression;
  274. return "data-" + o((r = null != (r = n.key || a && a.key) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "key", hash: {}, data: a }) : r)) + '="' + o(e.lambda(t, t)) + '"' }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  275. var r, o, l = null != t ? t : {};
  276. return '<script type="text/x-handlebars-template">\n\n <input type="file" id="' + e.escapeExpression((o = null != (o = n.id || (null != t ? t.id : t)) ? o : n.helperMissing, "function" == typeof o ? o.call(l, { name: "id", hash: {}, data: a }) : o)) + '" ' + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.size : r, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.readonly : r, { name: "if", hash: {}, fn: e.program(3, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != t ? t.name : t, { name: "if", hash: {}, fn: e.program(5, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n.each.call(l, null != (r = null != t ? t.options : t) ? r.data : r, { name: "each", hash: {}, fn: e.program(7, a, 0), inverse: e.noop, data: a })) ? r : "") + "/>\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"]["control-hidden"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  277. var r;
  278. return 'name="' + e.escapeExpression((r = null != (r = n.name || (null != t ? t.name : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "name", hash: {}, data: a }) : r)) + '"' }, 3: function(e, t, n, i, a) {
  279. var r, o = e.escapeExpression;
  280. return "data-" + o((r = null != (r = n.key || a && a.key) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "key", hash: {}, data: a }) : r)) + '="' + o(e.lambda(t, t)) + '"' }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  281. var r, o, l = null != t ? t : {};
  282. return '<script type="text/x-handlebars-template">\n\n <input type="hidden" id="' + e.escapeExpression((o = null != (o = n.id || (null != t ? t.id : t)) ? o : n.helperMissing, "function" == typeof o ? o.call(l, { name: "id", hash: {}, data: a }) : o)) + '" ' + (null != (r = n["if"].call(l, null != t ? t.name : t, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n.each.call(l, null != (r = null != t ? t.options : t) ? r.data : r, { name: "each", hash: {}, fn: e.program(3, a, 0), inverse: e.noop, data: a })) ? r : "") + "/>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"]["control-image"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  283. var r;
  284. return 'placeholder="' + e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.placeholder : r, t)) + '"' }, 3: function(e, t, n, i, a) {
  285. var r;
  286. return 'size="' + e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.size : r, t)) + '"' }, 5: function(e, t, n, i, a) {
  287. return 'readonly="readonly"' }, 7: function(e, t, n, i, a) {
  288. var r;
  289. return 'name="' + e.escapeExpression((r = null != (r = n.name || (null != t ? t.name : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "name", hash: {}, data: a }) : r)) + '"' }, 9: function(e, t, n, i, a) {
  290. var r, o = e.escapeExpression;
  291. return "data-" + o((r = null != (r = n.key || a && a.key) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "key", hash: {}, data: a }) : r)) + '="' + o(e.lambda(t, t)) + '"' }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  292. var r, o, l = null != t ? t : {},
  293. s = n.helperMissing,
  294. u = "function",
  295. c = e.escapeExpression;
  296. return '<script type="text/x-handlebars-template">\n\n <input type="text" id="' + c((o = null != (o = n.id || (null != t ? t.id : t)) ? o : s, typeof o === u ? o.call(l, { name: "id", hash: {}, data: a }) : o)) + '" ' + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.placeholder : r, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.size : r, { name: "if", hash: {}, fn: e.program(3, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.readonly : r, { name: "if", hash: {}, fn: e.program(5, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != t ? t.name : t, { name: "if", hash: {}, fn: e.program(7, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n.each.call(l, null != (r = null != t ? t.options : t) ? r.data : r, { name: "each", hash: {}, fn: e.program(9, a, 0), inverse: e.noop, data: a })) ? r : "") + '/>\n\n <div class="alpaca-image-display">\n <h5>Preview</h5>\n <img id="' + c((o = null != (o = n.id || (null != t ? t.id : t)) ? o : s, typeof o === u ? o.call(l, { name: "id", hash: {}, data: a }) : o)) + '-image" src="' + c((o = null != (o = n.data || (null != t ? t.data : t)) ? o : s, typeof o === u ? o.call(l, { name: "data", hash: {}, data: a }) : o)) + '">\n </div>\n\n</script>' }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"]["control-optiontree"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  297. var r;
  298. return 'placeholder="' + e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.placeholder : r, t)) + '"' }, 3: function(e, t, n, i, a) {
  299. var r;
  300. return 'size="' + e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.size : r, t)) + '"' }, 5: function(e, t, n, i, a) {
  301. return 'readonly="readonly"' }, 7: function(e, t, n, i, a) {
  302. var r;
  303. return 'name="' + e.escapeExpression((r = null != (r = n.name || (null != t ? t.name : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "name", hash: {}, data: a }) : r)) + '"' }, 9: function(e, t, n, i, a) {
  304. var r, o = e.escapeExpression;
  305. return "data-" + o((r = null != (r = n.key || a && a.key) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "key", hash: {}, data: a }) : r)) + '="' + o(e.lambda(t, t)) + '"' }, 11: function(e, t, n, i, a) {
  306. var r, o = e.escapeExpression;
  307. return o((r = null != (r = n.key || a && a.key) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "key", hash: {}, data: a }) : r)) + '="' + o(e.lambda(t, t)) + '"' }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  308. var r, o, l = null != t ? t : {},
  309. s = n.helperMissing,
  310. u = "function",
  311. c = e.escapeExpression;
  312. return '<script type="text/x-handlebars-template">\n\n <div class="optiontree"></div>\n\n <input type="' + c((o = null != (o = n.inputType || (null != t ? t.inputType : t)) ? o : s, typeof o === u ? o.call(l, { name: "inputType", hash: {}, data: a }) : o)) + '" id="' + c((o = null != (o = n.id || (null != t ? t.id : t)) ? o : s, typeof o === u ? o.call(l, { name: "id", hash: {}, data: a }) : o)) + '" ' + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.placeholder : r, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.size : r, { name: "if", hash: {}, fn: e.program(3, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.readonly : r, { name: "if", hash: {}, fn: e.program(5, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != t ? t.name : t, { name: "if", hash: {}, fn: e.program(7, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n.each.call(l, null != (r = null != t ? t.options : t) ? r.data : r, { name: "each", hash: {}, fn: e.program(9, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n.each.call(l, null != (r = null != t ? t.options : t) ? r.attributes : r, { name: "each", hash: {}, fn: e.program(11, a, 0), inverse: e.noop, data: a })) ? r : "") + "/>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"]["control-password"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  313. var r;
  314. return 'placeholder="' + e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.placeholder : r, t)) + '"' }, 3: function(e, t, n, i, a) {
  315. var r;
  316. return 'size="' + e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.size : r, t)) + '"' }, 5: function(e, t, n, i, a) {
  317. return 'readonly="readonly"' }, 7: function(e, t, n, i, a) {
  318. var r;
  319. return 'name="' + e.escapeExpression((r = null != (r = n.name || (null != t ? t.name : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "name", hash: {}, data: a }) : r)) + '"' }, 9: function(e, t, n, i, a) {
  320. var r, o = e.escapeExpression;
  321. return "data-" + o((r = null != (r = n.key || a && a.key) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "key", hash: {}, data: a }) : r)) + '="' + o(e.lambda(t, t)) + '"' }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  322. var r, o, l = null != t ? t : {};
  323. return '<script type="text/x-handlebars-template">\n\n <input type="password" id="' + e.escapeExpression((o = null != (o = n.id || (null != t ? t.id : t)) ? o : n.helperMissing, "function" == typeof o ? o.call(l, { name: "id", hash: {}, data: a }) : o)) + '" ' + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.placeholder : r, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.size : r, { name: "if", hash: {}, fn: e.program(3, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.readonly : r, { name: "if", hash: {}, fn: e.program(5, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != t ? t.name : t, { name: "if", hash: {}, fn: e.program(7, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n.each.call(l, null != (r = null != t ? t.options : t) ? r.data : r, { name: "each", hash: {}, fn: e.program(9, a, 0), inverse: e.noop, data: a })) ? r : "") + "/>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"]["control-radio"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  324. return "" }, 3: function(e, t, n, i, a) {
  325. var r, o, l = null != t ? t : {};
  326. return ' <div class="radio">\n <label>\n <input type="radio" ' + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.readonly : r, { name: "if", hash: {}, fn: e.program(4, a, 0), inverse: e.noop, data: a })) ? r : "") + ' name="' + e.escapeExpression((o = null != (o = n.name || (null != t ? t.name : t)) ? o : n.helperMissing, "function" == typeof o ? o.call(l, { name: "name", hash: {}, data: a }) : o)) + '" value=""/>' + (null != (r = e.lambda(null != (r = null != t ? t.options : t) ? r.noneLabel : r, t)) ? r : "") + "\n </label>\n </div>\n" }, 4: function(e, t, n, i, a) {
  327. return 'readonly="readonly"' }, 6: function(e, t, n, i, a, r, o) {
  328. var l, s, u = null != t ? t : {},
  329. c = e.escapeExpression,
  330. d = n.helperMissing,
  331. p = "function";
  332. return ' <div class="radio">\n <label>\n <input type="radio" ' + (null != (l = n["if"].call(u, null != (l = null != o[1] ? o[1].options : o[1]) ? l.readonly : l, { name: "if", hash: {}, fn: e.program(4, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + ' name="' + c(e.lambda(null != o[1] ? o[1].name : o[1], t)) + '" value="' + c((s = null != (s = n.value || (null != t ? t.value : t)) ? s : d, typeof s === p ? s.call(u, { name: "value", hash: {}, data: a }) : s)) + '" ' + (null != (l = n["if"].call(u, null != t ? t.selected : t, { name: "if", hash: {}, fn: e.program(7, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + "/>" + (null != (s = null != (s = n.text || (null != t ? t.text : t)) ? s : d, l = typeof s === p ? s.call(u, { name: "text", hash: {}, data: a }) : s) ? l : "") + "\n </label>\n </div>\n" }, 7: function(e, t, n, i, a) {
  333. return 'checked="checked"' }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a, r, o) {
  334. var l, s = null != t ? t : {};
  335. return '<script type="text/x-handlebars-template">\n\n' + (null != (l = n["if"].call(s, null != (l = null != t ? t.options : t) ? l.hideNone : l, { name: "if", hash: {}, fn: e.program(1, a, 0, r, o), inverse: e.program(3, a, 0, r, o), data: a })) ? l : "") + "\n" + (null != (l = n.each.call(s, null != t ? t.selectOptions : t, { name: "each", hash: {}, fn: e.program(6, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + "\n</script>" }, useData: !0, useDepths: !0 }), this.HandlebarsPrecompiled["web-edit"]["control-select"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  336. return 'readonly="readonly"' }, 3: function(e, t, n, i, a) {
  337. return 'multiple="multiple"' }, 5: function(e, t, n, i, a) {
  338. var r;
  339. return 'size="' + e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.size : r, t)) + '"' }, 7: function(e, t, n, i, a) {
  340. var r;
  341. return 'name="' + e.escapeExpression((r = null != (r = n.name || (null != t ? t.name : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "name", hash: {}, data: a }) : r)) + '"' }, 9: function(e, t, n, i, a) {
  342. var r, o = null != t ? t : {};
  343. return "\n" + (null != (r = n["if"].call(o, null != (r = null != t ? t.options : t) ? r.hideNone : r, { name: "if", hash: {}, fn: e.program(10, a, 0), inverse: e.program(12, a, 0), data: a })) ? r : "") + "\n" + (null != (r = n.each.call(o, null != t ? t.selectOptions : t, { name: "each", hash: {}, fn: e.program(14, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n" }, 10: function(e, t, n, i, a) {
  344. return "" }, 12: function(e, t, n, i, a) {
  345. var r;
  346. return ' <option value="">' + (null != (r = e.lambda(null != (r = null != t ? t.options : t) ? r.noneLabel : r, t)) ? r : "") + "</option>\n" }, 14: function(e, t, n, i, a) {
  347. var r, o, l = null != t ? t : {},
  348. s = n.helperMissing,
  349. u = "function";
  350. return ' <option value="' + (null != (o = null != (o = n.value || (null != t ? t.value : t)) ? o : s, r = typeof o === u ? o.call(l, { name: "value", hash: {}, data: a }) : o) ? r : "") + '" ' + (null != (r = n["if"].call(l, null != t ? t.selected : t, { name: "if", hash: {}, fn: e.program(15, a, 0), inverse: e.noop, data: a })) ? r : "") + ">" + e.escapeExpression((o = null != (o = n.text || (null != t ? t.text : t)) ? o : s, typeof o === u ? o.call(l, { name: "text", hash: {}, data: a }) : o)) + "</option>\n" }, 15: function(e, t, n, i, a) {
  351. return 'selected="selected"' }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  352. var r, o, l = null != t ? t : {};
  353. return '<script type="text/x-handlebars-template">\n\n <select id="' + e.escapeExpression((o = null != (o = n.id || (null != t ? t.id : t)) ? o : n.helperMissing, "function" == typeof o ? o.call(l, { name: "id", hash: {}, data: a }) : o)) + '" ' + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.readonly : r, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.multiple : r, { name: "if", hash: {}, fn: e.program(3, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.size : r, { name: "if", hash: {}, fn: e.program(5, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != t ? t.name : t, { name: "if", hash: {}, fn: e.program(7, a, 0), inverse: e.noop, data: a })) ? r : "") + ">\n\n" + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.multiple : r, { name: "if", hash: {}, fn: e.program(9, a, 0), inverse: e.program(9, a, 0), data: a })) ? r : "") + "\n </select>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"]["control-text"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  354. var r;
  355. return 'placeholder="' + e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.placeholder : r, t)) + '"' }, 3: function(e, t, n, i, a) {
  356. var r;
  357. return 'size="' + e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.size : r, t)) + '"' }, 5: function(e, t, n, i, a) {
  358. return 'readonly="readonly"' }, 7: function(e, t, n, i, a) {
  359. var r;
  360. return 'name="' + e.escapeExpression((r = null != (r = n.name || (null != t ? t.name : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "name", hash: {}, data: a }) : r)) + '"' }, 9: function(e, t, n, i, a) {
  361. var r, o = e.escapeExpression;
  362. return "data-" + o((r = null != (r = n.key || a && a.key) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "key", hash: {}, data: a }) : r)) + '="' + o(e.lambda(t, t)) + '"' }, 11: function(e, t, n, i, a) {
  363. var r, o = e.escapeExpression;
  364. return o((r = null != (r = n.key || a && a.key) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "key", hash: {}, data: a }) : r)) + '="' + o(e.lambda(t, t)) + '"' }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  365. var r, o, l = null != t ? t : {},
  366. s = n.helperMissing,
  367. u = "function",
  368. c = e.escapeExpression;
  369. return '<script type="text/x-handlebars-template">\n\n <input type="' + c((o = null != (o = n.inputType || (null != t ? t.inputType : t)) ? o : s, typeof o === u ? o.call(l, { name: "inputType", hash: {}, data: a }) : o)) + '" id="' + c((o = null != (o = n.id || (null != t ? t.id : t)) ? o : s, typeof o === u ? o.call(l, { name: "id", hash: {}, data: a }) : o)) + '" ' + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.placeholder : r, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.size : r, { name: "if", hash: {}, fn: e.program(3, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.readonly : r, { name: "if", hash: {}, fn: e.program(5, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != t ? t.name : t, { name: "if", hash: {}, fn: e.program(7, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n.each.call(l, null != (r = null != t ? t.options : t) ? r.data : r, { name: "each", hash: {}, fn: e.program(9, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n.each.call(l, null != (r = null != t ? t.options : t) ? r.attributes : r, { name: "each", hash: {}, fn: e.program(11, a, 0), inverse: e.noop, data: a })) ? r : "") + "/>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"]["control-textarea"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  370. var r;
  371. return 'placeholder="' + e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.placeholder : r, t)) + '"' }, 3: function(e, t, n, i, a) {
  372. var r;
  373. return 'rows="' + e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.rows : r, t)) + '"' }, 5: function(e, t, n, i, a) {
  374. var r;
  375. return 'cols="' + e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.cols : r, t)) + '"' }, 7: function(e, t, n, i, a) {
  376. return 'readonly="readonly"' }, 9: function(e, t, n, i, a) {
  377. var r;
  378. return 'name="' + e.escapeExpression((r = null != (r = n.name || (null != t ? t.name : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "name", hash: {}, data: a }) : r)) + '"' }, 11: function(e, t, n, i, a) {
  379. var r, o, l = null != t ? t : {},
  380. s = n.helperMissing,
  381. u = "function";
  382. return "data-" + e.escapeExpression((o = null != (o = n.fieldId || (null != t ? t.fieldId : t)) ? o : s, typeof o === u ? o.call(l, { name: "fieldId", hash: {}, data: a }) : o)) + '="' + (null != (o = null != (o = n.value || (null != t ? t.value : t)) ? o : s, r = typeof o === u ? o.call(l, { name: "value", hash: {}, data: a }) : o) ? r : "") + '"' }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  383. var r, o, l = null != t ? t : {};
  384. return '<script type="text/x-handlebars-template">\n\n <textarea id="' + e.escapeExpression((o = null != (o = n.id || (null != t ? t.id : t)) ? o : n.helperMissing, "function" == typeof o ? o.call(l, { name: "id", hash: {}, data: a }) : o)) + '" ' + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.placeholder : r, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.rows : r, { name: "if", hash: {}, fn: e.program(3, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.cols : r, { name: "if", hash: {}, fn: e.program(5, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.readonly : r, { name: "if", hash: {}, fn: e.program(7, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != t ? t.name : t, { name: "if", hash: {}, fn: e.program(9, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n.each.call(l, null != (r = null != t ? t.options : t) ? r.data : r, { name: "each", hash: {}, fn: e.program(11, a, 0), inverse: e.noop, data: a })) ? r : "") + "/>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"]["control-url"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  385. var r;
  386. return 'placeholder="' + e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.placeholder : r, t)) + '"' }, 3: function(e, t, n, i, a) {
  387. var r;
  388. return 'size="' + e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.size : r, t)) + '"' }, 5: function(e, t, n, i, a) {
  389. return 'readonly="readonly"' }, 7: function(e, t, n, i, a) {
  390. var r;
  391. return 'name="' + e.escapeExpression((r = null != (r = n.name || (null != t ? t.name : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "name", hash: {}, data: a }) : r)) + '"' }, 9: function(e, t, n, i, a) {
  392. var r, o = e.escapeExpression;
  393. return "data-" + o((r = null != (r = n.key || a && a.key) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "key", hash: {}, data: a }) : r)) + '="' + o(e.lambda(t, t)) + '"' }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  394. var r, o, l = null != t ? t : {};
  395. return '<script type="text/x-handlebars-template">\n\n <input type="text" id="' + e.escapeExpression((o = null != (o = n.id || (null != t ? t.id : t)) ? o : n.helperMissing, "function" == typeof o ? o.call(l, { name: "id", hash: {}, data: a }) : o)) + '" ' + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.placeholder : r, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.size : r, { name: "if", hash: {}, fn: e.program(3, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.readonly : r, { name: "if", hash: {}, fn: e.program(5, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != t ? t.name : t, { name: "if", hash: {}, fn: e.program(7, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n.each.call(l, null != (r = null != t ? t.options : t) ? r.data : r, { name: "each", hash: {}, fn: e.program(9, a, 0), inverse: e.noop, data: a })) ? r : "") + "/>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"].control = Handlebars.template({
  396. 1: function(e, t, n, i, a) {
  397. var r, o, l = null != t ? t : {};
  398. return ' <label class="' + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.labelClass : r, { name: "if", hash: {}, fn: e.program(2, a, 0), inverse: e.noop, data: a })) ? r : "") + ' alpaca-control-label" for="' + e.escapeExpression((o = null != (o = n.id || (null != t ? t.id : t)) ? o : n.helperMissing, "function" == typeof o ? o.call(l, { name: "id", hash: {}, data: a }) : o)) + '">' + (null != (r = e.lambda(null != (r = null != t ? t.options : t) ? r.label : r, t)) ? r : "") + "</label>\n" },
  399. 2: function(e, t, n, i, a) {
  400. var r;
  401. return e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.labelClass : r, t)) },
  402. 4: function(e, t, n, i, a) {
  403. return "" },
  404. 6: function(e, t, n, i, a) {
  405. var r;
  406. return null != (r = n.each.call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.helpers : r, { name: "each", hash: {}, fn: e.program(7, a, 0), inverse: e.noop, data: a })) ? r : "" },
  407. 7: function(e, t, n, i, a) {
  408. var r;
  409. return ' <p class="' + (null != (r = n["if"].call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.helperClass : r, { name: "if", hash: {}, fn: e.program(8, a, 0), inverse: e.noop, data: a })) ? r : "") + '">\n <i class="info-sign"></i>\n ' + (null != (r = e.lambda(t, t)) ? r : "") + "\n </p>\n" },
  410. 8: function(e, t, n, i, a) {
  411. var r;
  412. return e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.helperClass : r, t)) },
  413. 10: function(e, t, n, i, a) {
  414. var r;
  415. return null != (r = n["if"].call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.buttons : r, { name: "if", hash: {}, fn: e.program(11, a, 0), inverse: e.noop, data: a })) ? r : "" },
  416. 11: function(e, t, n, i, a) {
  417. var r;
  418. return ' <div class="alpaca-control-buttons-container">\n' + (null != (r = n.each.call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.buttons : r, { name: "each", hash: {}, fn: e.program(12, a, 0), inverse: e.noop, data: a })) ? r : "") + " </div>\n" },
  419. 12: function(e, t, n, i, a) {
  420. var r, o, l = null != t ? t : {},
  421. s = n.helperMissing,
  422. u = "function",
  423. c = e.escapeExpression;
  424. return ' <button data-key="' + c((o = null != (o = n.key || a && a.key) ? o : s, typeof o === u ? o.call(l, { name: "key", hash: {}, data: a }) : o)) + '" type="' + c((o = null != (o = n.type || (null != t ? t.type : t)) ? o : s, typeof o === u ? o.call(l, { name: "type", hash: {}, data: a }) : o)) + '" class="alpaca-control-button alpaca-control-button-' + c((o = null != (o = n.key || a && a.key) ? o : s, typeof o === u ? o.call(l, { name: "key", hash: {}, data: a }) : o)) + " " + c((o = null != (o = n.styles || (null != t ? t.styles : t)) ? o : s, typeof o === u ? o.call(l, { name: "styles", hash: {}, data: a }) : o)) + '" ' + (null != (r = n.each.call(l, null != t ? t.value : t, { name: "each", hash: {}, fn: e.program(13, a, 0), inverse: e.noop, data: a })) ? r : "") + ">" + (null != (o = null != (o = n.value || (null != t ? t.value : t)) ? o : s, r = typeof o === u ? o.call(l, { name: "value", hash: {}, data: a }) : o) ? r : "") + "</button>\n" },
  425. 13: function(e, t, n, i, a) {
  426. var r, o = null != t ? t : {},
  427. l = n.helperMissing,
  428. s = "function",
  429. u = e.escapeExpression;
  430. return u((r = null != (r = n.key || a && a.key) ? r : l, typeof r === s ? r.call(o, { name: "key", hash: {}, data: a }) : r)) + '="' + u((r = null != (r = n.value || (null != t ? t.value : t)) ? r : l, typeof r === s ? r.call(o, { name: "value", hash: {}, data: a }) : r)) + '" ' },
  431. compiler: [7, ">= 4.0.0"],
  432. main: function(e, t, n, i, a) {
  433. var r, o, l, s = null != t ? t : {},
  434. u = '<script type="text/x-handlebars-template">\n\n <div>\n\n' + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.label : r, {
  435. name: "if",
  436. hash: {},
  437. fn: e.program(1, a, 0),
  438. inverse: e.noop,
  439. data: a
  440. })) ? r : "") + "\n ";
  441. return o = null != (o = n.control || (null != t ? t.control : t)) ? o : n.helperMissing, l = { name: "control", hash: {}, fn: e.program(4, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(s, l) : o, n.control || (r = n.blockHelperMissing.call(t, r, l)), null != r && (u += r), u + "\n\n" + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.helpers : r, { name: "if", hash: {}, fn: e.program(6, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n" + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.renderButtons : r, { name: "if", hash: {}, fn: e.program(10, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n </div>\n\n</script>"
  442. },
  443. useData: !0
  444. }), this.HandlebarsPrecompiled["web-edit"].form = Handlebars.template({ 1: function(e, t, n, i, a) {
  445. return "" }, 3: function(e, t, n, i, a) {
  446. var r;
  447. return null != (r = n.each.call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.buttons : r, { name: "each", hash: {}, fn: e.program(4, a, 0), inverse: e.noop, data: a })) ? r : "" }, 4: function(e, t, n, i, a) {
  448. var r, o, l = null != t ? t : {},
  449. s = n.helperMissing,
  450. u = "function",
  451. c = e.escapeExpression;
  452. return ' <button data-key="' + c((o = null != (o = n.key || a && a.key) ? o : s, typeof o === u ? o.call(l, { name: "key", hash: {}, data: a }) : o)) + '" type="' + c((o = null != (o = n.type || (null != t ? t.type : t)) ? o : s, typeof o === u ? o.call(l, { name: "type", hash: {}, data: a }) : o)) + '" ' + (null != (r = n["if"].call(l, null != t ? t.id : t, { name: "if", hash: {}, fn: e.program(5, a, 0), inverse: e.noop, data: a })) ? r : "") + ' class="alpaca-form-button alpaca-form-button-' + c((o = null != (o = n.key || a && a.key) ? o : s, typeof o === u ? o.call(l, { name: "key", hash: {}, data: a }) : o)) + " " + c((o = null != (o = n.styles || (null != t ? t.styles : t)) ? o : s, typeof o === u ? o.call(l, { name: "styles", hash: {}, data: a }) : o)) + '" ' + (null != (r = n.each.call(l, null != t ? t.value : t, { name: "each", hash: {}, fn: e.program(7, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n.each.call(l, null != t ? t.attributes : t, { name: "each", hash: {}, fn: e.program(9, a, 0), inverse: e.noop, data: a })) ? r : "") + ">" + (null != (o = null != (o = n.value || (null != t ? t.value : t)) ? o : s, r = typeof o === u ? o.call(l, { name: "value", hash: {}, data: a }) : o) ? r : "") + "</button>\n" }, 5: function(e, t, n, i, a) {
  453. var r;
  454. return 'id="' + e.escapeExpression((r = null != (r = n.id || (null != t ? t.id : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "id", hash: {}, data: a }) : r)) + '"' }, 7: function(e, t, n, i, a) {
  455. var r, o = e.escapeExpression;
  456. return o((r = null != (r = n.key || a && a.key) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "key", hash: {}, data: a }) : r)) + '="' + o(e.lambda(t, t)) + '"' }, 9: function(e, t, n, i, a) {
  457. var r, o = e.escapeExpression;
  458. return " " + o((r = null != (r = n.key || a && a.key) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "key", hash: {}, data: a }) : r)) + '="' + o(e.lambda(t, t)) + '"' }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  459. var r, o, l, s = null != t ? t : {},
  460. u = '<script type="text/x-handlebars-template">\n\n <form role="form">\n\n ';
  461. return o = null != (o = n.formItems || (null != t ? t.formItems : t)) ? o : n.helperMissing, l = { name: "formItems", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(s, l) : o, n.formItems || (r = n.blockHelperMissing.call(t, r, l)), null != r && (u += r), u + '\n\n <div class="alpaca-form-buttons-container">\n' + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.buttons : r, { name: "if", hash: {}, fn: e.program(3, a, 0), inverse: e.noop, data: a })) ? r : "") + " </div>\n\n </form>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"].message = Handlebars.template({ compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  462. var r, o, l = null != t ? t : {},
  463. s = n.helperMissing,
  464. u = "function";
  465. return '<script type="text/x-handlebars-template">\n\n <div class="alpaca-message alpaca-message-' + (null != (o = null != (o = n.id || (null != t ? t.id : t)) ? o : s, r = typeof o === u ? o.call(l, { name: "id", hash: {}, data: a }) : o) ? r : "") + '">\n ' + (null != (o = null != (o = n.message || (null != t ? t.message : t)) ? o : s, r = typeof o === u ? o.call(l, { name: "message", hash: {}, data: a }) : o) ? r : "") + "\n </div>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["web-edit"].wizard = Handlebars.template({ 1: function(e, t, n, i, a) {
  466. var r;
  467. return ' <div class="alpaca-wizard-nav">\n <nav class="navbar navbar-default" role="navigation">\n <div class="container-fluid alpaca-wizard-back">\n <ul class="nav navbar-nav">\n' + (null != (r = n.each.call(null != t ? t : {}, null != t ? t.steps : t, { name: "each", hash: {}, fn: e.program(2, a, 0), inverse: e.noop, data: a })) ? r : "") + " </ul>\n </div>\n </nav>\n </div>\n" }, 2: function(e, t, n, i, a) {
  468. var r, o, l = null != t ? t : {},
  469. s = n.helperMissing,
  470. u = "function";
  471. return ' <li data-alpaca-wizard-step-index="' + e.escapeExpression((o = null != (o = n.index || a && a.index) ? o : s, typeof o === u ? o.call(l, { name: "index", hash: {}, data: a }) : o)) + '">\n <div class="holder">\n <div class="title">' + (null != (o = null != (o = n.title || (null != t ? t.title : t)) ? o : s, r = typeof o === u ? o.call(l, { name: "title", hash: {}, data: a }) : o) ? r : "") + '</div>\n <div class="description">' + (null != (o = null != (o = n.description || (null != t ? t.description : t)) ? o : s, r = typeof o === u ? o.call(l, { name: "description", hash: {}, data: a }) : o) ? r : "") + '</div>\n </div>\n <div class="chevron"></div>\n </li>\n' }, 4: function(e, t, n, i, a) {
  472. return ' <div class="alpaca-wizard-progress-bar">\n <div class="progress">\n <div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 60%;">\n </div>\n </div>\n </div>\n' }, 6: function(e, t, n, i, a) {
  473. var r, o;
  474. return " <h3>" + (null != (o = null != (o = n.wizardTitle || (null != t ? t.wizardTitle : t)) ? o : n.helperMissing, r = "function" == typeof o ? o.call(null != t ? t : {}, { name: "wizardTitle", hash: {}, data: a }) : o) ? r : "") + "</h3>\n" }, 8: function(e, t, n, i, a) {
  475. var r, o;
  476. return " <h4>" + (null != (o = null != (o = n.wizardDescription || (null != t ? t.wizardDescription : t)) ? o : n.helperMissing, r = "function" == typeof o ? o.call(null != t ? t : {}, { name: "wizardDescription", hash: {}, data: a }) : o) ? r : "") + "</h4>\n" }, 10: function(e, t, n, i, a, r, o) {
  477. var l;
  478. return null != (l = (n.compare || t && t.compare || n.helperMissing).call(null != t ? t : {}, null != t ? t.align : t, "left", { name: "compare", hash: {}, fn: e.program(11, a, 0, r, o), inverse: e.noop, data: a })) ? l : "" }, 11: function(e, t, n, i, a, r, o) {
  479. var l, s, u = null != t ? t : {},
  480. c = n.helperMissing,
  481. d = "function",
  482. p = e.escapeExpression;
  483. return ' <button type="' + p((s = null != (s = n.type || (null != t ? t.type : t)) ? s : c, typeof s === d ? s.call(u, { name: "type", hash: {}, data: a }) : s)) + '" ' + (null != (l = n["if"].call(u, null != t ? t.id : t, { name: "if", hash: {}, fn: e.program(12, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + ' class="' + p(e.lambda(null != (l = null != (l = null != o[1] ? o[1].view : o[1]) ? l.styles : l) ? l.button : l, t)) + '" data-alpaca-wizard-button-key="' + p((s = null != (s = n.key || a && a.key) ? s : c, typeof s === d ? s.call(u, { name: "key", hash: {}, data: a }) : s)) + '" ' + (null != (l = n.each.call(u, null != t ? t.attributes : t, { name: "each", hash: {}, fn: e.program(14, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + ">" + (null != (s = null != (s = n.title || (null != t ? t.title : t)) ? s : c, l = typeof s === d ? s.call(u, { name: "title", hash: {}, data: a }) : s) ? l : "") + "</button>\n" }, 12: function(e, t, n, i, a) {
  484. var r;
  485. return 'id="' + e.escapeExpression((r = null != (r = n.id || (null != t ? t.id : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "id", hash: {}, data: a }) : r)) + '"' }, 14: function(e, t, n, i, a) {
  486. var r, o = e.escapeExpression;
  487. return " " + o((r = null != (r = n.key || a && a.key) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "key", hash: {}, data: a }) : r)) + '="' + o(e.lambda(t, t)) + '"' }, 16: function(e, t, n, i, a, r, o) {
  488. var l;
  489. return null != (l = (n.compare || t && t.compare || n.helperMissing).call(null != t ? t : {}, null != t ? t.align : t, "right", { name: "compare", hash: {}, fn: e.program(11, a, 0, r, o), inverse: e.noop, data: a })) ? l : "" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a, r, o) {
  490. var l, s = null != t ? t : {};
  491. return '<script type="text/x-handlebars-template">\n\n <div class="alpaca-wizard">\n\n <!-- nav bar -->\n' + (null != (l = n["if"].call(s, null != t ? t.showSteps : t, { name: "if", hash: {}, fn: e.program(1, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + "\n <!-- wizard progress bar -->\n" + (null != (l = n["if"].call(s, null != t ? t.showProgressBar : t, { name: "if", hash: {}, fn: e.program(4, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + "\n" + (null != (l = n["if"].call(s, null != t ? t.wizardTitle : t, { name: "if", hash: {}, fn: e.program(6, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + (null != (l = n["if"].call(s, null != t ? t.wizardDescription : t, { name: "if", hash: {}, fn: e.program(8, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + '\n <!-- wizard steps -->\n <div class="alpaca-wizard-steps">\n\n </div>\n\n <!-- wizard buttons -->\n <div class="alpaca-wizard-buttons">\n\n <div class="pull-left">\n' + (null != (l = n.each.call(s, null != t ? t.buttons : t, { name: "each", hash: {}, fn: e.program(10, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + ' </div>\n\n <div class="pull-right">\n' + (null != (l = n.each.call(s, null != t ? t.buttons : t, { name: "each", hash: {}, fn: e.program(16, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + ' </div>\n\n <div style="clear:both"></div>\n\n </div>\n\n </div>\n\n</script>' }, useData: !0, useDepths: !0 }), this.HandlebarsPrecompiled["bootstrap-display"] = this.HandlebarsPrecompiled["bootstrap-display"] || {}, this.HandlebarsPrecompiled["bootstrap-display"].container = Handlebars.template({ 1: function(e, t, n, i, a) {
  492. var r, o = null != t ? t : {};
  493. return ' <legend class="' + (null != (r = n["if"].call(o, null != (r = null != t ? t.options : t) ? r.labelClass : r, { name: "if", hash: {}, fn: e.program(2, a, 0), inverse: e.noop, data: a })) ? r : "") + 'alpaca-container-label">\n\n' + (null != (r = n["if"].call(o, null != (r = null != t ? t.options : t) ? r.collapsible : r, { name: "if", hash: {}, fn: e.program(4, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n " + (null != (r = e.lambda(null != (r = null != t ? t.options : t) ? r.label : r, t)) ? r : "") + "\n\n" + (null != (r = n["if"].call(o, null != (r = null != t ? t.options : t) ? r.collapsible : r, { name: "if", hash: {}, fn: e.program(6, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n </legend>\n" }, 2: function(e, t, n, i, a) {
  494. var r;
  495. return e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.labelClass : r, t)) + " " }, 4: function(e, t, n, i, a) {
  496. return ' <span data-toggle="collapse">\n' }, 6: function(e, t, n, i, a) {
  497. return " </span>\n" }, 8: function(e, t, n, i, a) {
  498. var r;
  499. return null != (r = n.each.call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.helpers : r, { name: "each", hash: {}, fn: e.program(9, a, 0), inverse: e.noop, data: a })) ? r : "" }, 9: function(e, t, n, i, a) {
  500. var r;
  501. return ' <p class="alpaca-helper help-block ' + (null != (r = n["if"].call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.helperClass : r, { name: "if", hash: {}, fn: e.program(10, a, 0), inverse: e.noop, data: a })) ? r : "") + '">\n <i class="alpaca-icon-16 glyphicon glyphicon-info-sign"></i>\n ' + (null != (r = e.lambda(t, t)) ? r : "") + "\n </p>\n" }, 10: function(e, t, n, i, a) {
  502. var r;
  503. return e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.helperClass : r, t)) }, 12: function(e, t, n, i, a) {
  504. return "" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  505. var r, o, l, s = null != t ? t : {},
  506. u = '<script type="text/x-handlebars-template">\n\n <div>\n\n' + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.label : r, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n" + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.helpers : r, { name: "if", hash: {}, fn: e.program(8, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n ";
  507. return o = null != (o = n.container || (null != t ? t.container : t)) ? o : n.helperMissing, l = { name: "container", hash: {}, fn: e.program(12, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(s, l) : o, n.container || (r = n.blockHelperMissing.call(t, r, l)), null != r && (u += r), u + "\n\n </div>\n\n</script>\n" }, useData: !0 }), this.HandlebarsPrecompiled["bootstrap-display"]["control-radio"] = Handlebars.template({ 1: function(e, t, n, i, a, r, o) {
  508. var l;
  509. return null != (l = (n.compare || t && t.compare || n.helperMissing).call(null != t ? t : {}, null != t ? t.value : t, null != o[1] ? o[1].data : o[1], { name: "compare", hash: {}, fn: e.program(2, a, 0, r, o), inverse: e.noop, data: a })) ? l : "" }, 2: function(e, t, n, i, a) {
  510. var r, o;
  511. return " " + (null != (o = null != (o = n.text || (null != t ? t.text : t)) ? o : n.helperMissing, r = "function" == typeof o ? o.call(null != t ? t : {}, { name: "text", hash: {}, data: a }) : o) ? r : "") + "\n" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a, r, o) {
  512. var l;
  513. return '<script type="text/x-handlebars-template">\n\n <div>\n' + (null != (l = n.each.call(null != t ? t : {}, null != t ? t.selectOptions : t, { name: "each", hash: {}, fn: e.program(1, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + " </div>\n\n</script>\n" }, useData: !0, useDepths: !0 }), this.HandlebarsPrecompiled["bootstrap-display"]["control-select"] = Handlebars.template({ compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  514. var r;
  515. return '<script type="text/x-handlebars-template">\n\n <div>\n ' + e.escapeExpression((r = null != (r = n.displayableText || (null != t ? t.displayableText : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "displayableText", hash: {}, data: a }) : r)) + "\n </div>\n\n</script>\n" }, useData: !0 }), this.HandlebarsPrecompiled["bootstrap-display"]["control-upload-partial-download"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  516. var r, o = e.lambda,
  517. l = e.escapeExpression;
  518. return ' <td></td>\n <td class="name">\n <span>' + l(o(null != (r = null != t ? t.file : t) ? r.name : r, t)) + '</span>\n </td>\n <td class="size">\n <span>' + l(o(null != (r = null != t ? t.file : t) ? r.size : r, t)) + '</span>\n </td>\n <td class="error" colspan="2">\n Error:\n ' + l(o(null != (r = null != t ? t.file : t) ? r.error : r, t)) + "\n </td>\n" }, 3: function(e, t, n, i, a) {
  519. var r, o = e.lambda,
  520. l = e.escapeExpression;
  521. return ' <td class="preview">\n' + (null != (r = n["if"].call(null != t ? t : {}, null != (r = null != t ? t.file : t) ? r.thumbnailUrl : r, { name: "if", hash: {}, fn: e.program(4, a, 0), inverse: e.noop, data: a })) ? r : "") + ' </td>\n <td class="name">\n <a href="' + l(o(null != (r = null != t ? t.file : t) ? r.url : r, t)) + '" title="' + l(o(null != (r = null != t ? t.file : t) ? r.name : r, t)) + '" data-gallery="' + l(o(null != (r = null != t ? t.file : t) ? r.thumbnailUrl : r, t)) + 'gallery" download="' + l(o(null != (r = null != t ? t.file : t) ? r.name : r, t)) + '">' + l(o(null != (r = null != t ? t.file : t) ? r.name : r, t)) + '</a>\n </td>\n <td class="size"><span>' + l(o(null != (r = null != t ? t.file : t) ? r.size : r, t)) + '</span></td>\n <td colspan="2"></td>\n' }, 4: function(e, t, n, i, a) {
  522. var r, o = e.lambda,
  523. l = e.escapeExpression;
  524. return ' <a href="' + l(o(null != (r = null != t ? t.file : t) ? r.url : r, t)) + '" title="' + l(o(null != (r = null != t ? t.file : t) ? r.name : r, t)) + '" data-gallery="gallery" download="' + l(o(null != (r = null != t ? t.file : t) ? r.name : r, t)) + '">\n <img src="' + l(o(null != (r = null != t ? t.file : t) ? r.thumbnailUrl : r, t)) + '">\n </a>\n' }, 6: function(e, t, n, i, a, r, o) {
  525. var l;
  526. return null != (l = n.each.call(null != t ? t : {}, null != t ? t.buttons : t, { name: "each", hash: {}, fn: e.program(7, a, 0, r, o), inverse: e.noop, data: a })) ? l : "" }, 7: function(e, t, n, i, a, r, o) {
  527. var l;
  528. return null != (l = n["if"].call(null != t ? t : {}, null != t ? t.isDelete : t, { name: "if", hash: {}, fn: e.program(8, a, 0, r, o), inverse: e.program(10, a, 0, r, o), data: a })) ? l : "" }, 8: function(e, t, n, i, a, r, o) {
  529. var l, s = e.escapeExpression;
  530. return ' <button class="delete btn btn-danger" data-file-index="' + s(e.lambda(null != o[1] ? o[1].fileIndex : o[1], t)) + '" data-button-key="' + s((l = null != (l = n.key || (null != t ? t.key : t)) ? l : n.helperMissing, "function" == typeof l ? l.call(null != t ? t : {}, { name: "key", hash: {}, data: a }) : l)) + '">\n <i class="glyphicon glyphicon-trash glyphicon-white"></i>\n </button>\n' }, 10: function(e, t, n, i, a, r, o) {
  531. var l, s, u = null != t ? t : {},
  532. c = n.helperMissing,
  533. d = "function",
  534. p = e.escapeExpression;
  535. return ' <button class="' + p((s = null != (s = n.key || (null != t ? t.key : t)) ? s : c, typeof s === d ? s.call(u, { name: "key", hash: {}, data: a }) : s)) + " btn " + p((s = null != (s = n.buttonClass || (null != t ? t.buttonClass : t)) ? s : c, typeof s === d ? s.call(u, { name: "buttonClass", hash: {}, data: a }) : s)) + '" data-file-index="' + p(e.lambda(null != o[1] ? o[1].fileIndex : o[1], t)) + '" data-button-key="' + p((s = null != (s = n.key || (null != t ? t.key : t)) ? s : c, typeof s === d ? s.call(u, { name: "key", hash: {}, data: a }) : s)) + '">\n' + (null != (l = n["if"].call(u, null != t ? t.iconClass : t, { name: "if", hash: {}, fn: e.program(11, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + (null != (l = n["if"].call(u, null != t ? t.label : t, { name: "if", hash: {}, fn: e.program(13, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + " </button>\n" }, 11: function(e, t, n, i, a) {
  536. var r;
  537. return ' <i class="' + e.escapeExpression((r = null != (r = n.iconClass || (null != t ? t.iconClass : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "iconClass", hash: {}, data: a }) : r)) + '"></i>\n' }, 13: function(e, t, n, i, a) {
  538. var r;
  539. return " " + e.escapeExpression((r = null != (r = n.label || (null != t ? t.label : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "label", hash: {}, data: a }) : r)) + "\n" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a, r, o) {
  540. var l, s = null != t ? t : {};
  541. return '<script type="text/x-handlebars-template">\n\n <tr class="template-download">\n' + (null != (l = n["if"].call(s, null != (l = null != t ? t.file : t) ? l.error : l, { name: "if", hash: {}, fn: e.program(1, a, 0, r, o), inverse: e.program(3, a, 0, r, o), data: a })) ? l : "") + " <td>\n" + (null != (l = n["if"].call(s, null != t ? t.buttons : t, { name: "if", hash: {}, fn: e.program(6, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + " </td>\n </tr>\n\n</script>" }, useData: !0, useDepths: !0 }), this.HandlebarsPrecompiled["bootstrap-display"]["control-upload-partial-upload"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  542. return ' <td class="preview">\n <span class="fade"></span>\n </td>\n' }, 3: function(e, t, n, i, a) {
  543. return " <td></td>\n" }, 5: function(e, t, n, i, a) {
  544. var r;
  545. return ' <td class="error" colspan="2"><span class="label label-important">Error</span> ' + e.escapeExpression(e.lambda(null != (r = null != t ? t.file : t) ? r.error : r, t)) + "</td>\n" }, 7: function(e, t, n, i, a) {
  546. var r;
  547. return null != (r = n["if"].call(null != t ? t : {}, null != (r = null != t ? t.file : t) ? r.valid : r, { name: "if", hash: {}, fn: e.program(8, a, 0), inverse: e.program(15, a, 0), data: a })) ? r : "" }, 8: function(e, t, n, i, a) {
  548. var r, o = null != t ? t : {};
  549. return (null != (r = (n.compare || t && t.compare || n.helperMissing).call(o, a && a.index, 0, { name: "compare", hash: {}, fn: e.program(9, a, 0), inverse: e.noop, data: a })) ? r : "") + ' <td class="start">\n' + (null != (r = n["if"].call(o, null != (r = null != t ? t.options : t) ? r.autoUpload : r, { name: "if", hash: {}, fn: e.program(11, a, 0), inverse: e.program(13, a, 0), data: a })) ? r : "") + " </td>\n" }, 9: function(e, t, n, i, a) {
  550. return ' <td>\n <div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">\n <div class="progress-bar" style="width:0%;"></div>\n </div>\n </td>\n' }, 11: function(e, t, n, i, a) {
  551. return "" }, 13: function(e, t, n, i, a) {
  552. return ' <button class="btn btn-primary"> \\\n <i class="glyphicon glyphicon-upload glyphicon-white"></i>\n <span>Start</span>\n </button>\n' }, 15: function(e, t, n, i, a) {
  553. var r;
  554. return ' <td></td>\n <td class="cancel">\n' + (null != (r = (n.compare || t && t.compare || n.helperMissing).call(null != t ? t : {}, a && a.index, 0, { name: "compare", hash: {}, fn: e.program(16, a, 0), inverse: e.noop, data: a })) ? r : "") + " </td>\n" }, 16: function(e, t, n, i, a) {
  555. return ' <button class="btn btn-warning">\n <i class="icofont icofont-ban glyphicon-white"></i>\n <span>Cancel</span>\n </button>\n' }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  556. var r, o = null != t ? t : {},
  557. l = e.lambda,
  558. s = e.escapeExpression;
  559. return '<script type="text/x-handlebars-template">\n\n <tr class="template-upload">\n\n' + (null != (r = n["if"].call(o, null != (r = null != t ? t.options : t) ? r.showUploadPreview : r, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.program(3, a, 0), data: a })) ? r : "") + '\n <td class="name"><span>' + s(l(null != (r = null != t ? t.file : t) ? r.name : r, t)) + '</span></td>\n <td class="size"><span>' + s(l(null != (r = null != t ? t.file : t) ? r.size : r, t)) + "</span></td>\n\n" + (null != (r = n["if"].call(o, null != (r = null != t ? t.file : t) ? r.error : r, { name: "if", hash: {}, fn: e.program(5, a, 0), inverse: e.program(7, a, 0), data: a })) ? r : "") + " <td></td>\n </tr>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["bootstrap-display"]["control-upload"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  560. var r;
  561. return e.escapeExpression((r = null != (r = n.cssClasses || (null != t ? t.cssClasses : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "cssClasses", hash: {}, data: a }) : r)) }, 3: function(e, t, n, i, a) {
  562. var r;
  563. return " <thead>\n <tr>\n" + (null != (r = n["if"].call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.showUploadPreview : r, { name: "if", hash: {}, fn: e.program(4, a, 0), inverse: e.program(6, a, 0), data: a })) ? r : "") + ' <td>Name</td>\n <td>Size</td>\n <td colspan="2"></td><!-- error or start or progress indicator -->\n <td>Actions</td>\n </tr>\n </thead>\n' }, 4: function(e, t, n, i, a) {
  564. return " <td>Thumbnail</td>\n" }, 6: function(e, t, n, i, a) {
  565. return " <td></td>\n" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  566. var r, o, l = null != t ? t : {},
  567. s = e.escapeExpression,
  568. u = n.helperMissing,
  569. c = "function";
  570. return '<script type="text/x-handlebars-template">\n\n <div class="alpaca-fileupload-container ' + (null != (r = n["if"].call(l, null != t ? t.cssClasses : t, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + '">\n <div class="container-fluid">\n <div class="row alpaca-fileupload-chooserow">\n <div class="col-md-12">\n <div class="btn-group">\n <span class="' + s(e.lambda(null != (r = null != (r = null != t ? t.view : t) ? r.styles : r) ? r.button : r, t)) + ' fileinput-button">\n <i class="glyphicon glyphicon-upload"></i>\n <span class="fileupload-add-button">' + s((o = null != (o = n.chooseButtonLabel || (null != t ? t.chooseButtonLabel : t)) ? o : u, typeof o === c ? o.call(l, { name: "chooseButtonLabel", hash: {}, data: a }) : o)) + '</span>\n <input class="alpaca-fileupload-input" type="file" name="' + s((o = null != (o = n.name || (null != t ? t.name : t)) ? o : u, typeof o === c ? o.call(l, { name: "name", hash: {}, data: a }) : o)) + '_files">\n <input class="alpaca-fileupload-input-hidden" type="hidden" name="' + s((o = null != (o = n.name || (null != t ? t.name : t)) ? o : u, typeof o === c ? o.call(l, { name: "name", hash: {}, data: a }) : o)) + '_files_hidden">\n </span>\n </div>\n </div>\n </div>\n <div class="row alpaca-fileupload-well">\n <div class="col-md-12 fileupload-active-zone">\n <table class="table table-striped">\n' + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.showHeaders : r, { name: "if", hash: {}, fn: e.program(3, a, 0), inverse: e.noop, data: a })) ? r : "") + ' <tbody class="files">\n </tbody>\n </table>\n <p align="center" class="dropzone-message">' + s((o = null != (o = n.dropZoneMessage || (null != t ? t.dropZoneMessage : t)) ? o : u, typeof o === c ? o.call(l, { name: "dropZoneMessage", hash: {}, data: a }) : o)) + '</p>\n </div>\n </div>\n <div class="row">\n <div class="col-md-12">\n <div id="progress" class="progress">\n <div class="progress-bar progress-bar-success"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n</script>' }, useData: !0 }), this.HandlebarsPrecompiled["bootstrap-display"].control = Handlebars.template({ 1: function(e, t, n, i, a) {
  571. var r, o, l = null != t ? t : {};
  572. return ' <label class="' + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.labelClass : r, { name: "if", hash: {}, fn: e.program(2, a, 0), inverse: e.noop, data: a })) ? r : "") + ' control-label alpaca-control-label" for="' + e.escapeExpression((o = null != (o = n.id || (null != t ? t.id : t)) ? o : n.helperMissing, "function" == typeof o ? o.call(l, { name: "id", hash: {}, data: a }) : o)) + '">' + (null != (r = e.lambda(null != (r = null != t ? t.options : t) ? r.label : r, t)) ? r : "") + "</label>\n" }, 2: function(e, t, n, i, a) {
  573. var r;
  574. return e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.labelClass : r, t)) }, 4: function(e, t, n, i, a) {
  575. return "" }, 6: function(e, t, n, i, a) {
  576. var r;
  577. return null != (r = n.each.call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.helpers : r, { name: "each", hash: {}, fn: e.program(7, a, 0), inverse: e.noop, data: a })) ? r : "" }, 7: function(e, t, n, i, a) {
  578. var r;
  579. return ' <p class="help-block ' + (null != (r = n["if"].call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.helperClass : r, { name: "if", hash: {}, fn: e.program(8, a, 0), inverse: e.noop, data: a })) ? r : "") + '">\n <i class="glyphicon glyphicon-info-sign"></i>\n ' + (null != (r = e.lambda(t, t)) ? r : "") + "\n </p>\n" }, 8: function(e, t, n, i, a) {
  580. var r;
  581. return e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.helperClass : r, t)) }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  582. var r, o, l, s = null != t ? t : {},
  583. u = '<script type="text/x-handlebars-template">\n\n <div class="form-group">\n\n' + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.label : r, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n ";
  584. return o = null != (o = n.control || (null != t ? t.control : t)) ? o : n.helperMissing, l = { name: "control", hash: {}, fn: e.program(4, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(s, l) : o, n.control || (r = n.blockHelperMissing.call(t, r, l)), null != r && (u += r), u + "\n\n" + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.helpers : r, { name: "if", hash: {}, fn: e.program(6, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n </div>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["bootstrap-display"].message = Handlebars.template({ compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  585. var r, o;
  586. return '<script type="text/x-handlebars-template">\n\n <div class="help-block">\n <i class="glyphicon glyphicon-exclamation-sign"></i>&nbsp;' + (null != (o = null != (o = n.message || (null != t ? t.message : t)) ? o : n.helperMissing, r = "function" == typeof o ? o.call(null != t ? t : {}, { name: "message", hash: {}, data: a }) : o) ? r : "") + "\n </div>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["bootstrap-edit"] = this.HandlebarsPrecompiled["bootstrap-edit"] || {}, this.HandlebarsPrecompiled["bootstrap-edit"]["container-grid"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  587. return " btn-group" }, 3: function(e, t, n, i, a, r, o) {
  588. var l, s = null != t ? t : {},
  589. u = n.helperMissing;
  590. return "\n" + (null != (l = (n.compare || t && t.compare || u).call(s, null != (l = null != o[1] ? o[1].options : o[1]) ? l.toolbarStyle : l, "link", { name: "compare", hash: {}, fn: e.program(4, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + "\n" + (null != (l = (n.compare || t && t.compare || u).call(s, null != (l = null != o[1] ? o[1].options : o[1]) ? l.toolbarStyle : l, "button", { name: "compare", hash: {}, fn: e.program(6, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + "\n" }, 4: function(e, t, n, i, a) {
  591. var r = e.lambda,
  592. o = e.escapeExpression;
  593. return ' <a href="#" class="alpaca-array-toolbar-action" data-array-toolbar-action="' + o(r(null != t ? t.action : t, t)) + '">' + o(r(null != t ? t.label : t, t)) + "</a>\n" }, 6: function(e, t, n, i, a, r, o) {
  594. var l, s, u = e.escapeExpression,
  595. c = null != t ? t : {};
  596. return ' <button class="alpaca-array-toolbar-action ' + u(e.lambda(null != (l = null != (l = null != o[1] ? o[1].view : o[1]) ? l.styles : l) ? l.button : l, t)) + '" data-array-toolbar-action="' + u((s = null != (s = n.action || (null != t ? t.action : t)) ? s : n.helperMissing, "function" == typeof s ? s.call(c, { name: "action", hash: {}, data: a }) : s)) + '">\n' + (null != (l = n["if"].call(c, null != t ? t.iconClass : t, { name: "if", hash: {}, fn: e.program(7, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + " " + (null != (l = n["if"].call(c, null != t ? t.label : t, { name: "if", hash: {}, fn: e.program(9, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + "\n </button>\n" }, 7: function(e, t, n, i, a) {
  597. var r;
  598. return ' <i class="' + e.escapeExpression((r = null != (r = n.iconClass || (null != t ? t.iconClass : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "iconClass", hash: {}, data: a }) : r)) + '"></i>\n' }, 9: function(e, t, n, i, a) {
  599. var r, o;
  600. return null != (o = null != (o = n.label || (null != t ? t.label : t)) ? o : n.helperMissing, r = "function" == typeof o ? o.call(null != t ? t : {}, { name: "label", hash: {}, data: a }) : o) ? r : "" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a, r, o) {
  601. var l, s = null != t ? t : {};
  602. return '<script type="text/x-handlebars-template">\n\n <div>\n\n <div class="alpaca-array-toolbar" ' + (null != (l = (n.compare || t && t.compare || n.helperMissing).call(s, null != (l = null != t ? t.options : t) ? l.toolbarStyle : l, "button", { name: "compare", hash: {}, fn: e.program(1, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + ">\n\n" + (null != (l = n.each.call(s, null != t ? t.arrayToolbarActions : t, { name: "each", hash: {}, fn: e.program(3, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + '\n </div>\n\n <div class="alpaca-container-grid-holder"></div>\n\n </div>\n\n</script>' }, useData: !0, useDepths: !0 }), this.HandlebarsPrecompiled["bootstrap-edit"]["container-table"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  603. return "" }, 3: function(e, t, n, i, a) {
  604. return ' <!-- hidden column storing sort order -->\n <th class="alpaca-table-reorder-index-header"></th>\n <!-- draggable -->\n <th class="alpaca-table-reorder-draggable-header"></th>\n' }, 5: function(e, t, n, i, a) {
  605. var r, o, l = null != t ? t : {},
  606. s = n.helperMissing,
  607. u = "function";
  608. return ' <th data-header-id="' + e.escapeExpression((o = null != (o = n.id || (null != t ? t.id : t)) ? o : s, typeof o === u ? o.call(l, { name: "id", hash: {}, data: a }) : o)) + '" ' + (null != (r = n["if"].call(l, null != t ? t.hidden : t, { name: "if", hash: {}, fn: e.program(6, a, 0), inverse: e.noop, data: a })) ? r : "") + ">" + (null != (o = null != (o = n.title || (null != t ? t.title : t)) ? o : s, r = typeof o === u ? o.call(l, { name: "title", hash: {}, data: a }) : o) ? r : "") + "</th>\n" }, 6: function(e, t, n, i, a) {
  609. return 'class="alpaca-table-column-hidden"' }, 8: function(e, t, n, i, a) {
  610. return " <th>Actions</th>\n" }, 10: function(e, t, n, i, a) {
  611. var r;
  612. return "\n " + (null != (r = (n.item || t && t.item || n.helperMissing).call(null != t ? t : {}, "tr", { name: "item", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n\n" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  613. var r, o, l, s = null != t ? t : {},
  614. u = '<script type="text/x-handlebars-template">\n\n <div class="table-responsive">\n\n ';
  615. return o = null != (o = n.arrayToolbar || (null != t ? t.arrayToolbar : t)) ? o : n.helperMissing, l = { name: "arrayToolbar", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(s, l) : o, n.arrayToolbar || (r = n.blockHelperMissing.call(t, r, l)), null != r && (u += r), u + "\n\n <table>\n\n <!-- table headers -->\n <thead>\n <tr>\n\n" + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.dragRows : r, { name: "if", hash: {}, fn: e.program(3, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n" + (null != (r = n.each.call(s, null != t ? t.headers : t, { name: "each", hash: {}, fn: e.program(5, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n" + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.showActionsColumn : r, { name: "if", hash: {}, fn: e.program(8, a, 0), inverse: e.noop, data: a })) ? r : "") + " </tr>\n </thead>\n\n <!-- table body -->\n <tbody>\n" + (null != (r = n.each.call(s, null != t ? t.items : t, { name: "each", hash: {}, fn: e.program(10, a, 0), inverse: e.noop, data: a })) ? r : "") + " </tbody>\n\n </table>\n\n </div>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["bootstrap-edit"].container = Handlebars.template({
  616. 1: function(e, t, n, i, a) {
  617. var r, o = null != t ? t : {};
  618. return ' <legend class="' + (null != (r = n["if"].call(o, null != (r = null != t ? t.options : t) ? r.labelClass : r, { name: "if", hash: {}, fn: e.program(2, a, 0), inverse: e.noop, data: a })) ? r : "") + 'alpaca-container-label">\n\n' + (null != (r = n["if"].call(o, null != (r = null != t ? t.options : t) ? r.collapsible : r, { name: "if", hash: {}, fn: e.program(4, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n " + (null != (r = e.lambda(null != (r = null != t ? t.options : t) ? r.label : r, t)) ? r : "") + "\n\n" + (null != (r = n["if"].call(o, null != (r = null != t ? t.options : t) ? r.collapsible : r, {
  619. name: "if",
  620. hash: {},
  621. fn: e.program(6, a, 0),
  622. inverse: e.noop,
  623. data: a
  624. })) ? r : "") + "\n </legend>\n"
  625. },
  626. 2: function(e, t, n, i, a) {
  627. var r;
  628. return e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.labelClass : r, t)) + " " },
  629. 4: function(e, t, n, i, a) {
  630. return ' <span data-toggle="collapse">\n' },
  631. 6: function(e, t, n, i, a) {
  632. return " </span>\n" },
  633. 8: function(e, t, n, i, a) {
  634. var r;
  635. return null != (r = n.each.call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.helpers : r, { name: "each", hash: {}, fn: e.program(9, a, 0), inverse: e.noop, data: a })) ? r : "" },
  636. 9: function(e, t, n, i, a) {
  637. var r;
  638. return ' <p class="alpaca-helper help-block ' + (null != (r = n["if"].call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.helperClass : r, { name: "if", hash: {}, fn: e.program(10, a, 0), inverse: e.noop, data: a })) ? r : "") + '">\n <i class="alpaca-icon-16 glyphicon glyphicon-info-sign"></i>\n ' + (null != (r = e.lambda(t, t)) ? r : "") + "\n </p>\n" },
  639. 10: function(e, t, n, i, a) {
  640. var r;
  641. return e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.helperClass : r, t)) },
  642. 12: function(e, t, n, i, a) {
  643. return "" },
  644. compiler: [7, ">= 4.0.0"],
  645. main: function(e, t, n, i, a) {
  646. var r, o, l, s = null != t ? t : {},
  647. u = '<script type="text/x-handlebars-template">\n\n <div>\n\n' + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.label : r, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n" + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.helpers : r, { name: "if", hash: {}, fn: e.program(8, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n ";
  648. return o = null != (o = n.container || (null != t ? t.container : t)) ? o : n.helperMissing, l = { name: "container", hash: {}, fn: e.program(12, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(s, l) : o, n.container || (r = n.blockHelperMissing.call(t, r, l)), null != r && (u += r), u + "\n\n </div>\n\n</script>\n" },
  649. useData: !0
  650. }), this.HandlebarsPrecompiled["bootstrap-edit"]["control-colorpicker"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  651. return ' <div class="input-group">\n' }, 3: function(e, t, n, i, a) {
  652. var r;
  653. return 'placeholder="' + e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.placeholder : r, t)) + '"' }, 5: function(e, t, n, i, a) {
  654. var r;
  655. return 'size="' + e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.size : r, t)) + '"' }, 7: function(e, t, n, i, a) {
  656. return 'readonly="readonly"' }, 9: function(e, t, n, i, a) {
  657. var r;
  658. return 'name="' + e.escapeExpression((r = null != (r = n.name || (null != t ? t.name : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "name", hash: {}, data: a }) : r)) + '"' }, 11: function(e, t, n, i, a) {
  659. var r, o = e.escapeExpression;
  660. return "data-" + o((r = null != (r = n.key || a && a.key) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "key", hash: {}, data: a }) : r)) + '="' + o(e.lambda(t, t)) + '"' }, 13: function(e, t, n, i, a) {
  661. var r, o = e.escapeExpression;
  662. return o((r = null != (r = n.key || a && a.key) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "key", hash: {}, data: a }) : r)) + '="' + o(e.lambda(t, t)) + '"' }, 15: function(e, t, n, i, a) {
  663. return ' <span class="input-group-addon"><i></i></span>\n </div>\n' }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  664. var r, o, l = null != t ? t : {},
  665. s = n.helperMissing,
  666. u = "function",
  667. c = e.escapeExpression;
  668. return '<script type="text/x-handlebars-template">\n\n' + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.component : r, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + '\n <input type="' + c((o = null != (o = n.inputType || (null != t ? t.inputType : t)) ? o : s, typeof o === u ? o.call(l, { name: "inputType", hash: {}, data: a }) : o)) + '" id="' + c((o = null != (o = n.id || (null != t ? t.id : t)) ? o : s, typeof o === u ? o.call(l, { name: "id", hash: {}, data: a }) : o)) + '" ' + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.placeholder : r, { name: "if", hash: {}, fn: e.program(3, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.size : r, { name: "if", hash: {}, fn: e.program(5, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.readonly : r, { name: "if", hash: {}, fn: e.program(7, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n["if"].call(l, null != t ? t.name : t, { name: "if", hash: {}, fn: e.program(9, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n.each.call(l, null != (r = null != t ? t.options : t) ? r.data : r, { name: "each", hash: {}, fn: e.program(11, a, 0), inverse: e.noop, data: a })) ? r : "") + " " + (null != (r = n.each.call(l, null != (r = null != t ? t.options : t) ? r.attributes : r, { name: "each", hash: {}, fn: e.program(13, a, 0), inverse: e.noop, data: a })) ? r : "") + "/>\n\n" + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.component : r, { name: "if", hash: {}, fn: e.program(15, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["bootstrap-edit"]["control-upload-partial-download"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  669. var r, o = e.lambda,
  670. l = e.escapeExpression;
  671. return ' <td></td>\n <td class="name">\n <span>' + l(o(null != (r = null != t ? t.file : t) ? r.name : r, t)) + '</span>\n </td>\n <td class="size">\n <span>' + l(o(null != (r = null != t ? t.file : t) ? r.size : r, t)) + '</span>\n </td>\n <td class="error" colspan="2">\n Error:\n ' + l(o(null != (r = null != t ? t.file : t) ? r.error : r, t)) + "\n </td>\n" }, 3: function(e, t, n, i, a) {
  672. var r, o = e.lambda,
  673. l = e.escapeExpression;
  674. return ' <td class="preview">\n' + (null != (r = n["if"].call(null != t ? t : {}, null != (r = null != t ? t.file : t) ? r.thumbnailUrl : r, { name: "if", hash: {}, fn: e.program(4, a, 0), inverse: e.noop, data: a })) ? r : "") + ' </td>\n <td class="name">\n <a href="' + l(o(null != (r = null != t ? t.file : t) ? r.url : r, t)) + '" title="' + l(o(null != (r = null != t ? t.file : t) ? r.name : r, t)) + '" data-gallery="' + l(o(null != (r = null != t ? t.file : t) ? r.thumbnailUrl : r, t)) + 'gallery" download="' + l(o(null != (r = null != t ? t.file : t) ? r.name : r, t)) + '">' + l(o(null != (r = null != t ? t.file : t) ? r.name : r, t)) + '</a>\n </td>\n <td class="size"><span>' + l(o(null != (r = null != t ? t.file : t) ? r.size : r, t)) + '</span></td>\n <td colspan="2"></td>\n' }, 4: function(e, t, n, i, a) {
  675. var r, o = e.lambda,
  676. l = e.escapeExpression;
  677. return ' <a href="' + l(o(null != (r = null != t ? t.file : t) ? r.url : r, t)) + '" title="' + l(o(null != (r = null != t ? t.file : t) ? r.name : r, t)) + '" data-gallery="gallery" download="' + l(o(null != (r = null != t ? t.file : t) ? r.name : r, t)) + '">\n <img src="' + l(o(null != (r = null != t ? t.file : t) ? r.thumbnailUrl : r, t)) + '">\n </a>\n' }, 6: function(e, t, n, i, a, r, o) {
  678. var l;
  679. return null != (l = n.each.call(null != t ? t : {}, null != t ? t.buttons : t, { name: "each", hash: {}, fn: e.program(7, a, 0, r, o), inverse: e.noop, data: a })) ? l : "" }, 7: function(e, t, n, i, a, r, o) {
  680. var l;
  681. return null != (l = n["if"].call(null != t ? t : {}, null != t ? t.isDelete : t, { name: "if", hash: {}, fn: e.program(8, a, 0, r, o), inverse: e.program(10, a, 0, r, o), data: a })) ? l : "" }, 8: function(e, t, n, i, a, r, o) {
  682. var l, s = e.escapeExpression;
  683. return ' <button class="delete btn btn-danger" data-file-index="' + s(e.lambda(null != o[1] ? o[1].fileIndex : o[1], t)) + '" data-button-key="' + s((l = null != (l = n.key || (null != t ? t.key : t)) ? l : n.helperMissing, "function" == typeof l ? l.call(null != t ? t : {}, { name: "key", hash: {}, data: a }) : l)) + '">\n <i class="glyphicon glyphicon-trash glyphicon-white"></i>\n </button>\n' }, 10: function(e, t, n, i, a, r, o) {
  684. var l, s, u = null != t ? t : {},
  685. c = n.helperMissing,
  686. d = "function",
  687. p = e.escapeExpression;
  688. return ' <button class="' + p((s = null != (s = n.key || (null != t ? t.key : t)) ? s : c, typeof s === d ? s.call(u, { name: "key", hash: {}, data: a }) : s)) + " btn " + p((s = null != (s = n.buttonClass || (null != t ? t.buttonClass : t)) ? s : c, typeof s === d ? s.call(u, { name: "buttonClass", hash: {}, data: a }) : s)) + '" data-file-index="' + p(e.lambda(null != o[1] ? o[1].fileIndex : o[1], t)) + '" data-button-key="' + p((s = null != (s = n.key || (null != t ? t.key : t)) ? s : c, typeof s === d ? s.call(u, { name: "key", hash: {}, data: a }) : s)) + '">\n' + (null != (l = n["if"].call(u, null != t ? t.iconClass : t, { name: "if", hash: {}, fn: e.program(11, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + (null != (l = n["if"].call(u, null != t ? t.label : t, { name: "if", hash: {}, fn: e.program(13, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + " </button>\n" }, 11: function(e, t, n, i, a) {
  689. var r;
  690. return ' <i class="' + e.escapeExpression((r = null != (r = n.iconClass || (null != t ? t.iconClass : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "iconClass", hash: {}, data: a }) : r)) + '"></i>\n' }, 13: function(e, t, n, i, a) {
  691. var r;
  692. return " " + e.escapeExpression((r = null != (r = n.label || (null != t ? t.label : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "label", hash: {}, data: a }) : r)) + "\n" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a, r, o) {
  693. var l, s = null != t ? t : {};
  694. return '<script type="text/x-handlebars-template">\n\n <tr class="template-download">\n' + (null != (l = n["if"].call(s, null != (l = null != t ? t.file : t) ? l.error : l, { name: "if", hash: {}, fn: e.program(1, a, 0, r, o), inverse: e.program(3, a, 0, r, o), data: a })) ? l : "") + " <td>\n" + (null != (l = n["if"].call(s, null != t ? t.buttons : t, { name: "if", hash: {}, fn: e.program(6, a, 0, r, o), inverse: e.noop, data: a })) ? l : "") + " </td>\n </tr>\n\n</script>" }, useData: !0, useDepths: !0 }), this.HandlebarsPrecompiled["bootstrap-edit"]["control-upload-partial-upload"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  695. return ' <td class="preview">\n <span class="fade"></span>\n </td>\n' }, 3: function(e, t, n, i, a) {
  696. return " <td></td>\n" }, 5: function(e, t, n, i, a) {
  697. var r;
  698. return ' <td class="error" colspan="2"><span class="label label-important">Error</span> ' + e.escapeExpression(e.lambda(null != (r = null != t ? t.file : t) ? r.error : r, t)) + "</td>\n" }, 7: function(e, t, n, i, a) {
  699. var r;
  700. return null != (r = n["if"].call(null != t ? t : {}, null != (r = null != t ? t.file : t) ? r.valid : r, { name: "if", hash: {}, fn: e.program(8, a, 0), inverse: e.program(15, a, 0), data: a })) ? r : "" }, 8: function(e, t, n, i, a) {
  701. var r, o = null != t ? t : {};
  702. return (null != (r = (n.compare || t && t.compare || n.helperMissing).call(o, a && a.index, 0, { name: "compare", hash: {}, fn: e.program(9, a, 0), inverse: e.noop, data: a })) ? r : "") + ' <td class="start">\n' + (null != (r = n["if"].call(o, null != (r = null != t ? t.options : t) ? r.autoUpload : r, { name: "if", hash: {}, fn: e.program(11, a, 0), inverse: e.program(13, a, 0), data: a })) ? r : "") + " </td>\n" }, 9: function(e, t, n, i, a) {
  703. return ' <td>\n <div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">\n <div class="progress-bar" style="width:0%;"></div>\n </div>\n </td>\n' }, 11: function(e, t, n, i, a) {
  704. return "" }, 13: function(e, t, n, i, a) {
  705. return ' <button class="btn btn-primary"> \\\n <i class="glyphicon glyphicon-upload glyphicon-white"></i>\n <span>Start</span>\n </button>\n' }, 15: function(e, t, n, i, a) {
  706. var r;
  707. return ' <td></td>\n <td class="cancel">\n' + (null != (r = (n.compare || t && t.compare || n.helperMissing).call(null != t ? t : {}, a && a.index, 0, { name: "compare", hash: {}, fn: e.program(16, a, 0), inverse: e.noop, data: a })) ? r : "") + " </td>\n" }, 16: function(e, t, n, i, a) {
  708. return ' <button class="btn btn-warning">\n <i class="icofont icofont-ban glyphicon-white"></i>\n <span>Cancel</span>\n </button>\n' }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  709. var r, o = null != t ? t : {},
  710. l = e.lambda,
  711. s = e.escapeExpression;
  712. return '<script type="text/x-handlebars-template">\n\n <tr class="template-upload">\n\n' + (null != (r = n["if"].call(o, null != (r = null != t ? t.options : t) ? r.showUploadPreview : r, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.program(3, a, 0), data: a })) ? r : "") + '\n <td class="name"><span>' + s(l(null != (r = null != t ? t.file : t) ? r.name : r, t)) + '</span></td>\n <td class="size"><span>' + s(l(null != (r = null != t ? t.file : t) ? r.size : r, t)) + "</span></td>\n\n" + (null != (r = n["if"].call(o, null != (r = null != t ? t.file : t) ? r.error : r, { name: "if", hash: {}, fn: e.program(5, a, 0), inverse: e.program(7, a, 0), data: a })) ? r : "") + " <td></td>\n </tr>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["bootstrap-edit"]["control-upload"] = Handlebars.template({ 1: function(e, t, n, i, a) {
  713. var r;
  714. return e.escapeExpression((r = null != (r = n.cssClasses || (null != t ? t.cssClasses : t)) ? r : n.helperMissing, "function" == typeof r ? r.call(null != t ? t : {}, { name: "cssClasses", hash: {}, data: a }) : r)) }, 3: function(e, t, n, i, a) {
  715. var r;
  716. return " <thead>\n <tr>\n" + (null != (r = n["if"].call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.showUploadPreview : r, { name: "if", hash: {}, fn: e.program(4, a, 0), inverse: e.program(6, a, 0), data: a })) ? r : "") + ' <td>Name</td>\n <td>Size</td>\n <td colspan="2"></td><!-- error or start or progress indicator -->\n <td>Actions</td>\n </tr>\n </thead>\n' }, 4: function(e, t, n, i, a) {
  717. return " <td>Thumbnail</td>\n" }, 6: function(e, t, n, i, a) {
  718. return " <td></td>\n" }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  719. var r, o, l = null != t ? t : {},
  720. s = e.escapeExpression,
  721. u = n.helperMissing,
  722. c = "function";
  723. return '<script type="text/x-handlebars-template">\n\n <div class="alpaca-fileupload-container ' + (null != (r = n["if"].call(l, null != t ? t.cssClasses : t, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + '">\n <div class="container-fluid">\n <div class="row alpaca-fileupload-chooserow">\n <div class="col-md-12">\n <div class="btn-group">\n <span class="' + s(e.lambda(null != (r = null != (r = null != t ? t.view : t) ? r.styles : r) ? r.button : r, t)) + ' fileinput-button">\n <i class="glyphicon glyphicon-upload"></i>\n <span class="fileupload-add-button">' + s((o = null != (o = n.chooseButtonLabel || (null != t ? t.chooseButtonLabel : t)) ? o : u, typeof o === c ? o.call(l, { name: "chooseButtonLabel", hash: {}, data: a }) : o)) + '</span>\n <input class="alpaca-fileupload-input" type="file" name="' + s((o = null != (o = n.name || (null != t ? t.name : t)) ? o : u, typeof o === c ? o.call(l, { name: "name", hash: {}, data: a }) : o)) + '_files">\n <input class="alpaca-fileupload-input-hidden" type="hidden" name="' + s((o = null != (o = n.name || (null != t ? t.name : t)) ? o : u, typeof o === c ? o.call(l, { name: "name", hash: {}, data: a }) : o)) + '_files_hidden">\n </span>\n </div>\n </div>\n </div>\n <div class="row alpaca-fileupload-well">\n <div class="col-md-12 fileupload-active-zone">\n <table class="table table-striped">\n' + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.showHeaders : r, { name: "if", hash: {}, fn: e.program(3, a, 0), inverse: e.noop, data: a })) ? r : "") + ' <tbody class="files">\n </tbody>\n </table>\n <p align="center" class="dropzone-message">' + s((o = null != (o = n.dropZoneMessage || (null != t ? t.dropZoneMessage : t)) ? o : u, typeof o === c ? o.call(l, { name: "dropZoneMessage", hash: {}, data: a }) : o)) + '</p>\n </div>\n </div>\n <div class="row">\n <div class="col-md-12">\n <div id="progress" class="progress">\n <div class="progress-bar progress-bar-success"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n</script>' }, useData: !0 }), this.HandlebarsPrecompiled["bootstrap-edit"].control = Handlebars.template({ 1: function(e, t, n, i, a) {
  724. var r, o, l = null != t ? t : {};
  725. return ' <label class="' + (null != (r = n["if"].call(l, null != (r = null != t ? t.options : t) ? r.labelClass : r, { name: "if", hash: {}, fn: e.program(2, a, 0), inverse: e.noop, data: a })) ? r : "") + ' control-label alpaca-control-label" for="' + e.escapeExpression((o = null != (o = n.id || (null != t ? t.id : t)) ? o : n.helperMissing, "function" == typeof o ? o.call(l, { name: "id", hash: {}, data: a }) : o)) + '">' + (null != (r = e.lambda(null != (r = null != t ? t.options : t) ? r.label : r, t)) ? r : "") + "</label>\n" }, 2: function(e, t, n, i, a) {
  726. var r;
  727. return e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.labelClass : r, t)) }, 4: function(e, t, n, i, a) {
  728. return "" }, 6: function(e, t, n, i, a) {
  729. var r;
  730. return null != (r = n.each.call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.helpers : r, { name: "each", hash: {}, fn: e.program(7, a, 0), inverse: e.noop, data: a })) ? r : "" }, 7: function(e, t, n, i, a) {
  731. var r;
  732. return ' <p class="help-block ' + (null != (r = n["if"].call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.helperClass : r, { name: "if", hash: {}, fn: e.program(8, a, 0), inverse: e.noop, data: a })) ? r : "") + '">\n <i class="glyphicon glyphicon-info-sign"></i>\n ' + (null != (r = e.lambda(t, t)) ? r : "") + "\n </p>\n" }, 8: function(e, t, n, i, a) {
  733. var r;
  734. return e.escapeExpression(e.lambda(null != (r = null != t ? t.options : t) ? r.helperClass : r, t)) }, 10: function(e, t, n, i, a) {
  735. var r;
  736. return null != (r = n["if"].call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.buttons : r, { name: "if", hash: {}, fn: e.program(11, a, 0), inverse: e.noop, data: a })) ? r : "" }, 11: function(e, t, n, i, a) {
  737. var r;
  738. return ' <div class="alpaca-control-buttons-container">\n' + (null != (r = n.each.call(null != t ? t : {}, null != (r = null != t ? t.options : t) ? r.buttons : r, { name: "each", hash: {}, fn: e.program(12, a, 0), inverse: e.noop, data: a })) ? r : "") + " </div>\n" }, 12: function(e, t, n, i, a) {
  739. var r, o, l = null != t ? t : {},
  740. s = n.helperMissing,
  741. u = "function",
  742. c = e.escapeExpression;
  743. return ' <button data-key="' + c((o = null != (o = n.key || a && a.key) ? o : s, typeof o === u ? o.call(l, { name: "key", hash: {}, data: a }) : o)) + '" type="' + c((o = null != (o = n.type || (null != t ? t.type : t)) ? o : s, typeof o === u ? o.call(l, { name: "type", hash: {}, data: a }) : o)) + '" class="alpaca-control-button alpaca-control-button-' + c((o = null != (o = n.key || a && a.key) ? o : s, typeof o === u ? o.call(l, { name: "key", hash: {}, data: a }) : o)) + " " + c((o = null != (o = n.styles || (null != t ? t.styles : t)) ? o : s, typeof o === u ? o.call(l, { name: "styles", hash: {}, data: a }) : o)) + '" ' + (null != (r = n.each.call(l, null != t ? t.value : t, { name: "each", hash: {}, fn: e.program(13, a, 0), inverse: e.noop, data: a })) ? r : "") + ">" + (null != (o = null != (o = n.value || (null != t ? t.value : t)) ? o : s, r = typeof o === u ? o.call(l, { name: "value", hash: {}, data: a }) : o) ? r : "") + "</button>\n" }, 13: function(e, t, n, i, a) {
  744. var r, o = null != t ? t : {},
  745. l = n.helperMissing,
  746. s = "function",
  747. u = e.escapeExpression;
  748. return u((r = null != (r = n.key || a && a.key) ? r : l, typeof r === s ? r.call(o, { name: "key", hash: {}, data: a }) : r)) + '="' + u((r = null != (r = n.value || (null != t ? t.value : t)) ? r : l, typeof r === s ? r.call(o, { name: "value", hash: {}, data: a }) : r)) + '" ' }, compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  749. var r, o, l, s = null != t ? t : {},
  750. u = '<script type="text/x-handlebars-template">\n\n <div class="form-group">\n\n' + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.label : r, { name: "if", hash: {}, fn: e.program(1, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n ";
  751. return o = null != (o = n.control || (null != t ? t.control : t)) ? o : n.helperMissing, l = { name: "control", hash: {}, fn: e.program(4, a, 0), inverse: e.noop, data: a }, r = "function" == typeof o ? o.call(s, l) : o, n.control || (r = n.blockHelperMissing.call(t, r, l)), null != r && (u += r), u + "\n\n" + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.helpers : r, { name: "if", hash: {}, fn: e.program(6, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n" + (null != (r = n["if"].call(s, null != (r = null != t ? t.options : t) ? r.renderButtons : r, { name: "if", hash: {}, fn: e.program(10, a, 0), inverse: e.noop, data: a })) ? r : "") + "\n </div>\n\n</script>" }, useData: !0 }), this.HandlebarsPrecompiled["bootstrap-edit"].message = Handlebars.template({ compiler: [7, ">= 4.0.0"], main: function(e, t, n, i, a) {
  752. var r, o, l = null != t ? t : {},
  753. s = n.helperMissing,
  754. u = "function";
  755. return '<script type="text/x-handlebars-template">\n\n <div class="help-block alpaca-message alpaca-message-' + (null != (o = null != (o = n.id || (null != t ? t.id : t)) ? o : s, r = typeof o === u ? o.call(l, { name: "id", hash: {}, data: a }) : o) ? r : "") + '">\n <i class="glyphicon glyphicon-exclamation-sign"></i>&nbsp;' + (null != (o = null != (o = n.message || (null != t ? t.message : t)) ? o : s, r = typeof o === u ? o.call(l, { name: "message", hash: {}, data: a }) : o) ? r : "") + "\n </div>\n\n</script>" }, useData: !0 }),
  756. function(e, t) { e.Base = t() }(this, function() {
  757. var e = "function",
  758. t = "object",
  759. n = "string",
  760. i = !1,
  761. a = ["constructor", "toString", "valueOf"],
  762. r = a.length,
  763. o = /\bbase\b/,
  764. l = function() {},
  765. s = { toSource: null, base: l },
  766. u = function() {};
  767. return u.extend = function(n, a) {
  768. var r = u.prototype.extend;
  769. i = !0;
  770. var o = new this;
  771. r.call(o, n), o.base = s.base, i = !1;
  772. var l = o.constructor,
  773. c = o.constructor = function() { i || (this && (this._constructing || this.constructor === c) ? (this._constructing = !0, l.apply(this, arguments), this._constructing = !1) : arguments.length && u.cast.apply(c, arguments)) };
  774. return r.call(c, this), c.ancestor = this, c.prototype = o, c.valueOf = function(e) {
  775. return e === t ? c : l.valueOf() }, r.call(c, a), typeof c.init === e && c.init(), c }, u.prototype.extend = function(l, c) {
  776. if (typeof l === n && arguments.length > 1) {
  777. var d = this[l];
  778. if (d && typeof c === e && (!d.valueOf || d.valueOf() !== c.valueOf()) && o.test(c)) {
  779. var p = c.valueOf();
  780. c = function() {
  781. var e, t = this.base || s.base;
  782. return this.base = d, e = 0 === arguments.length ? p.call(this) : p.apply(this, arguments), this.base = t, e }, c.valueOf = function(e) {
  783. return e === t ? c : p }, c.toString = u.toString }
  784. this[l] = c } else if (l) {
  785. var h = u.prototype.extend;
  786. i || typeof this === e || (h = this.extend || h);
  787. for (var f, m = i ? 0 : 1; r > m; m++) f = a[m], l[f] !== s[f] && h.call(this, f, l[f]);
  788. for (f in l) s[f] || h.call(this, f, l[f]) }
  789. return this }, u = u.extend({ base: s.base }, { ancestor: Object, version: "1.1", cast: function() {
  790. for (var t, n, i = 0, a = arguments.length; a > i; i++) n = arguments[i], t = n.extend || u.prototype.extend, typeof n === e ? (t = n.prototype.extend || u.prototype.extend, t.call(n.prototype, this.prototype), t.call(n, this), n.ancestor = this) : t.call(n, this.prototype);
  791. return this }, implement: function() {
  792. for (var e = 0; e < arguments.length; e++) this.cast.call(arguments[e], this);
  793. return this }, toString: function() {
  794. return this.valueOf() + "" } }) }),
  795. function(e) {
  796. var t = function() {
  797. var n = t.makeArray(arguments);
  798. if (0 === n.length) return t.throwDefaultError("You must supply at least one argument. This argument can either be a DOM element against which Alpaca will generate a form or it can be a function name. See http://www.alpacajs.org for more details.");
  799. var i = n[0];
  800. i && t.isString(i) && (i = e("#" + i));
  801. var a = null,
  802. r = null,
  803. o = null,
  804. l = null,
  805. s = null,
  806. u = null,
  807. c = null,
  808. d = null,
  809. p = !1,
  810. h = {},
  811. f = null,
  812. m = null,
  813. g = null,
  814. v = null,
  815. b = function(n, a) {
  816. var r = null,
  817. o = e(n).attr("data-alpaca-field-id");
  818. if (o) {
  819. var l = t.fieldInstances[o];
  820. l && (r = l) }
  821. if (!r) {
  822. var s = e(n).attr("data-alpaca-form-id");
  823. if (s) {
  824. var u = e(n).find(":first");
  825. if (u.length > 0) {
  826. var c = e(u[0]).attr("data-alpaca-field-id");
  827. if (c) {
  828. var d = t.fieldInstances[c];
  829. d && (r = d) } } } }
  830. if (!r && !a) {
  831. var p = e(i).find(":first");
  832. if (p.length > 0) {
  833. var h = b(p[0], !0);
  834. h && (r = h) } }
  835. if (!r && !a) {
  836. var f = e(i).parent();
  837. if (f) {
  838. var m = b(f, !0);
  839. m && (r = m) } }
  840. return r },
  841. y = ["get", "exists", "destroy"],
  842. w = n.length > 1 && t.isString(n[1]) && y.indexOf(n[1]) > -1,
  843. E = b(i);
  844. if (E || w) {
  845. if (w) {
  846. var x = n[1];
  847. return "get" === x ? E : "exists" === x ? !!E : "destroy" === x ? void(E && E.destroy()) : t.throwDefaultError("Unknown special function: " + x) }
  848. return E }
  849. var F = null;
  850. if (1 === n.length) {
  851. var C = e(i).text();
  852. F = JSON.parse(C), e(i).html("") } else F = t.isObject(n[1]) ? n[1] : t.isFunction(n[1]) ? n[1]() : { data: n[1] };
  853. if (!F) return t.throwDefaultError("Unable to determine Alpaca configuration");
  854. if (a = F.data, r = F.schema, o = F.options, l = F.view, s = F.render, F.callback && (s = F.callback), u = F.postRender, c = F.error, d = F.connector, f = F.dataSource, m = F.schemaSource, g = F.optionsSource, v = F.viewSource, F.ui && (h.ui = F.ui), F.type && (h.type = F.type), t.isEmpty(F.notTopLevel) || (p = F.notTopLevel), t.isEmpty(c) && (c = t.defaultErrorCallback), !d || !d.connect) {
  855. var T = "default",
  856. S = {};
  857. t.isString(d) ? T = d : t.isObject(d) && d.id && (T = d.id, d.config && (S = d.config));
  858. var k = t.getConnectorClass(T);
  859. k || (k = t.getConnectorClass("default")), d = new k(T, S) }
  860. var A = d;
  861. if (p) {
  862. var O = t.getConnectorClass("default");
  863. A = new O("default") }
  864. o || (o = {});
  865. var I = function(e) { e.parent || (e.hideInitValidationError || e.refreshValidationState(!0), "view" !== e.view.type && t.fieldApplyFieldAndChildren(e, function(e) { e.hideInitValidationError = !1 })) },
  866. M = function(e) { e.parent || (e.observableScope = t.generateId()), e.parent || t.fireReady(e), t.isUndefined(o.focus) && !e.parent && (o.focus = t.defaultFocus), o && o.focus ? window.setTimeout(function() {
  867. var t = function(e) { e.suspendBlurFocus = !0, e.focus(), e.suspendBlurFocus = !1 };
  868. if (o.focus) {
  869. if (e.isControlField && e.isAutoFocusable()) t(e);
  870. else if (e.isContainerField)
  871. if (o.focus === !0) e.children && e.children.length > 0 && t(e);
  872. else if ("string" == typeof o.focus) {
  873. var n = e.getControlByPath(o.focus);
  874. n && n.isControlField && n.isAutoFocusable() && t(n) }
  875. I(e) } }, 500) : I(e), u && u(e) };
  876. A.loadAll({ data: a, schema: r, options: o, view: l, dataSource: f, schemaSource: m, optionsSource: g, viewSource: v }, function(e, n, u, p) {
  877. return e = e ? e : a, u = u ? u : r, n = n ? n : o, p = p ? p : l, t.isEmpty(e) && t.isEmpty(u) && (t.isEmpty(n) || t.isEmpty(n.type)) && (e = "", t.isEmpty(n) ? n = "text" : o && t.isObject(o) && (n.type = "text")), n.view && (p = n.view), t.init(i, e, n, u, p, h, s, M, d, c) }, function(e) {
  878. return c(e), null }) };
  879. t.Fields = {}, t.Connectors = {}, t.Extend = e.extend, t.Create = function() {
  880. var t = Array.prototype.slice.call(arguments);
  881. return t.unshift({}), e.extend.apply(this, t) }, t.Extend(t, {
  882. makeArray: function(e) {
  883. return Array.prototype.slice.call(e) },
  884. isFunction: function(e) {
  885. return "[object Function]" === Object.prototype.toString.call(e) },
  886. isString: function(e) {
  887. return "string" == typeof e },
  888. isObject: function(e) {
  889. return !t.isUndefined(e) && "[object Object]" === Object.prototype.toString.call(e) },
  890. isPlainObject: function(t) {
  891. return e.isPlainObject(t) },
  892. isNumber: function(e) {
  893. return "number" == typeof e },
  894. isArray: function(e) {
  895. return e instanceof Array },
  896. isBoolean: function(e) {
  897. return "boolean" == typeof e },
  898. isUndefined: function(e) {
  899. return "undefined" == typeof e },
  900. trim: function(e) {
  901. var n = e;
  902. return n && t.isString(n) && (n = n.replace(/^\s+|\s+$/g, "")), n },
  903. safeDomParse: function(n) {
  904. if (n && t.isString(n)) { n = t.trim(n);
  905. var i = null;
  906. try { i = e(n) } catch (a) { n = "<div>" + n + "</div>", i = e(n).children() }
  907. return i }
  908. return n },
  909. isEmpty: function(e, n) {
  910. var i = this;
  911. if (t.isUndefined(e)) return !0;
  912. if (null === e) return !0;
  913. if (e && t.isObject(e)) {
  914. var a = i.countProperties(e, n);
  915. if (0 === a) return !0 }
  916. return !1 },
  917. countProperties: function(e, n) {
  918. var i = 0;
  919. if (e && t.isObject(e))
  920. for (var a in e) e.hasOwnProperty(a) && (n ? i++ : "function" != typeof e[a] && i++);
  921. return i },
  922. copyOf: function(n) {
  923. var i = n;
  924. if (t.isArray(n)) { i = [];
  925. for (var a = 0; a < n.length; a++) i.push(t.copyOf(n[a])) } else if (t.isObject(n)) {
  926. if (n instanceof Date) return new Date(n.getTime());
  927. if (n instanceof RegExp) return new RegExp(n);
  928. if (n.nodeType && "cloneNode" in n) i = n.cloneNode(!0);
  929. else if (e.isPlainObject(n)) { i = {};
  930. for (var r in n) n.hasOwnProperty(r) && (i[r] = t.copyOf(n[r])) } }
  931. return i },
  932. copyInto: function(e, t) {
  933. for (var n in t) t.hasOwnProperty(n) && !this.isFunction(this[n]) && (e[n] = t[n]) },
  934. cloneObject: function(e) {
  935. return t.copyOf(e) },
  936. spliceIn: function(e, t, n) {
  937. return e.substring(0, t) + n + e.substring(t, e.length) },
  938. compactArray: function(e) {
  939. var t, n = [],
  940. i = e.length;
  941. for (t = 0; i > t; t++) lang.isNull(e[t]) || lang.isUndefined(e[t]) || n.push(e[t]);
  942. return n },
  943. removeAccents: function(e) {
  944. return e.replace(/[àáâãäå]/g, "a").replace(/[èéêë]/g, "e").replace(/[ìíîï]/g, "i").replace(/[òóôõö]/g, "o").replace(/[ùúûü]/g, "u").replace(/[ýÿ]/g, "y").replace(/[ñ]/g, "n").replace(/[ç]/g, "c").replace(/[œ]/g, "oe").replace(/[æ]/g, "ae") },
  945. indexOf: function(e, n, i) {
  946. var a, r = n.length;
  947. for (t.isFunction(i) || (i = function(e, t) {
  948. return e === t }), a = 0; r > a; a++)
  949. if (i.call({}, e, n[a])) return a;
  950. return -1 },
  951. uniqueIdCounter: 0,
  952. defaultLocale: "en_US",
  953. defaultFocus: !0,
  954. defaultSort: function(e, t) {
  955. return e.text > t.text ? 1 : e.text < t.text ? -1 : 0 },
  956. setDefaultLocale: function(e) { this.defaultLocale = e },
  957. defaultSchemaFieldMapping: {},
  958. registerDefaultSchemaFieldMapping: function(e, t) { e && t && (this.defaultSchemaFieldMapping[e] = t) },
  959. defaultFormatFieldMapping: {},
  960. registerDefaultFormatFieldMapping: function(e, t) { e && t && (this.defaultFormatFieldMapping[e] = t) },
  961. getSchemaType: function(e) {
  962. var n = null;
  963. return t.isEmpty(e) ? n = "string" : t.isArray(e) ? n = "array" : t.isObject(e) ? n = "object" : t.isString(e) ? n = "string" : t.isNumber(e) ? n = "number" : t.isBoolean(e) && (n = "boolean"), n || "object" != typeof e || (n = "object"), n },
  964. guessOptionsType: function(e) {
  965. var n = null;
  966. return n = e && "undefined" != typeof e["enum"] ? e["enum"].length > 3 ? "select" : "radio" : t.defaultSchemaFieldMapping[e.type], e.format && t.defaultFormatFieldMapping[e.format] && (n = t.defaultFormatFieldMapping[e.format]), n },
  967. views: {},
  968. generateViewId: function() {
  969. return "view-" + this.generateId() },
  970. registerView: function(e) {
  971. var n = e.id;
  972. if (!n) return t.throwDefaultError("Cannot register view with missing view id: " + n);
  973. var i = this.views[n];
  974. if (i) t.mergeObject(i, e);
  975. else { this.views[n] = e, e.templates || (e.templates = {});
  976. for (var a = t.TemplateEngineRegistry.ids(), r = 0; r < a.length; r++) {
  977. var o = a[r],
  978. l = t.TemplateEngineRegistry.find(o);
  979. if (l)
  980. for (var s = l.findCacheKeys(n), u = 0; u < s.length; u++) {
  981. var c = t.splitCacheKey(s[u]);
  982. e.templates[c.templateId] = { type: o, template: !0, cacheKey: s[u] } } } } },
  983. getNormalizedView: function(e) {
  984. return this.normalizedViews[e] },
  985. lookupNormalizedView: function(e, t) {
  986. var n = null;
  987. for (var i in this.normalizedViews) {
  988. var a = this.normalizedViews[i];
  989. if (a.ui === e && a.type === t) { n = i;
  990. break } }
  991. return n },
  992. registerTemplate: function(e, n, i) { i || (i = "base"), this.views[i] || (this.views[i] = {}, this.views[i].id = i), this.views[i].templates || (this.views[i].templates = {}), this.views[i].templates[e] = n, t.countProperties(t.normalizedViews) > 0 && (t.normalizedViews = {}) },
  993. registerTemplates: function(e, t) {
  994. for (var n in e) this.registerTemplate(n, e[n], t) },
  995. registerMessage: function(e, t, n) { n || (n = "base"), this.views[n] || (this.views[n] = {}, this.views[n].id = n), this.views[n].messages || (this.views[n].messages = {}), this.views[n].messages[e] = t },
  996. registerMessages: function(e, t) {
  997. for (var n in e) e.hasOwnProperty(n) && this.registerMessage(n, e[n], t) },
  998. defaultDateFormat: "MM/DD/YYYY",
  999. defaultTimeFormat: "HH:mm:ss",
  1000. regexps: { email: /^[a-z0-9!\#\$%&'\*\-\/=\?\+\-\^_`\{\|\}~]+(?:\.[a-z0-9!\#\$%&'\*\-\/=\?\+\-\^_`\{\|\}~]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,6}$/i, url: /^(http|https|ftp):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(\:[0-9]{1,5})?(\/.*)?$/i, "intranet-url": /^(http|https|ftp):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*(\:[0-9]{1,5})?(\/.*)?$/i, password: /^[0-9a-zA-Z\x20-\x7E]*$/, date: /^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.]\d\d$/, integer: /^([\+\-]?([1-9]\d*)|0)$/, number: /^([\+\-]?((([0-9]+(\.)?)|([0-9]*\.[0-9]+))([eE][+-]?[0-9]+)?))$/, phone: /^(\D?(\d{3})\D?\D?(\d{3})\D?(\d{4}))?$/, ipv4: /^(?:1\d?\d?|2(?:[0-4]\d?|[6789]|5[0-5]?)?|[3-9]\d?|0)(?:\.(?:1\d?\d?|2(?:[0-4]\d?|[6789]|5[0-5]?)?|[3-9]\d?|0)){3}$/, "zipcode-five": /^(\d{5})?$/, "zipcode-nine": /^(\d{5}(-\d{4})?)?$/, whitespace: /^\s+$/ },
  1001. fieldInstances: {},
  1002. fieldClassRegistry: {},
  1003. registerFieldClass: function(e, t) { this.fieldClassRegistry[e] = t },
  1004. getFieldClass: function(e) {
  1005. return this.fieldClassRegistry[e] },
  1006. getFieldClassType: function(e) {
  1007. for (var t in this.fieldClassRegistry)
  1008. if (this.fieldClassRegistry.hasOwnProperty(t) && this.fieldClassRegistry[t] === e) return t;
  1009. return null },
  1010. connectorClassRegistry: {},
  1011. registerConnectorClass: function(e, t) { this.connectorClassRegistry[e] = t },
  1012. getConnectorClass: function(e) {
  1013. return this.connectorClassRegistry[e] },
  1014. replaceAll: function(e, t, n) {
  1015. return e.replace(new RegExp(t, "g"), n) },
  1016. element: function(t, n, i, a) {
  1017. var r = e("<" + t + "/>");
  1018. if (n && r.attr(n), i && r.css(i), a)
  1019. for (var o in a) r.addClass(o) },
  1020. elementFromTemplate: function(n, i) {
  1021. var a = n;
  1022. if (i)
  1023. for (var r in i) a = t.replaceAll(a, "${" + r + "}", i[r]);
  1024. return e(a) },
  1025. generateId: function() {
  1026. return t.uniqueIdCounter++, "alpaca" + t.uniqueIdCounter },
  1027. later: function(t, n, i, a, r) { t = t || 0, n = n || {};
  1028. var o, l, s = i,
  1029. u = e.makeArray(a);
  1030. if ("string" == typeof i && (s = n[i]), !s) throw { name: "TypeError", message: "The function is undefined." };
  1031. return o = function() { s.apply(n, u) }, l = r ? setInterval(o, t) : setTimeout(o, t), { id: l, interval: r, cancel: function() { this.interval ? clearInterval(l) : clearTimeout(l) } } },
  1032. endsWith: function(e, t) {
  1033. return -1 !== e.indexOf(t, e.length - t.length) },
  1034. startsWith: function(e, t) {
  1035. return e.substr(0, t.length) === t },
  1036. isUri: function(e) {
  1037. return t.isString(e) && (t.startsWith(e, "http://") || t.startsWith(e, "https://") || t.startsWith(e, "/") || t.startsWith(e, "./") || t.startsWith(e, "../")) },
  1038. traverseObject: function(e, n, i) { t.isString(n) && (n = n.split("."));
  1039. var a = null,
  1040. r = e,
  1041. o = null;
  1042. do o = n.shift(), i && o === i && (o = n.shift()), t.isEmpty(r[o]) ? n = [] : (r = r[o], 0 === n.length && (a = r)); while (n.length > 0);
  1043. return a },
  1044. each: function(e, n) {
  1045. if (t.isArray(e))
  1046. for (var i = 0; i < e.length; i++) n.apply(e[i]);
  1047. else if (t.isObject(e))
  1048. for (var a in e) n.apply(e[a]) },
  1049. merge: function(e, n, i) {
  1050. e || (e = {});
  1051. for (var a in n) {
  1052. var r = !0;
  1053. i && (r = i(a)), r && (t.isEmpty(n[a]) ? e[a] = n[a] : t.isObject(n[a]) ? (e[a] || (e[a] = {}), e[a] = t.merge(e[a], n[a])) : e[a] = n[a]);
  1054. }
  1055. return e
  1056. },
  1057. mergeObject: function(e, t) {
  1058. return e || (e = {}), t || (t = {}), this.mergeObject2(t, e), e },
  1059. mergeObject2: function(n, i) {
  1060. var a = t.isArray,
  1061. r = t.isObject,
  1062. o = t.isUndefined,
  1063. l = t.copyOf,
  1064. s = function(t, n) {
  1065. return a(t) ? a(n) && e.each(t, function(e) { n.push(l(t[e])) }) : r(t) ? r(n) && e.each(t, function(e) { o(n[e]) ? n[e] = l(t[e]) : n[e] = s(t[e], n[e]) }) : n = l(t), n };
  1066. return s(n, i), i },
  1067. substituteTokens: function(e, n) {
  1068. if (!t.isEmpty(e))
  1069. for (var i = 0; i < n.length; i++) {
  1070. var a = "{" + i + "}",
  1071. r = e.indexOf(a);
  1072. if (r > -1) {
  1073. var o = e.substring(0, r) + n[i] + e.substring(r + 3);
  1074. e = o } }
  1075. return e },
  1076. compareObject: function(e, t) {
  1077. return equiv(e, t) },
  1078. compareArrayContent: function(t, n) {
  1079. var i = t && n && t.length === n.length;
  1080. if (i)
  1081. for (var a = t.length - 1; a >= 0; a--) {
  1082. var r = t[a];
  1083. if (e.inArray(r, n) < 0) return !1 }
  1084. return i },
  1085. testRegex: function(e, t) {
  1086. var n = new RegExp(e);
  1087. return n.test(t) },
  1088. isValEmpty: function(n, i) {
  1089. var a = !1;
  1090. return t.isEmpty(n, i) ? a = !0 : (t.isString(n) && "" === n && (a = !0), t.isObject(n) && e.isEmptyObject(n) && (a = !0), t.isArray(n) && 0 === n.length && (a = !0)), a },
  1091. init: function(e, n, i, a, r, o, l, s, u, c) {
  1092. var d = this;
  1093. if (t.isObject(r)) {
  1094. var p = r.id;
  1095. p || (r.id = this.generateViewId());
  1096. var h = r.parent;
  1097. h || (r.parent = "bootstrap-edit"), this.registerView(r), r = r.id }
  1098. this.compile(function(p) {
  1099. if (p.errors && p.errors.length > 0) {
  1100. for (var h = [], f = 0; f < p.errors.length; f++) {
  1101. var m = p.errors[f].view,
  1102. g = p.errors[f].cacheKey,
  1103. v = p.errors[f].err,
  1104. b = "The template with cache key: " + g + " for view: " + m + " failed to compile";
  1105. v && v.message && (b += ", message: " + v.message, h.push(v.message)), v && (b += ", err: " + JSON.stringify(v)), t.logError(b), delete d.normalizedViews[m], delete d.views[m] }
  1106. return t.throwErrorWithCallback("View compilation failed, cannot initialize Alpaca. " + h.join(", "), c) }
  1107. d._init(e, n, i, a, r, o, l, s, u, c) }, c) },
  1108. _init: function(n, i, a, r, o, l, s, u, c, d) {
  1109. var p = this,
  1110. h = t.defaultView || null,
  1111. f = null;
  1112. e.mobile && !h && (h = "jquerymobile");
  1113. var m = "function" == typeof e.fn.modal;
  1114. m && !h && (h = "bootstrap");
  1115. var g = "undefined" != typeof e.ui;
  1116. if (g && !h && (h = "jqueryui"), h && (f = i ? "edit" : "create"), !o) {
  1117. var v = l.ui,
  1118. b = l.type;
  1119. v || (h || (h = t.defaultUI), h && (v = h)), v && (b || (b = f ? f : "edit"), t.logDebug("No view provided but found request for UI: " + v + " and type: " + b), o = this.lookupNormalizedView(v, b), o ? t.logDebug("Found view: " + o) : t.logDebug("No view found for UI: " + v + " and type: " + b)) }
  1120. if (!o) return t.throwErrorWithCallback("A view was not specified and could not be automatically determined.", d);
  1121. if (t.isString(o) && !this.normalizedViews[o]) return t.throwErrorWithCallback("The desired view: " + o + " could not be loaded. Please make sure it is loaded and not misspelled.", d);
  1122. var y = t.createFieldInstance(n, i, a, r, o, c, d);
  1123. if (y) { e(n).addClass("alpaca-field-rendering"), e(n).addClass("alpaca-hidden"), t.fieldInstances[y.getId()] = y, y.allFieldInstances = function() {
  1124. return t.fieldInstances }, t.isEmpty(s) && (s = y.view.render), t.isEmpty(u) && (u = y.view.postRender);
  1125. var w = function() { y.parent || y.getFieldEl().addClass("alpaca-" + p.getNormalizedView(o).type), y.parent || y.getFieldEl().addClass("alpaca-top"), e(n).removeClass("alpaca-field-rendering"), e(n).removeClass("alpaca-hidden"), y._oldFieldEl && e(y._oldFieldEl).remove(), u(y) };
  1126. t.isEmpty(s) ? y.render(function() { w() }) : s(y, function() { w() }), y.callback = s, y.renderedCallback = u } },
  1127. createFieldInstance: function(e, n, i, a, r, o, l) {
  1128. if (t.isValEmpty(i, !0) && (i = {}), t.isValEmpty(a, !0) && (a = {}), i && t.isString(i)) {
  1129. var s = i;
  1130. i = {}, i.type = s }
  1131. i.type || (a.type || (a.type = t.getSchemaType(n)), a.type || (n && t.isArray(n) ? a.type = "array" : a.type = "object"), i.type = t.guessOptionsType(a));
  1132. var u = t.getFieldClass(i.type);
  1133. return u ? new u(e, n, i, a, r, o, l) : (l({ message: "Unable to find field class for type: " + i.type, reason: "FIELD_INSTANTIATION_ERROR" }), null) },
  1134. parseJSON: function(t) {
  1135. return t ? e.parseJSON(t) : null },
  1136. compile: function(n, i) {
  1137. var a = this,
  1138. r = { errors: [], count: 0, successCount: 0 },
  1139. o = function(e) {
  1140. if (0 === r.errors.length)
  1141. for (var t in e) a.normalizedViews[t] = e[t];
  1142. n(r) },
  1143. l = function(e, t, n, i, a) {
  1144. var l = n.id;
  1145. r.count++, t ? r.errors.push({ view: l, cacheKey: i, err: t }) : r.successCount++, r.count == a && o(e) },
  1146. s = function(n, i, a, r, o, s, u) {
  1147. var c = t.makeCacheKey(i.id, a, r, o),
  1148. d = "text/x-handlebars-template";
  1149. if (s && t.isObject(s) && (d = s.type, s.cacheKey && (c = s.cacheKey), s = s.template), s && "string" == typeof s) {
  1150. var p = s.toLowerCase();
  1151. if (t.isUri(p));
  1152. else if (!s || 0 !== s.indexOf("#") && 0 !== s.indexOf(".")) {
  1153. if (s) {
  1154. var h = i.templates[s];
  1155. h && (s = h) } } else {
  1156. var f = e(s);
  1157. d = e(f).attr("type"), s = e(f).html() } }
  1158. if (!d) { t.logError("Engine type was empty");
  1159. var m = new Error("Engine type was empty");
  1160. return void l(n, m, i, c, u) }
  1161. var g = t.TemplateEngineRegistry.find(d);
  1162. if (!g) { t.logError("Cannot find template engine for type: " + type);
  1163. var m = new Error("Cannot find template engine for type: " + type);
  1164. return void l(n, m, i, c, u) }
  1165. if (s === !0) {
  1166. if (g.isCached(c)) return void l(n, null, i, c, u);
  1167. var v = "View configuration for view: " + i.id + " claims to have precompiled template for cacheKey: " + c + " but it could not be found";
  1168. return t.logError(v), void l(n, new Error(v), i, c, u) }
  1169. return g.isCached(c) ? void l(n, null, i, c, u) : void g.compile(c, s, function(e) { l(n, e, i, c, u) }) },
  1170. u = function(e) {
  1171. var t = [];
  1172. for (var n in e) {
  1173. var i = e[n];
  1174. if (i.templates)
  1175. for (var a in i.templates) {
  1176. var r = i.templates[a];
  1177. t.push(function(e, t, n, i, a, r) {
  1178. return function(o) { s(e, t, n, i, a, r, o) } }(e, i, "view", i.id, a, r)) }
  1179. if (i.fields)
  1180. for (var o in i.fields)
  1181. if (i.fields[o].templates)
  1182. for (var a in i.fields[o].templates) {
  1183. var r = i.fields[o].templates[a];
  1184. t.push(function(e, t, n, i, a, r) {
  1185. return function(o) { s(e, t, n, i, a, r, o) } }(e, i, "field", o, a, r)) }
  1186. if (i.layout && i.layout.template) {
  1187. var r = i.layout.template;
  1188. t.push(function(e, t, n, i, a, r) {
  1189. return function(o) { s(e, t, n, i, a, r, o) } }(e, i, "layout", "layout", "layoutTemplate", r)) }
  1190. if (i.globalTemplate) {
  1191. var r = i.globalTemplate;
  1192. t.push(function(e, t, n, i, a, r) {
  1193. return function(o) { s(e, t, n, i, a, r, o) } }(e, i, "global", "global", "globalTemplate", r)) } }
  1194. for (var l = t.length, u = 0; u < t.length; u++) t[u](l) },
  1195. c = function() {
  1196. var e = {},
  1197. n = 0;
  1198. t.normalizedViews || (t.normalizedViews = {}), a.normalizedViews = t.normalizedViews;
  1199. for (var r in a.views)
  1200. if (!t.normalizedViews[r]) {
  1201. var l = new t.NormalizedView(r);
  1202. if (!l.normalize(a.views)) return t.throwErrorWithCallback("View normalization failed, cannot initialize Alpaca. Please check the error logs.", i);
  1203. e[r] = l, n++ }
  1204. n > 0 ? u(e) : o(e) };
  1205. c() },
  1206. getTemplateDescriptor: function(e, n, i) {
  1207. var a = null,
  1208. r = null,
  1209. o = null;
  1210. if (e.templates && e.templates[n]) { o = t.makeCacheKey(e.id, "view", e.id, n);
  1211. var l = e.templates[n];
  1212. t.isObject(l) && l.cacheKey && (o = l.cacheKey) }
  1213. if (i && i.path) {
  1214. var s = i.path;
  1215. if (e && e.fields && s && s.length > 1) {
  1216. var u = function(i, a, r) {
  1217. if (a != i.length) {
  1218. var o = i.slice(),
  1219. l = !1,
  1220. s = i[a],
  1221. c = s.indexOf("[");
  1222. c > -1 && (s = s.substring(0, c), l = !0), o[a] = s;
  1223. var d = o.join("/");
  1224. if (e.fields[d] && e.fields[d].templates && e.fields[d].templates[n]) {
  1225. var p = t.makeCacheKey(e.id, "field", d, n);
  1226. p && r.push({ path: d, cacheKey: p }) }
  1227. u(i, a + 1, r), l && u(o, a + 1, r) } },
  1228. c = s.split("/"),
  1229. d = [];
  1230. u(c, 0, d), d.length > 0 && (o = d[0].cacheKey) } }
  1231. if ("globalTemplate" !== n && "global" !== n || (o = t.makeCacheKey(e.id, "global", "global", "globalTemplate")), "layoutTemplate" !== n && "layout" !== n || (o = t.makeCacheKey(e.id, "layout", "layout", "layoutTemplate")), o) {
  1232. for (var p = t.TemplateEngineRegistry.ids(), h = 0; h < p.length; h++) {
  1233. var f = p[h],
  1234. m = t.TemplateEngineRegistry.find(f);
  1235. if (m.isCached(o)) { r = f;
  1236. break } }
  1237. r && (a = { engine: r, cacheKey: o }) }
  1238. return a },
  1239. tmpl: function(e, n) {
  1240. var i = t.tmplHtml(e, n);
  1241. return t.safeDomParse(i) },
  1242. tmplHtml: function(e, n) { n || (n = {});
  1243. var i = e.engine,
  1244. a = t.TemplateEngineRegistry.find(i);
  1245. if (!a) return t.throwDefaultError("Cannot find template engine for type: " + i);
  1246. var r = e.cacheKey,
  1247. o = a.execute(r, n, function(e) {
  1248. var n = JSON.stringify(e);
  1249. return e.message && (n = e.message), t.throwDefaultError("The compiled template: " + r + " failed to execute: " + n) });
  1250. return o }
  1251. }), t.DEBUG = 0, t.INFO = 1, t.WARN = 2, t.ERROR = 3, t.logLevel = t.WARN, t.logDebug = function(e) { t.log(t.DEBUG, e) }, t.logInfo = function(e) { t.log(t.INFO, e) }, t.logWarn = function(e) { t.log(t.WARN, e) }, t.logError = function(e) { t.log(t.ERROR, e) }, t.LOG_METHOD_MAP = { 0: "debug", 1: "info", 2: "warn", 3: "error" }, t.log = function(e, n) {
  1252. if (t.logLevel <= e) {
  1253. var i = t.LOG_METHOD_MAP[e]; "undefined" != typeof console && console[i] && ("debug" === i ? console.debug(n) : "info" === i ? console.info(n) : "warn" === i ? console.warn(n) : "error" === i ? console.error(n) : console.log(n)) } }, t.checked = function(e, n) {
  1254. return t.attrProp(e, "checked", n) }, t.disabled = function(e, n) {
  1255. return t.attrProp(e, "disabled", n) }, t.attrProp = function(t, n, i) {
  1256. return "undefined" != typeof i && (e(t).prop ? e(t).prop(n, i) : i ? e(t).attr(n, i) : e(t).removeAttr(n)), e(t).prop ? e(t).prop(n) : e(t).attr(n) }, t.loadRefSchemaOptions = function(e, n, i, a) {
  1257. var r = [],
  1258. o = {},
  1259. l = function(n, i, a) {
  1260. return function(r) {
  1261. if (i)
  1262. if ("#" === i) a.schema = n, r();
  1263. else if (0 === i.indexOf("#/")) { i = i.substring(2);
  1264. for (var o = i.split("/"), l = n, s = 0; s < o.length; s++) {
  1265. var u = o[s];
  1266. if (l[u]) l = l[u];
  1267. else if (l.properties && l.properties[u]) l = l.properties[u];
  1268. else {
  1269. if (!l.definitions || !l.definitions[u]) { l = null;
  1270. break }
  1271. l = l.definitions[u] } }
  1272. a.schema = l, r() } else if (0 === i.indexOf("#")) {
  1273. var c = t.resolveSchemaReference(n, i);
  1274. c && (a.schema = c), r() } else {
  1275. var d = t.pathParts(i);
  1276. e.connector.loadReferenceSchema(d.path, function(e) {
  1277. if (d.id) {
  1278. var n = t.resolveSchemaReference(e, d.id);
  1279. n && (a.schema = n) } else a.schema = e;
  1280. r() }, function(e) { r() }) } else r() } };
  1281. r.push(l(e.schema, n, o));
  1282. var s = function(n, i, a) {
  1283. return function(r) {
  1284. if (i)
  1285. if ("#" === i) a.options = n, r();
  1286. else if (0 === i.indexOf("#/")) { i = i.substring(2);
  1287. for (var o = i.split("/"), l = n, s = 0; s < o.length; s++) {
  1288. var u = o[s];
  1289. if (l[u]) l = l[u];
  1290. else if (l.fields && l.fields[u]) l = l.fields[u];
  1291. else {
  1292. if (!l.definitions || !l.definitions[u]) { l = null;
  1293. break }
  1294. l = l.definitions[u] } }
  1295. a.options = l, r() } else if (0 === i.indexOf("#")) {
  1296. var c = t.resolveOptionsReference(n, i);
  1297. c && (a.options = c), r() } else {
  1298. var d = t.pathParts(i);
  1299. e.connector.loadReferenceOptions(d.path, function(e) {
  1300. if (d.id) {
  1301. var n = t.resolveOptionsReference(e, d.id);
  1302. n && (a.options = n) } else a.options = e;
  1303. r() }, function(e) { r() }) } else r() } };
  1304. r.push(s(e.options, i, o)), t.series(r, function() { a(o.schema, o.options) }) }, t.DEFAULT_ERROR_CALLBACK = function(e) {
  1305. if (e && e.message) throw t.logError(JSON.stringify(e)), new Error("Alpaca caught an error with the default error handler: " + JSON.stringify(e)) }, t.defaultErrorCallback = t.DEFAULT_ERROR_CALLBACK, t.throwDefaultError = function(e) { e && t.isObject(e) && (e = JSON.stringify(e));
  1306. var n = { message: e };
  1307. t.defaultErrorCallback(n) }, t.throwErrorWithCallback = function(e, n) { e && t.isObject(e) && (e = JSON.stringify(e));
  1308. var i = { message: e };
  1309. n ? n(i) : t.defaultErrorCallback(i) }, t.resolveSchemaReference = function(e, n) {
  1310. if (e.id === n || "#" + e.id === n) return e;
  1311. if (e.properties)
  1312. for (var i in e.properties) {
  1313. var a = e.properties[i],
  1314. r = t.resolveSchemaReference(a, n);
  1315. if (r) return r } else if (e.items) {
  1316. var a = e.items,
  1317. r = t.resolveSchemaReference(a, n);
  1318. if (r) return r }
  1319. return null }, t.resolveOptionsReference = function(e, n) {
  1320. if (e.id === n || "#" + e.id === n) return e;
  1321. if (e.fields)
  1322. for (var i in e.fields) {
  1323. var a = e.fields[i],
  1324. r = t.resolveOptionsReference(a, n);
  1325. if (r) return r } else if (e.items) {
  1326. var a = e.items,
  1327. r = t.resolveOptionsReference(a, n);
  1328. if (r) return r }
  1329. return null }, e.alpaca = window.Alpaca = t, e.fn.alpaca = function() {
  1330. var n = t.makeArray(arguments),
  1331. i = [].concat(this, n),
  1332. a = t.apply(this, i);
  1333. return "undefined" == typeof a && (a = e(this)), a }, e.fn.outerHTML = function(t) {
  1334. return t ? e("<div></div>").append(this).html() : e("<div></div>").append(this.clone()).html() }, e.fn.swapWith = function(t) {
  1335. return this.each(function() {
  1336. var n = e(t).clone(),
  1337. i = e(this).clone();
  1338. e(t).replaceWith(i), e(this).replaceWith(n) }) }, e.fn.attrProp = function(n, i) {
  1339. return t.attrProp(e(this), n, i) }, e.event.special.destroyed = { remove: function(e) { e.handler && e.handler() } }, t.pathParts = function(e) {
  1340. if ("string" != typeof e) return e;
  1341. var n = e,
  1342. i = null,
  1343. a = n.indexOf("#");
  1344. a > -1 && (i = n.substring(a + 1), n = n.substring(0, a)), t.endsWith(n, "/") && (n = n.substring(0, n.length - 1));
  1345. var r = {};
  1346. return r.path = n, i && (r.id = i), r }, t.resolveField = function(e, n) {
  1347. var i = null;
  1348. if ("string" == typeof n)
  1349. if (0 === n.indexOf("#/") && propertyId.length > 2);
  1350. else if ("#" === n || "#/" === n) i = e;
  1351. else if (0 === n.indexOf("#")) {
  1352. for (var a = e; a.parent;) a = a.parent;
  1353. var r = n.substring(1);
  1354. i = t.resolveFieldByReference(a, r) } else i = e.childrenByPropertyId[n];
  1355. return i }, t.resolveFieldByReference = function(e, n) {
  1356. if (e.schema && e.schema.id == n) return e;
  1357. if (e.children && e.children.length > 0)
  1358. for (var i = 0; i < e.children.length; i++) {
  1359. var a = e.children[i],
  1360. r = t.resolveFieldByReference(a, n);
  1361. if (r) return r }
  1362. return null }, t.anyEquality = function(e, n) {
  1363. var i = {};
  1364. if ("object" == typeof e || t.isArray(e))
  1365. for (var a in e) i[e[a]] = !0;
  1366. else i[e] = !0;
  1367. var r = !1;
  1368. if ("object" == typeof n || t.isArray(n))
  1369. for (var a in n) {
  1370. var o = n[a];
  1371. if (i[o]) { r = !0;
  1372. break } } else r = i[n];
  1373. return r }, t.series = t.serial = function(e, t) { async.series(e, function() { t() }) }, t.parallel = function(e, t) { async.parallel(e, function() { t() }) }, t.nextTick = function(e) { async.nextTick(function() { e() }) }, t.compileValidationContext = function(e, t) {
  1374. var n = [],
  1375. i = e;
  1376. do i.isValidationParticipant() || (i = null), i && n.push(i), i && (i = i.parent); while (i);
  1377. n.reverse();
  1378. var a = [],
  1379. r = function(e, t, n) {
  1380. if (!e || 0 === e.length) return n();
  1381. var i = e[0],
  1382. a = {};
  1383. a.id = i.getId(), a.field = i, a.path = i.path;
  1384. var o = i.isValid();
  1385. i.isContainer() && (o = i.isValid(!0)), a.before = o;
  1386. var l = function(e, n, i) {
  1387. var a = e._previouslyValidated;
  1388. e.validate(), e._validateCustomValidator(function() {
  1389. var r = e.isValid();
  1390. e.isContainer() && (r = e.isValid(!0)), n.after = r, n.validated = !1, n.invalidated = !1, !o && r ? n.validated = !0 : o && !r ? n.invalidated = !0 : a || r || (n.invalidated = !0), n.container = e.isContainer(), n.valid = n.after, t.push(n), i() }) };
  1391. if (e.length > 1) {
  1392. var s = e.slice(0);
  1393. s.shift(), r(s, t, function() { l(i, a, function() { n() }) }) } else l(i, a, function() { n() }) };
  1394. r(n, a, function() { t(a) }) }, t.updateValidationStateForContext = function(e, n) {
  1395. for (var i = 0; i < n.length; i++) {
  1396. var a = n[i],
  1397. r = a.field;
  1398. if (r.getFieldEl().removeClass("alpaca-invalid alpaca-invalid-hidden alpaca-valid"), r.fireCallback("clearValidity"), a.valid) r.getFieldEl().addClass("alpaca-field-valid"), r.fireCallback("valid");
  1399. else if (!r.options.readonly || t.showReadOnlyInvalidState) {
  1400. var o = !1;
  1401. r.hideInitValidationError && (o = !0), r.fireCallback("invalid", o), r.getFieldEl().addClass("alpaca-invalid"), o && r.getFieldEl().addClass("alpaca-invalid-hidden") } else t.logWarn("The field (id=" + r.getId() + ", title=" + r.getTitle() + ", path=" + r.path + ") is invalid and also read-only");
  1402. if (a.validated ? t.later(25, this, function() { r.trigger("validated") }) : a.invalidated && t.later(25, this, function() { r.trigger("invalidated") }), r.options.showMessages && !r.initializing && (!r.options.readonly || t.showReadOnlyInvalidState)) {
  1403. var l = [];
  1404. for (var s in r.validation) r.validation[s].status || l.push({ id: s, message: r.validation[s].message });
  1405. r.displayMessage(l, r.valid) } } }, t.fieldApplyFieldAndChildren = function(e, n) {
  1406. if (n(e), e.children && e.children.length > 0)
  1407. for (var i = 0; i < e.children.length; i++) t.fieldApplyFieldAndChildren(e.children[i], n) }, t.replaceAll = function(e, t, n) {
  1408. return e.replace(new RegExp(t, "g"), n) }, t.asArray = function(e) {
  1409. if (!t.isArray(e)) {
  1410. var n = [];
  1411. return n.push(e), n }
  1412. return e },
  1413. function() {
  1414. function e(e) {
  1415. var t = !1;
  1416. return function() {
  1417. if (t) throw new Error("Callback was already called.");
  1418. t = !0, e.apply(i, arguments) } }
  1419. function t(e) {
  1420. return e.constructor === String ? "string" : e.constructor === Boolean ? "boolean" : e.constructor === Number ? isNaN(e) ? "nan" : "number" : "undefined" == typeof e ? "undefined" : null === e ? "null" : e instanceof Array ? "array" : e instanceof Date ? "date" : e instanceof RegExp ? "regexp" : "object" == typeof e ? "object" : e instanceof Function ? "function" : void 0 }
  1421. function n(e, n, i) {
  1422. var a = t(e);
  1423. return a ? "function" === t(n[a]) ? n[a].apply(n, i) : n[a] : void 0 }
  1424. var i, a, r = {};
  1425. i = this, null != i && (a = i.async), r.noConflict = function() {
  1426. return i.async = a, r };
  1427. var o = function(e, t) {
  1428. if (e.forEach) return e.forEach(t);
  1429. for (var n = 0; n < e.length; n += 1) t(e[n], n, e) },
  1430. l = function(e, t) {
  1431. if (e.map) return e.map(t);
  1432. var n = [];
  1433. return o(e, function(e, i, a) { n.push(t(e, i, a)) }), n },
  1434. s = function(e, t, n) {
  1435. return e.reduce ? e.reduce(t, n) : (o(e, function(e, i, a) { n = t(n, e, i, a) }), n) },
  1436. u = function(e) {
  1437. if (Object.keys) return Object.keys(e);
  1438. var t = [];
  1439. for (var n in e) e.hasOwnProperty(n) && t.push(n);
  1440. return t }; "undefined" != typeof process && process.nextTick ? (r.nextTick = process.nextTick, "undefined" != typeof setImmediate ? r.setImmediate = function(e) { setImmediate(e) } : r.setImmediate = r.nextTick) : "function" == typeof setImmediate ? (r.nextTick = function(e) { setImmediate(e) }, r.setImmediate = r.nextTick) : (r.nextTick = function(e) { setTimeout(e, 0) }, r.setImmediate = r.nextTick), r.each = function(t, n, i) {
  1441. if (i = i || function() {}, !t.length) return i();
  1442. var a = 0;
  1443. o(t, function(r) { n(r, e(function(e) { e ? (i(e), i = function() {}) : (a += 1, a >= t.length && i(null)) })) }) }, r.forEach = r.each, r.eachSeries = function(e, t, n) {
  1444. if (n = n || function() {}, !e.length) return n();
  1445. var i = 0,
  1446. a = function() { t(e[i], function(t) { t ? (n(t), n = function() {}) : (i += 1, i >= e.length ? n(null) : a()) }) };
  1447. a() }, r.forEachSeries = r.eachSeries, r.eachLimit = function(e, t, n, i) {
  1448. var a = c(t);
  1449. a.apply(null, [e, n, i]) }, r.forEachLimit = r.eachLimit;
  1450. var c = function(e) {
  1451. return function(t, n, i) {
  1452. if (i = i || function() {}, !t.length || 0 >= e) return i();
  1453. var a = 0,
  1454. r = 0,
  1455. o = 0;! function l() {
  1456. if (a >= t.length) return i();
  1457. for (; e > o && r < t.length;) r += 1, o += 1, n(t[r - 1], function(e) { e ? (i(e), i = function() {}) : (a += 1, o -= 1, a >= t.length ? i() : l()) }) }() } },
  1458. d = function(e) {
  1459. return function() {
  1460. var t = Array.prototype.slice.call(arguments);
  1461. return e.apply(null, [r.each].concat(t)) } },
  1462. p = function(e, t) {
  1463. return function() {
  1464. var n = Array.prototype.slice.call(arguments);
  1465. return t.apply(null, [c(e)].concat(n)) } },
  1466. h = function(e) {
  1467. return function() {
  1468. var t = Array.prototype.slice.call(arguments);
  1469. return e.apply(null, [r.eachSeries].concat(t)) } },
  1470. f = function(e, t, n, i) {
  1471. var a = [];
  1472. t = l(t, function(e, t) {
  1473. return { index: t, value: e } }), e(t, function(e, t) { n(e.value, function(n, i) { a[e.index] = i, t(n) }) }, function(e) { i(e, a) }) };
  1474. r.map = d(f), r.mapSeries = h(f), r.mapLimit = function(e, t, n, i) {
  1475. return m(t)(e, n, i) };
  1476. var m = function(e) {
  1477. return p(e, f) };
  1478. r.reduce = function(e, t, n, i) { r.eachSeries(e, function(e, i) { n(t, e, function(e, n) { t = n, i(e) }) }, function(e) { i(e, t) }) }, r.inject = r.reduce, r.foldl = r.reduce, r.reduceRight = function(e, t, n, i) {
  1479. var a = l(e, function(e) {
  1480. return e }).reverse();
  1481. r.reduce(a, t, n, i) }, r.foldr = r.reduceRight;
  1482. var g = function(e, t, n, i) {
  1483. var a = [];
  1484. t = l(t, function(e, t) {
  1485. return { index: t, value: e } }), e(t, function(e, t) { n(e.value, function(n) { n && a.push(e), t() }) }, function(e) { i(l(a.sort(function(e, t) {
  1486. return e.index - t.index }), function(e) {
  1487. return e.value })) }) };
  1488. r.filter = d(g), r.filterSeries = h(g), r.select = r.filter, r.selectSeries = r.filterSeries;
  1489. var v = function(e, t, n, i) {
  1490. var a = [];
  1491. t = l(t, function(e, t) {
  1492. return { index: t, value: e } }), e(t, function(e, t) { n(e.value, function(n) { n || a.push(e), t() }) }, function(e) { i(l(a.sort(function(e, t) {
  1493. return e.index - t.index }), function(e) {
  1494. return e.value })) }) };
  1495. r.reject = d(v), r.rejectSeries = h(v);
  1496. var b = function(e, t, n, i) { e(t, function(e, t) { n(e, function(n) { n ? (i(e), i = function() {}) : t() }) }, function(e) { i() }) };
  1497. r.detect = d(b), r.detectSeries = h(b), r.some = function(e, t, n) { r.each(e, function(e, i) { t(e, function(e) { e && (n(!0), n = function() {}), i() }) }, function(e) { n(!1) }) }, r.any = r.some, r.every = function(e, t, n) { r.each(e, function(e, i) { t(e, function(e) { e || (n(!1), n = function() {}), i() }) }, function(e) { n(!0) }) }, r.all = r.every, r.sortBy = function(e, t, n) { r.map(e, function(e, n) { t(e, function(t, i) { t ? n(t) : n(null, { value: e, criteria: i }) }) }, function(e, t) {
  1498. if (e) return n(e);
  1499. var i = function(e, t) {
  1500. var n = e.criteria,
  1501. i = t.criteria;
  1502. return i > n ? -1 : n > i ? 1 : 0 };
  1503. n(null, l(t.sort(i), function(e) {
  1504. return e.value })) }) }, r.auto = function(e, t) { t = t || function() {};
  1505. var n = u(e);
  1506. if (!n.length) return t(null);
  1507. var i = {},
  1508. a = [],
  1509. l = function(e) { a.unshift(e) },
  1510. c = function(e) {
  1511. for (var t = 0; t < a.length; t += 1)
  1512. if (a[t] === e) return void a.splice(t, 1) },
  1513. d = function() { o(a.slice(0), function(e) { e() }) };
  1514. l(function() { u(i).length === n.length && (t(null, i), t = function() {}) }), o(n, function(n) {
  1515. var a = e[n] instanceof Function ? [e[n]] : e[n],
  1516. p = function(e) {
  1517. var a = Array.prototype.slice.call(arguments, 1);
  1518. if (a.length <= 1 && (a = a[0]), e) {
  1519. var l = {};
  1520. o(u(i), function(e) { l[e] = i[e] }), l[n] = a, t(e, l), t = function() {} } else i[n] = a, r.setImmediate(d) },
  1521. h = a.slice(0, Math.abs(a.length - 1)) || [],
  1522. f = function() {
  1523. return s(h, function(e, t) {
  1524. return e && i.hasOwnProperty(t) }, !0) && !i.hasOwnProperty(n) };
  1525. if (f()) a[a.length - 1](p, i);
  1526. else {
  1527. var m = function() { f() && (c(m), a[a.length - 1](p, i)) };
  1528. l(m) } }) }, r.waterfall = function(e, t) {
  1529. if (t = t || function() {}, e.constructor !== Array) {
  1530. var n = new Error("First argument to waterfall must be an array of functions");
  1531. return t(n) }
  1532. if (!e.length) return t();
  1533. var i = function(e) {
  1534. return function(n) {
  1535. if (n) t.apply(null, arguments), t = function() {};
  1536. else {
  1537. var a = Array.prototype.slice.call(arguments, 1),
  1538. o = e.next();
  1539. o ? a.push(i(o)) : a.push(t), r.setImmediate(function() { e.apply(null, a) }) } } };
  1540. i(r.iterator(e))() };
  1541. var y = function(e, t, n) {
  1542. if (n = n || function() {}, t.constructor === Array) e.map(t, function(e, t) { e && e(function(e) {
  1543. var n = Array.prototype.slice.call(arguments, 1);
  1544. n.length <= 1 && (n = n[0]), t.call(null, e, n) }) }, n);
  1545. else {
  1546. var i = {};
  1547. e.each(u(t), function(e, n) { t[e](function(t) {
  1548. var a = Array.prototype.slice.call(arguments, 1);
  1549. a.length <= 1 && (a = a[0]), i[e] = a, n(t) }) }, function(e) { n(e, i) }) } };
  1550. r.parallel = function(e, t) { y({ map: r.map, each: r.each }, e, t) }, r.parallelLimit = function(e, t, n) { y({ map: m(t), each: c(t) }, e, n) }, r.series = function(e, t) {
  1551. if (t = t || function() {}, e.constructor === Array) r.mapSeries(e, function(e, t) { e && e(function(e) {
  1552. var n = Array.prototype.slice.call(arguments, 1);
  1553. n.length <= 1 && (n = n[0]), t.call(null, e, n) }) }, t);
  1554. else {
  1555. var n = {};
  1556. r.eachSeries(u(e), function(t, i) { e[t](function(e) {
  1557. var a = Array.prototype.slice.call(arguments, 1);
  1558. a.length <= 1 && (a = a[0]), n[t] = a, i(e) }) }, function(e) { t(e, n) }) } }, r.iterator = function(e) {
  1559. var t = function(n) {
  1560. var i = function() {
  1561. return e.length && e[n].apply(null, arguments), i.next() };
  1562. return i.next = function() {
  1563. return n < e.length - 1 ? t(n + 1) : null }, i };
  1564. return t(0) }, r.apply = function(e) {
  1565. var t = Array.prototype.slice.call(arguments, 1);
  1566. return function() {
  1567. return e.apply(null, t.concat(Array.prototype.slice.call(arguments))) } };
  1568. var w = function(e, t, n, i) {
  1569. var a = [];
  1570. e(t, function(e, t) { n(e, function(e, n) { a = a.concat(n || []), t(e) }) }, function(e) { i(e, a) }) };
  1571. r.concat = d(w), r.concatSeries = h(w), r.whilst = function(e, t, n) { e() ? t(function(i) {
  1572. return i ? n(i) : void r.whilst(e, t, n) }) : n() }, r.doWhilst = function(e, t, n) { e(function(i) {
  1573. return i ? n(i) : void(t() ? r.doWhilst(e, t, n) : n()) }) }, r.until = function(e, t, n) { e() ? n() : t(function(i) {
  1574. return i ? n(i) : void r.until(e, t, n) }) }, r.doUntil = function(e, t, n) { e(function(i) {
  1575. return i ? n(i) : void(t() ? n() : r.doUntil(e, t, n)) }) }, r.queue = function(t, n) {
  1576. function i(e, t, i, a) { t.constructor !== Array && (t = [t]), o(t, function(t) {
  1577. var o = { data: t, callback: "function" == typeof a ? a : null };
  1578. i ? e.tasks.unshift(o) : e.tasks.push(o), e.saturated && e.tasks.length === n && e.saturated(), r.setImmediate(e.process) }) }
  1579. void 0 === n && (n = 1);
  1580. var a = 0,
  1581. l = { tasks: [], concurrency: n, saturated: null, empty: null, drain: null, push: function(e, t) { i(l, e, !1, t) }, unshift: function(e, t) { i(l, e, !0, t) }, process: function() {
  1582. if (a < l.concurrency && l.tasks.length) {
  1583. var n = l.tasks.shift();
  1584. l.empty && 0 === l.tasks.length && l.empty(), a += 1;
  1585. var i = function() { a -= 1, n.callback && n.callback.apply(n, arguments), l.drain && l.tasks.length + a === 0 && l.drain(), l.process() },
  1586. r = e(i);
  1587. t(n.data, r) } }, length: function() {
  1588. return l.tasks.length }, running: function() {
  1589. return a } };
  1590. return l }, r.cargo = function(e, t) {
  1591. var n = !1,
  1592. i = [],
  1593. a = { tasks: i, payload: t, saturated: null, empty: null, drain: null, push: function(e, n) { e.constructor !== Array && (e = [e]), o(e, function(e) { i.push({ data: e, callback: "function" == typeof n ? n : null }), a.saturated && i.length === t && a.saturated() }), r.setImmediate(a.process) }, process: function s() {
  1594. if (!n) {
  1595. if (0 === i.length) return void(a.drain && a.drain());
  1596. var r = "number" == typeof t ? i.splice(0, t) : i.splice(0),
  1597. u = l(r, function(e) {
  1598. return e.data });
  1599. a.empty && a.empty(), n = !0, e(u, function() { n = !1;
  1600. var e = arguments;
  1601. o(r, function(t) { t.callback && t.callback.apply(null, e) }), s() }) } }, length: function() {
  1602. return i.length }, running: function() {
  1603. return n } };
  1604. return a };
  1605. var E = function(e) {
  1606. return function(t) {
  1607. var n = Array.prototype.slice.call(arguments, 1);
  1608. t.apply(null, n.concat([function(t) {
  1609. var n = Array.prototype.slice.call(arguments, 1); "undefined" != typeof console && (t ? console.error && console.error(t) : console[e] && o(n, function(t) { console[e](t) })) }])) } };
  1610. r.log = E("log"), r.dir = E("dir"), r.memoize = function(e, t) {
  1611. var n = {},
  1612. i = {};
  1613. t = t || function(e) {
  1614. return e };
  1615. var a = function() {
  1616. var a = Array.prototype.slice.call(arguments),
  1617. r = a.pop(),
  1618. o = t.apply(null, a);
  1619. o in n ? r.apply(null, n[o]) : o in i ? i[o].push(r) : (i[o] = [r], e.apply(null, a.concat([function() { n[o] = arguments;
  1620. var e = i[o];
  1621. delete i[o];
  1622. for (var t = 0, a = e.length; a > t; t++) e[t].apply(null, arguments) }]))) };
  1623. return a.memo = n, a.unmemoized = e, a }, r.unmemoize = function(e) {
  1624. return function() {
  1625. return (e.unmemoized || e).apply(null, arguments) } }, r.times = function(e, t, n) {
  1626. for (var i = [], a = 0; e > a; a++) i.push(a);
  1627. return r.map(i, t, n) }, r.timesSeries = function(e, t, n) {
  1628. for (var i = [], a = 0; e > a; a++) i.push(a);
  1629. return r.mapSeries(i, t, n) }, r.compose = function() {
  1630. var e = Array.prototype.reverse.call(arguments);
  1631. return function() {
  1632. var t = this,
  1633. n = Array.prototype.slice.call(arguments),
  1634. i = n.pop();
  1635. r.reduce(e, n, function(e, n, i) { n.apply(t, e.concat([function() {
  1636. var e = arguments[0],
  1637. t = Array.prototype.slice.call(arguments, 1);
  1638. i(e, t) }])) }, function(e, n) { i.apply(t, [e].concat(n)) }) } };
  1639. var x = function(e, t) {
  1640. var n = function() {
  1641. var n = this,
  1642. i = Array.prototype.slice.call(arguments),
  1643. a = i.pop();
  1644. return e(t, function(e, t) { e.apply(n, i.concat([t])) }, a) };
  1645. if (arguments.length > 2) {
  1646. var i = Array.prototype.slice.call(arguments, 2);
  1647. return n.apply(this, i) }
  1648. return n };
  1649. r.applyEach = d(x), r.applyEachSeries = h(x), r.forever = function(e, t) {
  1650. function n(i) {
  1651. if (i) {
  1652. if (t) return t(i);
  1653. throw i }
  1654. e(n) }
  1655. n() }, i.async = r;
  1656. i.equiv = function() {
  1657. var e, i = [],
  1658. a = function() {
  1659. function n(e, t) {
  1660. return e instanceof t.constructor || t instanceof e.constructor ? t == e : t === e }
  1661. return { string: n, "boolean": n, number: n, "null": n, undefined: n, nan: function(e) {
  1662. return isNaN(e) }, date: function(e, n) {
  1663. return "date" === t(e) && n.valueOf() === e.valueOf() }, regexp: function(e, n) {
  1664. return "regexp" === t(e) && n.source === e.source && n.global === e.global && n.ignoreCase === e.ignoreCase && n.multiline === e.multiline }, "function": function() {
  1665. var e = i[i.length - 1];
  1666. return e !== Object && "undefined" != typeof e }, array: function(n, i) {
  1667. var a, r;
  1668. if ("array" !== t(n)) return !1;
  1669. if (r = i.length, r !== n.length) return !1;
  1670. for (a = 0; r > a; a++)
  1671. if (!e(i[a], n[a])) return !1;
  1672. return !0 }, object: function(t, n) {
  1673. var a, r = !0,
  1674. o = [],
  1675. l = [];
  1676. if (n.constructor !== t.constructor) return !1;
  1677. i.push(n.constructor);
  1678. for (a in n) o.push(a), e(n[a], t[a]) || (r = !1);
  1679. i.pop();
  1680. for (a in t) l.push(a);
  1681. return r && e(o.sort(), l.sort()) } } }();
  1682. return e = function() {
  1683. var e = Array.prototype.slice.apply(arguments);
  1684. return e.length < 2 ? !0 : function(e, i) {
  1685. return e === i ? !0 : null === e || null === i || "undefined" == typeof e || "undefined" == typeof i || t(e) !== t(i) ? !1 : n(e, a, [i, e]) }(e[0], e[1]) && arguments.callee.apply(this, e.splice(1, e.length - 1)) } }() }(), t.MARKER_CLASS_CONTROL_FIELD = "alpaca-marker-control-field", t.MARKER_CLASS_CONTAINER_FIELD = "alpaca-marker-container-field", t.MARKER_CLASS_CONTAINER_FIELD_ITEM = "alpaca-marker-control-field-item", t.MARKER_DATA_CONTAINER_FIELD_ITEM_KEY = "data-alpaca-container-field-item-key", t.MARKER_CLASS_FORM_ITEMS_FIELD = "alpaca-marker-form-items-field", t.CLASS_CONTAINER = "alpaca-container", t.CLASS_CONTROL = "alpaca-control", t.MARKER_CLASS_INSERT = "alpaca-marker-insert", t.MARKER_DATA_INSERT_KEY = "data-alpaca-marker-insert-key", t.MARKER_CLASS_ARRAY_TOOLBAR = "alpaca-marker-array-field-toolbar", t.MARKER_DATA_ARRAY_TOOLBAR_FIELD_ID = "data-alpaca-array-field-toolbar-field-id", t.MARKER_CLASS_ARRAY_ITEM_ACTIONBAR = "alpaca-marker-array-field-item-actionbar", t.MARKER_DATA_ARRAY_ITEM_KEY = "data-alpaca-marker-array-field-item-key", t.MARKER_DATA_ARRAY_ITEM_PARENT_FIELD_ID = "data-alpaca-marker-array-field-item-parent-field-id", t.MARKER_CLASS_CONTAINER_FIELD_ITEM_FIELD = "alpaca-marker-container-field-item-field", t.makeCacheKey = function(e, t, n, i) {
  1686. return e + ":" + t + ":" + n + ":" + i }, t.splitCacheKey = function(e) {
  1687. var t = {},
  1688. n = e.indexOf(":"),
  1689. i = e.lastIndexOf(":");
  1690. t.viewId = e.substring(0, n), t.templateId = e.substring(i + 1);
  1691. var a = e.substring(n + 1, i),
  1692. r = a.indexOf(":");
  1693. return t.scopeType = a.substring(0, r), t.scopeId = a.substring(r + 1), t }, t.createEmptyDataInstance = function(e) {
  1694. return e ? "object" === e.type ? {} : "array" === e.type ? [] : "number" === e.type ? -1 : "boolean" === e.type ? !1 : "" : "" }, t.animatedSwap = function(t, n, i, a) { "function" == typeof i && (a = i, i = 500);
  1695. var r = function(t, n, i, a) {
  1696. var r = e(t),
  1697. o = e(n),
  1698. l = r.offset(),
  1699. s = o.offset(),
  1700. u = r.clone(),
  1701. c = o.clone(),
  1702. d = s.top + o.height() - l.top,
  1703. p = 0,
  1704. h = 0,
  1705. f = s.left + o.width() - l.left,
  1706. m = 0,
  1707. g = 0;
  1708. r.css("opacity", 0), o.css("opacity", 0), u.insertAfter(r).css({ position: "absolute", width: r.outerWidth(), height: r.outerHeight() }).offset(l).css("z-index", "999"), c.insertAfter(o).css({ position: "absolute", width: o.outerWidth(), height: o.outerHeight() }).offset(s).css("z-index", "999"), l.top !== s.top && (p = d - r.height()), h = d - o.height(), l.left !== s.left && (m = f - r.width()), g = f - o.width(), u.animate({ top: "+=" + p + "px", left: "+=" + m + "px" }, i, function() { o.css("opacity", 1), e(this).remove() }), c.animate({ top: "-=" + h + "px", left: "-=" + g + "px" }, i, function() { r.css("opacity", 1), e(this).remove() }), window.setTimeout(function() { u.remove(), c.remove(), a() }, i + 1) };
  1709. r(t, n, i, a) }, t.animatedMove = function(t, n, i, a) { "function" == typeof i && (a = i, i = 500);
  1710. var r = function(t, n, i, a) {
  1711. var r = e(t),
  1712. o = e(n),
  1713. l = r.offset(),
  1714. s = o.offset(),
  1715. u = r.clone(),
  1716. c = s.top + o.height() - l.top,
  1717. d = 0,
  1718. p = 0,
  1719. h = s.left + o.width() - l.left,
  1720. f = 0,
  1721. m = 0;
  1722. r.css("opacity", 0), o.css("opacity", 0), u.insertAfter(r).css({ position: "absolute", width: r.outerWidth(), height: r.outerHeight() }).offset(l).css("z-index", "999"), l.top !== s.top && (d = c - r.height()), p = c - o.height(), l.left !== s.left && (f = h - r.width()), m = h - o.width(), u.animate({ top: "+=" + d + "px", left: "+=" + f + "px" }, i, function() { o.css("opacity", 1), e(this).remove() }), window.setTimeout(function() { u.remove(), a() }, i + 1) };
  1723. r(t, n, i, a) }, t.fireReady = function(e) {
  1724. if (e.children && e.children.length > 0)
  1725. for (var n = 0; n < e.children.length; n++) t.fireReady(e.children[n]);
  1726. e.trigger("ready") }, t.readCookie = function(e) {
  1727. function t(e) {
  1728. for (var t = e + "=", n = document.cookie.split(";"), i = 0; i < n.length; i++) {
  1729. for (var a = n[i];
  1730. " " == a.charAt(0);) a = a.substring(1, a.length);
  1731. if (0 == a.indexOf(t)) return a.substring(t.length, a.length) }
  1732. return null }
  1733. var n = null;
  1734. return "undefined" != typeof document && (n = t(e)), n }, t.safeSetObjectArray = function(e, t, n) { "undefined" == typeof e[t] || null === e[t] ? e[t] = [] : e[t].length = 0;
  1735. for (var i = 0; i < n.length; i++) e[t].push(n[i]) }, t.inArray = function(t, n) {
  1736. return e.inArray(n, t) > -1 }, t.indexOf = function(t, n) {
  1737. return e.inArray(n, t) }, t.moment = function() {
  1738. if (t._moment || window.moment && (t._moment = window.moment), !t._moment) throw new Error("The moment.js library has not been included, cannot produce moment object");
  1739. return t._moment.call(this, arguments) }, t.CSRF_TOKEN = null, t.CSRF_COOKIE_NAMES = ["CSRF-TOKEN", "XSRF-TOKEN"], t.CSRF_HEADER_NAME = "X-CSRF-TOKEN", t.defaultToolbarSticky = void 0, t.showReadOnlyInvalidState = !1
  1740. }(jQuery),
  1741. function(e) {
  1742. var t = e.alpaca;
  1743. t.listenerId = function() {
  1744. var e = 0;
  1745. return function() {
  1746. return "listener-" + e++ } }(), t.subscribe = function() {
  1747. var e = t.makeArray(arguments),
  1748. n = null,
  1749. i = null,
  1750. a = null;
  1751. if (2 == e.length ? (n = "global", i = e.shift(), a = e.shift()) : (n = e.shift(), i = e.shift(), a = e.shift()), i && t.isObject(i) && (i = i.path), !i) return t.logError("Missing observable subscribe id: " + i), null;
  1752. var r = a._lfid;
  1753. r || (r = t.listenerId(), a._lfid = r);
  1754. var o = function(e) {
  1755. return function() {
  1756. return a.apply(e, arguments) } }(this);
  1757. o._lfid = a._lfid;
  1758. var l = t.ScopedObservables.get(n),
  1759. s = l.observable(i);
  1760. return s.subscribe(r, o), { scope: n, id: i, listenerId: r } }, t.unsubscribe = function() {
  1761. var e = t.makeArray(arguments),
  1762. n = null,
  1763. i = null,
  1764. a = null;
  1765. 2 == e.length ? (n = "global", i = e.shift(), a = e.shift()) : 3 == e.length && (n = e.shift(), i = e.shift(), a = e.shift());
  1766. var r = a;
  1767. if (t.isFunction(r) && (r = r._lfid), i && t.isObject(i) && (i = i.path), !i) return t.logError("Missing observable id: " + i), null;
  1768. var o = t.ScopedObservables.get(n),
  1769. l = o.observable(i);
  1770. return l.unsubscribe(r), { scope: n, id: i, listenerId: r } }, t.observable = function() {
  1771. var e, n, i = t.makeArray(arguments);
  1772. if (1 == i.length ? (e = "global", n = i.shift()) : 2 == i.length && (e = i.shift(), n = i.shift()), n && t.isObject(n) && (n = n.path), n) {
  1773. var a = t.ScopedObservables.get(e);
  1774. observable = a.observable(n) } else t.logError("Missing observable id: " + JSON.stringify(i));
  1775. return observable }, t.clearObservable = function() {
  1776. var e, n, i = t.makeArray(arguments);
  1777. 1 == i.length ? (e = "global", n = i.shift()) : 2 == i.length && (e = i.shift(), n = i.shift()), n && t.isObject(n) && (n = n.path), n || t.logError("Missing observable id: " + JSON.stringify(i));
  1778. var a = t.ScopedObservables.get(e),
  1779. r = a.observable(n);
  1780. r.clear() }, t.dependentObservable = function() {
  1781. var e = null,
  1782. n = null,
  1783. i = null,
  1784. a = t.makeArray(arguments);
  1785. if (2 == a.length) e = "global", n = a.shift(), i = a.shift();
  1786. else {
  1787. if (3 != a.length) return void t.error("Wrong number of arguments");
  1788. e = a.shift(), n = a.shift(), i = a.shift() }
  1789. n && t.isObject(n) && (n = n.path), n || t.logError("Missing observable id: " + JSON.stringify(a));
  1790. var r = t.ScopedObservables.get(e);
  1791. return r.dependentObservable(n, i) } }(jQuery),
  1792. function(e) {
  1793. var t = e.alpaca;
  1794. t.Observables = Base.extend({
  1795. constructor: function(e) { this.base(), this.scope = e, this.observables = {} },
  1796. observable: function(e, n) {
  1797. if (!this.observables[e]) {
  1798. var i = new t.Observable(this.scope, e);
  1799. n && i.set(n), this.observables[e] = i }
  1800. return this.observables[e] },
  1801. dependentObservable: function(e, n) {
  1802. var i = this;
  1803. if (!this.observables[e]) {
  1804. var a = this.observable(e),
  1805. r = new t.Observables(this.scope);
  1806. r.observable = function(e, t) {
  1807. var n = i.observable(e, t);
  1808. return n.markDependentOnUs(a), n };
  1809. var o = function() {
  1810. return n.call(r) };
  1811. a.setValueFunction(o)
  1812. }
  1813. return this.observables[e]
  1814. },
  1815. observables: function() {
  1816. return this.observables }
  1817. })
  1818. }(jQuery),
  1819. function(e) {
  1820. var t = e.alpaca;
  1821. t.Observable = Base.extend({ constructor: function(t, n) { this.base(), this.id = t + "-" + n, this.value = null, this.subscribers = {}, this.dependentOnUs = {}, this.notifySubscribers = function(t) {
  1822. var n = this;
  1823. e.each(this.subscribers, function(e, i) { i(n.value, t) }) }, this.notifyDependents = function(t) { e.each(this.dependentOnUs, function(e, t) { t.onDependencyChange() }) }, this.valueFunction = null }, setValueFunction: function(e) { this.valueFunction = e, this.onDependencyChange() }, subscribe: function(e, t) { this.isSubscribed(e) || (this.subscribers[e] = t) }, unsubscribe: function(e) { delete this.subscribers[e] }, isSubscribed: function(e) {
  1824. return !!this.subscribers[e] }, markDependentOnUs: function(e) { this.dependentOnUs[e.id] = e }, onDependencyChange: function() {
  1825. var e = this.get();
  1826. if (this.valueFunction) {
  1827. var t = this.valueFunction();
  1828. e != t && this.set(t) } }, set: function(e) {
  1829. var t = this.value;
  1830. this.value = e, this.notifyDependents(t), this.notifySubscribers(t) }, get: function(e) {
  1831. var t = this.value;
  1832. return t || (t = e), t }, clear: function() {
  1833. var e = this.value;
  1834. delete this.value, this.notifyDependents(e), this.notifySubscribers(e) } }) }(jQuery),
  1835. function(e) {
  1836. var t = e.alpaca;
  1837. t.ScopedObservables = {}, t.ScopedObservables.map = {}, t.ScopedObservables.get = function(e) {
  1838. return t.ScopedObservables.map[e] || (t.ScopedObservables.map[e] = new t.Observables(e)), t.ScopedObservables.map[e] } }(jQuery),
  1839. function() { Alpaca.TemplateEngineRegistry = function() {
  1840. var e = {};
  1841. return { register: function(t, n) { e[t] = n, n.init() }, find: function(t) {
  1842. var n = null;
  1843. if (e[t]) n = e[t];
  1844. else
  1845. for (var i in e)
  1846. for (var a = e[i].supportedMimetypes(), r = 0; r < a.length; r++)
  1847. if (t.toLowerCase() === a[r].toLowerCase()) { n = e[i];
  1848. break } return n }, ids: function() {
  1849. var t = [];
  1850. for (var n in e) t.push(n);
  1851. return t } } }() }(),
  1852. function(e) { Alpaca.AbstractTemplateEngine = Base.extend({ constructor: function(t) { this.base(), this.id = t, this.cleanup = function(t) {
  1853. return t && 1 === e(t).length && "script" === e(t)[0].nodeName.toLowerCase() ? e(t).html() : t } }, compile: function(t, n, i) {
  1854. var a = this,
  1855. r = "html";
  1856. if (Alpaca.isString(n)) {
  1857. var o = n.toLowerCase();
  1858. Alpaca.isUri(o) ? r = "uri" : 0 !== n.indexOf("#") && 0 !== n.indexOf(".") && 0 !== n.indexOf("[") || (r = "selector") }
  1859. if ("selector" === r) a._compile(t, n, function(e) { i(e) });
  1860. else if ("uri" === r) {
  1861. var l = a.fileExtension(),
  1862. s = n; - 1 === s.indexOf("." + l) && (s += "." + l), e.ajax({ url: s, dataType: "html", success: function(e, n, r) { e = a.cleanup(e), a._compile(t, e, function(e) { i(e) }) }, error: function(e, t) { i({ message: e.responseText, xhr: e, code: t }, null) } }) } else if ("html" === r) {
  1863. var u = n;
  1864. u instanceof jQuery && (u = e(u).outerHTML()), a._compile(t, u, function(e) { i(e) }) } else i(new Error("Template engine cannot determine how to handle type: " + r)) }, _compile: function(e, t, n) { Alpaca.isEmpty(t) && (t = ""), t = Alpaca.trim(t), 0 === t.toLowerCase().indexOf("<script") || (t = "<script type='" + this.supportedMimetypes()[0] + "'>" + t + "</script>"), Alpaca.logDebug("Compiling template: " + this.id + ", cacheKey: " + e + ", template: " + t), this.doCompile(e, t, n) }, doCompile: function(e, t, n) {}, execute: function(e, t, n) { Alpaca.logDebug("Executing template for cache key: " + e);
  1865. var i = this.doExecute(e, t, n);
  1866. return i = this.cleanup(i) }, doExecute: function(e, t, n) {
  1867. return null }, fileExtension: function() {
  1868. return "html" }, supportedMimetypes: function() {
  1869. return [] }, isCached: function(e) {
  1870. return !1 }, findCacheKeys: function(e) {
  1871. return [] } }) }(jQuery),
  1872. function($, Handlebars, HandlebarsPrecompiled) {
  1873. var COMPILED_TEMPLATES = {},
  1874. helpers = {};
  1875. helpers.compare = function(e, t, n) {
  1876. if (arguments.length < 3) throw new Error("Handlerbars Helper 'compare' needs 2 parameters");
  1877. var i = n.hash.operator || "==",
  1878. a = { "==": function(e, t) {
  1879. return e == t }, "===": function(e, t) {
  1880. return e === t }, "!=": function(e, t) {
  1881. return e != t }, "!==": function(e, t) {
  1882. return e !== t }, "<": function(e, t) {
  1883. return t > e }, ">": function(e, t) {
  1884. return e > t }, "<=": function(e, t) {
  1885. return t >= e }, ">=": function(e, t) {
  1886. return e >= t }, "typeof": function(e, t) {
  1887. return typeof e == t } };
  1888. if (!a[i]) throw new Error("Handlerbars Helper 'compare' doesn't know the operator " + i);
  1889. var r = a[i](e, t);
  1890. return r ? n.fn(this) : n.inverse(this) }, helpers.ifnot = function(e, t) {
  1891. return e ? t.inverse(this) : t.fn(this) }, helpers.times = function(e, t) {
  1892. for (var n = "", i = 0; e > i; ++i) n += t.fn(i);
  1893. return n }, helpers.control = function(e) {
  1894. return "<div class='" + Alpaca.MARKER_CLASS_CONTROL_FIELD + "'></div>" }, helpers.container = function(e) {
  1895. return "<div class='" + Alpaca.MARKER_CLASS_CONTAINER_FIELD + "'></div>" }, helpers.item = function(e, t) {
  1896. return Alpaca.isObject(e) && (t = e, e = "div"), "<" + e + " class='" + Alpaca.MARKER_CLASS_CONTAINER_FIELD_ITEM + "' " + Alpaca.MARKER_DATA_CONTAINER_FIELD_ITEM_KEY + "='" + this.name + "'></" + e + ">" }, helpers.itemField = function(e, t) {
  1897. return Alpaca.isObject(e) && (t = e, e = "div"), "<" + e + " class='" + Alpaca.MARKER_CLASS_CONTAINER_FIELD_ITEM_FIELD + "'></" + e + ">" }, helpers.formItems = function(e) {
  1898. return "<div class='" + Alpaca.MARKER_CLASS_FORM_ITEMS_FIELD + "'></div>" }, helpers.insert = function(e) {
  1899. return "<div class='" + Alpaca.MARKER_CLASS_INSERT + "' " + Alpaca.MARKER_DATA_INSERT_KEY + "='" + e + "'></div>" }, helpers.str = function(e) {
  1900. return e === !1 ? "false" : e === !0 ? "true" : 0 === e ? "0" : "undefined" == typeof e ? "" : null === e ? "" : Alpaca.isString(e) ? e : Alpaca.isNumber(e) ? e : Alpaca.isObject(e) ? JSON.stringify(e, null, " ") : Alpaca.isArray(e) ? JSON.stringify(e, null, " ") : e }, helpers.arrayToolbar = function(e) {
  1901. return "<div class='" + Alpaca.MARKER_CLASS_ARRAY_TOOLBAR + "' " + Alpaca.MARKER_DATA_ARRAY_TOOLBAR_FIELD_ID + "='" + this.id + "'></div>" }, helpers.arrayActionbar = function(e) {
  1902. return "<div class='" + Alpaca.MARKER_CLASS_ARRAY_ITEM_ACTIONBAR + "' " + Alpaca.MARKER_DATA_ARRAY_ITEM_KEY + "='" + this.name + "' " + Alpaca.MARKER_DATA_ARRAY_ITEM_PARENT_FIELD_ID + "='" + this.parentFieldId + "'></div>" }, Handlebars.registerHelper("arrayToolbar", helpers.arrayToolbar), Handlebars.registerHelper("arrayActionbar", helpers.arrayActionbar), Handlebars.registerHelper("setIndex", function(e) { this.index = Number(e) }), Handlebars.registerHelper("eachProperty", function(e, t) {
  1903. var n = "";
  1904. for (var i in e) n += t.fn({ key: i, value: e[i] });
  1905. return n }), Handlebars.registerHelper("uploadErrorMessage", function(e) {
  1906. var t = e;
  1907. return 1 === e ? t = "File exceeds upload_max_filesize" : 2 === e ? t = "File exceeds MAX_FILE_SIZE" : 3 === e ? t = "File was only partially uploaded" : 4 === e ? t = "No File was uploaded" : 5 === e ? t = "Missing a temporary folder" : 6 === e ? t = "Failed to write file to disk" : 7 === e ? t = "File upload stopped by extension" : "maxFileSize" === e ? t = "File is too big" : "minFileSize" === e ? t = "File is too small" : "acceptFileTypes" === e ? t = "Filetype not allowed" : "maxNumberOfFiles" === e ? t = "Max number of files exceeded" : "uploadedBytes" === e ? t = "Uploaded bytes exceed file size" : "emptyResult" === e && (t = "Empty file upload result"), t }), Handlebars.registerHelper("disguise", function(e, t) {
  1908. for (var n = "", i = 0; i < e.length; i++) n += t;
  1909. return n }), Handlebars.registerHelper("compare", helpers.compare), Handlebars.registerHelper("control", helpers.control), Handlebars.registerHelper("container", helpers.container), Handlebars.registerHelper("item", helpers.item), Handlebars.registerHelper("itemField", helpers.itemField), Handlebars.registerHelper("formItems", helpers.formItems), Handlebars.registerHelper("times", helpers.times), Handlebars.registerHelper("str", helpers.str), Handlebars.registerHelper("with", function(e, t) {
  1910. return t.fn(e) }), Handlebars.registerHelper("ifnot", helpers.ifnot);
  1911. var partials = {};
  1912. Alpaca.HandlebarsTemplateEngine = Alpaca.AbstractTemplateEngine.extend({ fileExtension: function() {
  1913. return "html" }, supportedMimetypes: function() {
  1914. return ["text/x-handlebars-template", "text/x-handlebars-tmpl"] }, init: function() {
  1915. if (HandlebarsPrecompiled)
  1916. for (var e in HandlebarsPrecompiled) {
  1917. var t = HandlebarsPrecompiled[e];
  1918. for (var n in t) {
  1919. var i = t[n];
  1920. if ("function" == typeof i) {
  1921. var a = Alpaca.makeCacheKey(e, "view", e, n);
  1922. COMPILED_TEMPLATES[a] = i } } } }, doCompile: function(cacheKey, html, callback) {
  1923. var self = this,
  1924. template = null;
  1925. try {
  1926. var functionString = Handlebars.precompile(html);
  1927. template = eval("(" + functionString + ")"), template = Handlebars.template(template), COMPILED_TEMPLATES[cacheKey] = template } catch (e) {
  1928. return void callback(e) }
  1929. callback() }, doExecute: function(e, t, n) {
  1930. var i = COMPILED_TEMPLATES[e];
  1931. if (!i) return void n(new Error("Could not find handlebars cached template for key: " + e));
  1932. var a = null;
  1933. try { a = i(t) } catch (r) {
  1934. return n(r), null }
  1935. return a }, isCached: function(e) {
  1936. return !!COMPILED_TEMPLATES[e] }, findCacheKeys: function(e) {
  1937. var t = [];
  1938. for (var n in COMPILED_TEMPLATES) 0 === n.indexOf(e + ":") && t.push(n);
  1939. return t } }), Alpaca.TemplateEngineRegistry.register("handlebars", new Alpaca.HandlebarsTemplateEngine("handlebars")) }(jQuery, "undefined" != typeof Handlebars ? Handlebars : window.Handlebars, "undefined" != typeof HandlebarsPrecompiled ? HandlebarsPrecompiled : window.HandlebarsPrecompiled),
  1940. function(e) {
  1941. var t = e.alpaca;
  1942. t.NormalizedView = Base.extend({ constructor: function(e) { this.id = e }, normalize: function(e) {
  1943. var n = e[this.id];
  1944. if (!n) return t.logError("View compilation failed - view not found: " + this.id), !1;
  1945. for (var i = [], a = n; a;) { i.push(a);
  1946. var r = a.parent;
  1947. if (r) {
  1948. var o = e[a.parent];
  1949. if (!o) return t.logError("View compilation failed - cannot find parent view: " + r + " for view: " + a.id), !1;
  1950. a = o } else a = null }
  1951. i = i.reverse();
  1952. for (var l = function(e, n, i) {
  1953. var a = n[i],
  1954. r = e[i];
  1955. t.isUndefined(r) || t.isUndefined(a) || t.logDebug("View property: " + i + " already has value: " + r + " and overwriting to: " + a), t.isUndefined(a) || (e[i] = a) }, s = function(e, n, i) {
  1956. var a = n[i],
  1957. r = e[i];
  1958. t.isUndefined(r) || t.isUndefined(a) || t.logDebug("View property: " + i + " already has function, overwriting"), t.isUndefined(a) || (e[i] = a) }, u = function(e, n, i) {
  1959. var a = n[i];
  1960. a && (e[i] || (e[i] = {}), t.mergeObject2(a, e[i])) }, c = 0; c < i.length; c++) {
  1961. var d = i[c];
  1962. l(this, d, "type"), l(this, d, "ui"), l(this, d, "displayReadonly"), l(this, d, "locale"), s(this, d, "render"), s(this, d, "postRender"), u(this, d, "templates"), u(this, d, "fields"), u(this, d, "layout"), u(this, d, "styles"), u(this, d, "callbacks"), u(this, d, "messages"), l(this, d, "horizontal"), l(this, d, "collapsible"), l(this, d, "legendStyle"), l(this, d, "toolbarStyle"), l(this, d, "buttonStyle"), l(this, d, "toolbarSticky"), l(this, d, "globalTemplate"), u(this, d, "wizard") }
  1963. return t.logDebug("View compilation complete for view: " + this.id), t.logDebug("Final view: "), t.logDebug(JSON.stringify(this, null, " ")), !0 } }) }(jQuery),
  1964. function(e) {
  1965. var t = e.alpaca;
  1966. t.RuntimeView = Base.extend({ constructor: function(e, t) { this.field = t, this.setView(e) }, setView: function(e) { e || (e = "web-edit");
  1967. var n = t.getNormalizedView(e);
  1968. if (!n) throw new Error("Runtime view for view id: " + e + " could not find a normalized view");
  1969. for (var i in n) n.hasOwnProperty(i) && (this[i] = n[i]) }, getWizard: function() {
  1970. return this.getViewParam("wizard") }, getGlobalTemplateDescriptor: function() {
  1971. return this.getTemplateDescriptor("globalTemplate") }, getLayout: function() {
  1972. var e = this;
  1973. return { templateDescriptor: this.getTemplateDescriptor("layoutTemplate", e), bindings: this.getViewParam(["layout", "bindings"], !0) } }, getTemplateDescriptor: function(e, n) {
  1974. return t.getTemplateDescriptor(this, e, n) }, getMessage: function(e, n) { n || (n = t.defaultLocale);
  1975. var i = this.getViewParam(["messages", n, e]);
  1976. return t.isEmpty(i) && (i = this.getViewParam(["messages", e])), i }, getViewParam: function(e, n) {
  1977. var i = this.field.path;
  1978. if (this.fields && this.fields[i]) {
  1979. var a = this._getConfigVal(this.fields[i], e);
  1980. if (!t.isEmpty(a)) return a }
  1981. if (i && -1 !== i.indexOf("[") && -1 !== i.indexOf("]")) {
  1982. var r = i.replace(/\[\d+\]/g, "[*]");
  1983. if (this.fields && this.fields[r]) {
  1984. var a = this._getConfigVal(this.fields[r], e);
  1985. if (!t.isEmpty(a)) return a } }
  1986. if (i && -1 !== i.indexOf("[") && -1 !== i.indexOf("]")) {
  1987. var r = i.replace(/\[\d+\]/g, "");
  1988. if (this.fields && this.fields[r]) {
  1989. var a = this._getConfigVal(this.fields[r], e);
  1990. if (!t.isEmpty(a)) return a } }
  1991. return !t.isEmpty(n) && n && "/" !== this.field.path ? null : this._getConfigVal(this, e) }, _getConfigVal: function(e, n) {
  1992. if (t.isArray(n))
  1993. for (var i = 0; i < n.length && !t.isEmpty(e); i++) e = e[n[i]];
  1994. else t.isEmpty(e) || (e = e[n]);
  1995. return e }, fireCallback: function(e, t, n, i, a, r, o) { this.callbacks && this.callbacks[t] && this.callbacks[t].call(e, n, i, a, r, o) }, applyStyle: function(t, n) {
  1996. var i = n;
  1997. i && i.getFieldEl && (i = i.getFieldEl()), i && this.styles && this.styles[t] && e(i).addClass(this.styles[t]) }, getStyle: function(e) {
  1998. return this.styles[e] ? this.styles[e] : "" } }) }(jQuery),
  1999. function(e) {
  2000. var t = e.alpaca;
  2001. t.Field = Base.extend({
  2002. constructor: function(e, n, i, a, r, o, l) {
  2003. var s = this;
  2004. this.initializing = !0, this.domEl = e, this.parent = null, this.data = n, this.options = i, this.schema = a, this.connector = o, this.errorCallback = function(e) { l ? l(e) : t.defaultErrorCallback.call(s, e) }, this.singleLevelRendering = !1, this.view = new t.RuntimeView(r, this);
  2005. var u = !1;
  2006. this.options || (this.options = {}, u = !0), this.id = this.options.id, this.type = this.options.type, this.id || (this.id = t.generateId());
  2007. var c = !1;
  2008. if (this.schema || (this.schema = {}, c = !0), this.options.label || null === this.schema.title || (this.options.label = this.schema.title), this.options.helpers || (this.options.helpers = []), this.options.helper) {
  2009. if (t.isArray(this.options.helper))
  2010. for (var d = 0; d < this.options.helper.length; d++) this.options.helpers.push(this.options.helper[d]);
  2011. else this.options.helpers.push(this.options.helper);
  2012. delete this.options.helper }
  2013. t.isEmpty(this.options.readonly) && !t.isEmpty(this.schema.readonly) && (this.options.readonly = this.schema.readonly), t.isValEmpty(this.data) && !t.isEmpty(this.schema["default"]) && (this.data = this.schema["default"], this.showingDefaultData = !0), this.path = "/", this.validation = {}, this._events = {}, this.isDisplayOnly = function() {
  2014. return "view" === s.view.type || "display" == s.view.type }, this.schema && this.schema.id && 0 === this.schema.id.indexOf("#") && (this.schema.id = this.schema.id.substring(1)), this._previouslyValidated = !1, this.updateObservable = function() { this.data ? this.observable(this.path).set(this.data) : this.observable(this.path).clear() }, this.getObservableScope = function() {
  2015. for (var e = this; !e.isTop();) e = e.parent;
  2016. var t = e.observableScope;
  2017. return t || (t = "global"), t }, this.ensureProperType = function(e) {
  2018. var n = this,
  2019. i = function(e, n) {
  2020. return t.isString(e) ? "number" === n ? e = parseFloat(e) : "integer" === n ? e = parseInt(e) : "boolean" === n && (e = "" !== e && "false" !== e.toLowerCase()) : t.isNumber(e) && ("string" === n ? e = "" + e : "boolean" === n && (e = -1 !== e && 0 !== e)), e };
  2021. if ("undefined" != typeof e)
  2022. if (t.isArray(e))
  2023. for (var a = 0; a < e.length; a++) n.schema.items && n.schema.items.type && (e[a] = i(e[a], n.schema.items.type));
  2024. else(t.isString(e) || t.isNumber(e)) && n.schema.type && (e = i(e, n.schema.type));
  2025. return e }, this.onConstruct() },
  2026. onConstruct: function() {},
  2027. isTop: function() {
  2028. return !this.parent },
  2029. getTemplateDescriptorId: function() {
  2030. throw new Error("Template descriptor ID was not specified") },
  2031. initTemplateDescriptor: function() {
  2032. var e = this,
  2033. n = this.view.getTemplateDescriptor(this.getTemplateDescriptorId(), this),
  2034. i = this.view.getGlobalTemplateDescriptor(),
  2035. a = this.view.getLayout(),
  2036. r = !1;
  2037. this.isTop() && (i ? (this.setTemplateDescriptor(i), this.singleLevelRendering = !0, r = !0) : a && a.templateDescriptor && (this.setTemplateDescriptor(a.templateDescriptor), r = !0)), !r && n && this.setTemplateDescriptor(n);
  2038. var o = this.getTemplateDescriptor();
  2039. return o ? void 0 : t.throwErrorWithCallback("Unable to find template descriptor for field: " + e.getFieldType()) },
  2040. setup: function() { this.initializing || (this.data = this.getValue()), this.initTemplateDescriptor(), t.isUndefined(this.schema.required) && (this.schema.required = !1), t.isUndefined(this.options.validate) && (this.options.validate = !0), t.isUndefined(this.options.disabled) && (this.options.disabled = !1), t.isUndefined(this.options.showMessages) && (this.options.showMessages = !0) },
  2041. setupField: function(e) { e() },
  2042. on: function(e, n) {
  2043. return t.logDebug("Adding listener for event: " + e), this._events[e] || (this._events[e] = []), this._events[e].push(n), this },
  2044. off: function(e) { this._events[e] && (this._events[e].length = 0) },
  2045. triggerWithPropagation: function(e, t, n) {
  2046. if ("string" == typeof t && (n = t, t = null), n || (n = "up"), "up" === n) this.trigger.call(this, e, t), this.parent && this.parent.triggerWithPropagation.call(this.parent, e, t, n);
  2047. else if ("down" === n) {
  2048. if (this.children && this.children.length > 0)
  2049. for (var i = 0; i < this.children.length; i++) {
  2050. var a = this.children[i];
  2051. a.triggerWithPropagation.call(a, e, t, n) }
  2052. this.trigger.call(this, e, t) } else if ("both" === n) {
  2053. if (this.children && this.children.length > 0)
  2054. for (var i = 0; i < this.children.length; i++) {
  2055. var a = this.children[i];
  2056. a.triggerWithPropagation.call(a, e, t, "down") }
  2057. this.trigger.call(this, e, t), this.parent && this.parent.triggerWithPropagation.call(this.parent, e, t, "up") } },
  2058. trigger: function(e, n, i, a, r) {
  2059. var o = this._events[e];
  2060. if (o)
  2061. for (var l = 0; l < o.length; l++) {
  2062. var s = o[l],
  2063. u = null;
  2064. if ("function" == typeof s) { t.logDebug("Firing event: " + e);
  2065. try { u = s.call(this, n, i, a, r) } catch (c) { t.logDebug("The event handler caught an exception: " + e), t.logDebug(c) } } } },
  2066. bindData: function() { t.isEmpty(this.data) || this.setValue(this.data) },
  2067. render: function(e, n) {
  2068. var i = this;
  2069. e && (t.isString(e) || t.isObject(e)) ? this.view.setView(e) : t.isEmpty(n) && t.isFunction(e) && (n = e), null === this.options.label && this.propertyId && (this.options.label = this.propertyId), this.options.name && (this.name = this.options.name), this.calculateName(), this.setup(), this.setupField(function() { i._render(function() { i.trigger("render"), n() }) }) },
  2070. calculateName: function() {
  2071. if (!this.name || this.name && this.nameCalculated)
  2072. if (this.parent && this.parent.name && this.path) {
  2073. var e = this.path.substring(this.path.lastIndexOf("/") + 1); - 1 !== e.indexOf("[") && -1 !== e.indexOf("]") && (e = e.substring(e.indexOf("[") + 1, e.indexOf("]"))), e && (this.name = this.parent.name + "_" + e, this.nameCalculated = !0) } else this.path && (this.name = this.path.replace(/\//g, "").replace(/\[/g, "_").replace(/\]/g, ""), this.nameCalculated = !0) },
  2074. _render: function(n) {
  2075. var i = this;
  2076. if (i.options.form && t.isObject(i.options.form)) { i.options.form.viewType = this.view.type;
  2077. var a = i.form;
  2078. a || (a = new t.Form(i.domEl, this.options.form, i.view.id, i.connector, i.errorCallback)), a.render(function(a) {
  2079. var r = e("<div></div>");
  2080. i._processRender(r, function() { a.formFieldsContainer.before(i.field), a.formFieldsContainer.remove(), a.topControl = i, i.view.type && "view" !== i.view.type && a.initEvents(), i.form = a;
  2081. i.postRender(function() { i.initializing = !1, i.form.afterInitialize(), e(i.field).bind("destroyed", function(e) { i.form.destroy() }), n && t.isFunction(n) && n(i) }) }) }) } else this._processRender(i.domEl, function() { i.postRender(function() { i.initializing = !1, n && t.isFunction(n) && n(i) }) }) },
  2082. _processRender: function(e, t) {
  2083. var n = this;
  2084. n.renderField(e, function() { n.fireCallback("field"), n.renderFieldElements(function() { t() }) }) },
  2085. renderFieldDomElement: function(e) {
  2086. var n = this.getTemplateDescriptor();
  2087. return t.tmpl(n, { id: this.getId(), options: this.options, schema: this.schema, data: e, view: this.view, path: this.path, name: this.name }) },
  2088. renderField: function(t, n) {
  2089. var i = this,
  2090. a = this.data;
  2091. this.isDisplayOnly() && "object" == typeof a && (a = JSON.stringify(a));
  2092. var r = i.renderFieldDomElement(a);
  2093. if (e(r).length > 0) {
  2094. for (var o = null, l = 0; l < e(r).length; l++) {
  2095. var s = e(r)[l].nodeName;
  2096. if (s && (s = s.toLowerCase(), "div" === s || "span" === s)) { o = e(e(r)[l]);
  2097. break } }
  2098. o || (o = e(e(r).last())), o && (r = o) }
  2099. this.field = r, this.field.appendTo(t), n() },
  2100. renderFieldElements: function(e) { e() },
  2101. updateDOMElement: function() { this.field.attr("data-alpaca-field-path", this.getPath()), this.field.attr("data-alpaca-field-name", this.getName()), this.field.removeAttr("name") },
  2102. postRender: function(n) {
  2103. var i = this;
  2104. if (this.field.addClass("alpaca-field"), this.field.addClass("alpaca-field-" + this.getFieldType()), this.field.attr("data-alpaca-field-id", this.getId()), this.updateDOMElement(), "view" !== this.view.type) { this.isRequired() ? (e(this.field).addClass("alpaca-required"), i.fireCallback("required")) : (e(this.field).addClass("alpaca-optional"), i.fireCallback("optional"));
  2105. var a = function() { t.disabled(e("input", i.field), !0), t.disabled(e("select", i.field), !0), t.disabled(e(":radio", i.field), !0), t.disabled(e(":checkbox", i.field), !0), e(":radio", i.field).off().click(function(e) {
  2106. return e.preventDefault(), e.stopImmediatePropagation(), !1 }), e(".radio label", i.field).off().click(function(e) {
  2107. return e.preventDefault(), e.stopImmediatePropagation(), !1 }), e("input", i.field).off().click(function(e) {
  2108. return e.preventDefault(), e.stopImmediatePropagation(), !1 }), i.disable && i.disable() };
  2109. this.options.readonly && (e(this.field).addClass("alpaca-readonly"), e("input", this.field).attr("readonly", "readonly"), a(), i.fireCallback("readonly")), this.options.disabled && (e(this.field).addClass("alpaca-disabled"), a(), i.fireCallback("disabled"));
  2110. var r = function(e, n) {
  2111. if (n) {
  2112. var i = 0,
  2113. a = null;
  2114. if (t.isArray(n))
  2115. for (i = 0; i < n.length; i++) e.addClass(n[i]);
  2116. else if (n.indexOf(",") > -1)
  2117. for (a = n.split(","), i = 0; i < a.length; i++) e.addClass(a[i]);
  2118. else if (n.indexOf(" ") > -1)
  2119. for (a = n.split(" "), i = 0; i < a.length; i++) e.addClass(a[i]);
  2120. else e.addClass(n) } };
  2121. r(this.field, this.options.fieldClass), this.options.disabled && (this.disable(), i.fireCallback("disable")), this.view.type && "edit" === this.view.type ? this.bindData() : this.showingDefaultData && this.bindData(), "create" === this.view.type && t.logDebug("Skipping data binding for field: " + this.id + " since view mode is 'create'"), this.view.type && "view" !== this.view.type && this.initEvents() }
  2122. this.options.hidden && this.field.hide();
  2123. var o = "create" === this.view.type && !this.refreshed;
  2124. this.hideInitValidationError = t.isValEmpty(this.options.hideInitValidationError) ? o : this.options.hideInitValidationError, this.view.displayReadonly || e(this.field).find(".alpaca-readonly").hide(), this.options.postRender ? this.options.postRender.call(this, function() { n() }) : n() },
  2125. refresh: function(n) {
  2126. var i = this,
  2127. a = i.data = i.getValue(),
  2128. r = i.domEl,
  2129. o = i.field,
  2130. l = e("<div></div>");
  2131. e(o).before(l), i.domEl = e("<div style='display: none'></div>"), i.field = void 0, i.control = void 0, i.container = void 0, i.form = void 0, e(o).find("button").prop("disabled", !0), this.initializing = !0, i.setup(), i.setupField(function() { i._render(function() { e(l).before(i.field), i.domEl = r;
  2132. var s = e(o).attr("class");
  2133. s && e.each(s.split(" "), function(t, n) { n && 0 === !n.indexOf("alpaca-") && e(i.field).addClass(n) }), e(o).hide(), e(l).remove(), i.refreshed = !0, "undefined" != typeof a && (t.isObject(a) || t.isArray(a)) && i.setValue(a), t.fireReady(i), n && n.call(i), e(o).remove(void 0, { nodestroy: !0 }) }) }) },
  2134. applyStyle: function(e, t) { this.view.applyStyle(e, t) },
  2135. fireCallback: function(e, t, n, i, a, r) { this.view.fireCallback(this, e, t, n, i, a, r) },
  2136. getFieldEl: function() {
  2137. return this.field },
  2138. getId: function() {
  2139. return this.id },
  2140. getParent: function() {
  2141. return this.parent },
  2142. getPath: function() {
  2143. return this.path },
  2144. getName: function() {
  2145. return this.name },
  2146. isTopLevel: function() {
  2147. return t.isEmpty(this.parent) },
  2148. top: function() {
  2149. for (var e = this; e.parent;) e = e.parent;
  2150. return e },
  2151. getValue: function() {
  2152. var e = this,
  2153. t = this.data;
  2154. return t = e.ensureProperType(t) },
  2155. setValue: function(e) { this.data = e, this.updateObservable(), this.triggerUpdate(), this.isDisplayOnly() && !this.initializing && (this.top && this.top() && this.top().initializing || this.refresh()) },
  2156. setDefault: function() {},
  2157. getTemplateDescriptor: function() {
  2158. return this.templateDescriptor },
  2159. setTemplateDescriptor: function(e) { this.templateDescriptor = e },
  2160. displayMessage: function(n, i) {
  2161. var a = this;
  2162. n && t.isObject(n) && (n = [n]), n && t.isString(n) && (n = [{ id: "custom", message: n }]), e(this.getFieldEl()).children(".alpaca-message").remove(), n && n.length > 0 && this.options.maxMessages && t.isNumber(this.options.maxMessages) && this.options.maxMessages > -1 && (n = n.slice(0, this.options.maxMessages)), a.fireCallback("removeMessages"), n && n.length > 0 && e.each(n, function(n, i) {
  2163. var r = !1;
  2164. a.hideInitValidationError && (r = !0);
  2165. var o = a.view.getTemplateDescriptor("message");
  2166. if (o) {
  2167. var l = t.tmpl(o, { id: i.id, message: i.message, view: a.view });
  2168. l.addClass("alpaca-message"), r && l.addClass("alpaca-message-hidden"), e(a.getFieldEl()).append(l) }
  2169. a.fireCallback("addMessage", n, i.id, i.message, r) }) },
  2170. refreshValidationState: function(e, n) {
  2171. var i = this,
  2172. a = [],
  2173. r = [],
  2174. o = function(e, n) {
  2175. return function(i) { t.nextTick(function() { t.compileValidationContext(e, function(e) { n.push(e), i() }) }) } };
  2176. if (e) {
  2177. var l = function(e, t) {
  2178. if (e.isValidationParticipant()) {
  2179. if (e.children && e.children.length > 0)
  2180. for (var n = 0; n < e.children.length; n++) l(e.children[n], t);
  2181. r.push(o(e, t)) } };
  2182. l(this, a) }
  2183. r.push(o(this, a)), t.series(r, function(e) {
  2184. for (var r = {}, o = [], l = 0; l < a.length; l++)
  2185. for (var s = a[l], u = o.length, c = 0; c < s.length; c++) {
  2186. var d = s[c],
  2187. p = r[d.id];
  2188. if (p) d.validated && !p.invalidated && (p.validated = !0, p.invalidated = !1, p.valid = d.valid), d.invalidated && (p.invalidated = !0, p.validated = !1, p.valid = d.valid);
  2189. else {
  2190. var h = {};
  2191. h.id = d.id, h.path = d.path, h.domEl = d.domEl, h.field = d.field, h.validated = d.validated, h.invalidated = d.invalidated, h.valid = d.valid, o.splice(u, 0, h), r[h.id] = h } }
  2192. o.reverse(), i.hideInitValidationError || t.updateValidationStateForContext(i.view, o), n && n() }) },
  2193. getMessage: function(e) {
  2194. return this.view.getMessage(e, this.view.locale) },
  2195. validate: function(e) {
  2196. var n = !0;
  2197. if (!this.initializing && this.options.validate) {
  2198. if (this.children && e)
  2199. for (var i = 0; i < this.children.length; i++) {
  2200. var a = this.children[i];
  2201. a.isValidationParticipant() && a.validate(e) }
  2202. if (n = this.handleValidate(), !n && t.logLevel == t.DEBUG) {
  2203. var r = [];
  2204. for (var o in this.validation) this.validation[o].status || r.push(this.validation[o].message);
  2205. t.logDebug("Validation failure for field (id=" + this.getId() + ", path=" + this.path + "), messages: " + JSON.stringify(r)) } }
  2206. return this._previouslyValidated = !0, n },
  2207. handleValidate: function() {
  2208. var e = this.validation,
  2209. n = this._validateOptional();
  2210. return e.notOptional = { message: n ? "" : this.getMessage("notOptional"), status: n }, n = this._validateDisallow(), e.disallowValue = { message: n ? "" : t.substituteTokens(this.getMessage("disallowValue"), [this.schema.disallow.join(", ")]), status: n }, e.notOptional.status && e.disallowValue.status },
  2211. _validateCustomValidator: function(e) {
  2212. var n = this;
  2213. this.options.validator && t.isFunction(this.options.validator) ? this.options.validator.call(this, function(t) { n.validation.custom = t, e() }) : e() },
  2214. _validateOptional: function() {
  2215. return this.isRequired() && this.isEmpty() ? !1 : !this.options.disallowOnlyEmptySpaces || !t.testRegex(t.regexps.whitespace, this.getValue()) },
  2216. _validateDisallow: function() {
  2217. if (!t.isValEmpty(this.schema.disallow)) {
  2218. var n = this.getValue(),
  2219. i = this.schema.disallow;
  2220. if (t.isArray(i)) {
  2221. var a = !0;
  2222. return e.each(i, function(e, i) {
  2223. (t.isObject(n) || t.isArray(n) && t.isString(i)) && (i = t.parseJSON(i)), t.compareObject(n, i) && (a = !1) }), a }
  2224. return (t.isObject(n) || t.isArray(n) && t.isString(i)) && (i = t.parseJSON(i)), !t.compareObject(n, i) }
  2225. return !0 },
  2226. triggerUpdate: function() { e(this.field).trigger("fieldupdate") },
  2227. disable: function() {},
  2228. enable: function() {},
  2229. isDisabled: function() {
  2230. return !1 },
  2231. isEnabled: function() {
  2232. return !this.isDisabled() },
  2233. focus: function(e) { e && e(this) },
  2234. destroy: function() { t.observable(this.path).clear(), t && t.fieldInstances && t.fieldInstances[this.getId()] && delete t.fieldInstances[this.getId()], e(this.field).remove() },
  2235. show: function() { this.options && this.options.hidden || (e(this.field).css({ display: "" }), this.onShow(), this.fireCallback("show")) },
  2236. onShow: function() {},
  2237. hide: function() { e(this.field).css({ display: "none" }), this.onHide(), this.fireCallback("hide") },
  2238. onHide: function() {},
  2239. isValidationParticipant: function() {
  2240. return this.isShown() },
  2241. isShown: function() {
  2242. return !this.isHidden() },
  2243. isVisible: function() {
  2244. return !this.isHidden() },
  2245. isHidden: function() {
  2246. return "none" === e(this.field).css("display") },
  2247. print: function() { this.getFieldEl().printArea && this.getFieldEl().printArea() },
  2248. onDependentReveal: function() {},
  2249. onDependentConceal: function() {},
  2250. reload: function() { this.initializing = !0, t.isEmpty(this.callback) ? this.render(this.renderedCallback) : this.callback(this, this.renderedCallback) },
  2251. clear: function() {
  2252. var e = null;
  2253. this.data && (e = this.data), this.setValue(e) },
  2254. isEmpty: function() {
  2255. return t.isValEmpty(this.getValue()) },
  2256. isValid: function(t) {
  2257. if (t && this.children)
  2258. for (var n = 0; n < this.children.length; n++) {
  2259. var i = this.children[n];
  2260. if (i.isValidationParticipant() && !i.isValid(t)) return !1 }
  2261. if (e.isEmptyObject(this.validation)) return !0;
  2262. for (var a in this.validation)
  2263. if (!this.validation[a].status) return !1;
  2264. return !0 },
  2265. initEvents: function() {
  2266. var n = this;
  2267. this.field && (this.field.mouseover(function(e) { n.onMouseOver.call(n, e), n.trigger("mouseover", e) }), this.field.mouseout(function(e) { n.onMouseOut.call(n, e), n.trigger("mouseout", e) }), e.each(this.options, function(e, i) {
  2268. if (t.startsWith(e, "onField") && t.isFunction(i)) {
  2269. var a = e.substring(7).toLowerCase();
  2270. n.field.on(a, function(e) { i.call(n, e) }) } }), this.options && this.options.events && e.each(this.options.events, function(e, i) { t.isFunction(i) && ("render" === e || "ready" === e || "blur" === e || "focus" === e ? n.on(e, function(e, t, a, r) { i.call(n, e, t, a, r) }) : n.field.on(e, function(e) { i.call(n, e) })) })) },
  2271. onFocus: function(t) { e(this.field).removeClass("alpaca-field-empty"), e(this.field).addClass("alpaca-field-focused") },
  2272. onBlur: function(t) {
  2273. var n = e(this.field).hasClass("alpaca-field-focused");
  2274. e(this.field).removeClass("alpaca-field-focused"), n && this.refreshValidationState(), e(this.field).trigger("fieldblur") },
  2275. onChange: function(e) { this.data = this.getValue(), this.updateObservable(), this.triggerUpdate() },
  2276. onMouseOver: function(e) {},
  2277. onMouseOut: function(e) {},
  2278. getControlByPath: function(e) {
  2279. var n = null;
  2280. if (e) { 0 === e.indexOf("/") && (e = e.substring(1)), t.endsWith(e, "/") && (e = e.substring(0, e.length - 1));
  2281. for (var i = this, a = e.split("/"), r = 0; r < a.length; r++) {
  2282. var o = a[r],
  2283. l = o,
  2284. s = -1,
  2285. u = o.indexOf("[");
  2286. if (u >= 0) {
  2287. var c = o.indexOf("]", u + 1);
  2288. c >= 0 && (s = parseInt(o.substring(u + 1, c)), l = o.substring(0, u)) }
  2289. l && (i = i.childrenByPropertyId[l], s > -1 && (i = i.children[s])) }
  2290. n = i }
  2291. return n },
  2292. getControlsByFieldType: function(e) {
  2293. var t = [];
  2294. if (e) {
  2295. var n = function(e, t, i) {
  2296. for (var a = 0; a < e.children.length; a++) e.children[a].getFieldType() === t && i.push(e.children[a]), e.children[a].isContainer() && n(e.children[a], t, i) };
  2297. n(this, e, t) }
  2298. return t },
  2299. getControlsBySchemaType: function(e) {
  2300. var t = [];
  2301. if (e) {
  2302. var n = function(e, t, i) {
  2303. for (var a = 0; a < e.children.length; a++) e.children[a].getType() === t && i.push(e.children[a]), e.children[a].isContainer() && n(e.children[a], t, i) };
  2304. n(this, e, t) }
  2305. return t },
  2306. subscribe: function() {
  2307. var e = t.makeArray(arguments);
  2308. return e.unshift(this.getObservableScope()), t.subscribe.apply(this, e) },
  2309. unsubscribe: function() {
  2310. var e = t.makeArray(arguments);
  2311. return e.unshift(this.getObservableScope()), t.unsubscribe.apply(this, e) },
  2312. observable: function() {
  2313. var e = t.makeArray(arguments);
  2314. return e.unshift(this.getObservableScope()), t.observable.apply(this, e) },
  2315. clearObservable: function() {
  2316. var e = t.makeArray(arguments);
  2317. return e.unshift(this.getObservableScope()), t.clearObservable.apply(this, e) },
  2318. dependentObservable: function() {
  2319. var e = t.makeArray(arguments);
  2320. return e.unshift(this.getObservableScope()), t.dependentObservable.apply(this, e) },
  2321. getType: function() {},
  2322. getFieldType: function() {
  2323. return "" },
  2324. getBaseFieldType: function() {
  2325. var e = null,
  2326. t = this.constructor.ancestor.prototype;
  2327. return t && t.getFieldType && (e = t.getFieldType()), e },
  2328. isContainer: function() {
  2329. return !1 },
  2330. isRequired: function() {
  2331. var e = !1;
  2332. if ("boolean" == typeof this.schema.required && (e = this.schema.required), this.parent && this.parent.schema.required && t.isArray(this.parent.schema.required)) {
  2333. var n = this.parent.schema.required;
  2334. if (n)
  2335. for (var i = 0; i < n.length; i++)
  2336. if (n[i] === this.propertyId) { e = !0;
  2337. break } }
  2338. return e },
  2339. getTitle: function() {},
  2340. getDescription: function() {},
  2341. getSchemaOfSchema: function() {
  2342. var e = { title: this.getTitle(), description: this.getDescription(), type: "object", properties: { title: { title: "Title", description: "Short description of the property.", type: "string" }, description: { title: "Description", description: "Detailed description of the property.", type: "string" }, readonly: { title: "Readonly", description: "Indicates that the field is read-only. A read-only field cannot have it's value changed. Read-only fields render in a grayed-out or disabled control. If the field is rendered using a view with the <code>displayReadonly</code> attribute set to false, the read-only field will not appear.", type: "boolean", "default": !1 }, required: { title: "Required", description: "Indicates whether the field's value is required. If set to true, the field must take on a valid value and cannnot be left empty or unassigned.", type: "boolean", "default": !1 }, "default": { title: "Default", description: "The default value to be assigned for this property. If the data for the field is empty or not provided, this default value will be plugged in for you. Specify a default value when you want to pre-populate the field's value ahead of time.", type: "any" }, type: { title: "Type", description: "Data type of the property.", type: "string", readonly: !0 }, format: { title: "Format", description: "Data format of the property.", type: "string" }, disallow: { title: "Disallowed Values", description: "List of disallowed values for the property.", type: "array" }, dependencies: { title: "Dependencies", description: "List of property dependencies.", type: "array" } } };
  2343. return this.getType && !t.isValEmpty(this.getType()) && (e.properties.type["default"] = this.getType(),
  2344. e.properties.type["enum"] = [this.getType()]), e
  2345. },
  2346. getOptionsForSchema: function() {
  2347. return { fields: { title: { helper: "Field short description", type: "text" }, description: { helper: "Field detailed description", type: "textarea" }, readonly: { helper: "Field will be read only if checked", rightLabel: "This field is read-only", type: "checkbox" }, required: { helper: "Field value must be set if checked", rightLabel: "This field is required", type: "checkbox" }, "default": { helper: "Field default value", type: "textarea" }, type: { helper: "Field data type", type: "text" }, format: { type: "select", dataSource: function(e) {
  2348. for (var n in t.defaultFormatFieldMapping) this.selectOptions.push({ value: n, text: n });
  2349. e() } }, disallow: { helper: "Disallowed values for the field", itemLabel: "Value", type: "array" }, dependencies: { helper: "Field Dependencies", multiple: !0, size: 3, type: "select", dataSource: function(e, t) {
  2350. if (e.parent && e.parent.schemaParent && e.parent.schemaParent.parent)
  2351. for (var n in e.parent.schemaParent.parent.childrenByPropertyId) n != e.parent.schemaParent.propertyId && e.selectOptions.push({ value: n, text: n });
  2352. t && t() } } } } },
  2353. getSchemaOfOptions: function() {
  2354. var e = { title: "Options for " + this.getTitle(), description: this.getDescription() + " (Options)", type: "object", properties: { form: {}, id: { title: "Field Id", description: "Unique field id. Auto-generated if not provided.", type: "string" }, type: { title: "Field Type", description: "Field type.", type: "string", "default": this.getFieldType(), readonly: !0 }, validate: { title: "Validation", description: "Field validation is required if true.", type: "boolean", "default": !0 }, showMessages: { title: "Show Messages", description: "Display validation messages if true.", type: "boolean", "default": !0 }, disabled: { title: "Disabled", description: "Field will be disabled if true.", type: "boolean", "default": !1 }, readonly: { title: "Readonly", description: "Field will be readonly if true.", type: "boolean", "default": !1 }, hidden: { title: "Hidden", description: "Field will be hidden if true.", type: "boolean", "default": !1 }, label: { title: "Label", description: "Field label.", type: "string" }, helper: { title: "Helper", description: "Field help message.", type: "string" }, helpers: { title: "Helpers", description: "An array of field help messages. Each message will be displayed on it's own line.", type: "array", items: { type: "string" } }, fieldClass: { title: "CSS class", description: "Specifies one or more CSS classes that should be applied to the dom element for this field once it is rendered. Supports a single value, comma-delimited values, space-delimited values or values passed in as an array.", type: "string" }, hideInitValidationError: { title: "Hide Initial Validation Errors", description: "Hide initial validation errors if true.", type: "boolean", "default": !1 }, focus: { title: "Focus", description: "If true, the initial focus for the form will be set to the first child element (usually the first field in the form). If a field name or path is provided, then the specified child field will receive focus. For example, you might set focus to 'name' (selecting the 'name' field) or you might set it to 'client/name' which picks the 'name' field on the 'client' object.", type: "checkbox", "default": !0 }, optionLabels: { title: "Enumerated Value Labels", description: "An array of string labels for items in the enum array", type: "array" }, view: { title: "Override of the view for this field", description: "Allows for this field to be rendered with a different view (such as 'display' or 'create')", type: "string" } } };
  2355. return this.isTopLevel() ? e.properties.form = { title: "Form", description: "Options for rendering the FORM tag.", type: "object", properties: { attributes: { title: "Form Attributes", description: "List of attributes for the FORM tag.", type: "object", properties: { id: { title: "Id", description: "Unique form id. Auto-generated if not provided.", type: "string" }, action: { title: "Action", description: "Form submission endpoint", type: "string" }, method: { title: "Method", description: "Form submission method", "enum": ["post", "get"], type: "string" }, rubyrails: { title: "Ruby On Rails", description: "Ruby on Rails Name Standard", "enum": ["true", "false"], type: "string" }, name: { title: "Name", description: "Form name", type: "string" }, focus: { title: "Focus", description: "Focus Setting", type: "any" } } }, buttons: { title: "Form Buttons", description: "Configuration for form-bound buttons", type: "object", properties: { submit: { type: "object", title: "Submit Button", required: !1 }, reset: { type: "object", title: "Reset button", required: !1 } } }, toggleSubmitValidState: { title: "Toggle Submit Valid State", description: "Toggle the validity state of the Submit button", type: "boolean", "default": !0 } } } : delete e.properties.form, e },
  2356. getOptionsForOptions: function() {
  2357. var e = { type: "object", fields: { id: { type: "text", readonly: !0 }, type: { type: "text" }, validate: { rightLabel: "Enforce validation", type: "checkbox" }, showMessages: { rightLabel: "Show validation messages", type: "checkbox" }, disabled: { rightLabel: "Disable this field", type: "checkbox" }, hidden: { type: "checkbox", rightLabel: "Hide this field" }, label: { type: "text" }, helper: { type: "textarea" }, helpers: { type: "array", items: { type: "textarea" } }, fieldClass: { type: "text" }, hideInitValidationError: { rightLabel: "Hide initial validation errors", type: "checkbox" }, focus: { type: "checkbox", rightLabel: "Auto-focus first child field" }, optionLabels: { type: "array", items: { type: "text" } }, view: { type: "text" } } };
  2358. return this.isTopLevel() && (e.fields.form = { type: "object", fields: { attributes: { type: "object", fields: { id: { type: "text", readonly: !0 }, action: { type: "text" }, method: { type: "select" }, name: { type: "text" } } } } }), e }
  2359. }), t.registerMessages({ disallowValue: "{0} are disallowed values.", notOptional: "This field is not optional." })
  2360. }(jQuery),
  2361. function(e) {
  2362. var t = e.alpaca;
  2363. t.ControlField = t.Field.extend({ onConstruct: function() {
  2364. var t = this;
  2365. this.isControlField = !0, this._getControlVal = function(n) {
  2366. var i = null;
  2367. return this.control && (i = e(this.control).val(), n && (i = t.ensureProperType(i))), i } }, setup: function() {
  2368. var e = this;
  2369. this.base();
  2370. var n = e.resolveControlTemplateType();
  2371. if (!n) return t.throwErrorWithCallback("Unable to find template descriptor for control: " + e.getFieldType());
  2372. if (this.controlDescriptor = this.view.getTemplateDescriptor("control-" + n, e), "undefined" == typeof this.options.renderButtons && (this.options.renderButtons = !0), this.options.buttons)
  2373. for (var i in this.options.buttons) this.options.buttons[i].label && (this.options.buttons[i].value = this.options.buttons[i].label), this.options.buttons[i].title && (this.options.buttons[i].value = this.options.buttons[i].title), this.options.buttons[i].type || (this.options.buttons[i].type = "button"), this.options.buttons[i].styles || (this.options.buttons[i].styles = this.view.styles.button) }, getControlEl: function() {
  2374. return this.control }, resolveControlTemplateType: function() {
  2375. var e = this,
  2376. t = !1,
  2377. n = null,
  2378. i = this;
  2379. do
  2380. if (i.getFieldType) {
  2381. var a = this.view.getTemplateDescriptor("control-" + i.getFieldType(), e);
  2382. a ? (n = i.getFieldType(), t = !0) : i = i.constructor.ancestor.prototype } else t = !0;
  2383. while (!t);
  2384. return n }, onSetup: function() {}, isAutoFocusable: function() {
  2385. return !0 }, getTemplateDescriptorId: function() {
  2386. return "control" }, renderFieldElements: function(n) {
  2387. var i = this;
  2388. this.control = e(this.field).find("." + t.MARKER_CLASS_CONTROL_FIELD), this.control.removeClass(t.MARKER_CLASS_CONTROL_FIELD), i.prepareControlModel(function(e) { i.beforeRenderControl(e, function() { i.renderControl(e, function(a) { a && (i.control.replaceWith(a), i.control = a, i.control.addClass(t.CLASS_CONTROL)), i.fireCallback("control"), i.afterRenderControl(e, function() { n() }) }) }) }) }, prepareControlModel: function(e) {
  2389. var t = {};
  2390. t.id = this.getId(), t.name = this.name, t.options = this.options, t.schema = this.schema, t.data = this.data, t.required = this.isRequired(), t.view = this.view, e(t) }, beforeRenderControl: function(e, t) { t() }, afterRenderControl: function(t, n) {
  2391. var i = this;
  2392. i.firstUpdateObservableFire || "undefined" == typeof i.data || null == i.data || (i.firstUpdateObservableFire = !0, i.updateObservable()), e(this.getFieldEl()).find(".alpaca-control-button").each(function() { e(this).click(function(t) { e(this).attr("button-pushed", !0) });
  2393. var t = e(this).attr("data-key");
  2394. if (t) {
  2395. var n = i.options.buttons[t];
  2396. n && n.click && e(this).click(function(e, t) {
  2397. return function(n) { n.preventDefault(), t.call(e, n) } }(i, n.click)) } }), n() }, renderControl: function(e, n) {
  2398. var i = null;
  2399. this.controlDescriptor && (i = t.tmpl(this.controlDescriptor, e)), n(i) }, postRender: function(e) { this.base(function() { e() }) }, updateDOMElement: function() { this.base(), this.control.attr("name", this.getName()) }, setDefault: function() {
  2400. var e = t.isEmpty(this.schema["default"]) ? "" : this.schema["default"];
  2401. this.setValue(e) }, getValue: function() {
  2402. var e = this,
  2403. t = this.base();
  2404. return this.isDisplayOnly() || (t = e.getControlValue()), t = e.ensureProperType(t) }, getControlValue: function() {
  2405. return this._getControlVal(!0) }, _validateEnum: function() {
  2406. if (!this.getEnum()) return !0;
  2407. var e = this.getValue();
  2408. return !this.isRequired() && t.isValEmpty(e) ? !0 : t.inArray(this.getEnum(), e) }, handleValidate: function() {
  2409. var e = this.base(),
  2410. n = this.validation,
  2411. i = this._validateEnum(),
  2412. a = this.getEnum(),
  2413. r = this.getOptionLabels();
  2414. return r && r.length > 0 && (a = r), n.invalidValueOfEnum = { message: i ? "" : t.substituteTokens(this.getMessage("invalidValueOfEnum"), [a.join(", "), this.getValue()]), status: i }, e && n.invalidValueOfEnum.status }, initEvents: function() { this.base(), this.control && this.control.length > 0 && this.initControlEvents() }, initControlEvents: function() {
  2415. var e = this,
  2416. t = this.control;
  2417. t.click(function(t) { e.onClick.call(e, t), e.trigger("click", t) }), t.change(function(t) { setTimeout(function() { e.onChange.call(e, t), e.triggerWithPropagation("change", t) }, 200) }), t.focus(function(t) {
  2418. if (e.wasFocused = !0, !e.suspendBlurFocus) {
  2419. var n = e.onFocus.call(e, t);
  2420. return n !== !1 && (n = e.trigger("focus", t)), n } }), t.blur(function(t) {
  2421. if (e.wasBlurred = !0, !e.suspendBlurFocus) {
  2422. var n = e.onBlur.call(e, t);
  2423. return n !== !1 && (n = e.trigger("blur", t)), n } }), t.keypress(function(t) {
  2424. var n = e.onKeyPress.call(e, t);
  2425. return n !== !1 && (n = e.trigger("keypress", t)), n }), t.keyup(function(t) {
  2426. var n = e.onKeyUp.call(e, t);
  2427. return n !== !1 && (n = e.trigger("keyup", t)), n }), t.keydown(function(t) {
  2428. var n = e.onKeyDown.call(e, t);
  2429. return n !== !1 && (n = e.trigger("keydown", t)), n }) }, onKeyPress: function(e) {
  2430. var t = this,
  2431. n = !1;
  2432. if (t.view.type && "edit" === t.view.type) {
  2433. var i = this.isValid();
  2434. i || (n = !0) } else if (t.view.type && "create" === t.view.type) {
  2435. var i = this.isValid();!i && t.wasBlurred && (n = !0) }
  2436. n && window.setTimeout(function() { t.refreshValidationState() }, 50) }, onKeyDown: function(e) {}, onKeyUp: function(e) {}, onClick: function(e) {}, disable: function() { this.options.readonly || (this.base(), this.control && this.control.length > 0 && e(this.control).prop("disabled", !0)) }, enable: function() { this.options.readonly || (this.base(), this.control && this.control.length > 0 && e(this.control).prop("disabled", !1)) }, isDisabled: function() {
  2437. return e(this.control).prop("disabled") }, getEnum: function() {
  2438. var e = null;
  2439. return this.schema && this.schema["enum"] && (e = this.schema["enum"]), e }, setEnum: function(e) { t.safeSetObjectArray(this.schema, "enum", e) }, getOptionLabels: function() {
  2440. var e = null;
  2441. return this.options && this.options.optionLabels && (e = this.options.optionLabels), e }, setOptionLabels: function(e) { t.safeSetObjectArray(this.options, "optionLabels", e) }, sortEnum: function() {
  2442. var e = this.getEnum();
  2443. if (e && e.length > 0) {
  2444. for (var n = this.getOptionLabels(), i = [], a = 0; a < e.length; a++) {
  2445. var r = e[a],
  2446. o = e[a];
  2447. n && n.length >= a + 1 && (o = n[a]), i.push({ value: r, text: o }) }
  2448. this.sortSelectableOptions(i);
  2449. for (var l = [], s = [], a = 0; a < i.length; a++) l.push(i[a].value), t.isArray(n) && s.push(i[a].text);
  2450. this.setEnum(l), this.setOptionLabels(s) } }, sortSelectableOptions: function(e) {
  2451. var n = this;
  2452. if (n.options.sort !== !1) {
  2453. var i = t.defaultSort;
  2454. n.options.sort && "function" == typeof n.options.sort && (i = n.options.sort), e.sort(i) } }, invokeDataSource: function(n, i, a) {
  2455. var r = this,
  2456. o = function(e) {
  2457. var t = this;
  2458. return e ? a(e) : void t.afterLoadDataSourceOptions(n, i, function(e, n) {
  2459. return e ? a(e) : (t.sortSelectableOptions(n), void a(null, n)) }) }.bind(r);
  2460. if (t.isFunction(r.options.dataSource)) r.options.dataSource.call(r, function(e) {
  2461. if (t.isArray(e)) {
  2462. for (var i = 0; i < e.length; i++) "string" == typeof e[i] ? n.push({ text: e[i], value: e[i] }) : t.isObject(e[i]) && n.push(e[i]);
  2463. o() } else if (t.isObject(e)) {
  2464. for (var a in e) n.push({ text: a, value: e[a] });
  2465. o() } else o() });
  2466. else if (t.isUri(r.options.dataSource)) {
  2467. var l = r.view.locale,
  2468. s = "" + r.options.dataSource;
  2469. l && (s += -1 === s.indexOf("?") ? "?" : "&", s += "locale=" + l), e.ajax({ url: s, type: "get", dataType: "json", success: function(i) {
  2470. var a = i;
  2471. r.options.dsTransformer && t.isFunction(r.options.dsTransformer) && (a = r.options.dsTransformer(a)), a && (t.isObject(a) ? (e.each(a, function(e, t) { n.push({ value: e, text: t }) }), o()) : t.isArray(a) && (e.each(a, function(e, t) { n.push({ value: t.value, text: t.text }) }), o())) }, error: function(e, t, n) { r.errorCallback({ message: "Unable to load data from uri : " + r.options.dataSource, stage: "DATASOURCE_LOADING_ERROR", details: { jqXHR: e, textStatus: t, errorThrown: n } }) } }) } else if (t.isArray(r.options.dataSource)) {
  2472. for (var u = r.options.dataSource, c = 0; c < u.length; c++) "string" == typeof u[c] ? n.push({ text: u[c], value: u[c] }) : t.isObject(u[c]) && n.push(u[c]);
  2473. o() } else if (t.isObject(r.options.dataSource))
  2474. if (r.options.dataSource.connector) {
  2475. var d = r.connector;
  2476. if (t.isObject(r.options.dataSource.connector)) {
  2477. var p = r.options.dataSource.connector.id,
  2478. h = r.options.dataSource.connector.config;
  2479. h || (h = {});
  2480. var f = t.getConnectorClass(p);
  2481. f && (d = new f(p, h)) }
  2482. var m = r.options.dataSource.config;
  2483. m || (m = {}), d.loadDataSource(m, function(e) {
  2484. for (var i = 0; i < e.length; i++) "string" == typeof e[i] ? n.push({ text: e[i], value: e[i] }) : t.isObject(e[i]) && n.push(e[i]);
  2485. o() }) } else {
  2486. for (var g in r.options.dataSource) n.push({ text: r.options.dataSource[g], value: g });
  2487. o() }
  2488. else a() }, afterLoadDataSourceOptions: function(e, t, n) { n(null, e) }, getSchemaOfSchema: function() {
  2489. return t.merge(this.base(), { properties: { "enum": { title: "Enumerated Values", description: "List of specific values for this property", type: "array" } } }) }, getOptionsForSchema: function() {
  2490. return t.merge(this.base(), { fields: { "enum": { itemLabel: "Value", type: "array" } } }) }, getSchemaOfOptions: function() {
  2491. return t.merge(this.base(), { properties: { name: { title: "Field Name", description: "Field Name.", type: "string" }, sort: { title: "Sort Function", description: "Defines an f(a,b) sort function for the array of enumerated values [{text, value}]. This is used to sort enum and optionLabels as well as results that come back from any data sources (for select and radio controls). By default the items are sorted alphabetically. Don't apply any sorting if false.", type: "function" } } }) }, getOptionsForOptions: function() {
  2492. return t.merge(this.base(), { fields: { name: { type: "text" } } }) } }), t.registerMessages({ invalidValueOfEnum: "This field should have one of the values in {0}. Current value is: {1}" }) }(jQuery),
  2493. function(e) {
  2494. var t = e.alpaca;
  2495. t.ContainerField = t.Field.extend({ onConstruct: function() { this.isContainerField = !0 }, isContainer: function() {
  2496. return !0 }, getContainerEl: function() {
  2497. return this.container }, getTemplateDescriptorId: function() {
  2498. return "container" }, resolveContainerTemplateType: function() {
  2499. var e = !1,
  2500. t = null,
  2501. n = this;
  2502. do
  2503. if (n.getFieldType) {
  2504. var i = this.view.getTemplateDescriptor("container-" + n.getFieldType(), this);
  2505. i ? (t = n.getFieldType(), e = !0) : n = n.constructor.ancestor.prototype } else e = !0;
  2506. while (!e);
  2507. return t }, resolveContainerItemTemplateType: function() {
  2508. var e = !1,
  2509. t = null,
  2510. n = this;
  2511. do
  2512. if (n.getFieldType) {
  2513. var i = this.view.getTemplateDescriptor("container-" + n.getFieldType() + "-item", this);
  2514. i ? (t = n.getFieldType(), e = !0) : n = n.constructor.ancestor.prototype } else e = !0;
  2515. while (!e);
  2516. return t }, setup: function() {
  2517. var e = this;
  2518. this.base();
  2519. var n = e.resolveContainerTemplateType();
  2520. if (!n) return t.throwErrorWithCallback("Unable to find template descriptor for container: " + e.getFieldType());
  2521. this.containerDescriptor = this.view.getTemplateDescriptor("container-" + n, e);
  2522. var i = !1;
  2523. t.isEmpty(this.view.collapsible) || (i = this.view.collapsible), t.isEmpty(this.options.collapsible) || (i = this.options.collapsible), this.options.collapsible = i;
  2524. var a = "button";
  2525. t.isEmpty(this.view.legendStyle) || (a = this.view.legendStyle), t.isEmpty(this.options.legendStyle) || (a = this.options.legendStyle), this.options.legendStyle = a, this.lazyLoading = !1, t.isEmpty(this.options.lazyLoading) || (this.lazyLoading = this.options.lazyLoading, this.lazyLoading && (this.options.collapsed = !0)), this.children = [], this.childrenById = {}, this.childrenByPropertyId = {} }, destroy: function() { this.form && (this.form.destroy(!0), delete this.form), t.each(this.children, function() { this.destroy() }), this.base() }, renderFieldElements: function(n) {
  2526. var i = this;
  2527. this.container = e(this.field).find("." + t.MARKER_CLASS_CONTAINER_FIELD), this.container.removeClass(t.MARKER_CLASS_CONTAINER_FIELD), i.prepareContainerModel(function(e) { i.beforeRenderContainer(e, function() { i.renderContainer(e, function(a) { a && (i.container.replaceWith(a), i.container = a, i.container.addClass(t.CLASS_CONTAINER)), i.view.horizontal ? i.container.addClass("alpaca-horizontal") : i.container.addClass("alpaca-vertical"), i.fireCallback("container"), i.afterRenderContainer(e, function() { n() }) }) }) }) }, prepareContainerModel: function(e) {
  2528. var t = this,
  2529. n = { id: this.getId(), name: this.name, schema: this.schema, options: this.options, view: this.view };
  2530. t.createItems(function(t) { t || (t = []);
  2531. for (var i = 0; i < t.length; i++) t[i].containerItemEl || (t[i].containerItemEl = t[i].getFieldEl());
  2532. n.items = t, e(n) }) }, beforeRenderContainer: function(e, t) { t() }, renderContainer: function(e, n) {
  2533. var i = null;
  2534. this.containerDescriptor && (i = t.tmpl(this.containerDescriptor, e)), n(i) }, afterRenderContainer: function(e, t) {
  2535. var n = this;
  2536. n.beforeApplyCreatedItems(e, function() { n.applyCreatedItems(e, function() { n.afterApplyCreatedItems(e, function() { t() }) }) }) }, postRender: function(e) { this.base(function() { e() }) }, initEvents: function() { this.base() }, createItems: function(e) { e() }, beforeApplyCreatedItems: function(e, t) { t() }, applyCreatedItems: function(n, i) {
  2537. var a = this,
  2538. r = null;
  2539. if (a.isTopLevel() && a.view.getLayout() && (r = a.view.getLayout().bindings, !r && a.view.getLayout().templateDescriptor && n.items.length > 0)) { r = {};
  2540. for (var o = 0; o < n.items.length; o++) {
  2541. var l = n.items[o].name;
  2542. r[l] = "[data-alpaca-layout-binding='" + l + "']" } }
  2543. n.items.length > 0 ? (e(a.container).addClass("alpaca-container-has-items"), e(a.container).attr("data-alpaca-container-item-count", n.items.length)) : (e(a.container).removeClass("alpaca-container-has-items"), e(a.container).removeAttr("data-alpaca-container-item-count"));
  2544. for (var o = 0; o < n.items.length; o++) {
  2545. var s = n.items[o],
  2546. u = e(a.container).find("." + t.MARKER_CLASS_CONTAINER_FIELD_ITEM + "[" + t.MARKER_DATA_CONTAINER_FIELD_ITEM_KEY + "='" + s.name + "']");
  2547. if (r) {
  2548. var c = r[s.name];
  2549. if (c) {
  2550. var d = e(c, a.field);
  2551. if (0 == d.length) try { d = e("#" + c, a.field) } catch (p) {}
  2552. d.length > 0 && (s.domEl = e("<div></div>"), e(s.domEl).addClass("alpaca-layout-binding-holder"), e(s.domEl).attr("alpaca-layout-binding-field-name", s.name), d.append(s.domEl), s.domEl.append(s.containerItemEl)) }
  2553. e(u).remove() } else {
  2554. var d = e(u).parent();
  2555. e(u).replaceWith(s.containerItemEl), s.domEl = d }
  2556. e(s.containerItemEl).addClass("alpaca-container-item"), 0 === o && e(s.containerItemEl).addClass("alpaca-container-item-first"), o + 1 === n.items.length && e(s.containerItemEl).addClass("alpaca-container-item-last"), e(s.containerItemEl).attr("data-alpaca-container-item-index", o), e(s.containerItemEl).attr("data-alpaca-container-item-name", s.name), e(s.containerItemEl).attr("data-alpaca-container-item-parent-field-id", a.getId()), a.registerChild(s, o) }
  2557. a.options.collapsible && a.fireCallback("collapsible"), a.triggerUpdate(), i() }, afterApplyCreatedItems: function(e, t) { t() }, registerChild: function(e, n) { t.isEmpty(n) ? this.children.push(e) : this.children.splice(n, 0, e), this.childrenById[e.getId()] = e, e.propertyId && (this.childrenByPropertyId[e.propertyId] = e), e.parent = this }, unregisterChild: function(e) {
  2558. var n = this.children[e];
  2559. n && (t.isEmpty(e) || this.children.splice(e, 1), delete this.childrenById[n.getId()], n.propertyId && delete this.childrenByPropertyId[n.propertyId], n.parent = null) }, updateDOMElement: function() {
  2560. var t = this;
  2561. this.base(), t.children.length > 0 ? (e(t.getContainerEl()).addClass("alpaca-container-has-items"), e(t.getContainerEl()).attr("data-alpaca-container-item-count", t.children.length)) : (e(t.getContainerEl()).removeClass("alpaca-container-has-items"), e(t.getContainerEl()).removeAttr("data-alpaca-container-item-count"));
  2562. for (var n = 0; n < t.children.length; n++) {
  2563. var i = t.children[n];
  2564. i.path || ("array" === i.schema.type ? i.path = t.path + "[" + n + "]" : i.path = t.path + "/" + i.propertyId), i.calculateName(), e(i.containerItemEl).removeClass("alpaca-container-item-first"), e(i.containerItemEl).removeClass("alpaca-container-item-last"), e(i.containerItemEl).removeClass("alpaca-container-item-index"), e(i.containerItemEl).removeClass("alpaca-container-item-key"), e(i.containerItemEl).addClass("alpaca-container-item"), 0 === n && e(i.containerItemEl).addClass("alpaca-container-item-first"), n + 1 === t.children.length && e(i.containerItemEl).addClass("alpaca-container-item-last"), e(i.containerItemEl).attr("data-alpaca-container-item-index", n), e(i.containerItemEl).attr("data-alpaca-container-item-name", i.name), e(i.containerItemEl).attr("data-alpaca-container-item-parent-field-id", t.getId()), t.updateChildDOMWrapperElement(n, i), i.updateDOMElement() } }, updateChildDOMWrapperElement: function(e, t) {}, handleRepositionDOMRefresh: function() {
  2565. var e = this;
  2566. e.getParent() ? e.getParent().updateDOMElement() : e.updateDOMElement() }, onDependentReveal: function() {
  2567. for (var e = 0; e < this.children.length; e++) this.children[e].onDependentReveal() }, onDependentConceal: function() {
  2568. for (var e = 0; e < this.children.length; e++) this.children[e].onDependentConceal() }, focus: function(t) {
  2569. var n = this;
  2570. if (this.isDisplayOnly()) return void(t && t());
  2571. this.base();
  2572. var i = -1,
  2573. a = [],
  2574. r = this.getContainerEl();
  2575. this.form && (r = this.form.getFormEl()), e(r).find(".alpaca-container-item[data-alpaca-container-item-parent-field-id='" + this.getId() + "']").each(function() {
  2576. var t = e(this).attr("data-alpaca-container-item-index");
  2577. a.push(n.children[t]) });
  2578. for (var o = 0; o < a.length; o++)
  2579. if (a[o] && !a[o].isValid(!0) && a[o].isControlField && a[o].isAutoFocusable() && !a[o].options.readonly) { i = o;
  2580. break } - 1 === i && a.length > 0 && (i = 0), i > -1 && (a[i].focus(), t && t(a[i])) }, disable: function() {
  2581. if (!this.options.readonly) { this.base();
  2582. for (var e = 0; e < this.children.length; e++) this.children[e].disable() } }, enable: function() {
  2583. if (!this.options.readonly) { this.base();
  2584. for (var e = 0; e < this.children.length; e++) this.children[e].enable() } }, getValue: function() {
  2585. var e = this,
  2586. t = e.getContainerValue();
  2587. return t }, getContainerValue: function() {
  2588. return null }, firstChild: function() {
  2589. var e = null;
  2590. return this.children.length > 0 && (e = this.children[0]), e }, lastChild: function() {
  2591. var e = null;
  2592. return this.children.length > 0 && (e = this.children[this.children.length - 1]), e }, getSchemaOfOptions: function() {
  2593. return t.merge(this.base(), { properties: { lazyLoading: { title: "Lazy Loading", description: "Child fields will only be rendered when the fieldset is expanded if this option is set true.", type: "boolean", "default": !1 }, collapsible: { title: "Collapsible", description: "Field set is collapsible if true.", type: "boolean", "default": !1 }, collapsed: { title: "Collapsed", description: "Field set is initially collapsed if true.", type: "boolean", "default": !1 }, legendStyle: { title: "Legend Style", description: "Field set legend style.", type: "string", "enum": ["button", "link"], "default": "button" }, animate: { title: "Animate movements and transitions", description: "Up and down transitions will be animated", type: "boolean", "default": !0 } } }) }, getOptionsForOptions: function() {
  2594. return t.merge(this.base(), { fields: { lazyLoading: { rightLabel: "Lazy loading child fields ?", helper: "Lazy loading will be enabled if checked.", type: "checkbox" }, collapsible: { rightLabel: "Field set collapsible ?", helper: "Field set is collapsible if checked.", type: "checkbox" }, collapsed: { rightLabel: "Field set initially collapsed ?", description: "Field set is initially collapsed if checked.", type: "checkbox" }, legendStyle: { type: "select" }, animate: { rightLabel: "Animate movements and transitions", type: "checkbox" } } }) } }) }(jQuery),
  2595. function(e) {
  2596. var t = e.alpaca;
  2597. t.Form = Base.extend({ constructor: function(e, n, i, a, r) {
  2598. if (this.domEl = e, this.parent = null, this.connector = a, this.errorCallback = r, this.options = n, this.options.attributes ? this.attributes = this.options.attributes : this.attributes = {}, this.options.buttons) { this.options.buttons.submit && (this.options.buttons.submit.type || (this.options.buttons.submit.type = "submit"), this.options.buttons.submit.name || (this.options.buttons.submit.name = "submit"), this.options.buttons.submit.value || (this.options.buttons.submit.value = "Submit")), this.options.buttons.reset && (this.options.buttons.reset.type || (this.options.buttons.reset.type = "reset"), this.options.buttons.reset.name || (this.options.buttons.reset.name = "reset"), this.options.buttons.reset.value || (this.options.buttons.reset.value = "Reset"));
  2599. for (var o in this.options.buttons) this.options.buttons[o].label && (this.options.buttons[o].value = this.options.buttons[o].label), this.options.buttons[o].title && (this.options.buttons[o].value = this.options.buttons[o].title), this.options.buttons[o].type || (this.options.buttons[o].type = "button") }
  2600. this.attributes.id ? this.id = this.attributes.id : (this.id = t.generateId(), this.attributes.id = this.id), this.options.buttons && this.options.buttons.submit && t.isUndefined(this.options.toggleSubmitValidState) && (this.options.toggleSubmitValidState = !0), this.viewType = n.viewType, this.view = new t.RuntimeView(i, this);
  2601. for (var o in this.options.buttons) this.options.buttons[o].styles || (this.options.buttons[o].styles = this.view.styles.button) }, render: function(e) {
  2602. var t = this;
  2603. this.processRender(this.domEl, function() { t.form.appendTo(t.domEl), t.form.addClass("alpaca-form"), t.fireCallback("form"), e(t) }) }, afterInitialize: function() {
  2604. var e = this;
  2605. e.options.toggleSubmitValidState && e.adjustSubmitButtonState() }, isFormValid: function() { this.topControl.validate(!0);
  2606. var e = this.topControl.isValid(!0);
  2607. return e }, isValid: function() {
  2608. return this.isFormValid() }, validate: function(e) {
  2609. return this.topControl.validate(e) }, enableSubmitButton: function() {
  2610. if (e(".alpaca-form-button-submit").attrProp("disabled", !1), e.mobile) try { e(".alpaca-form-button-submit").button("refresh") } catch (t) {} }, disableSubmitButton: function() {
  2611. if (e(".alpaca-form-button-submit").attrProp("disabled", !0), e.mobile) try { e(".alpaca-form-button-submit").button("refresh") } catch (t) {} }, adjustSubmitButtonState: function() { this.disableSubmitButton(), this.isFormValid() && this.enableSubmitButton() }, processRender: function(n, i) {
  2612. var a = this;
  2613. if (this.formDescriptor = this.view.getTemplateDescriptor("form"), !this.formDescriptor) return t.throwErrorWithCallback("Could not find template descriptor: form");
  2614. var r = t.tmpl(this.formDescriptor, { id: this.getId(), options: this.options, view: this.view });
  2615. r.appendTo(n), this.form = r, this.formFieldsContainer = e(this.form).find("." + t.MARKER_CLASS_FORM_ITEMS_FIELD), this.formFieldsContainer.removeClass(t.MARKER_CLASS_FORM_ITEMS_FIELD), t.isEmpty(this.form.attr("id")) && this.form.attr("id", this.getId() + "-form-outer"), t.isEmpty(this.form.attr("data-alpaca-form-id")) && this.form.attr("data-alpaca-form-id", this.getId()), e(n).find("form").attr(this.attributes), this.buttons = {}, e(n).find(".alpaca-form-button").each(function() { e(this).click(function(t) { e(this).attr("button-pushed", !0) });
  2616. var t = e(this).attr("data-key");
  2617. if (t) {
  2618. var n = a.options.buttons[t];
  2619. n && n.click && e(this).click(function(e, t) {
  2620. return function(n) { n.preventDefault(), t.call(e, n) } }(a, n.click)) } }), i() }, getId: function() {
  2621. return this.id }, getType: function() {
  2622. return this.type }, getParent: function() {
  2623. return this.parent }, getValue: function() {
  2624. return this.topControl.getValue() }, setValue: function(e) { this.topControl.setValue(e) }, initEvents: function() {
  2625. var t = this,
  2626. n = e(this.domEl).find("form"),
  2627. i = this.getValue();
  2628. e(n).submit(i, function(e) {
  2629. return t.onSubmit(e, t) }), this.options.toggleSubmitValidState && (e(t.topControl.getFieldEl()).bind("fieldupdate", function() { t.adjustSubmitButtonState() }), e(t.topControl.getFieldEl()).bind("fieldkeyup", function() { t.adjustSubmitButtonState() }), e(t.topControl.getFieldEl()).bind("fieldblur", function() { t.adjustSubmitButtonState() })) }, getButtonEl: function(t) {
  2630. return e(this.domEl).find(".alpaca-form-button-" + t) }, onSubmit: function(e, n) {
  2631. if (!this.isFormValid()) return e.stopPropagation(), this.refreshValidationState(!0), !1;
  2632. if (this.submitHandler) { e.stopPropagation();
  2633. var i = this.submitHandler(e, n);
  2634. return t.isUndefined(i) && (i = !1), i } }, registerSubmitHandler: function(e) { t.isFunction(e) && (this.submitHandler = e) }, refreshValidationState: function(e, t) { this.topControl.refreshValidationState(e, t) }, disable: function() { this.topControl.disable() }, enable: function() { this.topControl.enable() }, focus: function(e) { this.topControl.focus(function(t) { e && e(t) }) }, destroy: function(e) { this.getFormEl().remove(), !e && this.parent && this.parent.destroy() }, show: function() { this.getFormEl().css({ display: "" }) }, hide: function() { this.getFormEl().css({ display: "none" }) }, clear: function(e) { this.topControl.clear(e) }, isEmpty: function() {
  2635. return this.topControl.isEmpty() }, fireCallback: function(e, t, n, i, a, r) { this.view.fireCallback(this, e, t, n, i, a, r) }, getFormEl: function() {
  2636. return this.form }, submit: function() { this.form.submit() }, ajaxSubmit: function(n) {
  2637. var i = this;
  2638. n || (n = {}), n.url = i.options.attributes.action, n.type = i.options.attributes.method, n.data || (n.data = this.getValue()), n.dataType || (n.dataType = "json"), n.headers || (n.headers = {});
  2639. var a = i.determineCsrfToken();
  2640. return a && (n.headers[t.CSRF_HEADER_NAME] = a), e.ajax(n) }, determineCsrfToken: function() {
  2641. var e = t.CSRF_TOKEN;
  2642. if (!e)
  2643. for (var n = 0; n < t.CSRF_COOKIE_NAMES.length; n++) {
  2644. var i = t.CSRF_COOKIE_NAMES[n],
  2645. a = t.readCookie(i);
  2646. if (a) { e = a;
  2647. break } }
  2648. return e } }) }(jQuery),
  2649. function(e) {
  2650. var t = e.alpaca,
  2651. n = 36e5;
  2652. t.Connector = Base.extend({ constructor: function(e, a) { this.id = e, this.config = a, this.isUri = function(e) {
  2653. return !t.isEmpty(e) && t.isUri(e) }, this.cache = new i("URL", !0, n) }, connect: function(e, t) { e() }, loadTemplate: function(e, n, i) { t.isEmpty(e) ? i({ message: "Empty data source.", reason: "TEMPLATE_LOADING_ERROR" }) : t.isUri(e) ? this.loadUri(e, !1, function(e) { n && t.isFunction(n) && n(e) }, function(e) { i && t.isFunction(i) && i(e) }) : n(e) }, loadData: function(e, t, n, i) {
  2654. return this._handleLoadJsonResource(e, n, i) }, loadSchema: function(e, t, n, i) {
  2655. return this._handleLoadJsonResource(e, n, i) }, loadOptions: function(e, t, n, i) {
  2656. return this._handleLoadJsonResource(e, n, i) }, loadView: function(e, t, n, i) {
  2657. return this._handleLoadJsonResource(e, n, i) }, loadAll: function(e, n, i) {
  2658. var a = this,
  2659. r = function() {
  2660. var r = e.dataSource,
  2661. o = e.schemaSource,
  2662. l = e.optionsSource,
  2663. s = e.viewSource;
  2664. o || "string" != typeof e.schema || (o = e.schema), l || "string" != typeof e.options || (l = e.options), s || "string" != typeof e.view || (s = e.view);
  2665. var u = {},
  2666. c = 0,
  2667. d = 0,
  2668. p = function() { c === d && n && t.isFunction(n) && n(u.data, u.options, u.schema, u.view) },
  2669. h = function(e) { i && t.isFunction(i) && i(e) };
  2670. if (r && d++, o && d++, l && d++, s && d++, 0 === d) return void p();
  2671. var f = function(e, n, i) { u[e] = n, i && ("object" == typeof u[e] && "object" == typeof i ? t.mergeObject(u[e], i) : u[e] = i) };
  2672. r && a.loadData(r, e, function(t) { f("data", e.data, t), c++, p() }, h), o && a.loadSchema(o, e, function(t) { f("schema", e.schema, t), c++, p() }, h), l && a.loadOptions(l, e, function(t) { f("options", e.options, t), c++, p() }, h), s && a.loadView(s, e, function(t) { f("view", e.view, t), c++, p() }, h) },
  2673. o = function(e) { i && t.isFunction(i) && i(e) };
  2674. a.connect(r, o) }, loadJson: function(e, t, n) { this.loadUri(e, !0, t, n) }, buildAjaxConfig: function(e, t) {
  2675. var n = { url: e, type: "get" };
  2676. return t ? n.dataType = "json" : n.dataType = "text", n }, loadUri: function(n, i, a, r) {
  2677. var o = this,
  2678. l = o.buildAjaxConfig(n, i);
  2679. l.success = function(e) { o.cache.put(n, e), a && t.isFunction(a) && a(e) }, l.error = function(e, i, a) { r && t.isFunction(r) && r({ message: "Unable to load data from uri : " + n, stage: "DATA_LOADING_ERROR", details: { jqXHR: e, textStatus: i, errorThrown: a } }) };
  2680. var s = o.cache.get(n);
  2681. s !== !1 && a && t.isFunction(a) ? a(s) : e.ajax(l) }, loadReferenceSchema: function(e, t, n) {
  2682. return this._handleLoadJsonResource(e, t, n) }, loadReferenceOptions: function(e, t, n) {
  2683. return this._handleLoadJsonResource(e, t, n) }, _handleLoadJsonResource: function(e, t, n) { this.isUri(e) ? this.loadJson(e, function(e) { t(e) }, n) : t(e) }, loadDataSource: function(e, t, n) {
  2684. return this._handleLoadDataSource(e, t, n) }, _handleLoadDataSource: function(e, n, i) {
  2685. var a = e;
  2686. return t.isObject(a) && (a = e.url), this._handleLoadJsonResource(a, n, i) } }), t.registerConnectorClass("default", t.Connector);
  2687. var i = function(e, t, n) {
  2688. switch (t ? this.on = !0 : this.on = !1, null != n && (this.defaultLifetime = n), this.type = e, this.type) {
  2689. case "URL":
  2690. this.put = this.put_url;
  2691. break;
  2692. case "GET":
  2693. this.put = this.put_GET } };
  2694. i.prototype.on = !1, i.prototype.type = void 0, i.prototype.defaultLifetime = 18e5, i.prototype.items = {}, i.prototype.put_url = function(e, t, n) {
  2695. null == n && (n = this.defaultLifetime);
  2696. var i = this.make_key(e);
  2697. return this.items[i] = {}, this.items[i].key = i, this.items[i].url = e, this.items[i].response = t, this.items[i].expire = (new Date).getTime() + n, !0
  2698. }, i.prototype.put_GET = function(e, t, n, i) { null == i && (i = this.defaultLifetime);
  2699. var a = this.make_key(e, [t]);
  2700. return this.items[a] = {}, this.items[a].key = a, this.items[a].url = e, this.items[a].data = t, this.items[a].response = n, this.items[a].expire = (new Date).getTime() + i, !0 }, i.prototype.get = function(e, t) {
  2701. var n = this.make_key(e, t);
  2702. return null == this.items[n] ? !1 : this.items[n].expire < (new Date).getTime() ? !1 : this.items[n].response }, i.prototype.make_key = function(e, t) {
  2703. var n = e;
  2704. switch (this.type) {
  2705. case "URL":
  2706. break;
  2707. case "GET":
  2708. n += this.stringify(t[0]) }
  2709. return n }, i.prototype.flush = function() {
  2710. return cache.items = {}, !0 }, i.prototype.stringify = function(e, t, n) {
  2711. var i;
  2712. if (gap = "", indent = "", "number" == typeof n)
  2713. for (i = 0; n > i; i += 1) indent += " ";
  2714. else "string" == typeof n && (indent = n);
  2715. if (rep = t, t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length)) throw new Error("JSON.stringify");
  2716. return this.str("", { "": e }) }, i.prototype.quote = function(e) {
  2717. var t = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
  2718. return t.lastIndex = 0, t.test(e) ? '"' + e.replace(t, function(e) {
  2719. var t = meta[e];
  2720. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4) }) + '"' : '"' + e + '"' }, i.prototype.str = function(e, t) {
  2721. var n, i, a, r, o, l = gap,
  2722. s = t[e];
  2723. switch (s && "object" == typeof s && "function" == typeof s.toJSON && (s = s.toJSON(e)), "function" == typeof rep && (s = rep.call(t, e, s)), typeof s) {
  2724. case "string":
  2725. return this.quote(s);
  2726. case "number":
  2727. return isFinite(s) ? String(s) : "null";
  2728. case "boolean":
  2729. case "null":
  2730. return String(s);
  2731. case "object":
  2732. if (!s) return "null";
  2733. if (gap += indent, o = [], "[object Array]" === Object.prototype.toString.apply(s)) {
  2734. for (r = s.length, n = 0; r > n; n += 1) o[n] = this.str(n, s) || "null";
  2735. return a = 0 === o.length ? "[]" : gap ? "[\n" + gap + o.join(",\n" + gap) + "\n" + l + "]" : "[" + o.join(",") + "]", gap = l, a }
  2736. if (rep && "object" == typeof rep)
  2737. for (r = rep.length, n = 0; r > n; n += 1) i = rep[n], "string" == typeof i && (a = this.str(i, s), a && o.push(this.quote(i) + (gap ? ": " : ":") + a));
  2738. else
  2739. for (i in s) Object.hasOwnProperty.call(s, i) && (a = this.str(i, s), a && o.push(this.quote(i) + (gap ? ": " : ":") + a));
  2740. return a = 0 === o.length ? "{}" : gap ? "{\n" + gap + o.join(",\n" + gap) + "\n" + l + "}" : "{" + o.join(",") + "}", gap = l, a } }
  2741. }(jQuery),
  2742. function(e) {
  2743. var t = e.alpaca;
  2744. t.CloudCmsConnector = t.Connector.extend({ connect: function(e, n) {
  2745. var i = this,
  2746. a = function(t, a) {
  2747. return t ? void n(t) : (a && (i.branch = Chain(a), i.bindHelperFunctions(i.branch)), void e()) };
  2748. t.globalContext && t.globalContext.branch ? a(null, t.globalContext.branch) : (i.branch = null, i.doConnect(function(e, t) { a(e, t) })) }, doConnect: function(e) { this.config.key || (this.config.key = "default"), Gitana.connect(this.config, function(t) {
  2749. return t ? void e(t) : void(this.getDriver().getOriginalConfiguration().loadAppHelper ? this.datastore("content").readBranch("master").then(function() { e(null, this) }) : e()) }) }, bindHelperFunctions: function(e) { e.loadAlpacaSchema || (e.loadAlpacaSchema = function(t, n, i) {
  2750. var a = function() {
  2751. return e.getUri() + "/alpaca/schema" },
  2752. r = {};
  2753. return r.id = t, this.chainGetResponse(this, a, r).then(function(e) { i.call(this, null, e) }) }), e.loadAlpacaOptions || (e.loadAlpacaOptions = function(t, n, i) {
  2754. var a = function() {
  2755. return e.getUri() + "/alpaca/options" },
  2756. r = {};
  2757. return r.schemaId = n.schemaSource, r.id = t, this.chainGetResponse(this, a, r).then(function(e) { i.call(this, null, e) }) }), e.loadAlpacaData || (e.loadAlpacaData = function(t, n, i) {
  2758. var a = function() {
  2759. return e.getUri() + "/alpaca/data" },
  2760. r = {};
  2761. return r.id = t, this.chainGetResponse(this, a, r).then(function(e) { i.call(this, null, e) }) }), e.loadAlpacaDataSource || (e.loadAlpacaDataSource = function(n, i, a) {
  2762. var r = {};
  2763. i && t.copyInto(r, i);
  2764. var o = function() {
  2765. return e.getUri() + "/alpaca/datasource" };
  2766. return this.chainPostResponse(this, o, r, n).then(function(e) { a.call(this, null, e.datasource) }) }) }, loadData: function(e, t, n, i) {
  2767. var a = this;
  2768. return a.branch ? void a.branch.loadAlpacaData(e, t, function(e, t) {
  2769. if (e) return void i(e);
  2770. var a = null;
  2771. t && (a = JSON.parse(JSON.stringify(t))), n(a) }) : this.base(e, t, n, i) }, loadSchema: function(e, t, n, i) {
  2772. var a = this;
  2773. return a.branch ? void a.branch.loadAlpacaSchema(e, t, function(e, t) {
  2774. return e ? i(e) : void n(t) }) : this.base(e, t, n, i) }, loadOptions: function(e, n, i, a) {
  2775. var r = this;
  2776. return r.branch ? void r.branch.loadAlpacaOptions(e, n, function(e, n) {
  2777. return e ? a(e) : (n || (n = {}), n.form.buttons = { submit: { title: "Submit", click: function(e) {
  2778. var t = this,
  2779. n = this.getValue();
  2780. n || (n = {});
  2781. var i = this.ajaxSubmit({ xhrFields: { withCredentials: !0 }, crossDomain: !0, processData: !1, data: JSON.stringify(n), contentType: "application/json; charset=utf-8" });
  2782. i.done(function() { t.topControl.trigger("formSubmitSuccess") }), i.fail(function() { t.topControl.trigger("formSubmitFail") }) } } }, "undefined" == typeof n.focus && (n.focus = t.defaultFocus), n.form.attributes.action = r.config.baseURL + n.form.attributes.action, void i(n)) }) : this.base(e, n, i, a) }, loadReferenceSchema: function(e, t, n) {
  2783. var i = this;
  2784. if (0 === e.indexOf("qname://")) {
  2785. var a = e.substring(8).split("/");
  2786. e = a[0] + ":" + a[1] }
  2787. if (0 === e.toLowerCase().indexOf("http://") || 0 === e.toLowerCase().indexOf("https://")) return this._handleLoadJsonResource(e, t, n);
  2788. var r = null;
  2789. return i.loadSchema(e, r, t, n) }, loadReferenceOptions: function(e, t, n) {
  2790. var i = this;
  2791. if (0 === e.toLowerCase().indexOf("http://") || 0 === e.toLowerCase().indexOf("https://")) return this._handleLoadJsonResource(e, t, n);
  2792. var a = null;
  2793. if (0 === e.indexOf("qname://")) {
  2794. var r = e.substring(8).split("/");
  2795. if (r.length > 2) return a = {}, a.schemaSource = r[0] + ":" + r[1], e = r[2], i.loadOptions(e, a, t, n) }
  2796. t(null) }, loadDataSource: function(e, t, n) {
  2797. var i = this;
  2798. if (!i.branch) return this.base(e, t, n);
  2799. var a = e.pagination;
  2800. return delete e.pagination, i.branch.loadAlpacaDataSource(e, a, function(e, i) {
  2801. return e ? void n(e) : void t(i) }) } }), t.registerConnectorClass("cloudcms", t.CloudCmsConnector) }(jQuery),
  2802. function(e) {
  2803. var t = e.alpaca;
  2804. t.Fields.TextField = t.ControlField.extend({ getFieldType: function() {
  2805. return "text" }, setup: function() { this.base(), this.inputType || (this.inputType = "text"), this.options.inputType && (this.inputType = this.options.inputType), this.options.data || (this.options.data = {}), this.options.attributes || (this.options.attributes = {}), "undefined" == typeof this.options.allowOptionalEmpty && (this.options.allowOptionalEmpty = !0), this.options.autocomplete && "string" == typeof this.options.autocomplete && ("on" === this.options.autocomplete.toLowerCase() ? this.options.autocomplete = !0 : "true" === this.options.autocomplete.toLowerCase() ? this.options.autocomplete = !0 : "yes" === this.options.autocomplete.toLowerCase() ? this.options.autocomplete = !0 : this.options.autocomplete = !1), "undefined" == typeof this.options.autocomplete && (this.options.autocomplete = !1), "undefined" == typeof this.options.disallowEmptySpaces && (this.options.disallowEmptySpaces = !1), "undefined" == typeof this.options.disallowOnlyEmptySpaces && (this.options.disallowOnlyEmptySpaces = !1) }, destroy: function() { this.base(), this.control && this.control.typeahead && this.options.typeahead && e(this.control).typeahead("destroy") }, postRender: function(e) {
  2806. var t = this;
  2807. this.base(function() { t.control && (t.applyAutocomplete(), t.applyMask(), t.applyTypeAhead(), t.updateMaxLengthIndicator()), e() }) }, applyAutocomplete: function() {
  2808. var t = this; "undefined" != typeof t.options.autocomplete && (e(t.field).addClass("alpaca-autocomplete"), e(t.control).attr("autocomplete", t.options.autocomplete ? "on" : "off"), t.fireCallback("autocomplete")) }, applyMask: function() {
  2809. var e = this;
  2810. e.control.mask && e.options.maskString && e.control.mask(e.options.maskString) }, applyTypeAhead: function() {
  2811. var n = this;
  2812. if (n.control.typeahead && n.options.typeahead && !t.isEmpty(n.options.typeahead)) {
  2813. var i = n.options.typeahead.config;
  2814. i || (i = {});
  2815. var a = n.options.typeahead.datasets;
  2816. a || (a = {}), a.name || (a.name = n.getId());
  2817. var r = n.options.typeahead.events;
  2818. if (r || (r = {}), !a.init && ("local" === a.type || "remote" === a.type || "prefetch" === a.type)) {
  2819. var o = { datumTokenizer: function(e) {
  2820. var t = "";
  2821. for (var n in e)(e.hasOwnProperty(n) || e[n]) && (t += " " + e[n]);
  2822. return Bloodhound.tokenizers.whitespace(t) }, queryTokenizer: Bloodhound.tokenizers.whitespace };
  2823. if ("local" === a.type) {
  2824. var l = [];
  2825. if ("function" == typeof a.source) o.local = a.source;
  2826. else {
  2827. for (var s = 0; s < a.source.length; s++) {
  2828. var u = a.source[s]; "string" == typeof u && (u = { value: u }), l.push(u) }
  2829. o.local = l }
  2830. a.local && (o.local = a.local) } "prefetch" === a.type && (o.prefetch = { url: a.source }, a.filter && (o.prefetch.filter = a.filter)), "remote" === a.type && (o.remote = { url: a.source }, a.filter && (o.remote.filter = a.filter), a.replace && (o.remote.replace = a.replace)), e.each(a, function(e, t) { "type" !== e && "source" !== e && "filter" !== e && "replace" !== e && "local" !== e && "templates" !== e && (o[e] = t) });
  2831. var c = new Bloodhound(o);
  2832. c.initialize(), a.source = c.ttAdapter(), a.init = !0 }
  2833. if (a.templates)
  2834. for (var d in a.templates) {
  2835. var p = a.templates[d]; "string" == typeof p && (a.templates[d] = Handlebars.compile(p)) }
  2836. e(n.control).typeahead(i, a), e(n.control).on("typeahead:autocompleted", function(t, i) { n.setValue(i.value), e(n.control).change() }), e(n.control).on("typeahead:selected", function(t, i) { n.setValue(i.value), e(n.control).change() }), r && (r.autocompleted && e(n.control).on("typeahead:autocompleted", function(e, t) { r.autocompleted(e, t) }), r.selected && e(n.control).on("typeahead:selected", function(e, t) { r.selected(e, t) }));
  2837. var h = e(n.control);
  2838. e(n.control).change(function() {
  2839. var t = e(this).val(),
  2840. n = e(h).typeahead("val");
  2841. n !== t && e(h).typeahead("val", n) }), e(n.field).find("span.twitter-typeahead").first().css("display", "block"), e(n.field).find("span.twitter-typeahead input.tt-input").first().css("background-color", "") } }, prepareControlModel: function(e) {
  2842. var t = this;
  2843. this.base(function(n) { n.inputType = t.inputType, e(n) }) }, updateMaxLengthIndicator: function() {
  2844. var n = this,
  2845. i = !1,
  2846. a = "";
  2847. if (!t.isEmpty(n.schema.maxLength) && n.options.showMaxLengthIndicator) {
  2848. var r = n.getValue() || "",
  2849. o = n.schema.maxLength - r.length;
  2850. o >= 0 ? a = "You have " + o + " characters remaining" : (a = "Your message is too long by " + -1 * o + " characters", i = !0);
  2851. var l = e(n.field).find(".alpaca-field-text-max-length-indicator");
  2852. 0 === l.length && (l = e("<p class='alpaca-field-text-max-length-indicator'></p>"), e(n.control).after(l)), e(l).html(a), e(l).removeClass("err"), i && e(l).addClass("err") } }, getControlValue: function() {
  2853. var t = this,
  2854. n = this._getControlVal(!0);
  2855. if (t.control.mask && t.options.maskString) {
  2856. var i = e(this.control).data(e.mask.dataName);
  2857. i && (n = i(), n = t.ensureProperType(n)) }
  2858. return n }, setValue: function(e) { this.control && this.control.length > 0 && (t.isEmpty(e) ? this.control.val("") : this.control.val(e)), this.base(e), this.updateMaxLengthIndicator() }, handleValidate: function() {
  2859. var e = this.base(),
  2860. n = this.validation,
  2861. i = this._validatePattern();
  2862. return n.invalidPattern = { message: i ? "" : t.substituteTokens(this.getMessage("invalidPattern"), [this.schema.pattern]), status: i }, i = this._validateMaxLength(), n.stringTooLong = { message: i ? "" : t.substituteTokens(this.getMessage("stringTooLong"), [this.schema.maxLength]), status: i }, i = this._validateMinLength(), n.stringTooShort = { message: i ? "" : t.substituteTokens(this.getMessage("stringTooShort"), [this.schema.minLength]), status: i }, e && n.invalidPattern.status && n.stringTooLong.status && n.stringTooShort.status }, _validatePattern: function() {
  2863. if (this.schema.pattern) {
  2864. var e = this.getValue();
  2865. if ("" === e && this.options.allowOptionalEmpty && !this.isRequired()) return !0;
  2866. if (t.isEmpty(e) && (e = ""), "string" == typeof e && !e.match(this.schema.pattern)) return !1 }
  2867. return !0 }, _validateMinLength: function() {
  2868. if (!t.isEmpty(this.schema.minLength)) {
  2869. var e = this.getValue();
  2870. if (e !== e && (e = ""), "" === e && this.options.allowOptionalEmpty && !this.isRequired()) return !0;
  2871. if (t.isEmpty(e) && (e = ""), ("" + e).length < this.schema.minLength) return !1 }
  2872. return !0 }, _validateMaxLength: function() {
  2873. if (!t.isEmpty(this.schema.maxLength)) {
  2874. var e = this.getValue();
  2875. if ("" === e && this.options.allowOptionalEmpty && !this.isRequired()) return !0;
  2876. if (t.isEmpty(e) && (e = ""), ("" + e).length > this.schema.maxLength) return !1 }
  2877. return !0 }, focus: function(t) {
  2878. if (this.control && this.control.length > 0) {
  2879. var n = e(this.control).get(0);
  2880. try {
  2881. var i = n.value ? n.value.length : 0;
  2882. n.selectionStart = i, n.selectionEnd = i } catch (a) {}
  2883. n.focus(), t && t(this) } }, getType: function() {
  2884. return "string" }, onKeyPress: function(e) {
  2885. var n = this;
  2886. if (9 !== e.keyCode && 37 !== e.keyCode && 38 !== e.keyCode && 39 !== e.keyCode && 40 !== e.keyCode) {
  2887. if (8 === e.keyCode) {
  2888. if (!t.isEmpty(n.schema.minLength) && (n.options.constrainLengths || n.options.constrainMinLength)) {
  2889. var i = n.getValue() || "";
  2890. i.length <= n.schema.minLength && (e.preventDefault(), e.stopImmediatePropagation()) } } else if (!t.isEmpty(n.schema.maxLength) && (n.options.constrainLengths || n.options.constrainMaxLength)) {
  2891. var i = n.getValue() || "";
  2892. i.length >= n.schema.maxLength && (e.preventDefault(), e.stopImmediatePropagation()) }
  2893. 32 === e.keyCode && n.options.disallowEmptySpaces && (e.preventDefault(), e.stopImmediatePropagation()) } }, onKeyUp: function(t) {
  2894. var n = this;
  2895. n.updateMaxLengthIndicator(), e(this.field).trigger("fieldkeyup") }, getTitle: function() {
  2896. return "Single-Line Text" }, getDescription: function() {
  2897. return "Text field for single-line text." }, getSchemaOfSchema: function() {
  2898. return t.merge(this.base(), { properties: { minLength: { title: "Minimal Length", description: "Minimal length of the property value.", type: "number" }, maxLength: { title: "Maximum Length", description: "Maximum length of the property value.", type: "number" }, pattern: { title: "Pattern", description: "Regular expression for the property value.", type: "string" } } }) }, getOptionsForSchema: function() {
  2899. return t.merge(this.base(), { fields: { "default": { helper: "Field default value", type: "text" }, minLength: { type: "integer" }, maxLength: { type: "integer" }, pattern: { type: "text" } } }) }, getSchemaOfOptions: function() {
  2900. return t.merge(this.base(), { properties: { size: { title: "Field Size", description: "Field size.", type: "number", "default": 40 }, maskString: { title: "Mask Expression", description: "Expression for the field mask. Field masking will be enabled if not empty.", type: "string" }, placeholder: { title: "Field Placeholder", description: "Field placeholder.", type: "string" }, typeahead: { title: "Type Ahead", description: "Provides configuration for the $.typeahead plugin if it is available. For full configuration options, see: https://github.com/twitter/typeahead.js" }, allowOptionalEmpty: { title: "Allow Optional Empty", description: "Allows this non-required field to validate when the value is empty" }, inputType: { title: "HTML5 Input Type", description: "Allows for the override of the underlying HTML5 input type. If not specified, an assumed value is provided based on the kind of input control (i.e. 'text', 'date', 'email' and so forth)", type: "string" }, data: { title: "Data attributes for the underlying DOM input control", description: "Allows you to specify a key/value map of data attributes that will be added as DOM attribuets for the underlying input control. The data attributes will be added as data-{name}='{value}'.", type: "object" }, autocomplete: { title: "HTML autocomplete attribute for the underlying DOM input control", description: "Allows you to specify the autocomplete attribute for the underlying input control whether or not field should have autocomplete enabled.", type: "string" }, disallowEmptySpaces: { title: "Disallow Empty Spaces", description: "Whether to disallow the entry of empty spaces in the text", type: "boolean", "default": !1 }, disallowOnlyEmptySpaces: { title: "Disallow Only Empty Spaces", description: "Whether to disallow the entry of only empty spaces in the text", type: "boolean", "default": !1 } } }) }, getOptionsForOptions: function() {
  2901. return t.merge(this.base(), { fields: { size: { type: "integer" }, maskString: { helper: "a - an alpha character;9 - a numeric character;* - an alphanumeric character", type: "text" }, typeahead: { type: "object" }, allowOptionalEmpty: { type: "checkbox" }, inputType: { type: "text" }, data: { type: "object" } } }) } }), t.registerMessages({ invalidPattern: "This field should have pattern {0}", stringTooShort: "This field should contain at least {0} numbers or characters", stringTooLong: "This field should contain at most {0} numbers or characters" }), t.registerFieldClass("text", t.Fields.TextField), t.registerDefaultSchemaFieldMapping("string", "text") }(jQuery),
  2902. function(e) {
  2903. var t = e.alpaca;
  2904. t.Fields.TextAreaField = t.Fields.TextField.extend({ getFieldType: function() {
  2905. return "textarea" }, setup: function() { this.base(), this.options.rows || (this.options.rows = 5), this.options.cols || (this.options.cols = 40) }, handleValidate: function() {
  2906. var e = this.base(),
  2907. n = this.validation,
  2908. i = this._validateWordCount();
  2909. return n.wordLimitExceeded = { message: i ? "" : t.substituteTokens(this.getMessage("wordLimitExceeded"), [this.options.wordlimit]), status: i }, e && n.wordLimitExceeded.status }, _validateWordCount: function() {
  2910. if (this.options.wordlimit && this.options.wordlimit > -1) {
  2911. var e = this.data;
  2912. if (e) {
  2913. var t = e.split(" ").length;
  2914. if (t > this.options.wordlimit) return !1 } }
  2915. return !0 }, getTitle: function() {
  2916. return "Multi-Line Text" }, getDescription: function() {
  2917. return "Textarea field for multiple line text." }, getSchemaOfOptions: function() {
  2918. return t.merge(this.base(), { properties: { rows: { title: "Rows", description: "Number of rows", type: "number", "default": 5 }, cols: { title: "Columns", description: "Number of columns", type: "number", "default": 40 }, wordlimit: { title: "Word Limit", description: "Limits the number of words allowed in the text area.", type: "number", "default": -1 } } }) }, getOptionsForOptions: function() {
  2919. return t.merge(this.base(), { fields: { rows: { type: "integer" }, cols: { type: "integer" }, wordlimit: { type: "integer" } } }) } }), t.registerMessages({ wordLimitExceeded: "The maximum word limit of {0} has been exceeded." }), t.registerFieldClass("textarea", t.Fields.TextAreaField) }(jQuery),
  2920. function(e) {
  2921. var t = e.alpaca;
  2922. t.Fields.CheckBoxField = t.ControlField.extend({ getFieldType: function() {
  2923. return "checkbox" }, setup: function() {
  2924. var n = this;
  2925. if (n.base(), "undefined" == typeof n.options.multiple && ("array" === n.schema.type ? n.options.multiple = !0 : "undefined" != typeof n.schema["enum"] && (n.options.multiple = !0)), n.options.multiple) {
  2926. if (n.checkboxOptions = [], n.getEnum()) { n.sortEnum();
  2927. var i = n.getOptionLabels();
  2928. e.each(n.getEnum(), function(e, a) {
  2929. var r = a;
  2930. i && (t.isEmpty(i[e]) ? t.isEmpty(i[a]) || (r = i[a]) : r = i[e]), n.checkboxOptions.push({ value: a, text: r }) }) }
  2931. n.options.datasource && !n.options.dataSource && (n.options.dataSource = n.options.datasource, delete n.options.datasource), "undefined" == typeof n.options.useDataSourceAsEnum && (n.options.useDataSourceAsEnum = !0) } else this.options.rightLabel || (this.options.rightLabel = "") }, prepareControlModel: function(e) {
  2932. var t = this;
  2933. this.base(function(n) { t.checkboxOptions && (n.checkboxOptions = t.checkboxOptions), e(n) }) }, getEnum: function() {
  2934. var e = this.base();
  2935. return e || this.schema && this.schema.items && this.schema.items["enum"] && (e = this.schema.items["enum"]), e }, getOptionLabels: function() {
  2936. var e = this.base();
  2937. return e || this.options && this.options.items && this.options.items.optionLabels && (e = this.options.items.optionLabels), e }, onClick: function(e) { this.refreshValidationState() }, beforeRenderControl: function(e, t) {
  2938. var n = this;
  2939. this.base(e, function() { n.options.dataSource ? (n.options.multiple = !0, n.checkboxOptions || (e.checkboxOptions = n.checkboxOptions = []), n.checkboxOptions.length = 0, n.invokeDataSource(n.checkboxOptions, e, function(e) {
  2940. if (n.options.useDataSourceAsEnum) {
  2941. for (var i = [], a = [], r = 0; r < n.checkboxOptions.length; r++) i.push(n.checkboxOptions[r].value), a.push(n.checkboxOptions[r].text);
  2942. n.setEnum(i), n.setOptionLabels(a) }
  2943. t() })) : t() }) }, postRender: function(t) {
  2944. var n = this;
  2945. this.base(function() {
  2946. if (n.data && "undefined" != typeof n.data && n.setValue(n.data), n.options.multiple && (e(n.getFieldEl()).find("input:checkbox").prop("checked", !1), n.data)) {
  2947. var i = n.data;
  2948. if ("string" == typeof n.data) { i = n.data.split(",");
  2949. for (var a = 0; a < i.length; a++) i[a] = e.trim(i[a]) }
  2950. for (var r in i) e(n.getFieldEl()).find('input:checkbox[data-checkbox-value="' + i[r] + '"]').prop("checked", !0) }
  2951. e(n.getFieldEl()).find("input:checkbox").change(function(e) { n.triggerWithPropagation("change") }), t() }) }, getControlValue: function() {
  2952. var n = this,
  2953. i = null;
  2954. if (n.options.multiple) {
  2955. for (var a = [], r = 0; r < n.checkboxOptions.length; r++) {
  2956. var o = e(n.getFieldEl()).find("input[data-checkbox-index='" + r + "']");
  2957. if (t.checked(o)) {
  2958. var l = e(o).attr("data-checkbox-value");
  2959. a.push(l) } } "array" === n.schema.type ? i = a : "string" === n.schema.type && (i = a.join(",")) } else {
  2960. var s = e(n.getFieldEl()).find("input");
  2961. i = s.length > 0 ? t.checked(e(s[0])) : !1 }
  2962. return i }, setValue: function(n) {
  2963. var i = this,
  2964. a = function(n) { t.isString(n) && (n = "true" === n);
  2965. var a = e(i.getFieldEl()).find("input");
  2966. a.length > 0 && t.checked(e(a[0]), n) },
  2967. r = function(a) { "string" == typeof a && (a = a.split(","));
  2968. for (var r = 0; r < a.length; r++) a[r] = t.trim(a[r]);
  2969. t.checked(e(i.getFieldEl()).find("input[data-checkbox-value]"), !1);
  2970. for (var o = 0; o < a.length; o++) {
  2971. var l = e(i.getFieldEl()).find('input[data-checkbox-value="' + a[o] + '"]');
  2972. l.length > 0 && t.checked(e(l[0]), n) } },
  2973. o = !1;
  2974. i.options.multiple ? "string" == typeof n ? (r(n), o = !0) : t.isArray(n) && (r(n), o = !0) : "boolean" == typeof n ? (a(n), o = !0) : "string" == typeof n && (a(n), o = !0), !o && n && t.logError("CheckboxField cannot set value for schema.type=" + i.schema.type + " and value=" + n), this.base(n) }, _validateEnum: function() {
  2975. var e = this;
  2976. if (!e.options.multiple) return !0;
  2977. var n = e.getValue();
  2978. return !e.isRequired() && t.isValEmpty(n) ? !0 : ("string" == typeof n && (n = n.split(",")), t.anyEquality(n, e.getEnum())) }, disable: function() { e(this.control).find("input").each(function() { e(this).disabled = !0, e(this).prop("disabled", !0) }) }, enable: function() { e(this.control).find("input").each(function() { e(this).disabled = !1, e(this).prop("disabled", !1) }) }, getType: function() {
  2979. return "boolean" }, getTitle: function() {
  2980. return "Checkbox Field" }, getDescription: function() {
  2981. return "Checkbox Field for boolean (true/false), string ('true', 'false' or comma-delimited string of values) or data array." }, getSchemaOfOptions: function() {
  2982. return t.merge(this.base(), { properties: { rightLabel: { title: "Option Label", description: "Optional right-hand side label for single checkbox field.", type: "string" }, multiple: { title: "Multiple", description: "Whether to render multiple checkboxes for multi-valued type (such as an array or a comma-delimited string)", type: "boolean" }, dataSource: { title: "Option DataSource", description: "Data source for generating list of options. This can be a string or a function. If a string, it is considered to be a URI to a service that produces a object containing key/value pairs or an array of elements of structure {'text': '', 'value': ''}. This can also be a function that is called to produce the same list.", type: "string" }, useDataSourceAsEnum: { title: "Use Data Source as Enumerated Values", description: "Whether to constrain the field's schema enum property to the values that come back from the data source.", type: "boolean", "default": !0 } } }) }, getOptionsForOptions: function() {
  2983. return t.merge(this.base(), { fields: { rightLabel: { type: "text" }, multiple: { type: "checkbox" }, dataSource: { type: "text" } } }) } }), t.registerFieldClass("checkbox", t.Fields.CheckBoxField), t.registerDefaultSchemaFieldMapping("boolean", "checkbox") }(jQuery),
  2984. function(e) {
  2985. var t = e.alpaca;
  2986. t.Fields.FileField = t.Fields.TextField.extend({ getFieldType: function() {
  2987. return "file" }, setValue: function(e) { this.data = e, this.data = e, this.updateObservable(), this.triggerUpdate() }, getControlValue: function() {
  2988. return this.data }, onChange: function(e) { this.base(e), this.options.selectionHandler && this.processSelectionHandler(e.target.files) }, processSelectionHandler: function(e) {
  2989. if (e && e.length > 0 && "undefined" != typeof FileReader) {
  2990. var t = [],
  2991. n = 0,
  2992. i = new FileReader;
  2993. i.onload = function() {
  2994. var i = this;
  2995. return function(a) {
  2996. var r = a.target.result;
  2997. t.push(r), n++, n === e.length && i.options.selectionHandler.call(i, e, t) } }.call(this);
  2998. for (var a = 0; a < e.length; a++) i.readAsDataURL(e[a]) } }, getTitle: function() {
  2999. return "File Field" }, getDescription: function() {
  3000. return "Field for uploading files." }, getSchemaOfOptions: function() {
  3001. return t.merge(this.base(), { properties: { selectionHandler: { title: "Selection Handler", description: "Function that should be called when files are selected. Requires HTML5.", type: "boolean", "default": !1 } } }) }, getOptionsForOptions: function() {
  3002. return t.merge(this.base(), { fields: { selectionHandler: { type: "checkbox" } } }) } }), t.registerFieldClass("file", t.Fields.FileField) }(jQuery),
  3003. function(e) {
  3004. var t = e.alpaca;
  3005. t.Fields.ListField = t.ControlField.extend({ setup: function() {
  3006. var n = this;
  3007. if (n.base(), n.selectOptions = [], n.getEnum()) { n.sortEnum();
  3008. var i = n.getOptionLabels();
  3009. e.each(n.getEnum(), function(e, a) {
  3010. var r = a;
  3011. i && (t.isEmpty(i[e]) ? t.isEmpty(i[a]) || (r = i[a]) : r = i[e]), n.selectOptions.push({ value: a, text: r }) }) }
  3012. if (n.isRequired() && !n.data && n.options.removeDefaultNone === !0) {
  3013. var a = n.getEnum();
  3014. a && a.length > 0 && (n.data = a[0]) }
  3015. n.options.datasource && !n.options.dataSource && (n.options.dataSource = n.options.datasource, delete n.options.datasource), "undefined" == typeof n.options.useDataSourceAsEnum && (n.options.useDataSourceAsEnum = !0) }, prepareControlModel: function(e) {
  3016. var t = this;
  3017. this.base(function(n) { "undefined" == typeof t.options.noneLabel && (t.options.noneLabel = t.getMessage("noneLabel")), "undefined" == typeof t.options.hideNone && ("undefined" != typeof t.options.removeDefaultNone ? t.options.hideNone = t.options.removeDefaultNone : t.options.hideNone = t.isRequired()), e(n) }) }, beforeRenderControl: function(e, t) {
  3018. var n = this,
  3019. i = function() {
  3020. for (var e = n.convertToScalarValue(n.data), i = 0; i < n.selectOptions.length; i++)
  3021. if (e === n.selectOptions[i].value) { n.selectOptions[i].selected = !0;
  3022. break }
  3023. t() };
  3024. this.base(e, function() { n.options.dataSource ? (n.selectOptions.length = 0, n.invokeDataSource(n.selectOptions, e, function() {
  3025. if (n.options.useDataSourceAsEnum) {
  3026. for (var e = [], t = [], a = 0; a < n.selectOptions.length; a++) e.push(n.selectOptions[a].value), t.push(n.selectOptions[a].text);
  3027. n.setEnum(e), n.setOptionLabels(t) }
  3028. i() })) : i() }) }, convertToScalarValue: function(e) {
  3029. return e }, convertToDataValue: function(e, t) { t(null, e) }, getSchemaOfSchema: function() {
  3030. return t.merge(this.base(), { properties: { "enum": { title: "Enumeration", description: "List of field value options", type: "array", required: !0 } } }) }, getSchemaOfOptions: function() {
  3031. return t.merge(this.base(), { properties: { dataSource: { title: "Option Datasource", description: "Datasource for generating list of options. This can be a string or a function. If a string, it is considered to be a URI to a service that produces a object containing key/value pairs or an array of elements of structure {'text': '', 'value': ''}. This can also be a function that is called to produce the same list.", type: "string" }, removeDefaultNone: { title: "Remove Default None", description: "If true, the default 'None' option will not be shown.", type: "boolean", "default": !1 }, noneLabel: { title: "None Label", description: "The label to use for the 'None' option in a list (select, radio or otherwise).", type: "string", "default": "None" }, hideNone: { title: "Hide None", description: "Whether to hide the None option from a list (select, radio or otherwise). This will be true if the field is required and false otherwise.", type: "boolean", "default": !1 }, useDataSourceAsEnum: { title: "Use Data Source as Enumerated Values", description: "Whether to constrain the field's schema enum property to the values that come back from the data source.", type: "boolean", "default": !0 } } }) }, getOptionsForOptions: function() {
  3032. return t.merge(this.base(), { fields: { dataSource: { type: "text" }, removeDefaultNone: { type: "checkbox", rightLabel: "Remove Default None" }, noneLabel: { type: "text" }, hideNone: { type: "checkbox", rightLabel: "Hide the 'None' option from the list" } } }) } }), t.registerMessages({ noneLabel: "None" }) }(jQuery),
  3033. function(e) {
  3034. var t = e.alpaca;
  3035. t.Fields.RadioField = t.Fields.ListField.extend({ getFieldType: function() {
  3036. return "radio" }, setup: function() { this.base(), this.options.name ? this.name = this.options.name : this.name || (this.name = this.getId() + "-name"), t.isUndefined(this.options.emptySelectFirst) && (this.options.emptySelectFirst = !1), t.isUndefined(this.options.vertical) && (this.options.vertical = !0) }, getControlValue: function() {
  3037. var t = this,
  3038. n = null;
  3039. return e(this.control).find(":checked").each(function() { n = e(this).val(), n = t.ensureProperType(n) }), n }, setValue: function(n) {
  3040. var i = this;
  3041. e(this.control).find("input").each(function() { t.checked(e(this), null) }), "undefined" != typeof n && t.checked(e(i.control).find('input[value="' + n + '"]'), "checked"), this.options.emptySelectFirst && 0 === e(this.control).find("input:checked").length && t.checked(e(i.control).find("input:radio").first(), "checked"), this.base(n) }, initControlEvents: function() {
  3042. var t = this;
  3043. t.base();
  3044. var n = e(this.control).find("input");
  3045. n.focus(function(e) { t.suspendBlurFocus || (t.onFocus.call(t, e), t.trigger("focus", e)) }), n.blur(function(e) { t.suspendBlurFocus || (t.onBlur.call(t, e), t.trigger("blur", e)) }) }, prepareControlModel: function(e) {
  3046. var t = this;
  3047. this.base(function(n) { n.selectOptions = t.selectOptions, n.removeDefaultNone = t.options.removeDefaultNone, e(n) }) }, afterRenderControl: function(n, i) {
  3048. var a = this;
  3049. this.base(n, function() { a.options.emptySelectFirst && a.selectOptions && a.selectOptions.length > 0 && (a.data = a.selectOptions[0].value, 0 === e("input:radio:checked", a.control).length && t.checked(e(a.control).find('input:radio[value="' + a.data + '"]'), "checked")), a.options.vertical ? e(a.control).css("display", "block") : e(a.control).css("display", "inline-block"), i() }) }, updateDOMElement: function() { this.base(), e(this.control).find("input:radio").attr("name", this.getName()) }, onClick: function(t) {
  3050. var n = this,
  3051. i = n.getValue();
  3052. this.base(t);
  3053. var a = e(t.currentTarget).find("input").val(); "undefined" != typeof a && (n.setValue(a), n.refreshValidationState(), i !== a && n.trigger("change")) }, disable: function() { this.base(), this.getFieldEl().addClass("disabled") }, enable: function() { this.base(), this.getFieldEl().removeClass("disabled") }, getTitle: function() {
  3054. return "Radio Group Field" }, getDescription: function() {
  3055. return "Radio Group Field with list of options." }, getSchemaOfOptions: function() {
  3056. return t.merge(this.base(), { properties: { name: { title: "Field name", description: "Field name.", type: "string" }, emptySelectFirst: { title: "Empty Select First", description: "If the data is empty, then automatically select the first item in the list.", type: "boolean", "default": !1 }, vertical: { title: "Position the radio selector items vertically", description: "By default, radio controls are stacked vertically. Set to false if you'd like radio controls to lay out horizontally.", type: "boolean", "default": !0 } } }) } }), t.registerFieldClass("radio", t.Fields.RadioField) }(jQuery),
  3057. function(e) {
  3058. var t = e.alpaca;
  3059. t.Fields.SelectField = t.Fields.ListField.extend({
  3060. getFieldType: function() {
  3061. return "select" },
  3062. setup: function() {
  3063. var t = this;
  3064. this.base(), t.schema.type && "array" === t.schema.type && (t.options.multiple = !0), t.options.multiple && e.fn.multiselect && "undefined" == typeof t.options.hideNone && (t.options.hideNone = !0), this.schema.items && this.schema.items.maxItems && "undefined" == typeof this.schema.maxItems && (this.schema.maxItems = this.schema.items.maxItems, delete this.schema.items.maxItems), this.schema.items && this.schema.items.minItems && "undefined" == typeof this.schema.minItems && (this.schema.minItems = this.schema.items.minItems, delete this.schema.items.minItems), !t.options.multiselect && e.fn.multiselect && (t.options.multiselect = {}), t.options.multiselect && "undefined" == typeof t.options.multiselect.disableIfEmpty && (t.options.multiselect.disableIfEmpty = !0) },
  3065. getValue: function() {
  3066. var e = this;
  3067. return "object" === e.schema.type ? this.data : this.base() },
  3068. setValue: function(e) {
  3069. var n = this,
  3070. i = n.convertToScalarValue(e),
  3071. a = n.convertToScalarValue(n.getValue());
  3072. if (t.isArray(e)) t.compareArrayContent(i, a) || (!t.isEmpty(i) && this.control && this.control.val(i), this.base(e));
  3073. else {
  3074. var r = !1;
  3075. t.isEmpty(i) && t.isEmpty(a) ? r = !0 : i !== a && (r = !0), r && (n.control && "undefined" != typeof i && null !== i && n.control.val(i), this.base(e)) } },
  3076. getEnum: function() {
  3077. if (this.schema) {
  3078. if (this.schema["enum"]) return this.schema["enum"];
  3079. if (this.schema.type && "array" === this.schema.type && this.schema.items && this.schema.items["enum"]) return this.schema.items["enum"] } },
  3080. initControlEvents: function() {
  3081. var e = this;
  3082. if (e.base(), e.options.multiple) {
  3083. var t = this.control.parent().find("button.multiselect");
  3084. t.focus(function(t) { e.suspendBlurFocus || (e.onFocus.call(e, t), e.trigger("focus", t)) }), t.blur(function(t) { e.suspendBlurFocus || (e.onBlur.call(e, t), e.trigger("blur", t)) }) } },
  3085. prepareControlModel: function(e) {
  3086. var t = this;
  3087. this.base(function(n) { n.selectOptions = t.selectOptions, e(n) }) },
  3088. beforeRenderControl: function(e, n) { this.base(e, function() {
  3089. for (var i = [], a = {}, r = 0; r < e.selectOptions.length; r++) a[e.selectOptions[r].value] = e.selectOptions[r].text;
  3090. if (t.isArray(e.data))
  3091. for (var r = 0; r < e.data.length; r++) {
  3092. var o = a[e.data[r]];
  3093. o && i.push(o) } else {
  3094. var o = a[e.data];
  3095. o && i.push(o) }
  3096. e.displayableText = i.join(", "), n() }) },
  3097. afterRenderControl: function(n, i) {
  3098. var a = this;
  3099. this.base(n, function() {
  3100. if (t.isUndefined(a.data) && a.options.emptySelectFirst && a.selectOptions && a.selectOptions.length > 0 && (a.data = a.selectOptions[0].value),
  3101. a.data && a.setValue(a.data), a.options.multiple && e.fn.multiselect && !a.isDisplayOnly()) {
  3102. var n = null;
  3103. n = a.options.multiselect ? a.options.multiselect : {}, n.nonSelectedText || (n.nonSelectedText = "None", a.options.noneLabel && (n.nonSelectedText = a.options.noneLabel)), e(a.getControlEl()).multiselect(n) }
  3104. i()
  3105. })
  3106. },
  3107. _validateEnum: function() {
  3108. var n = this;
  3109. if (this.schema["enum"]) {
  3110. var i = this.data;
  3111. if (!this.isRequired() && t.isValEmpty(i)) return !0;
  3112. if (this.options.multiple) {
  3113. var a = !0;
  3114. return i || (i = []), t.isArray(i) || t.isObject(i) || (i = [i]), e.each(i, function(e, i) {
  3115. var r = n.convertToScalarValue(i),
  3116. o = t.inArray(n.schema["enum"], r);
  3117. o || (a = !1) }), a }
  3118. t.isArray(i) && (i = i[0]);
  3119. var r = n.convertToScalarValue(i);
  3120. return t.inArray(this.schema["enum"], r) }
  3121. return !0 },
  3122. onChange: function(e) {
  3123. var t = this,
  3124. n = t.getControlValue();
  3125. t.convertToDataValue(n, function(e, i) { t.data = i, t.control.val(n), t.updateObservable(), t.triggerUpdate(), t.refreshValidationState() }) },
  3126. _validateMinItems: function() {
  3127. return !(this.schema.minItems && this.schema.minItems >= 0 && e(":selected", this.control).length < this.schema.minItems) },
  3128. _validateMaxItems: function() {
  3129. return !(this.schema.maxItems && this.schema.maxItems >= 0 && e(":selected", this.control).length > this.schema.maxItems) },
  3130. handleValidate: function() {
  3131. var e = this.base(),
  3132. n = this.validation,
  3133. i = this._validateMaxItems();
  3134. return n.tooManyItems = { message: i ? "" : t.substituteTokens(this.getMessage("tooManyItems"), [this.schema.maxItems]), status: i }, i = this._validateMinItems(), n.notEnoughItems = { message: i ? "" : t.substituteTokens(this.getMessage("notEnoughItems"), [this.schema.minItems]), status: i }, e && n.tooManyItems.status && n.notEnoughItems.status },
  3135. focus: function(t) {
  3136. if (this.control && this.control.length > 0) {
  3137. var n = e(this.control).get(0);
  3138. n.focus(), t && t(this) } },
  3139. disable: function() {
  3140. var t = this;
  3141. this.base(), t.options.multiselect && e(t.getControlEl()).multiselect("disable") },
  3142. enable: function() {
  3143. var t = this;
  3144. this.base(), t.options.multiselect && e(t.getControlEl()).multiselect("enable") },
  3145. getTitle: function() {
  3146. return "Select Field" },
  3147. getDescription: function() {
  3148. return "Select Field" },
  3149. getSchemaOfOptions: function() {
  3150. return t.merge(this.base(), { properties: { multiple: { title: "Mulitple Selection", description: "Allow multiple selection if true.", type: "boolean", "default": !1 }, size: { title: "Displayed Options", description: "Number of options to be shown.", type: "number" }, emptySelectFirst: { title: "Empty Select First", description: "If the data is empty, then automatically select the first item in the list.", type: "boolean", "default": !1 }, multiselect: { title: "Multiselect Plugin Settings", description: "Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect", type: "any" } } }) },
  3151. getOptionsForOptions: function() {
  3152. return t.merge(this.base(), { fields: { multiple: { rightLabel: "Allow multiple selection ?", helper: "Allow multiple selection if checked", type: "checkbox" }, size: { type: "integer" }, emptySelectFirst: { type: "checkbox", rightLabel: "Empty Select First" }, multiselect: { type: "object", rightLabel: "Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect" } } }) }
  3153. }), t.registerFieldClass("select", t.Fields.SelectField)
  3154. }(jQuery),
  3155. function(e) {
  3156. var t = e.alpaca;
  3157. t.Fields.NumberField = t.Fields.TextField.extend({ setup: function() { this.base(), "undefined" == typeof this.options.numericEntry && (this.options.numericEntry = !1) }, getFieldType: function() {
  3158. return "number" }, postRender: function(e) {
  3159. var t = this;
  3160. this.base(function() { t.control && t.on("keypress", function(e) {
  3161. var n = e.charCode || e.keyCode || 0,
  3162. i = !0;
  3163. return t.options.numericEntry && (i = i && n >= 48 && 57 >= n), i || (e.preventDefault(), e.stopImmediatePropagation()), i }), e() }) }, getControlValue: function() {
  3164. var e = this._getControlVal(!0);
  3165. return "undefined" == typeof e || "" == e ? e : parseFloat(e) }, handleValidate: function() {
  3166. var e = this.base(),
  3167. n = this.validation,
  3168. i = this._validateNumber();
  3169. return n.stringNotANumber = { message: i ? "" : this.getMessage("stringNotANumber"), status: i }, i = this._validateDivisibleBy(), n.stringDivisibleBy = { message: i ? "" : t.substituteTokens(this.getMessage("stringDivisibleBy"), [this.schema.divisibleBy]), status: i }, i = this._validateMaximum(), n.stringValueTooLarge = { message: "", status: i }, i || (this.schema.exclusiveMaximum ? n.stringValueTooLarge.message = t.substituteTokens(this.getMessage("stringValueTooLargeExclusive"), [this.schema.maximum]) : n.stringValueTooLarge.message = t.substituteTokens(this.getMessage("stringValueTooLarge"), [this.schema.maximum])), i = this._validateMinimum(), n.stringValueTooSmall = { message: "", status: i }, i || (this.schema.exclusiveMinimum ? n.stringValueTooSmall.message = t.substituteTokens(this.getMessage("stringValueTooSmallExclusive"), [this.schema.minimum]) : n.stringValueTooSmall.message = t.substituteTokens(this.getMessage("stringValueTooSmall"), [this.schema.minimum])), i = this._validateMultipleOf(), n.stringValueNotMultipleOf = { message: "", status: i }, i || (n.stringValueNotMultipleOf.message = t.substituteTokens(this.getMessage("stringValueNotMultipleOf"), [this.schema.multipleOf])), e && n.stringNotANumber.status && n.stringDivisibleBy.status && n.stringValueTooLarge.status && n.stringValueTooSmall.status && n.stringValueNotMultipleOf.status && n.invalidPattern.status && n.stringTooLong.status && n.stringTooShort.status }, _validateOptional: function() {
  3170. return this.isDisplayOnly() || !this.isRequired() || !t.isValEmpty(e(this.control).val()) }, _validateNumber: function() {
  3171. var e = this._getControlVal();
  3172. if ("number" == typeof e && (e = "" + e), t.isValEmpty(e)) return !0;
  3173. var n = t.testRegex(t.regexps.number, e);
  3174. if (!n) return !1;
  3175. var i = this.getValue();
  3176. return !isNaN(i) }, _validateDivisibleBy: function() {
  3177. var e = this.getValue();
  3178. return !(!t.isEmpty(this.schema.divisibleBy) && e % this.schema.divisibleBy !== 0) }, _validateMaximum: function() {
  3179. var e = this.getValue();
  3180. if (!t.isEmpty(this.schema.maximum)) {
  3181. if (e > this.schema.maximum) return !1;
  3182. if (!t.isEmpty(this.schema.exclusiveMaximum) && e == this.schema.maximum && this.schema.exclusiveMaximum) return !1 }
  3183. return !0 }, _validateMinimum: function() {
  3184. var e = this.getValue();
  3185. if (!t.isEmpty(this.schema.minimum)) {
  3186. if (e < this.schema.minimum) return !1;
  3187. if (!t.isEmpty(this.schema.exclusiveMinimum) && e == this.schema.minimum && this.schema.exclusiveMinimum) return !1 }
  3188. return !0 }, _validateMultipleOf: function() {
  3189. var e = this.getValue();
  3190. return t.isEmpty(this.schema.multipleOf) || !e || 0 === this.schema.multipleOf }, getType: function() {
  3191. return "number" }, onKeyPress: function(e) {
  3192. var n = this;
  3193. if (9 !== e.keyCode && 37 !== e.keyCode && 38 !== e.keyCode && 39 !== e.keyCode && 40 !== e.keyCode) {
  3194. if (8 === e.keyCode) {
  3195. if (!t.isEmpty(n.schema.minLength) && (n.options.constrainLengths || n.options.constrainMinLength)) {
  3196. var i = n.getValue() || "";
  3197. t.isNumber(i) && (i = i.toString()), i.length <= n.schema.minLength && (e.preventDefault(), e.stopImmediatePropagation()) } } else if (!t.isEmpty(n.schema.maxLength) && (n.options.constrainLengths || n.options.constrainMaxLength)) {
  3198. var i = n.getValue() || "";
  3199. t.isNumber(i) && (i = i.toString()), i.length >= n.schema.maxLength && (e.preventDefault(), e.stopImmediatePropagation()) }
  3200. 32 === e.keyCode && n.options.disallowEmptySpaces && (e.preventDefault(), e.stopImmediatePropagation()) } }, onKeyUp: function(t) {
  3201. var n = this;
  3202. n.updateMaxLengthIndicator(), e(this.field).trigger("fieldkeyup") }, getSchemaOfSchema: function() {
  3203. return t.merge(this.base(), { properties: { multipleOf: { title: "Multiple Of", description: "Property value must be a multiple of the multipleOf schema property such that division by this value yields an interger (mod zero).", type: "number" }, minimum: { title: "Minimum", description: "Minimum value of the property.", type: "number" }, maximum: { title: "Maximum", description: "Maximum value of the property.", type: "number" }, exclusiveMinimum: { title: "Exclusive Minimum", description: "Property value can not equal the number defined by the minimum schema property.", type: "boolean", "default": !1 }, exclusiveMaximum: { title: "Exclusive Maximum", description: "Property value can not equal the number defined by the maximum schema property.", type: "boolean", "default": !1 } } }) }, getOptionsForSchema: function() {
  3204. return t.merge(this.base(), { fields: { multipleOf: { title: "Multiple Of", description: "The value must be a integral multiple of the property", type: "number" }, minimum: { title: "Minimum", description: "Minimum value of the property", type: "number" }, maximum: { title: "Maximum", description: "Maximum value of the property", type: "number" }, exclusiveMinimum: { rightLabel: "Exclusive minimum ?", helper: "Field value must be greater than but not equal to this number if checked", type: "checkbox" }, exclusiveMaximum: { rightLabel: "Exclusive Maximum ?", helper: "Field value must be less than but not equal to this number if checked", type: "checkbox" } } }) }, getSchemaOfOptions: function() {
  3205. return t.merge(this.base(), { properties: { numericEntry: { title: "Numeric Entry", description: "Whether to constrain data entry key presses to numeric values (0-9)", type: "boolean", "default": !1 } } }) }, getTitle: function() {
  3206. return "Number Field" }, getDescription: function() {
  3207. return "Field for float numbers." } }), t.registerMessages({ stringValueTooSmall: "The minimum value for this field is {0}", stringValueTooLarge: "The maximum value for this field is {0}", stringValueTooSmallExclusive: "Value of this field must be greater than {0}", stringValueTooLargeExclusive: "Value of this field must be less than {0}", stringDivisibleBy: "The value must be divisible by {0}", stringNotANumber: "This value is not a number.", stringValueNotMultipleOf: "This value is not a multiple of {0}" }), t.registerFieldClass("number", t.Fields.NumberField), t.registerDefaultSchemaFieldMapping("number", "number") }(jQuery),
  3208. function(e) {
  3209. var t = e.alpaca;
  3210. t.Fields.ArrayField = t.ContainerField.extend({ getFieldType: function() {
  3211. return "array" }, setup: function() {
  3212. var n = this;
  3213. this.base();
  3214. var i = n.resolveContainerItemTemplateType();
  3215. if (!i) return t.throwErrorWithCallback("Unable to find template descriptor for container item: " + n.getFieldType());
  3216. this.containerItemTemplateDescriptor = n.view.getTemplateDescriptor("container-" + i + "-item", n), this.options.toolbarStyle || (this.options.toolbarStyle = t.isEmpty(this.view.toolbarStyle) ? "button" : this.view.toolbarStyle), this.options.toolbarStyle || (this.options.toolbarStyle = "button"), this.options.actionbarStyle || (this.options.actionbarStyle = t.isEmpty(this.view.actionbarStyle) ? "top" : this.view.actionbarStyle), this.options.actionbarStyle || (this.options.actionbarStyle = "top"), this.schema.items || (this.schema.items = {}), this.options.items || (this.options.items = {}), this.schema.items && this.schema.items.maxItems && "undefined" == typeof this.schema.maxItems && (this.schema.maxItems = this.schema.items.maxItems, delete this.schema.items.maxItems), this.schema.items && this.schema.items.minItems && "undefined" == typeof this.schema.minItems && (this.schema.minItems = this.schema.items.minItems, delete this.schema.items.minItems), this.schema.items && this.schema.items.uniqueItems && "undefined" == typeof this.schema.uniqueItems && (this.schema.uniqueItems = this.schema.items.uniqueItems, delete this.schema.items.uniqueItems), this.options.rubyrails = !1, this.parent && this.parent.options && this.parent.options.form && this.parent.options.form.attributes && (t.isEmpty(this.parent.options.form.attributes.rubyrails) || (this.options.rubyrails = !0));
  3217. var a = t.defaultToolbarSticky;
  3218. if (t.isEmpty(this.view.toolbarSticky) || (a = this.view.toolbarSticky), t.isEmpty(this.options.toolbarSticky) || (a = this.options.toolbarSticky), this.options.toolbarSticky = a, "undefined" == typeof n.options.hideToolbarWithChildren && (n.options.hideToolbarWithChildren = !0), this.schema.items && this.schema.uniqueItems && t.mergeObject(this.options, { forceRevalidation: !0 }), "undefined" == typeof this.data && (this.data = []), null == this.data && (this.data = []), "" == this.data && (this.data = []), t.isString(this.data)) try {
  3219. var r = t.parseJSON(this.data);
  3220. if (!t.isArray(r) && !t.isObject(r)) return void t.logWarn("ArrayField parsed string data but it was not an array: " + this.data);
  3221. this.data = r } catch (o) { this.data = [this.data] }
  3222. if (!t.isArray(this.data) && !t.isObject(this.data)) return void t.logWarn("ArrayField data is not an array: " + JSON.stringify(this.data, null, " "));
  3223. var l = function(e, t, i) {
  3224. var a = n.findAction(e, t);
  3225. a || (a = { core: !0 }, e.push(a));
  3226. for (var r in i) a[r] || (a[r] = i[r]) },
  3227. s = function(e, t) {
  3228. var n = 0;
  3229. do "undefined" == typeof e[n].enabled && (e[n].enabled = !0), t || delete e[n].label, e[n].enabled ? n++ : e.splice(n, 1); while (n < e.length);
  3230. e.sort(function(e, t) {
  3231. return e.core && !t.core ? -1 : !e.core && t.core ? 1 : 0 }) };
  3232. if (n.toolbar = {}, n.options.toolbar)
  3233. for (var u in n.options.toolbar) n.toolbar[u] = t.copyOf(n.options.toolbar[u]);
  3234. if ("undefined" == typeof n.toolbar.showLabels && (n.toolbar.showLabels = !0), n.toolbar.actions || (n.toolbar.actions = []), l(n.toolbar.actions, "add", { label: n.getMessage("addItemButtonLabel"), action: "add", iconClass: n.view.getStyle("addIcon"), click: function(e, t) { n.handleToolBarAddItemClick(function(e) {}) } }), s(n.toolbar.actions, n.toolbar.showLabels), n.actionbar = {}, n.options.actionbar)
  3235. for (var c in n.options.actionbar) n.actionbar[c] = t.copyOf(n.options.actionbar[c]); "undefined" == typeof n.actionbar.showLabels && (n.actionbar.showLabels = !1), n.actionbar.actions || (n.actionbar.actions = []), l(n.actionbar.actions, "add", { label: n.getMessage("addButtonLabel"), action: "add", iconClass: n.view.getStyle("addIcon"), click: function(e, t, i) { n.handleActionBarAddItemClick(i, function(e) {}) } }), l(n.actionbar.actions, "remove", { label: n.getMessage("removeButtonLabel"), action: "remove", iconClass: n.view.getStyle("removeIcon"), click: function(e, t, i) { n.handleActionBarRemoveItemClick(i, function(e) {}) } }), l(n.actionbar.actions, "up", { label: n.getMessage("upButtonLabel"), action: "up", iconClass: n.view.getStyle("upIcon"), click: function(e, t, i) { n.handleActionBarMoveItemUpClick(i, function() {}) } }), l(n.actionbar.actions, "down", { label: n.getMessage("downButtonLabel"), action: "down", iconClass: n.view.getStyle("downIcon"), click: function(e, t, i) { n.handleActionBarMoveItemDownClick(i, function() {}) } }), s(n.actionbar.actions, n.actionbar.showLabels);
  3236. var d = this.data.length,
  3237. p = e.extend(!0, {}, this.data);
  3238. p.length = d, this.data = Array.prototype.slice.call(p) }, setValue: function(e) {
  3239. var n = this;
  3240. if (e && t.isArray(e)) {
  3241. var i = 0;
  3242. do
  3243. if (i < n.children.length) {
  3244. var a = n.children[i];
  3245. e.length > i ? (a.setValue(e[i]), i++) : n.removeItem(i) }
  3246. while (i < n.children.length);
  3247. i < e.length && n.resolveItemSchemaOptions(function(a, r, o) {
  3248. if (a || t.logDebug("Unable to resolve schema for item: " + i), o) return t.throwErrorWithCallback("Circular reference detected for schema: " + JSON.stringify(a), n.errorCallback);
  3249. for (var l = []; i < e.length;) {
  3250. var s = function(e, i) {
  3251. return function(o) { n.addItem(e, a, r, i[e], function() { t.nextTick(function() { o() }) }) } }(i, e);
  3252. l.push(s), i++ }
  3253. t.series(l, function() {}) }) } }, getContainerValue: function() {
  3254. if (0 === this.children.length && !this.isRequired()) return [];
  3255. for (var e = [], t = 0; t < this.children.length; t++) {
  3256. var n = this.children[t].getValue();
  3257. n !== n && (n = void 0), "undefined" != typeof n && e.push(n) }
  3258. return e }, createItems: function(e) {
  3259. var n = this,
  3260. i = [];
  3261. n.data && n.data.length > 0 ? n.resolveItemSchemaOptions(function(a, r, o) {
  3262. if (o) return t.throwErrorWithCallback("Circular reference detected for schema: " + JSON.stringify(a), n.errorCallback);
  3263. for (var l = [], s = 0; s < n.data.length; s++) {
  3264. var u = n.data[s],
  3265. c = function(e, t) {
  3266. return function(o) { n.createItem(e, a, r, t, function(e) { i.push(e), o() }) } }(s, u);
  3267. l.push(c) }
  3268. t.nextTick(function() { t.series(l, function(t) { e(i) }) }) }) : e(i) }, createItem: function(n, i, a, r, o) {
  3269. var l = this;
  3270. if (l._validateEqualMaxItems()) {
  3271. var s = e("<div></div>");
  3272. s.alpaca({ data: r, options: a, schema: i, view: this.view.id ? this.view.id : this.view, connector: this.connector, error: function(e) { l.destroy(), l.errorCallback.call(l, e) }, notTopLevel: !0, render: function(e, t) { e.parent = l, e.path = l.path + "[" + n + "]", e.render(null, function() { t && t() }) }, postRender: function(n) {
  3273. var i = t.tmpl(l.containerItemTemplateDescriptor, { id: l.getId(), name: n.name, parentFieldId: l.getId(), actionbarStyle: l.options.actionbarStyle, view: l.view, data: r }),
  3274. a = e(i).find("." + t.MARKER_CLASS_CONTAINER_FIELD_ITEM_FIELD);
  3275. return 0 === a.length && e(i).hasClass(t.MARKER_CLASS_CONTAINER_FIELD_ITEM_FIELD) && (a = e(i)), 0 === a.length ? void l.errorCallback.call(l, { message: "Cannot find insertion point for field: " + l.getId() }) : (e(a).before(n.getFieldEl()), e(a).remove(), n.containerItemEl = i, t.fieldApplyFieldAndChildren(n, function(e) { e.hideInitValidationError = !1 }), t.isFunction(l.options.items.postRender) && l.options.items.postRender.call(n, a), void(o && o(n))) } }) } }, resolveItemSchemaOptions: function(e) {
  3276. var n, i = this,
  3277. a = function(t, n, a) { i.options.readonly && (n.readonly = !0), e(t, n, a) };!n && i.options && i.options.fields && i.options.fields.item && (n = i.options.fields.item), !n && i.options && i.options.items && (n = i.options.items);
  3278. var r;
  3279. if (i.schema && i.schema.items && (r = i.schema.items), r && r.$ref) {
  3280. var o = r.$ref,
  3281. l = r.$ref;
  3282. n.$ref && (l = n.$ref);
  3283. for (var s = this, u = [s]; s.parent;) s = s.parent, u.push(s);
  3284. var c = r,
  3285. d = n;
  3286. t.loadRefSchemaOptions(s, o, l, function(e, n) {
  3287. for (var i = 0, r = 0; r < u.length; r++) u[r].schema && (u[r].schema.id === o || u[r].schema.id === "#" + o ? i++ : u[r].schema.$ref === o && i++);
  3288. var l = i > 10,
  3289. s = {};
  3290. c && t.mergeObject(s, c), e && t.mergeObject(s, e), delete s.id;
  3291. var p = {};
  3292. d && t.mergeObject(p, d), n && t.mergeObject(p, n), t.nextTick(function() { a(s, p, l) }) }) } else t.nextTick(function() { a(r, n) }) }, handleValidate: function() {
  3293. var e = this.base(),
  3294. n = this.validation,
  3295. i = this._validateUniqueItems();
  3296. return n.valueNotUnique = { message: i ? "" : this.getMessage("valueNotUnique"), status: i }, i = this._validateMaxItems(), n.tooManyItems = { message: i ? "" : t.substituteTokens(this.getMessage("tooManyItems"), [this.schema.maxItems]), status: i }, i = this._validateMinItems(), n.notEnoughItems = { message: i ? "" : t.substituteTokens(this.getMessage("notEnoughItems"), [this.schema.minItems]), status: i }, e && n.valueNotUnique.status && n.tooManyItems.status && n.notEnoughItems.status }, _validateEqualMaxItems: function() {
  3297. return !(this.schema.maxItems && this.schema.maxItems >= 0 && this.getSize() >= this.schema.maxItems) }, _validateEqualMinItems: function() {
  3298. return !(this.schema.minItems && this.schema.minItems >= 0 && this.getSize() <= this.schema.minItems) }, _validateMinItems: function() {
  3299. return !(this.schema.minItems && this.schema.minItems >= 0 && this.getSize() < this.schema.minItems) }, _validateMaxItems: function() {
  3300. return !(this.schema.maxItems && this.schema.maxItems >= 0 && this.getSize() > this.schema.maxItems) }, _validateUniqueItems: function() {
  3301. if (this.schema.items && this.schema.uniqueItems)
  3302. for (var e = {}, t = 0; t < this.children.length; t++) {
  3303. var n = this.children[t].getValue();
  3304. if (n || (n = ""), e[n]) return !1;
  3305. e[n] = !0 }
  3306. return !0 }, findAction: function(t, n) {
  3307. var i = null;
  3308. return e.each(t, function(e, t) { t.action === n && (i = t) }), i }, postRender: function(e) {
  3309. var t = this;
  3310. this.base(function() { t.updateToolbars(), e() }) }, getSize: function() {
  3311. return this.children.length }, updateDOMElement: function() { this.updatePathAndName(), this.base() }, updatePathAndName: function() {
  3312. var n = function(i) { i.children && e.each(i.children, function(a, r) { i.prePath && t.startsWith(r.path, i.prePath) && (r.prePath = r.path, r.path = r.path.replace(i.prePath, i.path)), i.preName && t.startsWith(r.name, i.preName) && (r.preName = r.name, r.name = r.name.replace(i.preName, i.name), r.field && e(r.field).attr("name", r.name)), n(r) }) };
  3313. this.children && this.children.length > 0 && e.each(this.children, function(t, i) {
  3314. var a = i.path.lastIndexOf("/"),
  3315. r = i.path.substring(a + 1);
  3316. r.indexOf("[") < 0 && r.indexOf("]") < 0 && (r = r.substring(r.indexOf("[") + 1, r.indexOf("]"))), r !== t && (i.prePath = i.path, i.path = i.path.substring(0, a) + "/[" + t + "]"), i.nameCalculated && (i.preName = i.name, i.parent && i.parent.name && i.path ? i.name = i.parent.name + "_" + t : i.path && (i.name = i.path.replace(/\//g, "").replace(/\[/g, "_").replace(/\]/g, "")), this.parent.options.rubyrails ? e(i.field).attr("name", i.parent.name) : e(i.field).attr("name", i.name)), i.prePath || (i.prePath = i.path), n(i) }) }, updateToolbars: function() {
  3317. var t = this;
  3318. if ("display" !== this.view.type && !this.schema.readonly) { t.toolbar && (t.fireCallback("arrayToolbar", !0), t.fireCallback("arrayToolbar")), t.actionbar && (t.fireCallback("arrayActionbars", !0), t.fireCallback("arrayActionbars"));
  3319. var n = e(this.getFieldEl()).find(".alpaca-array-toolbar[data-alpaca-array-toolbar-field-id='" + t.getId() + "']");
  3320. if (this.children.length > 0 && t.options.hideToolbarWithChildren ? e(n).hide() : (e(n).show(), e(n).find("[data-alpaca-array-toolbar-action]").each(function() {
  3321. var n = e(this).attr("data-alpaca-array-toolbar-action"),
  3322. i = t.findAction(t.toolbar.actions, n);
  3323. i && e(this).off().click(function(e) { e.preventDefault(), i.click.call(t, n, i) }) })), "undefined" == typeof this.options.toolbarSticky || null === this.options.toolbarSticky) {
  3324. var i = this.getFieldEl().find(".alpaca-container-item[data-alpaca-container-item-parent-field-id='" + t.getId() + "']");
  3325. e(i).each(function(n) {
  3326. var i = e(t.getFieldEl()).find(".alpaca-array-actionbar[data-alpaca-array-actionbar-parent-field-id='" + t.getId() + "'][data-alpaca-array-actionbar-item-index='" + n + "']");
  3327. i && i.length > 0 && (e(this).hover(function() { e(i).show() }, function() { e(i).hide() }), e(i).hide()) }) } else this.options.toolbarSticky ? e(t.getFieldEl()).find(".alpaca-array-actionbar[data-alpaca-array-actionbar-parent-field-id='" + t.getId() + "']").css("display", "inline-block") : this.options.toolbarSticky || e(t.getFieldEl()).find(".alpaca-array-actionbar[data-alpaca-array-actionbar-parent-field-id='" + t.getId() + "']").hide();
  3328. var a = e(t.getFieldEl()).find(".alpaca-array-actionbar[data-alpaca-array-actionbar-parent-field-id='" + t.getId() + "']");
  3329. e(a).each(function() {
  3330. var n = e(this).attr("data-alpaca-array-actionbar-item-index"); "string" == typeof n && (n = parseInt(n, 10)), e(this).children("[data-alpaca-array-actionbar-action]").each(function() {
  3331. var i = e(this).attr("data-alpaca-array-actionbar-action"),
  3332. a = t.findAction(t.actionbar.actions, i);
  3333. a && e(this).off().click(function(e) { e.preventDefault(), a.click.call(t, i, a, n) }) }), t._validateEqualMaxItems() ? (e(this).children("[data-alpaca-array-toolbar-action='add']").each(function(n) { e(this).removeClass("alpaca-button-disabled"), t.fireCallback("enableButton", this) }), e(this).children("[data-alpaca-array-actionbar-action='add']").each(function(n) { e(this).removeClass("alpaca-button-disabled"), t.fireCallback("enableButton", this) })) : (e(this).children("[data-alpaca-array-toolbar-action='add']").each(function(n) { e(this).addClass("alpaca-button-disabled"), t.fireCallback("disableButton", this) }), e(this).children("[data-alpaca-array-actionbar-action='add']").each(function(n) { e(this).addClass("alpaca-button-disabled"), t.fireCallback("disableButton", this) })), t._validateEqualMinItems() ? e(this).children("[data-alpaca-array-actionbar-action='remove']").each(function(n) { e(this).removeClass("alpaca-button-disabled"), t.fireCallback("enableButton", this) }) : e(this).children("[data-alpaca-array-actionbar-action='remove']").each(function(n) { e(this).addClass("alpaca-button-disabled"), t.fireCallback("disableButton", this) }) }), e(a).first().children("[data-alpaca-array-actionbar-action='up']").each(function() { e(this).addClass("alpaca-button-disabled"), t.fireCallback("disableButton", this) }), e(a).last().children("[data-alpaca-array-actionbar-action='down']").each(function() { e(this).addClass("alpaca-button-disabled"), t.fireCallback("disableButton", this) }) } }, doResolveItemContainer: function() {
  3334. var t = this;
  3335. return e(t.container) }, handleToolBarAddItemClick: function(e) {
  3336. var n = this;
  3337. n.resolveItemSchemaOptions(function(i, a, r) {
  3338. if (r) return t.throwErrorWithCallback("Circular reference detected for schema: " + JSON.stringify(i), n.errorCallback);
  3339. var o = n.children.length,
  3340. l = t.createEmptyDataInstance(i);
  3341. n.addItem(o, i, a, l, function(t) { e && e(t) }) }) }, handleActionBarAddItemClick: function(e, n) {
  3342. var i = this;
  3343. i.resolveItemSchemaOptions(function(a, r, o) {
  3344. if (o) return t.throwErrorWithCallback("Circular reference detected for schema: " + JSON.stringify(a), i.errorCallback);
  3345. var l = i.getValue(),
  3346. s = t.createEmptyDataInstance(a);
  3347. i.addItem(e + 1, a, r, s, function(t) { l.splice(e + 1, 0, t.getValue()), i.setValue(l), n && n(t) }) }) }, handleActionBarRemoveItemClick: function(e, t) {
  3348. var n = this;
  3349. n.removeItem(e, function() { t && t() }) }, handleActionBarMoveItemUpClick: function(e, t) {
  3350. var n = this;
  3351. n.swapItem(e, e - 1, n.options.animate, function() { t && t() }) }, handleActionBarMoveItemDownClick: function(e, t) {
  3352. var n = this;
  3353. n.swapItem(e, e + 1, n.options.animate, function() { t && t() }) }, doAddItem: function(n, i, a) {
  3354. var r = this,
  3355. o = r.doResolveItemContainer();
  3356. if (0 === n) e(o).append(i.containerItemEl);
  3357. else {
  3358. var l = o.children("[data-alpaca-container-item-index='" + (n - 1) + "']");
  3359. l && l.length > 0 && l.after(i.containerItemEl) }
  3360. r.doAfterAddItem(i, function(e) { t.fireReady(i), a(e) }) }, doAfterAddItem: function(e, t) { t() }, addItem: function(e, t, n, i, a) {
  3361. var r = this;
  3362. r._validateEqualMaxItems() && r.createItem(e, t, n, i, function(t) { r.registerChild(t, e), r.doAddItem(e, t, function() { r.handleRepositionDOMRefresh(), r.updateToolbars(), r.refreshValidationState(), r.trigger("add", t), r.triggerUpdate(), a && a(t) }) }) }, doRemoveItem: function(e, t) {
  3363. var n = this,
  3364. i = n.doResolveItemContainer();
  3365. i.children(".alpaca-container-item[data-alpaca-container-item-index='" + e + "']").remove(), n.doAfterRemoveItem(e, function(e) { t(e) }) }, doAfterRemoveItem: function(e, t) { t() }, removeItem: function(e, t) {
  3366. var n = this;
  3367. this._validateEqualMinItems() && (n.unregisterChild(e), n.doRemoveItem(e, function() { n.handleRepositionDOMRefresh(), n.updateToolbars(), n.refreshValidationState(), n.trigger("remove", e), n.triggerUpdate(), t && t() })) }, moveItem: function(n, i, a, r) {
  3368. var o = this;
  3369. if ("function" == typeof a && (r = a, a = o.options.animate), "undefined" == typeof a && (a = o.options.animate ? o.options.animate : !0), "string" == typeof n && (n = parseInt(n, 10)), "string" == typeof i && (i = parseInt(i, 10)), 0 > i && (i = 0), i >= o.children.length && (i = o.children.length - 1), -1 !== i && n !== i) {
  3370. var l = o.children[i];
  3371. if (l) {
  3372. var s = function() {
  3373. var e = i;
  3374. i > n && e--;
  3375. var t = o.children.splice(n, 1)[0];
  3376. o.children.splice(e, 0, t), o.data = o.getValue(), o.refresh(function() { o.refreshValidationState(), o.triggerUpdate(), o.trigger("move"), r && r() }) },
  3377. u = 0;
  3378. if (a && (u = 500), u > 0) {
  3379. var c = o.getId(),
  3380. d = o.getContainerEl().find(".alpaca-container-item[data-alpaca-container-item-index='" + n + "'][data-alpaca-container-item-parent-field-id='" + c + "']"),
  3381. p = o.getContainerEl().find(".alpaca-container-item[data-alpaca-container-item-index='" + i + "'][data-alpaca-container-item-parent-field-id='" + c + "']"),
  3382. h = e("<div class='tempMarker1'></div>");
  3383. d.before(h);
  3384. var f = e("<div class='tempMarker2'></div>");
  3385. p.before(f), t.animatedMove(d, p, u, function() { s() }) } else s() } } }, swapItem: function(n, i, a, r) {
  3386. var o = this;
  3387. if ("function" == typeof a && (r = a, a = o.options.animate), "undefined" == typeof a && (a = o.options.animate ? o.options.animate : !0), "string" == typeof n && (n = parseInt(n, 10)), "string" == typeof i && (i = parseInt(i, 10)), 0 > i && (i = 0), i >= o.children.length && (i = o.children.length - 1), -1 !== i && n !== i) {
  3388. var l = o.children[i];
  3389. if (l) {
  3390. var s = function() {
  3391. var e = o.children[n],
  3392. t = o.children[i];
  3393. o.children[n] = t, o.children[i] = e, o.data = o.getValue(), o.refresh(function() { o.refreshValidationState(), o.triggerUpdate(), o.trigger("move"), r && r() }) },
  3394. u = 0;
  3395. if (a && (u = 500), u > 0) {
  3396. var c = o.getId(),
  3397. d = o.getContainerEl().find(".alpaca-container-item[data-alpaca-container-item-index='" + n + "'][data-alpaca-container-item-parent-field-id='" + c + "']"),
  3398. p = o.getContainerEl().find(".alpaca-container-item[data-alpaca-container-item-index='" + i + "'][data-alpaca-container-item-parent-field-id='" + c + "']"),
  3399. h = e("<div class='tempMarker1'></div>");
  3400. d.before(h);
  3401. var f = e("<div class='tempMarker2'></div>");
  3402. p.before(f), t.animatedSwap(d, p, u, function() { s() }) } else s() } } }, getType: function() {
  3403. return "array" }, getTitle: function() {
  3404. return "Array Field" }, getDescription: function() {
  3405. return "Field for list of items with same data type or structure." }, getSchemaOfSchema: function() {
  3406. var e = { properties: { items: { title: "Array Items", description: "Schema for array items.", type: "object" }, minItems: { title: "Minimum Items", description: "Minimum number of items.", type: "number" }, maxItems: { title: "Maximum Items", description: "Maximum number of items.", type: "number" }, uniqueItems: { title: "Items Unique", description: "Item values should be unique if true.", type: "boolean", "default": !1 } } };
  3407. return this.children && this.children[0] && t.merge(e.properties.items.properties, this.children[0].getSchemaOfSchema()), t.merge(this.base(), e) }, getOptionsForSchema: function() {
  3408. return t.merge(this.base(), { fields: { items: { type: "object" }, minItems: { type: "integer" }, maxItems: { type: "integer" }, uniqueItems: { type: "checkbox" } } }) }, getSchemaOfOptions: function() {
  3409. var e = { properties: { toolbarSticky: { title: "Sticky Toolbar", description: "If true, the array item toolbar will always be enabled. If false, the toolbar is always disabled. If undefined or null, the toolbar will appear when hovered over.", type: "boolean", "default": void 0 }, toolbarStyle: { title: "Toolbar Style", description: "The kind of top-level toolbar to render for the array field. Either 'button' or 'link'.", type: "string", "default": "button" }, actionbarStyle: { title: "Actionbar Style", description: "The kind of actionbar to render for each item in the array. Either 'top', 'bottom', 'left', or 'right'.", type: "string", "default": "top" }, toolbar: { type: "object", title: "Toolbar Configuration", properties: { showLabels: { type: "boolean", "default": !0, title: "Whether to show labels next to actions" }, actions: { type: "array", title: "Toolbar Actions Configuration", items: { action: { type: "string", title: "Action Key" }, label: { type: "string", title: "Action Label" }, iconClass: { type: "string", title: "Action CSS Classes for Icon" }, click: { type: "function", title: "Action Click Handler" }, enabled: { type: "boolean", title: "Whether to enable the action", "default": !0 } } } } }, actionbar: { type: "object", properties: { showLabels: { type: "boolean", "default": !1, title: "Whether to show labels next to actions" }, actions: { type: "array", title: "Actions Bar Actions Configuration", items: { action: { type: "string", title: "Action Key" }, label: { type: "string", title: "Action Label" }, iconClass: { type: "string", title: "Action CSS Classes for Icon" }, click: { type: "function", title: "Action Click Handler" }, enabled: { type: "boolean", title: "Whether to enable the action", "default": !0 } } } } }, hideToolbarWithChildren: { type: "boolean", title: "Hide Toolbar with Children", description: "Indicates whether to hide the top toolbar when child elements are available.", "default": !0 } } };
  3410. return this.children && this.children[0] && t.merge(e.properties.items.properties, this.children[0].getSchemaOfSchema()), t.merge(this.base(), e) }, getOptionsForOptions: function() {
  3411. return t.merge(this.base(), { fields: { toolbarSticky: { type: "checkbox" }, items: { type: "object", fields: {} } } }) } }), t.registerMessages({ notEnoughItems: "The minimum number of items is {0}", tooManyItems: "The maximum number of items is {0}", valueNotUnique: "Values are not unique", notAnArray: "This value is not an Array" }), t.registerFieldClass("array", t.Fields.ArrayField), t.registerDefaultSchemaFieldMapping("array", "array"), t.registerMessages({ addItemButtonLabel: "Add New Item", addButtonLabel: "Add", removeButtonLabel: "Remove", upButtonLabel: "Up", downButtonLabel: "Down" }) }(jQuery),
  3412. function(e) {
  3413. var t = e.alpaca;
  3414. t.Fields.ObjectField = t.ContainerField.extend({
  3415. getFieldType: function() {
  3416. return "object" },
  3417. setup: function() {
  3418. var e = this;
  3419. this.base();
  3420. var n = e.resolveContainerItemTemplateType();
  3421. if (!n) { e.resolveContainerItemTemplateType();
  3422. return t.throwErrorWithCallback("Unable to find template descriptor for container item: " + e.getFieldType()) }
  3423. if (this.containerItemTemplateDescriptor = e.view.getTemplateDescriptor("container-" + n + "-item", e), !t.isEmpty(this.data) && "" !== this.data && !t.isObject(this.data)) {
  3424. if (!t.isString(this.data)) return;
  3425. try {
  3426. if (this.data = t.parseJSON(this.data), !t.isObject(this.data)) return void t.logWarn("ObjectField parsed data but it was not an object: " + JSON.stringify(this.data)) } catch (i) {
  3427. return } } },
  3428. setValue: function(e) {
  3429. if (e || (e = {}), t.isObject(e)) {
  3430. var n = {};
  3431. for (var i in this.childrenById) {
  3432. var a = this.childrenById[i].propertyId;
  3433. n[a] = this.childrenById[i] }
  3434. var r = {};
  3435. for (var o in e) e.hasOwnProperty(o) && (r[o] = e[o]);
  3436. for (var a in r) {
  3437. var l = n[a];
  3438. l && (l.setValue(r[a]), delete n[a], delete r[a]) }
  3439. for (var a in n) {
  3440. var l = n[a];
  3441. l.setValue(null) } } },
  3442. getContainerValue: function() {
  3443. if (0 === this.children.length && !this.isRequired()) return {};
  3444. for (var e = {}, n = 0; n < this.children.length; n++) {
  3445. var i = this.children[n].propertyId,
  3446. a = this.children[n].getValue();
  3447. if (a !== a && (a = void 0), "undefined" != typeof a && this.determineAllDependenciesValid(i)) {
  3448. var r = null; "boolean" == typeof a ? r = !!a : t.isArray(a) || t.isObject(a) || t.isNumber(a) ? r = a : (a || 0 === a) && (r = a), null !== r && (e[i] = r) } }
  3449. return e },
  3450. afterRenderContainer: function(e, n) {
  3451. var i = this;
  3452. this.base(e, function() {
  3453. if (i.isTopLevel() && i.view) { i.wizardConfigs = i.view.getWizard(), "undefined" != typeof i.wizardConfigs && (i.wizardConfigs && i.wizardConfigs !== !0 || (i.wizardConfigs = {}));
  3454. var e = i.view.getLayout().templateDescriptor;
  3455. i.wizardConfigs && t.isObject(i.wizardConfigs) && (!e || i.wizardConfigs.bindings ? i.autoWizard() : i.wizard()) }
  3456. n() }) },
  3457. createItems: function(e) {
  3458. var n = this,
  3459. i = [],
  3460. a = {};
  3461. for (var r in n.data) a[r] = r;
  3462. var o = n.data;
  3463. n.schema && n.schema.properties && (o = n.schema.properties);
  3464. var l = function() {
  3465. var n = [];
  3466. for (var r in a) n.push(r);
  3467. n.length > 0 && t.logDebug("There were " + n.length + " extra data keys that were not part of the schema " + JSON.stringify(n)), e(i) },
  3468. s = [];
  3469. for (var u in o) {
  3470. var c = null;
  3471. n.data && n.data.hasOwnProperty(u) && (c = n.data[u]);
  3472. var d = function(e, a, r) {
  3473. return function(o) { n.resolvePropertySchemaOptions(e, function(l, s, u) {
  3474. return u ? t.throwErrorWithCallback("Circular reference detected for schema: " + JSON.stringify(l), n.errorCallback) : (l || t.logDebug("Unable to resolve schema for property: " + e), void n.createItem(e, l, s, a, null, function(t) { i.push(t), delete r[e], o() })) }) } }(u, c, a);
  3475. s.push(d) }
  3476. t.nextTick(function() { t.series(s, function(e) {
  3477. for (var t = !1, n = 0; n < i.length; n++)
  3478. if ("undefined" != typeof i[n].options.order) { t = !0;
  3479. break }
  3480. t && i.sort(function(e, t) {
  3481. var n = e.options.order;
  3482. n || (n = 0);
  3483. var i = t.options.order;
  3484. return i || (i = 0), n - i }), l() }) })
  3485. },
  3486. createItem: function(n, i, a, r, o, l) {
  3487. var s = this,
  3488. u = e("<div></div>");
  3489. u.alpaca({ data: r, options: a, schema: i, view: this.view.id ? this.view.id : this.view, connector: this.connector, error: function(e) { s.destroy(), s.errorCallback.call(s, e) }, notTopLevel: !0, render: function(e, t) { e.parent = s, e.propertyId = n, "/" !== s.path ? e.path = s.path + "/" + n : e.path = s.path + n, e.render(null, function() { t && t() }) }, postRender: function(n) {
  3490. var i = t.tmpl(s.containerItemTemplateDescriptor, { id: s.getId(), name: n.name, parentFieldId: s.getId(), actionbarStyle: s.options.actionbarStyle, view: s.view, data: r }),
  3491. a = e(i).find("." + t.MARKER_CLASS_CONTAINER_FIELD_ITEM_FIELD);
  3492. return 0 === a.length && e(i).hasClass(t.MARKER_CLASS_CONTAINER_FIELD_ITEM_FIELD) && (a = e(i)), 0 === a.length ? void s.errorCallback.call(s, { message: "Cannot find insertion point for field: " + s.getId() }) : (e(a).before(n.getFieldEl()), e(a).remove(), n.containerItemEl = i, t.fieldApplyFieldAndChildren(n, function(e) { e.hideInitValidationError = !1 }), void(l && l(n))) } }) },
  3493. resolvePropertySchemaOptions: function(e, n) {
  3494. var i = this,
  3495. a = function(e, t, a) { i.options.readonly && (t.readonly = !0), n(e, t, a) },
  3496. r = null;
  3497. i.schema && i.schema.properties && i.schema.properties[e] && (r = i.schema.properties[e]);
  3498. var o = {};
  3499. if (i.options && i.options.fields && i.options.fields[e] && (o = i.options.fields[e]), r && r.$ref) {
  3500. var l = r.$ref,
  3501. s = r.$ref;
  3502. o.$ref && (s = o.$ref);
  3503. for (var u = this, c = [u]; u.parent;) u = u.parent, c.push(u);
  3504. var d = r,
  3505. p = o;
  3506. t.loadRefSchemaOptions(u, l, s, function(e, n) {
  3507. for (var i = 0, r = 0; r < c.length; r++) c[r].schema && (c[r].schema.id === l || c[r].schema.id === "#" + l ? i++ : c[r].schema.$ref === l && i++);
  3508. var o = i > 1,
  3509. s = {};
  3510. d && t.mergeObject(s, d), e && t.mergeObject(s, e), d && d.id && (s.id = d.id);
  3511. var u = {};
  3512. p && t.mergeObject(u, p), n && t.mergeObject(u, n), t.nextTick(function() { a(s, u, o) }) }) } else t.nextTick(function() { a(r, o) }) },
  3513. applyCreatedItems: function(e, t) {
  3514. var n = this;
  3515. this.base(e, function() {
  3516. var i = function(a) {
  3517. if (a === e.items.length) return void t();
  3518. var r = e.items[a],
  3519. o = r.propertyId;
  3520. n.showOrHidePropertyBasedOnDependencies(o), n.bindDependencyFieldUpdateEvent(o), n.refreshDependentFieldStates(o), i(a + 1) };
  3521. i(0) }) },
  3522. handleValidate: function() {
  3523. var e = this.base(),
  3524. n = this.validation,
  3525. i = this._validateMaxProperties();
  3526. return n.tooManyProperties = { message: i ? "" : t.substituteTokens(this.getMessage("tooManyProperties"), [this.schema.maxProperties]), status: i }, i = this._validateMinProperties(), n.tooFewProperties = { message: i ? "" : t.substituteTokens(this.getMessage("tooManyItems"), [this.schema.minProperties]), status: i }, e && n.tooManyProperties.status && n.tooFewProperties.status },
  3527. _validateMaxProperties: function() {
  3528. if ("undefined" == typeof this.schema.maxProperties) return !0;
  3529. var e = this.schema.maxProperties,
  3530. t = 0;
  3531. for (var n in this.data) t++;
  3532. return e >= t },
  3533. _validateMinProperties: function() {
  3534. if ("undefined" == typeof this.schema.minProperties) return !0;
  3535. var e = this.schema.minProperties,
  3536. t = 0;
  3537. for (var n in this.data) t++;
  3538. return t >= e },
  3539. showOrHidePropertyBasedOnDependencies: function(e) {
  3540. var n = this,
  3541. i = this.childrenByPropertyId[e];
  3542. if (!i) return t.throwErrorWithCallback("Missing property: " + e, n.errorCallback);
  3543. var a = this.determineAllDependenciesValid(e);
  3544. a ? (i.show(), i.onDependentReveal()) : (i.hide(), i.onDependentConceal()), i.getFieldEl().trigger("fieldupdate") },
  3545. getChildDependencies: function(e) {
  3546. var t = null;
  3547. if (this.schema.dependencies && (t = this.schema.dependencies[e]), !t) {
  3548. var n = this.childrenByPropertyId[e];
  3549. n && (t = n.schema.dependencies) }
  3550. return t },
  3551. getChildConditionalDependencies: function(e) {
  3552. var t = null,
  3553. n = this.childrenByPropertyId[e];
  3554. return n && (t = n.options.dependencies), t },
  3555. determineAllDependenciesValid: function(n) {
  3556. var i = this,
  3557. a = this.childrenByPropertyId[n];
  3558. if (!a) return t.throwErrorWithCallback("Missing property: " + n, i.errorCallback);
  3559. var r = i.getChildDependencies(n);
  3560. if (!r) return !0;
  3561. var o = !0;
  3562. return t.isString(r) ? o = i.determineSingleDependencyValid(n, r) : t.isArray(r) && e.each(r, function(e, t) { o = o && i.determineSingleDependencyValid(n, t) }), o },
  3563. bindDependencyFieldUpdateEvent: function(n) {
  3564. var i = this,
  3565. a = this.childrenByPropertyId[n];
  3566. if (!a) return t.throwErrorWithCallback("Missing property: " + n, i.errorCallback);
  3567. var r = i.getChildDependencies(n);
  3568. if (!r) return !0;
  3569. var o = function(e, n) {
  3570. var r = t.resolveField(i, n);
  3571. r && (r.getFieldEl().bind("fieldupdate", function(e, t, n, a) {
  3572. return function(t) { i.showOrHidePropertyBasedOnDependencies(n), e.getFieldEl().trigger("fieldupdate") } }(a, r, e, n)), r.getFieldEl().trigger("fieldupdate")) };
  3573. t.isString(r) ? o(n, r) : t.isArray(r) && e.each(r, function(e, t) { o(n, t) }) },
  3574. refreshDependentFieldStates: function(n) {
  3575. var i = this,
  3576. a = this.childrenByPropertyId[n];
  3577. if (!a) return t.throwErrorWithCallback("Missing property: " + n, i.errorCallback);
  3578. var r = i.getChildDependencies(n);
  3579. if (!r) return !0;
  3580. var o = function(e) {
  3581. var n = t.resolveField(i, e);
  3582. n && n.getFieldEl().trigger("fieldupdate") };
  3583. t.isString(r) ? o(r) : t.isArray(r) && e.each(r, function(e, t) { o(t) }) },
  3584. determineSingleDependencyValid: function(e, n) {
  3585. var i = this,
  3586. a = t.resolveField(i, n);
  3587. if (!a) return !1;
  3588. var r = a.data,
  3589. o = !1,
  3590. l = this.getChildConditionalDependencies(e);
  3591. if (l && 0 !== l.length) { "boolean" !== a.getType() || r || (r = !1);
  3592. var s = l[n];!t.isEmpty(s) && t.isFunction(s) ? o = s.call(this, r) : (o = !0, t.isArray(s) ? t.anyEquality(r, s) || (o = !1) : t.isEmpty(s) || t.anyEquality(s, r) || (o = !1)) } else o = "boolean" !== a.getType() || this.childrenByPropertyId[e].options.dependencies || r ? !t.isValEmpty(a.data) : !1;
  3593. return a && a.isHidden() && (o = !1), o },
  3594. getIndex: function(e) {
  3595. if (t.isEmpty(e)) return -1;
  3596. for (var n = 0; n < this.children.length; n++) {
  3597. var i = this.children[n].propertyId;
  3598. if (i == e) return n }
  3599. return -1 },
  3600. addItem: function(e, t, n, i, a, r) {
  3601. var o = this;
  3602. this.createItem(e, t, n, i, a, function(e) {
  3603. var t = null;
  3604. if (a && o.childrenById[a])
  3605. for (var n = 0; n < o.children.length; n++)
  3606. if (o.children[n].getId() == a) { t = n;
  3607. break }
  3608. o.registerChild(e, null != t ? t + 1 : 0), o.doAddItem(t, e), o.handleRepositionDOMRefresh(), o.refreshValidationState(!0, function() { o.trigger("add", e), o.triggerUpdate(), e.triggerWithPropagation.call(e, "ready", "down"), r && r() }) }) },
  3609. doAddItem: function(n, i) {
  3610. var a = this;
  3611. if (n) {
  3612. var r = a.getContainerEl().children("[data-alpaca-container-item-index='" + n + "']");
  3613. r && r.length > 0 && r.after(i.containerItemEl) } else e(a.container).prepend(i.containerItemEl);
  3614. a.doAfterAddItem(i, function() { t.fireReady(i) }) },
  3615. doAfterAddItem: function(e, t) { t() },
  3616. doResolveItemContainer: function() {
  3617. var t = this;
  3618. return e(t.container) },
  3619. removeItem: function(t, n) {
  3620. var i = this,
  3621. a = this.childrenByPropertyId[t];
  3622. a ? (this.children = e.grep(this.children, function(e, n) {
  3623. return e.propertyId !== t }), delete this.childrenByPropertyId[t], delete this.childrenById[a.getId()], i.doRemoveItem(a), this.refreshValidationState(!0, function() { i.handleRepositionDOMRefresh(), i.trigger("remove", a), i.triggerUpdate(), n && n() })) : n() },
  3624. doRemoveItem: function(e) {
  3625. var t = this,
  3626. n = t.doResolveItemContainer();
  3627. n.children(".alpaca-container-item[data-alpaca-container-item-name='" + e.name + "']").remove(), e.destroy() },
  3628. wizard: function() {
  3629. var n = this,
  3630. i = this.wizardConfigs.steps;
  3631. i || (i = []);
  3632. var a = this.wizardConfigs.title,
  3633. r = this.wizardConfigs.description,
  3634. o = this.wizardConfigs.buttons;
  3635. o || (o = {}), o.previous || (o.previous = {}), o.previous.title || (o.previous.title = "Previous"), o.previous.align || (o.previous.align = "left"), o.previous.type || (o.previous.type = "button"), o.next || (o.next = {}), o.next.title || (o.next.title = "Next"), o.next.align || (o.next.align = "right"), o.next.type || (o.next.type = "button"), this.wizardConfigs.hideSubmitButton || (o.submit || (o.submit = {}), o.submit.title || (o.submit.title = "Submit"), o.submit.align || (o.submit.align = "right"), o.submit.type || (o.submit.type = "button"));
  3636. for (var l in o) o[l].type || (o[l].type = "button");
  3637. var s = this.wizardConfigs.showSteps; "undefined" == typeof s && (s = !0);
  3638. var u = this.wizardConfigs.showProgressBar,
  3639. c = this.wizardConfigs.validation; "undefined" == typeof c && (c = !0);
  3640. var a = e(this.field).attr("data-alpaca-wizard-title"),
  3641. r = e(this.field).attr("data-alpaca-wizard-description"),
  3642. d = e(this.field).attr("data-alpaca-wizard-validation"); "undefined" != typeof d && (c = !!d);
  3643. var p = e(this.field).attr("data-alpaca-wizard-show-steps"); "undefined" != typeof p && (s = !!p);
  3644. var h = e(this.field).attr("data-alpaca-wizard-show-progress-bar"); "undefined" != typeof h && (u = !!h);
  3645. var f = e(this.field).find("[data-alpaca-wizard-role='step']");
  3646. 0 == i.length && f.each(function(t) {
  3647. var n = {},
  3648. a = e(this).attr("data-alpaca-wizard-step-title"); "undefined" != typeof a && (n.title = a), n.title || (n.title = "Step " + t);
  3649. var r = e(this).attr("data-alpaca-wizard-step-description"); "undefined" != typeof r && (n.description = r), n.description || (n.description = "Step " + t), i.push(n) }), "undefined" == typeof u && i.length > 1 && (u = !0);
  3650. var m = {};
  3651. m.wizardTitle = a, m.wizardDescription = r, m.showSteps = s, m.performValidation = c, m.steps = i, m.buttons = o, m.schema = n.schema, m.options = n.options, m.data = n.data, m.showProgressBar = u, m.markAllStepsVisited = this.wizardConfigs.markAllStepsVisited, m.view = n.view;
  3652. var g = n.view.getTemplateDescriptor("wizard", n);
  3653. if (g) {
  3654. var v = t.tmpl(g, m);
  3655. e(n.field).append(v);
  3656. var b = e(v).find(".alpaca-wizard-nav"),
  3657. y = e(v).find(".alpaca-wizard-steps"),
  3658. w = e(v).find(".alpaca-wizard-buttons"),
  3659. E = e(v).find(".alpaca-wizard-progress-bar");
  3660. e(y).append(f),
  3661. function(i, a, r, o) {
  3662. var l = 0,
  3663. s = e(r).find("[data-alpaca-wizard-button-key='previous']"),
  3664. u = e(r).find("[data-alpaca-wizard-button-key='next']"),
  3665. c = e(r).find("[data-alpaca-wizard-button-key='submit']"),
  3666. d = function() {
  3667. if (o.showSteps) {
  3668. if (o.visits || (o.visits = {}), o.markAllStepsVisited)
  3669. for (var t = e(i).find("[data-alpaca-wizard-step-index]"), n = 0; n < t.length; n++) o.visits[n] = !0;
  3670. o.visits[l] = !0;
  3671. var t = e(i).find("[data-alpaca-wizard-step-index]");
  3672. e(t).removeClass("disabled"), e(t).removeClass("completed"), e(t).removeClass("active"), e(t).removeClass("visited");
  3673. for (var n = 0; n < t.length; n++) l > n ? e(i).find("[data-alpaca-wizard-step-index='" + n + "']").addClass("completed") : n === l ? e(i).find("[data-alpaca-wizard-step-index='" + n + "']").addClass("active") : o.visits && o.visits[n] || e(i).find("[data-alpaca-wizard-step-index='" + n + "']").addClass("disabled"), o.visits && o.visits[n] && e(i).find("[data-alpaca-wizard-step-index='" + n + "']").addClass("visited") }
  3674. if (o.showProgressBar) {
  3675. var r = l + 1,
  3676. d = o.steps.length + 1,
  3677. p = parseInt(r / d * 100, 10) + "%";
  3678. e(E).find(".progress-bar").attr("aria-valuemax", d), e(E).find(".progress-bar").attr("aria-valuenow", r), e(E).find(".progress-bar").css("width", p) }
  3679. s.hide(), u.hide(), c.hide(), 1 == o.steps.length ? c.show() : o.steps.length > 1 && (l > 0 && s.show(), u.show(), 0 == l ? u.show() : l == o.steps.length - 1 && (u.hide(), c.show())), e(a).find("[data-alpaca-wizard-role='step']").hide(), e(e(a).find("[data-alpaca-wizard-role='step']")[l]).show() },
  3680. p = function(i, r) {
  3681. if (!o.performValidation) return void r(!0);
  3682. var s = [],
  3683. u = e(e(a).find("[data-alpaca-wizard-role='step']")[l]);
  3684. e(u).find(".alpaca-field").each(function() {
  3685. var t = e(this).attr("data-alpaca-field-id");
  3686. if (t) {
  3687. var i = n.childrenById[t];
  3688. i && s.push(i) } });
  3689. for (var c = [], d = 0; d < s.length; d++) c.push(function(e) {
  3690. return function(t) { e.refreshValidationState(!0, function() { t() }) } }(s[d]));
  3691. t.series(c, function() {
  3692. for (var e = !0, t = 0; t < s.length; t++) e = e && s[t].isValid(!0);
  3693. var a = o.buttons[i];
  3694. a && a.validate ? a.validate.call(n, function(t) { e = e && t, r(e) }) : r(e) }) };
  3695. e(s).click(function(e) {
  3696. if (e.preventDefault(), l >= 1) {
  3697. var t = o.buttons.previous;
  3698. t && t.click && t.click.call(n, e), l--, d() } }), e(u).click(function(e) { e.preventDefault(), l + 1 <= o.steps.length - 1 && p("next", function(t) {
  3699. if (t) {
  3700. var i = o.buttons.next;
  3701. i && i.click && i.click.call(n, e), l++, d() } else window.setTimeout(function() { n.focus(function(e) {}) }, 250) }) }), e(c).click(function(e) { e.preventDefault(), l === o.steps.length - 1 && p("submit", function(t) {
  3702. if (t) {
  3703. var i = o.buttons.submit;
  3704. i && (i.click ? i.click.call(n, e) : n.form && n.form.submit()) } else window.setTimeout(function() { n.focus(function(e) {}) }, 250) }) }), e(r).find("[data-alpaca-wizard-button-key]").each(function() {
  3705. var t = e(this).attr("data-alpaca-wizard-button-key");
  3706. if ("submit" != t && "next" != t && "previous" != t) {
  3707. var i = o.buttons[t];
  3708. i && i.click && e(this).click(function(e) {
  3709. return function(t) { e.click.call(n, t) } }(i)) } }), e(i).find("[data-alpaca-wizard-step-index]").click(function(t) { t.preventDefault();
  3710. var n = e(this).attr("data-alpaca-wizard-step-index");
  3711. n && (n = parseInt(n, 10), (n == l || o.visits && o.visits[n]) && (l > n ? (l = n, d()) : n > l && p(null, function(e) { e && (l = n, d()) }))) }), n.on("moveToStep", function(e) {
  3712. var t = e.index,
  3713. n = e.skipValidation; "undefined" != typeof t && t <= o.steps.length - 1 && (n ? (l = t, d()) : p(null, function(e) { e && (l = t, d()) })) }), n.on("advanceOrSubmit", function(t) { p(null, function(t) { t && (l === o.steps.length - 1 ? e(c).click() : e(u).click()) }) }), d() }(b, y, w, m) } },
  3714. autoWizard: function() {
  3715. var t = this.wizardConfigs.bindings;
  3716. t || (t = {});
  3717. for (var n in this.childrenByPropertyId) t.hasOwnProperty(n) || (t[n] = 1);
  3718. var i = !0;
  3719. e(this.field).find("[data-alpaca-wizard-role='step']").length > 0 && (i = !1);
  3720. var a = 1,
  3721. r = [];
  3722. do { r = [];
  3723. for (var n in t) t[n] === a && this.childrenByPropertyId && this.childrenByPropertyId[n] && r.push(this.childrenByPropertyId[n]);
  3724. if (r.length > 0) {
  3725. var o = null;
  3726. i ? (o = e('<div data-alpaca-wizard-role="step"></div>'), e(this.field).append(o)) : o = e(e(this.field).find("[data-alpaca-wizard-role='step']")[a - 1]);
  3727. for (var l = !1, s = 0; s < r.length; s++)
  3728. if ("undefined" != typeof r[s].options.order) { l = !0;
  3729. break }
  3730. l && r.sort(function(e, t) {
  3731. var n = e.options.order;
  3732. n || (n = 0);
  3733. var i = t.options.order;
  3734. return i || (i = 0), n - i });
  3735. for (var s = 0; s < r.length; s++) e(o).append(r[s].containerItemEl);
  3736. a++ } } while (r.length > 0);
  3737. this.wizard(), 0 === e(this.container).children().length && e(this.container).css("display", "none") },
  3738. getType: function() {
  3739. return "object" },
  3740. moveItem: function(n, i, a, r) {
  3741. var o = this;
  3742. if ("function" == typeof a && (r = a, a = o.options.animate), "undefined" == typeof a && (a = o.options.animate ? o.options.animate : !0), "string" == typeof n && (n = parseInt(n, 10)), "string" == typeof i && (i = parseInt(i, 10)), 0 > i && (i = 0), i >= o.children.length && (i = o.children.length - 1), -1 !== i) {
  3743. var l = o.children[i];
  3744. if (l) {
  3745. var s = o.getContainerEl().children("[data-alpaca-container-item-index='" + n + "']"),
  3746. u = o.getContainerEl().children("[data-alpaca-container-item-index='" + i + "']"),
  3747. c = e("<div class='tempMarker1'></div>");
  3748. s.before(c);
  3749. var d = e("<div class='tempMarker2'></div>");
  3750. u.before(d);
  3751. var p = function() {
  3752. for (var t = [], a = 0; a < o.children.length; a++) a === n ? t[a] = o.children[i] : a === i ? t[a] = o.children[n] : t[a] = o.children[a];
  3753. o.children = t, c.replaceWith(u), d.replaceWith(s), o.handleRepositionDOMRefresh(), e(s).find("[data-alpaca-array-actionbar-item-index='" + n + "']").attr("data-alpaca-array-actionbar-item-index", i), e(u).find("[data-alpaca-array-actionbar-item-index='" + i + "']").attr("data-alpaca-array-actionbar-item-index", n), o.refreshValidationState(), o.triggerUpdate(), o.trigger("move"), r && r() };
  3754. a ? t.animatedSwap(s, u, 500, function() { p() }) : p() } } },
  3755. getTitle: function() {
  3756. return "Object Field" },
  3757. getDescription: function() {
  3758. return "Object field for containing other fields" },
  3759. getSchemaOfSchema: function() {
  3760. var e = { properties: { properties: { title: "Properties", description: "List of child properties.", type: "object" }, maxProperties: { type: "number", title: "Maximum Number Properties", description: "The maximum number of properties that this object is allowed to have" }, minProperties: { type: "number", title: "Minimum Number of Properties", description: "The minimum number of properties that this object is required to have" } } },
  3761. n = e.properties.properties;
  3762. if (n.properties = {}, this.children)
  3763. for (var i = 0; i < this.children.length; i++) {
  3764. var a = this.children[i].propertyId;
  3765. n.properties[a] = this.children[i].getSchemaOfSchema(), n.properties[a].title = a + " :: " + n.properties[a].title }
  3766. return t.merge(this.base(), e) },
  3767. getSchemaOfOptions: function() {
  3768. var e = t.merge(this.base(), { properties: {}, order: { type: "number", title: "Order", description: "Allows for optional specification of the index of this field in the properties array." } }),
  3769. n = { properties: { fields: { title: "Field Options", description: "List of options for child fields.", type: "object" } } },
  3770. i = n.properties.fields;
  3771. if (i.properties = {}, this.children)
  3772. for (var a = 0; a < this.children.length; a++) {
  3773. var r = this.children[a].propertyId;
  3774. i.properties[r] = this.children[a].getSchemaOfOptions(), i.properties[r].title = r + " :: " + i.properties[r].title }
  3775. return t.merge(e, n) }
  3776. }), t.registerMessages({ tooManyProperties: "The maximum number of properties ({0}) has been exceeded.", tooFewProperties: "There are not enough properties ({0} are required)" }), t.registerFieldClass("object", t.Fields.ObjectField), t.registerDefaultSchemaFieldMapping("object", "object")
  3777. }(jQuery),
  3778. function(e) {
  3779. var t = e.alpaca;
  3780. t.Fields.AnyField = t.ControlField.extend({ getFieldType: function() {
  3781. return "any" }, setup: function() { this.base() }, getControlValue: function() {
  3782. return this._getControlVal(!0) }, setValue: function(e) { t.isEmpty(e) ? this.control.val("") : this.control.val(e), this.base(e) }, disable: function() { this.control.disabled = !0 }, enable: function() { this.control.disabled = !1 }, focus: function(e) { this.control.focus(), e && e(this) }, getType: function() {
  3783. return "any" }, getTitle: function() {
  3784. return "Any Field" }, getDescription: function() {
  3785. return "Any field." }, getSchemaOfSchema: function() {
  3786. return t.merge(this.base(), { properties: {} }) }, getOptionsForSchema: function() {
  3787. return t.merge(this.base(), { fields: {} }) }, getSchemaOfOptions: function() {
  3788. return t.merge(this.base(), { properties: {} }) }, getOptionsForOptions: function() {
  3789. return t.merge(this.base(), { fields: {} }) } }), t.registerFieldClass("any", t.Fields.AnyField), t.registerDefaultSchemaFieldMapping("any", "any") }(jQuery),
  3790. function(e) {
  3791. var t = e.alpaca;
  3792. t.Fields.HiddenField = t.ControlField.extend({ getFieldType: function() {
  3793. return "hidden" }, setup: function() { this.base() }, getControlValue: function() {
  3794. return this._getControlVal(!0) }, setValue: function(e) { t.isEmpty(e) ? this.getControlEl().val("") : this.getControlEl().val(e), this.base(e) }, getType: function() {
  3795. return "string" }, getTitle: function() {
  3796. return "Hidden" }, getDescription: function() {
  3797. return "Field for a hidden HTML input" } }), t.registerFieldClass("hidden", t.Fields.HiddenField) }(jQuery),
  3798. function(e) {
  3799. var t = e.alpaca;
  3800. t.Fields.AddressField = t.Fields.ObjectField.extend({ getFieldType: function() {
  3801. return "address" }, setup: function() { this.base(), this.data && this.data.street || (this.data = { street: ["", ""] }), this.schema = { title: "Home Address", type: "object", properties: { street: { title: "Street", type: "array", items: { type: "string", maxLength: 30 }, minItems: 0, maxItems: 3 }, city: { title: "City", type: "string" }, state: { title: "State", type: "string", "enum": ["AL", "AK", "AS", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FM", "FL", "GA", "GU", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MH", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "MP", "OH", "OK", "OR", "PW", "PA", "PR", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VI", "VA", "WA", "WV", "WI", "WY"] }, zip: { title: "Zip Code", type: "string", pattern: /^(\d{5}(-\d{4})?)?$/ } } }, t.merge(this.options, { fields: { zip: { maskString: "99999", size: 5 }, state: { optionLabels: ["ALABAMA", "ALASKA", "AMERICAN SAMOA", "ARIZONA", "ARKANSAS", "CALIFORNIA", "COLORADO", "CONNECTICUT", "DELAWARE", "DISTRICT OF COLUMBIA", "FEDERATED STATES OF MICRONESIA", "FLORIDA", "GEORGIA", "GUAM", "HAWAII", "IDAHO", "ILLINOIS", "INDIANA", "IOWA", "KANSAS", "KENTUCKY", "LOUISIANA", "MAINE", "MARSHALL ISLANDS", "MARYLAND", "MASSACHUSETTS", "MICHIGAN", "MINNESOTA", "MISSISSIPPI", "MISSOURI", "MONTANA", "NEBRASKA", "NEVADA", "NEW HAMPSHIRE", "NEW JERSEY", "NEW MEXICO", "NEW YORK", "NORTH CAROLINA", "NORTH DAKOTA", "NORTHERN MARIANA ISLANDS", "OHIO", "OKLAHOMA", "OREGON", "PALAU", "PENNSYLVANIA", "PUERTO RICO", "RHODE ISLAND", "SOUTH CAROLINA", "SOUTH DAKOTA", "TENNESSEE", "TEXAS", "UTAH", "VERMONT", "VIRGIN ISLANDS", "VIRGINIA", "WASHINGTON", "WEST VIRGINIA", "WISCONSIN", "WYOMING"] } } }), t.isEmpty(this.options.addressValidation) && (this.options.addressValidation = !0) }, isContainer: function() {
  3802. return !1 }, getAddress: function() {
  3803. var t = this.getValue(); "view" === this.view.type && (t = this.data);
  3804. var n = "";
  3805. return t && (t.street && e.each(t.street, function(e, t) { n += t + " " }), t.city && (n += t.city + " "), t.state && (n += t.state + " "), t.zip && (n += t.zip)), n }, afterRenderContainer: function(t, n) {
  3806. var i = this;
  3807. this.base(t, function() {
  3808. var t = i.getContainerEl();
  3809. if (e(t).addClass("alpaca-addressfield"), i.options.addressValidation && !i.isDisplayOnly()) { e('<div style="clear:both;"></div>').appendTo(t);
  3810. var a = e('<div class="alpaca-form-button">Show Google Map</div>').appendTo(t);
  3811. a.button && a.button({ text: !0 }), a.click(function() {
  3812. if (google && google.maps) {
  3813. var t = new google.maps.Geocoder,
  3814. n = i.getAddress();
  3815. t && t.geocode({ address: n }, function(t, n) {
  3816. if (n === google.maps.GeocoderStatus.OK) {
  3817. var a = i.getId() + "-map-canvas";
  3818. 0 === e("#" + a).length && e("<div id='" + a + "' class='alpaca-field-address-mapcanvas'></div>").appendTo(i.getFieldEl());
  3819. var r = new google.maps.Map(document.getElementById(i.getId() + "-map-canvas"), { zoom: 10, center: t[0].geometry.location, mapTypeId: google.maps.MapTypeId.ROADMAP });
  3820. new google.maps.Marker({ map: r, position: t[0].geometry.location }) } else i.displayMessage("Geocoding failed: " + n) }) } else i.displayMessage("Google Map API is not installed.") }).wrap("<small/>"), i.options.showMapOnLoad && a.click() }
  3821. n() }) }, getType: function() {
  3822. return "any" }, getTitle: function() {
  3823. return "Address" }, getDescription: function() {
  3824. return "Standard US Address with Street, City, State and Zip. Also comes with support for Google map." }, getSchemaOfOptions: function() {
  3825. return t.merge(this.base(), { properties: { validateAddress: { title: "Address Validation", description: "Enable address validation if true", type: "boolean", "default": !0 }, showMapOnLoad: { title: "Whether to show the map when first loaded", type: "boolean" } } }) }, getOptionsForOptions: function() {
  3826. return t.merge(this.base(), { fields: { validateAddress: { helper: "Address validation if checked", rightLabel: "Enable Google Map for address validation?", type: "checkbox" } } }) } }), t.registerFieldClass("address", t.Fields.AddressField) }(jQuery),
  3827. function(e) {
  3828. var t = e.alpaca;
  3829. t.Fields.CKEditorField = t.Fields.TextAreaField.extend({ getFieldType: function() {
  3830. return "ckeditor" }, setup: function() { this.data || (this.data = ""), this.base(), "undefined" == typeof this.options.ckeditor && (this.options.ckeditor = {}) }, afterRenderControl: function(t, n) {
  3831. var i = this;
  3832. this.base(t, function() {!i.isDisplayOnly() && i.control && "undefined" != typeof CKEDITOR && i.on("ready", function() { i.editor || (i.editor = CKEDITOR.replace(e(i.control)[0], i.options.ckeditor), i.initCKEditorEvents()) }), e(i.control).bind("destroyed", function() {
  3833. if (i.editor) { i.editor.removeAllListeners();
  3834. try { i.editor.destroy(!1) } catch (e) {}
  3835. i.editor = null } }), n() }) }, initCKEditorEvents: function() {
  3836. var e = this;
  3837. e.editor && (e.editor.on("click", function(t) { e.onClick.call(e, t), e.trigger("click", t) }), e.editor.on("change", function(t) { e.onChange(), e.triggerWithPropagation("change", t) }), e.editor.on("blur", function(t) { e.onBlur(), e.trigger("blur", t) }), e.editor.on("focus", function(t) { e.onFocus.call(e, t), e.trigger("focus", t) }), e.editor.on("key", function(t) { e.onKeyPress.call(e, t), e.trigger("keypress", t) })) }, setValue: function(e) {
  3838. var t = this;
  3839. this.base(e), t.editor && t.editor.setData(e) }, getControlValue: function() {
  3840. var e = this,
  3841. t = null;
  3842. return e.editor && (t = e.editor.getData()), t }, destroy: function() {
  3843. var e = this;
  3844. e.editor && (e.editor.destroy(), e.editor = null), this.base() }, getTitle: function() {
  3845. return "CK Editor" }, getDescription: function() {
  3846. return "Provides an instance of a CK Editor control for use in editing HTML." }, getSchemaOfOptions: function() {
  3847. return t.merge(this.base(), { properties: { ckeditor: { title: "CK Editor options", description: "Use this entry to provide configuration options to the underlying CKEditor plugin.", type: "any" } } }) }, getOptionsForOptions: function() {
  3848. return t.merge(this.base(), { fields: { ckeditor: { type: "any" } } }) } }), t.registerFieldClass("ckeditor", t.Fields.CKEditorField) }(jQuery),
  3849. function(e) {
  3850. var t = e.alpaca;
  3851. t.Fields.ColorField = t.Fields.TextField.extend({ setup: function() {
  3852. var t = this;
  3853. this.spectrumAvailable = !1, t.isDisplayOnly() || "undefined" == typeof e.fn.spectrum || (this.spectrumAvailable = !0), "undefined" == typeof this.options.spectrum && t.spectrumAvailable && (this.inputType = "color"), this.base(), t.spectrumAvailable && ("undefined" == typeof this.options.spectrum && (this.options.spectrum = {}), "undefined" == typeof this.options.spectrum.showInput && (this.options.spectrum.showInput = !0), "undefined" == typeof this.options.spectrum.showPalette && (this.options.spectrum.showPalette = !0), "undefined" == typeof this.options.spectrum.preferredFormat && (this.options.spectrum.preferredFormat = "hex3"), "undefined" == typeof this.options.spectrum.clickoutFiresChange && (this.options.spectrum.clickoutFiresChange = !0)) }, getFieldType: function() {
  3854. return "color" }, getType: function() {
  3855. return "string" }, afterRenderControl: function(t, n) {
  3856. var i = this;
  3857. this.base(t, function() { i.spectrumAvailable && i.control && (setTimeout(function() { e(i.control[0]).spectrum(e.extend({ color: i.data }, i.options.spectrum)) }, 100), e(i.control).on("change.spectrum", function(e, t) {
  3858. var n = i.convertTinyColor(t);
  3859. i.setValue(n) })), n() }) }, convertTinyColor: function(e) {
  3860. return e.toHexString() }, getTitle: function() {
  3861. return "Color Field" }, getDescription: function() {
  3862. return "A color picker for selecting hexadecimal color values" } }), t.registerFieldClass("color", t.Fields.ColorField), t.registerDefaultSchemaFieldMapping("color", "color") }(jQuery),
  3863. function(e) {
  3864. var t = e.alpaca;
  3865. t.Fields.ColorPickerField = t.Fields.TextField.extend({ setup: function() {
  3866. var t = this;
  3867. this.simpleColorPickerAvailable = !1, t.isDisplayOnly() || "undefined" == typeof e.fn.colorpicker || (this.simpleColorPickerAvailable = !0), "undefined" != typeof this.options.colorpicker || t.simpleColorPickerAvailable || (this.inputType = "color"), this.base(), "undefined" == typeof this.options.colorpicker && (this.options.colorpicker = {}), t.data && (t.options.colorpicker.color = t.data) }, getFieldType: function() {
  3868. return "colorpicker" }, getType: function() {
  3869. return "string" }, afterRenderControl: function(t, n) {
  3870. var i = this;
  3871. this.base(t, function() { i.simpleColorPickerAvailable && i.control && (setTimeout(function() { e(i.control[0]).colorpicker(i.options.colorpicker) }, 100), e(i.control).on("changeColor.colorpicker", function(e) { i.setValue(e.color.toHex()) })), n() }) }, getTitle: function() {
  3872. return "Color Picker Field" }, getDescription: function() {
  3873. return "A color picker for selecting hexadecimal color values" } }), t.registerFieldClass("colorpicker", t.Fields.ColorPickerField) }(jQuery),
  3874. function(e) {
  3875. var t = e.alpaca;
  3876. t.Fields.CountryField = t.Fields.SelectField.extend({ getFieldType: function() {
  3877. return "country" }, setup: function() { t.isUndefined(this.options.capitalize) && (this.options.capitalize = !1), this.schema["enum"] = [], this.options.optionLabels = [];
  3878. var e = this.getMessage("countries");
  3879. if (e)
  3880. for (var n in e) { this.schema["enum"].push(n);
  3881. var i = e[n];
  3882. this.options.capitalize && (i = i.toUpperCase()), this.options.optionLabels.push(i) }
  3883. this.base() }, getTitle: function() {
  3884. return "Country Field" }, getDescription: function() {
  3885. return "Provides a dropdown selector of countries keyed by their ISO3 code. The names of the countries are read from the I18N bundle for the current locale." }, getSchemaOfOptions: function() {
  3886. return t.merge(this.base(), { properties: { capitalize: { title: "Capitalize", description: "Whether the values should be capitalized", type: "boolean", "default": !1, readonly: !0 } } }) }, getOptionsForOptions: function() {
  3887. return t.merge(this.base(), { fields: { capitalize: { type: "checkbox" } } }) } }), t.registerFieldClass("country", t.Fields.CountryField), t.registerDefaultFormatFieldMapping("country", "country") }(jQuery),
  3888. function(e) {
  3889. var t = function() {
  3890. var e = { up: Math.ceil, down: function(e) {
  3891. return ~~e }, nearest: Math.round };
  3892. return function(t) {
  3893. return e[t] } }(),
  3894. n = e.alpaca;
  3895. n.Fields.CurrencyField = n.Fields.TextField.extend({ constructor: function(e, t, n, i, a, r, o) { n = n || {};
  3896. var l = this.getSchemaOfPriceFormatOptions().properties;
  3897. for (var s in l) {
  3898. var u = l[s];
  3899. s in n || (n[s] = u["default"] || void 0) } "undefined" != typeof t && (t = "" + parseFloat(t).toFixed(n.centsLimit)), this.base(e, t, n, i, a, r, o) }, getFieldType: function() {
  3900. return "currency" }, afterRenderControl: function(t, n) {
  3901. var i = this,
  3902. a = this.getControlEl();
  3903. this.base(t, function() { e(a).priceFormat(i.options), n() }) }, getControlValue: function() {
  3904. var n = this.getControlEl(),
  3905. i = e(n).is("input") ? n.val() : n.html();
  3906. if (this.options.unmask || "none" !== this.options.round) {
  3907. var a = function() {
  3908. var e = "";
  3909. for (var t in i) {
  3910. var n = i[t];
  3911. isNaN(n) ? n === this.options.centsSeparator && (e += ".") : e += n }
  3912. return parseFloat(e) }.bind(this)();
  3913. if ("none" !== this.options.round && (a = t(this.options.round)(a), !this.options.unmask)) {
  3914. for (var r = [], o = "" + a, l = 0, s = 0; l < i.length; l++) isNaN(i[l]) ? r.push(i[l]) : r.push(o[s++] || 0);
  3915. return r.join("") }
  3916. return a }
  3917. return i }, getTitle: function() {
  3918. return "Currency Field" }, getDescription: function() {
  3919. return "Provides an automatically formatted and configurable input for entering currency amounts." }, getSchemaOfPriceFormatOptions: function() {
  3920. return { properties: { allowNegative: { title: "Allow Negative", description: "Determines if negative numbers are allowed.", type: "boolean", "default": !1 }, centsLimit: { title: "Cents Limit", description: "The limit of fractional digits.", type: "number", "default": 2, minimum: 0 }, centsSeparator: { title: "Cents Separator", description: "The separator between whole and fractional amounts.", type: "text", "default": "." }, clearPrefix: { title: "Clear Prefix", description: "Determines if the prefix is cleared on blur.", type: "boolean", "default": !1 }, clearSuffix: { title: "Clear Suffix", description: "Determines if the suffix is cleared on blur.", type: "boolean", "default": !1 }, insertPlusSign: { title: "Plus Sign", description: "Determines if a plus sign should be inserted for positive values.", type: "boolean", "default": !1 }, limit: { title: "Limit", description: "A limit of the length of the field.", type: "number", "default": void 0, minimum: 0 }, prefix: { title: "Prefix", description: "The prefix if any for the field.", type: "text", "default": "$" }, round: { title: "Round", description: "Determines if the field is rounded. (Rounding is done when getValue is called and is not reflected in the UI)", type: "string", "enum": ["up", "down", "nearest", "none"], "default": "none" }, suffix: { title: "Suffix", description: "The suffix if any for the field.", type: "text", "default": "" }, thousandsSeparator: { title: "Thousands Separator", description: "The separator between thousands.", type: "string", "default": "," }, unmask: { title: "Unmask", description: "If true then the resulting value for this field will be unmasked. That is, the resulting value will be a float instead of a string (with the prefix, suffix, etc. removed).", type: "boolean", "default": !0 } } } }, getSchemaOfOptions: function() {
  3921. return n.merge(this.base(), this.getSchemaOfPriceFormatOptions()) }, getOptionsForOptions: function() {
  3922. return n.merge(this.base(), { fields: { allowNegative: { type: "checkbox" }, centsLimit: { type: "number" }, centsSeparator: { type: "text" }, clearPrefix: { type: "checkbox" }, clearSuffix: { type: "checkbox" }, insertPlusSign: { type: "checkbox" }, limit: { type: "number" }, prefix: { type: "text" }, round: { type: "select" }, suffix: { type: "text" }, thousandsSeparator: { type: "string" }, unmask: { type: "checkbox" } } }) } }), n.registerFieldClass("currency", n.Fields.CurrencyField) }(jQuery),
  3923. function(e) {
  3924. var t = e.alpaca;
  3925. t.Fields.DateField = t.Fields.TextField.extend({
  3926. getFieldType: function() {
  3927. return "date" },
  3928. getDefaultFormat: function() {
  3929. return t.defaultDateFormat },
  3930. getDefaultExtraFormats: function() {
  3931. return [] },
  3932. setup: function() {
  3933. var e = this;
  3934. if (this.base(), e.options.picker || (e.options.picker = {}), "undefined" == typeof e.options.picker.useCurrent && (e.options.picker.useCurrent = !1), e.options.picker.format && (e.options.dateFormat = e.options.picker.format), e.options.dateFormat || (e.options.dateFormat = e.getDefaultFormat()), e.options.picker.format || (e.options.picker.format = e.options.dateFormat), e.options.picker.locale || (e.options.picker.locale = t.defaultLocale), e.options.picker.dayViewHeaderFormat || (e.options.picker.dayViewHeaderFormat = "MMMM YYYY"), !e.options.picker.extraFormats) {
  3935. var n = e.getDefaultExtraFormats();
  3936. n && (e.options.picker.extraFormats = n) } "undefined" == typeof e.options.manualEntry && (e.options.manualEntry = !1) },
  3937. onKeyPress: function(e) {
  3938. return this.options.manualEntry ? (e.preventDefault(), void e.stopImmediatePropagation()) : void this.base(e);
  3939. },
  3940. onKeyDown: function(e) {
  3941. return this.options.manualEntry ? (e.preventDefault(), void e.stopImmediatePropagation()) : void this.base(e) },
  3942. beforeRenderControl: function(e, t) { this.field.css("position", "relative"), t() },
  3943. afterRenderControl: function(t, n) {
  3944. var i = this;
  3945. this.base(t, function() { "display" !== i.view.type && e.fn.datetimepicker && (i.getControlEl().datetimepicker(i.options.picker), i.picker = i.getControlEl().data("DateTimePicker"), i.picker && i.options.dateFormat && i.picker.format(i.options.dateFormat), i.picker && (i.options.dateFormat = i.picker.format()), i.getFieldEl().on("dp.change", function(e) { setTimeout(function() { i.onChange.call(i, e), i.triggerWithPropagation("change", e) }, 250) }), i.data && i.picker.date(i.data)), n() }) },
  3946. setManualEntry: function(e) { this.options.manualEntry = e },
  3947. getDate: function() {
  3948. var e = this,
  3949. t = null;
  3950. try { t = e.picker ? e.picker.date() ? e.picker.date()._d : null : new Date(this.getValue()) } catch (n) { console.error(n) }
  3951. return t },
  3952. date: function() {
  3953. return this.getDate() },
  3954. onChange: function(e) { this.base(), this.refreshValidationState() },
  3955. isAutoFocusable: function() {
  3956. return !1 },
  3957. handleValidate: function() {
  3958. var e = this.base(),
  3959. n = this.validation,
  3960. i = this._validateDateFormat();
  3961. return n.invalidDate = { message: i ? "" : t.substituteTokens(this.getMessage("invalidDate"), [this.options.dateFormat]), status: i }, e && n.invalidDate.status },
  3962. _validateDateFormat: function() {
  3963. var e = this,
  3964. n = !0;
  3965. if (e.options.dateFormat) {
  3966. var i = e.getValue();
  3967. if (i || e.isRequired()) {
  3968. var a = [];
  3969. if (a.push(e.options.dateFormat), e.options.picker && e.options.picker.extraFormats)
  3970. for (var r = 0; r < e.options.picker.extraFormats.length; r++) a.push(e.options.picker.extraFormats[r]);
  3971. for (var r = 0; r < a.length; r++) n = n || t.moment(i, e.options.dateFormat, !0).isValid() } }
  3972. return n },
  3973. setValue: function(e) {
  3974. var n = this;
  3975. this.base(e), this.picker && t.moment(e, n.options.dateFormat, !0).isValid() && this.picker.date(e) },
  3976. destroy: function() { this.base(), this.picker = null },
  3977. getTitle: function() {
  3978. return "Date Field" },
  3979. getDescription: function() {
  3980. return "Date Field" },
  3981. getSchemaOfSchema: function() {
  3982. return t.merge(this.base(), { properties: { format: { title: "Format", description: "Property data format", type: "string", "default": "date", "enum": ["date"], readonly: !0 } } }) },
  3983. getOptionsForSchema: function() {
  3984. return t.merge(this.base(), { fields: { format: { type: "text" } } }) },
  3985. getSchemaOfOptions: function() {
  3986. return t.merge(this.base(), { properties: { dateFormat: { title: "Date Format", description: "Date format (using moment.js format)", type: "string" }, picker: { title: "DatetimePicker options", description: "Options that are supported by the <a href='http://eonasdan.github.io/bootstrap-datetimepicker/'>Bootstrap DateTime Picker</a>.", type: "any" } } }) },
  3987. getOptionsForOptions: function() {
  3988. return t.merge(this.base(), { fields: { dateFormat: { type: "text" }, picker: { type: "any" } } }) }
  3989. }), t.registerMessages({ invalidDate: "Invalid date for format {0}" }), t.registerFieldClass("date", t.Fields.DateField), t.registerDefaultFormatFieldMapping("date", "date")
  3990. }(jQuery),
  3991. function(e) {
  3992. var t = e.alpaca;
  3993. t.Fields.DatetimeField = t.Fields.DateField.extend({ getFieldType: function() {
  3994. return "datetime" }, getDefaultFormat: function() {
  3995. return t.defaultDateFormat + " " + t.defaultTimeFormat }, getDefaultExtraFormats: function() {
  3996. return [t.defaultDateFormat + " hh:mm:ss a", t.defaultDateFormat + " HH:mm", t.defaultDateFormat] }, setup: function() { this.base() }, getTitle: function() {
  3997. return "Datetime Field" }, getDescription: function() {
  3998. return "Datetime Field based on <a href='http://eonasdan.github.io/bootstrap-datetimepicker/'>Bootstrap DateTime Picker</a>." } }), t.registerFieldClass("datetime", t.Fields.DatetimeField), t.registerDefaultFormatFieldMapping("datetime", "datetime"), t.registerDefaultFormatFieldMapping("date-time", "datetime") }(jQuery),
  3999. function(e) {
  4000. var t = e.alpaca;
  4001. t.Fields.EditorField = t.Fields.TextField.extend({ getFieldType: function() {
  4002. return "editor" }, setup: function() {
  4003. var e = this;
  4004. this.base(), e.options.aceTheme || (e.options.aceTheme = "ace/theme/chrome"), e.options.aceMode || (e.options.aceMode = "ace/mode/json"), "undefined" == typeof e.options.beautify && (e.options.beautify = !0), e.options.beautify && this.data && ("ace/mode/json" === e.options.aceMode && (t.isObject(this.data) ? this.data = JSON.stringify(this.data, null, " ") : t.isString(this.data) && (this.data = JSON.stringify(JSON.parse(this.data), null, " "))), "ace/mode/html" === e.options.aceMode && "undefined" != typeof html_beautify && (this.data = html_beautify(this.data)), "ace/mode/css" === e.options.aceMode && "undefined" != typeof css_beautify && (this.data = css_beautify(this.data)), "ace/mode/javascript" === e.options.aceMode && "undefined" != typeof js_beautify && (this.data = js_beautify(this.data))), "ace/mode/json" === e.options.aceMode && (this.data && "{}" !== this.data || (this.data = "{\n \n}")) }, afterRenderControl: function(n, i) {
  4005. var a = this;
  4006. this.base(n, function() {
  4007. if (a.control) {
  4008. var n = a.options.aceHeight;
  4009. n && e(a.control).css("height", n);
  4010. var r = a.options.aceWidth;
  4011. r || (r = "100%"), e(a.control).css("width", r) }
  4012. var o = e(a.control)[0];
  4013. if (!ace && window.ace && (ace = window.ace), ace) { a.editor = ace.edit(o), a.editor.setOptions({ maxLines: 1 / 0 }), a.editor.getSession().setUseWrapMode(!0);
  4014. var l = a.options.aceTheme;
  4015. a.editor.setTheme(l);
  4016. var s = a.options.aceMode;
  4017. if (a.editor.getSession().setMode(s), a.editor.renderer.setHScrollBarAlwaysVisible(!1), a.editor.setShowPrintMargin(!1), a.editor.setValue(a.data), a.editor.clearSelection(), a.editor.getSession().getUndoManager().reset(), a.options.aceFitContentHeight) {
  4018. var u = function() {
  4019. var t = !1;
  4020. 0 === a.editor.renderer.lineHeight && (t = !0, a.editor.renderer.lineHeight = 16);
  4021. var n = a.editor.getSession().getScreenLength() * a.editor.renderer.lineHeight + a.editor.renderer.scrollBar.getWidth();
  4022. e(a.control).height(n.toString() + "px"), a.editor.resize(), t && window.setTimeout(function() { a.editor.clearSelection() }, 100) };
  4023. u(), a.editor.getSession().on("change", u) }
  4024. a.schema.readonly && a.editor.setReadOnly(!0), e(o).bind("destroyed", function() { a.editor && (a.editor.destroy(), a.editor = null) }) } else t.logError("Editor Field is missing the 'ace' Cloud 9 Editor");
  4025. i() }) }, destroy: function() { this.editor && (this.editor.destroy(), this.editor = null), this.base() }, getEditor: function() {
  4026. return this.editor }, handleValidate: function() {
  4027. var e = this.base(),
  4028. n = this.validation,
  4029. i = this._validateWordCount();
  4030. n.wordLimitExceeded = { message: i ? "" : t.substituteTokens(this.getMessage("wordLimitExceeded"), [this.options.wordlimit]), status: i };
  4031. var a = this._validateEditorAnnotations();
  4032. return n.editorAnnotationsExist = { message: a ? "" : this.getMessage("editorAnnotationsExist"), status: a }, e && n.wordLimitExceeded.status && n.editorAnnotationsExist.status }, _validateEditorAnnotations: function() {
  4033. if (this.editor) {
  4034. var e = this.editor.getSession().getAnnotations();
  4035. if (e && e.length > 0) return !1 }
  4036. return !0 }, _validateWordCount: function() {
  4037. if (this.options.wordlimit && this.options.wordlimit > -1) {
  4038. var e = this.editor.getValue();
  4039. if (e) {
  4040. var t = e.split(" ").length;
  4041. if (t > this.options.wordlimit) return !1 } }
  4042. return !0 }, onDependentReveal: function() { this.editor && this.editor.resize() }, setValue: function(e) {
  4043. var n = this;
  4044. this.editor && ("object" == n.schema.type && t.isObject(e) && (e = JSON.stringify(e, null, " ")), this.editor.setValue(e), n.editor.clearSelection()), this.base(e) }, getControlValue: function() {
  4045. var e = null;
  4046. return this.editor && (e = this.editor.getValue()), "object" == this.schema.type && (e = e ? JSON.parse(e) : {}), e }, getTitle: function() {
  4047. return "Editor" }, getDescription: function() {
  4048. return "Editor" }, getSchemaOfOptions: function() {
  4049. return t.merge(this.base(), { properties: { aceTheme: { title: "ACE Editor Theme", description: "Specifies the theme to set onto the editor instance", type: "string", "default": "ace/theme/twilight" }, aceMode: { title: "ACE Editor Mode", description: "Specifies the mode to set onto the editor instance", type: "string", "default": "ace/mode/javascript" }, aceWidth: { title: "ACE Editor Height", description: "Specifies the width of the wrapping div around the editor", type: "string", "default": "100%" }, aceHeight: { title: "ACE Editor Height", description: "Specifies the height of the wrapping div around the editor", type: "string", "default": "300px" }, aceFitContentHeight: { title: "ACE Fit Content Height", description: "Configures the ACE Editor to auto-fit its height to the contents of the editor", type: "boolean", "default": !1 }, wordlimit: { title: "Word Limit", description: "Limits the number of words allowed in the text area.", type: "number", "default": -1 } } }) }, getOptionsForOptions: function() {
  4050. return t.merge(this.base(), { fields: { aceTheme: { type: "text" }, aceMode: { type: "text" }, wordlimit: { type: "integer" } } }) } }), t.registerMessages({ wordLimitExceeded: "The maximum word limit of {0} has been exceeded.", editorAnnotationsExist: "The editor has errors in it that must be corrected" }), t.registerFieldClass("editor", t.Fields.EditorField) }(jQuery),
  4051. function(e) {
  4052. var t = e.alpaca;
  4053. t.Fields.EmailField = t.Fields.TextField.extend({ getFieldType: function() {
  4054. return "email" }, setup: function() { this.inputType = "email", this.base(), this.schema.pattern || (this.schema.pattern = t.regexps.email) }, handleValidate: function() {
  4055. var e = this.base(),
  4056. t = this.validation;
  4057. return t.invalidPattern.status || (t.invalidPattern.message = this.getMessage("invalidEmail")), e }, getTitle: function() {
  4058. return "Email Field" }, getDescription: function() {
  4059. return "Email Field." }, getSchemaOfSchema: function() {
  4060. var e = this.schema && this.schema.pattern ? this.schema.pattern : t.regexps.email;
  4061. return t.merge(this.base(), { properties: { pattern: { title: "Pattern", description: "Field Pattern in Regular Expression", type: "string", "default": e, "enum": [e], readonly: !0 }, format: { title: "Format", description: "Property data format", type: "string", "default": "email", "enum": ["email"], readonly: !0 } } }) }, getOptionsForSchema: function() {
  4062. return t.merge(this.base(), { fields: { format: { type: "text" } } }) } }), t.registerMessages({ invalidEmail: "Invalid Email address e.g. info@cloudcms.com" }), t.registerFieldClass("email", t.Fields.EmailField), t.registerDefaultFormatFieldMapping("email", "email") }(jQuery),
  4063. function(e) {
  4064. var t = e.alpaca;
  4065. t.Fields.GridField = t.Fields.ArrayField.extend({ getFieldType: function() {
  4066. return "grid" }, setup: function() { this.base(), "undefined" == typeof this.options.grid && (this.options.grid = {}) }, afterRenderContainer: function(t, n) {
  4067. var i = this;
  4068. this.base(t, function() {
  4069. var t = [],
  4070. a = [];
  4071. for (var r in i.options.fields) {
  4072. var o = i.options.fields[r],
  4073. l = r;
  4074. o.label && (l = o.label), a.push(l) }
  4075. t.push(a);
  4076. for (var s = 0; s < i.data.length; s++) {
  4077. var u = [];
  4078. for (var c in i.data[s]) u.push(i.data[s][c]);
  4079. t.push(u) }
  4080. var d = e(i.container).find(".alpaca-container-grid-holder"),
  4081. p = i.options.grid;
  4082. p.data = t, e(d).handsontable(p), n() }) }, getType: function() {
  4083. return "array" }, getTitle: function() {
  4084. return "Grid Field" }, getDescription: function() {
  4085. return "Renders array items into a grid" } }), t.registerFieldClass("grid", t.Fields.GridField) }(jQuery),
  4086. function(e) {
  4087. var t = e.alpaca;
  4088. t.Fields.ImageField = t.Fields.TextField.extend({ getFieldType: function() {
  4089. return "image" }, getTitle: function() {
  4090. return "Image Field" }, getDescription: function() {
  4091. return "Image Field." } }), t.registerFieldClass("image", t.Fields.ImageField) }(jQuery),
  4092. function(e) {
  4093. var t = e.alpaca;
  4094. t.Fields.IntegerField = t.Fields.NumberField.extend({ getFieldType: function() {
  4095. return "integer" }, getControlValue: function() {
  4096. var e = this.base();
  4097. return "undefined" == typeof e || "" == e ? e : parseInt(e, 10) }, onChange: function(e) { this.base(), this.slider && this.slider.slider("value", this.getValue()) }, postRender: function(n) {
  4098. var i = this;
  4099. this.base(function() { i.options.slider && (t.isEmpty(i.schema.maximum) || t.isEmpty(i.schema.minimum) || i.control && (i.control.after('<div id="slider"></div>'), i.slider = e("#slider", i.control.parent()).slider({ value: i.getValue(), min: i.schema.minimum, max: i.schema.maximum, slide: function(e, t) { i.setValue(t.value), i.refreshValidationState() } }))), n() }) }, handleValidate: function() {
  4100. var e = this.base(),
  4101. t = this.validation,
  4102. n = this._validateInteger();
  4103. return t.stringNotANumber = { message: n ? "" : this.getMessage("stringNotAnInteger"), status: n }, e }, _validateInteger: function() {
  4104. var e = this._getControlVal();
  4105. if ("number" == typeof e && (e = "" + e), t.isValEmpty(e)) return !0;
  4106. var n = t.testRegex(t.regexps.integer, e);
  4107. if (!n) return !1;
  4108. var i = this.getValue();
  4109. return !isNaN(i) }, getType: function() {
  4110. return "integer" }, getTitle: function() {
  4111. return "Integer Field" }, getDescription: function() {
  4112. return "Field for integers." }, getSchemaOfSchema: function() {
  4113. return t.merge(this.base(), { properties: { minimum: { title: "Minimum", description: "Minimum value of the property.", type: "integer" }, maximum: { title: "Maximum", description: "Maximum value of the property.", type: "integer" }, divisibleBy: { title: "Divisible By", description: "Property value must be divisible by this number.", type: "integer" } } }) }, getOptionsForSchema: function() {
  4114. return t.merge(this.base(), { fields: { minimum: { helper: "Minimum value of the field.", type: "integer" }, maximum: { helper: "Maximum value of the field.", type: "integer" }, divisibleBy: { helper: "Property value must be divisible by this number.", type: "integer" } } }) }, getSchemaOfOptions: function() {
  4115. return t.merge(this.base(), { properties: { slider: { title: "Slider", description: "Generate jQuery UI slider control with the field if true.", type: "boolean", "default": !1 } } }) }, getOptionsForOptions: function() {
  4116. return t.merge(this.base(), { fields: { slider: { rightLabel: "Slider control ?", helper: "Generate slider control if selected.", type: "checkbox" } } }) } }), t.registerMessages({ stringNotAnInteger: "This value is not an integer." }), t.registerFieldClass("integer", t.Fields.IntegerField), t.registerDefaultSchemaFieldMapping("integer", "integer") }(jQuery),
  4117. function(e) {
  4118. var t = e.alpaca;
  4119. t.Fields.IPv4Field = t.Fields.TextField.extend({ getFieldType: function() {
  4120. return "ipv4" }, setup: function() { this.base(), this.schema.pattern || (this.schema.pattern = t.regexps.ipv4) }, handleValidate: function() {
  4121. var e = this.base(),
  4122. t = this.validation;
  4123. return t.invalidPattern.status || (t.invalidPattern.message = this.getMessage("invalidIPv4")), e }, getTitle: function() {
  4124. return "IP Address Field" }, getDescription: function() {
  4125. return "IP Address Field." }, getSchemaOfSchema: function() {
  4126. var e = this.schema && this.schema.pattern ? this.schema.pattern : t.regexps.ipv4;
  4127. return t.merge(this.base(), { properties: { pattern: { title: "Pattern", description: "Field Pattern in Regular Expression", type: "string", "default": e, readonly: !0 }, format: { title: "Format", description: "Property data format", type: "string", "enum": ["ip-address"], "default": "ip-address", readonly: !0 } } }) }, getOptionsForSchema: function() {
  4128. return t.merge(this.base(), { fields: { format: { type: "text" } } }) } }), t.registerMessages({ invalidIPv4: "Invalid IPv4 address, e.g. 192.168.0.1" }), t.registerFieldClass("ipv4", t.Fields.IPv4Field), t.registerDefaultFormatFieldMapping("ip-address", "ipv4") }(jQuery),
  4129. function(e) {
  4130. function t(e) {
  4131. if ("string" == typeof e.data) {
  4132. var t = e.handler,
  4133. n = e.data.toLowerCase().split(" ");
  4134. e.handler = function(e) {
  4135. if (this === e.target || !/textarea|select/i.test(e.target.nodeName) && "text" !== e.target.type) {
  4136. var i = "keypress" !== e.type && jQuery.hotkeys.specialKeys[e.which],
  4137. a = String.fromCharCode(e.which).toLowerCase(),
  4138. r = "",
  4139. o = {};
  4140. e.altKey && "alt" !== i && (r += "alt+"), e.ctrlKey && "ctrl" !== i && (r += "ctrl+"), e.metaKey && !e.ctrlKey && "meta" !== i && (r += "meta+"), e.shiftKey && "shift" !== i && (r += "shift+"), i ? o[r + i] = !0 : (o[r + a] = !0, o[r + jQuery.hotkeys.shiftNums[a]] = !0, "shift+" === r && (o[jQuery.hotkeys.shiftNums[a]] = !0));
  4141. for (var l = 0, s = n.length; s > l; l++)
  4142. if (o[n[l]]) return t.apply(this, arguments) } } } }
  4143. var n = e.alpaca;
  4144. n.Fields.JSONField = n.Fields.TextAreaField.extend({ getFieldType: function() {
  4145. return "json" }, setValue: function(e) {
  4146. (n.isObject(e) || "object" == typeof e) && (e = JSON.stringify(e, null, 3)), this.base(e) }, getControlValue: function() {
  4147. var e = this.base();
  4148. return e && n.isString(e) && (e = JSON.parse(e)), e }, handleValidate: function() {
  4149. var e = this.base(),
  4150. t = this.validation,
  4151. n = this._validateJSON();
  4152. return t.stringNotAJSON = { message: n.status ? "" : this.getMessage("stringNotAJSON") + " " + n.message, status: n.status }, e && t.stringNotAJSON.status }, _validateJSON: function() {
  4153. var e = this.control.val();
  4154. if (n.isValEmpty(e)) return { status: !0 };
  4155. try {
  4156. var t = JSON.parse(e);
  4157. return this.setValue(JSON.stringify(t, null, 3)), { status: !0 } } catch (i) {
  4158. return { status: !1, message: i.message } } }, afterRenderControl: function(e, t) {
  4159. var n = this;
  4160. this.base(e, function() { n.control && (n.control.bind("keypress", function(e) {
  4161. var t = e.keyCode || e.wich;
  4162. 34 === t && n.control.insertAtCaret('"'), 123 === t && n.control.insertAtCaret("}"), 91 === t && n.control.insertAtCaret("]") }), n.control.bind("keypress", "Ctrl+l", function() { n.getFieldEl().removeClass("alpaca-field-focused"), n.refreshValidationState() }), n.control.attr("title", "Type Ctrl+L to format and validate the JSON string.")), t() }) }, getTitle: function() {
  4163. return "JSON Editor" }, getDescription: function() {
  4164. return "Editor for JSON objects with basic validation and formatting." } }), n.registerMessages({ stringNotAJSON: "This value is not a valid JSON string." }), n.registerFieldClass("json", n.Fields.JSONField), e.fn.insertAtCaret = function(e) {
  4165. return this.each(function() {
  4166. if (document.selection) this.focus(), sel = document.selection.createRange(), sel.text = e, this.focus();
  4167. else if (this.selectionStart || "0" == this.selectionStart) {
  4168. var t = this.selectionStart,
  4169. n = this.selectionEnd,
  4170. i = this.scrollTop;
  4171. this.value = this.value.substring(0, t) + e + this.value.substring(n, this.value.length), this.focus(), this.selectionStart = t, this.selectionEnd = t, this.scrollTop = i } else this.value += e, this.focus() }) }, jQuery.hotkeys = { version: "0.8", specialKeys: { 8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause", 20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home", 37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del", 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7", 104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111: "/", 112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8", 120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 191: "/", 224: "meta" }, shiftNums: { "`": "~", 1: "!", 2: "@", 3: "#", 4: "$", 5: "%", 6: "^", 7: "&", 8: "*", 9: "(", 0: ")", "-": "_", "=": "+", ";": ": ", "'": '"', ",": "<", ".": ">", "/": "?", "\\": "|" } }, jQuery.each(["keydown", "keyup", "keypress"], function() { jQuery.event.special[this] = { add: t } }) }(jQuery),
  4172. function(e) {
  4173. var t = e.alpaca;
  4174. t.Fields.LowerCaseField = t.Fields.TextField.extend({ getFieldType: function() {
  4175. return "lowercase" }, setup: function() { this.base(), this.data && (this.data = this.data.toLowerCase()) }, setValue: function(e) {
  4176. if (!e) return this.base(e);
  4177. var t = e.toLowerCase();
  4178. t != this.getValue() && this.base(t) }, onKeyPress: function(e) { this.base(e);
  4179. var n = this;
  4180. t.later(25, this, function() {
  4181. var e = n.getValue();
  4182. n.setValue(e) }) }, getTitle: function() {
  4183. return "Lowercase Text" }, getDescription: function() {
  4184. return "Text field for lowercase text." } }), t.registerFieldClass("lowercase", t.Fields.LowerCaseField), t.registerDefaultFormatFieldMapping("lowercase", "lowercase") }(jQuery),
  4185. function(e) {
  4186. var t = e.alpaca;
  4187. t.Fields.MapField = t.Fields.ArrayField.extend({ getFieldType: function() {
  4188. return "map" }, getType: function() {
  4189. return "object" }, setup: function() {
  4190. if (this.data && t.isObject(this.data)) {
  4191. var n = [];
  4192. e.each(this.data, function(e, i) {
  4193. var a = t.copyOf(i);
  4194. a._key = e, n.push(a) }), this.data = n }
  4195. this.base(), t.mergeObject(this.options, { forceRevalidation: !0 }), t.isEmpty(this.data) }, getContainerValue: function() {
  4196. if (0 !== this.children.length || this.isRequired()) {
  4197. for (var e = {}, t = 0; t < this.children.length; t++) {
  4198. var n = this.children[t].getValue(),
  4199. i = n._key;
  4200. i && (delete n._key, e[i] = n) }
  4201. return e } }, handleValidate: function() {
  4202. var e = this.base(),
  4203. t = this.validation,
  4204. n = this._validateMapKeysNotEmpty();
  4205. t.keyMissing = { message: n ? "" : this.getMessage("keyMissing"), status: n };
  4206. var i = this._validateMapKeysUnique();
  4207. return t.keyNotUnique = { message: i ? "" : this.getMessage("keyNotUnique"), status: i }, e && t.keyMissing.status && t.keyNotUnique.status }, _validateMapKeysNotEmpty: function() {
  4208. for (var e = !0, t = 0; t < this.children.length; t++) {
  4209. var n = this.children[t].getValue(),
  4210. i = n._key;
  4211. if (!i) { e = !1;
  4212. break } }
  4213. return e }, _validateMapKeysUnique: function() {
  4214. for (var e = !0, t = {}, n = 0; n < this.children.length; n++) {
  4215. var i = this.children[n].getValue(),
  4216. a = i._key;
  4217. t[a] && (e = !1), t[a] = a }
  4218. return e }, getTitle: function() {
  4219. return "Map Field" }, getDescription: function() {
  4220. return "Field for objects with key/value pairs that share the same schema for values." } }), t.registerFieldClass("map", t.Fields.MapField), t.registerMessages({ keyNotUnique: "Keys of map field are not unique.", keyMissing: "Map contains an empty key." }) }(jQuery),
  4221. function(e) {
  4222. var t = e.alpaca;
  4223. t.Fields.OptionTreeField = t.Fields.TextField.extend({ getFieldType: function() {
  4224. return "optiontree" }, setup: function() {
  4225. var e = this;
  4226. this.base(), this.options.tree || (this.options.tree = {}), this.options.tree.selectors || (this.options.tree.selectors = {}), this.options.tree.order || (this.options.tree.order = []);
  4227. for (var n in this.options.tree.selectors) {
  4228. if (!this.options.tree.selectors[n].schema) return void t.logError("OptionTree selector for: " + n + " is missing schema");
  4229. this.options.tree.selectors[n].options || (this.options.tree.selectors[n].options = {}) }
  4230. this.options.tree.data || (this.options.tree.data = []);
  4231. for (var i = 0; i < this.options.tree.data.length; i++) {
  4232. var a = this.options.tree.data[i];
  4233. if (a.attributes)
  4234. for (var n in a.attributes) this.options.tree.selectors[n] || (this.options.tree.selectors[n] = {}), this.options.tree.selectors[n].label || (this.options.tree.selectors[n].options.noneLabel = "Choose..."), this.options.tree.selectors[n].type || (this.options.tree.selectors[n].options.type = "select") }
  4235. if (!e.options.tree.order) { e.options.tree.order = [];
  4236. for (var n in e.options.tree.selectors) e.options.tree.order.push(e.options.tree.selectors[n]) } "undefined" == typeof e.options.tree.horizontal && (e.options.tree.horizontal = !0), this.locationValueLists = {}, this.locationValues = {};
  4237. for (var i = 0; i < e.options.tree.data.length; i++)
  4238. if (e.options.tree.data[i].attributes) {
  4239. var r = "root";
  4240. for (var n in e.options.tree.data[i].attributes) {
  4241. var o = e.options.tree.data[i].attributes[n],
  4242. l = this.locationValueLists[r];
  4243. l || (l = [], this.locationValueLists[r] = l);
  4244. for (var s = !1, u = 0; u < l.length; u++)
  4245. if (l[u].value === o) { s = !0;
  4246. break }
  4247. s || l.push({ text: o, value: o }), r.length > 0 && (r += "~"), r += n + "=" + o }
  4248. this.locationValues[r] = e.options.tree.data[i].value }
  4249. this.currentAttributes = {}, this.controls = {} }, toLocation: function(e) {
  4250. var t = "root";
  4251. for (var n in e) {
  4252. var i = e[n];
  4253. t.length > 0 && (t += "~"), t += n + "=" + i }
  4254. return t }, existsLocationWithPrefix: function(e) {
  4255. var t = !1;
  4256. for (var n in this.locationValueLists)
  4257. if (n.indexOf(e) > -1) { t = !0;
  4258. break }
  4259. return t }, afterRenderControl: function(t, n) {
  4260. var i = this;
  4261. i.optionTreeHolder = e(i.field).find(".optiontree"), i.options.tree.horizontal && e(i.field).addClass("optiontree-horizontal"), this.base(t, function() { i.refreshOptionTreeControls(function() { n() }) }) }, refreshOptionTreeControls: function(n) {
  4262. var i = this;
  4263. for (var a in i.controls) i.controls[a].hide();
  4264. for (var r = 0, o = 0; o < i.options.tree.order.length; o++) {
  4265. var l = i.options.tree.order[o]; "undefined" != typeof i.currentAttributes[l] && null !== i.currentAttributes[l] && "" !== i.currentAttributes[l] && r++ }
  4266. var s = "root",
  4267. u = [],
  4268. c = 0,
  4269. o = 0;
  4270. do {
  4271. if (o < i.options.tree.order.length) {
  4272. var l = i.options.tree.order[o],
  4273. d = o == i.options.tree.order.length - 1 || i.existsLocationWithPrefix(s + "~" + l + "=");
  4274. if (d)
  4275. if (r >= c) {
  4276. if (i.controls[l]) i.controls[l].show(), s += "~" + l + "=" + i.currentAttributes[l];
  4277. else {
  4278. var p = i.options.tree.selectors[l],
  4279. h = o + 1 === i.options.tree.order.length,
  4280. f = function(t, n, a, r, o, l) {
  4281. return function(s) {
  4282. var u = a.schema,
  4283. c = a.options;
  4284. c || (c = {}), c.type || (c.type = "select"), "select" === c.type && (c.dataSource = function(e) {
  4285. var t = i.toLocation(i.currentAttributes),
  4286. n = i.locationValueLists[t];
  4287. e(n) });
  4288. var d = e("<div class='optiontree-selector'></div>");
  4289. e(d).alpaca({ schema: u, options: c, postRender: function(a) { r[n] = a, e(o).append(d), a.selectorId = n, a.on("change", function() {
  4290. var e = this.selectorId;
  4291. i.currentAttributes[e] = this.getValue();
  4292. for (var n = 0; n < i.options.tree.order.length; n++)
  4293. if (n > t) {
  4294. var e = i.options.tree.order[n];
  4295. delete i.currentAttributes[e], r[e] && (r[e].destroy(), delete r[e]) }
  4296. if (l) {
  4297. for (var a = null, n = 0; n < i.options.tree.data.length; n++) {
  4298. var o = !0,
  4299. s = i.options.tree.data[n].attributes;
  4300. for (var u in i.currentAttributes)
  4301. if (s[u] !== i.currentAttributes[u]) { o = !1;
  4302. break }
  4303. o && (a = i.options.tree.data[n].value) }
  4304. a && i.setValue(a) }
  4305. i.refreshOptionTreeControls() }), a.show(), s() } }) } }(o, l, p, i.controls, i.optionTreeHolder, h);
  4306. u.push(f), s += "~" + l + "=" + i.currentAttributes[l] }
  4307. c++ } else i.controls[l] && (i.controls[l].destroy(), delete i.controls[l]);
  4308. else i.controls[l] && (i.controls[l].destroy(), delete i.controls[l]) }
  4309. o++ } while (o < i.options.tree.order.length);
  4310. t.series(u, function() { n && n() }) }, getType: function() {
  4311. return "any" }, getTitle: function() {
  4312. return "Option Tree" }, getDescription: function() {
  4313. return "Option Tree" }, getSchemaOfOptions: function() {
  4314. return t.merge(this.base(), { properties: { tree: { type: "object", properties: { options: { type: "object" }, order: { type: "array", items: { type: "string" } }, data: { type: "array", items: { type: "object", properties: { value: { type: "any" }, attributes: { type: "object" } } } }, horizontal: { type: "boolean" } } } } }) }, getOptionsForOptions: function() {
  4315. return t.merge(this.base(), { fields: {} }) } }), t.registerFieldClass("optiontree", t.Fields.OptionTreeField) }(jQuery),
  4316. function(e) {
  4317. var t = e.alpaca;
  4318. t.Fields.PasswordField = t.Fields.TextField.extend({ getFieldType: function() {
  4319. return "password" }, setup: function() { this.base(), this.schema.pattern || (this.schema.pattern = t.regexps.password) }, handleValidate: function() {
  4320. var e = this.base(),
  4321. t = this.validation;
  4322. return t.invalidPattern.status || (t.invalidPattern.message = this.getMessage("invalidPassword")), e }, getTitle: function() {
  4323. return "Password Field" }, getDescription: function() {
  4324. return "Password Field." }, getSchemaOfSchema: function() {
  4325. var e = this.schema && this.schema.pattern ? this.schema.pattern : /^[0-9a-zA-Z\x20-\x7E]*$/;
  4326. return t.merge(this.base(), { properties: { pattern: { title: "Pattern", description: "Field Pattern in Regular Expression", type: "string", "default": this.schema.pattern, "enum": [e], readonly: !0 }, format: { title: "Format", description: "Property data format", type: "string", "default": "password", "enum": ["password"], readonly: !0 } } }) }, getOptionsForSchema: function() {
  4327. return t.merge(this.base(), { fields: { format: { type: "text" } } }) } }), t.registerMessages({ invalidPassword: "Invalid Password" }), t.registerFieldClass("password", t.Fields.PasswordField), t.registerDefaultFormatFieldMapping("password", "password") }(jQuery),
  4328. function(e) {
  4329. var t = e.alpaca;
  4330. t.Fields.PersonalNameField = t.Fields.TextField.extend({ getFieldType: function() {
  4331. return "personalname" }, setValue: function(e) {
  4332. if (!e) return this.base(e);
  4333. for (var t = "", n = 0; n < e.length; n++) t += 0 === n ? e.charAt(n).toUpperCase() : " " === e.charAt(n - 1) || "-" === e.charAt(n - 1) || "'" === e.charAt(n - 1) ? e.charAt(n).toUpperCase() : e.charAt(n);
  4334. t != this.getValue() && this.base(t) }, onKeyPress: function(e) { this.base(e);
  4335. var n = this;
  4336. t.later(25, this, function() {
  4337. var e = n.getValue();
  4338. n.setValue(e) }) }, getTitle: function() {
  4339. return "Personal Name" }, getDescription: function() {
  4340. return "Text Field for personal name with captical letter for first letter & after hyphen, space or apostrophe." } }), t.registerFieldClass("personalname", t.Fields.PersonalNameField) }(jQuery),
  4341. function(e) {
  4342. var t = e.alpaca;
  4343. t.Fields.PhoneField = t.Fields.TextField.extend({ setup: function() { this.inputType = "tel", this.base(), this.schema.pattern || (this.schema.pattern = t.regexps.phone), t.isEmpty(this.options.maskString) && (this.options.maskString = "(999) 999-9999") }, postRender: function(e) { this.base(function() { e() }) }, handleValidate: function() {
  4344. var e = this.base(),
  4345. t = this.validation;
  4346. return t.invalidPattern.status || (t.invalidPattern.message = this.getMessage("invalidPhone")), e }, getFieldType: function() {
  4347. return "phone" }, getTitle: function() {
  4348. return "Phone Field" }, getDescription: function() {
  4349. return "Phone Field." }, getSchemaOfSchema: function() {
  4350. var e = this.schema && this.schema.pattern ? this.schema.pattern : t.regexps.phone;
  4351. return t.merge(this.base(), { properties: { pattern: { title: "Pattern", description: "Field Pattern in Regular Expression", type: "string", "default": e, "enum": [e], readonly: !0 }, format: { title: "Format", description: "Property data format", type: "string", "default": "phone", "enum": ["phone"], readonly: !0 } } }) }, getOptionsForSchema: function() {
  4352. return t.merge(this.base(), { fields: { format: { type: "text" } } }) }, getSchemaOfOptions: function() {
  4353. return t.merge(this.base(), { properties: { maskString: { title: "Field Mask String", description: "Expression for field mask", type: "string", "default": "(999) 999-9999" } } }) } }), t.registerMessages({ invalidPhone: "Invalid Phone Number, e.g. (123) 456-9999" }), t.registerFieldClass("phone", t.Fields.PhoneField), t.registerDefaultFormatFieldMapping("phone", "phone") }(jQuery),
  4354. function(e) {
  4355. var t = e.alpaca;
  4356. t.Fields.PickAColorField = t.Fields.TextField.extend({ setup: function() {
  4357. var t = this;
  4358. this.pickAColorFieldAvailable = !1, t.isDisplayOnly() || "undefined" == typeof e.fn.pickAColor || (this.pickAColorFieldAvailable = !0), "undefined" != typeof this.options.pickacolor || t.pickAColorFieldAvailable || (this.inputType = "color"), this.base(), "undefined" == typeof this.options.pickacolor && (this.options.pickacolor = { showSpectrum: !0, showSavedColors: !0, saveColorsPerElement: !1, fadeMenuToggle: !0, showAdvanced: !0, showBasicColors: !0, showHexInput: !0, allowBlank: !0, inlineDropdown: !1 }), "undefined" == typeof this.options.colors && (this.options.colors = { white: "#ffffff", clouds: "#ecf0f1", red: "#c0392b", orange: "#e67e22", yellow: "#f1c40f", green: "#27ae60", blue: "#2980b9", purple: "#8e44ad", dark: "#34495e", black: "#000000", brown: "#bb9977" }), this.options.pickacolor && "undefined" == typeof this.options.pickacolor.basicColors && (this.options.pickacolor.basicColors = this.options.colors), "undefined" == typeof this.options.pickacolor.inlineDropdown && (this.options.pickacolor.inlineDropdown = !1) }, getFieldType: function() {
  4359. return "pickacolor" }, getType: function() {
  4360. return "string" }, afterRenderControl: function(t, n) {
  4361. var i = this;
  4362. this.base(t, function() { i.control && i.pickAColorFieldAvailable && i.options.pickacolor && (i.data && e(i.control).attr("value", i.data), e(i.control).addClass("pick-a-color"), e(i.control).pickAColor(i.options.pickacolor), e(i.control).on("change", function(t) { i.setValue(e(this).val()) })), n() }) }, getTitle: function() {
  4363. return "Pick-A-Color Field" }, getDescription: function() {
  4364. return "A color picker for selecting hexadecimal color values" } }), t.registerFieldClass("pickacolor", t.Fields.PickAColorField) }(jQuery),
  4365. function(e) {
  4366. var t = e.alpaca;
  4367. t.Fields.SearchField = t.Fields.TextField.extend({ setup: function() { this.inputType = "search", this.base(), this.options.attributes.results = 5 }, getFieldType: function() {
  4368. return "search" }, getType: function() {
  4369. return "string" }, getTitle: function() {
  4370. return "Search Field" }, getDescription: function() {
  4371. return "A search box field" } }), t.registerFieldClass("search", t.Fields.SearchField), t.registerDefaultSchemaFieldMapping("search", "search") }(jQuery),
  4372. function(e) {
  4373. var t = e.alpaca;
  4374. t.usHoldings = {}, t.usHoldings.territories = { "American Samoa": "AS", "District Of Columbia": "DC", "Federated States Of Micronesia": "FM", Guam: "GU", "Marshall Islands": "MH", "Northern Mariana Islands": "MP", Palau: "PW", "Puerto Rico": "PR", "Virgin Islands": "VI" }, t.usHoldings.states = { Alabama: "AL", Alaska: "AK", Arizona: "AZ", Arkansas: "AR", California: "CA", Colorado: "CO", Connecticut: "CT", Delaware: "DE", Florida: "FL", Georgia: "GA", Hawaii: "HI", Idaho: "ID", Illinois: "IL", Indiana: "IN", Iowa: "IA", Kansas: "KS", Kentucky: "KY", Louisiana: "LA", Maine: "ME", Maryland: "MD", Massachusetts: "MA", Michigan: "MI", Minnesota: "MN", Mississippi: "MS", Missouri: "MO", Montana: "MT", Nebraska: "NE", Nevada: "NV", "New Hampshire": "NH", "New Jersey": "NJ", "New Mexico": "NM", "New York": "NY", "North Carolina": "NC", "North Dakota": "ND", Ohio: "OH", Oklahoma: "OK", Oregon: "OR", Pennsylvania: "PA", "Rhode Island": "RI", "South Carolina": "SC", "South Dakota": "SD", Tennessee: "TN", Texas: "TX", Utah: "UT", Vermont: "VT", Virginia: "VA", Washington: "WA", "West Virginia": "WV", Wisconsin: "WI", Wyoming: "WY" }, t.Fields.StateField = t.Fields.SelectField.extend({
  4375. getFieldType: function() {
  4376. return "state" },
  4377. setup: function() { t.isUndefined(this.options.capitalize) && (this.options.capitalize = !1), t.isUndefined(this.options.includeStates) && (this.options.includeStates = !0), t.isUndefined(this.options.includeTerritories) && (this.options.includeTerritories = !0), t.isUndefined(this.options.format) && (this.options.format = "name"), "name" === this.options.format || "code" === this.options.format || (t.logError("The configured state format: " + this.options.format + " is not a legal value [name, code]"), this.options.format = "name");
  4378. var e = t.retrieveUSHoldings(this.options.includeStates, this.options.includeTerritories, "code" === this.options.format, this.options.capitalize);
  4379. this.schema["enum"] = e.keys, this.options.optionLabels = e.values, this.base() },
  4380. getTitle: function() {
  4381. return "State Field" },
  4382. getDescription: function() {
  4383. return "Provides a dropdown selector of states and/or territories in the United States, keyed by their two-character code." },
  4384. getSchemaOfOptions: function() {
  4385. return t.merge(this.base(), {
  4386. properties: { format: { title: "Format", description: "How to represent the state values in the selector", type: "string", "default": "name", "enum": ["name", "code"], readonly: !0 }, capitalize: { title: "Capitalize", description: "Whether the values should be capitalized", type: "boolean", "default": !1, readonly: !0 }, includeStates: { title: "Include States", description: "Whether to include the states of the United States", type: "boolean", "default": !0, readonly: !0 }, includeTerritories: { title: "Include Territories", description: "Whether to include the territories of the United States", type: "boolean", "default": !0, readonly: !0 } }
  4387. })
  4388. },
  4389. getOptionsForOptions: function() {
  4390. return t.merge(this.base(), { fields: { format: { type: "text" }, capitalize: { type: "checkbox" }, includeStates: { type: "checkbox" }, includeTerritories: { type: "checkbox" } } }) }
  4391. }), t.registerFieldClass("state", t.Fields.StateField), t.registerDefaultFormatFieldMapping("state", "state"), t.retrieveUSHoldings = function() {
  4392. return function(n, i, a, r) {
  4393. var o = { keys: [], values: [] },
  4394. l = e.extend({}, n ? t.usHoldings.states : {}, i ? t.usHoldings.territories : {}),
  4395. s = Object.keys(l);
  4396. s.sort();
  4397. for (var u in s) {
  4398. var c = s[u],
  4399. d = l[c],
  4400. p = a ? d : c;
  4401. r && (p = p.toUpperCase()), o.keys.push(d), o.values.push(p) }
  4402. return o } }()
  4403. }(jQuery),
  4404. function(e) {
  4405. var t = e.alpaca;
  4406. t.Fields.SummernoteField = t.Fields.TextAreaField.extend({ getFieldType: function() {
  4407. return "summernote" }, setup: function() { this.data || (this.data = ""), this.base(), "undefined" == typeof this.options.summernote && (this.options.summernote = { height: null, minHeight: null, maxHeight: null, focus: !0 }) }, afterRenderControl: function(t, n) {
  4408. var i = this;
  4409. this.base(t, function() {!i.isDisplayOnly() && i.control && e.fn.summernote && i.on("ready", function() { e(i.control).summernote(i.options.summernote) }), e(i.control).bind("destroyed", function() {
  4410. try { e(i.control).summernote("destroy") } catch (t) {} }), n() }) }, getTitle: function() {
  4411. return "Summernote Editor" }, getDescription: function() {
  4412. return "Provides an instance of a Summernote Editor control for use in editing HTML." }, getSchemaOfOptions: function() {
  4413. return t.merge(this.base(), { properties: { summernote: { title: "Summernote Editor options", description: "Use this entry to provide configuration options to the underlying Summernote plugin.", type: "any" } } }) }, getOptionsForOptions: function() {
  4414. return t.merge(this.base(), { fields: { summernote: { type: "any" } } }) } }), t.registerFieldClass("summernote", t.Fields.SummernoteField) }(jQuery),
  4415. function(e) {
  4416. var t = e.alpaca;
  4417. t.Fields.TableField = t.Fields.ArrayField.extend({ setup: function() {
  4418. var n = this;
  4419. n.options || (n.options = {}), "undefined" == typeof n.options.animate && (n.options.animate = !1), "undefined" == typeof this.options.toolbarSticky && (this.options.toolbarSticky = !0), this.base(), this.options.items.type || (this.options.items.type = "tablerow"), this.options.datatable && (this.options.datatables = this.options.datatable), "undefined" == typeof this.options.datatables && (this.options.datatables = { paging: !1, lengthChange: !1, info: !1, searching: !1, ordering: !0 }, "undefined" == typeof this.options.dragRows && (this.options.dragRows = !1), this.options.readonly && (this.options.dragRows = !1), this.isDisplayOnly() && (this.options.dragRows = !1)), "undefined" == typeof this.options.showActionsColumn && (this.options.showActionsColumn = !0, this.options.readonly && (this.options.showActionsColumn = !1), this.isDisplayOnly() && (this.options.showActionsColumn = !1)), this.options.datatables.columns = [], e.fn.dataTableExt && !e.fn.DataTable.ext.type.search.alpaca && (e.fn.DataTable.ext.order.alpaca = function(e, t) { n.data = n.getValue();
  4420. var i = null,
  4421. a = 0;
  4422. for (var r in n.schema.items.properties) {
  4423. if (a === t) { i = r;
  4424. break }
  4425. a++ }
  4426. var o = [];
  4427. if (n.data)
  4428. for (var l = 0; l < n.data.length; l++) o.push(n.data[l][i]);
  4429. return o.sort(), o }, e.fn.dataTableExt.afnFiltering.push(function(n, i, a, r, o) {
  4430. var l = e(n.nTableWrapper).find(".dataTables_filter input[type='search']").val();
  4431. if (!l) return !0;
  4432. l = "" + l, l = e.trim(l), l = l.toLowerCase();
  4433. for (var s = !1, u = 0; u < r.length; u++) {
  4434. var c = r[u];
  4435. if (c) {
  4436. var d = c.indexOf("data-alpaca-field-id=");
  4437. if (d > -1) {
  4438. var p = e(c).attr("data-alpaca-field-id"),
  4439. h = t.fieldInstances[p].getValue();
  4440. if (h && (h = "" + h, h = h.toLowerCase(), h.indexOf(l) > -1)) { s = !0;
  4441. break } } } }
  4442. return s })) }, getFieldType: function() {
  4443. return "table" }, prepareContainerModel: function(e) {
  4444. var t = this;
  4445. t.base(function(n) {
  4446. if (n.headers = [], t.schema.items && t.schema.items.properties)
  4447. for (var i in t.schema.items.properties) {
  4448. var a = {};
  4449. a.id = i, a.title = t.schema.items.properties[i].title, a.hidden = !1, t.options.items && t.options.items.fields && t.options.items.fields[i] && (t.options.items.fields[i].label && (a.title = t.options.items.fields[i].label), "hidden" === t.options.items.fields[i].type && (a.hidden = !0)), n.headers.push(a) }
  4450. e(n) }) }, afterRenderContainer: function(t, n) {
  4451. var i = this;
  4452. this.base(t, function() { i.cleanupDomInjections();
  4453. var t = e(this.container).find("table");
  4454. if (i.applyStyle("table", t), i.options.datatables && e.fn.DataTable) { i.options.dragRows && (i.options.datatables.columns.push({ orderable: !1, name: "dragRowsIndex", hidden: !0 }), i.options.datatables.columns.push({ orderable: !1, name: "dragRowsDraggable" }));
  4455. for (var a in i.schema.items.properties) {
  4456. var r = { orderable: !0, orderDataType: "alpaca" };
  4457. i.options.datatables.columns.push(r) }
  4458. i.options.showActionsColumn && i.options.datatables.columns.push({ orderable: !1, name: "actions" }), i.options.dragRows && (i.options.datatables.rowReorder = { selector: "tr td.alpaca-table-reorder-draggable-cell", dataSrc: 0, snapX: !0, update: !0 }), i.off("ready"), i.on("ready", function() { i._dt && (i._dt.destroy(), i._dt = void 0);
  4459. var t = e(i.container).find("table");
  4460. i._dt = e(t).DataTable(i.options.datatables), i._dt.on("row-reorder", function(e, t, n) { i._dt._disableAlpacaHandlers || t.length > 0 && t[0].oldPosition !== t[0].newPosition && (i._dt._disableAlpacaHandlers = !0, i.moveItem(t[0].oldPosition, t[0].newPosition, !1, function() {})) }), e(i.container).bind("destroyed", function() { i._dt && (i._dt.destroy(), i._dt = void 0) }), i._dt.on("order", function(e, t, n, a) {
  4461. if (!i._dt._disableAlpacaHandlers) {
  4462. if (!i._dt._originalChildren) { i._dt._originalChildren = [];
  4463. for (var r = 0; r < i.children.length; r++) i._dt._originalChildren.push(i.children[r]) }
  4464. for (var o = [], l = 0; l < t.aiDisplay.length; l++) {
  4465. var s = t.aiDisplay[l];
  4466. o.push(i._dt._originalChildren[s]) }
  4467. i.children = o, i._dt._disableAlpacaHandlers = !1 } }) }) }
  4468. e(t).find("thead > tr > th[data-header-id]").each(function() {
  4469. var t = e(this).attr("data-header-id"),
  4470. n = i.schema.items.properties[t],
  4471. a = null;
  4472. i.options.items.fields && i.options.items.fields[t] && (a = i.options.items.fields[t]), n.required || a && a.required ? i.fireCallback("tableHeaderRequired", n, a, this) : i.fireCallback("tableHeaderOptional", n, a, this) }), n() }.bind(i)) }, cleanupDomInjections: function() {
  4473. var n = function(t) {
  4474. var n = e(t).parent(),
  4475. i = e(t).children(),
  4476. a = e(t).attr("class").split(/\s+/);
  4477. e.each(a, function(t, i) { "alpaca-merge-up" === i || e(n).addClass(i) }), e.each(e(t)[0].attributes, function() { this.name && 0 === this.name.indexOf("data-") && e(n).attr(this.name, this.value) }), i.length > 0 ? e(t).replaceWith(i) : e(t).remove() };
  4478. this.getFieldEl().find("tr > .alpaca-field").each(function() { n(this) }), this.getFieldEl().find("tr > .alpaca-container").each(function() { n(this) });
  4479. var i = this.getFieldEl().find("." + t.MARKER_CLASS_ARRAY_ITEM_ACTIONBAR);
  4480. i.length > 0 && i.each(function() {
  4481. var t = e("<td class='actionbar' nowrap='nowrap'></td>");
  4482. e(this).before(t), e(t).append(this) });
  4483. var a = this.getFieldEl().find(".alpaca-table-reorder-draggable-cell");
  4484. a.length > 0 && a.each(function() {
  4485. var t = e("<td class='alpaca-table-reorder-draggable-cell'></td>");
  4486. e(this).before(t), e(t).append(e(this).children()), e(this).remove() });
  4487. var r = this.getFieldEl().find(".alpaca-table-reorder-index-cell");
  4488. r.length > 0 && r.each(function(t) {
  4489. var n = e("<td class='alpaca-table-reorder-index-cell'>" + t + "</td>");
  4490. e(this).before(n), e(this).remove() }), this.getFieldEl().find(".alpaca-merge-up").each(function() { n(this) }) }, doResolveItemContainer: function() {
  4491. var t = this;
  4492. return e(t.container).find("table tbody") }, doAfterAddItem: function(t, n) {
  4493. var i = this;
  4494. i.data = i.getValue(), i.cleanupDomInjections();
  4495. var a = i.options.datatables && e.fn.DataTable;
  4496. if (i.options.dragRows || a && 1 === i.data.length) i.refresh(function() { n() });
  4497. else {
  4498. if (i._dt) {
  4499. var r = i.field.find("[data-alpaca-field-path='" + t.path + "']");
  4500. i._dt.row.add(r) }
  4501. n() } }, doAfterRemoveItem: function(t, n) {
  4502. var i = this;
  4503. i.data = i.getValue(), i.cleanupDomInjections();
  4504. var a = i.options.datatables && e.fn.DataTable;
  4505. i.options.dragRows || a && 0 === i.data.length ? i.refresh(function() { n() }) : (i._dt && i._dt.rows(t).remove(), n()) }, getType: function() {
  4506. return "array" }, getTitle: function() {
  4507. return "Table Field" }, getDescription: function() {
  4508. return "Renders array items into a table" }, getSchemaOfOptions: function() {
  4509. return t.merge(this.base(), { properties: { datatables: { title: "DataTables Configuration", description: "Optional configuration to be passed to the underlying DataTables Plugin.", type: "object" }, showActionsColumn: { title: "Show Actions Column", "default": !0, description: "Whether to show or hide the actions column.", type: "boolean" }, dragRows: { title: "Drag Rows", "default": !1, description: "Whether to enable the dragging of rows via a draggable column. This requires DataTables and the DataTables Row Reorder Plugin.", type: "boolean" } } }) }, getOptionsForOptions: function() {
  4510. return t.merge(this.base(), { fields: { datatables: { type: "object" }, showActionsColumn: { type: "checkbox" }, dragRows: { type: "checkbox" } } }) } }), t.registerFieldClass("table", t.Fields.TableField) }(jQuery),
  4511. function(e) {
  4512. var t = e.alpaca;
  4513. t.Fields.TableRowField = t.Fields.ObjectField.extend({ prepareContainerModel: function(e) {
  4514. var t = this;
  4515. this.base(function(n) { n.options.showActionsColumn = t.parent.options.showActionsColumn, n.options.dragRows = t.parent.options.dragRows;
  4516. for (var i = 0; i < n.items.length; i++) "hidden" === n.items[i].options.type && (n.items[i].hidden = !0);
  4517. e(n) }) }, getFieldType: function() {
  4518. return "tablerow" }, getType: function() {
  4519. return "object" }, getTitle: function() {
  4520. return "Table Row Field" }, getDescription: function() {
  4521. return "Renders object items into a table row" } }), t.registerFieldClass("tablerow", t.Fields.TableRowField) }(jQuery),
  4522. function(e) {
  4523. var t = e.alpaca;
  4524. t.Fields.TagField = t.Fields.LowerCaseField.extend({ getFieldType: function() {
  4525. return "tag" }, setup: function() { this.base(), this.options.separator || (this.options.separator = ",") }, getControlValue: function() {
  4526. var e = this.base();
  4527. return "" === e ? [] : e.split(this.options.separator) }, setValue: function(e) {
  4528. return "" !== e ? e ? void this.base(e.join(this.options.separator)) : this.base("") : void 0 }, onBlur: function(t) { this.base(t);
  4529. var n = this.getValue(),
  4530. i = [];
  4531. e.each(n, function(e, t) { "" !== t.trim() && i.push(t.trim()) }), this.setValue(i) }, getTitle: function() {
  4532. return "Tag Field" }, getDescription: function() {
  4533. return "Text field for entering list of tags separated by delimiter." }, getSchemaOfOptions: function() {
  4534. return t.merge(this.base(), { properties: { separator: { title: "Separator", description: "Separator used to split tags.", type: "string", "default": "," } } }) }, getOptionsForOptions: function() {
  4535. return t.merge(this.base(), { fields: { separator: { type: "text" } } }) } }), t.registerFieldClass("tag", t.Fields.TagField) }(jQuery),
  4536. function(e) {
  4537. var t = e.alpaca;
  4538. t.Fields.TimeField = t.Fields.DateField.extend({ getFieldType: function() {
  4539. return "time" }, getDefaultFormat: function() {
  4540. return t.defaultTimeFormat }, setup: function() { this.base() }, getTitle: function() {
  4541. return "Time Field" }, getDescription: function() {
  4542. return "Time Field" } }), t.registerMessages({ invalidTime: "Invalid time" }), t.registerFieldClass("time", t.Fields.TimeField), t.registerDefaultFormatFieldMapping("time", "time") }(jQuery),
  4543. function(e) {
  4544. var t = e.alpaca;
  4545. t.Fields.TinyMCEField = t.Fields.TextAreaField.extend({ getFieldType: function() {
  4546. return "tinymce" }, setup: function() {
  4547. var e = this;
  4548. this.data || (this.data = ""), e.options.toolbar || (e.options.toolbar = "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"), this.base() }, setValue: function(e) {
  4549. var t = this;
  4550. this.base(e), t.editor && t.editor.setContent(e) }, getControlValue: function() {
  4551. var e = this,
  4552. t = null;
  4553. return e.editor && (t = e.editor.getContent()), t }, initTinyMCEEvents: function() {
  4554. var e = this;
  4555. e.editor && (e.editor.on("click", function(t) { e.onClick.call(e, t), e.trigger("click", t) }), e.editor.on("change", function(t) { e.onChange(), e.triggerWithPropagation("change", t) }), e.editor.on("blur", function(t) { e.onBlur(), e.trigger("blur", t) }), e.editor.on("focus", function(t) { e.onFocus.call(e, t), e.trigger("focus", t) }), e.editor.on("keypress", function(t) { e.onKeyPress.call(e, t), e.trigger("keypress", t) }), e.editor.on("keyup", function(t) { e.onKeyUp.call(e, t), e.trigger("keyup", t) }), e.editor.on("keydown", function(t) { e.onKeyDown.call(e, t), e.trigger("keydown", t) })) }, afterRenderControl: function(t, n) {
  4556. var i = this;
  4557. this.base(t, function() {!i.isDisplayOnly() && i.control && "undefined" != typeof tinyMCE && i.on("ready", function() {
  4558. if (!i.editor) {
  4559. var t = e(i.control)[0].id;
  4560. tinyMCE.init({ init_instance_callback: function(e) { i.editor = e, i.initTinyMCEEvents() }, selector: "#" + t, toolbar: i.options.toolbar }) } }), n() }) }, destroy: function() {
  4561. var e = this;
  4562. e.editor && (e.editor.remove(), e.editor = null), this.base() }, getTitle: function() {
  4563. return "TinyMCE Editor" }, getDescription: function() {
  4564. return "Provides an instance of a TinyMCE control for use in editing HTML." }, getSchemaOfOptions: function() {
  4565. return t.merge(this.base(), { properties: { toolbar: { title: "TinyMCE toolbar options", description: "Toolbar options for TinyMCE plugin.", type: "string" } } }) }, getOptionsForOptions: function() {
  4566. return t.merge(this.base(), { fields: { toolbar: { type: "text" } } }) } }), t.registerFieldClass("tinymce", t.Fields.TinyMCEField) }(jQuery),
  4567. function(e) {
  4568. var t = e.alpaca;
  4569. t.Fields.TokenField = t.Fields.TextField.extend({ getFieldType: function() {
  4570. return "token" }, setup: function() { this.base(), this.options.separator || (this.options.separator = ","), "undefined" == typeof this.options.tokenfield && (this.options.tokenfield = {}), "undefined" == typeof this.options.tokenfield.showAutocompleteOnFocus && (this.options.tokenfield.showAutocompleteOnFocus = !0) }, getControlValue: function() {
  4571. return this.base() }, setValue: function(e) { this.base(e) }, onBlur: function(e) { this.base(e) }, afterRenderControl: function(t, n) {
  4572. var i = this;
  4573. this.base(t, function() {!i.isDisplayOnly() && i.control && "undefined" != typeof e.fn.tokenfield && i.on("ready", function(t, n) { e(t.control).tokenfield(n) }(i, i.options.tokenfield)), n() }) }, getTitle: function() {
  4574. return "Token Field" }, getDescription: function() {
  4575. return "Token field for entering list of tokens separated by delimiter." }, getSchemaOfOptions: function() {
  4576. return t.merge(this.base(), { properties: { separator: { title: "Separator", description: "Separator used to split tokens.", type: "string", "default": "," }, tokenfield: { title: "Token Field options", description: "Settings to pass into the underlying bootstrap-tokenfield control", type: "object", "default": void 0 } } }) }, getOptionsForOptions: function() {
  4577. return t.merge(this.base(), { fields: { separator: { type: "text" } } }) } }), t.registerFieldClass("token", t.Fields.TokenField) }(jQuery),
  4578. function(e) {
  4579. var t = e.alpaca;
  4580. t.Fields.UploadField = t.ControlField.extend({ constructor: function(n, i, a, r, o, l) {
  4581. var s = this;
  4582. this.base(n, i, a, r, o, l), this.isArrayType = function() {
  4583. return "array" === s.schema.type }, this.isObjectType = function() {
  4584. return "object" === s.schema.type }, this.wrapTemplate = function(n) {
  4585. return function(i) {
  4586. for (var a = i.files, r = i.formatFileSize, o = i.options, l = [], u = 0; u < a.length; u++) {
  4587. var c = {};
  4588. c.options = s.options, c.file = t.cloneObject(a[u]), c.size = r(c.size), c.buttons = s.options.buttons, c.view = s.view, c.fileIndex = u;
  4589. var d = t.tmpl(s.view.getTemplateDescriptor(n), c, s);
  4590. l.push(d[0]) }
  4591. return l = e(l), e(l).each(function() { o.fileupload && o.fileupload.autoUpload && e(this).find("button.start").css("display", "none"), s.handleWrapRow(this, o), e(this).find("button.delete").on("click", function() {
  4592. var t = e(d).find("button.delete"),
  4593. n = e(t).attr("data-file-index"),
  4594. i = a[n];
  4595. if (s.onFileDelete.call(s, d, t, i), s.isArrayType()) {
  4596. var r = s.getValueAsArray();
  4597. r.splice(n, 1), s.setValueAsArray(r) } else s.isObjectType() && s.setValueAsArray([]);
  4598. s.triggerWithPropagation("change"), setTimeout(function() { s.refreshUIState() }, 200) }) }), e(l) } } }, getFieldType: function() {
  4599. return "upload" }, setup: function() {
  4600. var e = this;
  4601. this.base(), e.options.renderButtons = !1, e.options.buttons || (e.options.buttons = []), e.options.hideDeleteButton || e.options.buttons.push({ key: "delete", isDelete: !0 }), "undefined" == typeof e.options.showUploadPreview && (e.options.showUploadPreview = !0), "undefined" == typeof e.options.showHeaders && (e.options.showHeaders = !0), e.data || (e.data = []), e.data && t.isObject(e.data) && (e.data = [e.data]), e.options.upload || (e.options.upload = {}), "undefined" == typeof e.options.maxNumberOfFiles && "undefined" != typeof e.options.upload.maxNumberOfFiles && (e.options.maxNumberOfFiles = e.options.upload.maxNumberOfFiles), "undefined" == typeof e.options.maxNumberOfFiles && (e.options.maxNumberOfFiles = 1, e.isArrayType() && (e.options.maxNumberOfFiles = -1)), e.isObjectType() && (e.options.maxNumberOfFiles = 1), e.options.multiple === !1 && (e.options.maxNumberOfFiles = 1), (e.options.maxNumberOfFiles > 1 || -1 === e.options.maxNumberOfFiles) && (e.options.multiple = !0), e.options.upload.maxNumberOfFiles = 9999, e.options.maxNumberOfFiles > 0 && (e.options.upload.maxNumberOfFiles = e.options.maxNumberOfFiles), "undefined" == typeof e.options.maxFileSize && (e.options.upload.maxFileSize ? e.options.maxFileSize = e.options.upload.maxFileSize : e.options.maxFileSize = -1, e.options.maxFileSize && (e.options.upload.maxFileSize = e.options.maxFileSize)), "undefined" == typeof e.options.fileTypes && (e.options.upload.acceptFileTypes ? e.options.fileTypes = e.options.upload.acceptFileTypes : e.options.fileTypes = null, e.options.fileTypes && (e.options.upload.acceptFileTypes = e.options.fileTypes)), e.options.errorHandler || (e.options.errorHandler = function(e) { alert(e.join("\n")) });
  4602. var n = e.determineCsrfToken();
  4603. n && (e.options.upload || (e.options.upload = {}), e.options.upload.headers || (e.options.upload.headers = {}), e.options.upload.headers[t.CSRF_HEADER_NAME] = n) }, determineCsrfToken: function() {
  4604. var e = t.CSRF_TOKEN;
  4605. if (!e)
  4606. for (var n = 0; n < t.CSRF_COOKIE_NAMES.length; n++) {
  4607. var i = t.CSRF_COOKIE_NAMES[n],
  4608. a = t.readCookie(i);
  4609. if (a) { e = a;
  4610. break } }
  4611. return e }, prepareControlModel: function(e) {
  4612. var t = this;
  4613. t.base(function(n) { n.chooseButtonLabel = t.options.chooseButtonLabel, n.chooseButtonLabel || (n.chooseButtonLabel = t.getMessage("chooseFiles"), 1 === t.options.maxNumberOfFiles && (n.chooseButtonLabel = t.getMessage("chooseFile"))), n.dropZoneMessage = t.options.dropZoneMessage, n.dropZoneMessage || (n.dropZoneMessage = t.getMessage("dropZoneMultiple"), 1 === n.options.maxNumberOfFiles && (n.dropZoneMessage = t.getMessage("dropZoneSingle"))), n.selectFromExistingMessage = t.options.selectFromExistingMessage, n.selectFromExistingMessage || (n.selectFromExistingMessage = t.getMessage("selectFromExistingMultiple"), 1 === n.options.maxNumberOfFiles && (n.selectFromExistingMessage = t.getMessage("selectFromExistingSingle"))), e(n) }) }, afterRenderControl: function(t, n) {
  4614. var i = this;
  4615. this.base(t, function() { i.handlePostRender(function() { i.isDisplayOnly() && (e(i.control).find("button").hide(), e(i.control).find(".btn").hide(), e(i.control).find(".alpaca-fileupload-chooserow").hide(), e(i.control).find(".dropzone-message").hide()), n() }) }) }, getUploadTemplate: function() {
  4616. return this.wrapTemplate("control-upload-partial-upload") }, getDownloadTemplate: function() {
  4617. return this.wrapTemplate("control-upload-partial-download") }, handleBeforeFileUploadSubmit: function(e) {}, handlePostRender: function(t) {
  4618. var n = this,
  4619. i = this.control,
  4620. a = {};
  4621. if (a.dataType = "json", a.uploadTemplateId = null, a.uploadTemplate = this.getUploadTemplate(), a.downloadTemplateId = null, a.downloadTemplate = this.getDownloadTemplate(), a.filesContainer = e(i).find(".files"), a.dropZone = e(i).find(".fileupload-active-zone"), a.url = "/", a.method = "post", a.showUploadPreview = n.options.showUploadPreview, n.options.upload)
  4622. for (var r in n.options.upload) a[r] = n.options.upload[r];
  4623. n.options.multiple && e(i).find(".alpaca-fileupload-input").attr("multiple", !0), n.options.name && e(i).find(".alpaca-fileupload-input").attr("name", n.options.name), e(i).find(".progress").css("display", "none"), a.progressall = function(t, n) {
  4624. var a = !1;
  4625. if (n.loaded < n.total && (a = !0), a) { e(i).find(".progress").css("display", "block");
  4626. var r = parseInt(n.loaded / n.total * 100, 10);
  4627. e("#progress .progress-bar").css("width", r + "%") } else e(i).find(".progress").css("display", "none") }, a.add = function(e, t) {
  4628. var i = [],
  4629. a = 0;
  4630. do {
  4631. var r = !1;
  4632. if (a < t.files.length) {
  4633. if (n.options.fileTypes) {
  4634. var o = n.options.fileTypes; "string" == typeof n.options.fileTypes && (o = new RegExp(n.options.fileTypes)), o.test(t.files[a].type) || (i.push("Not an accepted file type: " + t.files[a].type), r = !0) }
  4635. n.options.maxFileSize > -1 && t.files[a].size > n.options.maxFileSize && (i.push("Filesize is too big: " + t.files[a].size), r = !0) }
  4636. r ? a++ : a++ } while (a < t.files.length);
  4637. i.length > 0 ? n.options.errorHandler(i) : t.submit() }, n.applyConfiguration(a);
  4638. var o = n.fileUpload = e(i).find(".alpaca-fileupload-input").fileupload(a);
  4639. o.bindFirst("fileuploaddone", function(e, t) {
  4640. var i = n.options.enhanceFiles;
  4641. i ? i(a, t) : n.enhanceFiles(a, t), t.files = t.result.files, setTimeout(function() { n.refreshValidationState(!0), n.refreshUIState() }, 250) }), o.bindFirst("fileuploadsubmit", function(t, i) { n.options.properties && e.each(i.files, function(e, t) {
  4642. for (var a in n.options.properties) {
  4643. var r = "property" + e + "__" + a,
  4644. o = n.options.properties[a];
  4645. o = n.applyTokenSubstitutions(o, e, t), i.formData || (i.formData = {}), i.formData[r] = o } }), n.options.parameters && e.each(i.files, function(e, t) {
  4646. for (var a in n.options.parameters) {
  4647. var r = "param" + e + "__" + a,
  4648. o = n.options.parameters[a];
  4649. o = n.applyTokenSubstitutions(o, e, t), i.formData || (i.formData = {}), i.formData[r] = o } }), n.handleBeforeFileUploadSubmit(i), n.options.beforeFileUploadSubmitHandler && n.options.beforeFileUploadSubmitHandler.call(n, i) }), o.bind("fileuploaddone", function(e, t) {
  4650. var i = n.getValueAsArray(),
  4651. a = function(e) {
  4652. return e === t.files.length ? void n.setValueAsArray(i) : void n.convertFileToDescriptor(t.files[e], function(t, n) { n && i.push(n), a(e + 1) }) };
  4653. a(0) }), o.bind("fileuploadfail", function(e, t) { t.errorThrown && n.onUploadFail(t) }), o.bind("fileuploadalways", function(e, t) { n.refreshUIState() }), n.applyBindings(o, i), n.preload(o, i, function(a) {
  4654. if (a) {
  4655. var r = e(n.control).find(".alpaca-fileupload-input");
  4656. e(r).fileupload("option", "done").call(r, e.Event("done"), { result: { files: a } }), n.afterPreload(o, i, a, function() { t() }) } else t() }), "undefined" != typeof document && e(document).bind("drop dragover", function(e) { e.preventDefault() }) }, handleWrapRow: function(e, t) {}, applyTokenSubstitutions: function(e, t, n) {
  4657. var i = { index: t, name: n.name, size: n.size, url: n.url, thumbnailUrl: n.thumbnailUrl },
  4658. a = -1,
  4659. r = 0;
  4660. do
  4661. if (a = e.indexOf("{", r), a > -1) {
  4662. var o = e.indexOf("}", a);
  4663. if (o > -1) {
  4664. var l = e.substring(a + car.length, o),
  4665. s = i[l];
  4666. s && (e = e.substring(0, a) + s + e.substring(o + 1)), r = o + 1 } }
  4667. while (a > -1);
  4668. return e }, applyConfiguration: function(e) {}, applyBindings: function(e) {}, convertFileToDescriptor: function(e, t) {
  4669. var n = { id: e.id, name: e.name, size: e.size, url: e.url, thumbnailUrl: e.thumbnailUrl, deleteUrl: e.deleteUrl, deleteType: e.deleteType };
  4670. t(null, n) }, convertDescriptorToFile: function(e, t) {
  4671. var n = { id: e.id, name: e.name, size: e.size, url: e.url, thumbnailUrl: e.thumbnailUrl, deleteUrl: e.deleteUrl, deleteType: e.deleteType };
  4672. t(null, n) }, enhanceFiles: function(e, t) {}, preload: function(e, t, n) {
  4673. var i = this,
  4674. a = [],
  4675. r = i.getValueAsArray(),
  4676. o = function(e) {
  4677. return e == r.length ? n(a) : void i.convertDescriptorToFile(r[e], function(t, n) { n && a.push(n), o(e + 1) }) };
  4678. o(0) }, afterPreload: function(e, t, n, i) {
  4679. var a = this;
  4680. a.refreshUIState(), i() }, getControlValue: function() {
  4681. return this.data }, getValue: function() {
  4682. var e = this.data;
  4683. return this.isObjectType() && (e = this.data && this.data.length > 0 ? this.data[0] : void 0), e }, setValue: function(e) { e ? t.isArray(e) ? this.data = e : t.isObject(e) && (this.data = [e]) : this.data = [], this.updateObservable(), this.triggerUpdate() }, getValueAsArray: function() {
  4684. return this.data || [] }, setValueAsArray: function(e) {
  4685. var t = this;
  4686. if (t.isArrayType()) t.setValue(e);
  4687. else if (t.isObjectType()) {
  4688. var n = null;
  4689. e && e.length > 0 && (n = e[0]), t.setValue(n) } }, reload: function(t) {
  4690. var n = this,
  4691. i = this.getValueAsArray(),
  4692. a = [],
  4693. r = function(o) {
  4694. if (o === i.length) {
  4695. var l = e(n.control).find(".alpaca-fileupload-input");
  4696. return e(l).fileupload("option", "done").call(l, e.Event("done"), { result: { files: a } }), n.refreshValidationState(), t() }
  4697. n.convertDescriptorToFile(i[o], function(e, t) { t && a.push(t), r(o + 1) }) };
  4698. r(0) }, plugin: function() {
  4699. var t = this;
  4700. return e(t.control).find(".alpaca-fileupload-input").data().blueimpFileupload }, refreshUIState: function() {
  4701. var e = this,
  4702. t = e.plugin();
  4703. if (t) {
  4704. var n = e.options.maxNumberOfFiles; - 1 === n ? e.refreshButtons(!0) : t.options.getNumberOfFiles && t.options.getNumberOfFiles() >= n ? e.refreshButtons(!1) : e.refreshButtons(!0) } }, refreshButtons: function(t) {
  4705. var n = this;
  4706. e(n.control).find(".btn.fileinput-button").prop("disabled", !0), e(n.control).find(".btn.fileinput-button").attr("disabled", "disabled"), e(n.control).find(".fileupload-active-zone p.dropzone-message").css("display", "none"), t && (e(n.control).find(".btn.fileinput-button").prop("disabled", !1), e(n.control).find(".btn.fileinput-button").attr("disabled", null), e(n.control).find(".fileupload-active-zone p.dropzone-message").css("display", "block")) }, onFileDelete: function(n, i, a) {
  4707. var r = this,
  4708. o = a.deleteUrl,
  4709. l = a.deleteType,
  4710. s = { method: l, url: o, headers: {} },
  4711. u = r.determineCsrfToken();
  4712. u && (s.headers[t.CSRF_HEADER_NAME] = u), e.ajax(s) }, onUploadFail: function(e) {
  4713. var t = this;
  4714. t.options.errorHandler && t.options.errorHandler.call(t, [e.errorThrown]);
  4715. for (var n = 0; n < e.files.length; n++) e.files[n].error = e.errorThrown }, disable: function() { e(this.field).find(".fileinput-button").prop("disabled", !0), e(this.field).find(".fileinput-button").attr("disabled", "disabled"), e(this.field).find(".alpaca-fileupload-well").css("visibility", "hidden") }, enable: function() { e(this.field).find(".fileinput-button").prop("disabled", !1), e(this.field).find(".fileinput-button").removeAttr("disabled"), e(this.field).find(".alpaca-fileupload-well").css("visibility", "visible") }, getTitle: function() {
  4716. return "Upload Field" }, getDescription: function() {
  4717. return "Provides an upload field with support for thumbnail preview" }, getType: function() {
  4718. return "array" }, getSchemaOfOptions: function() {
  4719. return t.merge(this.base(), { properties: { maxNumberOfFiles: { title: "Maximum Number of Files", description: "The maximum number of files to allow to be uploaded. If greater than zero, the maximum number will be constrained. If -1, then no limit is imposed.", type: "number", "default": 1 }, maxFileSize: { title: "Maximum File Size (in bytes)", description: "The maximum file size allowed per upload. If greater than zero, the maximum file size will be limited to the given size in bytes. If -1, then no limit is imposed.", type: "number", "default": -1 }, fileTypes: { title: "File Types", description: "A regular expression limiting the file types that can be uploaded based on filename", type: "string" }, multiple: { title: "Multiple", description: "Whether to allow multiple file uploads. If maxNumberOfFiles is not specified, multiple will toggle between 1 and unlimited.", type: "boolean", "default": !1 }, showUploadPreview: { title: "Show Upload Preview", description: "Whether to show thumbnails for uploaded assets (requires preview support)", type: "boolean", "default": !0 }, errorHandler: { title: "Error Handler", description: "Optional function handler to be called when one or more files fails to upload. This function is responsible for parsing the underlying xHR request and populating the error message state.", type: "function" } } }) } }), t.registerFieldClass("upload", t.Fields.UploadField), t.registerMessages({ chooseFile: "Choose File...", chooseFiles: "Choose Files...", dropZoneSingle: "Click the Choose button or Drag and Drop a file here to upload...", dropZoneMultiple: "Click the Choose button or Drag and Drop files here to upload..." }),
  4720. function(e) {
  4721. function t(t) {
  4722. return l ? t.data("events") : e._data(t[0]).events }
  4723. function n(e, n, i) {
  4724. var a = t(e),
  4725. r = a[n];
  4726. if (!l) {
  4727. var o = i ? r.splice(r.delegateCount - 1, 1)[0] : r.pop();
  4728. return void r.splice(i ? 0 : r.delegateCount || 0, 0, o) }
  4729. i ? a.live.unshift(a.live.pop()) : r.unshift(r.pop()) }
  4730. function i(t, i, a) {
  4731. var r = i.split(/\s+/);
  4732. t.each(function() {
  4733. for (var t = 0; t < r.length; ++t) {
  4734. var i = e.trim(r[t]).match(/[^\.]+/i)[0];
  4735. n(e(this), i, a) } }) }
  4736. var a = e.fn.jquery.split("."),
  4737. r = parseInt(a[0]),
  4738. o = parseInt(a[1]),
  4739. l = 1 > r || 1 === r && 7 > o;
  4740. e.fn.bindFirst = function() {
  4741. var t = e.makeArray(arguments),
  4742. n = t.shift();
  4743. return n && (e.fn.bind.apply(this, arguments), i(this, n)), this } }(e) }(jQuery),
  4744. function(e) {
  4745. var t = e.alpaca;
  4746. t.Fields.UpperCaseField = t.Fields.TextField.extend({ getFieldType: function() {
  4747. return "uppercase" }, setup: function() { this.base(), this.data && (this.data = this.data.toUpperCase()) }, setValue: function(e) {
  4748. if (!e) return this.base(e);
  4749. var n = null;
  4750. e && t.isString(e) && (n = e.toUpperCase()), n != this.getValue() && this.base(n) }, onKeyPress: function(e) { this.base(e);
  4751. var n = this;
  4752. t.later(25, this, function() {
  4753. var e = n.getValue();
  4754. n.setValue(e) }) }, getTitle: function() {
  4755. return "Uppercase Text" }, getDescription: function() {
  4756. return "Text field for uppercase text." } }), t.registerFieldClass("uppercase", t.Fields.UpperCaseField), t.registerDefaultFormatFieldMapping("uppercase", "uppercase") }(jQuery),
  4757. function(e) {
  4758. var t = e.alpaca;
  4759. t.Fields.URLField = t.Fields.TextField.extend({ getFieldType: function() {
  4760. return "url" }, setup: function() { this.inputType = "url", this.base(), "undefined" == typeof this.options.allowIntranet && (this.options.allowIntranet = !1), this.options.allowIntranet ? this.schema.pattern = t.regexps["intranet-url"] : this.schema.pattern = t.regexps.url, this.schema.format = "uri" }, handleValidate: function() {
  4761. var e = this.base(),
  4762. t = this.validation;
  4763. return t.invalidPattern.status || (t.invalidPattern.message = this.getMessage("invalidURLFormat")), e }, getSchemaOfOptions: function() {
  4764. return t.merge(this.base(), { properties: { allowIntranet: { title: "Allow intranet", description: "Allows URLs with unqualified hostnames" } } }) }, getOptionsForOptions: function() {
  4765. return t.merge(this.base(), { fields: { allowIntranet: { type: "checkbox" } } }) }, getTitle: function() {
  4766. return "URL Field" }, getDescription: function() {
  4767. return "Provides a text control with validation for an internet web address." } }), t.registerMessages({ invalidURLFormat: "The URL provided is not a valid web address." }), t.registerFieldClass("url", t.Fields.URLField), t.registerDefaultFormatFieldMapping("url", "url") }(jQuery),
  4768. function(e) {
  4769. var t = e.alpaca;
  4770. t.Fields.ZipcodeField = t.Fields.TextField.extend({ getFieldType: function() {
  4771. return "zipcode" }, setup: function() { this.base(), this.options.format = this.options.format ? this.options.format : "nine", "nine" === this.options.format ? this.schema.pattern = t.regexps["zipcode-nine"] : "five" === this.options.format ? this.schema.pattern = t.regexps["zipcode-five"] : (t.logError("The configured zipcode format: " + this.options.format + " is not a legal value [five, nine]"), this.options.format = "nine", this.schema.pattern = t.regexps["zipcode-nine"]), "nine" === this.options.format ? this.options.maskString = "99999-9999" : "five" === this.options.format && (this.options.maskString = "99999") }, handleValidate: function() {
  4772. var e = this.base(),
  4773. t = this.validation;
  4774. return t.invalidPattern.status || ("nine" === this.options.format ? t.invalidPattern.message = this.getMessage("invalidZipcodeFormatNine") : "five" === this.options.format && (t.invalidPattern.message = this.getMessage("invalidZipcodeFormatFive"))), e }, getSchemaOfOptions: function() {
  4775. return t.merge(this.base(), { properties: { format: { title: "Format", description: "How to represent the zipcode field", type: "string", "default": "five", "enum": ["five", "nine"], readonly: !0 } } }) }, getOptionsForOptions: function() {
  4776. return t.merge(this.base(), { fields: { format: { type: "text" } } }) }, getTitle: function() {
  4777. return "Zipcode Field" }, getDescription: function() {
  4778. return "Provides a five or nine-digital US zipcode control with validation." } }), t.registerMessages({ invalidZipcodeFormatFive: "Invalid Five-Digit Zipcode (#####)", invalidZipcodeFormatNine: "Invalid Nine-Digit Zipcode (#####-####)" }), t.registerFieldClass("zipcode", t.Fields.ZipcodeField), t.registerDefaultFormatFieldMapping("zipcode", "zipcode") }(jQuery),
  4779. function(e) {
  4780. var t = e.alpaca;
  4781. t.registerView({
  4782. id: "base",
  4783. title: "Abstract base view",
  4784. messages: {
  4785. countries: {
  4786. afg: "Afghanistan",
  4787. ala: "Aland Islands",
  4788. alb: "Albania",
  4789. dza: "Algeria",
  4790. asm: "American Samoa",
  4791. and: "Andorra",
  4792. ago: "Angola",
  4793. aia: "Anguilla",
  4794. ata: "Antarctica",
  4795. atg: "Antigua and Barbuda",
  4796. arg: "Argentina",
  4797. arm: "Armenia",
  4798. abw: "Aruba",
  4799. aus: "Australia",
  4800. aut: "Austria",
  4801. aze: "Azerbaijan",
  4802. bhs: "Bahamas",
  4803. bhr: "Bahrain",
  4804. bgd: "Bangladesh",
  4805. brb: "Barbados",
  4806. blr: "Belarus",
  4807. bel: "Belgium",
  4808. blz: "Belize",
  4809. ben: "Benin",
  4810. bmu: "Bermuda",
  4811. btn: "Bhutan",
  4812. bol: "Bolivia",
  4813. bih: "Bosnia and Herzegovina",
  4814. bwa: "Botswana",
  4815. bvt: "Bouvet Island",
  4816. bra: "Brazil",
  4817. iot: "British Indian Ocean Territory",
  4818. brn: "Brunei Darussalam",
  4819. bgr: "Bulgaria",
  4820. bfa: "Burkina Faso",
  4821. bdi: "Burundi",
  4822. khm: "Cambodia",
  4823. cmr: "Cameroon",
  4824. can: "Canada",
  4825. cpv: "Cape Verde",
  4826. cym: "Cayman Islands",
  4827. caf: "Central African Republic",
  4828. tcd: "Chad",
  4829. chl: "Chile",
  4830. chn: "China",
  4831. cxr: "Christmas Island",
  4832. cck: "Cocos (Keeling), Islands",
  4833. col: "Colombia",
  4834. com: "Comoros",
  4835. cog: "Congo",
  4836. cod: "Congo, the Democratic Republic of the",
  4837. cok: "Cook Islands",
  4838. cri: "Costa Rica",
  4839. hrv: "Croatia",
  4840. cub: "Cuba",
  4841. cyp: "Cyprus",
  4842. cze: "Czech Republic",
  4843. civ: "Cote d'Ivoire",
  4844. dnk: "Denmark",
  4845. dji: "Djibouti",
  4846. dma: "Dominica",
  4847. dom: "Dominican Republic",
  4848. ecu: "Ecuador",
  4849. egy: "Egypt",
  4850. slv: "El Salvador",
  4851. gnq: "Equatorial Guinea",
  4852. eri: "Eritrea",
  4853. est: "Estonia",
  4854. eth: "Ethiopia",
  4855. flk: "Falkland Islands (Malvinas),",
  4856. fro: "Faroe Islands",
  4857. fji: "Fiji",
  4858. fin: "Finland",
  4859. fra: "France",
  4860. guf: "French Guiana",
  4861. pyf: "French Polynesia",
  4862. atf: "French Southern Territories",
  4863. gab: "Gabon",
  4864. gmb: "Gambia",
  4865. geo: "Georgia",
  4866. deu: "Germany",
  4867. gha: "Ghana",
  4868. gib: "Gibraltar",
  4869. grc: "Greece",
  4870. grl: "Greenland",
  4871. grd: "Grenada",
  4872. glp: "Guadeloupe",
  4873. gum: "Guam",
  4874. gtm: "Guatemala",
  4875. ggy: "Guernsey",
  4876. gin: "Guinea",
  4877. gnb: "Guinea-Bissau",
  4878. guy: "Guyana",
  4879. hti: "Haiti",
  4880. hmd: "Heard Island and McDonald Islands",
  4881. vat: "Holy See (Vatican City State),",
  4882. hnd: "Honduras",
  4883. hkg: "Hong Kong",
  4884. hun: "Hungary",
  4885. isl: "Iceland",
  4886. ind: "India",
  4887. idn: "Indonesia",
  4888. irn: "Iran, Islamic Republic of",
  4889. irq: "Iraq",
  4890. irl: "Ireland",
  4891. imn: "Isle of Man",
  4892. isr: "Israel",
  4893. ita: "Italy",
  4894. jam: "Jamaica",
  4895. jpn: "Japan",
  4896. jey: "Jersey",
  4897. jor: "Jordan",
  4898. kaz: "Kazakhstan",
  4899. ken: "Kenya",
  4900. kir: "Kiribati",
  4901. prk: "Korea, Democratic People's Republic of",
  4902. kor: "Korea, Republic of",
  4903. kwt: "Kuwait",
  4904. kgz: "Kyrgyzstan",
  4905. lao: "Lao People's Democratic Republic",
  4906. lva: "Latvia",
  4907. lbn: "Lebanon",
  4908. lso: "Lesotho",
  4909. lbr: "Liberia",
  4910. lby: "Libyan Arab Jamahiriya",
  4911. lie: "Liechtenstein",
  4912. ltu: "Lithuania",
  4913. lux: "Luxembourg",
  4914. mac: "Macao",
  4915. mkd: "Macedonia, the former Yugoslav Republic of",
  4916. mdg: "Madagascar",
  4917. mwi: "Malawi",
  4918. mys: "Malaysia",
  4919. mdv: "Maldives",
  4920. mli: "Mali",
  4921. mlt: "Malta",
  4922. mhl: "Marshall Islands",
  4923. mtq: "Martinique",
  4924. mrt: "Mauritania",
  4925. mus: "Mauritius",
  4926. myt: "Mayotte",
  4927. mex: "Mexico",
  4928. fsm: "Micronesia, Federated States of",
  4929. mda: "Moldova, Republic of",
  4930. mco: "Monaco",
  4931. mng: "Mongolia",
  4932. mne: "Montenegro",
  4933. msr: "Montserrat",
  4934. mar: "Morocco",
  4935. moz: "Mozambique",
  4936. mmr: "Myanmar",
  4937. nam: "Namibia",
  4938. nru: "Nauru",
  4939. npl: "Nepal",
  4940. nld: "Netherlands",
  4941. ant: "Netherlands Antilles",
  4942. ncl: "New Caledonia",
  4943. nzl: "New Zealand",
  4944. nic: "Nicaragua",
  4945. ner: "Niger",
  4946. nga: "Nigeria",
  4947. niu: "Niue",
  4948. nfk: "Norfolk Island",
  4949. mnp: "Northern Mariana Islands",
  4950. nor: "Norway",
  4951. omn: "Oman",
  4952. pak: "Pakistan",
  4953. plw: "Palau",
  4954. pse: "Palestinian Territory, Occupied",
  4955. pan: "Panama",
  4956. png: "Papua New Guinea",
  4957. pry: "Paraguay",
  4958. per: "Peru",
  4959. phl: "Philippines",
  4960. pcn: "Pitcairn",
  4961. pol: "Poland",
  4962. prt: "Portugal",
  4963. pri: "Puerto Rico",
  4964. qat: "Qatar",
  4965. rou: "Romania",
  4966. rus: "Russian Federation",
  4967. rwa: "Rwanda",
  4968. reu: "Reunion",
  4969. blm: "Saint Barthelemy",
  4970. shn: "Saint Helena",
  4971. kna: "Saint Kitts and Nevis",
  4972. lca: "Saint Lucia",
  4973. maf: "Saint Martin (French part)",
  4974. spm: "Saint Pierre and Miquelon",
  4975. vct: "Saint Vincent and the Grenadines",
  4976. wsm: "Samoa",
  4977. smr: "San Marino",
  4978. stp: "Sao Tome and Principe",
  4979. sau: "Saudi Arabia",
  4980. sen: "Senegal",
  4981. srb: "Serbia",
  4982. syc: "Seychelles",
  4983. sle: "Sierra Leone",
  4984. sgp: "Singapore",
  4985. svk: "Slovakia",
  4986. svn: "Slovenia",
  4987. slb: "Solomon Islands",
  4988. som: "Somalia",
  4989. zaf: "South Africa",
  4990. sgs: "South Georgia and the South Sandwich Islands",
  4991. esp: "Spain",
  4992. lka: "Sri Lanka",
  4993. sdn: "Sudan",
  4994. sur: "Suriname",
  4995. sjm: "Svalbard and Jan Mayen",
  4996. swz: "Swaziland",
  4997. swe: "Sweden",
  4998. che: "Switzerland",
  4999. syr: "Syrian Arab Republic",
  5000. twn: "Taiwan, Province of China",
  5001. tjk: "Tajikistan",
  5002. tza: "Tanzania, United Republic of",
  5003. tha: "Thailand",
  5004. tls: "Timor-Leste",
  5005. tgo: "Togo",
  5006. tkl: "Tokelau",
  5007. ton: "Tonga",
  5008. tto: "Trinidad and Tobago",
  5009. tun: "Tunisia",
  5010. tur: "Turkey",
  5011. tkm: "Turkmenistan",
  5012. tca: "Turks and Caicos Islands",
  5013. tuv: "Tuvalu",
  5014. uga: "Uganda",
  5015. ukr: "Ukraine",
  5016. are: "United Arab Emirates",
  5017. gbr: "United Kingdom",
  5018. usa: "United States",
  5019. umi: "United States Minor Outlying Islands",
  5020. ury: "Uruguay",
  5021. uzb: "Uzbekistan",
  5022. vut: "Vanuatu",
  5023. ven: "Venezuela",
  5024. vnm: "Viet Nam",
  5025. vgb: "Virgin Islands, British",
  5026. vir: "Virgin Islands, U.S.",
  5027. wlf: "Wallis and Futuna",
  5028. esh: "Western Sahara",
  5029. yem: "Yemen",
  5030. zmb: "Zambia",
  5031. zwe: "Zimbabwe"
  5032. },
  5033. empty: "",
  5034. required: "This field is required",
  5035. valid: "",
  5036. invalid: "This field is invalid",
  5037. months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
  5038. timeUnits: { SECOND: "seconds", MINUTE: "minutes", HOUR: "hours", DAY: "days", MONTH: "months", YEAR: "years" }
  5039. }
  5040. })
  5041. }(jQuery),
  5042. function(e) {
  5043. var t = e.alpaca;
  5044. t.registerView({ id: "base", messages: { cs_CZ: { required: "Toto pole je vyžadováno", invalid: "Toto pole je neplatné", months: ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"], timeUnits: { SECOND: "sekundy", MINUTE: "minuty", HOUR: "hodiny", DAY: "dny", MONTH: "měsíce", YEAR: "roky" }, invalidValueOfEnum: "Toto pole musí obsahovat jednu hodnotu z {0}. Aktuální hodnota je: {1}", notOptional: "Toto pole není volitelné", disallowValue: "{0} jsou zakázané hodnoty.", notEnoughItems: "Minimální počet položek je {0}", tooManyItems: "Maximální počet položek je {0}", valueNotUnique: "Hodnoty nejsou unikátní", notAnArray: "Tato hodnota není pole", addItemButtonLabel: "Přidat novou položku", addButtonLabel: "Přidat", removeButtonLabel: "Odebrat", upButtonLabel: "Nahoru", downButtonLabel: "Dolů", noneLabel: "Žádný", stringValueTooSmall: "Minimální hodnota tohoto pole je {0}", stringValueTooLarge: "Maximální hodnota tohoto pole je {0}", stringValueTooSmallExclusive: "Hodnota tohoto pole musí být větší než {0}", stringValueTooLargeExclusive: "Hodnota tohoto pole musí být menší než {0}", stringDivisibleBy: "Hodnota musí být dělitelná {0}", stringNotANumber: "Hodnota není číslo.", stringValueNotMultipleOf: "Číslo není násobkem {0}", tooManyProperties: "Maximální počet vlastností ({0}) byl překročen.", tooFewProperties: "Není dostatek vlastností (je požadováno {0})", wordLimitExceeded: "Maximální počet slov ({0}) byl překročen.", invalidPattern: "Toto pole má mít vzor {0}", stringTooShort: "Toto pole musí obsahovat nejmeně {0} znaků", stringTooLong: "Toto pole musí obsahovat maximálně {0} znaků", invalidDate: "Nesprávné datum pro formát {0}", editorAnnotationsExist: "Editor má v sobě chyby, které musí být opraveny", invalidEmail: "Chybná e-mailová adresa, př.: info@cloudcms.com", stringNotAnInteger: "Tato hodnota není číslo.", invalidIPv4: "Chybná IPv4 adresa, ex: 192.168.0.1", stringNotAJSON: "Tato hodnota není platný JSON text.", keyMissing: "Mapa obsahuje prázdný klíč.", keyNotUnique: "Klíče nejsou jedinečné.", invalidPassword: "Špatné heslo", invalidPhone: "Špatné telefonní číslo, př.: (123) 456-9999", chooseFile: "Vyberte soubor...", chooseFiles: "Vyberte soubory...", dropZoneSingle: "Vyberte soubor nebo jej přetáhněte sem pro nahrání...", dropZoneMultiple: "Vyberte soubory nebo je přetáhněte sem pro nahrání...", invalidURLFormat: "Uvedená URL není platna webová adresa.", invalidZipcodeFormatFive: "Chybné poštovní směrovací číslo (#####)", invalidZipcodeFormatNine: "Chybné devíti-místné poštovní směrovací číslo (#####-####)" } } }) }(jQuery),
  5045. function(e) {
  5046. var t = e.alpaca;
  5047. t.registerView({ id: "base", messages: { de_AT: { required: "Eingabe erforderlich", invalid: "Eingabe invalid", months: ["Jänner", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], timeUnits: { SECOND: "Sekunden", MINUTE: "Minuten", HOUR: "Stunden", DAY: "Tage", MONTH: "Monate", YEAR: "Jahre" }, notOptional: "Dieses Feld ist nicht optional", disallowValue: "Diese Werte sind nicht erlaubt: {0}", invalidValueOfEnum: "Diese Feld sollte einen der folgenden Werte enthalten: {0}. [{1}]", notEnoughItems: "Die Mindestanzahl von Elementen ist {0}", tooManyItems: "Die Maximalanzahl von Elementen ist {0}", valueNotUnique: "Diese Werte sind nicht eindeutig", notAnArray: "Keine Liste von Werten", invalidDate: "Falsches Datumsformat: {0}", invalidEmail: "Ungültige e-Mail Adresse, z.B.: info@cloudcms.com", stringNotAnInteger: "Eingabe ist keine Ganz Zahl.", invalidIPv4: "Ungültige IPv4 Adresse, z.B.: 192.168.0.1", stringValueTooSmall: "Die Mindestanzahl von Zeichen ist {0}", stringValueTooLarge: "Die Maximalanzahl von Zeichen ist {0}", stringValueTooSmallExclusive: "Die Anzahl der Zeichen muss größer sein als {0}", stringValueTooLargeExclusive: "Die Anzahl der Zeichen muss kleiner sein als {0}", stringDivisibleBy: "Der Wert muss durch {0} dividierbar sein", stringNotANumber: "Die Eingabe ist keine Zahl", invalidPassword: "Ungültiges Passwort.", invalidPhone: "Ungültige Telefonnummer, z.B.: (123) 456-9999", invalidPattern: "Diese Feld stimmt nicht mit folgender Vorgabe überein {0}", stringTooShort: "Dieses Feld sollte mindestens {0} Zeichen enthalten", stringTooLong: "Dieses Feld sollte höchstens {0} Zeichen enthalten" } } }) }(jQuery),
  5048. function(e) {
  5049. var t = e.alpaca;
  5050. t.registerView({ id: "base", messages: { de_DE: { required: "Eingabe erforderlich", invalid: "Eingabe ungültig", months: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], timeUnits: { SECOND: "Sekunden", MINUTE: "Minuten", HOUR: "Stunden", DAY: "Tage", MONTH: "Monate", YEAR: "Jahre" }, notOptional: "Dieses Feld ist nicht optional", disallowValue: "Diese Werte sind nicht erlaubt: {0}", invalidValueOfEnum: "Diese Feld sollte einen der folgenden Werte enthalten: {0}. [{1}]", notEnoughItems: "Die Mindestanzahl von Elementen ist {0}", tooManyItems: "Die Maximalanzahl von Elementen ist {0}", valueNotUnique: "Diese Werte sind nicht eindeutig", notAnArray: "Keine Liste von Werten", invalidDate: "Falsches Datumsformat: {0}", invalidEmail: "Keine gültige E-Mail Adresse", stringNotAnInteger: "Keine Ganze Zahl", invalidIPv4: "Ungültige IPv4 Adresse", stringValueTooSmall: "Die kleinstmögliche Zahl ist {0}", stringValueTooLarge: "Die grösstmögliche Zahl ist {0}", stringValueTooSmallExclusive: "Die kleinstmögliche Zahl muss größer sein als {0}", stringValueTooLargeExclusive: "Die grösstmögliche Zahl muss kleiner sein als {0}", stringDivisibleBy: "Der Wert muss durch {0} dividierbar sein", stringNotANumber: "Die Eingabe ist keine Zahl", invalidPassword: "Ungültiges Passwort", invalidPhone: "Ungültige Telefonnummer", invalidPattern: "Diese Feld stimmt nicht mit folgender Vorgabe überein {0}", stringTooShort: "Dieses Feld sollte mindestens {0} Zeichen enthalten", stringTooLong: "Dieses Feld sollte höchstens {0} Zeichen enthalten" } } }) }(jQuery),
  5051. function(e) {
  5052. var t = e.alpaca;
  5053. t.registerView({ id: "base", messages: { el_GR: { required: "Υποχρεωτικό", invalid: "Λάθος", months: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"], timeUnits: { SECOND: "Δευτερόλεπτα", MINUTE: "Λεπτά", HOUR: "Ώρες", DAY: "Μέρες", MONTH: "Μήνες", YEAR: "Χρόνια" }, notOptional: "Αυτό το πεδίο δεν είναι προαιρετικό", disallowValue: "Μη επιτρεπτή τιμή: {0}", invalidValueOfEnum: "Το πεδίο πρέπει να περιέχει μία από τις ακόλουθες τιμές: {0}. [{1}]", notEnoughItems: "Ο ελάχιστος αριθμός εγγραφών είναι {0}", tooManyItems: "Ο μέγιστος αριθμός εγγραφών είναι {0}", valueNotUnique: "Οι τιμές δεν είναι μοναδικές", notAnArray: "Δεν υπάρχουν εγγραφές", invalidDate: "Λάθος μορφή ημερομηνίας: {0}", invalidEmail: "Μη έγκυρο email", stringNotAnInteger: "Δεν είναι ακέραιος", invalidIPv4: "Μη έγκυρη IPv4 διεύθυνση", stringValueTooSmall: "Το ελάχιστο πλήθος χαρακτήρων είναι {0}", stringValueTooLarge: "Το μέγιστο πλήθος χαρακτήρων είναι {0}", stringValueTooSmallExclusive: "Απαιτούνται περισσότεροι χαρακτήες από {0}", stringValueTooLargeExclusive: "Απαιτούνται λιγότεροι χαρακτήρες από {0}", stringDivisibleBy: "Η τιμή πρέπει να είναι πολλαπλάσιο του {0}", stringNotANumber: "Η τιμή δεν είναι αριθμός", invalidPassword: "Μη έγκυρο password", invalidPhone: "Μη έγκυρος αριθμός τηλεφώνου", invalidPattern: "Αυτό το πεδίο δεν έχει την απαιτούμενη μορφή {0}", stringTooShort: "Το πεδίο πρέπει να έχει τουλάχιστον {0} χαρακτήρες", stringTooLong: "Το πεδίο μπορεί να έχει το πολύ {0} χαρακτήρες" } } }) }(jQuery),
  5054. function(e) {
  5055. var t = e.alpaca;
  5056. t.registerView({ id: "base", messages: { es_ES: { required: "Este campo es obligatorio", invalid: "Este campo es inválido", months: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"], timeUnits: { SECOND: "segundos", MINUTE: "minutos", HOUR: "horas", DAY: "días", MONTH: "meses", YEAR: "años" }, notOptional: "Este campo no es opcional.", disallowValue: "{0} son los valores rechazados.", invalidValueOfEnum: "Este campo debe tener uno de los valores adentro {0}. [{1}]", notEnoughItems: "El número mínimo de artículos es {0}", tooManyItems: "El número máximo de artículos es {0}", valueNotUnique: "Los valores no son únicos", notAnArray: "Este valor no es un arsenal", invalidDate: "Fecha inválida para el formato {0}", invalidEmail: "Email address inválido, ex: info@cloudcms.com", stringNotAnInteger: "Este valor no es un número entero.", invalidIPv4: "Dirección inválida IPv4, ex: 192.168.0.1", stringValueTooSmall: "El valor mínimo para este campo es {0}", stringValueTooLarge: "El valor máximo para este campo es {0}", stringValueTooSmallExclusive: "El valor de este campo debe ser mayor que {0}", stringValueTooLargeExclusive: "El valor de este campo debe ser menos que {0}", stringDivisibleBy: "El valor debe ser divisible cerca {0}", stringNotANumber: "Este valor no es un número.", invalidPassword: "Contraseña inválida", invalidPhone: "Número de teléfono inválido, ex: (123) 456-9999", invalidPattern: "Este campo debe tener patrón {0}", stringTooShort: "Este campo debe contener por lo menos {0} números o caracteres", stringTooLong: "Este campo debe contener a lo más {0} números o caracteres", noneLabel: "Ninguno", addItemButtonLabel: "Añadir", addButtonLabel: "Añadir", removeButtonLabel: "Quitar", upButtonLabel: "Arriba", downButtonLabel: "Abajo" } } }) }(jQuery),
  5057. function(e) {
  5058. var t = e.alpaca;
  5059. t.registerView({ id: "base", messages: { fi_FI: { required: "Kenttä on pakollinen", invalid: "Syöte on virheellinen", months: ["Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"], timeUnits: { SECOND: "sekuntia", MINUTE: "minuuttia", HOUR: "tuntia", DAY: "päivää", MONTH: "kuukautta", YEAR: "vuotta" }, notOptional: "Tämä kenttä on pakollinen", disallowValue: "Seuraavat syötteet eivät ole sallittuja: {0}", invalidValueOfEnum: "Kentän pitää sisältää yksi seuraavista arvoista: {0}. [{1}]", notEnoughItems: "Pienin sallittu määrä arvoja on {0}", tooManyItems: "Suurin sallittu määrä arvoja on {0}", valueNotUnique: "Syötetyt arvot eivät ole uniikkeja", notAnArray: "Syöte ei ole lista", invalidDate: "Virheellinen päivämäärämuoto: {0}", invalidEmail: "Virheellinen sähköpostiosoite", stringNotAnInteger: "Arvo ei ole kokonaisluku", invalidIPv4: "Virheellinen IPv4-osoite", stringValueTooSmall: "Pienin sallittu arvo on {0}", stringValueTooLarge: "Suurin sallittu arvo on {0}", stringValueTooSmallExclusive: "Arvon pitää olla suurempi kuin {0}", stringValueTooLargeExclusive: "Arvon pitää olla pienempi kuin {0}", stringDivisibleBy: "Luvun pitää olla jaollinen luvulla {0}", stringNotANumber: "Syöte ei ole luku", invalidPassword: "Virheellinen salasana", invalidPhone: "Virheellinen puhelinnumero", invalidPattern: "Syötteen täytyy olla seuraavassa muodossa: {0}", stringTooShort: "Syötteen minimipituus on {0} merkkiä", stringTooLong: "Syötteen maksimipituus on {0} merkkiä" } } }) }(jQuery),
  5060. function(e) {
  5061. var t = e.alpaca;
  5062. t.registerView({ id: "base", messages: { fr_FR: { required: "Ce champ est requis", invalid: "Ce champ est invalide", months: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"], timeUnits: { SECOND: "secondes", MINUTE: "minutes", HOUR: "heures", DAY: "jours", MONTH: "mois", YEAR: "années" }, notOptional: "Ce champ n'est pas optionnel.", disallowValue: "{0} sont des valeurs interdites.", invalidValueOfEnum: "Ce champ doit prendre une des valeurs suivantes : {0}. [{1}]", notEnoughItems: "Le nombre minimum d'éléments est {0}", tooManyItems: "Le nombre maximum d'éléments est {0}", valueNotUnique: "Les valeurs sont uniques", notAnArray: "Cette valeur n'est pas une liste", invalidDate: "Cette date ne correspond pas au format {0}", invalidEmail: "Adresse de courriel invalide, ex: info@cloudcms.com", stringNotAnInteger: "Cette valeur n'est pas un nombre entier.", invalidIPv4: "Adresse IPv4 invalide, ex: 192.168.0.1", stringValueTooSmall: "La valeur minimale pour ce champ est {0}", stringValueTooLarge: "La valeur maximale pour ce champ est {0}", stringValueTooSmallExclusive: "La valeur doit-être supérieure à {0}", stringValueTooLargeExclusive: "La valeur doit-être inférieure à {0}", stringDivisibleBy: "La valeur doit-être divisible par {0}", stringNotANumber: "Cette valeur n'est pas un nombre.", invalidPassword: "Mot de passe invalide", invalidPhone: "Numéro de téléphone invalide, ex: (123) 456-9999", invalidPattern: "Ce champ doit correspondre au motif {0}", stringTooShort: "Ce champ doit contenir au moins {0} caractères", stringTooLong: "Ce champ doit contenir au plus {0} caractères" } } }) }(jQuery),
  5063. function(e) {
  5064. var t = e.alpaca;
  5065. t.registerView({ id: "base", messages: { hr_HR: { required: "Polje je obavezno", invalid: "Pogrešna vrijednost", months: ["Siječanj", "Veljača", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac"], timeUnits: { SECOND: "sekunda", MINUTE: "minuta", HOUR: "sati", DAY: "dan", MONTH: "mjesec", YEAR: "godina" }, notOptional: "Polje nije opciono.", disallowValue: "{0} vrijednost nije dozvoljena.", invalidValueOfEnum: "Moguće vrijednosti : {0}. [{1}]", notEnoughItems: "Odaberite najmanje {0}", tooManyItems: "Odaberite najviše {0}", valueNotUnique: "Vrijednost nije jedinstvena", notAnArray: "Vrijednost nije popis", invalidDate: "Datum nije u formatu {0}", invalidEmail: "E-mail adresa nije u ispravnom formatu, npr: ime.prezime@internet.com", stringNotAnInteger: "Vrijednost nije cijeli broj.", invalidIPv4: "IPv4 adresa nije ispravna, npr: 192.168.0.1", stringValueTooSmall: "Vrijednost je ispod dopuštenog {0}", stringValueTooLarge: "Vrijednost je iznad dopuštenog {0}", stringValueTooSmallExclusive: "Vrijednost mora biti veća od {0}", stringValueTooLargeExclusive: "Vrijednost mora biti manja od {0}", stringDivisibleBy: "Vrijednost mora biti djeljiva sa {0}", stringNotANumber: "Vrijednost nije broj.", invalidPassword: "Neispravna lozinka", invalidPhone: "Telefon nije ispravan, npr: (123) 456-9999", invalidPattern: "Pogrešan uzorak {0}", stringTooShort: "Polje mora imati namjanje {0} znakova", stringTooLong: "Polje mora imati najviše {0} znakova" } } }) }(jQuery),
  5066. function(e) {
  5067. var t = e.alpaca;
  5068. t.registerView({ id: "base", messages: { it_IT: { required: "Questo campo è obbligatorio", invalid: "Questo campo è invalido", months: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], timeUnits: { SECOND: "secondi", MINUTE: "minuti", HOUR: "ore", DAY: "giorni", MONTH: "mesi", YEAR: "anni" }, notOptional: "Questo campo non è opzionale", disallowValue: "{0} sono valori invalidi", invalidValueOfEnum: "Questo campo deve avere uno dei seguenti valori {0} (valore attuale: {1})", notEnoughItems: "Il numero minimo di elementi richiesti è {0}", tooManyItems: "Il numero massimo di elementi ammessi è {0}", valueNotUnique: "I valori non sono univoci", notAnArray: "Questo valore non è di tipo array", invalidDate: "Data invalida per il formato {0}", invalidEmail: "Indirizzo email invalido, si attendono valori del tipo: info@cloudcms.com", stringNotAnInteger: "Questo valore non è un numero intero", invalidIPv4: "Indirizzo IPv4 invalido, si attendono valori del tipo: 192.168.0.1", stringValueTooSmall: "Il valore minimo per questo campo è {0}", stringValueTooLarge: "Il valore massimo per questo campo è {0}", stringValueTooSmallExclusive: "Il valore di questo campo deve essere maggiore di {0}", stringValueTooLargeExclusive: "Il valore di questo campo deve essere minore di {0}", stringDivisibleBy: "Il valore di questo campo deve essere divisibile per {0}", stringNotANumber: "Questo valore non è un numero", invalidPassword: "Password invalida", invalidPhone: "Numero di telefono invalido, si attendono valori del tipo: (123) 456-9999", invalidPattern: "Questo campo deve avere la seguente struttura: {0}", stringTooShort: "Questo campo non deve contenere meno di {0} caratteri", stringTooLong: "Questo campo non deve contenere più di {0} caratteri", noneLabel: "Nessuno", addItemButtonLabel: "Aggiungi", addButtonLabel: "Aggiungi", removeButtonLabel: "Rimuovi", upButtonLabel: "Su", downButtonLabel: "Giù" } } }) }(jQuery),
  5069. function(e) {
  5070. var t = e.alpaca;
  5071. t.registerView({ id: "base", messages: { ja_JP: { required: "この項目は必須です", invalid: "この項目は正しい値ではありません", months: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], timeUnits: { SECOND: "秒", MINUTE: "分", HOUR: "時", DAY: "日", MONTH: "月", YEAR: "年" }, notOptional: "この項目は任意の回答項目ではありません", disallowValue: "{0} は禁止されている値です", invalidValueOfEnum: "この項目は {0} の中から選ばなければなりません。現在の値は {1} です", notEnoughItems: "項目数は {0} 以上必要です", tooManyItems: "項目数は {0} 以下でなければなりません", valueNotUnique: "値が一意ではありません", notAnArray: "この項目の値が配列でありません", stringValueTooSmall: "この項目の最小値は {0} です", stringValueTooLarge: "この項目の最大値は {0} です", stringValueTooSmallExclusive: "この項目の値は {0} より小さくなければなりません", stringValueTooLargeExclusive: "この項目の値は {0} より大きくなければなりません", stringDivisibleBy: "値は {0} によって割り切れなければなりません", stringNotANumber: "この項目の値が数値ではありません", stringValueNotMultipleOf: "値が {0} の倍数ではありません", stringNotAnInteger: "この項目の値が整数ではありません", stringNotAJSON: "値が正しい JSON 形式の文字列ではありません", stringTooShort: "この項目は {0} 文字以上必要です", stringTooLong: "この項目は {0} 文字以下でなければなりません", invalidTime: "時間が正しくありません", invalidDate: "日付が {0} ではありません", invalidEmail: "メールアドレスが正しくありません。例えば info@cloudcms.com のような形式です", invalidIPv4: "IPv4 アドレスが正しくありません。例えば 192.168.0.1 のような形式です", invalidPassword: "パスワードが正しくありません", invalidPhone: "電話番号が正しくありません。例えば (123) 456-9999 のような形式です", invalidPattern: "この項目は {0} のパターンでなければなりません", invalidURLFormat: "URL が正しい形式ではありません", keyMissing: "地図が空のキーを含んでいます", keyNotUnique: "地図のキーが一意ではありません", ObjecttooFewProperties: "プロパティが足りません ({0} が必要です)", tooManyProperties: "プロパティ ({0}) の最大数を超えています", wordLimitExceeded: "{0} の単語数の制限を超えています", editorAnnotationsExist: "エディタが修正すべきエラーを報告しています", invalidZipcodeFormatFive: "5桁の Zipcode (#####) ではありません", invalidZipcodeFormatNine: "9桁の Zipcode (#####-####) ではありません" } } }) }(jQuery),
  5072. function(e) {
  5073. var t = e.alpaca;
  5074. t.registerView({ id: "base", messages: { nb_NO: { required: "Feltet er obligatorisk", invalid: "Verdien er ugyldig", months: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], timeUnits: { SECOND: "Sekunder", MINUTE: "Minutter", HOUR: "Timer", DAY: "Dager", MONTH: "Måneder", YEAR: "År" }, notOptional: "Dette feltet er obligatorisk", disallowValue: "Denne verdien er ikke tillatt: {0}", invalidValueOfEnum: "Feltet må inneholde en av følgende verdier: {0}. Nåværende verdi er: {1}", notEnoughItems: "Det minste tillatte antallet elementer er {0}", tooManyItems: "Det største tillatte antallet elementer er {0}", valueNotUnique: "Verdiene er ikke unike", notAnArray: "Ikke en liste av verdier", invalidDate: "Ugyldig datoformat: {0}", invalidEmail: "Ugyldig e-postadresse", stringNotAnInteger: "Verdien er ikke et heltall", invalidIPv4: "Ugyldig IPv4-adresse", stringValueTooSmall: "Den minste tillatte verdien er {0}", stringValueTooLarge: "Den største tillatte verdien er {0}", stringValueTooSmallExclusive: "Verdien må være større enn {0}", stringValueTooLargeExclusive: "Verdien må være mindre enn {0}", stringDivisibleBy: "Tallet må være delbart med {0}", stringNotANumber: "Verdien er ikke et tall", invalidPassword: "Ugyldig passord", invalidPhone: "Ugyldig telefonnummer", invalidPattern: "Feltet må være i følgende format: {0}", stringTooShort: "Dette feltet må minst inneholde {0} tegn", stringTooLong: "Dette feltet kan maks inneholde {0} tegn" } } }) }(jQuery),
  5075. function(e) {
  5076. var t = e.alpaca;
  5077. t.registerView({ id: "base", messages: { nl_BE: { required: "Dit veld is verplicht", invalid: "Dit veld is ongeldig", months: ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "July", "Augustus", "September", "Oktober", "November", "December"], timeUnits: { SECOND: "seconden", MINUTE: "minuten", HOUR: "uren", DAY: "dagen", MONTH: "maanden", YEAR: "jaren" }, notOptional: "Dit veld is niet optioneel.", disallowValue: "{0} zijn verboden waarden.", invalidValueOfEnum: "Dit veld moet één van volgende bevatten : {0}. [{1}]", notEnoughItems: "Het minimum aantal elementen is {0}", tooManyItems: "Het maximum aantal elementen is {0}", valueNotUnique: "De waarden zijn uniek", notAnArray: "Deze waarde is geen lijst", invalidDate: "De datum komt niet overeen met formaat {0}", invalidEmail: "Ongeldig e-mailadres, vb.: info@cloudcms.com", stringNotAnInteger: "Deze waarde is geen geheel getal.", invalidIPv4: "Ongeldig IPv4 adres, vb.: 192.168.0.1", stringValueTooSmall: "De minimale waarde voor dit veld is {0}", stringValueTooLarge: "De maximale waarde voor dit veld is {0}", stringValueTooSmallExclusive: "De waarde moet groter zijn dan {0}", stringValueTooLargeExclusive: "De waarde moet kleiner zijn dan {0}", stringDivisibleBy: "De waarde moet deelbaar zijn door {0}", stringNotANumber: "Deze waarde is geen getal.", invalidPassword: "Ongeldig wachtwoord", invalidPhone: "Ongeldig telefoonnummer, vb: (123) 456-9999", invalidPattern: "Dit veld moet overeenkomen met patroon {0}", stringTooShort: "Dit veld moet minstens {0} tekens bevatten", stringTooLong: "Dit veld moet minder dan {0} tekens bevatten" } } }) }(jQuery),
  5078. function(e) {
  5079. var t = e.alpaca;
  5080. t.registerView({ id: "base", messages: { pl_PL: { required: "To pole jest wymagane", invalid: "To pole jest nieprawidłowe", months: ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"], timeUnits: { SECOND: "sekundy", MINUTE: "minuty", HOUR: "godziny", DAY: "dni", MONTH: "miesiące", YEAR: "lata" }, notOptional: "To pole nie jest opcjonalne", disallowValue: "Ta wartość nie jest dozwolona: {0}", invalidValueOfEnum: "To pole powinno zawierać jedną z następujących wartości: {0}. [{1}]", notEnoughItems: "Minimalna liczba elementów wynosi {0}", tooManyItems: "Maksymalna liczba elementów wynosi {0}", valueNotUnique: "Te wartości nie są unikalne", notAnArray: "Ta wartość nie jest tablicą", invalidDate: "Niepoprawny format daty: {0}", invalidEmail: "Niepoprawny adres email, n.p.: info@cloudcms.com", stringNotAnInteger: "Ta wartość nie jest liczbą całkowitą", invalidIPv4: "Niepoprawny adres IPv4, n.p.: 192.168.0.1", stringValueTooSmall: "Minimalna wartość dla tego pola wynosi {0}", stringValueTooLarge: "Maksymalna wartość dla tego pola wynosi {0}", stringValueTooSmallExclusive: "Wartość dla tego pola musi być większa niż {0}", stringValueTooLargeExclusive: "Wartość dla tego pola musi być mniejsza niż {0}", stringDivisibleBy: "Wartość musi być podzielna przez {0}", stringNotANumber: "Wartość nie jest liczbą", invalidPassword: "Niepoprawne hasło", invalidPhone: "Niepoprawny numer telefonu, n.p.: (123) 456-9999", invalidPattern: "To pole powinno mieć format {0}", stringTooShort: "To pole powinno zawierać co najmniej {0} znaków", stringTooLong: "To pole powinno zawierać najwyżej {0} znaków" } } }) }(jQuery),
  5081. function(e) {
  5082. var t = e.alpaca;
  5083. t.registerView({ id: "base", messages: { pt_BR: { required: "Este campo é obrigatório", invalid: "Este campo é inválido", months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], timeUnits: { SECOND: "segundos", MINUTE: "minutos", HOUR: "horas", DAY: "dias", MONTH: "meses", YEAR: "anos" }, notOptional: "Este campo não é opcional.", disallowValue: "{0} são valores proibidas.", invalidValueOfEnum: "Este campo deve ter um dos seguintes valores: {0}. [{1}]", notEnoughItems: "O número mínimo de elementos é {0}", tooManyItems: "O número máximo de elementos é {0}", valueNotUnique: "Os valores não são únicos", notAnArray: "Este valor não é uma lista", invalidDate: "Esta data não tem o formato {0}", invalidEmail: "Endereço de email inválida, ex: info@cloudcms.com", stringNotAnInteger: "Este valor não é um número inteiro.", invalidIPv4: "Endereço IPv4 inválida, ex: 192.168.0.1", stringValueTooSmall: "O valor mínimo para este campo é {0}", stringValueTooLarge: "O valor máximo para este campo é {0}", stringValueTooSmallExclusive: "O valor deste campo deve ser maior que {0}", stringValueTooLargeExclusive: "O valor deste campo deve ser menor que {0}", stringDivisibleBy: "O valor deve ser divisível por {0}", stringNotANumber: "Este valor não é um número.", invalidPassword: "Senha inválida", invalidPhone: "Número de telefone inválido, ex: (123) 456-9999", invalidPattern: "Este campo deve ter o padrão {0}", stringTooShort: "Este campo deve incluir pelo menos {0} caracteres", stringTooLong: "Este campo pode incluir no máximo {0} caracteres" } } }) }(jQuery),
  5084. function(e) {
  5085. var t = e.alpaca;
  5086. t.registerView({ id: "base", messages: { sv_SE: { required: "Fältet är obligatoriskt", invalid: "Värdet är felaktigt", months: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"], timeUnits: { SECOND: "sekunder", MINUTE: "minuter", HOUR: "timmar", DAY: "dagar", MONTH: "månader", YEAR: "år" }, notOptional: "Detta fält är obligatoriskt", disallowValue: "Dessa värden är inte tillåtna: {0}", invalidValueOfEnum: "Fältet måste innehålla ett av följande värden: {0}. [{1}]", notEnoughItems: "Det minsta tillåtna antalet element är {0}", tooManyItems: "Det största tillåtna antalet element är {0}", valueNotUnique: "Värdena är inte unika", notAnArray: "Inte en lista av värden", invalidDate: "Felaktigt format för datum: {0}", invalidEmail: "Ogiltig e-postadress", stringNotAnInteger: "Värdet är inte ett heltal", invalidIPv4: "Ogiltig IPv4-adress", stringValueTooSmall: "Det minsta tillåtna värdet är {0}", stringValueTooLarge: "Det största tillåtna värdet är {0}", stringValueTooSmallExclusive: "Värdet måste vara större än {0}", stringValueTooLargeExclusive: "Värdet måste vara mindre än {0}", stringDivisibleBy: "Talet måste vara delbart med {0}", stringNotANumber: "Värdet är inte ett tal", invalidPassword: "Ogiltigt lösenord", invalidPhone: "Ogiltigt telefonnummer", invalidPattern: "Fältet måste vara i följande format: {0}", stringTooShort: "Detta fält måste innehålla minst {0} tecken", stringTooLong: "Detta fält får innehålla högst {0} tecken" } } }) }(jQuery),
  5087. function(e) {
  5088. var t = e.alpaca;
  5089. t.registerView({ id: "base", messages: { zh_CN: { required: "&#27492;&#22495;&#24517;&#39035;", invalid: "&#27492;&#22495;&#19981;&#21512;&#26684;", months: ["&#19968;&#26376;", "&#20108;&#26376;", "&#19977;&#26376;", "&#22235;&#26376;", "&#20116;&#26376;", "&#20845;&#26376;", "&#19971;&#26376;", "&#20843;&#26376;", "&#20061;&#26376;", "&#21313;&#26376;", "&#21313;&#19968;&#26376;", "&#21313;&#20108;&#26376;"], timeUnits: { SECOND: "&#31186;", MINUTE: "&#20998;", HOUR: "&#26102;", DAY: "&#26085;", MONTH: "&#26376;", YEAR: "&#24180;" }, notOptional: "&#27492;&#22495;&#38750;&#20219;&#36873;", disallowValue: "&#38750;&#27861;&#36755;&#20837;&#21253;&#25324; {0}.", invalidValueOfEnum: "&#20801;&#35768;&#36755;&#20837;&#21253;&#25324; {0}. [{1}]", notEnoughItems: "&#26368;&#23567;&#20010;&#25968; {0}", tooManyItems: "&#26368;&#22823;&#20010;&#25968; {0}", valueNotUnique: "&#36755;&#20837;&#20540;&#19981;&#29420;&#29305;", notAnArray: "&#19981;&#26159;&#25968;&#32452;", invalidDate: "&#26085;&#26399;&#26684;&#24335;&#22240;&#35813;&#26159; {0}", invalidEmail: "&#20234;&#22969;&#20799;&#26684;&#24335;&#19981;&#23545;, ex: info@cloudcms.com", stringNotAnInteger: "&#19981;&#26159;&#25972;&#25968;.", invalidIPv4: "&#19981;&#26159;&#21512;&#27861;IP&#22320;&#22336;, ex: 192.168.0.1", stringValueTooSmall: "&#26368;&#23567;&#20540;&#26159; {0}", stringValueTooLarge: "&#26368;&#22823;&#20540;&#26159; {0}", stringValueTooSmallExclusive: "&#20540;&#24517;&#39035;&#22823;&#20110; {0}", stringValueTooLargeExclusive: "&#20540;&#24517;&#39035;&#23567;&#20110; {0}", stringDivisibleBy: "&#20540;&#24517;&#39035;&#33021;&#34987; {0} &#25972;&#38500;", stringNotANumber: "&#19981;&#26159;&#25968;&#23383;.", invalidPassword: "&#38750;&#27861;&#23494;&#30721;", invalidPhone: "&#38750;&#27861;&#30005;&#35805;&#21495;&#30721;, ex: (123) 456-9999", invalidPattern: "&#27492;&#22495;&#39035;&#26377;&#26684;&#24335; {0}", stringTooShort: "&#27492;&#22495;&#33267;&#23569;&#38271;&#24230; {0}", stringTooLong: "&#27492;&#22495;&#26368;&#22810;&#38271;&#24230; {0}" } } }) }(jQuery),
  5090. function(e) {
  5091. var t = e.alpaca,
  5092. n = {};
  5093. n.field = function() {}, n.control = function() {}, n.container = function() {}, n.form = function() {}, n.required = function() {}, n.optional = function() {}, n.readonly = function() {}, n.disabled = function() {}, n.enabled = function() {}, n.clearValidity = function() {}, n.invalid = function(e) {}, n.valid = function() {}, n.addMessage = function(e, t, n, i) {}, n.removeMessages = function() {}, n.enableButton = function(e) {}, n.disableButton = function(e) {}, n.arrayToolbar = function(n) {
  5094. var i = this;
  5095. if (n) {
  5096. var a = e(i.getFieldEl()).find(".alpaca-array-toolbar[data-alpaca-array-toolbar-field-id='" + i.getId() + "']");
  5097. if (a.length > 0) {
  5098. var r = e("<div class='" + t.MARKER_CLASS_ARRAY_TOOLBAR + "' " + t.MARKER_DATA_ARRAY_TOOLBAR_FIELD_ID + "='" + i.getId() + "'></div>");
  5099. a.before(r), a.remove()
  5100. }
  5101. } else {
  5102. var r = e(i.getContainerEl()).find("." + t.MARKER_CLASS_ARRAY_TOOLBAR + "[" + t.MARKER_DATA_ARRAY_TOOLBAR_FIELD_ID + "='" + i.getId() + "']");
  5103. if (r.length > 0) {
  5104. var o = i.view.getTemplateDescriptor("container-array-toolbar", i);
  5105. if (o) {
  5106. var l = t.tmpl(o, { actions: i.toolbar.actions, id: i.getId(), toolbarStyle: i.options.toolbarStyle, view: i.view });
  5107. e(r).before(l), e(r).remove() } } }
  5108. }, n.arrayActionbars = function(n) {
  5109. for (var i = this, a = 0; a < i.children.length; a++) {
  5110. var r = i.children[a],
  5111. o = r.getId();
  5112. if (n) {
  5113. var l = e(i.getFieldEl()).find(".alpaca-array-actionbar[data-alpaca-array-actionbar-field-id='" + o + "']");
  5114. if (l.length > 0) {
  5115. var s = e("<div class='" + t.MARKER_CLASS_ARRAY_ITEM_ACTIONBAR + "' " + t.MARKER_DATA_ARRAY_ITEM_KEY + "='" + r.name + "'></div>");
  5116. l.before(s), l.remove() } } else {
  5117. var s = e(i.getFieldEl()).find("." + t.MARKER_CLASS_ARRAY_ITEM_ACTIONBAR + "[" + t.MARKER_DATA_ARRAY_ITEM_KEY + "='" + r.name + "']");
  5118. if (s.length > 0) {
  5119. var u = i.view.getTemplateDescriptor("container-array-actionbar", i);
  5120. if (u) {
  5121. var c = t.tmpl(u, { actions: i.actionbar.actions, name: r.name, parentFieldId: i.getId(), fieldId: r.getId(), itemIndex: a, actionbarStyle: i.options.actionbarStyle, view: i.view });
  5122. e(s).before(c), e(s).remove() } } } } }, n.autocomplete = function() {};
  5123. var i = {};
  5124. i.button = "", i.smallButton = "", i.addIcon = "", i.removeIcon = "", i.upIcon = "", i.downIcon = "", i.expandedIcon = "", i.collapsedIcon = "", i.table = "", t.registerView({ id: "web-display", parent: "base", type: "display", ui: "web", title: "Default HTML5 display view", displayReadonly: !0, templates: {}, callbacks: n, styles: i, horizontal: !1 }), t.registerView({ id: "web-display-horizontal", parent: "web-display", horizontal: !0 }), t.registerView({ id: "web-edit", parent: "base", type: "edit", ui: "web", title: "Default HTML5 edit view", displayReadonly: !0, templates: {}, callbacks: n, styles: i, horizontal: !1 }), t.registerView({ id: "web-edit-horizontal", parent: "web-edit", horizontal: !0 }), t.registerView({ id: "web-create", parent: "web-edit", type: "create", title: "Default HTML5 create view", displayReadonly: !1, templates: {}, horizontal: !1 }), t.registerView({ id: "web-create-horizontal", parent: "web-create", horizontal: !0 })
  5125. }(jQuery),
  5126. function(e) {
  5127. var t = e.alpaca,
  5128. n = {};
  5129. n.button = "btn btn-default", n.smallButton = "btn btn-default btn-sm", n.addIcon = "icofont icofont-plus-circle", n.removeIcon = "icofont icofont-minus-circle", n.upIcon = "icofont icofont-rounded-up", n.downIcon = "icofont icofont-rounded-down", n.expandedIcon = "glyphicon glyphicon-circle-arrow-down", n.collapsedIcon = "glyphicon glyphicon-circle-arrow-right", n.table = "table table-striped table-bordered table-hover";
  5130. var i = {};
  5131. i.required = function() {
  5132. var t = this.getFieldEl(),
  5133. n = e(t).find("label.alpaca-control-label");
  5134. e('<span class="alpaca-icon-required glyphicon glyphicon-star"></span>').prependTo(n) }, i.invalid = function() { this.isControlField && e(this.getFieldEl()).addClass("has-error") }, i.valid = function() { e(this.getFieldEl()).removeClass("has-error") }, i.control = function() {
  5135. var t = this.getFieldEl(),
  5136. n = this.getControlEl();
  5137. if (e(t).find("input").addClass("form-control"), e(t).find("textarea").addClass("form-control"), e(t).find("select").addClass("form-control"), e(t).find("input[type=checkbox]").removeClass("form-control"), e(t).find("input[type=file]").removeClass("form-control"), e(t).find("input[type=radio]").removeClass("form-control"), "color" === this.inputType && e(t).find("input").removeClass("form-control"), e(t).find("input[type=checkbox]").parent().parent().addClass("checkbox"), e(t).find("input[type=radio]").parent().parent().addClass("radio"), e(t).parents("form").hasClass("form-inline") && (e(t).find("input[type=checkbox]").parent().addClass("checkbox-inline"), e(t).find("input[type=radio]").parent().addClass("radio-inline")), e(t).find("label.alpaca-control-label").addClass("control-label"), this.view.horizontal) { e(t).find("label.alpaca-control-label").addClass("col-sm-3");
  5138. var i = e("<div></div>");
  5139. i.addClass("col-sm-9"), e(n).after(i), i.append(n), e(t).append("<div style='clear:both;'></div>") } }, i.container = function() {
  5140. var t = this.getContainerEl();
  5141. this.view.horizontal && e(t).addClass("form-horizontal") }, i.form = function() { this.getFormEl() }, i.enableButton = function(t) { e(t).removeAttr("disabled") }, i.disableButton = function(t) { e(t).attr("disabled", "disabled") }, i.collapsible = function() {
  5142. var n = this.getFieldEl(),
  5143. i = e(n).find("legend").first(),
  5144. a = e("[data-toggle='collapse']", i);
  5145. if (e(a).length > 0) {
  5146. var r = this.getContainerEl(),
  5147. o = e(r).attr("id");
  5148. o || (o = t.generateId(), e(r).attr("id", o)), e(r).addClass("collapse"), this.options.collapsed || e(r).addClass("in"), e(a).attr("data-target") || e(a).attr("data-target", "#" + o), e(a).mouseover(function(t) { e(this).css("cursor", "pointer") }) } }, i.tableHeaderRequired = function(t, n, i) { e('<span class="alpaca-icon-required glyphicon glyphicon-star"></span>').prependTo(i) }, i.tableHeaderOptional = function(e, t, n) {}, t.registerView({ id: "bootstrap-display", parent: "web-display", type: "display", ui: "bootstrap", title: "Display View for Bootstrap 3", displayReadonly: !0, callbacks: i, styles: n, templates: {} }), t.registerView({ id: "bootstrap-display-horizontal", parent: "bootstrap-display", horizontal: !0 }), t.registerView({ id: "bootstrap-edit", parent: "web-edit", type: "edit", ui: "bootstrap", title: "Edit View for Bootstrap 3", displayReadonly: !0, callbacks: i, styles: n, templates: {} }), t.registerView({ id: "bootstrap-edit-horizontal", parent: "bootstrap-edit", horizontal: !0 }), t.registerView({ id: "bootstrap-create", parent: "bootstrap-edit", title: "Create View for Bootstrap 3", type: "create", displayReadonly: !1 }), t.registerView({ id: "bootstrap-create-horizontal", parent: "bootstrap-create", horizontal: !0 }) }(jQuery), Alpaca.defaultView = "bootstrap", Alpaca
  5149. });