text: /*
  YUI 3.13.0 (build 508226d)
  Copyright 2013 Yahoo! Inc. All rights reserved.
  Licensed under the BSD License.
  http://yuilibrary.com/license/
  */
  
  if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
  if (!__coverage__['build/model/model.js']) {
     __coverage__['build/model/model.js'] = {"path":"build/model/model.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"119":0,"120":0,"121":0,"122":0,"123":0,"124":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":0,"131":0,"132":0,"133":0,"134":0,"135":0,"136":0,"137":0,"138":0,"139":0,"140":0,"141":0,"142":0,"143":0,"144":0,"145":0,"146":0,"147":0,"148":0,"149":0,"150":0,"151":0,"152":0,"153":0,"154":0,"155":0,"156":0,"157":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,0],"25":[0,0],"26":[0,0],"27":[0,0],"28":[0,0],"29":[0,0],"30":[0,0],"31":[0,0],"32":[0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[0,0],"37":[0,0],"38":[0,0],"39":[0,0],"40":[0,0],"41":[0,0],"42":[0,0],"43":[0,0],"44":[0,0],"45":[0,0],"46":[0,0],"47":[0,0],"48":[0,0],"49":[0,0],"50":[0,0],"51":[0,0],"52":[0,0],"53":[0,0],"54":[0,0],"55":[0,0],"56":[0,0,0],"57":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":36}}},"2":{"name":"Model","line":95,"loc":{"start":{"line":95,"column":0},"end":{"line":95,"column":17}}},"3":{"name":"(anonymous_3)","line":199,"loc":{"start":{"line":199,"column":17},"end":{"line":199,"column":35}}},"4":{"name":"(anonymous_4)","line":232,"loc":{"start":{"line":232,"column":13},"end":{"line":232,"column":42}}},"5":{"name":"(anonymous_5)","line":241,"loc":{"start":{"line":241,"column":34},"end":{"line":241,"column":46}}},"6":{"name":"finish","line":242,"loc":{"start":{"line":242,"column":12},"end":{"line":242,"column":33}}},"7":{"name":"(anonymous_7)","line":244,"loc":{"start":{"line":244,"column":53},"end":{"line":244,"column":69}}},"8":{"name":"(anonymous_8)","line":270,"loc":{"start":{"line":270,"column":22},"end":{"line":270,"column":34}}},"9":{"name":"(anonymous_9)","line":314,"loc":{"start":{"line":314,"column":15},"end":{"line":314,"column":31}}},"10":{"name":"(anonymous_10)","line":328,"loc":{"start":{"line":328,"column":14},"end":{"line":328,"column":30}}},"11":{"name":"(anonymous_11)","line":344,"loc":{"start":{"line":344,"column":16},"end":{"line":344,"column":28}}},"12":{"name":"(anonymous_12)","line":360,"loc":{"start":{"line":360,"column":11},"end":{"line":360,"column":23}}},"13":{"name":"(anonymous_13)","line":390,"loc":{"start":{"line":390,"column":10},"end":{"line":390,"column":39}}},"14":{"name":"(anonymous_14)","line":401,"loc":{"start":{"line":401,"column":35},"end":{"line":401,"column":60}}},"15":{"name":"(anonymous_15)","line":453,"loc":{"start":{"line":453,"column":11},"end":{"line":453,"column":31}}},"16":{"name":"(anonymous_16)","line":498,"loc":{"start":{"line":498,"column":10},"end":{"line":498,"column":39}}},"17":{"name":"(anonymous_17)","line":509,"loc":{"start":{"line":509,"column":38},"end":{"line":509,"column":53}}},"18":{"name":"(anonymous_18)","line":515,"loc":{"start":{"line":515,"column":67},"end":{"line":515,"column":92}}},"19":{"name":"(anonymous_19)","line":570,"loc":{"start":{"line":570,"column":9},"end":{"line":570,"column":41}}},"20":{"name":"(anonymous_20)","line":595,"loc":{"start":{"line":595,"column":14},"end":{"line":595,"column":45}}},"21":{"name":"(anonymous_21)","line":683,"loc":{"start":{"line":683,"column":10},"end":{"line":683,"column":53}}},"22":{"name":"(anonymous_22)","line":711,"loc":{"start":{"line":711,"column":12},"end":{"line":711,"column":24}}},"23":{"name":"(anonymous_23)","line":747,"loc":{"start":{"line":747,"column":10},"end":{"line":747,"column":40}}},"24":{"name":"(anonymous_24)","line":755,"loc":{"start":{"line":755,"column":31},"end":{"line":755,"column":47}}},"25":{"name":"(anonymous_25)","line":808,"loc":{"start":{"line":808,"column":14},"end":{"line":808,"column":41}}},"26":{"name":"(anonymous_26)","line":832,"loc":{"start":{"line":832,"column":13},"end":{"line":832,"column":43}}},"27":{"name":"(anonymous_27)","line":883,"loc":{"start":{"line":883,"column":12},"end":{"line":883,"column":32}}},"28":{"name":"(anonymous_28)","line":897,"loc":{"start":{"line":897,"column":15},"end":{"line":897,"column":47}}},"29":{"name":"handler","line":900,"loc":{"start":{"line":900,"column":8},"end":{"line":900,"column":30}}},"30":{"name":"(anonymous_30)","line":946,"loc":{"start":{"line":946,"column":18},"end":{"line":946,"column":82}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1007,"column":67}},"2":{"start":{"line":27,"column":0},"end":{"line":93,"column":22}},"3":{"start":{"line":95,"column":0},"end":{"line":97,"column":1}},"4":{"start":{"line":96,"column":4},"end":{"line":96,"column":56}},"5":{"start":{"line":99,"column":0},"end":{"line":1004,"column":3}},"6":{"start":{"line":200,"column":8},"end":{"line":200,"column":29}},"7":{"start":{"line":201,"column":8},"end":{"line":201,"column":29}},"8":{"start":{"line":202,"column":8},"end":{"line":202,"column":29}},"9":{"start":{"line":233,"column":8},"end":{"line":233,"column":24}},"10":{"start":{"line":236,"column":8},"end":{"line":239,"column":9}},"11":{"start":{"line":237,"column":12},"end":{"line":237,"column":31}},"12":{"start":{"line":238,"column":12},"end":{"line":238,"column":28}},"13":{"start":{"line":241,"column":8},"end":{"line":257,"column":11}},"14":{"start":{"line":242,"column":12},"end":{"line":250,"column":13}},"15":{"start":{"line":243,"column":16},"end":{"line":247,"column":17}},"16":{"start":{"line":244,"column":20},"end":{"line":246,"column":23}},"17":{"start":{"line":245,"column":24},"end":{"line":245,"column":51}},"18":{"start":{"line":249,"column":16},"end":{"line":249,"column":60}},"19":{"start":{"line":252,"column":12},"end":{"line":256,"column":13}},"20":{"start":{"line":253,"column":16},"end":{"line":253,"column":53}},"21":{"start":{"line":255,"column":16},"end":{"line":255,"column":25}},"22":{"start":{"line":259,"column":8},"end":{"line":259,"column":51}},"23":{"start":{"line":271,"column":8},"end":{"line":271,"column":51}},"24":{"start":{"line":272,"column":8},"end":{"line":272,"column":69}},"25":{"start":{"line":315,"column":8},"end":{"line":315,"column":35}},"26":{"start":{"line":316,"column":8},"end":{"line":316,"column":71}},"27":{"start":{"line":329,"column":8},"end":{"line":329,"column":35}},"28":{"start":{"line":330,"column":8},"end":{"line":330,"column":76}},"29":{"start":{"line":345,"column":8},"end":{"line":345,"column":62}},"30":{"start":{"line":361,"column":8},"end":{"line":361,"column":45}},"31":{"start":{"line":391,"column":8},"end":{"line":391,"column":24}},"32":{"start":{"line":394,"column":8},"end":{"line":397,"column":9}},"33":{"start":{"line":395,"column":12},"end":{"line":395,"column":31}},"34":{"start":{"line":396,"column":12},"end":{"line":396,"column":26}},"35":{"start":{"line":399,"column":8},"end":{"line":399,"column":34}},"36":{"start":{"line":401,"column":8},"end":{"line":431,"column":11}},"37":{"start":{"line":402,"column":12},"end":{"line":407,"column":23}},"38":{"start":{"line":409,"column":12},"end":{"line":428,"column":13}},"39":{"start":{"line":410,"column":16},"end":{"line":410,"column":35}},"40":{"start":{"line":411,"column":16},"end":{"line":411,"column":38}},"41":{"start":{"line":413,"column":16},"end":{"line":413,"column":45}},"42":{"start":{"line":416,"column":16},"end":{"line":420,"column":17}},"43":{"start":{"line":417,"column":20},"end":{"line":419,"column":23}},"44":{"start":{"line":422,"column":16},"end":{"line":422,"column":63}},"45":{"start":{"line":424,"column":16},"end":{"line":424,"column":47}},"46":{"start":{"line":425,"column":16},"end":{"line":425,"column":34}},"47":{"start":{"line":427,"column":16},"end":{"line":427,"column":44}},"48":{"start":{"line":430,"column":12},"end":{"line":430,"column":56}},"49":{"start":{"line":433,"column":8},"end":{"line":433,"column":20}},"50":{"start":{"line":454,"column":8},"end":{"line":466,"column":9}},"51":{"start":{"line":455,"column":12},"end":{"line":465,"column":13}},"52":{"start":{"line":456,"column":16},"end":{"line":456,"column":46}},"53":{"start":{"line":458,"column":16},"end":{"line":462,"column":19}},"54":{"start":{"line":464,"column":16},"end":{"line":464,"column":28}},"55":{"start":{"line":468,"column":8},"end":{"line":468,"column":24}},"56":{"start":{"line":499,"column":8},"end":{"line":499,"column":24}},"57":{"start":{"line":502,"column":8},"end":{"line":505,"column":9}},"58":{"start":{"line":503,"column":12},"end":{"line":503,"column":31}},"59":{"start":{"line":504,"column":12},"end":{"line":504,"column":26}},"60":{"start":{"line":507,"column":8},"end":{"line":507,"column":34}},"61":{"start":{"line":509,"column":8},"end":{"line":547,"column":11}},"62":{"start":{"line":510,"column":12},"end":{"line":513,"column":13}},"63":{"start":{"line":511,"column":16},"end":{"line":511,"column":53}},"64":{"start":{"line":512,"column":16},"end":{"line":512,"column":23}},"65":{"start":{"line":515,"column":12},"end":{"line":546,"column":15}},"66":{"start":{"line":516,"column":16},"end":{"line":521,"column":27}},"67":{"start":{"line":523,"column":16},"end":{"line":543,"column":17}},"68":{"start":{"line":524,"column":20},"end":{"line":524,"column":39}},"69":{"start":{"line":525,"column":20},"end":{"line":525,"column":42}},"70":{"start":{"line":527,"column":20},"end":{"line":527,"column":49}},"71":{"start":{"line":530,"column":20},"end":{"line":534,"column":21}},"72":{"start":{"line":531,"column":24},"end":{"line":533,"column":27}},"73":{"start":{"line":536,"column":20},"end":{"line":539,"column":21}},"74":{"start":{"line":537,"column":24},"end":{"line":537,"column":71}},"75":{"start":{"line":538,"column":24},"end":{"line":538,"column":55}},"76":{"start":{"line":541,"column":20},"end":{"line":541,"column":38}},"77":{"start":{"line":542,"column":20},"end":{"line":542,"column":48}},"78":{"start":{"line":545,"column":16},"end":{"line":545,"column":60}},"79":{"start":{"line":549,"column":8},"end":{"line":549,"column":20}},"80":{"start":{"line":571,"column":8},"end":{"line":571,"column":28}},"81":{"start":{"line":572,"column":8},"end":{"line":572,"column":33}},"82":{"start":{"line":574,"column":8},"end":{"line":574,"column":50}},"83":{"start":{"line":596,"column":8},"end":{"line":597,"column":53}},"84":{"start":{"line":601,"column":8},"end":{"line":601,"column":39}},"85":{"start":{"line":602,"column":8},"end":{"line":602,"column":48}},"86":{"start":{"line":606,"column":8},"end":{"line":615,"column":9}},"87":{"start":{"line":608,"column":12},"end":{"line":608,"column":45}},"88":{"start":{"line":610,"column":12},"end":{"line":614,"column":13}},"89":{"start":{"line":611,"column":16},"end":{"line":611,"column":56}},"90":{"start":{"line":612,"column":19},"end":{"line":614,"column":13}},"91":{"start":{"line":613,"column":16},"end":{"line":613,"column":56}},"92":{"start":{"line":617,"column":8},"end":{"line":621,"column":9}},"93":{"start":{"line":618,"column":12},"end":{"line":620,"column":13}},"94":{"start":{"line":619,"column":16},"end":{"line":619,"column":61}},"95":{"start":{"line":623,"column":8},"end":{"line":653,"column":9}},"96":{"start":{"line":624,"column":12},"end":{"line":624,"column":38}},"97":{"start":{"line":625,"column":12},"end":{"line":625,"column":46}},"98":{"start":{"line":627,"column":12},"end":{"line":639,"column":13}},"99":{"start":{"line":628,"column":16},"end":{"line":638,"column":17}},"100":{"start":{"line":629,"column":20},"end":{"line":629,"column":41}},"101":{"start":{"line":631,"column":20},"end":{"line":631,"column":44}},"102":{"start":{"line":633,"column":20},"end":{"line":637,"column":22}},"103":{"start":{"line":641,"column":12},"end":{"line":652,"column":13}},"104":{"start":{"line":643,"column":16},"end":{"line":647,"column":17}},"105":{"start":{"line":644,"column":20},"end":{"line":646,"column":23}},"106":{"start":{"line":649,"column":16},"end":{"line":649,"column":45}},"107":{"start":{"line":651,"column":16},"end":{"line":651,"column":47}},"108":{"start":{"line":655,"column":8},"end":{"line":655,"column":20}},"109":{"start":{"line":684,"column":8},"end":{"line":684,"column":56}},"110":{"start":{"line":686,"column":8},"end":{"line":688,"column":9}},"111":{"start":{"line":687,"column":12},"end":{"line":687,"column":23}},"112":{"start":{"line":712,"column":8},"end":{"line":712,"column":36}},"113":{"start":{"line":714,"column":8},"end":{"line":714,"column":30}},"114":{"start":{"line":715,"column":8},"end":{"line":715,"column":31}},"115":{"start":{"line":716,"column":8},"end":{"line":716,"column":33}},"116":{"start":{"line":718,"column":8},"end":{"line":720,"column":9}},"117":{"start":{"line":719,"column":12},"end":{"line":719,"column":28}},"118":{"start":{"line":722,"column":8},"end":{"line":722,"column":21}},"119":{"start":{"line":748,"column":8},"end":{"line":751,"column":21}},"120":{"start":{"line":753,"column":8},"end":{"line":753,"column":60}},"121":{"start":{"line":755,"column":8},"end":{"line":763,"column":11}},"122":{"start":{"line":756,"column":12},"end":{"line":762,"column":13}},"123":{"start":{"line":758,"column":16},"end":{"line":758,"column":58}},"124":{"start":{"line":760,"column":16},"end":{"line":760,"column":36}},"125":{"start":{"line":761,"column":16},"end":{"line":761,"column":56}},"126":{"start":{"line":765,"column":8},"end":{"line":765,"column":64}},"127":{"start":{"line":809,"column":8},"end":{"line":809,"column":31}},"128":{"start":{"line":833,"column":8},"end":{"line":834,"column":26}},"129":{"start":{"line":836,"column":8},"end":{"line":864,"column":9}},"130":{"start":{"line":837,"column":12},"end":{"line":837,"column":73}},"131":{"start":{"line":838,"column":12},"end":{"line":838,"column":83}},"132":{"start":{"line":840,"column":12},"end":{"line":850,"column":13}},"133":{"start":{"line":842,"column":16},"end":{"line":842,"column":89}},"134":{"start":{"line":844,"column":16},"end":{"line":849,"column":17}},"135":{"start":{"line":846,"column":20},"end":{"line":848,"column":47}},"136":{"start":{"line":852,"column":12},"end":{"line":852,"column":30}},"137":{"start":{"line":855,"column":12},"end":{"line":863,"column":13}},"138":{"start":{"line":856,"column":16},"end":{"line":856,"column":37}},"139":{"start":{"line":858,"column":16},"end":{"line":862,"column":17}},"140":{"start":{"line":859,"column":20},"end":{"line":859,"column":61}},"141":{"start":{"line":861,"column":20},"end":{"line":861,"column":55}},"142":{"start":{"line":866,"column":8},"end":{"line":866,"column":63}},"143":{"start":{"line":884,"column":8},"end":{"line":884,"column":36}},"144":{"start":{"line":898,"column":8},"end":{"line":898,"column":24}},"145":{"start":{"line":900,"column":8},"end":{"line":914,"column":9}},"146":{"start":{"line":901,"column":12},"end":{"line":911,"column":13}},"147":{"start":{"line":903,"column":16},"end":{"line":907,"column":19}},"148":{"start":{"line":909,"column":16},"end":{"line":909,"column":30}},"149":{"start":{"line":910,"column":16},"end":{"line":910,"column":23}},"150":{"start":{"line":913,"column":12},"end":{"line":913,"column":23}},"151":{"start":{"line":916,"column":8},"end":{"line":922,"column":9}},"152":{"start":{"line":919,"column":12},"end":{"line":919,"column":56}},"153":{"start":{"line":921,"column":12},"end":{"line":921,"column":47}},"154":{"start":{"line":948,"column":8},"end":{"line":950,"column":59}},"155":{"start":{"line":953,"column":8},"end":{"line":959,"column":9}},"156":{"start":{"line":954,"column":12},"end":{"line":958,"column":14}},"157":{"start":{"line":961,"column":8},"end":{"line":961,"column":25}}},"branchMap":{"1":{"line":236,"type":"if","locations":[{"start":{"line":236,"column":8},"end":{"line":236,"column":8}},{"start":{"line":236,"column":8},"end":{"line":236,"column":8}}]},"2":{"line":243,"type":"if","locations":[{"start":{"line":243,"column":16},"end":{"line":243,"column":16}},{"start":{"line":243,"column":16},"end":{"line":243,"column":16}}]},"3":{"line":249,"type":"binary-expr","locations":[{"start":{"line":249,"column":16},"end":{"line":249,"column":24}},{"start":{"line":249,"column":28},"end":{"line":249,"column":59}}]},"4":{"line":252,"type":"if","locations":[{"start":{"line":252,"column":12},"end":{"line":252,"column":12}},{"start":{"line":252,"column":12},"end":{"line":252,"column":12}}]},"5":{"line":252,"type":"binary-expr","locations":[{"start":{"line":252,"column":16},"end":{"line":252,"column":23}},{"start":{"line":252,"column":28},"end":{"line":252,"column":42}},{"start":{"line":252,"column":46},"end":{"line":252,"column":63}}]},"6":{"line":271,"type":"binary-expr","locations":[{"start":{"line":271,"column":8},"end":{"line":271,"column":24}},{"start":{"line":271,"column":29},"end":{"line":271,"column":49}}]},"7":{"line":316,"type":"cond-expr","locations":[{"start":{"line":316,"column":51},"end":{"line":316,"column":64}},{"start":{"line":316,"column":67},"end":{"line":316,"column":69}}]},"8":{"line":330,"type":"cond-expr","locations":[{"start":{"line":330,"column":56},"end":{"line":330,"column":69}},{"start":{"line":330,"column":72},"end":{"line":330,"column":74}}]},"9":{"line":345,"type":"binary-expr","locations":[{"start":{"line":345,"column":15},"end":{"line":345,"column":27}},{"start":{"line":345,"column":31},"end":{"line":345,"column":61}}]},"10":{"line":394,"type":"if","locations":[{"start":{"line":394,"column":8},"end":{"line":394,"column":8}},{"start":{"line":394,"column":8},"end":{"line":394,"column":8}}]},"11":{"line":399,"type":"binary-expr","locations":[{"start":{"line":399,"column":8},"end":{"line":399,"column":15}},{"start":{"line":399,"column":20},"end":{"line":399,"column":32}}]},"12":{"line":409,"type":"if","locations":[{"start":{"line":409,"column":12},"end":{"line":409,"column":12}},{"start":{"line":409,"column":12},"end":{"line":409,"column":12}}]},"13":{"line":416,"type":"if","locations":[{"start":{"line":416,"column":16},"end":{"line":416,"column":16}},{"start":{"line":416,"column":16},"end":{"line":416,"column":16}}]},"14":{"line":430,"type":"binary-expr","locations":[{"start":{"line":430,"column":12},"end":{"line":430,"column":20}},{"start":{"line":430,"column":24},"end":{"line":430,"column":55}}]},"15":{"line":454,"type":"if","locations":[{"start":{"line":454,"column":8},"end":{"line":454,"column":8}},{"start":{"line":454,"column":8},"end":{"line":454,"column":8}}]},"16":{"line":502,"type":"if","locations":[{"start":{"line":502,"column":8},"end":{"line":502,"column":8}},{"start":{"line":502,"column":8},"end":{"line":502,"column":8}}]},"17":{"line":507,"type":"binary-expr","locations":[{"start":{"line":507,"column":8},"end":{"line":507,"column":15}},{"start":{"line":507,"column":20},"end":{"line":507,"column":32}}]},"18":{"line":510,"type":"if","locations":[{"start":{"line":510,"column":12},"end":{"line":510,"column":12}},{"start":{"line":510,"column":12},"end":{"line":510,"column":12}}]},"19":{"line":511,"type":"binary-expr","locations":[{"start":{"line":511,"column":16},"end":{"line":511,"column":24}},{"start":{"line":511,"column":28},"end":{"line":511,"column":52}}]},"20":{"line":515,"type":"cond-expr","locations":[{"start":{"line":515,"column":37},"end":{"line":515,"column":45}},{"start":{"line":515,"column":48},"end":{"line":515,"column":56}}]},"21":{"line":523,"type":"if","locations":[{"start":{"line":523,"column":16},"end":{"line":523,"column":16}},{"start":{"line":523,"column":16},"end":{"line":523,"column":16}}]},"22":{"line":530,"type":"if","locations":[{"start":{"line":530,"column":20},"end":{"line":530,"column":20}},{"start":{"line":530,"column":20},"end":{"line":530,"column":20}}]},"23":{"line":536,"type":"if","locations":[{"start":{"line":536,"column":20},"end":{"line":536,"column":20}},{"start":{"line":536,"column":20},"end":{"line":536,"column":20}}]},"24":{"line":545,"type":"binary-expr","locations":[{"start":{"line":545,"column":16},"end":{"line":545,"column":24}},{"start":{"line":545,"column":28},"end":{"line":545,"column":59}}]},"25":{"line":606,"type":"if","locations":[{"start":{"line":606,"column":8},"end":{"line":606,"column":8}},{"start":{"line":606,"column":8},"end":{"line":606,"column":8}}]},"26":{"line":610,"type":"if","locations":[{"start":{"line":610,"column":12},"end":{"line":610,"column":12}},{"start":{"line":610,"column":12},"end":{"line":610,"column":12}}]},"27":{"line":612,"type":"if","locations":[{"start":{"line":612,"column":19},"end":{"line":612,"column":19}},{"start":{"line":612,"column":19},"end":{"line":612,"column":19}}]},"28":{"line":618,"type":"if","locations":[{"start":{"line":618,"column":12},"end":{"line":618,"column":12}},{"start":{"line":618,"column":12},"end":{"line":618,"column":12}}]},"29":{"line":623,"type":"if","locations":[{"start":{"line":623,"column":8},"end":{"line":623,"column":8}},{"start":{"line":623,"column":8},"end":{"line":623,"column":8}}]},"30":{"line":628,"type":"if","locations":[{"start":{"line":628,"column":16},"end":{"line":628,"column":16}},{"start":{"line":628,"column":16},"end":{"line":628,"column":16}}]},"31":{"line":636,"type":"binary-expr","locations":[{"start":{"line":636,"column":33},"end":{"line":636,"column":38}},{"start":{"line":636,"column":42},"end":{"line":636,"column":46}}]},"32":{"line":641,"type":"if","locations":[{"start":{"line":641,"column":12},"end":{"line":641,"column":12}},{"start":{"line":641,"column":12},"end":{"line":641,"column":12}}]},"33":{"line":643,"type":"if","locations":[{"start":{"line":643,"column":16},"end":{"line":643,"column":16}},{"start":{"line":643,"column":16},"end":{"line":643,"column":16}}]},"34":{"line":686,"type":"if","locations":[{"start":{"line":686,"column":8},"end":{"line":686,"column":8}},{"start":{"line":686,"column":8},"end":{"line":686,"column":8}}]},"35":{"line":718,"type":"if","locations":[{"start":{"line":718,"column":8},"end":{"line":718,"column":8}},{"start":{"line":718,"column":8},"end":{"line":718,"column":8}}]},"36":{"line":753,"type":"binary-expr","locations":[{"start":{"line":753,"column":8},"end":{"line":753,"column":17}},{"start":{"line":753,"column":22},"end":{"line":753,"column":58}}]},"37":{"line":756,"type":"if","locations":[{"start":{"line":756,"column":12},"end":{"line":756,"column":12}},{"start":{"line":756,"column":12},"end":{"line":756,"column":12}}]},"38":{"line":758,"type":"cond-expr","locations":[{"start":{"line":758,"column":46},"end":{"line":758,"column":50}},{"start":{"line":758,"column":53},"end":{"line":758,"column":57}}]},"39":{"line":765,"type":"cond-expr","locations":[{"start":{"line":765,"column":26},"end":{"line":765,"column":56}},{"start":{"line":765,"column":59},"end":{"line":765,"column":63}}]},"40":{"line":809,"type":"binary-expr","locations":[{"start":{"line":809,"column":8},"end":{"line":809,"column":16}},{"start":{"line":809,"column":20},"end":{"line":809,"column":30}}]},"41":{"line":836,"type":"if","locations":[{"start":{"line":836,"column":8},"end":{"line":836,"column":8}},{"start":{"line":836,"column":8},"end":{"line":836,"column":8}}]},"42":{"line":836,"type":"binary-expr","locations":[{"start":{"line":836,"column":12},"end":{"line":836,"column":23}},{"start":{"line":836,"column":27},"end":{"line":836,"column":47}}]},"43":{"line":837,"type":"binary-expr","locations":[{"start":{"line":837,"column":24},"end":{"line":837,"column":46}},{"start":{"line":837,"column":50},"end":{"line":837,"column":72}}]},"44":{"line":838,"type":"cond-expr","locations":[{"start":{"line":838,"column":63},"end":{"line":838,"column":67}},{"start":{"line":838,"column":70},"end":{"line":838,"column":82}}]},"45":{"line":840,"type":"if","locations":[{"start":{"line":840,"column":12},"end":{"line":840,"column":12}},{"start":{"line":840,"column":12},"end":{"line":840,"column":12}}]},"46":{"line":842,"type":"cond-expr","locations":[{"start":{"line":842,"column":66},"end":{"line":842,"column":70}},{"start":{"line":842,"column":73},"end":{"line":842,"column":88}}]},"47":{"line":844,"type":"if","locations":[{"start":{"line":844,"column":16},"end":{"line":844,"column":16}},{"start":{"line":844,"column":16},"end":{"line":844,"column":16}}]},"48":{"line":846,"type":"cond-expr","locations":[{"start":{"line":847,"column":24},"end":{"line":847,"column":43}},{"start":{"line":848,"column":24},"end":{"line":848,"column":46}}]},"49":{"line":855,"type":"if","locations":[{"start":{"line":855,"column":12},"end":{"line":855,"column":12}},{"start":{"line":855,"column":12},"end":{"line":855,"column":12}}]},"50":{"line":858,"type":"if","locations":[{"start":{"line":858,"column":16},"end":{"line":858,"column":16}},{"start":{"line":858,"column":16},"end":{"line":858,"column":16}}]},"51":{"line":901,"type":"if","locations":[{"start":{"line":901,"column":12},"end":{"line":901,"column":12}},{"start":{"line":901,"column":12},"end":{"line":901,"column":12}}]},"52":{"line":916,"type":"if","locations":[{"start":{"line":916,"column":8},"end":{"line":916,"column":8}},{"start":{"line":916,"column":8},"end":{"line":916,"column":8}}]},"53":{"line":949,"type":"binary-expr","locations":[{"start":{"line":949,"column":26},"end":{"line":949,"column":30}},{"start":{"line":949,"column":34},"end":{"line":949,"column":51}}]},"54":{"line":950,"type":"binary-expr","locations":[{"start":{"line":950,"column":27},"end":{"line":950,"column":34}},{"start":{"line":950,"column":38},"end":{"line":950,"column":58}}]},"55":{"line":953,"type":"if","locations":[{"start":{"line":953,"column":8},"end":{"line":953,"column":8}},{"start":{"line":953,"column":8},"end":{"line":953,"column":8}}]},"56":{"line":953,"type":"binary-expr","locations":[{"start":{"line":953,"column":12},"end":{"line":953,"column":21}},{"start":{"line":953,"column":25},"end":{"line":953,"column":36}},{"start":{"line":953,"column":40},"end":{"line":953,"column":53}}]},"57":{"line":957,"type":"binary-expr","locations":[{"start":{"line":957,"column":21},"end":{"line":957,"column":29}},{"start":{"line":957,"column":33},"end":{"line":957,"column":37}}]}},"code":["(function () { YUI.add('model', function (Y, NAME) {","","/**","Attribute-based data model with APIs for getting, setting, validating, and","syncing attribute values, as well as events for being notified of model changes.","","@module app","@submodule model","@since 3.4.0","**/","","/**","Attribute-based data model with APIs for getting, setting, validating, and","syncing attribute values, as well as events for being notified of model changes.","","In most cases, you'll want to create your own subclass of `Y.Model` and","customize it to meet your needs. In particular, the `sync()` and `validate()`","methods are meant to be overridden by custom implementations. You may also want","to override the `parse()` method to parse non-generic server responses.","","@class Model","@constructor","@extends Base","@since 3.4.0","**/","","var GlobalEnv = YUI.namespace('Env.Model'),","    Lang      = Y.Lang,","    YArray    = Y.Array,","    YObject   = Y.Object,","","    /**","    Fired when one or more attributes on this model are changed.","","    @event change","    @param {Object} changed Hash of change information for each attribute that","        changed. Each item in the hash has the following properties:","      @param {Any} changed.newVal New value of the attribute.","      @param {Any} changed.prevVal Previous value of the attribute.","      @param {String|null} changed.src Source of the change event, if any.","    **/","    EVT_CHANGE = 'change',","","    /**","    Fired when an error occurs, such as when the model doesn't validate or when","    a sync layer response can't be parsed.","","    @event error","    @param {Any} error Error message, object, or exception generated by the","      error. Calling `toString()` on this should result in a meaningful error","      message.","    @param {String} src Source of the error. May be one of the following (or any","      custom error source defined by a Model subclass):","","      * `load`: An error loading the model from a sync layer. The sync layer's","        response (if any) will be provided as the `response` property on the","        event facade.","","      * `parse`: An error parsing a JSON response. The response in question will","        be provided as the `response` property on the event facade.","","      * `save`: An error saving the model to a sync layer. The sync layer's","        response (if any) will be provided as the `response` property on the","        event facade.","","      * `validate`: The model failed to validate. The attributes being validated","        will be provided as the `attributes` property on the event facade.","    **/","    EVT_ERROR = 'error',","","    /**","    Fired after model attributes are loaded from a sync layer.","","    @event load","    @param {Object} parsed The parsed version of the sync layer's response to","        the load request.","    @param {any} response The sync layer's raw, unparsed response to the load","        request.","    @since 3.5.0","    **/","    EVT_LOAD = 'load',","","    /**","    Fired after model attributes are saved to a sync layer.","","    @event save","    @param {Object} [parsed] The parsed version of the sync layer's response to","        the save request, if there was a response.","    @param {any} [response] The sync layer's raw, unparsed response to the save","        request, if there was one.","    @since 3.5.0","    **/","    EVT_SAVE = 'save';","","function Model() {","    Model.superclass.constructor.apply(this, arguments);","}","","Y.Model = Y.extend(Model, Y.Base, {","    // -- Public Properties ----------------------------------------------------","","    /**","    Hash of attributes that have changed since the last time this model was","    saved.","","    @property changed","    @type Object","    @default {}","    **/","","    /**","    Name of the attribute to use as the unique id (or primary key) for this","    model.","","    The default is `id`, but if your persistence layer uses a different name for","    the primary key (such as `_id` or `uid`), you can specify that here.","","    The built-in `id` attribute will always be an alias for whatever attribute","    name you specify here, so getting and setting `id` will always behave the","    same as getting and setting your custom id attribute.","","    @property idAttribute","    @type String","    @default `'id'`","    **/","    idAttribute: 'id',","","    /**","    Hash of attributes that were changed in the last `change` event. Each item","    in this hash is an object with the following properties:","","      * `newVal`: The new value of the attribute after it changed.","      * `prevVal`: The old value of the attribute before it changed.","      * `src`: The source of the change, or `null` if no source was specified.","","    @property lastChange","    @type Object","    @default {}","    **/","","    /**","    Array of `ModelList` instances that contain this model.","","    When a model is in one or more lists, the model's events will bubble up to","    those lists. You can subscribe to a model event on a list to be notified","    when any model in the list fires that event.","","    This property is updated automatically when this model is added to or","    removed from a `ModelList` instance. You shouldn't alter it manually. When","    working with models in a list, you should always add and remove models using","    the list's `add()` and `remove()` methods.","","    @example Subscribing to model events on a list:","","        // Assuming `list` is an existing Y.ModelList instance.","        list.on('*:change', function (e) {","            // This function will be called whenever any model in the list","            // fires a `change` event.","            //","            // `e.target` will refer to the model instance that fired the","            // event.","        });","","    @property lists","    @type ModelList[]","    @default `[]`","    **/","","    // -- Protected Properties -------------------------------------------------","","    /**","    This tells `Y.Base` that it should create ad-hoc attributes for config","    properties passed to Model's constructor. This makes it possible to","    instantiate a model and set a bunch of attributes without having to subclass","    `Y.Model` and declare all those attributes first.","","    @property _allowAdHocAttrs","    @type Boolean","    @default true","    @protected","    @since 3.5.0","    **/","    _allowAdHocAttrs: true,","","    /**","    Total hack to allow us to identify Model instances without using","    `instanceof`, which won't work when the instance was created in another","    window or YUI sandbox.","","    @property _isYUIModel","    @type Boolean","    @default true","    @protected","    @since 3.5.0","    **/","    _isYUIModel: true,","","    // -- Lifecycle Methods ----------------------------------------------------","    initializer: function (config) {","        this.changed    = {};","        this.lastChange = {};","        this.lists      = [];","    },","","    // -- Public Methods -------------------------------------------------------","","    /**","    Destroys this model instance and removes it from its containing lists, if","    any.","","    The _callback_, if one is provided, will be called after the model is","    destroyed.","","    If `options.remove` is `true`, then this method delegates to the `sync()`","    method to delete the model from the persistence layer, which is an","    asynchronous action. In this case, the _callback_ (if provided) will be","    called after the sync layer indicates success or failure of the delete","    operation.","","    @method destroy","    @param {Object} [options] Sync options. It's up to the custom sync","        implementation to determine what options it supports or requires, if","        any.","      @param {Boolean} [options.remove=false] If `true`, the model will be","        deleted via the sync layer in addition to the instance being destroyed.","    @param {callback} [callback] Called after the model has been destroyed (and","        deleted via the sync layer if `options.remove` is `true`).","      @param {Error|null} callback.err If an error occurred, this parameter will","        contain the error. Otherwise _err_ will be `null`.","    @chainable","    **/","    destroy: function (options, callback) {","        var self = this;","","        // Allow callback as only arg.","        if (typeof options === 'function') {","            callback = options;","            options  = null;","        }","","        self.onceAfter('destroy', function () {","            function finish(err) {","                if (!err) {","                    YArray.each(self.lists.concat(), function (list) {","                        list.remove(self, options);","                    });","                }","","                callback && callback.apply(null, arguments);","            }","","            if (options && (options.remove || options['delete'])) {","                self.sync('delete', options, finish);","            } else {","                finish();","            }","        });","","        return Model.superclass.destroy.call(self);","    },","","    /**","    Returns a clientId string that's unique among all models on the current page","    (even models in other YUI instances). Uniqueness across pageviews is","    unlikely.","","    @method generateClientId","    @return {String} Unique clientId.","    **/","    generateClientId: function () {","        GlobalEnv.lastId || (GlobalEnv.lastId = 0);","        return this.constructor.NAME + '_' + (GlobalEnv.lastId += 1);","    },","","    /**","    Returns the value of the specified attribute.","","    If the attribute's value is an object, _name_ may use dot notation to","    specify the path to a specific property within the object, and the value of","    that property will be returned.","","    @example","        // Set the 'foo' attribute to an object.","        myModel.set('foo', {","            bar: {","                baz: 'quux'","            }","        });","","        // Get the value of 'foo'.","        myModel.get('foo');","        // => {bar: {baz: 'quux'}}","","        // Get the value of 'foo.bar.baz'.","        myModel.get('foo.bar.baz');","        // => 'quux'","","    @method get","    @param {String} name Attribute name or object property path.","    @return {Any} Attribute value, or `undefined` if the attribute doesn't","      exist.","    **/","","    // get() is defined by Y.Attribute.","","    /**","    Returns an HTML-escaped version of the value of the specified string","    attribute. The value is escaped using `Y.Escape.html()`.","","    @method getAsHTML","    @param {String} name Attribute name or object property path.","    @return {String} HTML-escaped attribute value.","    **/","    getAsHTML: function (name) {","        var value = this.get(name);","        return Y.Escape.html(Lang.isValue(value) ? String(value) : '');","    },","","    /**","    Returns a URL-encoded version of the value of the specified string","    attribute. The value is encoded using the native `encodeURIComponent()`","    function.","","    @method getAsURL","    @param {String} name Attribute name or object property path.","    @return {String} URL-encoded attribute value.","    **/","    getAsURL: function (name) {","        var value = this.get(name);","        return encodeURIComponent(Lang.isValue(value) ? String(value) : '');","    },","","    /**","    Returns `true` if any attribute of this model has been changed since the","    model was last saved.","","    New models (models for which `isNew()` returns `true`) are implicitly","    considered to be \"modified\" until the first time they're saved.","","    @method isModified","    @return {Boolean} `true` if this model has changed since it was last saved,","      `false` otherwise.","    **/","    isModified: function () {","        return this.isNew() || !YObject.isEmpty(this.changed);","    },","","    /**","    Returns `true` if this model is \"new\", meaning it hasn't been saved since it","    was created.","","    Newness is determined by checking whether the model's `id` attribute has","    been set. An empty id is assumed to indicate a new model, whereas a","    non-empty id indicates a model that was either loaded or has been saved","    since it was created.","","    @method isNew","    @return {Boolean} `true` if this model is new, `false` otherwise.","    **/","    isNew: function () {","        return !Lang.isValue(this.get('id'));","    },","","    /**","    Loads this model from the server.","","    This method delegates to the `sync()` method to perform the actual load","    operation, which is an asynchronous action. Specify a _callback_ function to","    be notified of success or failure.","","    A successful load operation will fire a `load` event, while an unsuccessful","    load operation will fire an `error` event with the `src` value \"load\".","","    If the load operation succeeds and one or more of the loaded attributes","    differ from this model's current attributes, a `change` event will be fired.","","    @method load","    @param {Object} [options] Options to be passed to `sync()` and to `set()`","      when setting the loaded attributes. It's up to the custom sync","      implementation to determine what options it supports or requires, if any.","    @param {callback} [callback] Called when the sync operation finishes.","      @param {Error|null} callback.err If an error occurred, this parameter will","        contain the error. If the sync operation succeeded, _err_ will be","        `null`.","      @param {Any} callback.response The server's response. This value will","        be passed to the `parse()` method, which is expected to parse it and","        return an attribute hash.","    @chainable","    **/","    load: function (options, callback) {","        var self = this;","","        // Allow callback as only arg.","        if (typeof options === 'function') {","            callback = options;","            options  = {};","        }","","        options || (options = {});","","        self.sync('read', options, function (err, response) {","            var facade = {","                    options : options,","                    response: response","                },","","                parsed;","","            if (err) {","                facade.error = err;","                facade.src   = 'load';","","                self.fire(EVT_ERROR, facade);","            } else {","                // Lazy publish.","                if (!self._loadEvent) {","                    self._loadEvent = self.publish(EVT_LOAD, {","                        preventable: false","                    });","                }","","                parsed = facade.parsed = self._parse(response);","","                self.setAttrs(parsed, options);","                self.changed = {};","","                self.fire(EVT_LOAD, facade);","            }","","            callback && callback.apply(null, arguments);","        });","","        return self;","    },","","    /**","    Called to parse the _response_ when the model is loaded from the server.","    This method receives a server _response_ and is expected to return an","    attribute hash.","","    The default implementation assumes that _response_ is either an attribute","    hash or a JSON string that can be parsed into an attribute hash. If","    _response_ is a JSON string and either `Y.JSON` or the native `JSON` object","    are available, it will be parsed automatically. If a parse error occurs, an","    `error` event will be fired and the model will not be updated.","","    You may override this method to implement custom parsing logic if necessary.","","    @method parse","    @param {Any} response Server response.","    @return {Object} Attribute hash.","    **/","    parse: function (response) {","        if (typeof response === 'string') {","            try {","                return Y.JSON.parse(response);","            } catch (ex) {","                this.fire(EVT_ERROR, {","                    error   : ex,","                    response: response,","                    src     : 'parse'","                });","","                return null;","            }","        }","","        return response;","    },","","    /**","    Saves this model to the server.","","    This method delegates to the `sync()` method to perform the actual save","    operation, which is an asynchronous action. Specify a _callback_ function to","    be notified of success or failure.","","    A successful save operation will fire a `save` event, while an unsuccessful","    save operation will fire an `error` event with the `src` value \"save\".","","    If the save operation succeeds and one or more of the attributes returned in","    the server's response differ from this model's current attributes, a","    `change` event will be fired.","","    @method save","    @param {Object} [options] Options to be passed to `sync()` and to `set()`","      when setting synced attributes. It's up to the custom sync implementation","      to determine what options it supports or requires, if any.","    @param {Function} [callback] Called when the sync operation finishes.","      @param {Error|null} callback.err If an error occurred or validation","        failed, this parameter will contain the error. If the sync operation","        succeeded, _err_ will be `null`.","      @param {Any} callback.response The server's response. This value will","        be passed to the `parse()` method, which is expected to parse it and","        return an attribute hash.","    @chainable","    **/","    save: function (options, callback) {","        var self = this;","","        // Allow callback as only arg.","        if (typeof options === 'function') {","            callback = options;","            options  = {};","        }","","        options || (options = {});","","        self._validate(self.toJSON(), function (err) {","            if (err) {","                callback && callback.call(null, err);","                return;","            }","","            self.sync(self.isNew() ? 'create' : 'update', options, function (err, response) {","                var facade = {","                        options : options,","                        response: response","                    },","","                    parsed;","","                if (err) {","                    facade.error = err;","                    facade.src   = 'save';","","                    self.fire(EVT_ERROR, facade);","                } else {","                    // Lazy publish.","                    if (!self._saveEvent) {","                        self._saveEvent = self.publish(EVT_SAVE, {","                            preventable: false","                        });","                    }","","                    if (response) {","                        parsed = facade.parsed = self._parse(response);","                        self.setAttrs(parsed, options);","                    }","","                    self.changed = {};","                    self.fire(EVT_SAVE, facade);","                }","","                callback && callback.apply(null, arguments);","            });","        });","","        return self;","    },","","    /**","    Sets the value of a single attribute. If model validation fails, the","    attribute will not be set and an `error` event will be fired.","","    Use `setAttrs()` to set multiple attributes at once.","","    @example","        model.set('foo', 'bar');","","    @method set","    @param {String} name Attribute name or object property path.","    @param {any} value Value to set.","    @param {Object} [options] Data to be mixed into the event facade of the","        `change` event(s) for these attributes.","      @param {Boolean} [options.silent=false] If `true`, no `change` event will","          be fired.","    @chainable","    **/","    set: function (name, value, options) {","        var attributes = {};","        attributes[name] = value;","","        return this.setAttrs(attributes, options);","    },","","    /**","    Sets the values of multiple attributes at once. If model validation fails,","    the attributes will not be set and an `error` event will be fired.","","    @example","        model.setAttrs({","            foo: 'bar',","            baz: 'quux'","        });","","    @method setAttrs","    @param {Object} attributes Hash of attribute names and values to set.","    @param {Object} [options] Data to be mixed into the event facade of the","        `change` event(s) for these attributes.","      @param {Boolean} [options.silent=false] If `true`, no `change` event will","          be fired.","    @chainable","    **/","    setAttrs: function (attributes, options) {","        var idAttribute = this.idAttribute,","            changed, e, key, lastChange, transaction;","","        // Makes a shallow copy of the `options` object before adding the","        // `_transaction` object to it so we don't modify someone else's object.","        options     = Y.merge(options);","        transaction = options._transaction = {};","","        // When a custom id attribute is in use, always keep the default `id`","        // attribute in sync.","        if (idAttribute !== 'id') {","            // So we don't modify someone else's object.","            attributes = Y.merge(attributes);","","            if (YObject.owns(attributes, idAttribute)) {","                attributes.id = attributes[idAttribute];","            } else if (YObject.owns(attributes, 'id')) {","                attributes[idAttribute] = attributes.id;","            }","        }","","        for (key in attributes) {","            if (YObject.owns(attributes, key)) {","                this._setAttr(key, attributes[key], options);","            }","        }","","        if (!YObject.isEmpty(transaction)) {","            changed    = this.changed;","            lastChange = this.lastChange = {};","","            for (key in transaction) {","                if (YObject.owns(transaction, key)) {","                    e = transaction[key];","","                    changed[key] = e.newVal;","","                    lastChange[key] = {","                        newVal : e.newVal,","                        prevVal: e.prevVal,","                        src    : e.src || null","                    };","                }","            }","","            if (!options.silent) {","                // Lazy publish for the change event.","                if (!this._changeEvent) {","                    this._changeEvent = this.publish(EVT_CHANGE, {","                        preventable: false","                    });","                }","","                options.changed = lastChange;","","                this.fire(EVT_CHANGE, options);","            }","        }","","        return this;","    },","","    /**","    Override this method to provide a custom persistence implementation for this","    model. The default just calls the callback without actually doing anything.","","    This method is called internally by `load()`, `save()`, and `destroy()`, and","    their implementations rely on the callback being called. This effectively","    means that when a callback is provided, it must be called at some point for","    the class to operate correctly.","","    @method sync","    @param {String} action Sync action to perform. May be one of the following:","","      * `create`: Store a newly-created model for the first time.","      * `delete`: Delete an existing model.","      * `read`  : Load an existing model.","      * `update`: Update an existing model.","","    @param {Object} [options] Sync options. It's up to the custom sync","      implementation to determine what options it supports or requires, if any.","    @param {Function} [callback] Called when the sync operation finishes.","      @param {Error|null} callback.err If an error occurred, this parameter will","        contain the error. If the sync operation succeeded, _err_ will be","        falsy.","      @param {Any} [callback.response] The server's response.","    **/","    sync: function (/* action, options, callback */) {","        var callback = YArray(arguments, 0, true).pop();","","        if (typeof callback === 'function') {","            callback();","        }","    },","","    /**","    Returns a copy of this model's attributes that can be passed to","    `Y.JSON.stringify()` or used for other nefarious purposes.","","    The `clientId` attribute is not included in the returned object.","","    If you've specified a custom attribute name in the `idAttribute` property,","    the default `id` attribute will not be included in the returned object.","","    Note: The ECMAScript 5 specification states that objects may implement a","    `toJSON` method to provide an alternate object representation to serialize","    when passed to `JSON.stringify(obj)`.  This allows class instances to be","    serialized as if they were plain objects.  This is why Model's `toJSON`","    returns an object, not a JSON string.","","    See <http://es5.github.com/#x15.12.3> for details.","","    @method toJSON","    @return {Object} Copy of this model's attributes.","    **/","    toJSON: function () {","        var attrs = this.getAttrs();","","        delete attrs.clientId;","        delete attrs.destroyed;","        delete attrs.initialized;","","        if (this.idAttribute !== 'id') {","            delete attrs.id;","        }","","        return attrs;","    },","","    /**","    Reverts the last change to the model.","","    If an _attrNames_ array is provided, then only the named attributes will be","    reverted (and only if they were modified in the previous change). If no","    _attrNames_ array is provided, then all changed attributes will be reverted","    to their previous values.","","    Note that only one level of undo is available: from the current state to the","    previous state. If `undo()` is called when no previous state is available,","    it will simply do nothing.","","    @method undo","    @param {Array} [attrNames] Array of specific attribute names to revert. If","      not specified, all attributes modified in the last change will be","      reverted.","    @param {Object} [options] Data to be mixed into the event facade of the","        change event(s) for these attributes.","      @param {Boolean} [options.silent=false] If `true`, no `change` event will","          be fired.","    @chainable","    **/","    undo: function (attrNames, options) {","        var lastChange  = this.lastChange,","            idAttribute = this.idAttribute,","            toUndo      = {},","            needUndo;","","        attrNames || (attrNames = YObject.keys(lastChange));","","        YArray.each(attrNames, function (name) {","            if (YObject.owns(lastChange, name)) {","                // Don't generate a double change for custom id attributes.","                name = name === idAttribute ? 'id' : name;","","                needUndo     = true;","                toUndo[name] = lastChange[name].prevVal;","            }","        });","","        return needUndo ? this.setAttrs(toUndo, options) : this;","    },","","    /**","    Override this method to provide custom validation logic for this model.","","    While attribute-specific validators can be used to validate individual","    attributes, this method gives you a hook to validate a hash of all","    attributes before the model is saved. This method is called automatically","    before `save()` takes any action. If validation fails, the `save()` call","    will be aborted.","","    In your validation method, call the provided `callback` function with no","    arguments to indicate success. To indicate failure, pass a single argument,","    which may contain an error message, an array of error messages, or any other","    value. This value will be passed along to the `error` event.","","    @example","","        model.validate = function (attrs, callback) {","            if (attrs.pie !== true) {","                // No pie?! Invalid!","                callback('Must provide pie.');","                return;","            }","","            // Success!","            callback();","        };","","    @method validate","    @param {Object} attrs Attribute hash containing all model attributes to","        be validated.","    @param {Function} callback Validation callback. Call this function when your","        validation logic finishes. To trigger a validation failure, pass any","        value as the first argument to the callback (ideally a meaningful","        validation error of some kind).","","        @param {Any} [callback.err] Validation error. Don't provide this","            argument if validation succeeds. If validation fails, set this to an","            error message or some other meaningful value. It will be passed","            along to the resulting `error` event.","    **/","    validate: function (attrs, callback) {","        callback && callback();","    },","","    // -- Protected Methods ----------------------------------------------------","","    /**","    Duckpunches the `addAttr` method provided by `Y.Attribute` to keep the","    `id` attribute’s value and a custom id attribute’s (if provided) value","    in sync when adding the attributes to the model instance object.","","    Marked as protected to hide it from Model's public API docs, even though","    this is a public method in Attribute.","","    @method addAttr","    @param {String} name The name of the attribute.","    @param {Object} config An object with attribute configuration property/value","      pairs, specifying the configuration for the attribute.","    @param {Boolean} lazy (optional) Whether or not to add this attribute lazily","      (on the first call to get/set).","    @return {Object} A reference to the host object.","    @chainable","    @protected","    **/","    addAttr: function (name, config, lazy) {","        var idAttribute = this.idAttribute,","            idAttrCfg, id;","","        if (idAttribute && name === idAttribute) {","            idAttrCfg = this._isLazyAttr('id') || this._getAttrCfg('id');","            id        = config.value === config.defaultValue ? null : config.value;","","            if (!Lang.isValue(id)) {","                // Hunt for the id value.","                id = idAttrCfg.value === idAttrCfg.defaultValue ? null : idAttrCfg.value;","","                if (!Lang.isValue(id)) {","                    // No id value provided on construction, check defaults.","                    id = Lang.isValue(config.defaultValue) ?","                        config.defaultValue :","                        idAttrCfg.defaultValue;","                }","            }","","            config.value = id;","","            // Make sure `id` is in sync.","            if (idAttrCfg.value !== id) {","                idAttrCfg.value = id;","","                if (this._isLazyAttr('id')) {","                    this._state.add('id', 'lazy', idAttrCfg);","                } else {","                    this._state.add('id', 'value', id);","                }","            }","        }","","        return Model.superclass.addAttr.apply(this, arguments);","    },","","    /**","    Calls the public, overrideable `parse()` method and returns the result.","","    Override this method to provide a custom pre-parsing implementation. This","    provides a hook for custom persistence implementations to \"prep\" a response","    before calling the `parse()` method.","","    @method _parse","    @param {Any} response Server response.","    @return {Object} Attribute hash.","    @protected","    @see Model.parse()","    @since 3.7.0","    **/","    _parse: function (response) {","        return this.parse(response);","    },","","    /**","    Calls the public, overridable `validate()` method and fires an `error` event","    if validation fails.","","    @method _validate","    @param {Object} attributes Attribute hash.","    @param {Function} callback Validation callback.","        @param {Any} [callback.err] Value on failure, non-value on success.","    @protected","    **/","    _validate: function (attributes, callback) {","        var self = this;","","        function handler(err) {","            if (Lang.isValue(err)) {","                // Validation failed. Fire an error.","                self.fire(EVT_ERROR, {","                    attributes: attributes,","                    error     : err,","                    src       : 'validate'","                });","","                callback(err);","                return;","            }","","            callback();","        }","","        if (self.validate.length === 1) {","            // Backcompat for 3.4.x-style synchronous validate() functions that","            // don't take a callback argument.","            handler(self.validate(attributes, handler));","        } else {","            self.validate(attributes, handler);","        }","    },","","    // -- Private Methods ----------------------------------------------------","","    /**","     Overrides AttributeCore's `_setAttrVal`, to register the changed value if it's part","     of a Model `setAttrs` transaction.","","     NOTE: AttributeCore's `_setAttrVal` is currently private, but until we support coalesced","     change events in attribute, we need this override.","","     @method _setAttrVal","     @private","     @param {String} attrName The attribute name.","     @param {String} subAttrName The sub-attribute name, if setting a sub-attribute property (\"x.y.z\").","     @param {Any} prevVal The currently stored value of the attribute.","     @param {Any} newVal The value which is going to be stored.","     @param {Object} [opts] Optional data providing the circumstances for the change.","     @param {Object} [attrCfg] Optional config hash for the attribute. This is added for performance along the critical path,","     where the calling method has already obtained the config from state.","","     @return {boolean} true if the new attribute value was stored, false if not.","     **/","    _setAttrVal : function(attrName, subAttrName, prevVal, newVal, opts, attrCfg) {","","        var didChange = Model.superclass._setAttrVal.apply(this, arguments),","            transaction = opts && opts._transaction,","            initializing = attrCfg && attrCfg.initializing;","","        // value actually changed inside a model setAttrs transaction","        if (didChange && transaction && !initializing) {","            transaction[attrName] = {","                newVal: this.get(attrName), // newVal may be impacted by getter","                prevVal: prevVal,","                src: opts.src || null","            };","        }","","        return didChange;","    }","","}, {","    NAME: 'model',","","    ATTRS: {","        /**","        A client-only identifier for this model.","","        Like the `id` attribute, `clientId` may be used to retrieve model","        instances from lists. Unlike the `id` attribute, `clientId` is","        automatically generated, and is only intended to be used on the client","        during the current pageview.","","        @attribute clientId","        @type String","        @readOnly","        **/","        clientId: {","            valueFn : 'generateClientId',","            readOnly: true","        },","","        /**","        A unique identifier for this model. Among other things, this id may be","        used to retrieve model instances from lists, so it should be unique.","","        If the id is empty, this model instance is assumed to represent a new","        item that hasn't yet been saved.","","        If you would prefer to use a custom attribute as this model's id instead","        of using the `id` attribute (for example, maybe you'd rather use `_id`","        or `uid` as the primary id), you may set the `idAttribute` property to","        the name of your custom id attribute. The `id` attribute will then","        act as an alias for your custom attribute.","","        @attribute id","        @type String|Number|null","        @default `null`","        **/","        id: {value: null}","    }","});","","","}, '3.13.0', {\"requires\": [\"base-build\", \"escape\", \"json-parse\"]});","","}());"]};
  }
  var __cov_$HDKMKwqcR$Oyg$Q1rySiQ = __coverage__['build/model/model.js'];
  __cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['1']++;YUI.add('model',function(Y,NAME){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['1']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['2']++;var GlobalEnv=YUI.namespace('Env.Model'),Lang=Y.Lang,YArray=Y.Array,YObject=Y.Object,EVT_CHANGE='change',EVT_ERROR='error',EVT_LOAD='load',EVT_SAVE='save';__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['3']++;function Model(){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['2']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['4']++;Model.superclass.constructor.apply(this,arguments);}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['5']++;Y.Model=Y.extend(Model,Y.Base,{idAttribute:'id',_allowAdHocAttrs:true,_isYUIModel:true,initializer:function(config){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['3']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['6']++;this.changed={};__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['7']++;this.lastChange={};__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['8']++;this.lists=[];},destroy:function(options,callback){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['4']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['9']++;var self=this;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['10']++;if(typeof options==='function'){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['1'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['11']++;callback=options;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['12']++;options=null;}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['1'][1]++;}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['13']++;self.onceAfter('destroy',function(){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['5']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['14']++;function finish(err){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['6']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['15']++;if(!err){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['2'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['16']++;YArray.each(self.lists.concat(),function(list){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['7']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['17']++;list.remove(self,options);});}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['2'][1]++;}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['18']++;(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['3'][0]++,callback)&&(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['3'][1]++,callback.apply(null,arguments));}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['19']++;if((__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['5'][0]++,options)&&((__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['5'][1]++,options.remove)||(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['5'][2]++,options['delete']))){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['4'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['20']++;self.sync('delete',options,finish);}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['4'][1]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['21']++;finish();}});__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['22']++;return Model.superclass.destroy.call(self);},generateClientId:function(){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['8']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['23']++;(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['6'][0]++,GlobalEnv.lastId)||(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['6'][1]++,GlobalEnv.lastId=0);__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['24']++;return this.constructor.NAME+'_'+(GlobalEnv.lastId+=1);},getAsHTML:function(name){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['9']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['25']++;var value=this.get(name);__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['26']++;return Y.Escape.html(Lang.isValue(value)?(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['7'][0]++,String(value)):(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['7'][1]++,''));},getAsURL:function(name){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['10']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['27']++;var value=this.get(name);__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['28']++;return encodeURIComponent(Lang.isValue(value)?(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['8'][0]++,String(value)):(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['8'][1]++,''));},isModified:function(){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['11']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['29']++;return(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['9'][0]++,this.isNew())||(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['9'][1]++,!YObject.isEmpty(this.changed));},isNew:function(){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['12']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['30']++;return!Lang.isValue(this.get('id'));},load:function(options,callback){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['13']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['31']++;var self=this;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['32']++;if(typeof options==='function'){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['10'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['33']++;callback=options;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['34']++;options={};}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['10'][1]++;}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['35']++;(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['11'][0]++,options)||(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['11'][1]++,options={});__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['36']++;self.sync('read',options,function(err,response){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['14']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['37']++;var facade={options:options,response:response},parsed;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['38']++;if(err){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['12'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['39']++;facade.error=err;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['40']++;facade.src='load';__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['41']++;self.fire(EVT_ERROR,facade);}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['12'][1]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['42']++;if(!self._loadEvent){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['13'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['43']++;self._loadEvent=self.publish(EVT_LOAD,{preventable:false});}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['13'][1]++;}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['44']++;parsed=facade.parsed=self._parse(response);__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['45']++;self.setAttrs(parsed,options);__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['46']++;self.changed={};__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['47']++;self.fire(EVT_LOAD,facade);}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['48']++;(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['14'][0]++,callback)&&(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['14'][1]++,callback.apply(null,arguments));});__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['49']++;return self;},parse:function(response){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['15']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['50']++;if(typeof response==='string'){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['15'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['51']++;try{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['52']++;return Y.JSON.parse(response);}catch(ex){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['53']++;this.fire(EVT_ERROR,{error:ex,response:response,src:'parse'});__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['54']++;return null;}}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['15'][1]++;}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['55']++;return response;},save:function(options,callback){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['16']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['56']++;var self=this;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['57']++;if(typeof options==='function'){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['16'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['58']++;callback=options;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['59']++;options={};}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['16'][1]++;}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['60']++;(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['17'][0]++,options)||(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['17'][1]++,options={});__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['61']++;self._validate(self.toJSON(),function(err){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['17']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['62']++;if(err){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['18'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['63']++;(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['19'][0]++,callback)&&(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['19'][1]++,callback.call(null,err));__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['64']++;return;}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['18'][1]++;}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['65']++;self.sync(self.isNew()?(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['20'][0]++,'create'):(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['20'][1]++,'update'),options,function(err,response){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['18']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['66']++;var facade={options:options,response:response},parsed;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['67']++;if(err){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['21'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['68']++;facade.error=err;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['69']++;facade.src='save';__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['70']++;self.fire(EVT_ERROR,facade);}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['21'][1]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['71']++;if(!self._saveEvent){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['22'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['72']++;self._saveEvent=self.publish(EVT_SAVE,{preventable:false});}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['22'][1]++;}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['73']++;if(response){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['23'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['74']++;parsed=facade.parsed=self._parse(response);__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['75']++;self.setAttrs(parsed,options);}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['23'][1]++;}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['76']++;self.changed={};__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['77']++;self.fire(EVT_SAVE,facade);}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['78']++;(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['24'][0]++,callback)&&(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['24'][1]++,callback.apply(null,arguments));});});__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['79']++;return self;},set:function(name,value,options){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['19']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['80']++;var attributes={};__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['81']++;attributes[name]=value;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['82']++;return this.setAttrs(attributes,options);},setAttrs:function(attributes,options){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['20']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['83']++;var idAttribute=this.idAttribute,changed,e,key,lastChange,transaction;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['84']++;options=Y.merge(options);__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['85']++;transaction=options._transaction={};__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['86']++;if(idAttribute!=='id'){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['25'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['87']++;attributes=Y.merge(attributes);__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['88']++;if(YObject.owns(attributes,idAttribute)){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['26'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['89']++;attributes.id=attributes[idAttribute];}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['26'][1]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['90']++;if(YObject.owns(attributes,'id')){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['27'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['91']++;attributes[idAttribute]=attributes.id;}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['27'][1]++;}}}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['25'][1]++;}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['92']++;for(key in attributes){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['93']++;if(YObject.owns(attributes,key)){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['28'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['94']++;this._setAttr(key,attributes[key],options);}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['28'][1]++;}}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['95']++;if(!YObject.isEmpty(transaction)){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['29'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['96']++;changed=this.changed;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['97']++;lastChange=this.lastChange={};__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['98']++;for(key in transaction){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['99']++;if(YObject.owns(transaction,key)){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['30'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['100']++;e=transaction[key];__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['101']++;changed[key]=e.newVal;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['102']++;lastChange[key]={newVal:e.newVal,prevVal:e.prevVal,src:(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['31'][0]++,e.src)||(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['31'][1]++,null)};}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['30'][1]++;}}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['103']++;if(!options.silent){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['32'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['104']++;if(!this._changeEvent){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['33'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['105']++;this._changeEvent=this.publish(EVT_CHANGE,{preventable:false});}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['33'][1]++;}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['106']++;options.changed=lastChange;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['107']++;this.fire(EVT_CHANGE,options);}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['32'][1]++;}}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['29'][1]++;}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['108']++;return this;},sync:function(){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['21']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['109']++;var callback=YArray(arguments,0,true).pop();__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['110']++;if(typeof callback==='function'){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['34'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['111']++;callback();}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['34'][1]++;}},toJSON:function(){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['22']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['112']++;var attrs=this.getAttrs();__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['113']++;delete attrs.clientId;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['114']++;delete attrs.destroyed;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['115']++;delete attrs.initialized;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['116']++;if(this.idAttribute!=='id'){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['35'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['117']++;delete attrs.id;}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['35'][1]++;}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['118']++;return attrs;},undo:function(attrNames,options){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['23']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['119']++;var lastChange=this.lastChange,idAttribute=this.idAttribute,toUndo={},needUndo;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['120']++;(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['36'][0]++,attrNames)||(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['36'][1]++,attrNames=YObject.keys(lastChange));__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['121']++;YArray.each(attrNames,function(name){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['24']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['122']++;if(YObject.owns(lastChange,name)){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['37'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['123']++;name=name===idAttribute?(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['38'][0]++,'id'):(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['38'][1]++,name);__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['124']++;needUndo=true;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['125']++;toUndo[name]=lastChange[name].prevVal;}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['37'][1]++;}});__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['126']++;return needUndo?(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['39'][0]++,this.setAttrs(toUndo,options)):(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['39'][1]++,this);},validate:function(attrs,callback){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['25']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['127']++;(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['40'][0]++,callback)&&(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['40'][1]++,callback());},addAttr:function(name,config,lazy){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['26']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['128']++;var idAttribute=this.idAttribute,idAttrCfg,id;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['129']++;if((__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['42'][0]++,idAttribute)&&(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['42'][1]++,name===idAttribute)){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['41'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['130']++;idAttrCfg=(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['43'][0]++,this._isLazyAttr('id'))||(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['43'][1]++,this._getAttrCfg('id'));__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['131']++;id=config.value===config.defaultValue?(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['44'][0]++,null):(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['44'][1]++,config.value);__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['132']++;if(!Lang.isValue(id)){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['45'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['133']++;id=idAttrCfg.value===idAttrCfg.defaultValue?(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['46'][0]++,null):(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['46'][1]++,idAttrCfg.value);__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['134']++;if(!Lang.isValue(id)){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['47'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['135']++;id=Lang.isValue(config.defaultValue)?(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['48'][0]++,config.defaultValue):(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['48'][1]++,idAttrCfg.defaultValue);}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['47'][1]++;}}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['45'][1]++;}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['136']++;config.value=id;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['137']++;if(idAttrCfg.value!==id){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['49'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['138']++;idAttrCfg.value=id;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['139']++;if(this._isLazyAttr('id')){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['50'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['140']++;this._state.add('id','lazy',idAttrCfg);}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['50'][1]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['141']++;this._state.add('id','value',id);}}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['49'][1]++;}}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['41'][1]++;}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['142']++;return Model.superclass.addAttr.apply(this,arguments);},_parse:function(response){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['27']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['143']++;return this.parse(response);},_validate:function(attributes,callback){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['28']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['144']++;var self=this;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['145']++;function handler(err){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['29']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['146']++;if(Lang.isValue(err)){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['51'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['147']++;self.fire(EVT_ERROR,{attributes:attributes,error:err,src:'validate'});__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['148']++;callback(err);__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['149']++;return;}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['51'][1]++;}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['150']++;callback();}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['151']++;if(self.validate.length===1){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['52'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['152']++;handler(self.validate(attributes,handler));}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['52'][1]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['153']++;self.validate(attributes,handler);}},_setAttrVal:function(attrName,subAttrName,prevVal,newVal,opts,attrCfg){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.f['30']++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['154']++;var didChange=Model.superclass._setAttrVal.apply(this,arguments),transaction=(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['53'][0]++,opts)&&(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['53'][1]++,opts._transaction),initializing=(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['54'][0]++,attrCfg)&&(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['54'][1]++,attrCfg.initializing);__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['155']++;if((__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['56'][0]++,didChange)&&(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['56'][1]++,transaction)&&(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['56'][2]++,!initializing)){__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['55'][0]++;__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['156']++;transaction[attrName]={newVal:this.get(attrName),prevVal:prevVal,src:(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['57'][0]++,opts.src)||(__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['57'][1]++,null)};}else{__cov_$HDKMKwqcR$Oyg$Q1rySiQ.b['55'][1]++;}__cov_$HDKMKwqcR$Oyg$Q1rySiQ.s['157']++;return didChange;}},{NAME:'model',ATTRS:{clientId:{valueFn:'generateClientId',readOnly:true},id:{value:null}}});},'3.13.0',{'requires':['base-build','escape','json-parse']});
  